|
@@ -36,11 +36,9 @@ import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.evisa.feign.EVisaClient;
|
|
|
import org.springblade.evisa.vo.CertBeanVO;
|
|
|
-import org.springblade.manager.entity.ContractInfo;
|
|
|
-import org.springblade.manager.entity.ContractRelationJlyz;
|
|
|
-import org.springblade.manager.entity.WbsTreeContract;
|
|
|
-import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
+import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.feign.ContractClient;
|
|
|
+import org.springblade.manager.feign.ProjectClient;
|
|
|
import org.springblade.manager.feign.WbsTreeContractClient;
|
|
|
import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
@@ -101,6 +99,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final MessageWarningClient messageWarningClient;
|
|
|
|
|
|
+ private final ProjectClient projectClient;
|
|
|
+
|
|
|
/**
|
|
|
* 初始化合同段导图树
|
|
|
*/
|
|
@@ -564,12 +564,34 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(queries != null && queries.size() > 0){
|
|
|
title = queries.stream().map(InformationQuery::getName).distinct().collect(Collectors.joining());
|
|
|
|
|
|
+ List<Long> projectIds = queries.stream().map(InformationQuery::getProjectId).distinct().collect(Collectors.toList());
|
|
|
+ List<Long> contractIds = queries.stream().map(InformationQuery::getContractId).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<ProjectInfo> projects = this.projectClient.queryProjectList(JSONArray.parseArray(JSONObject.toJSONString(projectIds), String.class));
|
|
|
+ List<ContractInfo> contracts = this.contractClient.queryContractListByIds(contractIds);
|
|
|
+
|
|
|
+ Map<String, ProjectInfo> projectMap = new HashMap<>();
|
|
|
+ Map<String, ContractInfo> contractMap = new HashMap<>();
|
|
|
+ projects.forEach(project -> projectMap.put(project.getId().toString(), project));
|
|
|
+ contracts.forEach(contract -> contractMap.put(contract.getId().toString(), contract));
|
|
|
+
|
|
|
for(InformationQuery query : queries){
|
|
|
if(StringUtils.isNotEmpty(query.getFileUserIdAndName())){
|
|
|
String[] userArray = query.getFileUserIdAndName().split(",");
|
|
|
for(String str : userArray){
|
|
|
String[] strs = str.split("-");
|
|
|
try{
|
|
|
+ String projectName = "", contractName = "";
|
|
|
+ if(projectMap.containsKey(query.getProjectId().toString())){
|
|
|
+ ProjectInfo project = projectMap.get(query.getProjectId().toString());
|
|
|
+ projectName = StringUtils.isNotEmpty(project.getProjectAlias()) ? project.getProjectAlias() : project.getProjectName();
|
|
|
+ }
|
|
|
+ if(contractMap.containsKey(query.getContractId().toString())){
|
|
|
+ ContractInfo contract = contractMap.get(query.getContractId().toString());
|
|
|
+ contractName = contract.getContractName();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//保存通知记录
|
|
|
this.messageWarningClient.savePushUserMessageWarning(
|
|
|
new MessageWarningVO(
|
|
@@ -578,7 +600,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//废除通知
|
|
|
3,
|
|
|
//内容
|
|
|
- AuthUtil.getNickName() + "废除了【" + query.getName() + "】",
|
|
|
+ projectName + contractName + "的用户【" + AuthUtil.getNickName() + "】废除了【" + query.getName() + "】",
|
|
|
//推送的目标人
|
|
|
Long.parseLong(strs[0]),
|
|
|
//默认未读
|
|
@@ -590,13 +612,17 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(6, "资料管理", "工序资料", Func.toStrList(task.getFormDataId()), title);
|
|
|
+ try{
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
|
|
|
+ json.put("operationObjName", title);
|
|
|
+
|
|
|
+ //保存操作记录
|
|
|
+ this.operationLogClient.saveUserOperationLog(6, "资料管理", "工序资料", json);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
return R.data(true, "废除成功");
|
|
|
}catch (Exception e){
|
|
@@ -651,8 +677,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
title = queries.stream().map(InformationQuery::getName).distinct().collect(Collectors.joining());
|
|
|
}
|
|
|
|
|
|
- //保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(5, "资料管理", "工序资料", Func.toStrList(startTaskVO.getIds()), title);
|
|
|
+ try{
|
|
|
+ //保存操作记录
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", Func.toStrList(startTaskVO.getIds()));
|
|
|
+ json.put("operationObjName", title);
|
|
|
+
|
|
|
+ this.operationLogClient.saveUserOperationLog(5, "资料管理", "工序资料", json);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return R.data(true);
|
|
|
}
|
|
|
}
|
|
@@ -696,11 +730,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//首先查询需要复制的节点及其下级所有子节点的信息
|
|
|
WbsTreeContract needCopyNode = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(vo.getNeedCopyPrimaryKeyId());
|
|
|
|
|
|
+ //获取当前合同段所有节点
|
|
|
+
|
|
|
List<WbsTreeContract> parentList = new ArrayList<>(), childList = new ArrayList<>(), allList = new ArrayList<>(), saveList = new ArrayList<>();
|
|
|
//新增施工台账
|
|
|
List<ConstructionLedger> saveLedger = new ArrayList<>();
|
|
|
|
|
|
parentList.add(needCopyNode);
|
|
|
+
|
|
|
+// this.wbsTreeContractClient.searchContractTree(needCopyNode.getContractId());
|
|
|
+
|
|
|
//查询所有有效子节点
|
|
|
this.foreachQueryChildContract(parentList, childList);
|
|
|
allList.addAll(parentList);
|
|
@@ -872,7 +911,13 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(contractNodeMap.containsKey(newData.getOldId())){
|
|
|
WbsTreeContract contractNode = contractNodeMap.get(newData.getOldId());
|
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
|
- WbsTreeContract parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(contractNode.getContractId()), contractNode.getParentId());
|
|
|
+ WbsTreeContract parentNode;
|
|
|
+ if(contractNodeMap.containsKey(contractNode.getParentId().toString())){
|
|
|
+ parentNode = contractNodeMap.get(contractNode.getParentId().toString());
|
|
|
+ } else {
|
|
|
+ parentNode = this.wbsTreeContractClient.queryCurrentNodeAllParent(Long.parseLong(contractNode.getContractId()), contractNode.getParentId());
|
|
|
+ }
|
|
|
+
|
|
|
if(parentNode != null){
|
|
|
ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
}
|
|
@@ -882,8 +927,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(projectNodeMap.containsKey(newData.getOldId())){
|
|
|
WbsTreePrivate contractNode = projectNodeMap.get(newData.getOldId());
|
|
|
if(contractNode.getParentId() != null && StringUtils.isNotEmpty(contractNode.getParentId().toString())){
|
|
|
- WbsTreePrivate parentNode = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(contractNode.getProjectId(), contractNode.getParentId());
|
|
|
- ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
+ WbsTreePrivate parentNode;
|
|
|
+ if(projectNodeMap.containsKey(contractNode.getParentId().toString())){
|
|
|
+ parentNode = projectNodeMap.get(contractNode.getParentId().toString());
|
|
|
+ } else {
|
|
|
+ parentNode = this.wbsTreePrivateClient.queryPeersNodeByProjectIdAndId(contractNode.getProjectId(), contractNode.getParentId());
|
|
|
+ }
|
|
|
+ if(parentNode != null){
|
|
|
+ ledger.setStation(StringUtils.isNotEmpty(parentNode.getFullName()) ? parentNode.getFullName() : parentNode.getDeptName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1105,7 +1157,16 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
WbsTreeContract queries = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(pKeyId);
|
|
|
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(3, "资料管理", "工序资料", Func.toStrList(pKeyId.toString()), StringUtils.isNotEmpty(queries.getFullName()) ? queries.getFullName() : queries.getDeptName());
|
|
|
+ try{
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", Func.toStrList(pKeyId.toString()));
|
|
|
+ json.put("operationObjName", StringUtils.isNotEmpty(queries.getFullName()) ? queries.getFullName() : queries.getDeptName());
|
|
|
+
|
|
|
+ this.operationLogClient.saveUserOperationLog(3, "资料管理", "工序资料", json);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
return R.data(this.wbsTreeContractClient.updateContractNodeParameter(node));
|
|
|
}
|
|
|
|
|
@@ -1185,7 +1246,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//保存操作记录
|
|
|
List<String> idArray = JSONArray.parseArray(JSONObject.toJSONString(ids.split(",")), String.class);
|
|
|
- this.operationLogClient.saveUserOperationLog(4, "资料管理", "工序资料", idArray, nodeName);
|
|
|
+
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", idArray);
|
|
|
+ json.put("operationObjName", nodeName);
|
|
|
+ this.operationLogClient.saveUserOperationLog(4, "资料管理", "工序资料", json);
|
|
|
+
|
|
|
//保存进回收站
|
|
|
this.recycleBinClient.saveDelBusinessData(idArray, StringUtils.isNotEmpty(removeNode.getFullName()) ? removeNode.getFullName() : removeNode.getDeptName(), 2, parentNodeName.toString(), removeNode.getProjectId(), removeNode.getContractId());
|
|
|
|
|
@@ -1223,9 +1289,15 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//查询数据
|
|
|
selectedNodeList = this.unifiedCode(allSelectedNodeList, treeContract);
|
|
|
|
|
|
- //全选的集合则进一步向下查询
|
|
|
+ //检查当前操作的节点是否是填报节点,如果是则需要查询相关联表格
|
|
|
+ List<WbsTreePrivate> submitNodeList = selectedNodeList.stream().filter(treePrivate -> Arrays.asList("1,2,3,4".split(",")).contains(treePrivate.getMajorDataType().toString())).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
List<WbsTreePrivate> childList = new ArrayList<>();
|
|
|
- this.foreachQueryChild(selectedNodeList, childList);
|
|
|
+ if(submitNodeList.size() > 0){
|
|
|
+ this.foreachQueryChild(submitNodeList, childList);
|
|
|
+ //将表格数据设置
|
|
|
+ selectedNodeList.addAll(childList);
|
|
|
+ }
|
|
|
|
|
|
if(childList.size() > 0){
|
|
|
//处理重复的数据
|
|
@@ -1372,11 +1444,13 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if(saveLedger.size() > 0){
|
|
|
this.constructionLedgerService.saveBatch(saveLedger);
|
|
|
}
|
|
|
+
|
|
|
try{
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("operationObjIds", JSONArray.parseArray(JSONObject.toJSONString(saveList.stream().map(WbsTreeContract::getPKeyId).distinct().collect(Collectors.toList())), String.class));
|
|
|
+ json.put("operationObjName", saveList.stream().map(wbs -> StringUtils.isNotEmpty(wbs.getFullName()) ? wbs.getFullName() : wbs.getDeptName()).collect(Collectors.joining()));
|
|
|
//保存操作记录
|
|
|
- this.operationLogClient.saveUserOperationLog(operationType, "资料管理", "工序资料",
|
|
|
- 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()));
|
|
|
+ this.operationLogClient.saveUserOperationLog(operationType, "资料管理", "工序资料", json);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@@ -1411,12 +1485,12 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
*/
|
|
|
private void foreachQueryChild(List<WbsTreePrivate> parentList, List<WbsTreePrivate> childList){
|
|
|
parentList.forEach(parent -> {
|
|
|
- //查询子节点
|
|
|
List<WbsTreePrivate> childs = this.wbsTreePrivateClient.queryChildByParentId(parent);
|
|
|
+
|
|
|
if(childs != null && childs.size() > 0){
|
|
|
//添加入结果集
|
|
|
childList.addAll(childs);
|
|
|
- //还有子级,继续向下
|
|
|
+ //继续向下检查子集
|
|
|
this.foreachQueryChild(childs, childList);
|
|
|
}
|
|
|
});
|
|
@@ -1554,6 +1628,11 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
submitNodeKeyIds.add(vo.getWbsId().toString());
|
|
|
//查询当前节点下的所有填报节点
|
|
|
WbsTreeContract node = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(vo.getWbsId());
|
|
|
+ if(node == null){
|
|
|
+ //这一步主要是为了兼容监理合同段
|
|
|
+ node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(vo.getWbsId(), Long.parseLong(vo.getContractIdRelation()));
|
|
|
+ }
|
|
|
+
|
|
|
if(!new Integer("6").equals(node.getDeptCategory()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())){
|
|
|
//不是工序,则查询当前节点下的所有填报节点
|
|
|
List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
|
|
@@ -1585,7 +1664,10 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
@ApiImplicitParam(name = "parentId", value = "父节点,为空则查询第一级节点"),
|
|
|
@ApiImplicitParam(name = "contractId", value = "合同段ID", required = true)
|
|
|
})
|
|
|
- public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation){
|
|
|
+ public R<List<WbsTreeContractTreeVOS>> queryContractWbsTreeByContractIdAndType(@RequestParam String primaryKeyId,@RequestParam String parentId, @RequestParam String contractId, @RequestParam String contractIdRelation){
|
|
|
+ if (StringUtils.isNotEmpty(primaryKeyId)){
|
|
|
+ parentId = primaryKeyId;
|
|
|
+ }
|
|
|
List<WbsTreeContractTreeVOS> rootTreeNode = this.queryContractTree(parentId, contractId, contractIdRelation);
|
|
|
rootTreeNode = rootTreeNode.stream().filter(vo -> vo.getDeptCategory() != 111).collect(Collectors.toList());
|
|
|
|
|
@@ -1754,7 +1836,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
}
|
|
|
|
|
|
rootTreeNode.forEach(vo -> {
|
|
|
- String primaryKeyId = new Integer("2").equals(contractInfo.getContractType()) ? vo.getId().toString() : vo.getPrimaryKeyId();
|
|
|
+// String primaryKeyId = new Integer("2").equals(contractInfo.getContractType()) ? vo.getId().toString() : vo.getPrimaryKeyId();
|
|
|
+ String primaryKeyId = vo.getPrimaryKeyId();
|
|
|
|
|
|
if(new Integer("1").equals(contractInfo.getContractType())){
|
|
|
if(StringUtils.isEmpty(parentId) || "0".equals(parentId)){
|