src/main/java/com/mzl/flower/dto/request/flower/FlowerMarkupSpQueryDTO.java
@@ -20,4 +20,7 @@ @ApiModelProperty(value = "合伙人ID") private Long partnerId; @ApiModelProperty(value = "是否加价") private String isFee; } src/main/java/com/mzl/flower/dto/response/flower/FlowerMarkupSpListDTO.java
@@ -67,4 +67,7 @@ @ApiModelProperty(value = "重量") private Double weight; @ApiModelProperty(value = "售价") private BigDecimal sellPrice; } src/main/java/com/mzl/flower/service/flower/FlowerMarkupSpService.java
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.util.List; @Slf4j @@ -77,6 +78,11 @@ if(ll != null && ll.size() > 0){ for(FlowerMarkupSpListDTO ss : ll){ ss.setPrice(getFinalPriceForPartner(dto.getPartnerId(), ss.getCategory(), ss.getFlowerId(), ss.getPrice(), ss.getLevel())); BigDecimal fee = ss.getFee(); if (fee == null) { fee = BigDecimal.ZERO; } ss.setSellPrice(ss.getPrice().add(fee)); } } @@ -90,6 +96,11 @@ if(ll != null && ll.size() > 0){ for(FlowerMarkupSpListDTO ss : ll){ ss.setPrice(getFinalPriceForPartner(dto.getPartnerId(), ss.getCategory(), ss.getFlowerId(), ss.getPrice(), ss.getLevel())); BigDecimal fee = ss.getFee(); if (fee == null) { fee = BigDecimal.ZERO; } ss.setSellPrice(ss.getPrice().add(fee)); } } src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml
@@ -33,6 +33,16 @@ ) ) </if> <if test="condition.isFee != null"> <choose> <when test="condition.isFee == 'markup'"> AND sp.fee > 0 </when> <otherwise> AND (sp.fee is null or sp.fee = 0) </otherwise> </choose> </if> ORDER BY f.id </select> @@ -68,6 +78,16 @@ ) ) </if> <if test="condition.isFee != null"> <choose> <when test="condition.isFee == 'markup'"> AND sp.fee > 0 </when> <otherwise> AND (sp.fee is null or sp.fee = 0) </otherwise> </choose> </if> ORDER BY f.id </select> </mapper>