'提交代码'

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 { try {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (highMerchant.getCompanyId() == null if (userInfoModel.getBsCompany() == null) {
|| StringUtils.isBlank(highMerchant.getMerchantKey()) 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.getMerchantName())
|| StringUtils.isBlank(highMerchant.getTelephone()) || StringUtils.isBlank(highMerchant.getTelephone())
|| StringUtils.isBlank(highMerchant.getAddress()) || StringUtils.isBlank(highMerchant.getAddress())
@ -91,6 +95,7 @@ public class HighMerchantController {
highMerchant.setStatus(1); // 状态:0:不可用,1:可用 highMerchant.setStatus(1); // 状态:0:不可用,1:可用
highMerchant.setCreateTime(new Date()); highMerchant.setCreateTime(new Date());
highMerchant.setUpdateTime(new Date()); highMerchant.setUpdateTime(new Date());
highMerchant.setCompanyId(userInfoModel.getBsCompany().getId());
highMerchant.setOperatorId(userInfoModel.getSecUser().getId()); highMerchant.setOperatorId(userInfoModel.getSecUser().getId());
highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName()); highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName());
highMerchantService.insertMerchant(highMerchant); highMerchantService.insertMerchant(highMerchant);
@ -110,8 +115,11 @@ public class HighMerchantController {
try { try {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); 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 if (highMerchant.getId() == null
|| highMerchant.getCompanyId() == null
|| StringUtils.isBlank(highMerchant.getMerchantKey()) || StringUtils.isBlank(highMerchant.getMerchantKey())
|| StringUtils.isBlank(highMerchant.getMerchantName()) || StringUtils.isBlank(highMerchant.getMerchantName())
|| StringUtils.isBlank(highMerchant.getTelephone()) || StringUtils.isBlank(highMerchant.getTelephone())
@ -151,6 +159,7 @@ public class HighMerchantController {
highMerchant.setUpdateTime(new Date()); highMerchant.setUpdateTime(new Date());
highMerchant.setOperatorId(userInfoModel.getSecUser().getId()); highMerchant.setOperatorId(userInfoModel.getSecUser().getId());
highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName()); highMerchant.setOperatorName(userInfoModel.getSecUser().getUserName());
highMerchant.setCompanyId(userInfoModel.getBsCompany().getId());
highMerchantService.updateMerchant(highMerchant); highMerchantService.updateMerchant(highMerchant);
return ResponseMsgUtil.success(highMerchant); return ResponseMsgUtil.success(highMerchant);

Loading…
Cancel
Save