|
@@ -16,9 +16,11 @@ import org.springblade.common.utils.BaiduApiUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
+import org.springblade.core.secure.utils.SecureUtil;
|
|
|
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 +36,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 +371,25 @@ 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 a.ancestors from m_wbs_tree_contract_extend a " +
|
|
|
+ "inner join m_wbs_tree_contract b on a.p_key_id = b.p_key_id and b.is_deleted = 0 and b.is_buss_show != 2 " +
|
|
|
+ "where a.type = " + tableOwner + " and a.is_sync = 1 and a.is_deleted = 0 and a.contract_id = " + contractId;
|
|
|
+ Set<String> syncPKeyIds = new HashSet<>();
|
|
|
+ if(SecureUtil.isAdministrator()){
|
|
|
+ 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)) {
|
|
@@ -519,6 +541,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
// vo.setColorStatus(lowestNode.getColorStatus());
|
|
|
// }
|
|
|
// }
|
|
|
+ if(CollectionUtil.isNotEmpty(syncPKeyIds)){
|
|
|
+ //判断是否展示同步标识
|
|
|
+ vo.setIsSync(syncPKeyIds.contains(vo.getPrimaryKeyId().toString()) ? 1 : 0);
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|
|
@@ -684,6 +710,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
// vo.setColorStatus(lowestNode.getColorStatus());
|
|
|
// }
|
|
|
// }
|
|
|
+ if(CollectionUtil.isNotEmpty(syncPKeyIds)){
|
|
|
+ //判断是否展示同步标识
|
|
|
+ vo.setIsSync(syncPKeyIds.contains(vo.getPrimaryKeyId().toString()) ? 1 : 0);
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}).collect(Collectors.toList());
|