|
@@ -19,6 +19,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.node.ForestNodeMerger;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
+import org.springblade.core.tool.utils.CollectionUtil;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.manager.bean.NodeVO;
|
|
|
import org.springblade.manager.dto.FindAllUserByConditionDTO;
|
|
@@ -34,6 +35,7 @@ import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springblade.system.user.vo.UserContractInfoVO;
|
|
|
import org.springblade.system.user.vo.UserVO2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@@ -368,6 +370,21 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
public R<Object> getTreeNodeByValueAndContractId(String queryValue, String contractId, String tableOwner) {
|
|
|
if (StringUtils.isNotEmpty(queryValue) && StringUtils.isNotEmpty(contractId)) {
|
|
|
ContractInfo contractInfo = contractInfoMapper.selectById(contractId);
|
|
|
+
|
|
|
+ //查询wbs同步信息
|
|
|
+ String contractExtendSql = "select ancestors from m_wbs_tree_contract_extend where type = " + tableOwner + " and is_sync = 1 and is_deleted = 0 and contract_id = " + contractId;
|
|
|
+ Set<String> syncPKeyIds = new HashSet<>();
|
|
|
+ List<String> strings = null;
|
|
|
+ try {
|
|
|
+ strings = jdbcTemplate.queryForList(contractExtendSql, String.class);
|
|
|
+ } catch (DataAccessException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ //TODO 暂时忽略错误
|
|
|
+ }
|
|
|
+ if(CollectionUtil.isNotEmpty(strings)){
|
|
|
+ strings.stream().filter(com.alibaba.nacos.common.utils.StringUtils::isNotEmpty).forEach(f -> syncPKeyIds.addAll(Arrays.asList(f.split(","))));
|
|
|
+ }
|
|
|
+
|
|
|
if (contractInfo != null) {
|
|
|
/*质检施工合同段*/
|
|
|
if (contractInfo.getContractType().equals(1)) {
|
|
@@ -491,6 +508,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
List<WbsTreeContractStatistics> wbsTreeContractStatisticsList = jdbcTemplate.query("select id, leaf_num, fill_num, approve_num, complete_num,jl_fill_num, jl_approve_num, jl_complete_num from m_wbs_tree_contract_statistics where id in (" + pKeyIds + ")",
|
|
|
new BeanPropertyRowMapper<>(WbsTreeContractStatistics.class));
|
|
|
Map<Long, WbsTreeContractStatistics> wbsTreeContractStatisticsMap = wbsTreeContractStatisticsList.stream().collect(Collectors.toMap(WbsTreeContractStatistics::getId, item -> item));
|
|
|
+ List<String> finalStrings = strings;
|
|
|
List<WbsTreeContractTreeAllVO> wbsTreeContractTreeAllVOS = wbsTreeContractList.stream()
|
|
|
.map(node -> {
|
|
|
WbsTreeContractTreeAllVO vo = BeanUtil.copyProperties(node, WbsTreeContractTreeAllVO.class);
|
|
@@ -519,6 +537,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
// vo.setColorStatus(lowestNode.getColorStatus());
|
|
|
// }
|
|
|
// }
|
|
|
+ if(CollectionUtil.isNotEmpty(finalStrings)){
|
|
|
+ //判断是否展示同步标识
|
|
|
+ vo.setIsSync(finalStrings.contains(vo.getPrimaryKeyId()) ? 1 : 0);
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
@@ -652,6 +674,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
// countMap.put(key, 1L);
|
|
|
// }
|
|
|
// }
|
|
|
+ List<String> finalStrings = strings;
|
|
|
String pKeyIds = wbsTreeContractList.stream().map(item -> item.getPKeyId() + "").collect(Collectors.joining(","));
|
|
|
List<WbsTreeContractStatistics> wbsTreeContractStatisticsList = jdbcTemplate.query("select id, leaf_num, fill_num, approve_num, complete_num,jl_fill_num, jl_approve_num, jl_complete_num from m_wbs_tree_contract_statistics where id in (" + pKeyIds + ")",
|
|
|
new BeanPropertyRowMapper<>(WbsTreeContractStatistics.class));
|
|
@@ -684,6 +707,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
// vo.setColorStatus(lowestNode.getColorStatus());
|
|
|
// }
|
|
|
// }
|
|
|
+ if(CollectionUtil.isNotEmpty(finalStrings)){
|
|
|
+ //判断是否展示同步标识
|
|
|
+ vo.setIsSync(finalStrings.contains(vo.getPrimaryKeyId()) ? 1 : 0);
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|