diff --git a/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java b/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java index 76c66d5f..bb713a4e 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/BsCompanyController.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, ""); } diff --git a/hai-bweb/src/main/java/com/bweb/controller/BsOrganizationController.java b/hai-bweb/src/main/java/com/bweb/controller/BsOrganizationController.java index 42952442..b3853dfa 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/BsOrganizationController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/BsOrganizationController.java @@ -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, "");