From 87276a1afc2b331e7a4b5c6b042a0a54d2226f86 Mon Sep 17 00:00:00 2001 From: yuanye Date: Mon, 15 Mar 2021 17:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bweb/controller/HighMerchantController.java | 8 ++++---- .../com/hai/service/impl/HighMerchantServiceImpl.java | 6 +++--- .../hai/service/impl/HighMerchantStoreServiceImpl.java | 2 +- 3 files changed, 8 insertions(+), 8 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 6141bdae..a389163c 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerchantController.java @@ -62,7 +62,7 @@ public class HighMerchantController { @ApiOperation(value = "增加商户") public ResponseData insertMerchant(@RequestBody HighMerchantModel highMerchant, HttpServletRequest request) { try { - SessionObject sessionObject = userCenter.getSessionObject(request); + SessionObject sessionObject = UserCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); if (userInfoModel.getBsCompany() == null) { log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限"); @@ -113,7 +113,7 @@ public class HighMerchantController { @ApiOperation(value = "修改商户") public ResponseData updateMerchant(@RequestBody HighMerchantModel highMerchant, HttpServletRequest request) { try { - SessionObject sessionObject = userCenter.getSessionObject(request); + SessionObject sessionObject = UserCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); if (userInfoModel.getBsCompany() == null) { log.error("HighMerchantController -> updateMerchant() error!","该主角色没有权限"); @@ -144,7 +144,7 @@ public class HighMerchantController { } // 校验账户手机号 - if (MemberValidateUtil.validatePhone(highMerchant.getSecUser().getTelephone())) { + if (!MemberValidateUtil.validatePhone(highMerchant.getSecUser().getTelephone())) { log.error("BsStudentController --> updateMerchant() error!", "请输入正确的电话号码"); throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR, ""); } @@ -226,7 +226,7 @@ public class HighMerchantController { @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { - SessionObject sessionObject = userCenter.getSessionObject(request); + SessionObject sessionObject = UserCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); if (userInfoModel.getBsCompany() == null) { log.error("HighMerchantController -> getMerchantList() error!","权限不足"); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java index 5374bc4c..22bb778b 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java @@ -41,7 +41,7 @@ public class HighMerchantServiceImpl implements HighMerchantService { highMerchant.getSecUser().setPassword(MD5Util.encode(highMerchant.getSecUser().getPassword().getBytes())); highMerchant.getSecUser().setAdminFlag(1); highMerchant.getSecUser().setStatus(1); - highMerchant.getSecUser().setRoleId(2L); + highMerchant.getSecUser().setRoleId(3L); highMerchant.getSecUser().setObjectType(2); highMerchant.getSecUser().setObjectId(highMerchant.getId()); highMerchant.getSecUser().setCreateTime(new Date()); @@ -70,7 +70,7 @@ public class HighMerchantServiceImpl implements HighMerchantService { public void updateStatus(Long id, Integer status) { // 查询商户 HighMerchantModel merchant = getMerchantById(id); - if(merchant != null) { + if(merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.MERCHANT_NOF_FOUND, ""); } merchant.setStatus(status); @@ -103,7 +103,7 @@ public class HighMerchantServiceImpl implements HighMerchantService { criteria.andCompanyIdEqualTo(MapUtils.getLongValue(map, "companyId")); } - if (MapUtils.getLong(map, "merchantKey") != null) { + if (StringUtils.isNotBlank(MapUtils.getString(map, "merchantKey"))) { criteria.andMerchantKeyEqualTo(MapUtils.getString(map, "merchantKey")); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java index ab515393..34d0e27b 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java @@ -42,7 +42,7 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService { highMerchantStore.getSecUser().setPassword(MD5Util.encode(highMerchantStore.getSecUser().getPassword().getBytes())); highMerchantStore.getSecUser().setAdminFlag(1); highMerchantStore.getSecUser().setStatus(1); - highMerchantStore.getSecUser().setRoleId(3L); + highMerchantStore.getSecUser().setRoleId(4L); highMerchantStore.getSecUser().setObjectType(3); highMerchantStore.getSecUser().setObjectId(highMerchantStore.getId()); highMerchantStore.getSecUser().setCreateTime(new Date());