Merge branch 'master' of https://e.coding.net/yilidev/yilipalkaifa/apps
This commit is contained in:
commit
d5c096fda4
Binary file not shown.
@ -3,6 +3,7 @@ package com.actionsoft.apps.coe.pal.datamigration.util;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordAttribute;
|
||||
import com.actionsoft.apps.coe.pal.datamigration.model.po.WordField;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -271,9 +272,13 @@ public class WordUtil {
|
||||
String text = cell.text().trim();
|
||||
//去除text特殊符号
|
||||
if (null != text && !"".equals(text)) {
|
||||
text = text.replaceAll("\\p{C}", "");
|
||||
text = text.replaceAll("\\p{C}", " ");
|
||||
}
|
||||
if (text.matches("[\\u4e00-\\u9fa5\\s]+$")){
|
||||
text = text.replace(" ",",");
|
||||
}else {
|
||||
text = text.replace(" ","");
|
||||
}
|
||||
text.replace(" ","");
|
||||
|
||||
if (i == 0){
|
||||
//首行为标题行
|
||||
|
||||
@ -1572,12 +1572,10 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
importProperty.setPropertyValue(object.toJSONString());
|
||||
propDao.update(importProperty);
|
||||
} else if ("awsorg".equals(repositoryAttrModel.getType())) {
|
||||
//aws组织架构解析,这里是做单组织结构的解析,ToDo:多组结构解析
|
||||
//aws组织架构解析,多组结构解析
|
||||
String orgName = (String) wordField.getData();
|
||||
AwsOrgInfo orgByName = this.getOrgByName(orgName);
|
||||
if (null != orgByName) {
|
||||
List<AwsOrgInfo> awsOrgInfos = new ArrayList<>();
|
||||
awsOrgInfos.add(orgByName);
|
||||
List<AwsOrgInfo> awsOrgInfos = this.getOrgByName(orgName);
|
||||
if (!awsOrgInfos.isEmpty()) {
|
||||
//先更新property数据 [{"name":"部门3","id":"fdea04c8-502f-4367-82b7-a5ebe0ce5f67","type":"department"}]
|
||||
importProperty.setPropertyValue(JSON.toJSONString(awsOrgInfos));
|
||||
propDao.update(importProperty);
|
||||
@ -1800,48 +1798,46 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
return context;
|
||||
}
|
||||
|
||||
private AwsOrgInfo getOrgByName(String name) {
|
||||
AwsOrgInfo awsOrgInfo = null;
|
||||
private List<AwsOrgInfo> getOrgByName(String name) {
|
||||
List<AwsOrgInfo> awsOrgInfos = new ArrayList<>();
|
||||
List<String> nameList = Arrays.stream(name.split(",")).collect(Collectors.toList());
|
||||
//从公司级别递归寻找name相同结构
|
||||
//公司
|
||||
Iterator<CompanyModel> companyIterator = CompanyCache.getCache().iterator();
|
||||
while (companyIterator.hasNext()) {
|
||||
CompanyModel companyModel = companyIterator.next();
|
||||
if (companyModel.getNameI18N().equalsIgnoreCase(name)) {
|
||||
awsOrgInfo = new AwsOrgInfo(companyModel.getId(), companyModel.getNameI18N(), companyModel.getType());
|
||||
break;
|
||||
if (nameList.contains(companyModel.getNameI18N())) {
|
||||
awsOrgInfos.add(new AwsOrgInfo(companyModel.getId(), companyModel.getNameI18N(), companyModel.getType()));
|
||||
}
|
||||
}
|
||||
if (null == awsOrgInfo) {
|
||||
if (awsOrgInfos.isEmpty()) {
|
||||
//部门
|
||||
Iterator<DepartmentModel> departIterator = DepartmentCache.getCache().iterator();
|
||||
while (departIterator.hasNext()) {
|
||||
DepartmentModel departmentModel = departIterator.next();
|
||||
if (departmentModel.getNameI18N().equalsIgnoreCase(name)) {
|
||||
awsOrgInfo = new AwsOrgInfo(departmentModel.getId(), departmentModel.getNameI18N(), departmentModel.getType());
|
||||
break;
|
||||
if (nameList.contains(departmentModel.getNameI18N())) {
|
||||
awsOrgInfos.add(new AwsOrgInfo(departmentModel.getId(), departmentModel.getNameI18N(), departmentModel.getType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null == awsOrgInfo) {
|
||||
if (awsOrgInfos.isEmpty()) {
|
||||
//用户
|
||||
Iterator<UserModel> userIterator = UserCache.getCache().iterator();
|
||||
while (userIterator.hasNext()) {
|
||||
UserModel userModel = userIterator.next();
|
||||
if (userModel.getUserNameI18N().equalsIgnoreCase(name)) {
|
||||
awsOrgInfo = new AwsOrgInfo(userModel.getUID(), userModel.getUserNameI18N(), "user");
|
||||
break;
|
||||
if (nameList.contains(userModel.getUserNameI18N())) {
|
||||
awsOrgInfos.add(new AwsOrgInfo(userModel.getUID(), userModel.getUserNameI18N(), "user"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null == awsOrgInfo) {
|
||||
if (awsOrgInfos.isEmpty()) {
|
||||
//岗位
|
||||
|
||||
}
|
||||
|
||||
return awsOrgInfo;
|
||||
return awsOrgInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user