|
@@ -1,6 +1,5 @@
|
|
|
package org.springblade.manager.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.lang.hash.Hash;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -10,9 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
-import org.springblade.business.entity.InformationQuery;
|
|
|
import org.springblade.business.feign.InformationQueryClient;
|
|
|
import org.springblade.common.utils.BaiduApiUtil;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
@@ -29,6 +26,7 @@ import org.springblade.manager.entity.*;
|
|
|
import org.springblade.manager.mapper.*;
|
|
|
import org.springblade.manager.service.IContractInfoService;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
+import org.springblade.meter.feign.MeterContractInfoClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springblade.system.user.vo.UserContractInfoVO;
|
|
@@ -60,6 +58,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
private final IUserClient iUserClient;
|
|
|
private final InformationQueryClient informationQueryClient;
|
|
|
private final ArchiveTreeContractMapper archiveTreeContractMapper;
|
|
|
+ private final MeterContractInfoClient meterContractInfoClient;
|
|
|
@Autowired
|
|
|
StringRedisTemplate redisTemplate;
|
|
|
|
|
@@ -797,19 +796,21 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
|
|
|
boolean row = this.saveOrUpdate(contractInfo);
|
|
|
|
|
|
- //监理、总监办新增
|
|
|
+ /*监理、总监办新增*/
|
|
|
if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
|
|
|
if (contractInfo.getIdList().size() > 0) {
|
|
|
List<WbsTreeContractVO3> infos = contractInfo.getIdList();
|
|
|
for (WbsTreeContractVO3 info : infos) {
|
|
|
- //新增关系记录
|
|
|
+ /*新增关系记录*/
|
|
|
baseMapper.insertContractRelationJLYZ(SnowFlakeUtil.getId(), contractInfo.getId(), info.getContractId());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //中西试验室
|
|
|
+ /*总承包合同段(计量合同段)*/
|
|
|
} else if (contractInfo.getContractType().equals(4)) {
|
|
|
- //TODO
|
|
|
+ if (ObjectUtil.isNotEmpty(contractInfo.getMeterContractInfo())) {
|
|
|
+ meterContractInfoClient.saveOrUpdate(contractInfo.getMeterContractInfo());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return this.submitContractRelevantInfo(row, contractInfo);
|
|
@@ -832,30 +833,28 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
}
|
|
|
boolean row = this.saveOrUpdate(contractInfo);
|
|
|
|
|
|
- //监理、总监办编辑
|
|
|
+ /*监理、总监办编辑*/
|
|
|
if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
|
|
|
- //获取当前项目所有施工合同段ids
|
|
|
+ /*获取当前项目所有施工合同段ids*/
|
|
|
List<Long> contractInfosSGAll = baseMapper.selectList(Wrappers.<ContractInfo>lambdaQuery()
|
|
|
.eq(ContractInfo::getPId, contractInfo.getPId())
|
|
|
.eq(ContractInfo::getContractType, 1).eq(ContractInfo::getStatus, 1))
|
|
|
.stream().map(ContractInfo::getId).collect(Collectors.toList());
|
|
|
|
|
|
- //更新当下项目所有施工合同段Redis树缓存
|
|
|
+ contractInfosSGAll.add(contractInfo.getId());
|
|
|
+ /*更新当下项目合同段Redis树缓存*/
|
|
|
for (Long id : contractInfosSGAll) {
|
|
|
informationQueryClient.delAsyncWbsTree(id + "");
|
|
|
}
|
|
|
|
|
|
- //更新当前监理合同段Redis树缓存
|
|
|
- informationQueryClient.delAsyncWbsTree(contractInfo.getId() + "");
|
|
|
-
|
|
|
- //删除记录信息
|
|
|
+ /*删除记录信息*/
|
|
|
List<String> updateId_SG = contractInfo.getIdList().stream().map(WbsTreeContractVO3::getContractId).collect(Collectors.toList());
|
|
|
baseMapper.deleteContractRelationJLYZ(contractInfo.getId());
|
|
|
for (String id : updateId_SG) {
|
|
|
baseMapper.insertContractRelationJLYZ(SnowFlakeUtil.getId(), contractInfo.getId(), id);
|
|
|
}
|
|
|
|
|
|
- //当前关联的施工合同段ids
|
|
|
+ /*当前关联的施工合同段ids*/
|
|
|
String sql = "select * from m_contract_relation_jlyz where contract_id_jlyz = " + contractInfo.getId();
|
|
|
List<String> record_SG = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractRelationJlyz.class)).stream().map(ContractRelationJlyz::getContractIdSg).collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.toList());
|
|
|
|
|
@@ -863,12 +862,12 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
List<Long> delIds = contractInfosSGAll.stream().filter(f -> !record_SG.contains(f.toString())).collect(Collectors.toList());
|
|
|
|
|
|
if (saveIds.size() > 0) {
|
|
|
- //同步
|
|
|
+ /*同步*/
|
|
|
this.syncUserInfoToContract(contractInfo, saveIds);
|
|
|
}
|
|
|
|
|
|
if (delIds.size() > 0) {
|
|
|
- //删除
|
|
|
+ /*删除*/
|
|
|
List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectService.getBaseMapper().selectList(Wrappers.<SaveUserInfoByProjectDTO>lambdaQuery()
|
|
|
.eq(SaveUserInfoByProjectDTO::getProjectId, contractInfo.getPId())
|
|
|
.eq(SaveUserInfoByProjectDTO::getIsRecordJlId, contractInfo.getId())
|
|
@@ -881,9 +880,11 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //中西试验室编辑
|
|
|
+ /*总承包合同段(计量合同段)*/
|
|
|
} else if (contractInfo.getContractType().equals(4)) {
|
|
|
-
|
|
|
+ if (ObjectUtil.isNotEmpty(contractInfo.getMeterContractInfo())) {
|
|
|
+ meterContractInfoClient.saveOrUpdate(contractInfo.getMeterContractInfo());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return this.submitContractRelevantInfo(row, contractInfo);
|