From 632a92173ff5cb0720669a6d427bf8534d20a538 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 15 Nov 2023 11:08:31 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev --- .../com/web/controller/OrderController.java | 22 +++++++++++++++++++ .../java/com/hai/config/CommonSysConfig.java | 2 ++ .../java/com/hai/group/GroupCodeService.java | 1 + .../hai/group/impl/GroupCodeServiceImpl.java | 5 ++++- .../java/com/hai/model/GoodsOrderModel.java | 19 +++++----------- .../resources/dev/commonConfig.properties | 2 ++ 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/hai-order/src/main/java/com/web/controller/OrderController.java b/hai-order/src/main/java/com/web/controller/OrderController.java index f7f4b11b..1e3963d2 100644 --- a/hai-order/src/main/java/com/web/controller/OrderController.java +++ b/hai-order/src/main/java/com/web/controller/OrderController.java @@ -15,6 +15,8 @@ import com.hai.enum_type.UserObjectTypeEnum; import com.hai.goods.service.DeliveryAddressService; import com.hai.goods.service.GoodsLogisticsService; import com.hai.goods.service.GoodsOrderExtService; +import com.hai.group.GroupCodeService; +import com.hai.group.GroupService; import com.hai.model.GoodsOrderModel; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; @@ -77,6 +79,13 @@ public class OrderController { @Resource private HighUserService highUserService; + @Resource + private GroupService groupService; + + @Resource + private GroupCodeService groupCodeService; + + @RequestMapping(value="/create",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") @@ -299,6 +308,19 @@ public class OrderController { goodsOrderModel.setGoodsOrder(order); goodsOrderModel.setGoodsDeliveryAddress(deliveryAddress); + HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo()); + + JSONObject object = groupService.getGroupContent(highGroupOrder.getGroupId()); + + if (object.getString("return_code").equals("000000")) { + goodsOrderModel.setGroupData(object.getJSONObject("return_data")); + } + + Map map = new HashMap<>(); + map.put("orderId" , highOrder.getId()); + + HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); + goodsOrderModel.setHighGroupCode(highGroupCode); return ResponseMsgUtil.success(goodsOrderModel); diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 529c410b..abd1e599 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -142,4 +142,6 @@ public class CommonSysConfig { private String diandianwAppid; private String diandianwAppSecret; + private String groupCode; + } diff --git a/hai-service/src/main/java/com/hai/group/GroupCodeService.java b/hai-service/src/main/java/com/hai/group/GroupCodeService.java index a0b30e7c..d7990571 100644 --- a/hai-service/src/main/java/com/hai/group/GroupCodeService.java +++ b/hai-service/src/main/java/com/hai/group/GroupCodeService.java @@ -50,6 +50,7 @@ public interface GroupCodeService { */ HighGroupCode findGroupCode(Map map); + /** * @Author Sum1Dream * @Name findGroupCodeList diff --git a/hai-service/src/main/java/com/hai/group/impl/GroupCodeServiceImpl.java b/hai-service/src/main/java/com/hai/group/impl/GroupCodeServiceImpl.java index 69a3652a..bcc67a29 100644 --- a/hai-service/src/main/java/com/hai/group/impl/GroupCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/group/impl/GroupCodeServiceImpl.java @@ -60,6 +60,9 @@ public class GroupCodeServiceImpl implements GroupCodeService { if (MapUtils.getLong(map, "storeId") != null) { criteria.andSroreIdEqualTo(MapUtils.getLong(map, "storeId")); } + if (MapUtils.getLong(map, "orderId") != null) { + criteria.andOrderIdEqualTo(MapUtils.getLong(map, "orderId")); + } List list = highGroupCodeMapper.selectByExample(example); @@ -110,7 +113,7 @@ public class GroupCodeServiceImpl implements GroupCodeService { // 生成二维码 String qrCodeImg = highGroupCode.getGroupCode() +".png"; String qrCodeUrl = CommonSysConst.getSysConfig().getFileUrl() + "/groupCode/" + qrCodeImg; - QRCodeGenerator.generateQRCodeImage(highGroupCode.getGroupCode(), 350, 350, qrCodeUrl); + QRCodeGenerator.generateQRCodeImage(CommonSysConst.getSysConfig().getGroupCode() + highGroupCode.getGroupCode(), 350, 350, qrCodeUrl); highGroupCode.setCodeImgUrl(qrCodeUrl); updateGroupCode(highGroupCode); diff --git a/hai-service/src/main/java/com/hai/model/GoodsOrderModel.java b/hai-service/src/main/java/com/hai/model/GoodsOrderModel.java index 99060258..b8598764 100644 --- a/hai-service/src/main/java/com/hai/model/GoodsOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/GoodsOrderModel.java @@ -1,28 +1,21 @@ package com.hai.model; +import com.alibaba.fastjson.JSONObject; import com.hai.entity.GoodsDeliveryAddress; import com.hai.entity.GoodsOrder; +import com.hai.entity.HighGroupCode; import com.hai.entity.HighOrder; +import lombok.Data; +@Data public class GoodsOrderModel extends HighOrder { GoodsOrder goodsOrder; GoodsDeliveryAddress goodsDeliveryAddress; - public GoodsOrder getGoodsOrder() { - return goodsOrder; - } + JSONObject groupData; - public void setGoodsOrder(GoodsOrder goodsOrder) { - this.goodsOrder = goodsOrder; - } + HighGroupCode highGroupCode; - public GoodsDeliveryAddress getGoodsDeliveryAddress() { - return goodsDeliveryAddress; - } - - public void setGoodsDeliveryAddress(GoodsDeliveryAddress goodsDeliveryAddress) { - this.goodsDeliveryAddress = goodsDeliveryAddress; - } } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index f31b57e2..063a6795 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -143,3 +143,5 @@ blxPostUrl=https://vertical-formats-gateway.blx.bodata.cn:18443 diandianwPostUrl=http://www.diandianw.cn/youdianyou/ diandianwAppid=1016145002rmz7dkti3f5oqh1razswc0 diandianwAppSecret=msk48q5jinmpsfdgpcyryx6lhkoiii4s + +groupCode = https://gratia-pay.dctpay.com/cweb?accountId=0001&key=