|
@@ -11,8 +11,8 @@ import lombok.NoArgsConstructor;
|
|
|
|
|
|
|
|
import java.io.Serial;
|
|
import java.io.Serial;
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Data
|
|
@Data
|
|
|
public class BusinessInsuranceDTO implements Serializable {
|
|
public class BusinessInsuranceDTO implements Serializable {
|
|
@@ -47,14 +47,28 @@ public class BusinessInsuranceDTO implements Serializable {
|
|
|
@JsonProperty("chargPostInfos")
|
|
@JsonProperty("chargPostInfos")
|
|
|
private List<Object> chargPostInfos;
|
|
private List<Object> chargPostInfos;
|
|
|
|
|
|
|
|
- public BusinessInsuranceDTO(RiskInfoVo biRiskInfoVo, List<KindInfoVo> kindInfoVo) {
|
|
|
|
|
|
|
+ public BusinessInsuranceDTO(RiskInfoVo biRiskInfoVo, List<KindInfoVo> kindInfoVo,String seatCount) {
|
|
|
this.coefficientInfo = new CoefficientInfoDTO();
|
|
this.coefficientInfo = new CoefficientInfoDTO();
|
|
|
this.deviceInfos = List.of();
|
|
this.deviceInfos = List.of();
|
|
|
- this.itemKinds = kindInfoVo.stream().map(ItemKindsDTO::new).collect(Collectors.toList());
|
|
|
|
|
|
|
+ this.itemKinds = getKinds(kindInfoVo,seatCount);
|
|
|
this.productInfo = new ProductInfoDTO(biRiskInfoVo);
|
|
this.productInfo = new ProductInfoDTO(biRiskInfoVo);
|
|
|
this.specialInfos = List.of();
|
|
this.specialInfos = List.of();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public List<ItemKindsDTO> getKinds(List<KindInfoVo> kindInfoVo, String seatCount) {
|
|
|
|
|
+ BigDecimal seat = new BigDecimal(seatCount);
|
|
|
|
|
+ return kindInfoVo.stream()
|
|
|
|
|
+ .map(ItemKindsDTO::new)
|
|
|
|
|
+ .peek(dto -> {
|
|
|
|
|
+ if ("030009".equals(dto.getKindCode()) || "035803".equals(dto.getKindCode())) {
|
|
|
|
|
+ dto.setAmount(new BigDecimal(dto.getAmount()).multiply(seat).toString());
|
|
|
|
|
+ dto.setQuantity(String.valueOf(Integer.parseInt(seatCount) - 1));
|
|
|
|
|
+ }
|
|
|
|
|
+ }).toList();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
public BusinessInsuranceDTO(){
|
|
public BusinessInsuranceDTO(){
|
|
|
this.coefficientInfo = new CoefficientInfoDTO();
|
|
this.coefficientInfo = new CoefficientInfoDTO();
|
|
|
this.deviceInfos = List.of();
|
|
this.deviceInfos = List.of();
|