diff --git a/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java index eadf67b..b2ca19c 100644 --- a/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java +++ b/cweb/src/main/java/com/cweb/controller/group/OpenGroupController.java @@ -7,6 +7,7 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.CoordCommonUtil; import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsMer; import com.hfkj.entity.BsStore; import com.hfkj.entity.BsStoreGroupContent; import com.hfkj.entity.BsStoreGroupDetail; @@ -15,6 +16,7 @@ import com.hfkj.group.BsStoreGroupService; import com.hfkj.model.GroupContentModel; import com.hfkj.model.OpenStoreModel; import com.hfkj.model.ResponseData; +import com.hfkj.service.BsMerService; import com.hfkj.service.BsStoreService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -49,6 +51,9 @@ public class OpenGroupController { @Resource private BsStoreGroupProductService storeGroupProductService; + @Resource + private BsMerService merService; + @RequestMapping(value="/getStoreList",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "商户查询门店列表") @@ -140,6 +145,9 @@ public class OpenGroupController { bsStore.setBsStoreExtMsg(storeGroupService.findStoreExtMsgByStoreId(storeId)); bsStore.setBsStoreImg(storeGroupService.getBsStoreImgByList(map)); + BsMer bsMer = merService.getMerDetail(bsStore.getMerId()); + bsStore.setMerchantNo(bsMer.getMerNo()); + return ResponseMsgUtil.success(bsStore); } catch (Exception e) { @@ -165,4 +173,34 @@ public class OpenGroupController { } } + @RequestMapping(value="/getMerNo",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取订单号") + public ResponseData getMerNo(@RequestParam(value = "storeId" , required = true) Long storeId) { + try { + + Map map = new HashMap<>(); + map.put("storeId" , storeId); + + BsStore bsStore = bsStoreService.getStoreById(storeId); + + if (bsStore == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到门店信息!"); + } + + BsMer bsMer = merService.getMerDetail(bsStore.getMerId()); + + if (bsMer == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到商户信息!"); + } + + + return ResponseMsgUtil.success(bsMer.getMerNo()); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java b/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java index 0c01913..daf725a 100644 --- a/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java +++ b/service/src/main/java/com/hfkj/model/BsStoreExtMsgModel.java @@ -16,4 +16,6 @@ public class BsStoreExtMsgModel { private BsStoreExtMsg bsStoreExtMsg; + private String merchantNo; + }