Sfoglia il codice sorgente

报价协议修改

wks 3 anni fa
parent
commit
6b3959ed29

+ 4 - 1
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlFactorDto.java

@@ -3,8 +3,10 @@ package com.ydtech.modules.protocol.entity.dto;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.util.ObjectUtils;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,7 +30,8 @@ public class PtlFactorDto {
     private Integer minValue;
 
     public List<String> getParameter() {
-        return parameter.stream().filter(x -> !x.isEmpty()).collect(Collectors.toList());
+        return ObjectUtils.isEmpty(parameter) ? Collections.emptyList() :
+                parameter.stream().filter(x -> !x.isEmpty()).collect(Collectors.toList());
     }
 
     public Integer getMaxValue() {

+ 1 - 2
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementUnderwritingRulesServiceImpl.java

@@ -44,8 +44,7 @@ public class PtlAgreementUnderwritingRulesServiceImpl extends ServiceImpl<PtlAgr
 
             ptlAgreementUnderwritingRules.forEach(x -> {
                 Map<String, PtlFactorDto> mapPtlFactorDto = PtlAgreementCostsFactorSaveDto.toMapPtlFactorDto(x.getRulesFactor());
-                PtlFactorDto ptlFactorDto = mapPtlFactorDto.get("LicenseNo");
-                List<String> licenseNo = ObjectUtils.isEmpty(ptlFactorDto) ? Collections.emptyList() : ptlFactorDto.getParameter();
+                List<String> licenseNo = mapPtlFactorDto.get("LicenseNo").getParameter();
                 map.put(x.getAgreementId(), licenseNo);
             });
         }