|
@@ -1152,6 +1152,9 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
if (contractInfo == null || contractInfo.getMiddlePayRatio() == null){
|
|
|
throw new ServiceException("后台未设置支付比例");
|
|
|
}
|
|
|
+ if (contractInfo.getSevenRatio() == null || contractInfo.getTwentyEightRatio() == null){
|
|
|
+ throw new ServiceException("后台未设置7天或28天强度支付比例");
|
|
|
+ }
|
|
|
//查询出当前合同段所有允许自动计量的合同计量单元信息,并携带关联WBS节点逗号拼接,并携带关联清单的id逗号拼接,并携带当前计量期下当前合同计量单元的id,逗号拼接
|
|
|
List<MeterTreeContractVO2> voList = baseMapper.getAllAutoMeterNode(contractId,periodId);
|
|
|
//过滤,如果不存在关联WBS节点则排除,如果不存在挂载清单也排除,如果已经计量也排除
|
|
@@ -1173,7 +1176,7 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
//关联wbsId分组
|
|
|
wbsInfoVOMap = vos.stream().collect(Collectors.toMap(l -> l.getId(), l -> l));
|
|
|
}
|
|
|
- //循环合同计量单元,过滤掉不符合要求的计量单元,
|
|
|
+ //循环合同计量单元,过滤掉不符合要求的计量单元
|
|
|
Iterator<MeterTreeContractVO2> iterator = voList.iterator();
|
|
|
//wbs拼接
|
|
|
StringBuilder str = new StringBuilder();
|
|
@@ -1183,39 +1186,51 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
|
|
|
StringBuilder str3 = new StringBuilder();
|
|
|
while (iterator.hasNext()){
|
|
|
MeterTreeContractVO2 vo2 = iterator.next();
|
|
|
+ //先去获取对应质检的相关数据
|
|
|
+ List<Long> linkWbsIds = Func.toLongList(vo2.getLinkWbs());
|
|
|
+ Boolean isApp = false;
|
|
|
+ Integer strength = null;
|
|
|
+ for (Long id : linkWbsIds) {
|
|
|
+ MeterLinkWbsInfoVO vo = wbsInfoVOMap.get(id);
|
|
|
+ if (vo.getAppStatus() != 2) {
|
|
|
+ isApp = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (vo.getMaxType() == 12) {
|
|
|
+ strength = 28;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if ((strength == null || strength != 28) && vo.getMaxType() == 11) {
|
|
|
+ strength = 7;
|
|
|
+ }
|
|
|
+ }
|
|
|
//为混凝土节点,则去找寻附件
|
|
|
if (vo2.getIsConcreteNode() == 1) {
|
|
|
- List<Long> linkWbsIds = Func.toLongList(vo2.getLinkWbs());
|
|
|
- Boolean isApp = false;
|
|
|
- Integer strength = null;
|
|
|
- for (Long id : linkWbsIds) {
|
|
|
- MeterLinkWbsInfoVO vo = wbsInfoVOMap.get(id);
|
|
|
- if (vo.getAppStatus() != 2) {
|
|
|
- isApp = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (vo.getMaxType() == 12) {
|
|
|
- strength = 28;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (vo.getMaxType() == 11) {
|
|
|
- strength = 7;
|
|
|
- }
|
|
|
- }
|
|
|
- //审批不过通过,附件不存在7天或28天,直接过滤
|
|
|
- if (isApp || strength == null) {
|
|
|
+ //附件不存在7天或28天,直接过滤
|
|
|
+ if (strength == null) {
|
|
|
iterator.remove();
|
|
|
continue;
|
|
|
}
|
|
|
//根据附件设置强度设置强度值
|
|
|
- if (strength == 7){
|
|
|
- vo2.setPayRatio(vo2.getSevenRatio());
|
|
|
+ if (strength == 28){
|
|
|
+ if (isApp){
|
|
|
+ iterator.remove();
|
|
|
+ continue;
|
|
|
+ }else {
|
|
|
+ vo2.setPayRatio(contractInfo.getTwentyEightRatio());
|
|
|
+ }
|
|
|
}else {
|
|
|
- vo2.setPayRatio(vo2.getTwentyEightRatio());
|
|
|
+ vo2.setPayRatio(contractInfo.getSevenRatio());
|
|
|
}
|
|
|
}else {
|
|
|
- //不为混凝土节点,直接设置强度值为后管合同段默认
|
|
|
- vo2.setPayRatio(contractInfo.getMiddlePayRatio());
|
|
|
+ //不为混凝土节点
|
|
|
+ //审批不通过,移除,审批通过则设置为后台比例
|
|
|
+ if (isApp) {
|
|
|
+ iterator.remove();
|
|
|
+ continue;
|
|
|
+ }else {
|
|
|
+ vo2.setPayRatio(contractInfo.getMiddlePayRatio());
|
|
|
+ }
|
|
|
}
|
|
|
//末尾拼接所有WBS节点,所有计量节点
|
|
|
str.append(vo2.getLinkWbs()+",");
|