|
|
@@ -2,6 +2,7 @@ package com.xunmei.sync.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.excel.util.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.R;
|
|
|
@@ -176,7 +177,7 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
}
|
|
|
|
|
|
List<FjnxOrg> fjnxOrgList = ConvertXmlOrgDtoToOrgFjnx(fjnxXmlOrgDto.getOrgVos());
|
|
|
- ifjnxOrgService.saveOrUpdateBatch(fjnxOrgList);
|
|
|
+// ifjnxOrgService.saveOrUpdateBatch(fjnxOrgList);
|
|
|
|
|
|
R<List<SysOrg>> existAllOrgResult = remoteOrgService.getAllOrg(SecurityConstants.INNER);
|
|
|
if (existAllOrgResult.getCode() != 200) {
|
|
|
@@ -626,6 +627,8 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
org.setIsLock(ConvertOrgIsLockValue(fjnxOrgDto.getUsableFlag()));
|
|
|
org.setDeleted(0);
|
|
|
org.setSource(1);
|
|
|
+ org.setAffiliatedArea(fjnxOrgDto.getAffiliatedArea());
|
|
|
+ org.setAffiliatedBank(fjnxOrgDto.getAffiliatedBank());
|
|
|
// todo 机构类型转换
|
|
|
return org;
|
|
|
}
|
|
|
@@ -711,6 +714,8 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
org.setIsLock(ConvertOrgIsLockValue(fjnxOrg.getUsableFlag()));
|
|
|
org.setSource(1);
|
|
|
org.setDeleted(0);
|
|
|
+ org.setAffiliatedArea(fjnxOrg.getAffiliatedArea());
|
|
|
+ org.setAffiliatedBank(fjnxOrg.getAffiliatedBank());
|
|
|
return org;
|
|
|
|
|
|
}
|
|
|
@@ -1101,6 +1106,7 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
// String a="M33000000";
|
|
|
// }
|
|
|
|
|
|
+ // 设置机构的业务父级
|
|
|
Optional<FjnxOrgBusinessRelation> first = fjnxOrgBusinessRelationList.stream().filter(b -> b.getOrgCode().equals(item.getOrgCode())).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
String afterStr = StringEscapeUtils.escapeEcmaScript(item.getOrgName());
|
|
|
@@ -1115,12 +1121,41 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
|
|
|
log.error("设置fjnx机构树显示父级机构失败,机构名称:{},机构编码:{},机构树显示父级机构编码:{}", afterStr, first.get().getOrgCode(), first.get().getBusinessParentCode());
|
|
|
}
|
|
|
}
|
|
|
+ // 设置机构所属行社
|
|
|
+ final Optional<FJNXOrgDto> affiliatedBank = list.stream().filter(x -> ObjectUtil.equal(x.getOrgCode(), item.getCorporCode())).findFirst();
|
|
|
+ if(affiliatedBank.isPresent())
|
|
|
+ {
|
|
|
+ tempOrg.setAffiliatedBank(affiliatedBank.get().getShortName());
|
|
|
+ }
|
|
|
+ // 设置机构所属地区
|
|
|
+ tempOrg.setAffiliatedArea(getOrgAffiliatedArea(tempOrg.getOrgPath(),list,fjnxOrgBusinessRelationList));
|
|
|
resultList.add(tempOrg);
|
|
|
});
|
|
|
return AddCustomOrg(resultList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取机构所属地区 ,机构不在地区下的返回空字符如 省联社下的职能部门
|
|
|
+ * @param userOrgPath 机构path
|
|
|
+ * @param specialOrgList 同步配置表中配置的各类型数据, 类型为3的为地区行社
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String getOrgAffiliatedArea(String userOrgPath,List<FJNXOrgDto> orgDtoList ,List<FjnxOrgBusinessRelation> specialOrgList){
|
|
|
+ final List<String> dqhsOrgCodeList = specialOrgList.stream().filter(x -> x.getOrgType().equals(3)).map(FjnxOrgBusinessRelation::getOrgCode).collect(Collectors.toList());
|
|
|
+ final List<String> orgCodeList = orgPathConvertToOrgCodeList(userOrgPath);
|
|
|
+ final Optional<String> first = CollectionUtils.intersection(orgCodeList, dqhsOrgCodeList).stream().findFirst();
|
|
|
+ if(first.isPresent())
|
|
|
+ {
|
|
|
+ final Optional<FJNXOrgDto> first1 = orgDtoList.stream().filter(x -> ObjectUtil.equal(x.getOrgCode(), first.get().toString())).findFirst();
|
|
|
+ if(first1.isPresent())
|
|
|
+ {
|
|
|
+ return first1.get().getShortName().replace("地区行社","");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return StringUtil.EMPTY_STRING;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 新增 机关机构
|
|
|
*
|
|
|
* @param list
|