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); }