diff --git a/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java b/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java index 719995e7..9482bc04 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java @@ -98,6 +98,7 @@ public class BsCompanyController { } //发布人员 SessionObject sessionObject = userCenter.getSessionObject(request); + if(sessionObject == null){ log.error("SecCompanyController --> updateCompany() error!", ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index 1d15f56b..15a0b0b0 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -95,7 +95,7 @@ public class HighCouponController { } // 查询商户 - HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getCompanyId()); + HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getMerchantId()); if (merchant == null) { log.error("HighCouponController -> insertCoupon() error!","未找到商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); @@ -259,16 +259,24 @@ public class HighCouponController { @RequestMapping(value="/getCouponList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "卡卷列表") - public ResponseData getCouponList(@RequestParam(name = "companyId", required = false) Long companyId, + public ResponseData getCouponList( @RequestParam(name = "merchantId", required = false) Long merchantId, @RequestParam(name = "couponName", required = false) String couponName, @RequestParam(name = "couponType", required = false) Integer couponType, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "pageSize", required = true) Integer pageSize) { + @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { + Map map = new HashMap<>(); - map.put("companyId", companyId); + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighCouponController -> getCouponList() error!","权限不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + map.put("companyId", userInfoModel.getBsCompany().getId()); map.put("merchantId", merchantId); map.put("couponName", couponName); map.put("couponType", couponType);