rk
12 小时以前 9bc128d735e8921b14bac85dabbbcbc5b497c5d1
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -132,7 +132,7 @@
        company.setIsdeleted(Constants.ZERO);
        company.setHkStatus(Constants.ONE);
        company.setStatus(Constants.ZERO);
        company.setSortnum(0);//默认最上面
        company.setSortnum(Objects.isNull(company.getSortnum())?0:company.getSortnum());
        company.setHkDate(company.getCreateDate());
        company.setEditDate(company.getCreateDate());
        company.setEditor(company.getCreator());
@@ -292,7 +292,7 @@
        if(company.getId() == null|| StringUtils.isBlank(company.getName())){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(company.getType()!=null && !(company.getType() ==0 || company.getType() ==1)){
        if(company.getType()!=null && !(company.getType() ==0 || company.getType() ==1 || company.getType() ==-1)){
            throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,组织类型不正确,请按要求填写~");
        }
        //查询名称不能重复
@@ -324,6 +324,7 @@
        company.setType(null);
        company.setEditDate(new Date());
        company.setEditor(user.getId());
        company.setHkStatus(Constants.ONE);
        company.setHkDate(company.getHkDate());
        company.setHkId(StringUtils.defaultString(model.getHkId(),UUID.randomUUID().toString().replace("-","")));
@@ -961,7 +962,7 @@
        company.setCompanyNamePath(company.getName());//名称路径
        company.setHkParentId(rootOrgId);
        String idPath = "";
        if(StringUtils.isNotBlank(company.getErpParentId()) && !StringUtils.equals(company.getErpParentId(),Constants.ONE+"")){
        if(StringUtils.isNotBlank(company.getErpParentId())){
            Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda().eq(Company::getErpId,company.getErpParentId())
                    .eq(Company::getIsdeleted,Constants.ZERO).last(" limit 1 "));
            if(parent == null || Constants.equalsInteger(parent.getIsdeleted(),Constants.ONE)){
@@ -981,6 +982,7 @@
            company.setHkParentId(parent.getHkId());
            company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/");
            company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName());
            company.setParentId(parent.getId());
        }
        company.setHkCompanyPath(company.getCompanyNamePath());
        company.setCreateDate(new Date());
@@ -1009,7 +1011,7 @@
    public Company syncDDEditCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse,Company company){
        company.setErpParentId(deptGetResponse.getParentId().toString());
        String idPath = "";
        if(StringUtils.isNotBlank(company.getErpParentId()) && !StringUtils.equals(company.getErpParentId(),Constants.ONE+"")){
        if(StringUtils.isNotBlank(company.getErpParentId())){
            Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda().eq(Company::getErpId,company.getErpParentId())
                    .eq(Company::getIsdeleted,Constants.ZERO).last("limit 1 "));
            if(parent == null || Constants.equalsInteger(parent.getIsdeleted(),Constants.ONE)){
@@ -1026,6 +1028,7 @@
            company.setHkParentId(parent.getHkId());
            company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/");
            company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName());
            company.setParentId(parent.getId());
        }
        company.setName(deptGetResponse.getName());