aris流程导入处理空格问题 asc码160特殊空格

This commit is contained in:
446052889@qq.com 2022-07-10 12:55:46 +08:00
parent 0e02ee1c1b
commit 7b7fac8e51
5 changed files with 23 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import com.actionsoft.apps.coe.pal.datamigration.aris.mapping.ModelMappingAPIMan
import com.actionsoft.apps.coe.pal.datamigration.aris.model.*;
import com.actionsoft.apps.coe.pal.datamigration.constant.Constant;
import com.actionsoft.apps.coe.pal.datamigration.util.LogUtil;
import com.actionsoft.apps.coe.pal.datamigration.util.StrUtil;
import com.actionsoft.bpms.util.UtilString;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
@ -84,7 +85,7 @@ public class ArisXmlHandleWeb {
path.add(groupMap.get(modelParent).getName());
getPath(path, groupMap.get(modelParent).getPid());
}
modelModel.setModelPath(StringUtils.join(path, "\\").replace(" ", ""));
modelModel.setModelPath(StrUtil.removeAllBlack(StringUtils.join(path, "\\")));
}
}
@ -215,7 +216,7 @@ public class ArisXmlHandleWeb {
String modifyUser = e.attributeValue("LastModifier");
ModelModel modelModel = new ModelModel();
modelModel.setId(id);
modelModel.setName(name.trim());// 去除两边空白
modelModel.setName(StrUtil.removeAllBlack(name));// 去除两边空白
modelModel.setPid(pid);
modelModel.setType(type);
modelModel.setCreateTime(createTime);

View File

@ -811,6 +811,7 @@ public class ArisXmlImportRun {
/**
* 处理流程属性前后置流程
* 测试不通过需要梳理+重构 todo
*
* @param wsId
* @param idRelationMap
@ -874,7 +875,7 @@ public class ArisXmlImportRun {
propertyDao.insert(propertyModel);
removeKey.add(key);
removeKey.add(shapeId);
LogUtil.appendLog(Constant.LOG_END + "PAL过程链图[" + arisModel.getName() + "]相关前置流程进行处理关联,前置属性内容[" + repositoryModels.get(0).getName() + "]", fullLogFile);
LogUtil.appendLog(Constant.LOG_END + "PAL过程链图[" + arisModel.getName() + "]相关前置流程进行处理关联,前置属性内容[" + leadOrRearObj.getString("text") + "]", fullLogFile);
break;
} else if (tempShapeObj.getJSONObject("to").getString("id").equals(shapeId)) {
// rear_process
@ -903,7 +904,7 @@ public class ArisXmlImportRun {
propertyDao.insert(propertyModel);
removeKey.add(key);
removeKey.add(shapeId);
LogUtil.appendLog(Constant.LOG_END + "PAL过程链图[" + arisModel.getName() + "]相关后置流程进行处理关联,后置属性内容[" + repositoryModels.get(0).getName() + "]", fullLogFile);
LogUtil.appendLog(Constant.LOG_END + "PAL过程链图[" + arisModel.getName() + "]相关后置流程进行处理关联,后置属性内容[" + leadOrRearObj.getString("text") + "]", fullLogFile);
break;
} else {
continue;

View File

@ -23,6 +23,8 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class ProcessUtil {
@ -241,7 +243,7 @@ public class ProcessUtil {
propertyModels = propertyModels.stream().filter(item -> Constant.METHOD_ARIS_URL.equals(item.getPropertyId())).collect(Collectors.toList());
Map<String, String> map = new HashMap<>();
for (PALRepositoryPropertyModel prop : propertyModels) {
map.put(prop.getPlId(), prop.getPropertyValue().replace(" ", ""));// 去除空格
map.put(prop.getPlId(), StrUtil.removeAllBlack(prop.getPropertyValue()));// 去除空格
}
for (PALRepositoryModel model : list) {
if (map.containsKey(model.getId())) {

View File

@ -0,0 +1,14 @@
package com.actionsoft.apps.coe.pal.datamigration.util;
public class StrUtil {
/**
* 去除字符串所有空格增加处理特殊空格ASCII码值为160
* @param str
* @return
*/
public static String removeAllBlack(String str) {
return str == null ? "" : str.replaceAll("\\u00A0+", "").replace(" ", "");
}
}