Bladeren bron

7天21天强度修改

qianxb 1 jaar geleden
bovenliggende
commit
22c28bb4bb

+ 6 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/MeterContractInfo.java

@@ -88,5 +88,11 @@ public class MeterContractInfo extends BaseEntity {
     @ApiModelProperty(value = "中期计量最高支付比例")
     private BigDecimal middlePayRatio;
 
+    @ApiModelProperty(value = "7天强度")
+    private BigDecimal sevenRatio;
+
+    @ApiModelProperty(value = "28天强度")
+    private BigDecimal twentyEightRatio;
+
 }
 

+ 1 - 1
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MeterLinkWbsInfoVO.java

@@ -17,7 +17,7 @@ public class MeterLinkWbsInfoVO {
     @ApiModelProperty(value = "节点审批状态")
     private Integer appStatus;
 
-    @ApiModelProperty(value = "节点最大附件type值")
+    @ApiModelProperty(value = "节点所有附件type值")
     private Integer maxType;
 
 }

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -908,6 +908,10 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                         throw new ServiceException("请检查整体结算比例是否在规定范围");
                     }
                 }
+                if ((meterContractInfo.getSevenRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getSevenRatio().compareTo(new BigDecimal("100")) > 0)
+                        || (meterContractInfo.getTwentyEightRatio().compareTo(BigDecimal.ZERO) < 0 || meterContractInfo.getTwentyEightRatio().compareTo(new BigDecimal("100")) > 0)){
+                    throw new ServiceException("强度比例必须在0-100范围内");
+                }
                 R r = meterContractInfoClient.saveOrUpdate(meterContractInfo);
                 if (r.getCode() != 200){
                     throw new ServiceException("保存合同计量相关信息失败,原因:"+r.getMsg());

+ 3 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractInventoryFormController.java

@@ -63,7 +63,7 @@ public class ContractInventoryFormController extends BladeController {
 	/**
 	 * 获取合同清单树
 	 */
-	@GetMapping("getFormTree")
+	@GetMapping("/getFormTree")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "获取合同清单树", notes = "返回全加载树")
 	@ApiImplicitParams(value = {
@@ -78,7 +78,7 @@ public class ContractInventoryFormController extends BladeController {
 	/**
 	 * 获取合同清单树懒加载
 	 */
-	@GetMapping("lazyTree")
+	@GetMapping("/lazyTree")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "获取合同清单树-懒加载", notes = "返回懒加载树,首次节点父id传0")
 	@ApiImplicitParams(value = {
@@ -92,7 +92,7 @@ public class ContractInventoryFormController extends BladeController {
 	}
 
 
-	@PostMapping("importExcel")
+	@PostMapping("/importExcel")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "导入excel", notes = "导入excel")
 	public R<String> importExcel(@RequestParam("file") MultipartFile file,Long projectId, Long contractId) {

+ 40 - 25
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MiddleMeterApplyServiceImpl.java

@@ -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()+",");