From d7f036faa28c2b157cda20226581dd3e0736f3ef Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 11 Jun 2024 09:25:24 +0800 Subject: [PATCH] Changes --- .../controller/goods/GoodsController.java | 32 +++++++++++++++---- .../business/BsOrderGoodsController.java | 2 +- .../service/order/OrderPaySuccessService.java | 14 ++++++-- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index a13e50f..2a45795 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -57,6 +57,9 @@ public class GoodsController { @Resource private UserCenter userCenter; + @Resource + private GoodsUserAddressService deliveryAddressService; + @RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "编辑商品信息") @@ -277,7 +280,7 @@ public class GoodsController { map.put("goodsBrand", goodsBrand); if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { - map.put("merId", userModel.getAccount().getId()); + map.put("merId", userModel.getAccount().getObjectId()); } map.put("type", type); @@ -399,11 +402,6 @@ public class GoodsController { SessionObject sessionObject = userCenter.getSessionObject(request); SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - - } - GoodsMsg goodsMsg = goodsMsgService.queryDetail(id); if (goodsMsg.getStatus() == 1) { @@ -441,6 +439,28 @@ public class GoodsController { } + @RequestMapping(value = "/findDeliveryAddressById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询收货地址详情") + public ResponseData findDeliveryAddressById( + @RequestParam(value = "id", required = true) Long id + ) { + try { + + GoodsUserAddress deliveryAddress = deliveryAddressService.queryDetail(id); + + if (deliveryAddress == null) { + log.error("GoodsDetailController -> findGoodsDetailById() error!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息"); + } + + return ResponseMsgUtil.success(deliveryAddress); + + } catch (Exception e) { + log.error("GoodsDetailController --> findGoodsDetailById() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java index c9565e1..1d1b4c5 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java @@ -76,7 +76,7 @@ public class BsOrderGoodsController { Map map = new HashMap<>(); if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { - map.put("merId", userModel.getAccount().getId()); + map.put("merId", userModel.getAccount().getObjectId()); } map.put("logisticsNo", logisticsNo); diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 5c37325..566da3e 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -60,7 +60,7 @@ public class OrderPaySuccessService { for (BsOrderChild childOrder : order.getOrderChildList()) { try { if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { - goods(order); + goods(order, childOrder); } else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { product(order, childOrder); } @@ -184,7 +184,7 @@ public class OrderPaySuccessService { * 实物产品 * @param order */ - public void goods(OrderModel order) throws Exception { + public void goods(OrderModel order, BsOrderChild childOrder) throws Exception { BsOrderGoods goodsOrder = bsOrderGoodsService.findGoodsOrder(order.getOrderNo()); if (goodsOrder == null) { @@ -193,7 +193,15 @@ public class OrderPaySuccessService { goodsMsgService.editSaleNum(goodsOrder.getGoodsId() , goodsOrder.getGoodsCount() , 1); - + goodsOrder.setTotalPrice(childOrder.getProductTotalPrice()); + goodsOrder.setTotalDeductionPrice(childOrder.getTotalDeductionPrice()); + goodsOrder.setCouponDiscountPrice(childOrder.getCouponDiscountPrice()); + goodsOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice()); + goodsOrder.setPayRealPrice(childOrder.getSurplusRefundPrice()); + goodsOrder.setPayChannel(order.getPayChannel()); + goodsOrder.setPayType(order.getPayType()); + goodsOrder.setPaySerialNo(order.getPaySerialNo()); + goodsOrder.setPayTime(order.getPayTime()); goodsOrder.setUpdateTime(new Date()); goodsOrder.setStatus(1); bsOrderGoodsService.update(goodsOrder);