diff --git a/hai-order/src/main/java/com/web/controller/notify/GroupOrderController.java b/hai-order/src/main/java/com/web/controller/notify/GroupOrderController.java index 9216e918..aca574e3 100644 --- a/hai-order/src/main/java/com/web/controller/notify/GroupOrderController.java +++ b/hai-order/src/main/java/com/web/controller/notify/GroupOrderController.java @@ -1,10 +1,16 @@ package com.web.controller.notify; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.HighGroupCode; import com.hai.entity.HighGroupOrder; import com.hai.entity.HighOrder; import com.hai.group.GroupCodeService; +import com.hai.model.ResponseData; import com.hai.service.HighOrderService; import com.hai.service.impl.OutRechargeOrderServiceImpl; import io.swagger.annotations.Api; @@ -37,7 +43,8 @@ public class GroupOrderController { @RequestMapping(value = "/gorOrderNotify", method = RequestMethod.GET) @ApiOperation(value = "团购订单回调") @ResponseBody - public void gorOrderNotify(@RequestParam(name = "groupCode", required = false) String groupCode) { + public ResponseData gorOrderNotify(@RequestParam(name = "groupCode", required = false) String groupCode, + @RequestParam(name = "storeId", required = false) String storeId) { try { @@ -47,9 +54,15 @@ public class GroupOrderController { Map map = new HashMap<>(); map.put("groupCode" , groupCode); + map.put("storeId" , storeId); HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); + + if (highGroupCode == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相关核销券!"); + } + HighOrder highOrder = highOrderService.getOrderById(highGroupCode.getId()); HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo()); @@ -68,9 +81,10 @@ public class GroupOrderController { highOrderService.updateOrder(highOrder); log.info("============回调任务End============="); - + return ResponseMsgUtil.success("核销成功!"); } catch (Exception e) { log.error("WechatPayController --> wechatNotify() error!", e); + return ResponseMsgUtil.exception(e); } } 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 34efcfd1..9766fad3 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 @@ -112,9 +112,9 @@ public class GroupCodeServiceImpl implements GroupCodeService { // 生成二维码 String qrCodeImg = highGroupCode.getGroupCode() +".png"; - String qrCodeUrl = "/groupCode/" + qrCodeImg; + String qrCodeUrl = CommonSysConst.getSysConfig().getFileUrl() + "groupCode/" + qrCodeImg; QRCodeGenerator.generateQRCodeImage(CommonSysConst.getSysConfig().getGroupCode() + highGroupCode.getGroupCode(), 350, 350, qrCodeUrl); - highGroupCode.setCodeImgUrl(qrCodeUrl); + highGroupCode.setCodeImgUrl("/groupCode/" + qrCodeImg); updateGroupCode(highGroupCode); diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index b30fd1a0..6c492f11 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -1172,7 +1172,7 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { HighGroupOrder highGroupOrder = new HighGroupOrder(); if (objectMer.getString("return_code").equals("000000")) { - highGroupOrder.setMerNo(object.getString("return_data")); + highGroupOrder.setMerNo(objectMer.getString("return_data")); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("return_msg")); } diff --git a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java index b52fcf71..b69c797b 100644 --- a/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/CommonServiceImpl.java @@ -81,7 +81,7 @@ public class CommonServiceImpl implements CommonService { - private Map> dicCache = new HashMap>(); + private Map> dicCache = new HashMap<>(); private List citiesCache = new ArrayList<>();