From da19bc056e5b58ff74e7064109251bd51a056a12 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 5 Apr 2021 17:41:36 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/HighOrderController.java | 18 +++++++++--------- .../com/hai/schedule/HighCouponSchedule.java | 2 +- .../com/hai/schedule/HighDiscountSchedule.java | 2 +- .../com/hai/schedule/HighOrderSchedule.java | 2 +- .../java/com/hai/schedule/SynchronizeCNPC.java | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index ffea0fa8..e14c3ec3 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -98,8 +98,12 @@ public class HighOrderController { log.error("HighOrderController --> addOrder() error!", "未找到卡卷信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); } - - // 校验优惠券是否可用 + // 是否达到限购数量 + if (highCouponService.userBuyLimitNumber(userInfoModel.getHighUser().getId(), coupon.getId()) == true) { + log.error("HighOrderController --> addOrder() error!", "已达到限购数量"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",已达到限购数量"); + } + // 校验优惠券是否可用 如果使用优惠券就只能使用卡券的原价 if (highOrder.getMemDiscountId() != null) { List discountCouponRelList = highDiscountCouponRelService.getRelByCoupon(coupon.getId()); if (discountCouponRelList.size() > 0) { @@ -109,14 +113,11 @@ public class HighOrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用优惠券"); } } + childOrder.setGoodsPrice(coupon.getSalesPrice()); + } else { + childOrder.setGoodsPrice(coupon.getDiscountPrice()); } - - // 是否到底限购数量 - if (highCouponService.userBuyLimitNumber(userInfoModel.getHighUser().getId(), coupon.getId()) == true) { - log.error("HighOrderController --> addOrder() error!", "已达到限购数量"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",已达到限购数量"); - } if (highCouponCodeService.getStockCountByCoupon(coupon.getId()) <= 0) { log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); @@ -124,7 +125,6 @@ public class HighOrderController { childOrder.setGoodsName(coupon.getCouponName()); childOrder.setGoodsImg(coupon.getCouponImg()); childOrder.setGoodsSpecName("默认"); - childOrder.setGoodsPrice(coupon.getDiscountPrice()); } if (childOrder.getGoodsType() == 2) { diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java index ec8b0a5f..68c564db 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighCouponSchedule.java @@ -30,7 +30,7 @@ public class HighCouponSchedule { * @Date 2021/4/4 22:44 **/ // @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 - //@Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行 + @Scheduled(cron = "0 0 0 * * ?") //每天 凌晨0点执行 public void expiredCoupon() { // 查询过期的卡券 List userCoupons = highUserCouponService.getOverdueCoupon(); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java index 8fd41af8..b370a79c 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighDiscountSchedule.java @@ -29,7 +29,7 @@ public class HighDiscountSchedule { * @Description 处理过期的优惠券 * @Date 2021/4/4 22:44 **/ - //@Scheduled(cron = "0 0 0 * * ?") //每1分钟执行一次 + @Scheduled(cron = "0 0 0 * * ?") //每1分钟执行一次 public void expiredDiscount() { List expiredDiscount = highDiscountUserRelService.getExpiredDiscount(); for (HighDiscountUserRel rel : expiredDiscount) { diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index 9573b7d0..789bef83 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -33,7 +33,7 @@ public class HighOrderSchedule { * @Description 取消订单 15分钟 * @Date 2021/4/4 22:45 **/ - //@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 public void cancelOrder() { List orderList = highOrderService.getCloseOrder(); if (orderList != null && orderList.size() > 0) { diff --git a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java index 9bbdd083..21d355fe 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java +++ b/hai-schedule/src/main/java/com/hai/schedule/SynchronizeCNPC.java @@ -29,7 +29,7 @@ public class SynchronizeCNPC { private static final String[] HEX_DIGITS = {"0" ,"1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; - @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + //@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 public void certification() { Map tokenMap = new HashMap<>(); tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); From b82344f3af20f7bf8db0830a5349d5eba56afc73 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 5 Apr 2021 19:33:55 +0800 Subject: [PATCH 2/6] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/HighDiscountAgentRelController.java | 4 ++-- .../com/hai/service/impl/HighDiscountUserRelServiceImpl.java | 3 +++ .../main/java/com/hai/service/impl/HighOrderServiceImpl.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java index ae436423..066d1fde 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java @@ -97,7 +97,7 @@ public class HighDiscountAgentRelController { // 是否已分配 if (highDiscountAgentRelService.getRelByDiscountAgent(highDiscountAgentRel.getDiscountId(), highDiscountAgentRel.getAgentId()) != null) { log.error("HighDiscountAgentRelController -> insertDiscountAgent() error!", discount.getDiscountName() + "重复分配给" + agent.getAgentName()); - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, discount.getDiscountName() + "重复分配给" + agent.getAgentName()); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, discount.getDiscountName() + "重复分配给" + agent.getAgentName()); } highDiscountAgentRel.setCreateTime(new Date()); highDiscountAgentRel.setStatus(1); @@ -110,7 +110,7 @@ public class HighDiscountAgentRelController { //参数 Map map = new HashMap<>(); map.put("type", QrCodeType.AGENT_QR_CODE); - map.put("code", AESEncodeUtil.aesEncrypt(Base64Util.encode(highDiscountAgentRel.getId().toString()))); + map.put("code", Base64Util.encode(AESEncodeUtil.aesEncrypt(highDiscountAgentRel.getId().toString()))); QRCodeGenerator.generateQRCodeImage(JSON.toJSONString(map), 350, 350, qrCodeUrl); highDiscountAgentRel.setQrCode(qrCodeImg); highDiscountAgentRelService.updateDiscountAgentRel(highDiscountAgentRel); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java index a7c4e060..04d06dce 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java @@ -52,6 +52,9 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic if (rel == null || rel.getHighDiscount() == null || rel.getAgentId() == null){ throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, ""); } + rel.setStockCount(rel.getStockCount() - 1); + highDiscountAgentRelService.updateDiscountAgentRel(rel); + // 校验卡卷状态 if (rel.getHighDiscount().getStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡券已下架"); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 9b7a735f..ed5c7935 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -367,7 +367,7 @@ public class HighOrderServiceImpl implements HighOrderService { HighDiscountUserRel rel = highDiscountUserRelService.getRelById(order.getMemDiscountId()); if (rel != null) { rel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 - rel.setUseTime(new Date()); + rel.setUseTime(null); highDiscountUserRelService.updateDiscountUserRel(rel); } } From e497a2df2d525004ced0dac21eca004a268b64b2 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 5 Apr 2021 19:34:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cweb/controller/HighOrderController.java | 3 ++- .../java/com/hai/service/impl/HighOrderServiceImpl.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index ffea0fa8..4f3d53e2 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -152,7 +152,8 @@ public class HighOrderController { // 累计订单价格 totalPrice = totalPrice.add(childOrder.getTotalPrice()); } - + highOrder.setTotalPrice(totalPrice); + // 是否使用了优惠券 if (highOrder.getMemDiscountId() != null) { // 卡优惠券信息 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 9b7a735f..2f4a897c 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -394,6 +394,15 @@ public class HighOrderServiceImpl implements HighOrderService { HighDiscountUserRelExample example = new HighDiscountUserRelExample(); HighDiscountUserRelExample.Criteria criteria = example.createCriteria(); + if (userId != null) { + criteria.andUserIdEqualTo(userId); + } + + if (status != null) { + criteria.andStatusEqualTo(status); + } + + example.setOrderByClause("create_time desc"); return highDiscountUserRelMapper.selectByExample(example).size(); } } From dd480f181050a0df148d801fd10c0f49b9526291 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 5 Apr 2021 20:41:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?'=E6=8F=90=E4=BA=A4diam'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/HighOrderController.java | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 676e6412..496a26e1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -79,6 +79,16 @@ public class HighOrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + HighDiscountUserRel highDiscountUserRel = null; + if (highOrder.getMemDiscountId() != null) { + // 卡优惠券信息 + highDiscountUserRel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId()); + if (highDiscountUserRel == null || highDiscountUserRel.getStatus() != 1) { + log.error("HighOrderController --> addOrder() error!", "优惠券状态错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误"); + } + } + BigDecimal totalPrice = new BigDecimal("0"); for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { if (childOrder.getGoodsType() == null || childOrder.getGoodsId() == null || childOrder.getSaleCount() == null) { @@ -104,10 +114,11 @@ public class HighOrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, coupon.getCouponName() + ",已达到限购数量"); } // 校验优惠券是否可用 如果使用优惠券就只能使用卡券的原价 - if (highOrder.getMemDiscountId() != null) { + if (highDiscountUserRel != null) { List discountCouponRelList = highDiscountCouponRelService.getRelByCoupon(coupon.getId()); if (discountCouponRelList.size() > 0) { - List collect = discountCouponRelList.stream().filter(o -> o.getDiscountId().equals(highOrder.getMemDiscountId())).collect(Collectors.toList()); + HighDiscountUserRel finalHighDiscountUserRel = highDiscountUserRel; + List collect = discountCouponRelList.stream().filter(o -> o.getDiscountId().equals(finalHighDiscountUserRel.getDiscountId())).collect(Collectors.toList()); if (collect == null || collect.size() == 0) { log.error("HighOrderController --> addOrder() error!", "无法使用优惠券"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法使用优惠券"); @@ -156,22 +167,17 @@ public class HighOrderController { // 是否使用了优惠券 if (highOrder.getMemDiscountId() != null) { - // 卡优惠券信息 - HighDiscountUserRel rel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId()); - if (rel == null || rel.getStatus() != 1) { - log.error("HighOrderController --> addOrder() error!", "优惠券状态错误"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券状态错误"); - } - highOrder.setMemDiscountName(rel.getHighDiscount().getDiscountName()); + + highOrder.setMemDiscountName(highDiscountUserRel.getHighDiscount().getDiscountName()); // 卡卷类型 1:满减 2:抵扣 3:折扣 - if (rel.getHighDiscount().getDiscountType() == 1) { + if (highDiscountUserRel.getHighDiscount().getDiscountType() == 1) { // 如果订单总额 小于 满减价格 - if (highOrder.getTotalPrice().compareTo(rel.getHighDiscount().getDiscountCondition()) > 1) { + if (highOrder.getTotalPrice().compareTo(highDiscountUserRel.getHighDiscount().getDiscountCondition()) > 1) { log.error("HighOrderController --> addOrder() error!", "订单未达到满减额度"); - throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+rel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "订单未达到"+highDiscountUserRel.getHighDiscount().getDiscountCondition()+"元,无法使用此优惠券"); } // 订单总额 - 满减额度 - BigDecimal total = highOrder.getTotalPrice().subtract(rel.getHighDiscount().getDiscountPrice()); + BigDecimal total = highOrder.getTotalPrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice()); // 如果总额小于0 if (total.compareTo(new BigDecimal("0")) == -1) { highOrder.setTotalPrice(new BigDecimal("0")); @@ -181,9 +187,9 @@ public class HighOrderController { } // 卡卷类型 1:满减 2:抵扣 3:折扣 - if (rel.getHighDiscount().getDiscountType() == 2) { + if (highDiscountUserRel.getHighDiscount().getDiscountType() == 2) { // 订单总额 - 满减额度 - BigDecimal total = highOrder.getTotalPrice().subtract(rel.getHighDiscount().getDiscountPrice()); + BigDecimal total = highOrder.getTotalPrice().subtract(highDiscountUserRel.getHighDiscount().getDiscountPrice()); // 如果总额小于0 if (total.compareTo(new BigDecimal("0")) == -1) { highOrder.setTotalPrice(new BigDecimal("0")); @@ -193,9 +199,9 @@ public class HighOrderController { } // 卡卷类型 1:满减 2:抵扣 3:折扣 - if (rel.getHighDiscount().getDiscountType() == 3) { + if (highDiscountUserRel.getHighDiscount().getDiscountType() == 3) { // 折扣除100 - BigDecimal discountPrice = rel.getHighDiscount().getDiscountPrice().divide(new BigDecimal("100")); + BigDecimal discountPrice = highDiscountUserRel.getHighDiscount().getDiscountPrice().divide(new BigDecimal("10")); // 订单总额 * 折扣 BigDecimal total = highOrder.getTotalPrice().multiply(discountPrice); highOrder.setTotalPrice(total); @@ -206,7 +212,7 @@ public class HighOrderController { highOrder.setMemId(userInfoModel.getHighUser().getId()); highOrder.setMemName(userInfoModel.getHighUser().getName()); highOrder.setMemPhone(userInfoModel.getHighUser().getPhone()); - highOrder.setPayPrice(totalPrice); + highOrder.setPayPrice(highOrder.getTotalPrice()); highOrder.setCreateTime(new Date()); highOrder.setOrderStatus(1); From 7faf660e8083862785348d4f22d60a8f7b8f5baa Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 5 Apr 2021 21:06:22 +0800 Subject: [PATCH 5/6] =?UTF-8?q?'=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hai/entity/HighOrder.java | 10 ++++++++++ .../hai/service/impl/HighCouponCodeServiceImpl.java | 13 +++++++++++++ .../com/hai/service/impl/HighCouponServiceImpl.java | 6 ++++++ .../com/hai/service/impl/HighOrderServiceImpl.java | 5 +++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index 87eba376..89f50ac9 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -125,6 +125,16 @@ public class HighOrder implements Serializable { private List highChildOrderList; + private HighDiscount highDiscount; + + public HighDiscount getHighDiscount() { + return highDiscount; + } + + public void setHighDiscount(HighDiscount highDiscount) { + this.highDiscount = highDiscount; + } + public List getHighChildOrderList() { return highChildOrderList; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java index ebfa787e..b1f5490a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponCodeServiceImpl.java @@ -11,6 +11,7 @@ import com.hai.dao.HighCouponCodeMapperExt; import com.hai.entity.*; import com.hai.model.UserInfoModel; import com.hai.service.HighCouponCodeService; +import com.hai.service.HighCouponService; import com.hai.service.HighOrderService; import com.hai.service.HighUserCouponService; import org.apache.commons.collections4.MapUtils; @@ -42,6 +43,9 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { @Resource private HighOrderService highOrderService; + @Resource + private HighCouponService highCouponService; + @Resource private HighUserCouponService highUserCouponService; @@ -87,6 +91,15 @@ public class HighCouponCodeServiceImpl implements HighCouponCodeService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_CODE_OVERDUE, ""); } + // 卡券信息 + HighCoupon coupon = highCouponService.getCouponById(salesCode.getCouponId()); + if (coupon == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_DISCOUNT, ""); + } + // 卡券来源:1.中石化 + if (coupon.getCouponSource() == 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "此卡券无法消核"); + } salesCode.setStoreId(userInfoModel.getMerchantStore().getId()); salesCode.setConsumeTime(new Date()); salesCode.setStatus(3); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 1ed1cdb4..f698fa71 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -349,6 +349,12 @@ public class HighCouponServiceImpl implements HighCouponService { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } + if (MapUtils.getInteger(map, "couponSource") != null) { + criteria.andCouponSourceEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andCouponSourceNotEqualTo(2); + } + example.setOrderByClause("create_time desc"); List coupons = highCouponMapper.selectByExample(example); if (coupons != null && coupons.size() > 0) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 0d441ee8..fab67a21 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -264,6 +264,9 @@ public class HighOrderServiceImpl implements HighOrderService { return null; } order.setHighChildOrderList(getChildOrderByOrder(order.getId())); + if (order.getMemDiscountId() != null) { + order.setHighDiscount(highDiscountUserRelService.getRelById(order.getMemDiscountId()).getHighDiscount()); + } return order; } @@ -383,8 +386,6 @@ public class HighOrderServiceImpl implements HighOrderService { criteria.andMemIdEqualTo(memId); criteria.andOrderStatusEqualTo(status); - - return highOrderMapper.selectByExample(example).size(); } From 8f8a13322d8508392da5851d9cf02ce55faafd5a Mon Sep 17 00:00:00 2001 From: 199901012 Date: Mon, 5 Apr 2021 21:06:42 +0800 Subject: [PATCH 6/6] =?UTF-8?q?'=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/cweb/controller/HighOrderController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 676e6412..ff6e6f2c 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -212,7 +212,7 @@ public class HighOrderController { highOrderService.insertOrder(highOrder); - return ResponseMsgUtil.success(highOrder); + return ResponseMsgUtil.success(getOrderById(highOrder.getId())); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!",e);