'提交代码'

dev-discount
199901012 4 years ago
parent 8988856570
commit 5834b713bb
  1. 15
      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);

Loading…
Cancel
Save