Merge branch 'apps_dev' of https://e.coding.net/yilidev/yilipalkaifa/apps into apps_dev

This commit is contained in:
lihongyu 2022-10-07 10:27:36 +08:00
commit d8f518a223
2 changed files with 62 additions and 40 deletions

View File

@ -89,6 +89,7 @@ public class SynchronousPortJob implements IJob {
try {
orgdepartmentList = DBSql.getMaps(open, "select DEPARTMENTNAME,ID,LAYER,PARENTDEPARTMENTID,ORDERINDEX from ORGDEPARTMENT where Closed=0 ");
RowMap parentModel=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME='内蒙古伊利实业集团股份有限公司' and PLMETHODID='org.normal'");
String parentModelIds=null;
if(parentModel==null){
@ -258,17 +259,10 @@ public class SynchronousPortJob implements IJob {
Map<String, String> idRelationMap = new HashMap<>();
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(model.getId(), 0);
if (defineModel == null) {
defineModel = CoeDesignerUtil.createModel(model.getId(), 0);
defineModel.setCreateHistory(false);
}
String define = defineModel.getDefinition();
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
List<RowMap> orgdepartmentList = DBSql.getMaps(conn, "select DESCR from BO_EU_ORG_POSTS WHERE DEPTID=? AND DESCR IS NOT NULL ", departmentId);
List<RowMap> orgdepartmentList = DBSql.getMaps(conn, "select DESCR,DEPTNAME from BO_EU_ORG_POSTS WHERE DEPTID=? AND DESCR IS NOT NULL ", departmentId);
JSONArray shapes = new JSONArray();
@ -278,7 +272,7 @@ public class SynchronousPortJob implements IJob {
boolean flag=true;
String positionName = orgdepartmentList.get(i).getString("DESCR");
String deptname = orgdepartmentList.get(i).getString("DEPTNAME");
//新建一个uuid
String shapeId = UUIDGener.getObjectId();
//拿到基础结构
@ -289,9 +283,13 @@ public class SynchronousPortJob implements IJob {
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(uuid);
System.out.println("name=============="+parentModel.getName());
try {
List<Map<String, Object>> fileElements = CoeDesignerUtil.getShapeMessageJson4(uuid);
if (fileElements.size() > 0) {
for (Map<String, Object> shape2 : fileElements) {
List result = new ArrayList();
@ -303,17 +301,41 @@ public class SynchronousPortJob implements IJob {
}
if (flag == true) {
System.out.println("uuid==============="+uuid);
System.out.println("部门名称为=================" + deptname);
System.out.println("新建岗位为==================" + positionName);
JSONObject newShape = JSONObject.parseObject(shape.toString());
newShape.put("id", shapeId);
newShape.put("text", positionName);
shapes.add(newShape);
}
}else{
JSONObject newShape = JSONObject.parseObject(shape.toString());
newShape.put("id", shapeId);
newShape.put("text", positionName);
shapes.add(newShape);
}
} catch (Exception e) {
e.printStackTrace();
}
}
try {
if(shapes.size()>0){
CoeRepositoryImportUtil util = new CoeRepositoryImportUtil();
BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(uuid, 0);
if (defineModel == null) {
defineModel = CoeDesignerUtil.createModel(uuid, 0);
defineModel.setCreateHistory(false);
}
String define = defineModel.getDefinition();
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
int maxZIndex = getMaxPropsZIndex(elements);// 层级
int initY = getMaxPositionY(elements);// 默认的纵向坐标
@ -331,11 +353,11 @@ public class SynchronousPortJob implements IJob {
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作*/
}
} catch (Exception e) {
e.printStackTrace();
}
}