|
@@ -2,11 +2,13 @@ package com.siwei.apply.controller;
|
|
|
|
|
|
|
|
import com.siwei.apply.domain.NodeAttachment;
|
|
import com.siwei.apply.domain.NodeAttachment;
|
|
|
import com.siwei.apply.domain.ProjectWorkflow;
|
|
import com.siwei.apply.domain.ProjectWorkflow;
|
|
|
|
|
+import com.siwei.apply.domain.YdbpData;
|
|
|
import com.siwei.apply.domain.res.TdgyRes;
|
|
import com.siwei.apply.domain.res.TdgyRes;
|
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
import com.siwei.apply.enums.AloneWorkFlowEnum;
|
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
import com.siwei.apply.service.NodeAttachmentService;
|
|
|
import com.siwei.apply.service.ProjectService;
|
|
import com.siwei.apply.service.ProjectService;
|
|
|
import com.siwei.apply.service.TdgyService;
|
|
import com.siwei.apply.service.TdgyService;
|
|
|
|
|
+import com.siwei.apply.service.YdbpDataService;
|
|
|
import com.siwei.apply.utils.ServiceFileUtil;
|
|
import com.siwei.apply.utils.ServiceFileUtil;
|
|
|
import com.siwei.common.core.domain.R;
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
import com.siwei.common.core.utils.StringUtils;
|
|
@@ -35,6 +37,11 @@ public class NodeAttachmentController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TdgyService tdgyService;
|
|
private TdgyService tdgyService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private YdbpDataService ydbpDataService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 处理文件并保存附件信息
|
|
* 处理文件并保存附件信息
|
|
@@ -55,18 +62,28 @@ public class NodeAttachmentController extends BaseController {
|
|
|
if (nodeId == null || nodeId.trim().isEmpty()) {
|
|
if (nodeId == null || nodeId.trim().isEmpty()) {
|
|
|
return R.fail("nodeId不能为空");
|
|
return R.fail("nodeId不能为空");
|
|
|
}
|
|
}
|
|
|
- ProjectWorkflow projectWorkflow = projectService.getProjectWorkflowByNodeId(projectId,nodeId);
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String tableName = "";
|
|
|
String gdType = "";
|
|
String gdType = "";
|
|
|
|
|
+ //YdbpData data = ydbpDataService.getById(id);
|
|
|
|
|
+ ProjectWorkflow projectWorkflow = projectService.getProjectWorkflowByNodeId(projectId,nodeId);
|
|
|
if(Objects.nonNull(projectWorkflow)){
|
|
if(Objects.nonNull(projectWorkflow)){
|
|
|
if(AloneWorkFlowEnum.NODE_2.getTableName().equals(projectWorkflow.getNodeTableName())){
|
|
if(AloneWorkFlowEnum.NODE_2.getTableName().equals(projectWorkflow.getNodeTableName())){
|
|
|
TdgyRes tdgy = tdgyService.getById(nodeId);
|
|
TdgyRes tdgy = tdgyService.getById(nodeId);
|
|
|
gdType = tdgy.getGdType();
|
|
gdType = tdgy.getGdType();
|
|
|
gdType= "出让".equals(gdType) ? "1" : "划拨".equals(gdType)? "2":"1";
|
|
gdType= "出让".equals(gdType) ? "1" : "划拨".equals(gdType)? "2":"1";
|
|
|
}
|
|
}
|
|
|
|
|
+ tableName = projectWorkflow.getNodeTableName();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ YdbpData data = ydbpDataService.getById(nodeId);
|
|
|
|
|
+ if(Objects.nonNull(data)){
|
|
|
|
|
+ //tableName = AloneWorkFlowEnum.NODE_9.getTableName();
|
|
|
|
|
+ tableName = AloneWorkFlowEnum.NODE_1.getTableName();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String id = nodeAttachmentService.processFileAndSave(filePath,projectWorkflow.getNodeTableName(),gdType);
|
|
|
|
|
|
|
+ String id = nodeAttachmentService.processFileAndSave(filePath,tableName,gdType);
|
|
|
nodeAttachmentService.modifyAttachmentInfo(projectId,nodeId,id);
|
|
nodeAttachmentService.modifyAttachmentInfo(projectId,nodeId,id);
|
|
|
if (id != null) {
|
|
if (id != null) {
|
|
|
Map<String, String> responseData = new HashMap<>();
|
|
Map<String, String> responseData = new HashMap<>();
|