|
@@ -164,7 +164,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean saveAndUpdateContract(ContractInfoVO contractInfo) {
|
|
|
if (contractInfo.getId() == null) {
|
|
|
- //新增
|
|
|
List<ContractInfo> contractInfos = baseMapper.selectList(Wrappers.<ContractInfo>query().lambda()
|
|
|
.eq(ContractInfo::getContractName, contractInfo.getContractName())
|
|
|
.eq(ContractInfo::getPId, contractInfo.getPId())
|
|
@@ -178,7 +177,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
|
|
|
boolean row = saveOrUpdate(contractInfo);
|
|
|
|
|
|
- //新增合同段 监理、业主与施工wbs树信息
|
|
|
if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
|
|
|
if (contractInfo.getIdList().size() > 0) {
|
|
|
List<WbsTreeContractVO3> infos = contractInfo.getIdList();
|
|
@@ -191,7 +189,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
return submitContractRelevantInfo(row, contractInfo);
|
|
|
|
|
|
} else {
|
|
|
- //编辑
|
|
|
List<ContractInfo> contractInfos = baseMapper.selectList(Wrappers.<ContractInfo>query().lambda()
|
|
|
.eq(ContractInfo::getContractName, contractInfo.getContractName())
|
|
|
.eq(ContractInfo::getPId, contractInfo.getPId())
|
|
@@ -200,20 +197,17 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
if (contractInfos.size() > 0) {
|
|
|
throw new ServiceException("合同段名称已存在当前项目下,请重新输入");
|
|
|
}
|
|
|
- //新增合同段
|
|
|
boolean row = saveOrUpdate(contractInfo);
|
|
|
|
|
|
- //关联合同段 监理、业主与施工wbs树信息
|
|
|
if (contractInfo.getContractType().equals(2) || contractInfo.getContractType().equals(3)) {
|
|
|
List<WbsTreeContractVO3> idList = contractInfo.getIdList();
|
|
|
- //删除当前关系信息
|
|
|
+
|
|
|
List<ContractRelationJlyz> resultListJLTZ = baseMapper.selectByContractRelationJlyz(contractInfo.getId());
|
|
|
if (resultListJLTZ.size() > 0) {
|
|
|
baseMapper.deleteContractRelationJLYZ(contractInfo.getId());
|
|
|
}
|
|
|
|
|
|
if (idList.size() > 0) {
|
|
|
- //新增关系信息
|
|
|
List<String> idList_SG = idList.stream().map(WbsTreeContractVO3::getContractId).collect(Collectors.toList());
|
|
|
idList_SG.forEach(ids -> {
|
|
|
baseMapper.insertContractRelationJLYZ(SnowFlakeUtil.getId(), contractInfo.getId(), ids);
|
|
@@ -227,7 +221,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
|
|
|
private boolean submitContractRelevantInfo(boolean row, ContractInfoVO contractInfo) {
|
|
|
if (row) {
|
|
|
- //绑定用户角色信息
|
|
|
List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectMapper.selectList(Wrappers.<SaveUserInfoByProjectDTO>query().lambda()
|
|
|
.eq(SaveUserInfoByProjectDTO::getProjectId, contractInfo.getPId())
|
|
|
.isNull(SaveUserInfoByProjectDTO::getContractId)
|
|
@@ -239,8 +232,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
saveUserInfoByProjectMapper.updateById(i);
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- //获取初始化位置信息
|
|
|
String projectPlace = contractInfo.getProjectPlace();
|
|
|
try {
|
|
|
Map<String, Object> addressInfo = BaiduApiUtil.geocoding(projectPlace);
|
|
@@ -264,7 +255,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
queryWrapper.eq("is_deleted", contractInfo.getIsDeleted());
|
|
|
ProjectContractArea projectContractArea1 = projectContractAreaMapper.selectOne(queryWrapper);
|
|
|
if (projectContractArea1 == null) {
|
|
|
- //初始化
|
|
|
int res = projectContractAreaMapper.insert(projectContractArea);
|
|
|
return res > 0;
|
|
|
}
|
|
@@ -304,7 +294,6 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
|
|
|
@Override
|
|
|
public List<WbsTreeContractVO> tree2(String wbsId, String projectId, String contractId) {
|
|
|
- //方式2
|
|
|
List<WbsTreeContractVO> wbsTreeContractVOS = baseMapper.tree3(wbsId, projectId, contractId, null, null);
|
|
|
return buildWbsTreeByStream(wbsTreeContractVOS);
|
|
|
}
|