From 43a1483cd4608d70b593e6ad22c91335212640da Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sat, 27 Mar 2021 22:08:17 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cweb/controller/HighOrderController.java | 16 ++++++++++++++++ .../hai/service/impl/HighOrderServiceImpl.java | 5 ++++- .../service/pay/impl/GoodsOrderServiceImpl.java | 2 ++ 3 files changed, 22 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 8a2c67fc..f6c92d21 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -167,6 +167,22 @@ public class HighOrderController { } } + @RequestMapping(value = "/cancelOrder", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "取消订单") + public ResponseData cancelOrder(@RequestParam(name = "orderId", required = true) Long orderId) { + try { + + highOrderService.cancelOrder(orderId); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighOrderController --> cancelOrder() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/getUserOrderList", method = RequestMethod.GET) @ResponseBody 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 8029c7c2..125dc511 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 @@ -142,6 +142,7 @@ public class HighOrderServiceImpl implements HighOrderService { if (highChildOrder.getGoodsType() == 1) { HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 + code.setReceiveTime(new Date()); highCouponCodeService.updateCouponCode(code); // 卡卷关联用户 @@ -150,6 +151,7 @@ public class HighOrderServiceImpl implements HighOrderService { highUserCoupon.setCouponId(code.getCouponId()); highUserCoupon.setUserId(highOrder.getMemId()); highUserCoupon.setCouponCodeId(code.getId()); + highUserCoupon.setCreateTime(new Date()); highUserCoupon.setUseEndTime(code.getUseEndTime()); highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCouponMapper.insert(highUserCoupon); @@ -230,7 +232,7 @@ public class HighOrderServiceImpl implements HighOrderService { @Override public List getCloseOrder() { - return null; + return highOrderMapperExt.getCloseOrder(); } @Override @@ -266,6 +268,7 @@ public class HighOrderServiceImpl implements HighOrderService { if (highChildOrder.getGoodsType() == 1) { // 查询卡卷详情 HighCouponCode couponCode = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); + couponCode.setChildOrderId(null); couponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 highCouponCodeService.updateCouponCode(couponCode); } diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index 1bc58098..aa703bb5 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -67,6 +67,7 @@ public class GoodsOrderServiceImpl implements PayService { highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId()); code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付 + code.setReceiveTime(new Date()); highCouponCodeService.updateCouponCode(code); // 卡卷关联用户 @@ -75,6 +76,7 @@ public class GoodsOrderServiceImpl implements PayService { highUserCoupon.setCouponId(code.getCouponId()); highUserCoupon.setUserId(order.getMemId()); highUserCoupon.setCouponCodeId(code.getId()); + highUserCoupon.setCreateTime(new Date()); highUserCoupon.setUseEndTime(code.getUseEndTime()); highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用 highUserCouponMapper.insert(highUserCoupon);