|
@@ -3,8 +3,10 @@ package org.springblade.business.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -20,9 +22,7 @@ import org.springblade.business.feign.MessageWarningClient;
|
|
|
import org.springblade.business.feign.OperationLogClient;
|
|
|
import org.springblade.business.feign.RecycleBinClient;
|
|
|
import org.springblade.business.feign.TaskClient;
|
|
|
-import org.springblade.business.service.IConstructionLedgerService;
|
|
|
-import org.springblade.business.service.IInformationQueryFileService;
|
|
|
-import org.springblade.business.service.ITaskService;
|
|
|
+import org.springblade.business.service.*;
|
|
|
import org.springblade.business.socket.WebSocket;
|
|
|
import org.springblade.business.utils.FileUtils;
|
|
|
import org.springblade.business.vo.*;
|
|
@@ -52,7 +52,6 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springblade.business.service.IInformationQueryService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
import java.io.IOException;
|
|
@@ -107,6 +106,8 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
private final TableFileClient tableFileClient;
|
|
|
|
|
|
+ private final ITreeContractFirstService treeContractFirstService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取文件题名
|
|
|
*/
|
|
@@ -539,7 +540,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
*/
|
|
|
@PostMapping("/queryNodeStatus")
|
|
|
@ApiOperationSupport(order = 23)
|
|
|
- @ApiOperation(value = "/查询节点状态")
|
|
|
+ @ApiOperation(value = "/查询节点状态-施工")
|
|
|
public R<String> queryNodeStatus(@RequestParam String primaryKeyId, @RequestParam String classify) {
|
|
|
//记录状态
|
|
|
String status = "1";
|
|
@@ -561,28 +562,162 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//如果不匹配,默认为未填报
|
|
|
status = "1";
|
|
|
//查询表格
|
|
|
- List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
|
|
|
- if (tableList != null && tableList.size() > 0) {
|
|
|
- for (WbsTreeContract table : tableList) {
|
|
|
- if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
- //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
- status = "2";
|
|
|
- break;
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //查询表格
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询节点状态-监理
|
|
|
+ */
|
|
|
+ @PostMapping("/queryNodeStatus-jl")
|
|
|
+ @ApiOperationSupport(order = 23)
|
|
|
+ @ApiOperation(value = "/查询节点状态-监理")
|
|
|
+ public R<String> queryNodeStatusJl(@RequestParam String primaryKeyId, @RequestParam String classify) {
|
|
|
+ //记录状态
|
|
|
+ String status = "1";
|
|
|
+ //查询填报状态,type=1资料填报
|
|
|
+ InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1));
|
|
|
+ if (businessData != null) {
|
|
|
+ switch (businessData.getStatus()) {
|
|
|
+ case 0:
|
|
|
+ case 3:
|
|
|
+ //0属于未上报,3属于已废除,统一为待上报
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ //1属于待审批,2属于已审批,统一为已上报
|
|
|
+ status = "3";
|
|
|
break;
|
|
|
+ default:
|
|
|
+ //如果不匹配,默认为未填报
|
|
|
+ status = "1";
|
|
|
+ //查询表格
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
//查询表格
|
|
|
- List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId), "queryTable", classify);
|
|
|
- if (tableList != null && tableList.size() > 0) {
|
|
|
- for (WbsTreeContract table : tableList) {
|
|
|
- if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
- //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
- status = "2";
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(status);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询节点状态-首件
|
|
|
+ */
|
|
|
+ @PostMapping("/queryNodeStatus-sj")
|
|
|
+ @ApiOperationSupport(order = 23)
|
|
|
+ @ApiOperation(value = "/查询节点状态-首件")
|
|
|
+ @ApiModelProperty(value = "id",notes = "当前该条首件的记录id")
|
|
|
+ public R<String> queryNodeStatusSj(@RequestParam String primaryKeyId, @RequestParam String classify,String id) {
|
|
|
+ //记录状态
|
|
|
+ String status = "1";
|
|
|
+ //查询填报状态,type=3首件
|
|
|
+ InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
|
|
|
+ .eq(InformationQuery::getId,id)
|
|
|
+ .eq(InformationQuery::getType, 3)
|
|
|
+ );
|
|
|
+ if (businessData != null) {
|
|
|
+ switch (businessData.getStatus()) {
|
|
|
+ case 0:
|
|
|
+ case 3:
|
|
|
+ //0属于未上报,3属于已废除,统一为待上报
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ //1属于待审批,2属于已审批,统一为已上报
|
|
|
+ status = "3";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ //如果不匹配,默认为未填报
|
|
|
+ status = "1";
|
|
|
+ //查询表格
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //查询表格
|
|
|
+ WbsTreeContract obj = this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(primaryKeyId);
|
|
|
+ if (ObjectUtils.isNotEmpty(obj)) {
|
|
|
+ List<WbsTreeContract> tableList = this.wbsTreeContractClient.queryChildByParentId(obj, "queryTable", classify);
|
|
|
+ if (tableList != null && tableList.size() > 0) {
|
|
|
+ for (WbsTreeContract table : tableList) {
|
|
|
+ if (new Integer("2").equals(table.getIsTabPdf())) {
|
|
|
+ //这些表格中,但凡有一个能够预览,就开放预览
|
|
|
+ status = "2";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -590,6 +725,7 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
return R.data(status);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 查询节点状态-试验
|
|
|
*/
|
|
@@ -1127,6 +1263,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
if (new Integer("1").equals(node.getType())) {
|
|
|
//如果是节点类型才重塑ID
|
|
|
newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ //划分编号
|
|
|
+ newData.setPartitionCode(StringUtils.isNotEmpty(vo.getPartitionCode()) ? vo.getPartitionCode() : null);
|
|
|
}
|
|
|
//设置父节点ID
|
|
|
if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
@@ -1149,8 +1288,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//初始化PDF路径
|
|
|
newData.setPdfUrl(null);
|
|
|
newData.setCreateUser(AuthUtil.getUserId());
|
|
|
- //划分编号
|
|
|
- newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
|
|
|
|
|
|
//获取当前所有复制的节点的最大sort
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
@@ -1202,6 +1339,9 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//设置新ID
|
|
|
if (new Integer("1").equals(node.getType())) {
|
|
|
newData.setId(oldToNewIdMap.containsKey(node.getId()) ? oldToNewIdMap.get(node.getId()) : SnowFlakeUtil.getId());
|
|
|
+
|
|
|
+ //划分编号
|
|
|
+ newData.setPartitionCode(StringUtils.isNotEmpty(node.getPartitionCode()) ? node.getPartitionCode() : null);
|
|
|
}
|
|
|
//设置父节点ID
|
|
|
if (vo.getNeedCopyPrimaryKeyId().equals(node.getPKeyId().toString())) {
|
|
@@ -1224,8 +1364,6 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
newData.setIsTabPdf(1);
|
|
|
//初始化PDF路径
|
|
|
newData.setPdfUrl(null);
|
|
|
- //划分编号
|
|
|
- newData.setPartitionCode(StringUtils.isNotEmpty(copyBatch.getPartitionCode()) ? copyBatch.getPartitionCode() : null);
|
|
|
|
|
|
//获取当前所有复制的节点的最大sort
|
|
|
String sql = "select sort from m_wbs_tree_contract where contract_id = '" + node.getContractId() + "' and (id = '" + node.getId() + "' or old_id = '" + node.getId() + "')";
|
|
@@ -1956,28 +2094,44 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
//这一步主要是为了兼容监理合同段
|
|
|
node = this.wbsTreeContractClient.getContractWbsTreeByContractIdAndId(vo.getWbsId(), Long.parseLong(vo.getContractIdRelation()));
|
|
|
}
|
|
|
-
|
|
|
+ List<QueryProcessDataVO> queryDataResult = new ArrayList<>();
|
|
|
if (!new Integer("6").equals(node.getNodeType()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())) {
|
|
|
//不是工序,则查询当前节点下的所有填报节点
|
|
|
if (node.getParentId() == 0) {
|
|
|
String contractId = node.getContractId();
|
|
|
List<WbsTreeContract> treeS = wbsTreeContractClient.getContractWbsTreeByParentId(node.getId().toString(), contractId);
|
|
|
for (WbsTreeContract tree : treeS) {
|
|
|
- List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(tree.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
|
|
|
- if (queryDataResult != null && queryDataResult.size() > 0) {
|
|
|
- submitNodeKeyIds.addAll(queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList()));
|
|
|
- queryDataResult.clear();
|
|
|
+ List<QueryProcessDataVO> Result = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(tree.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
|
|
|
+ if (Result != null && Result.size() > 0) {
|
|
|
+ queryDataResult.addAll(Result);
|
|
|
+ Result.clear();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- List<QueryProcessDataVO> queryDataResult = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
|
|
|
- if (StringUtils.isNotEmpty(vo.getIsFirst())) {
|
|
|
- //如果是首件列表请求,则删掉没有标记为首件的数据
|
|
|
- queryDataResult.removeIf(data -> StringUtils.isEmpty(data.getFirstId()));
|
|
|
+ List<QueryProcessDataVO> Result = this.informationQueryService.queryProcessDataByParentIdAndContractIdTwo(node.getId().toString(), contract.getContractType(), StringUtils.isNotEmpty(vo.getContractIdRelation()) ? vo.getContractIdRelation() : vo.getContractId().toString());
|
|
|
+ if (Result != null && Result.size() > 0) {
|
|
|
+ queryDataResult.addAll(Result);
|
|
|
+ Result.clear();
|
|
|
}
|
|
|
- if (queryDataResult != null && queryDataResult.size() > 0) {
|
|
|
- submitNodeKeyIds.addAll(queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ //如果是首件列表请求,则删掉没有标记为首件的数据
|
|
|
+ if (queryDataResult != null && queryDataResult.size() > 0) {
|
|
|
+ if (StringUtils.isNotEmpty(vo.getIsFirst())) {
|
|
|
+ List<String> treeIds = queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList());
|
|
|
+ //通过合同段主键在首件关联表中查询出所有数据
|
|
|
+ List<TreeContractFirst> firstList = treeContractFirstService.list(new LambdaQueryWrapper<TreeContractFirst>().in(TreeContractFirst::getWbsNodeId, treeIds));
|
|
|
+ List<String> list = firstList.stream().map(fl -> (fl.getWbsNodeId()+"")).collect(Collectors.toList());
|
|
|
+ queryDataResult = queryDataResult.stream().filter(qdr->list.contains(qdr.getPrimaryKeyId())).collect(Collectors.toList());
|
|
|
+// for (QueryProcessDataVO queryProcessDataVO : queryDataResult) {
|
|
|
+// TreeContractFirst first = treeContractFirstService.getOne(new LambdaQueryWrapper<TreeContractFirst>()
|
|
|
+// .eq(TreeContractFirst::getWbsNodeId, queryProcessDataVO.getPrimaryKeyId()));
|
|
|
+// if (first != null){
|
|
|
+// queryProcessDataVO.setFirstId(first.getId()+"");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// queryDataResult.removeIf(data -> StringUtils.isEmpty(data.getFirstId()));
|
|
|
}
|
|
|
+ submitNodeKeyIds.addAll(queryDataResult.stream().map(QueryProcessDataVO::getPrimaryKeyId).distinct().collect(Collectors.toList()));
|
|
|
}
|
|
|
}
|
|
|
//设置进集合中
|