|
@@ -22,7 +22,9 @@ import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
import org.springblade.manager.entity.WbsTreeContract;
|
|
import org.springblade.manager.entity.WbsTreeContract;
|
|
|
|
+import org.springblade.manager.feign.ContractClient;
|
|
import org.springblade.manager.feign.WbsTreeContractClient;
|
|
import org.springblade.manager.feign.WbsTreeContractClient;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
@@ -61,6 +63,8 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
|
|
|
|
private final IContractLogService contractLogService;
|
|
private final IContractLogService contractLogService;
|
|
|
|
|
|
|
|
+ private final ContractClient contractClient;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<String> queryBusinessTableData(String formDataId) {
|
|
public List<String> queryBusinessTableData(String formDataId) {
|
|
//获取具体业务数据
|
|
//获取具体业务数据
|
|
@@ -547,4 +551,73 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
|
|
linkList.forEach(link -> vo.setWaitingUserList(link.getTaskUserName(), new Integer("999").equals(link.getEVisaStatus()) ? 999 : new Integer("2").equals(link.getStatus()) ? 2 : new Integer("3").equals(link.getStatus()) && new Integer("1").equals(link.getInitiative()) ? 3 : 1));
|
|
linkList.forEach(link -> vo.setWaitingUserList(link.getTaskUserName(), new Integer("999").equals(link.getEVisaStatus()) ? 999 : new Integer("2").equals(link.getStatus()) ? 2 : new Integer("3").equals(link.getStatus()) && new Integer("1").equals(link.getInitiative()) ? 3 : 1));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取当前合同所有填报表
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Long> getTreeAllTable(String contractId){
|
|
|
|
+ //总数据
|
|
|
|
+ List<WbsTreeContractTreeVOS> list = new ArrayList<>();
|
|
|
|
+ this.getAllTable("",contractId,list);
|
|
|
|
+ Map<String,Long> map = new HashMap<>();
|
|
|
|
+ list.stream().forEach(li->map.put(li.getId()+"",li.getSubmitCounts()));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 递归调用获取合同所有填报表
|
|
|
|
+ */
|
|
|
|
+ public void getAllTable(String parentId,String contractId, List<WbsTreeContractTreeVOS> list){
|
|
|
|
+ List<WbsTreeContractTreeVOS> vos = this.queryContractTree(parentId, contractId, "", "1");
|
|
|
|
+ if (vos != null && vos.size() > 0){
|
|
|
|
+ vos = vos.stream().filter(vo->vo.getSubmitCounts()!=0).collect(Collectors.toList());
|
|
|
|
+ list.addAll(vos);
|
|
|
|
+ for (WbsTreeContractTreeVOS vo : vos) {
|
|
|
|
+ this.getAllTable(vo.getId()+"",contractId,list);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 查询合同段划分树公共代码
|
|
|
|
+ */
|
|
|
|
+ private List<WbsTreeContractTreeVOS> queryContractTree(String parentId, String contractId, String contractIdRelation, String classifyType) {
|
|
|
|
+ List<WbsTreeContractTreeVOS> rootTreeNode;
|
|
|
|
+
|
|
|
|
+ //获取合同段,检查是否是监理合同段
|
|
|
|
+ ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(contractId));
|
|
|
|
+ if (new Integer("2").equals(contractInfo.getContractType()) || new Integer("3").equals(contractInfo.getContractType())) {
|
|
|
|
+ //监理/业主合同段,需要获取关联的施工方合同段根节点数据
|
|
|
|
+ List<String> contractIds = new ArrayList<>();
|
|
|
|
+ if (StringUtils.isEmpty(parentId)) {
|
|
|
|
+ contractIds = this.contractClient.getProcessContractByJLContractId(contractId);
|
|
|
|
+ } else {
|
|
|
|
+ contractIds.add(contractIdRelation);
|
|
|
|
+ }
|
|
|
|
+ if (contractIds.size() > 0) {
|
|
|
|
+ if (StringUtils.isNotEmpty(parentId)) {
|
|
|
|
+ //子节点
|
|
|
|
+ rootTreeNode = this.queryContractTreeSupervision(contractIds, parentId, Integer.parseInt(classifyType));
|
|
|
|
+ } else {
|
|
|
|
+ //根节点
|
|
|
|
+ rootTreeNode = this.queryContractTreeSupervision(contractIds, "0", Integer.parseInt(classifyType));
|
|
|
|
+
|
|
|
|
+ //设置根节点数量统计
|
|
|
|
+ for (WbsTreeContractTreeVOS root : rootTreeNode) {
|
|
|
|
+ List<WbsTreeContractTreeVOS> rootZi = this.queryContractTreeSupervision(Func.toStrList(root.getContractIdRelation()), root.getId().toString(), Integer.parseInt(classifyType));
|
|
|
|
+ List<Long> collect = rootZi.stream().map(WbsTreeContractTreeVOS::getSubmitCounts).collect(Collectors.toList());
|
|
|
|
+ Long reduce = collect.stream().reduce(0L, Long::sum);
|
|
|
|
+ root.setSubmitCounts(reduce);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ rootTreeNode = new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ //施工合同段
|
|
|
|
+ rootTreeNode = this.queryContractTree(contractId, StringUtils.isNotEmpty(parentId) ? parentId : "0", 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return rootTreeNode;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|