dev-discount
袁野 4 years ago
parent bef91af72b
commit b95203afc4
  1. 3
      hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/BsOrganizationController.java

@ -206,8 +206,9 @@ public class BsCompanyController {
log.error("BsCompanyController --> updateCompany() error!", "该单位已经存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPANY_NAME_IS_EXIST_ERROR, "");
}
BsCompany companyId = bsCompanyService.getCompanyById(company.getId());
// 校验该区域是否存在公司
if (bsCompanyService.selectCompanyByRegion(secCompanyModel.getCompany().getRegionId()) != null && !secCompany.getId().equals(company.getId())) {
if (bsCompanyService.selectCompanyByRegion(secCompanyModel.getCompany().getRegionId()) != null && !companyId.getId().equals(company.getId())) {
log.error("BsCompanyController --> addCompanyAndUser() error!", "该区域分公司已存在");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "");
}

@ -90,7 +90,6 @@ public class BsOrganizationController {
try {
if (organization.getParentId() == null || organization.getCompanyId() == null
|| StringUtils.isBlank(organization.getName())
|| StringUtils.isBlank(organization.getAddress())
|| StringUtils.isBlank(organization.getPhone())) {
log.error("SecOrganizationController --> addOrganization() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -143,7 +142,6 @@ public class BsOrganizationController {
|| organization.getParentId() == null
|| organization.getCompanyId() == null
|| StringUtils.isBlank(organization.getName())
|| StringUtils.isBlank(organization.getAddress())
|| StringUtils.isBlank(organization.getPhone())) {
log.error("SecOrganizationController --> updateOrganization() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

Loading…
Cancel
Save