|
@@ -24,9 +24,11 @@ import org.springblade.business.service.IContractTreeDrawingsService;
|
|
|
import org.springblade.business.service.ITreeContractFirstService;
|
|
|
import org.springblade.business.utils.FileUtils;
|
|
|
import org.springblade.business.vo.*;
|
|
|
+import org.springblade.common.utils.CommonUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.jackson.JsonUtil;
|
|
@@ -42,6 +44,7 @@ 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.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.entity.DictBiz;
|
|
|
import org.springblade.system.feign.IDictBizClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -94,11 +97,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final RecycleBinClient recycleBinClient;
|
|
|
|
|
|
+ private final NewIOSSClient newIOSSClient;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初始化合同段导图树
|
|
|
+ */
|
|
|
@PostMapping("/initMappingStructureTree")
|
|
|
@ApiOperationSupport(order = 27)
|
|
|
@ApiOperation(value = "初始化合同段导图树(只有接口,功能未写)")
|
|
|
public R<List<WbsTreeContractTreeVOS>> initMappingStructureTree(@RequestBody List<String> ids){
|
|
|
-
|
|
|
+ System.out.println(ids);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -418,6 +426,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 21)
|
|
|
@ApiOperation(value = "本地验签")
|
|
|
public R<Boolean> localVerify(@RequestParam String ids){
|
|
|
+ System.out.println(ids);
|
|
|
return R.data(false);
|
|
|
}
|
|
|
|
|
@@ -446,7 +455,23 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperationSupport(order = 20)
|
|
|
@ApiOperation(value = "批量打印")
|
|
|
public R<String> batchPrint(@RequestParam String ids) {
|
|
|
- return R.data(null);
|
|
|
+ //获取勾选的数据
|
|
|
+ List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(ids.split(",")));
|
|
|
+ //获取pdf
|
|
|
+ List<String> pdfList = queries.stream().map(query -> StringUtils.isNotEmpty(query.getEVisaPdfUrl()) ? query.getEVisaPdfUrl() : query.getPdfUrl()).distinct().collect(Collectors.toList());
|
|
|
+ pdfList.removeIf(StringUtils::isEmpty);
|
|
|
+ //执行合并
|
|
|
+ String mergeName = SnowFlakeUtil.getId() + ".pdf", mergeUrl = "/Users/doc/print/" + mergeName;
|
|
|
+ FileUtils.mergePdfPublicMethods(pdfList, mergeUrl);
|
|
|
+
|
|
|
+ //上传
|
|
|
+ BladeFile bladeFile = this.newIOSSClient.uploadFile(mergeName, mergeUrl);
|
|
|
+ if(StringUtils.isNotEmpty(bladeFile.getLink())){
|
|
|
+ //执行本地文件删除
|
|
|
+ CommonUtil.removeFile(Arrays.asList(mergeUrl.split(",")));
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(bladeFile.getLink());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -482,7 +507,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiOperation(value = "批量废除")
|
|
|
public R<Boolean> batchAbolish(@RequestParam String ids){
|
|
|
//获取所有相关任务记录
|
|
|
- List<Task> taskList = this.taskClient.queryTaskListByFormDataId(ids);
|
|
|
+ List<Task> taskList = this.taskClient.queryTaskListByFormDataId(ids);
|
|
|
if(taskList != null && taskList.size() > 0){
|
|
|
try{
|
|
|
//执行废除
|
|
@@ -500,8 +525,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
this.informationQueryService.update(wrapper.in(InformationQuery::getId, Arrays.asList(task.getFormDataId().split(","))));
|
|
|
}
|
|
|
+
|
|
|
+ List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
|
|
|
+ String title = "批量废除";
|
|
|
+ if(queries != null && queries.size() > 0){
|
|
|
+ title = queries.stream().map(InformationQuery::getName).distinct().collect(Collectors.joining());
|
|
|
+ }
|
|
|
+
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(6, "资料管理", "工序资料", task.getFormDataId());
|
|
|
+ this.operationLogClient.saveUserOperationLog(6, "资料管理", "工序资料", task.getFormDataId(), title);
|
|
|
}
|
|
|
return R.data(true, "废除成功");
|
|
|
}catch (Exception e){
|
|
@@ -549,8 +581,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
e.printStackTrace();
|
|
|
return R.data(300, false, "上报失败");
|
|
|
}
|
|
|
+
|
|
|
+ List<InformationQuery> queries = this.informationQueryService.getBaseMapper().selectBatchIds(Arrays.asList(startTaskVO.getIds().split(",")));
|
|
|
+ String title = "批量上报";
|
|
|
+ if(queries != null && queries.size() > 0){
|
|
|
+ title = queries.stream().map(InformationQuery::getName).distinct().collect(Collectors.joining());
|
|
|
+ }
|
|
|
+
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(5, "资料管理", "工序资料", startTaskVO.getIds());
|
|
|
+ this.operationLogClient.saveUserOperationLog(5, "资料管理", "工序资料", startTaskVO.getIds(), title);
|
|
|
return R.data(true);
|
|
|
}
|
|
|
}
|
|
@@ -736,7 +775,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- return this.saveOrCopyNodeTree(saveList, saveLedger);
|
|
|
+ return this.saveOrCopyNodeTree(saveList, saveLedger, 32);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -952,8 +991,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(StringUtils.isEmpty(node.getDeptName()) || "null".equals(String.valueOf(node.getPKeyId())) || StringUtils.isEmpty(String.valueOf(node.getPKeyId()))){
|
|
|
return R.data(-1, false , "缺少参数");
|
|
|
}
|
|
|
+
|
|
|
+ WbsTreeContract queries = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(pKeyId);
|
|
|
+
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(3, "资料管理", "工序资料", pKeyId);
|
|
|
+ this.operationLogClient.saveUserOperationLog(3, "资料管理", "工序资料", pKeyId, StringUtils.isNotEmpty(queries.getFullName()) ? queries.getFullName() : queries.getDeptName());
|
|
|
return R.data(this.wbsTreeContractClient.updateContractNodeParameter(node));
|
|
|
}
|
|
|
|
|
@@ -989,6 +1031,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
List<Long> removeList = removeNodeList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList());
|
|
|
//拼接
|
|
|
ids = ids + "," + String.join(",", JSONArray.parseArray(JSONObject.toJSONString(removeList), String.class));
|
|
|
+ String nodeName = StringUtils.isNotEmpty(removeNode.getFullName()) ? removeNode.getFullName() : removeNode.getDeptName() + "," + removeNodeList.stream().map(wbs -> StringUtils.isNotEmpty(wbs.getFullName()) ? wbs.getFullName() : wbs.getDeptName()).collect(Collectors.joining());
|
|
|
|
|
|
//获取当前节点下所有填报节点
|
|
|
List<QueryProcessDataVO> queryProcess = this.informationQueryService.queryProcessDataByParentIdAndContractId(removeNode.getId().toString(), 1, removeNode.getContractId());
|
|
@@ -1008,7 +1051,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(4, "资料管理", "工序资料", ids);
|
|
|
+ this.operationLogClient.saveUserOperationLog(4, "资料管理", "工序资料", ids, nodeName);
|
|
|
//保存进回收站
|
|
|
this.recycleBinClient.saveDelBusinessData(ids, removeNode.getDeptName(), 2, "", removeNode.getProjectId(), removeNode.getContractId());
|
|
|
|
|
@@ -1170,7 +1213,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- return this.saveOrCopyNodeTree(saveList, saveLedger);
|
|
|
+ return this.saveOrCopyNodeTree(saveList, saveLedger, 2);
|
|
|
}
|
|
|
|
|
|
private List<WbsTreePrivate> unifiedCode(List<AddContractTreeNodeVO.Node> allSelectedNodeList, WbsTreeContract treeContract){
|
|
@@ -1185,7 +1228,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
@NotNull
|
|
|
- private R<Boolean> saveOrCopyNodeTree(List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger) {
|
|
|
+ private R<Boolean> saveOrCopyNodeTree(List<WbsTreeContract> saveList, List<ConstructionLedger> saveLedger, Integer operationType) {
|
|
|
if(saveList.size() > 0){
|
|
|
//保存施工日志
|
|
|
if(saveLedger.size() > 0){
|
|
@@ -1193,7 +1236,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
try{
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(2, "资料管理", "工序资料", String.join(",", JSONArray.parseArray(JSONObject.toJSONString(saveList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList())), String.class)));
|
|
|
+ this.operationLogClient.saveUserOperationLog(operationType, "资料管理", "工序资料",
|
|
|
+ String.join(",", JSONArray.parseArray(JSONObject.toJSONString(saveList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList())), String.class)),
|
|
|
+ saveList.stream().map(wbs -> StringUtils.isNotEmpty(wbs.getFullName()) ? wbs.getFullName() : wbs.getDeptName()).collect(Collectors.joining()));
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -1407,63 +1453,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation){
|
|
|
- List<WbsTreeContractTreeVOS> rootTreeNode;
|
|
|
-
|
|
|
- //获取合同段,检查是否是监理合同段
|
|
|
- ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
|
|
|
- if(new Integer("2").equals(contractInfo.getContractType())){
|
|
|
- //监理合同段,需要获取关联的施工方合同段根节点数据
|
|
|
- rootTreeNode = this.wbsTreeContractClient.lazyTree(StringUtils.isNotEmpty(parentId) ? Long.parseLong(parentId) : 0, contractId, contractIdRelation, contractInfo.getContractType());
|
|
|
- } else {
|
|
|
- if(com.alibaba.nacos.common.utils.StringUtils.isEmpty(parentId)){
|
|
|
- //为空,说明初始化
|
|
|
- //获取根节点
|
|
|
- rootTreeNode = this.clientTreePublicCodeClient.queryContractWbsTreeByContractIdAndType(contractId, 1, "0");
|
|
|
- } else {
|
|
|
- //不为空,获取其下子节点
|
|
|
- rootTreeNode = this.wbsTreeContractClient.queryContractWbsTreeByContractIdAndType(contractId, 1, parentId);
|
|
|
- }
|
|
|
- }
|
|
|
+ List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation);
|
|
|
+ rootTreeNode = rootTreeNode.stream().filter(vo -> vo.getDeptCategory() != 111).collect(Collectors.toList());
|
|
|
|
|
|
- //其他参数
|
|
|
- if(rootTreeNode != null && rootTreeNode.size() > 0){
|
|
|
- //获取当前父节点下所有工序节点及填报资料
|
|
|
- List<QueryProcessDataVO> queryDataResult;
|
|
|
- if(new Integer("2").equals(contractInfo.getContractType())){
|
|
|
- queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 2, contractIdRelation);
|
|
|
- } else {
|
|
|
- queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(parentId, 1, contractId);
|
|
|
- }
|
|
|
-
|
|
|
- rootTreeNode.forEach(vo -> {
|
|
|
- String primaryKeyId = new Integer("2").equals(contractInfo.getContractType()) ? vo.getId().toString() : vo.getPrimaryKeyId();
|
|
|
-
|
|
|
- if(new Integer("1").equals(contractInfo.getContractType())){
|
|
|
- if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
|
|
|
- vo.setTitle(contractInfo.getContractName());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //获取上传的图纸
|
|
|
- ContractTreeDrawings drawings = this.contractTreeDrawingsService.queryCurrentNodeDrawings(primaryKeyId);
|
|
|
- if(drawings != null){
|
|
|
- //主键
|
|
|
- vo.setDrawingsId(drawings.getId());
|
|
|
- //文件路径
|
|
|
- vo.setFileUrl(drawings.getFileUrl());
|
|
|
- }
|
|
|
-
|
|
|
- //处理颜色
|
|
|
- if(queryDataResult != null && queryDataResult.size() > 0){
|
|
|
- this.setNodeColor(vo, queryDataResult, true);
|
|
|
- }
|
|
|
-
|
|
|
- //判断当前节点是否被标记为首件
|
|
|
- TreeContractFirst first = this.treeContractFirstService.getOne(Wrappers.<TreeContractFirst>lambdaQuery().eq(TreeContractFirst::getIsDeleted, 0).eq(TreeContractFirst::getWbsNodeId, primaryKeyId));
|
|
|
- vo.setIsFirst(first != null);
|
|
|
- });
|
|
|
- }
|
|
|
- rootTreeNode = rootTreeNode.stream().filter(vo->vo.getDeptCategory()!=111).collect(Collectors.toList());
|
|
|
return R.data(rootTreeNode);
|
|
|
}
|
|
|
|
|
@@ -1589,6 +1581,17 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByFirstInfo(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation){
|
|
|
+ List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation);
|
|
|
+ //查询被标记为首件的数据
|
|
|
+ rootTreeNode = rootTreeNode.stream().filter(WbsTreeContractTreeVOS::getIsFirst).collect(Collectors.toList());
|
|
|
+
|
|
|
+ return R.data(rootTreeNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询合同段划分树公共代码
|
|
|
+ */
|
|
|
+ private List<WbsTreeContractTreeVOS> queryContractTree(String parentId, String contractId, String contractIdRelation){
|
|
|
List<WbsTreeContractTreeVOS> rootTreeNode;
|
|
|
|
|
|
//获取合同段,检查是否是监理合同段
|
|
@@ -1646,8 +1649,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- rootTreeNode = rootTreeNode.stream().filter(wbsbenan->wbsbenan.getIsFirst()==true).collect(Collectors.toList());
|
|
|
- return R.data(rootTreeNode);
|
|
|
+ return rootTreeNode;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|