From 88244b756031ad2ef60b32b8190fb87df338d818 Mon Sep 17 00:00:00 2001 From: wst <2450473462@qq.com> Date: Sun, 1 Dec 2024 10:29:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skyeye/order/conroller/OrderController.java | 14 ++++++++++++++ .../com/skyeye/order/service/OrderService.java | 2 ++ .../order/service/impl/OrderServiceImpl.java | 17 ++++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/conroller/OrderController.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/conroller/OrderController.java index 99a6e67d..000f08f5 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/conroller/OrderController.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/conroller/OrderController.java @@ -185,4 +185,18 @@ public class OrderController { public void generatePayOrderRrCode(InputObject inputObject, OutputObject outputObject) { orderService.generatePayOrderRrCode(inputObject, outputObject); } + + /** + * 后台修改支付状态 + * + * @param inputObject 入参以及用户信息等获取对象 + * @param outputObject 出参以及提示信息的返回值对象 + */ + @ApiOperation(id = "updateOrderToPayState", value = "后台修改支付状态", method = "POST", allUse = "1") + @ApiImplicitParams({ + @ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")}) + @RequestMapping("/post/OrderController/updateOrderToPayState") + public void updateOrderToPayState(InputObject inputObject, OutputObject outputObject){ + orderService.updateOrderToPayState(inputObject, outputObject); + } } \ No newline at end of file diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderService.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderService.java index a3b51a91..4a40e801 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderService.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderService.java @@ -33,4 +33,6 @@ public interface OrderService extends SkyeyeBusinessService { void generatePayOrderRrCode(InputObject inputObject, OutputObject outputObject); void changeOrderAdjustPrice(InputObject inputObject, OutputObject outputObject); + + void updateOrderToPayState(InputObject inputObject, OutputObject outputObject); } diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java index f2fc5996..4dd9bb70 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java @@ -337,9 +337,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl case "5":// 处理中 stateList = Arrays.asList(new Integer[]{ ShopOrderState.REFUNDING.getKey(), // 退款中 - ShopOrderState.SALESRETURNING.getKey(),//退货中 - ShopOrderState.EXCHANGEING.getKey()});//换货中 break; case "6": // 申请记录 @@ -387,6 +385,18 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl refreshCache(params.get("id").toString()); } + @Override + public void updateOrderToPayState(InputObject inputObject, OutputObject outputObject) { + String orderId = inputObject.getParams().get("id").toString(); + if (StrUtil.isEmpty(orderId)) { + return; + } + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq(CommonConstants.ID, orderId); + updateWrapper.set(MybatisPlusUtil.toColumns(Order::getState), ShopOrderState.UNDELIVERED.getKey()); + refreshCache(orderId); + } + @Override public void deletePostpose(List ids) { orderItemService.deleteByPerentIds(ids); @@ -465,8 +475,6 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl Map payRresult = iPayService.payment(BeanUtil.beanToMap(one), channelCode, "", channelExtras, payProperties.getOrderNotifyUrl()).getBean(); Map payChannel = JSONUtil.toBean(payRresult.get("payChannel").toString(), null); Map payOrderRespDTO = JSONUtil.toBean(payRresult.get("payOrderRespDTO").toString(), null); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); updateWrapper.eq(CommonConstants.ID, id); updateWrapper.set(MybatisPlusUtil.toColumns(Order::getState), ShopOrderState.UNDELIVERED.getKey()); @@ -477,7 +485,6 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl one.getPayPrice(), payChannel.get("feeRate").toString())); updateWrapper.set(MybatisPlusUtil.toColumns(Order::getExtensionId), payOrderRespDTO.get("id").toString()); updateWrapper.set(MybatisPlusUtil.toColumns(Order::getExtensionNo), payOrderRespDTO.get("no").toString()); - update(updateWrapper); refreshCache(id); }