|
|
@ -374,7 +374,7 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper, |
|
|
|
totalPercent = totalPercent.substring(0, totalPercent.indexOf(".")); |
|
|
|
resultList.get(0).setTotalPercent(totalPercent); |
|
|
|
} |
|
|
|
// 封装ismodify
|
|
|
|
// 封装ismodify 判断是否显示 上传资料
|
|
|
|
resultList.stream().forEach(item -> { |
|
|
|
determineIsModify(projectId, item); |
|
|
|
}); |
|
|
@ -495,11 +495,13 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper, |
|
|
|
|
|
|
|
private void determineIsModify(String projectId, HuzhouPlaninfoOV item) { |
|
|
|
item.getChildren().forEach(childItem -> { |
|
|
|
// 判断子阶段是否需要填写实际合同金额,如果存在则支持重新上传
|
|
|
|
String taskLevel = childItem.getTaskLevel(); |
|
|
|
|
|
|
|
if (childItem.getTaskName().equals("合同签订")) { |
|
|
|
LambdaQueryWrapper<HuzhouPlaninfo> qw = new LambdaQueryWrapper<>(); |
|
|
|
qw.eq(HuzhouPlaninfo::getProjectId, projectId) |
|
|
|
.eq(HuzhouPlaninfo::getTaskName, "合同签订").eq(HuzhouPlaninfo::getIsfinish, "2"); |
|
|
|
.eq(HuzhouPlaninfo::getTaskName, "合同签订") |
|
|
|
.eq(HuzhouPlaninfo::getIsfinish, "2"); |
|
|
|
if (planInfoMapper.selectCount(qw) > 0 && contractinfoService.getPlanContractinfoByprojectId(projectId).size() < 1) { |
|
|
|
childItem.setIsmodify(true); |
|
|
|
log.info("----开启补偿接口重新上传合同金额-----"); |
|
|
@ -507,16 +509,31 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper, |
|
|
|
childItem.setIsmodify(false); |
|
|
|
} |
|
|
|
} else { |
|
|
|
Boolean flag = contractinfoService.hasContractinfoByTaskName(projectId, childItem.getTaskName()); |
|
|
|
if (flag) { |
|
|
|
childItem.setIsmodify(true); |
|
|
|
} else { |
|
|
|
childItem.setIsmodify(false); |
|
|
|
} |
|
|
|
// 判断子阶段是否需要填写实际合同金额,如果存在则支持重新上传
|
|
|
|
boolean isModify = contractinfoService.hasContractinfoByTaskName(projectId, childItem.getTaskName()); |
|
|
|
childItem.setIsmodify(isModify); |
|
|
|
} |
|
|
|
//gjh-上传资料显示逻辑
|
|
|
|
boolean isModify = isGreaterThanThreshold(taskLevel, "2.2"); |
|
|
|
childItem.setIsmodify(isModify); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 判断传入的 taskLevel 是否大于指定阈值(如 "2.3") |
|
|
|
* 前提:taskLevel 格式统一为 x.y,每个层级只有一位数字(如 "2.4", "3.0") |
|
|
|
* |
|
|
|
* @param taskLevel 当前任务层级 |
|
|
|
* @param thresholdLevel 阈值任务层级 |
|
|
|
* @return 如果 taskLevel > thresholdLevel,返回 true;否则 false |
|
|
|
*/ |
|
|
|
private boolean isGreaterThanThreshold(String taskLevel, String thresholdLevel) { |
|
|
|
if (taskLevel == null || thresholdLevel == null) { |
|
|
|
throw new IllegalArgumentException("taskLevel 和 thresholdLevel 不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
return taskLevel.compareTo(thresholdLevel) > 0; |
|
|
|
} |
|
|
|
private void dealMainTaskLevelIsFinish(String projectId, List<String> taskLevelList, List<HuzhouPlaninfo> subPlanInfoList, List<HuzhouPlaninfo> mainPlanInfoList) { |
|
|
|
for (String taskLevel : taskLevelList) { |
|
|
|
// 检查该 taskLevel 下的所有子项目是否都已完成
|
|
|
@ -1622,4 +1639,15 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper, |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Boolean deleteContractMoney(String projectid) { |
|
|
|
LambdaQueryWrapper<HuzhouContractinfo> deleteWrapper = new LambdaQueryWrapper<>(); |
|
|
|
deleteWrapper.eq(HuzhouContractinfo::getProjectId, projectid); |
|
|
|
boolean success = contractinfoService.remove(deleteWrapper); |
|
|
|
if(success){ |
|
|
|
log.info("删除原有合同金额成功!"); |
|
|
|
} |
|
|
|
return success; |
|
|
|
} |
|
|
|
} |
|
|
|