pal 流程数据导入Word 表格类型数据调整

This commit is contained in:
anhc 2022-06-28 15:13:03 +08:00
parent 4760eba7ef
commit de587f6e87

View File

@ -11,7 +11,9 @@ import com.actionsoft.apps.coe.pal.datamigration.model.po.WordField;
import com.actionsoft.apps.coe.pal.datamigration.util.ExcelUtil;
import com.actionsoft.apps.coe.pal.datamigration.util.ShapeUtil;
import com.actionsoft.apps.coe.pal.datamigration.util.WordUtil;
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodAttributeModel;
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
@ -52,6 +54,7 @@ import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Document;
import java.io.File;
@ -1732,7 +1735,21 @@ public class DataMigrationWeb extends ActionWeb {
}
if (array.size() > 0) {
//特殊处理表头
array.getJSONObject(0).put("id", "table_head");
PALMethodAttributeModel attributeModel = null;
List<PALMethodAttributeModel> attributes = PALMethodCache.getPALMethodModelById(importModel.getMethodId()).getAttributes();
for (PALMethodAttributeModel attribute : attributes) {
if (attribute.getType().equals(importProperty.getPropertyId())){
attributeModel = attribute;
}
}
if (null == attributeModel || StringUtils.isEmpty(attributeModel.getRef())){
array.getJSONObject(0).put("id", "table_head");
}else{
JSONObject attrRef = JSON.parseObject(attributeModel.getRef());
array.getJSONObject(0).put("id", "table_head");
array.getJSONObject(0).put("id", attrRef.get("firstColumn"));
array.getJSONObject(0).put("id", attrRef.get("secondColumn"));
}
}
object.put("table", array);
//更新数据库值