From eee8816ebe11686552013e40f017ce80b4c82251 Mon Sep 17 00:00:00 2001 From: xhxu Date: Sat, 7 May 2022 11:07:13 +0800 Subject: [PATCH] //update channel --- .../controller/WxCouponController.java | 18 +++++++++++++++++- .../iformall/domain/vo/WxCouponChannelVo.java | 13 +++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index d928c999b..5e1f83a65 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -111,6 +111,7 @@ public class WxCouponController extends BaseController { if (wxCouponCVo == null) { return new ResultData(ErrorCode.COUPON_IS_EMPTY); } + wxCouponCVo.setSalePrice(couponCVo.getSalePrice()); wxCouponCVo.setRemainInventory(couponCVo.getRemainInventory()); wxCouponCVo.setStatus(couponCVo.getStatus()); } @@ -213,9 +214,18 @@ public class WxCouponController extends BaseController { } WxCouponCVo couponCVo = new WxCouponCVo(); + if(cc.getChannelPrice() != null){ + couponCVo.setSalePrice(cc.getChannelPrice()); + }else{ + couponCVo.setSalePrice(c.getSalePrice()); + } + if(cc.getChannelStock() != null){ + couponCVo.setRemainInventory(cc.getChannelStock()); + }else{ + couponCVo.setRemainInventory(c.getRemainInventory()); + } couponCVo.setId(cc.getId()); couponCVo.setCouponId(cc.getCouponId()); - couponCVo.setRemainInventory(c.getRemainInventory()); couponCVo.setStatus(c.getStatus()); return couponCVo; } @@ -260,6 +270,12 @@ public class WxCouponController extends BaseController { if(wxcv == null){ return null; } + if(cc.getChannelPrice() != null){ + wxcv.setSalePrice(cc.getChannelPrice()); + } + if(cc.getChannelStock() != null){ + wxcv.setRemainInventory(cc.getChannelStock()); + } wxcv.setId(cc.getId()); wxcv.setCouponId(cc.getCouponId()); wxcv.setTargetAd(cc.getTargetAd()); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java index 8f71a3406..f4d6e19a7 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java @@ -174,11 +174,20 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { */ public void setWxCoupon(WxCoupon c){ if(c != null){ - this.setRemainInventory(c.getRemainInventory()); + if(this.getChannelStock() == null){ + this.setRemainInventory(c.getRemainInventory()); + }else{ + this.setRemainInventory(this.getChannelStock()); + } + if(this.getChannelPrice() == null){ + this.setSalePrice(c.getSalePrice()); + }else{ + this.setSalePrice(this.getChannelPrice()); + } + this.setInventory(c.getInventory()); this.setCoverImg(c.getCoverImg()); this.setSubTitle(c.getSubTitle()); - this.setSalePrice(c.getSalePrice()); this.setUsePrice(c.getUsePrice()); this.setPrice(c.getPrice()); this.setTailPrice(c.getTailPrice());