diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java index 4a269c03..b57f9d17 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -112,7 +112,6 @@ public class HighDiscountController { if (highDiscount.getId() == null || StringUtils.isBlank(highDiscount.getDiscountName()) || StringUtils.isBlank(highDiscount.getDiscountImg()) - || StringUtils.isBlank(highDiscount.getDiscountCarouselImg()) || highDiscount.getEffectiveDay() == null || highDiscount.getSalesEndTime() == null) { log.error("HighDiscountController -> updateDiscount() error!","参数错误"); @@ -148,7 +147,7 @@ public class HighDiscountController { } - @RequestMapping(value="/updateDiscountStatus",method = RequestMethod.POST) + @RequestMapping(value="/updateDiscountStatus",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "修改优惠券状态") public ResponseData updateDiscountStatus(@RequestParam(name = "discountId", required = true) Long discountId, @@ -187,6 +186,7 @@ public class HighDiscountController { @RequestMapping(value="/getDiscountList",method = RequestMethod.GET) @ResponseBody + @ApiOperation(value = "查询优惠券列表") public ResponseData getDiscountList(@RequestParam(name = "discountKey", required = false) String discountKey, @RequestParam(name = "discountName", required = false) String discountName, diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountCouponRelController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountCouponRelController.java index 4dd37fa9..0a8161b2 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountCouponRelController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountCouponRelController.java @@ -49,7 +49,7 @@ public class HighDiscountCouponRelController { try { JSONObject jsonObject = JSONObject.parseObject(reqBody); Long discountId = jsonObject.getLong("discountId"); - String couponIdStr = jsonObject.getString("couponId"); + String couponIdStr = jsonObject.getString("couponIdStr"); if (discountId == null || StringUtils.isBlank(couponIdStr)) { log.error("HighDiscountCouponRelController -> insertDiscountCoupon() error!","参数错误"); @@ -110,9 +110,9 @@ public class HighDiscountCouponRelController { } } - @RequestMapping(value="/insertDiscount",method = RequestMethod.GET) + @RequestMapping(value="/getRelByDiscount",method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "根据卡卷 查询关联卡券") + @ApiOperation(value = "根据优惠券 查询关联卡券") public ResponseData getRelByDiscount(@RequestParam(name = "discountId", required = true) Long discountId) { try { diff --git a/hai-bweb/src/main/java/com/bweb/controller/LoginController.java b/hai-bweb/src/main/java/com/bweb/controller/LoginController.java index dc782524..53b32db6 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/LoginController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/LoginController.java @@ -60,6 +60,9 @@ public class LoginController { @Resource private SecPermissionService secPermissionService; + @Resource + private HighAgentService highAgentService; + @RequestMapping(value="/userLogin",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "机构用户登录({'loginName':'','password':''})") @@ -156,6 +159,20 @@ public class LoginController { } userInfoModel.setMerchantStore(merchantStore); + } else if (secUser.getObjectType() == 4) { + // 查询门店 + HighAgent highAgent = highAgentService.findByAgentMsgId(secUser.getObjectId()); + if(highAgent == null){ + log.error("login error!","未找到代理商"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, ""); + } + + if(highAgent.getStatus() != 1) { + log.error("login error!","未找到代理商"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, ""); + } + userInfoModel.setHighAgent(highAgent); + } else { log.error("login error!","用户信息错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, "");