Commit 3c9cb86b by 周晓航

订单 详情 列表新增字段 couponInfos 用于一单多券需求

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 6f25594b
...@@ -1454,7 +1454,9 @@ public class OrderAdapter { ...@@ -1454,7 +1454,9 @@ public class OrderAdapter {
//积分抵扣金额 //积分抵扣金额
Long customerScoreAmount = 0L; Long customerScoreAmount = 0L;
String customerScorePrompt = null; String customerScorePrompt = null;
List<CouponInfoVo> couponInfos = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ordersBean.getAccountList())) { if (CollectionUtils.isNotEmpty(ordersBean.getAccountList())) {
// fisherman 组装一单多券 使用的券信息
for (AccountBeanV1 accountBean : ordersBean.getAccountList()) { for (AccountBeanV1 accountBean : ordersBean.getAccountList()) {
if (accountBean.getPrice() < 0 && !OldOrderAccountType.MONTH_CARD_TOTAL_DISCOUNT.getCode().equals(accountBean.getType())) { if (accountBean.getPrice() < 0 && !OldOrderAccountType.MONTH_CARD_TOTAL_DISCOUNT.getCode().equals(accountBean.getType())) {
discountTotalAmount = discountTotalAmount + (0 - accountBean.getPrice()); discountTotalAmount = discountTotalAmount + (0 - accountBean.getPrice());
...@@ -1485,6 +1487,7 @@ public class OrderAdapter { ...@@ -1485,6 +1487,7 @@ public class OrderAdapter {
couponInfoVo.setCouponCode(accountBean.getAccountId()); couponInfoVo.setCouponCode(accountBean.getAccountId());
couponInfoVo.setCouponName(accountBean.getName()); couponInfoVo.setCouponName(accountBean.getName());
couponInfoVo.setCouponAmount(accountBean.getPrice() < 0 ? 0 - accountBean.getPrice() : accountBean.getPrice()); couponInfoVo.setCouponAmount(accountBean.getPrice() < 0 ? 0 - accountBean.getPrice() : accountBean.getPrice());
// fisherman 后续已维护到 couponinfos ,请停止维护 该字段
responseVo.setCouponInfo(couponInfoVo); responseVo.setCouponInfo(couponInfoVo);
couponAmount = accountBean.getPrice() < 0 ? 0 - accountBean.getPrice() : accountBean.getPrice(); couponAmount = accountBean.getPrice() < 0 ? 0 - accountBean.getPrice() : accountBean.getPrice();
} }
...@@ -1501,8 +1504,16 @@ public class OrderAdapter { ...@@ -1501,8 +1504,16 @@ public class OrderAdapter {
if (OldOrderAccountType.FREIGHT_COUPON.getCode().equals(accountBean.getType())) { if (OldOrderAccountType.FREIGHT_COUPON.getCode().equals(accountBean.getType())) {
responseVo.setFreightCouponName(accountBean.getName()); responseVo.setFreightCouponName(accountBean.getName());
} }
if (OrderAccountType.verificationCoupon.contains(accountBean.getType())) {
CouponInfoVo couponInfoVo = new CouponInfoVo();
couponInfoVo.setCouponCode(accountBean.getAccountId());
couponInfoVo.setCouponName(accountBean.getName());
couponInfoVo.setCouponAmount(Math.abs(accountBean.getPrice()));
couponInfos.add(couponInfoVo);
}
} }
} }
responseVo.setCouponInfos(couponInfos);
responseVo.setDeliveryAmount(deliveryAmount); responseVo.setDeliveryAmount(deliveryAmount);
responseVo.setOriginalDeliveryAmount(originalDeliveryAmount); responseVo.setOriginalDeliveryAmount(originalDeliveryAmount);
responseVo.setPackageAmount(packageAmount); responseVo.setPackageAmount(packageAmount);
......
...@@ -16,7 +16,6 @@ import cn.freemud.entities.dto.PromotionMessageDto; ...@@ -16,7 +16,6 @@ import cn.freemud.entities.dto.PromotionMessageDto;
import cn.freemud.entities.dto.activity.PayGiftCheckAndJoinResponseDto; import cn.freemud.entities.dto.activity.PayGiftCheckAndJoinResponseDto;
import cn.freemud.entities.dto.activity.PayGiftCheckAndJoinResponseDtoNew; import cn.freemud.entities.dto.activity.PayGiftCheckAndJoinResponseDtoNew;
import cn.freemud.entities.dto.promotion.QueryHistoryGroupVO; import cn.freemud.entities.dto.promotion.QueryHistoryGroupVO;
import cn.freemud.entities.dto.promotion.QuerySpellGroupVo;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp;
...@@ -357,6 +356,8 @@ public class QueryOrderResponseVo { ...@@ -357,6 +356,8 @@ public class QueryOrderResponseVo {
/** /**
* 优惠券信息 * 优惠券信息
* 后续优惠券信息 以维护到 couponInfos 请停止使用该字段 20211026
* 记得和前端对接下 小程序版本 是否支持 couponInfos
*/ */
private CouponInfoVo couponInfo; private CouponInfoVo couponInfo;
...@@ -665,4 +666,12 @@ public class QueryOrderResponseVo { ...@@ -665,4 +666,12 @@ public class QueryOrderResponseVo {
//是否已开票,true已开票,默认false未开票 //是否已开票,true已开票,默认false未开票
private Boolean needInvoice; private Boolean needInvoice;
/**
* 可使用多张优惠券, 使用该字段展示所有使用的优惠券信息
* 包括 :
* cn.freemud.enums.OrderAccountType#verificationCoupon
* 后续 需要移除 该类里面的 couponinfo字段, 20211026
*/
private List<CouponInfoVo> couponInfos = new ArrayList<>();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment