|
|
@@ -2,8 +2,10 @@ package com.siwei.apply.controller;
|
|
|
|
|
|
import com.siwei.apply.domain.NodeAttachment;
|
|
|
import com.siwei.apply.domain.ProjectWorkflow;
|
|
|
+import com.siwei.apply.domain.res.TdgyRes;
|
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
|
import com.siwei.apply.service.ProjectService;
|
|
|
+import com.siwei.apply.service.TdgyService;
|
|
|
import com.siwei.apply.utils.ServiceFileUtil;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
|
@@ -29,6 +31,10 @@ public class NodeAttachmentController extends BaseController {
|
|
|
private ProjectService projectService;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TdgyService tdgyService;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 处理文件并保存附件信息
|
|
|
*
|
|
|
@@ -142,7 +148,7 @@ public class NodeAttachmentController extends BaseController {
|
|
|
return R.fail("nodeId不能为空");
|
|
|
}
|
|
|
//获取附件信息及依赖关系
|
|
|
- NodeAttachment nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId);
|
|
|
+ NodeAttachment nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,null);
|
|
|
return R.ok(nodeAttachment);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("查询节点附件信息异常", e);
|
|
|
@@ -258,28 +264,71 @@ public class NodeAttachmentController extends BaseController {
|
|
|
NodeAttachment nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
|
|
|
//增加一条空目录结构
|
|
|
if (Objects.isNull(nodeAttachment)) {
|
|
|
- nodeAttachmentService.addDefaultAttachment(projectId,nodeId);
|
|
|
+ nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
|
|
|
}
|
|
|
//这里重新获取依赖关系
|
|
|
- nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId);
|
|
|
+ nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,null);
|
|
|
return R.ok(nodeAttachment);
|
|
|
} catch (Exception e) {
|
|
|
logger.error("初始化附件信息异常", e);
|
|
|
- return R.fail(502,"初始化附件信息异常:" + e.getMessage());
|
|
|
+ return R.fail(502, "初始化附件信息异常:" + e.getMessage());
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 切换供地类型,出让,划拨
|
|
|
+ * 获取不同附件依赖关系
|
|
|
+ * 1.出让
|
|
|
+ * 2.划拨
|
|
|
+ */
|
|
|
+ @PostMapping("/changeTypeNodeAttachment")
|
|
|
+ public R<NodeAttachment> getNodeAttachmentAfterChangeType(@RequestBody Map<String, String> requestBody) {
|
|
|
+ try {
|
|
|
+ String nodeId = requestBody.get("nodeId");
|
|
|
+ String projectId = requestBody.get("projectId");
|
|
|
+ String gdType = requestBody.get("gdType");
|
|
|
+ if (StringUtils.isBlank(gdType)) {
|
|
|
+ return R.fail(502,"gdType不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(nodeId)) {
|
|
|
+ return R.fail(502,"nodeId不能为空");
|
|
|
+ }
|
|
|
+ NodeAttachment nodeAttachment = null;
|
|
|
+ TdgyRes tdgyRes = tdgyService.getById(nodeId);
|
|
|
+ if (Objects.nonNull(tdgyRes)) {
|
|
|
+ String dbGdType = tdgyRes.getGdType();
|
|
|
+ //如果当前类型与库中一致,则直接取
|
|
|
+ if(("出让".equals(dbGdType) && "1".equals(gdType)) || ("划拨".equals(dbGdType) && "2".equals(gdType))){
|
|
|
+ // 1.如果出让
|
|
|
+ nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
|
|
|
+ //增加一条空目录结构
|
|
|
+ if (Objects.isNull(nodeAttachment)) {
|
|
|
+ nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
|
|
|
+ }
|
|
|
+ //这里重新获取依赖关系
|
|
|
+ nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
|
|
|
+ }else {
|
|
|
+ //1.先删除当前节点
|
|
|
+ nodeAttachmentService.deleteByNodeId(nodeId);
|
|
|
+ nodeAttachmentService.addDefaultAttachment(projectId, nodeId);
|
|
|
+ //这里重新获取依赖关系
|
|
|
+ nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ return R.ok(nodeAttachment);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("初始化附件信息异常", e);
|
|
|
+ return R.fail(502,"初始化附件信息异常:" + e.getMessage());
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|