|
@@ -976,20 +976,25 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
|
|
|
projectContractArea.setProjectId(contractInfo.getPId());
|
|
|
projectContractArea.setIsDeleted(0);
|
|
|
projectContractArea.setContractId(String.valueOf(contractInfo.getId()));
|
|
|
- QueryWrapper<ProjectContractArea> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("project_id", contractInfo.getPId());
|
|
|
- queryWrapper.eq("contract_id", contractInfo.getId());
|
|
|
- queryWrapper.eq("province", position.get("province"));
|
|
|
- queryWrapper.eq("city", position.get("city"));
|
|
|
- queryWrapper.eq("county", position.get("district"));
|
|
|
- queryWrapper.eq("city_code", position.get("adcode"));
|
|
|
- queryWrapper.eq("is_deleted", contractInfo.getIsDeleted());
|
|
|
- ProjectContractArea projectContractArea1 = projectContractAreaMapper.selectOne(queryWrapper);
|
|
|
- if (projectContractArea1 == null) {
|
|
|
- int res = projectContractAreaMapper.insert(projectContractArea);
|
|
|
- return res > 0;
|
|
|
- }
|
|
|
- return true;
|
|
|
+// QueryWrapper<ProjectContractArea> queryWrapper = new QueryWrapper<>();
|
|
|
+// queryWrapper.eq("project_id", contractInfo.getPId());
|
|
|
+// queryWrapper.eq("contract_id", contractInfo.getId());
|
|
|
+// queryWrapper.eq("province", position.get("province"));
|
|
|
+// queryWrapper.eq("city", position.get("city"));
|
|
|
+// queryWrapper.eq("county", position.get("district"));
|
|
|
+// queryWrapper.eq("city_code", position.get("adcode"));
|
|
|
+// queryWrapper.eq("is_deleted", contractInfo.getIsDeleted());
|
|
|
+// ProjectContractArea projectContractArea1 = projectContractAreaMapper.selectOne(queryWrapper);
|
|
|
+// if (projectContractArea1 == null) {
|
|
|
+// int res = projectContractAreaMapper.insert(projectContractArea);
|
|
|
+// return res > 0;
|
|
|
+// }
|
|
|
+ //删除之前所有的地址,再新增
|
|
|
+ projectContractAreaMapper.delete(new LambdaQueryWrapper<ProjectContractArea>()
|
|
|
+ .eq(ProjectContractArea::getContractId,projectContractArea.getContractId()));
|
|
|
+ int res = projectContractAreaMapper.insert(projectContractArea);
|
|
|
+ return res > 0;
|
|
|
+// return true;
|
|
|
} catch (IOException e) {
|
|
|
throw new ServiceException("施工台账初始化失败");
|
|
|
}
|