renkang
2024-11-21 b4eb1b683886899c4914f2a97961144624c46c74
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -67,6 +67,7 @@
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public Integer create(Company company) {
        company.setType(Constants.ONE);
        if(StringUtils.isBlank(company.getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
@@ -120,9 +121,9 @@
        company.setHkId(UUID.randomUUID().toString().replace("-",""));
        companyMapper.insert(company);
        //下发海康安防平台
        if(!addHkOrg(company)){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织同步下发失败,请稍后重试");
        }
//        if(!addHkOrg(company)){
//            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织同步下发失败,请稍后重试");
//        }
        Company com = new Company();
        com.setId(company.getId());
        com.setCompanyPath(idPath+company.getId()+"/");
@@ -243,9 +244,9 @@
        company.setHkDate(company.getHkDate());
        companyMapper.updateById(company);
        //下发海康安防平台
        if(StringUtils.isNotBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织删除下发失败,请确认该组织无下级组织或组织人员信息~");
        }
//        if(StringUtils.isNotBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
//            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织删除下发失败,请确认该组织无下级组织或组织人员信息~");
//        }
    }
    @Override