diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index ad0640aa..47a129c4 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java index 8168841b..1529d8f5 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishExecuteListenerInterfaceImpl.java @@ -35,7 +35,10 @@ import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.UUIDGener; import com.actionsoft.bpms.util.UtilDate; import com.actionsoft.bpms.util.UtilString; +import com.actionsoft.exception.AWSAPIException; +import com.actionsoft.exception.AWSDataAccessException; import com.actionsoft.exception.AWSException; +import com.actionsoft.exception.BPMNError; import com.actionsoft.sdk.local.SDK; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -128,7 +131,8 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme insertPerformanceIndicatorLibrary(boN.get("PUBLISHFILEID").toString(),param.getUserContext(),bo.get("WSID").toString(),boN.getString("PUBLISH_NUMBER")); - + //回填绩效编号 + //createPerformanceNumber(boN.get("PUBLISHFILEID").toString(),param.getUserContext(),bo.get("WSID").toString(),boN.getString("PUBLISH_NUMBER")); } @@ -531,65 +535,76 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme */ public void updateProcessNumber(String publishFileId,UserContext uc,String wsId,String processNumber){ - //获取关联绩效模型数据 - List performanceList=new ArrayList(); - performanceList.add(0,"control.kpi"); - performanceList.add(1,publishFileId); + try { + //获取关联绩效模型数据 + List performanceList=new ArrayList(); + performanceList.add(0,"control.kpi"); + performanceList.add(1,publishFileId); - RowMap performrowMap=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",performanceList.toString()); - if(performrowMap!=null){ - - PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(performrowMap.getString("ID")); + RowMap performrowMap=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",performanceList.toString()); - Map> methodAttrsMap = new HashMap<>();// 属性存储 - Map methodValueAttrsMap = new HashMap<>();// 属性存储 + if(performrowMap!=null ){ - //查询对应绩效模型中数据模型进行填充数据 - BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(performrowMap.getString("ID"), 0); + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(performrowMap.getString("ID")); - CoeProcessLevelWeb coeProcessLevelWeb=new CoeProcessLevelWeb(uc); + String id=performrowMap.getString("ID");; - String define = defineModel.getDefinition(); - JSONObject definition = JSONObject.parseObject(define); - JSONObject elements = definition.getJSONObject("elements"); - coeProcessLevelWeb.handleShapeDefaultAttr(wsId, parentModel, elements, methodAttrsMap); - //拿去流程数据填充绩效模型中数据属性 - for (String key : elements.keySet()) { - JSONObject shape1 = elements.getJSONObject(key); - if ("linker".equals(shape1.getString("name"))) { - continue; - } - String shapeText = shape1.getString("text"); - JSONArray dataAttributes = shape1.getJSONArray("dataAttributes"); - if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) { - for (Object attribute : dataAttributes) { - JSONObject obj = (JSONObject) attribute; - if (obj.containsKey("attributesJsonArray")) { - JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray"); - for (int i = 0; i < attributesJsonArray.size(); i++) { - if (attributesJsonArray.getJSONObject(i).containsKey("id")) { - String getid=attributesJsonArray.getJSONObject(i).getString("id"); - if(getid.equals("Number_of_the_associated_flow_file")){ - attributesJsonArray.getJSONObject(i).put("value", processNumber); + Map> methodAttrsMap = new HashMap<>();// 属性存储 + + Map methodValueAttrsMap = new HashMap<>();// 属性存储 + + //查询对应绩效模型中数据模型进行填充数据 + BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(id, 0); + + CoeProcessLevelWeb coeProcessLevelWeb=new CoeProcessLevelWeb(uc); + + String define = defineModel.getDefinition(); + JSONObject definition = JSONObject.parseObject(define); + JSONObject elements = definition.getJSONObject("elements"); + + coeProcessLevelWeb.handleShapeDefaultAttr(wsId, parentModel, elements, methodAttrsMap); + + //拿去流程数据填充绩效模型中数据属性 + for (String key : elements.keySet()) { + JSONObject shape1 = elements.getJSONObject(key); + if ("linker".equals(shape1.getString("name"))) { + continue; + } + String shapeText = shape1.getString("text"); + JSONArray dataAttributes = shape1.getJSONArray("dataAttributes"); + if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) { + for (Object attribute : dataAttributes) { + JSONObject obj = (JSONObject) attribute; + if (obj.containsKey("attributesJsonArray")) { + JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray"); + for (int i = 0; i < attributesJsonArray.size(); i++) { + if (attributesJsonArray.getJSONObject(i).containsKey("id")) { + String getid=attributesJsonArray.getJSONObject(i).getString("id"); + if(getid.equals("Number_of_the_associated_flow_file")){ + attributesJsonArray.getJSONObject(i).put("value", processNumber); + } + } - } - } + } } } + } + defineModel.setDefinition(definition.toString()); + // 保存文件 + CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作 + } - - defineModel.setDefinition(definition.toString()); - // 保存文件 - CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作 - + } catch (AWSDataAccessException e) { + e.printStackTrace(); + } finally { } } @@ -599,147 +614,205 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme * 发布流程结束查询关联绩效模型数据,插入绩效指标库中 * @return */ - public String insertPerformanceIndicatorLibrary(String publishFileId,UserContext uc,String wsId,String processNumber){ + public void insertPerformanceIndicatorLibrary(String publishFileId,UserContext uc,String wsId,String processNumber){ //获取关联绩效模型数据 - List performanceList=new ArrayList(); - performanceList.add(0,"control.kpi"); - performanceList.add(1,publishFileId); + try { + List performanceList=new ArrayList(); + performanceList.add(0,"control.kpi"); + performanceList.add(1,publishFileId); - RowMap performrowMap=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",performanceList.toString()); - - List l1l3performanceList=new ArrayList(); - l1l3performanceList.add(0,"control.ma"); - l1l3performanceList.add(1,publishFileId); - - RowMap l1l3performrowMap=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",l1l3performanceList.toString()); - - if(performrowMap!=null || l1l3performrowMap!=null){ - - PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(performrowMap.getString("ID")); - - - Map> methodAttrsMap = new HashMap<>();// 属性存储 - - Map methodValueAttrsMap = new HashMap<>();// 属性存储 - - //查询对应绩效模型中数据模型进行填充数据 - BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(performrowMap.getString("ID"), 0); - - CoeProcessLevelWeb coeProcessLevelWeb=new CoeProcessLevelWeb(uc); - - String define = defineModel.getDefinition(); - JSONObject definition = JSONObject.parseObject(define); - JSONObject elements = definition.getJSONObject("elements"); + RowMap performrowMap=DBSql.getMap("SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT2=?",performanceList.toString()); - ProcessInstance processInst=SDK.getProcessAPI().createBOProcessInstance("obj_1ffbc1e73b99427ca64469e466f97dbe", uc.getUID(), "指标绩效数据插入"); + if(performrowMap!=null ){ - //拿去流程数据填充绩效模型中数据属性 - for (String key : elements.keySet()) { - JSONObject shape1 = elements.getJSONObject(key); - if ("linker".equals(shape1.getString("name"))) { - continue; - } - String shapeText = shape1.getString("text"); - JSONArray dataAttributes = shape1.getJSONArray("dataAttributes"); - if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) { - for (Object attribute : dataAttributes) { - JSONObject obj = (JSONObject) attribute; - if (obj.containsKey("attributesJsonArray")) { - JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray"); - BO recordBO=new BO(); + String id = performrowMap.getString("ID"); - for (int i = 0; i < attributesJsonArray.size(); i++) { - if (attributesJsonArray.getJSONObject(i).containsKey("id")) { + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(id); - String getid=attributesJsonArray.getJSONObject(i).getString("id"); - String value=attributesJsonArray.getJSONObject(i).getString("value"); - if(getid.equals("Process_Architecture_L1")){//L1 - recordBO.set("PROCESS_ARCHITECTURE_L1",value); - } - if(getid.equals("Process_Architecture_L2")){//L2 - recordBO.set("PROCESS_ARCHITECTURE_L2",value); - } - if(getid.equals("Process_Architecture_L3")){//L3 - recordBO.set("PROCESS_ARCHITECTURE_L3",value); - } - if(getid.equals("Number_of_the_associated_flow_file")){//关联流程文件编号 - recordBO.set("NUMBER_OF_THE_ASSO_FLOW_FILE",value); - } - if(getid.equals("Associated_process_name")){//关联流程名称 - recordBO.set("ASSOCIATED_PROCESS_NAME",value); - } - if(getid.equals("Associated_process_name")){//流程绩效指标名称 - recordBO.set("PERFORMANCE_INDICATOR_NAME",value); - } - if(getid.equals("Index_properties")){//指标性质 - recordBO.set("INDEX_PROPERTIES",value); - } - if(getid.equals("ndicator_User_defined_label")){//指标自定义标签 - recordBO.set("NDICATOR_USER_DEFINED_LABEL",value); - } - if(getid.equals("Index_definition")){//指标定义 - recordBO.set("INDEX_DEFINITION",value); - } - if(getid.equals("unit_measurement")){//计量单位 - recordBO.set("UNIT_MEASUREMENT",value); - } - if(getid.equals("statistical_period")){//统计周期 - recordBO.set("STATISTICAL_PERIOD",value); - } + Map> methodAttrsMap = new HashMap<>();// 属性存储 - if(getid.equals("computational_formula")){//计算公式 - recordBO.set("COMPUTATIONAL_FORMULA",value); - } - if(getid.equals("Data_fetch_logic")){//数据取数逻辑 - recordBO.set("DATA_FETCH_LOGIC",value); - } - if(getid.equals("Take_the_number_aperture")){//取数口径 - recordBO.set("TAKE_THE_NUMBER_APERTURE",value); - } - if(getid.equals("remark")){//备注 - recordBO.set("REMARK",value); - } - if(getid.equals("oa_process")){//OA流程 - recordBO.set("OA_PROCESS",value); - } + Map methodValueAttrsMap = new HashMap<>();// 属性存储 - if(getid.equals("element")){//元素 + //查询对应绩效模型中数据模型进行填充数据 + BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(id, 0); + + CoeProcessLevelWeb coeProcessLevelWeb=new CoeProcessLevelWeb(uc); + + String define = defineModel.getDefinition(); + JSONObject definition = JSONObject.parseObject(define); + JSONObject elements = definition.getJSONObject("elements"); + + + + ProcessInstance processInst=SDK.getProcessAPI().createBOProcessInstance("obj_1ffbc1e73b99427ca64469e466f97dbe", uc.getUID(), "指标绩效数据插入"); + + //拿去流程数据填充绩效模型中数据属性 + for (String key : elements.keySet()) { + JSONObject shape1 = elements.getJSONObject(key); + if ("linker".equals(shape1.getString("name"))) { + continue; + } + String shapeText = shape1.getString("text"); + JSONArray dataAttributes = shape1.getJSONArray("dataAttributes"); + if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) { + for (Object attribute : dataAttributes) { + JSONObject obj = (JSONObject) attribute; + if (obj.containsKey("attributesJsonArray")) { + JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray"); + BO recordBO=new BO(); + + for (int i = 0; i < attributesJsonArray.size(); i++) { + if (attributesJsonArray.getJSONObject(i).containsKey("id")) { + + String getid=attributesJsonArray.getJSONObject(i).getString("id"); + String value=attributesJsonArray.getJSONObject(i).getString("value"); + if(getid.equals("Process_Architecture_L1")){//L1 + recordBO.set("PROCESS_ARCHITECTURE_L1",value); + } + if(getid.equals("Process_Architecture_L2")){//L2 + recordBO.set("PROCESS_ARCHITECTURE_L2",value); + } + if(getid.equals("Process_Architecture_L3")){//L3 + recordBO.set("PROCESS_ARCHITECTURE_L3",value); + } + if(getid.equals("Number_of_the_associated_flow_file")){//关联流程文件编号 + recordBO.set("NUMBER_OF_THE_ASSO_FLOW_FILE",value); + } + if(getid.equals("Associated_process_name")){//关联流程名称 + recordBO.set("ASSOCIATED_PROCESS_NAME",value); + } + if(getid.equals("Associated_process_name")){//流程绩效指标名称 + recordBO.set("PERFORMANCE_INDICATOR_NAME",value); + } + + if(getid.equals("Index_properties")){//指标性质 + recordBO.set("INDEX_PROPERTIES",value); + } + if(getid.equals("ndicator_User_defined_label")){//指标自定义标签 + recordBO.set("NDICATOR_USER_DEFINED_LABEL",value); + } + if(getid.equals("Index_definition")){//指标定义 + recordBO.set("INDEX_DEFINITION",value); + } + if(getid.equals("unit_measurement")){//计量单位 + recordBO.set("UNIT_MEASUREMENT",value); + } + if(getid.equals("statistical_period")){//统计周期 + recordBO.set("STATISTICAL_PERIOD",value); + } + + if(getid.equals("computational_formula")){//计算公式 + recordBO.set("COMPUTATIONAL_FORMULA",value); + } + if(getid.equals("Data_fetch_logic")){//数据取数逻辑 + recordBO.set("DATA_FETCH_LOGIC",value); + } + if(getid.equals("Take_the_number_aperture")){//取数口径 + recordBO.set("TAKE_THE_NUMBER_APERTURE",value); + } + if(getid.equals("remark")){//备注 + recordBO.set("REMARK",value); + } + if(getid.equals("oa_process")){//OA流程 + recordBO.set("OA_PROCESS",value); + } + + if(getid.equals("element")){//元素 + + JSONObject getvalue = attributesJsonArray.getJSONObject(i).getJSONObject("value"); + if(getvalue!=null){ + JSONArray elejsonArray = attributesJsonArray.getJSONObject(i).getJSONObject("value").getJSONArray("table"); + for(int k=1;k