|
@@ -1,6 +1,7 @@
|
|
package org.springblade.manager.service.impl;
|
|
package org.springblade.manager.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
+import cn.hutool.core.lang.func.LambdaUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -52,9 +53,7 @@ import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.excel.WbsExcelBatchUtil;
|
|
import org.springblade.manager.excel.WbsExcelBatchUtil;
|
|
import org.springblade.manager.excel.WbsExcelUtil;
|
|
import org.springblade.manager.excel.WbsExcelUtil;
|
|
import org.springblade.manager.feign.ContractClient;
|
|
import org.springblade.manager.feign.ContractClient;
|
|
-import org.springblade.manager.mapper.ContractInfoMapper;
|
|
|
|
-import org.springblade.manager.mapper.WbsTreeContractMapper;
|
|
|
|
-import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
|
|
|
+import org.springblade.manager.mapper.*;
|
|
import org.springblade.manager.service.ITableFileService;
|
|
import org.springblade.manager.service.ITableFileService;
|
|
import org.springblade.manager.service.IWbsParamService;
|
|
import org.springblade.manager.service.IWbsParamService;
|
|
import org.springblade.manager.service.IWbsTreeContractService;
|
|
import org.springblade.manager.service.IWbsTreeContractService;
|
|
@@ -105,6 +104,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
private final BladeRedis bladeRedis;
|
|
private final BladeRedis bladeRedis;
|
|
private final ConstructionLedgerFeignClient constructionLedgerFeign;
|
|
private final ConstructionLedgerFeignClient constructionLedgerFeign;
|
|
private final WbsTreePrivateMapper wbsTreePrivateMapper;
|
|
private final WbsTreePrivateMapper wbsTreePrivateMapper;
|
|
|
|
+ private final ProjectInfoMapper projectInfoMapper;
|
|
private final ContractInfoMapper contractInfoMapper;
|
|
private final ContractInfoMapper contractInfoMapper;
|
|
private final JdbcTemplate jdbcTemplate;
|
|
private final JdbcTemplate jdbcTemplate;
|
|
private final InformationQueryClient informationQueryClient;
|
|
private final InformationQueryClient informationQueryClient;
|
|
@@ -124,6 +124,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
private final Map<String, List<WbsTreeContractLazyQueryInfoVO>> localCacheQueryInfos = new ConcurrentHashMap<>();
|
|
private final Map<String, List<WbsTreeContractLazyQueryInfoVO>> localCacheQueryInfos = new ConcurrentHashMap<>();
|
|
//存储当前合同段contractId_tableOwner对应的节点数量统计缓存信息
|
|
//存储当前合同段contractId_tableOwner对应的节点数量统计缓存信息
|
|
private final Map<String, List<WbsTreeContractLazyVO>> localCacheParentCountNodes = new ConcurrentHashMap<>();
|
|
private final Map<String, List<WbsTreeContractLazyVO>> localCacheParentCountNodes = new ConcurrentHashMap<>();
|
|
|
|
+ @Autowired
|
|
|
|
+ private WbsTreeMapper wbsTreeMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<WbsTreeContract> selectQueryCurrentNodeByAncestors(List<String> ids, String contractId) {
|
|
public List<WbsTreeContract> selectQueryCurrentNodeByAncestors(List<String> ids, String contractId) {
|
|
@@ -1104,23 +1106,36 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean syncContractTabSort(String projectId) {
|
|
|
|
- if (ObjectUtil.isNotEmpty(projectId)) {
|
|
|
|
- List<WbsTreePrivate> tabs = jdbcTemplate.query("select id,p_key_id,sort from m_wbs_tree_private where is_deleted = 0 and sort is not null and wbs_type = 1 and project_id = " + projectId, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
|
- List<ContractInfo> contractInfos = jdbcTemplate.query("select id from m_contract_info where is_deleted = 0 and contract_type = 1 and p_id = " + projectId, new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
|
- for (ContractInfo contractInfo : contractInfos) {
|
|
|
|
- for (List<WbsTreePrivate> wbsTreePrivates : Lists.partition(tabs, 1000)) {
|
|
|
|
- try {
|
|
|
|
- this.batchUpdateData(wbsTreePrivates, contractInfo.getId());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- throw new ServiceException("保存数据异常,请联系管理员");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
|
|
+ public boolean syncContractTabSort(String projectId,Long primaryKeyId) {
|
|
|
|
+
|
|
|
|
+ //获取当前节点对应节点信息
|
|
|
|
+ WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, primaryKeyId));
|
|
|
|
+ //获取项目信息
|
|
|
|
+ ProjectInfo projectInfo = projectInfoMapper.selectOne(Wrappers.<ProjectInfo>lambdaQuery().eq(ProjectInfo::getId, wbsTreePrivate.getProjectId()));
|
|
|
|
+ Integer type = 0;
|
|
|
|
+ if (
|
|
|
|
+ ("1".equals(wbsTreePrivate.getWbsType()) && ("public").equals(projectInfo.getReferenceWbsTemplateType())) ||
|
|
|
|
+ ("2".equals(wbsTreePrivate.getWbsType()) && ("public").equals(projectInfo.getReferenceWbsTemplateTypeTrial())) ||
|
|
|
|
+ ("3".equals(wbsTreePrivate.getWbsType()) && ("public").equals(projectInfo.getReferenceWbsTemplateTypeMeter())) ||
|
|
|
|
+ ("5".equals(wbsTreePrivate.getWbsType()) && ("public").equals(projectInfo.getReferenceWbsTemplateTypeLar()))
|
|
|
|
+ ) {
|
|
|
|
+ type = 0;
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ type = 1;
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //1、获取指定项目指定节点下的表单信息
|
|
|
|
+ Long count = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPId, primaryKeyId).eq(WbsTreePrivate::getType, 1));
|
|
|
|
+ if(count > 0){
|
|
|
|
+ throw new RuntimeException("请选择底层节点");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ baseMapper.updateSortNotIsUseSort(type,Long.valueOf(projectId),primaryKeyId);
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|