发布代码提交
This commit is contained in:
parent
4d47744dd4
commit
b5372b1120
Binary file not shown.
@ -127,14 +127,6 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
updateProcessNumber(boN.get("PUBLISHFILEID").toString(),param.getUserContext(),bo.get("WSID").toString(),boN.getString("PUBLISH_NUMBER"));
|
||||
|
||||
|
||||
//插入绩效指标库
|
||||
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"));
|
||||
|
||||
|
||||
}
|
||||
//by bzp 测试编号生成
|
||||
//new ProcesNumberUtil().getNumber(processInstId);
|
||||
@ -529,7 +521,8 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布结束后获取关联绩效模型填充流程编号
|
||||
* 1、发布结束后获取关联绩效模型填充流程编号
|
||||
* 2、获取信息插入绩效指标库
|
||||
* @param publishFileId
|
||||
* @param publishDate
|
||||
*/
|
||||
@ -543,14 +536,16 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
|
||||
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(), "指标绩效数据插入");
|
||||
|
||||
|
||||
ProcessInstance performNumberProcess = SDK.getProcessAPI().createBOProcessInstance("obj_96bc36eab7ac44af90458d8de6bcc58b", uc.getUID(), "绩效编号插入");
|
||||
|
||||
if (performrowMap != null) {
|
||||
|
||||
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(performrowMap.getString("ID"));
|
||||
|
||||
String id=performrowMap.getString("ID");;
|
||||
|
||||
String id = performrowMap.getString("ID");
|
||||
|
||||
|
||||
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();// 属性存储
|
||||
@ -568,6 +563,13 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
|
||||
coeProcessLevelWeb.handleShapeDefaultAttr(wsId, parentModel, elements, methodAttrsMap);
|
||||
|
||||
//获取当前MP绩效最新排序数值
|
||||
BO performanceNumberBO = SDK.getBOAPI().query("BO_EU_PERFORMANCE_NUMBER").addQuery("PERFORMANCE_TYPE=", "control.kpi").addQuery("PROCESS_NUMBER=", processNumber).detail();
|
||||
//去掉 /P05V1.0-
|
||||
String before = processNumber.substring(0, processNumber.indexOf("/"));
|
||||
String after = processNumber.substring(processNumber.indexOf("-"), processNumber.length());
|
||||
|
||||
int currentnumber = 0;
|
||||
//拿去流程数据填充绩效模型中数据属性
|
||||
for (String key : elements.keySet()) {
|
||||
JSONObject shape1 = elements.getJSONObject(key);
|
||||
@ -577,99 +579,37 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
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);
|
||||
|
||||
if (performanceNumberBO != null) {
|
||||
currentnumber = Integer.valueOf(performanceNumberBO.getString("CURRENTNUMBER"));
|
||||
} else {
|
||||
BO performanceBo = new BO();
|
||||
performanceBo.set("PROCESS_NUMBER", processNumber);
|
||||
performanceBo.set("CURRENTNUMBER", 1);
|
||||
performanceBo.set("PERFORMANCE_TYPE", "control.kpi");
|
||||
SDK.getBOAPI().create("BO_EU_PERFORMANCE_NUMBER", performanceBo, performNumberProcess.getId(), "");
|
||||
currentnumber = 1;
|
||||
}
|
||||
currentnumber++;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
defineModel.setDefinition(definition.toString());
|
||||
// 保存文件
|
||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||
|
||||
}
|
||||
} catch (AWSDataAccessException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发布流程结束查询关联绩效模型数据,插入绩效指标库中
|
||||
* @return
|
||||
*/
|
||||
public void insertPerformanceIndicatorLibrary(String publishFileId,UserContext uc,String wsId,String processNumber){
|
||||
|
||||
//获取关联绩效模型数据
|
||||
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 ){
|
||||
|
||||
String id = performrowMap.getString("ID");
|
||||
|
||||
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(id);
|
||||
|
||||
|
||||
Map<String, Map<String, JSONObject>> methodAttrsMap = new HashMap<>();// 属性存储
|
||||
|
||||
Map<String, String> 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");
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
if (attributesJsonArray.size() > 0) {
|
||||
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("Number_of_the_associated_flow_file")) {
|
||||
attributesJsonArray.getJSONObject(i).put("value", processNumber);
|
||||
}
|
||||
|
||||
|
||||
//插入绩效指标库操作
|
||||
if (getid.equals("Process_Architecture_L1")) {//L1
|
||||
recordBO.set("PROCESS_ARCHITECTURE_L1", value);
|
||||
}
|
||||
@ -722,7 +662,6 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
}
|
||||
|
||||
if (getid.equals("element")) {//元素
|
||||
|
||||
JSONObject getvalue = attributesJsonArray.getJSONObject(i).getJSONObject("value");
|
||||
if (getvalue != null) {
|
||||
JSONArray elejsonArray = attributesJsonArray.getJSONObject(i).getJSONObject("value").getJSONArray("table");
|
||||
@ -738,82 +677,34 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
|
||||
}
|
||||
|
||||
//回填绩效编号操作
|
||||
if (getid.equals("Process_performance_indicator_Number")) {
|
||||
attributesJsonArray.getJSONObject(i).put("value", "MA" + before + after + currentnumber);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
SDK.getBOAPI().create("BO_EU_PER_IND_LIB", recordBO, processInst.getId(), "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
performanceNumberBO.set("CURRENTNUMBER", currentnumber);
|
||||
SDK.getBOAPI().update("BO_EU_PERFORMANCE_NUMBER", performanceNumberBO);
|
||||
|
||||
defineModel.setDefinition(definition.toString());
|
||||
// 保存文件
|
||||
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
|
||||
|
||||
}
|
||||
} catch (AWSDataAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (AWSAPIException e) {
|
||||
e.printStackTrace();
|
||||
} catch (BPMNError bpmnError) {
|
||||
bpmnError.printStackTrace();
|
||||
} finally {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成MA,MP对应编号
|
||||
* 生成规则: MP(流程编号是:08.01.05.05/P05V1.0-YLYYYY,对应的流程绩效编号MP-08.01.05.05-YLYYYY.AA(AA=1~99顺序排号)对流程编号,去除"/P05V1.0)
|
||||
* MA: MA类指标编号半手动编号:等于MA.XX.XX.XX.XX.AA,其中XX.XX.XX.XX.手动编号,最后两位AA系统提供顺序(MA下排序)
|
||||
*/
|
||||
public void createPerformanceNumber(String publishFileId,UserContext uc,String wsId,String processNumber){
|
||||
|
||||
//获取流程编号
|
||||
if(UtilString.isNotEmpty(processNumber)){
|
||||
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());
|
||||
|
||||
|
||||
|
||||
|
||||
//MP(流程编号是:08.01.05.05/P05V1.0-YLYYYY,对应的流程绩效编号MP-08.01.05.05-YLYYYY.AA(AA=1~99顺序排号)对流程编号,去除"/P05V1.0)
|
||||
if(performrowMap!=null){
|
||||
|
||||
|
||||
String before=processNumber.substring(0,processNumber.indexOf("/"));
|
||||
String after=processNumber.substring(processNumber.indexOf("-"),processNumber.length());
|
||||
|
||||
//获取当前MP绩效最新排序数值
|
||||
DBSql.getMap("");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//判断模型方法是MA/MP
|
||||
|
||||
|
||||
//处理绩效编号
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user