From 6197207d3edd10c7ca0c8924a31b42e4bc17a364 Mon Sep 17 00:00:00 2001 From: yuanye Date: Thu, 18 Mar 2021 16:44:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9daima?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bweb/controller/BsCompanyController.java | 1 + .../bweb/controller/HighCouponController.java | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) 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);