|
@@ -26,6 +26,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
@@ -43,6 +44,7 @@ public class NeiWaiYeProgressController {
|
|
|
|
|
|
private final JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 内外业进度 ,id为当前合同段id
|
|
|
*/
|
|
@@ -67,9 +69,34 @@ public class NeiWaiYeProgressController {
|
|
|
childList.removeIf(child -> child.getNodeType() != null && child.getNodeType() == 111);
|
|
|
|
|
|
//获取当前节点下的所有填报节点
|
|
|
- List<QueryProcessDataVO> queryProcessDataVOList;
|
|
|
- if (!new Integer("6").equals(node.getNodeType()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())) {
|
|
|
- queryProcessDataVOList = this.informationQueryService.queryProcessDataByParentIdAndContractId(node.getId().toString(), classFy, contractId);
|
|
|
+ List<QueryProcessDataVO> queryProcessDataVOList = new ArrayList<>();
|
|
|
+ if (node.getParentId() == 0){
|
|
|
+ //ancens断层,手动插入子节点
|
|
|
+ for (WbsTreeContract contract : childList) {
|
|
|
+ queryProcessDataVOList.addAll(this.informationQueryService.queryProcessDataByParentIdAndContractId2(contract.getId().toString(), classFy, contractId));
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (!new Integer("6").equals(node.getNodeType()) && !Arrays.asList("1,2,3,4".split(",")).contains(node.getMajorDataType().toString())) {
|
|
|
+ //查询出节点下所有填报节点
|
|
|
+// List<WbsTreeContract> list = this.wbsTreeContractClient.getAllChildren(node.getId(), Long.parseLong(node.getContractId()));
|
|
|
+// List<Long> keys = list.stream().map(l -> l.getPKeyId()).collect(Collectors.toList());
|
|
|
+// List<Long> ids = this.informationQueryService.getInfoByNodeIds(keys);
|
|
|
+// queryProcessDataVOList = list.stream().map(l -> {
|
|
|
+// QueryProcessDataVO vo = new QueryProcessDataVO();
|
|
|
+// vo.setPrimaryKeyId(l.getPKeyId() + "");
|
|
|
+// vo.setMajorDataType(l.getMajorDataType());
|
|
|
+// vo.setAncestors(l.getAncestors());
|
|
|
+// vo.setParentId(l.getParentId() + "");
|
|
|
+// if (ids != null && ids.contains(l.getPKeyId())) {
|
|
|
+// vo.setStatus(2);
|
|
|
+// }else {
|
|
|
+// vo.setStatus(1);
|
|
|
+// }
|
|
|
+// return vo;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //查询出所有已完成任务
|
|
|
+ queryProcessDataVOList = this.informationQueryService.queryProcessDataByParentIdAndContractId2(node.getId().toString(), classFy, contractId);
|
|
|
} else {
|
|
|
//填报节点
|
|
|
queryProcessDataVOList = this.informationQueryService.queryProcessDataByPrimaryKeyIdAndClassify(node.getPKeyId().toString(), classFy);
|
|
@@ -96,23 +123,11 @@ public class NeiWaiYeProgressController {
|
|
|
if (new Integer("2").equals(vo.getStatus())) {
|
|
|
neiYeSuccessAmount++;
|
|
|
}
|
|
|
- //统计外业数量(外业根据当前填报节点是否已经生成一份施工日志为准(暂时))
|
|
|
- Integer logCount = this.contractLogWbsService.countContractLogBySelectPrimaryKeyIdsAndClassify(Func.toStrList(vo.getPrimaryKeyId()), 7);
|
|
|
- if (logCount != null && logCount > 0) {
|
|
|
- waiYeSuccessAmount++;
|
|
|
- } else {
|
|
|
- //检查是否填有对应的施工台账(以施工台账是否填写开工时间为准)
|
|
|
- ConstructionLedger ledger = this.constructionLedgerService.getOne(Wrappers.<ConstructionLedger>lambdaQuery().eq(ConstructionLedger::getWbsId, vo.getPrimaryKeyId()));
|
|
|
- if (ledger != null && ledger.getSiteStartTime() != null) {
|
|
|
- waiYeSuccessAmount++;
|
|
|
- }
|
|
|
- }
|
|
|
//统计总数
|
|
|
amount++;
|
|
|
iterator.remove();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//添加返回结果
|
|
|
result.add(new NeiWaiYeProgressVO(StringUtils.isNotEmpty(child.getFullName()) ? child.getFullName() : child.getNodeName(), amount, neiYeSuccessAmount, waiYeSuccessAmount));
|
|
|
}
|