From 5834b713bb459d98e3daae409af7a946764a311c Mon Sep 17 00:00:00 2001 From: 199901012 Date: Fri, 12 Mar 2021 21:49:42 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighMerchantController.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java index eddbe7b7..4e9fdf36 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java @@ -64,8 +64,12 @@ public class HighMerchantController { try { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); - if (highMerchant.getCompanyId() == null - || StringUtils.isBlank(highMerchant.getMerchantKey()) + if (userInfoModel.getBsCompany() == null) { + log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + + if (StringUtils.isBlank(highMerchant.getMerchantKey()) || StringUtils.isBlank(highMerchant.getMerchantName()) || StringUtils.isBlank(highMerchant.getTelephone()) || StringUtils.isBlank(highMerchant.getAddress()) @@ -91,6 +95,7 @@ public class HighMerchantController { highMerchant.setStatus(1); // 状态:0:不可用,1:可用 highMerchant.setCreateTime(new Date()); highMerchant.setUpdateTime(new Date()); + highMerchant.setCompanyId(userInfoModel.getBsCompany().getId()); highMerchant.setOperatorId(userInfoModel.getSecUser().getId()); highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName()); highMerchantService.insertMerchant(highMerchant); @@ -110,8 +115,11 @@ public class HighMerchantController { try { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + if (userInfoModel.getBsCompany() == null) { + log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } if (highMerchant.getId() == null - || highMerchant.getCompanyId() == null || StringUtils.isBlank(highMerchant.getMerchantKey()) || StringUtils.isBlank(highMerchant.getMerchantName()) || StringUtils.isBlank(highMerchant.getTelephone()) @@ -151,6 +159,7 @@ public class HighMerchantController { highMerchant.setUpdateTime(new Date()); highMerchant.setOperatorId(userInfoModel.getSecUser().getId()); highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName()); + highMerchant.setCompanyId(userInfoModel.getBsCompany().getId()); highMerchantService.updateMerchant(highMerchant); return ResponseMsgUtil.success(highMerchant);