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());