소스 검색

返回价格

LuoDLeo 2 달 전
부모
커밋
b719e85a6d

+ 1 - 0
src/main/java/org/springblade/modules/api/controller/ApiGoodsController.java

@@ -122,6 +122,7 @@ public class ApiGoodsController extends BladeController {
         GoodsInfoVO goodsInfoVO = GoodsInfoWrapper.build().entityVO(detail);
         goodsInfoVO.setCargoWayId(cargoWay.getId());
         goodsInfoVO.setCargoWayNo(cargoWay.getCargoNo());
+        goodsInfoVO.setDiscount(cargoWay.getDiscount());
         return R.data(goodsInfoVO);
     }
 

+ 4 - 0
src/main/java/org/springblade/modules/mall/vo/GoodsInfoVO.java

@@ -56,6 +56,10 @@ public class GoodsInfoVO extends GoodsInfo {
 	@ApiModelProperty(value = "货道编号")
 	private String cargoWayNo;
 
+    public BigDecimal getPaymentAmount() {
+        return super.getDiscount() == null ? super.getSalePrice() : super.getSalePrice().subtract(BigDecimal.valueOf(super.getDiscount()));
+    }
+
 	public String getAuditStatusDesc() {
 		return AuditStatusEnum.getNameByValue(this.getAuditStatus());
 	}