| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private OrgAddRequest getOrgAddModel(Company c ) { |
| | | OrgAddRequest model = new OrgAddRequest(); |
| | |
| | | @Override |
| | | public String syncJdyCompany() { |
| | | //{ |
| | | // "dept_no": 1,//数字 1 为根部门编号。 |
| | | // "dept_no": 1,//数字 1 为根部门编号。483636217:芜湖市公司 |
| | | // "has_child": true |
| | | //} |
| | | DeptApiClient deptApiClient = new DeptApiClient(HttpConstant.API_KEY, HttpConstant.HOST); |
| | | DeptApiClient deptApiClient = new DeptApiClient(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.API_KEY).getCode() |
| | | ,systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_HOST).getCode()); |
| | | try { |
| | | Map<String, Object> result = deptApiClient.deptList(1,true,deptApiClient.getDefaultVersion()); |
| | | int root = 1; |
| | | try { |
| | | root = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_COMPANY_ROOT_NO).getCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | Map<String, Object> result = deptApiClient.deptList(root,true,deptApiClient.getDefaultVersion()); |
| | | if(result!=null && result.get("departments")!=null ){ |
| | | TypeReference<List<DeptEntityModel>> typeReference = new TypeReference<List<DeptEntityModel>>(){}; |
| | | Object obj = result.get("departments"); |
| | |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "同步数据异常!"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 整理钉钉同步 新增组织对象 |
| | | * @return |
| | |
| | | private Company getUpdateCompanyModel(Company param, Company company) { |
| | | return syncDDEditCompanyModel(param,company); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据ERPID 判断数据是否已在集合里存在 |
| | |
| | | if(parent == null || Constants.equalsInteger(parent.getIsdeleted(),Constants.ONE)){ |
| | | parent =root; |
| | | } |
| | | /* if(Objects.nonNull(parent.getType())&&!Constants.equalsInteger(parent.getType(),-1)){ |
| | | /*if(Objects.nonNull(parent.getType())&&!Constants.equalsInteger(parent.getType(),-1)){ |
| | | if(!Constants.equalsInteger(company.getType(),parent.getType())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,组织信息错误"); |
| | | } |