cloudroam
2024-09-10 540b80dd4c3b3fdecc56e12792b485cc111b5530
1.新增筛选:已加价/未加价2.新增“售价”字段,售价=底价+加价
已修改4个文件
37 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/dto/request/flower/FlowerMarkupSpQueryDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/response/flower/FlowerMarkupSpListDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/flower/FlowerMarkupSpService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>