|
|
@@ -875,15 +875,22 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
*/
|
|
|
private List<FjnxOrg> AddCustomOrg(List<FjnxOrg> list) {
|
|
|
final List<FjnxOrg> topOrgList = list.stream().filter(x -> ObjectUtil.isEmpty(x.getOrgParent())).collect(Collectors.toList());
|
|
|
- final List<String> needMoveOrgCodeList=new ArrayList<>();
|
|
|
+ final List<String> specialOrgNeedMoveOrgCodeList=new ArrayList<>();
|
|
|
+ final List<String> specialDeptNoMoveOrgCodeList=new ArrayList<>();
|
|
|
// 获取配置中的需要移动到机关下的机构编码
|
|
|
- final List<FjnxOrgMoveToCustomOrg> fjnxOrgMoveToCustomOrgs = fjnxOrgMoveToCustomOrgMapper.selectList(Wrappers.emptyWrapper());
|
|
|
- if(ObjectUtil.isNotEmpty(fjnxOrgMoveToCustomOrgs)){
|
|
|
- final List<String> collect = fjnxOrgMoveToCustomOrgs.stream().map(x -> x.getNeedMoveOrgCode()).collect(Collectors.toList());
|
|
|
- needMoveOrgCodeList.addAll(collect);
|
|
|
+ final List<FjnxOrgMoveToCustomOrg> specialOrgList = fjnxOrgMoveToCustomOrgMapper.selectList(Wrappers.emptyWrapper());
|
|
|
+ final List<FjnxOrgMoveToCustomOrg> specialOrgNeedMoveList = specialOrgList.stream().filter(x -> x.getOrgType().equals(1)).collect(Collectors.toList());
|
|
|
+ final List<FjnxOrgMoveToCustomOrg> specialDeptNoMoveList = specialOrgList.stream().filter(x -> x.getOrgType().equals(2)).collect(Collectors.toList());
|
|
|
+ if(ObjectUtil.isNotEmpty(specialOrgNeedMoveList)){
|
|
|
+ final List<String> collect = specialOrgNeedMoveList.stream().map(x -> x.getOrgCode()).collect(Collectors.toList());
|
|
|
+ specialOrgNeedMoveOrgCodeList.addAll(collect);
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(specialDeptNoMoveList)){
|
|
|
+ final List<String> collect = specialDeptNoMoveList.stream().map(x -> x.getOrgCode()).collect(Collectors.toList());
|
|
|
+ specialDeptNoMoveOrgCodeList.addAll(collect);
|
|
|
}
|
|
|
topOrgList.forEach(topOrg -> {
|
|
|
- changeOrgHierarchical(topOrg, list,needMoveOrgCodeList);
|
|
|
+ changeOrgHierarchical(topOrg, list,specialOrgNeedMoveOrgCodeList,specialDeptNoMoveOrgCodeList);
|
|
|
});
|
|
|
return list;
|
|
|
}
|
|
|
@@ -893,7 +900,7 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
* @param parentOrg
|
|
|
* @param list
|
|
|
*/
|
|
|
- private void changeOrgHierarchical(FjnxOrg parentOrg, List<FjnxOrg> list,List<String> needMoveOrgCodeList) {
|
|
|
+ private void changeOrgHierarchical(FjnxOrg parentOrg, List<FjnxOrg> list,List<String> specialOrgNeedMoveList,List<String> specialDeptNoMoveList) {
|
|
|
if(StringUtil.isNullOrEmpty( parentOrg.getOrgCode())) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -902,7 +909,7 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- final List<FjnxOrg> nendChangeOrgHierarchical =getNendMoveToCustomOrg(childOrgList,needMoveOrgCodeList);
|
|
|
+ final List<FjnxOrg> nendChangeOrgHierarchical =getNendMoveToCustomOrg(childOrgList,specialOrgNeedMoveList,specialDeptNoMoveList);
|
|
|
if (nendChangeOrgHierarchical.size() > 0) {
|
|
|
FjnxOrg customOrg = findCustomAddOrg(parentOrg, getAddCustomOrgName(), list);
|
|
|
list.add(customOrg);
|
|
|
@@ -931,24 +938,37 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- changeOrgHierarchical(org,list,needMoveOrgCodeList);
|
|
|
+ changeOrgHierarchical(org,list,specialOrgNeedMoveList,specialDeptNoMoveList);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
- private List<FjnxOrg> getNendMoveToCustomOrg( List<FjnxOrg> orgList,List<String> needMoveOrgCodeList)
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param orgList
|
|
|
+ * @param specialOrgNeedMoveList 配置表中 不是M开头但是是部门的数据
|
|
|
+ * @param specialDeptNoMoveList 配置表中 是M开头但是是机构的数据
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<FjnxOrg> getNendMoveToCustomOrg( List<FjnxOrg> orgList,List<String> specialOrgNeedMoveList,List<String> specialDeptNoMoveList)
|
|
|
{
|
|
|
final List<FjnxOrg> allNendMoveOrgList =new ArrayList<>();
|
|
|
- if(ObjectUtil.isNotEmpty(needMoveOrgCodeList))
|
|
|
+ if(ObjectUtil.isNotEmpty(specialOrgNeedMoveList))
|
|
|
{
|
|
|
- final List<FjnxOrg> needMoveOrgList = orgList.stream().filter(x -> needMoveOrgCodeList.stream().anyMatch(y -> ObjectUtil.equal(y, x.getOrgCode()))).collect(Collectors.toList());
|
|
|
+ // 配置表中 不是M开头但是是部门的数据
|
|
|
+// final List<FjnxOrgMoveToCustomOrg> specialOrgNeedMoveList = specialOrgList.stream().filter(x -> x.getOrgType().equals(1)).collect(Collectors.toList());
|
|
|
+ final List<FjnxOrg> needMoveOrgList = orgList.stream().filter(x -> specialOrgNeedMoveList.stream().anyMatch(y -> ObjectUtil.equal(y, x.getOrgCode()))).collect(Collectors.toList());
|
|
|
allNendMoveOrgList.addAll(needMoveOrgList);
|
|
|
}
|
|
|
+ // 配置表中 是M开头但是是机构的数据
|
|
|
+// final List<FjnxOrgMoveToCustomOrg> specialDeptNoMoveList = specialOrgList.stream().filter(x -> x.getOrgType().equals(2)).collect(Collectors.toList());
|
|
|
+
|
|
|
List<FjnxOrg> deptOrgList = orgList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getOrgCode()) && x.getOrgCode().toLowerCase().startsWith("m")).collect(Collectors.toList());
|
|
|
final List<FjnxOrg> collect = deptOrgList.stream().filter(x -> !x.getOrgName().endsWith("地区行社") && !x.getOrgName().endsWith("办事处")).collect(Collectors.toList());
|
|
|
if(ObjectUtil.isNotEmpty(collect)){
|
|
|
collect.stream().forEach(x->{
|
|
|
- if(!allNendMoveOrgList.stream().anyMatch(y->ObjectUtil.equal(x.getOrgCode(),y.getOrgCode()))){
|
|
|
+ if(!allNendMoveOrgList.stream().anyMatch(y->ObjectUtil.equal(x.getOrgCode(),y.getOrgCode()))
|
|
|
+ && !specialDeptNoMoveList.stream().anyMatch(z->ObjectUtil.equal(x.getOrgCode(),z))){
|
|
|
allNendMoveOrgList.add(x);
|
|
|
}
|
|
|
});
|