liukangdong
2024-08-22 0aa2dd71fa4b989838f89aff2cac82950a70097f
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -104,6 +104,7 @@
                }
            }
            idPath = parent.getCompanyPath();
            company.setHkParentId(parent.getHkId());
            company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/");
            company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName());
        }
@@ -156,6 +157,7 @@
    }
    private boolean delHkOrg(Company company) {
        OrgDelRequest request =new OrgDelRequest();
        request.setIndexCodes(new String[]{company.getHkId()});
        BaseResponse<List<OrgUpdateFailureResponse>> result =  HKService.delBatchOrg(request);
        if(result !=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE)){
@@ -232,6 +234,7 @@
                .eq(Member::getIsdeleted,Constants.ZERO)) >0){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,该部门下存在人员信息,不能进行删除操作!");
        }
        Company company = new Company();
        company.setId(id);
        company.setEditDate(new Date());
@@ -241,7 +244,7 @@
        company.setHkDate(company.getHkDate());
        companyMapper.updateById(company);
        //下发海康安防平台
        if(StringUtils.isBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
        if(StringUtils.isNotBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织删除下发失败,请确认该组织无下级组织或组织人员信息~");
        }
    }
@@ -483,13 +486,11 @@
        companyMapper.updateById(company);
    }
    @Override
    public long count(Company company) {
        QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
        return companyMapper.selectCount(wrapper);
    }
    @Override
    public List<CompanyDTO> findCompanyTreePage(Integer type) {
@@ -501,7 +502,6 @@
        List<Company> companies = companyMapper.selectList(wrapper);
        return getCompanyTree( companies, null);
    }
    private List<CompanyDTO> getCompanyTree(List<Company> companies, String parentId){
        if (CollectionUtils.isEmpty(companies)){