|
@@ -31,9 +31,13 @@ import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
+import org.springblade.manager.entity.WbsTreeContract;
|
|
|
+import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.feign.ContractClient;
|
|
|
import org.springblade.manager.feign.WbsTreeContractClient;
|
|
|
+import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
|
+import org.springblade.manager.vo.WbsTreePrivateVO;
|
|
|
import org.springblade.system.entity.DictBiz;
|
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -45,25 +49,132 @@ import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * 资料查询控制器
|
|
|
+ * 资料填报及查询控制器
|
|
|
*
|
|
|
* @author BladeX
|
|
|
* @since 2022-06-08
|
|
|
*/
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
-@RequestMapping("/informationQuery")
|
|
|
+@RequestMapping("/informationWriteQuery")
|
|
|
@Api(tags = "资料查询接口")
|
|
|
-public class InformationQueryController extends BladeController {
|
|
|
+public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final ContractClient contractClient;
|
|
|
|
|
|
private final WbsTreeContractClient wbsTreeContractClient;
|
|
|
|
|
|
+ private final WbsTreePrivateClient wbsTreePrivateClient;
|
|
|
+
|
|
|
private final IInformationQueryService informationQueryService;
|
|
|
|
|
|
private final IDictBizClient dictBizClient;
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改节点信息
|
|
|
+ * @param node 节点信息
|
|
|
+ * @return 修改结果
|
|
|
+ */
|
|
|
+ @PostMapping("/updateContractNodeParameter")
|
|
|
+ @ApiOperationSupport(order = 13)
|
|
|
+ @ApiOperation(value = "修改节点信息")
|
|
|
+ @ApiImplicitParam(name = "node", value = "节点信息(目前只允许修改名称)")
|
|
|
+ public R<Boolean> updateContractNodeParameter(@RequestBody WbsTreeContract node){
|
|
|
+ //只允许修改节点名称
|
|
|
+ if(StringUtils.isEmpty(node.getDeptName())){
|
|
|
+ return R.data(false);
|
|
|
+ }
|
|
|
+ return R.data(this.wbsTreeContractClient.updateContractNodeParameter(node));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取节点信息
|
|
|
+ * @param primaryKeyId 节点的primaryKeyId
|
|
|
+ * @return 节点信息
|
|
|
+ */
|
|
|
+ @GetMapping("/getContractNodeByPrimaryKeyId")
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
+ @ApiOperation(value = "获取节点信息")
|
|
|
+ @ApiImplicitParam(name = "primaryKeyId", value = "节点的primaryKeyId")
|
|
|
+ public R<WbsTreeContract> getContractNodeByPrimaryKeyId(@RequestParam String primaryKeyId){
|
|
|
+ return R.data(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除节点
|
|
|
+ * @param ids 节点的primaryKeyId
|
|
|
+ * @return 删除结果
|
|
|
+ */
|
|
|
+ @PostMapping("/removeContractTreeNode")
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
+ @ApiOperation(value = "删除节点")
|
|
|
+ @ApiImplicitParam(name = "ids", value = "节点的primaryKeyId")
|
|
|
+ public R<Boolean> removeContractTreeNode(@RequestParam String ids){
|
|
|
+ return R.data(this.wbsTreeContractClient.removeContractTreeNode(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增子节点
|
|
|
+ * @param contractNodePrimaryKeyId 新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId
|
|
|
+ * @param projectNodePrimaryKeyId 被选中的新增节点
|
|
|
+ * @return 新增结果
|
|
|
+ */
|
|
|
+ @PostMapping("/saveContractTreeNode")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ @ApiOperation(value = "新增节点及其子节点")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "contractNodePrimaryKeyId", value = "新增的节点所在位置,即当前点出菜单栏的节点PrimaryKeyId", required = true),
|
|
|
+ @ApiImplicitParam(name = "projectNodePrimaryKeyId", value = "被选中的新增节点", required = true)
|
|
|
+ })
|
|
|
+ public R<Boolean> saveContractTreeNode(@RequestParam String contractNodePrimaryKeyId, @RequestParam String projectNodePrimaryKeyId){
|
|
|
+ //先获取当前节点的信息
|
|
|
+ WbsTreeContract treeContract = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(contractNodePrimaryKeyId));
|
|
|
+ //判断新增
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 懒加载项目级工程划分树
|
|
|
+ * @param projectId 项目ID
|
|
|
+ * @param id 节点ID
|
|
|
+ * @return 结果集
|
|
|
+ */
|
|
|
+ @PostMapping("/queryWbsTreePrivateByProjectIdAndId")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "懒加载项目级工程划分树")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "projectId", value = "项目ID"),
|
|
|
+ @ApiImplicitParam(name = "id", value = "点击节点ID")
|
|
|
+ })
|
|
|
+ public R<List<WbsTreePrivateVO>> queryWbsTreePrivateByProjectIdAndId(@RequestParam String projectId, @RequestParam String id){
|
|
|
+ return R.data(this.wbsTreePrivateClient.queryWbsTreePrivateByProjectIdAndId(projectId, Long.parseLong(id)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取与当前节点平级的项目级节点
|
|
|
+ * @param primaryKeyId 主键
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @PostMapping("/queryPeersNode")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "获取与当前节点平级的项目级节点")
|
|
|
+ @ApiImplicitParam(name = "primaryKeyId", value = "需要新增子节点的节点ID,即当前点出菜单栏的节点ID")
|
|
|
+ public R<WbsTreePrivate> queryPeersNode(@RequestParam String primaryKeyId){
|
|
|
+ if(StringUtils.isEmpty(primaryKeyId) || "null".equals(primaryKeyId)){
|
|
|
+ return R.data(null);
|
|
|
+ }
|
|
|
+
|
|
|
+ //首先获取当前节点信息
|
|
|
+ WbsTreeContract treeContract = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));
|
|
|
+ //获取与其平级对应的项目级节点
|
|
|
+ WbsTreePrivate treePrivate = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(treeContract.getProjectId(), treeContract.getId());
|
|
|
+
|
|
|
+ return R.data(treePrivate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取流程状态分类和文件类型分类
|
|
|
*/
|