流程发布文件类型回填到主表
This commit is contained in:
parent
e4f08b74e7
commit
e947053131
@ -1,9 +1,13 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.event;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishHistory;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.dao.PublishListHistory;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishHistoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.model.PublishListHistoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||
@ -26,11 +30,6 @@ import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteListenerInterface {
|
||||
|
||||
@Override
|
||||
@ -52,13 +51,74 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi
|
||||
ProcessStatusAPIManager.getInstance().batchUpdateApprovalStatus(ctx.getTaskInstance().getProcessInstId(), true);
|
||||
//任务提交后重新生成手册
|
||||
List<BO> bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list();
|
||||
ArrayList<String> arr = new ArrayList<String>();
|
||||
if(bolistN.size()>0) {
|
||||
for (BO bo : bolistN) {
|
||||
try {
|
||||
typeList(arr, bo.getString("PUBLISHFILEID"));
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
}
|
||||
List<BO> bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list();
|
||||
if(bolistC.size()>0) {
|
||||
for (BO bo : bolistC) {
|
||||
try {
|
||||
typeList(arr, bo.getString("CHANGEDFILEIDNEW"));
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<BO> bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list();
|
||||
if(bolistS.size()>0) {
|
||||
for (BO bo : bolistS) {
|
||||
try {
|
||||
typeList(arr, bo.getString("STOPFILEID"));
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存发布文件的类型到主表
|
||||
if((arr.contains("表单模板")||arr.contains("操作指导"))&&!arr.contains("制度模型")&&!arr.contains("EPC模型")&&!arr.contains("泳道图")) {
|
||||
SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板");
|
||||
}else {
|
||||
SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图");
|
||||
}
|
||||
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
BO bo = SDK.getBOAPI().query(PublisherConstant.BOTABLENAME).detailByBindId(processInstId);
|
||||
updateEffectiveDateProperty(processInstId, bo, nowTime, bolistN, bolistC);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<String> typeList(ArrayList<String> arr,String plId){
|
||||
String sql = "SELECT PLMETHODID,EXT3 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '"+plId+"'";
|
||||
RowMap map = DBSql.getMap(sql);
|
||||
if(map!=null) {
|
||||
String methodId = map.getString("PLMETHODID");
|
||||
if("control.policy".equals(methodId)) {
|
||||
String fileType = map.getString("EXT3");
|
||||
if("I/O_L4".equals(fileType)) {
|
||||
arr.add("操作指导");
|
||||
}else {
|
||||
arr.add("制度模型");
|
||||
}
|
||||
}else if("data.form".equals(methodId)) {
|
||||
arr.add("表单模板");
|
||||
}else if("process.epc".equals(methodId)) {
|
||||
arr.add("EPC模型");
|
||||
}else if("process.flowchart".equals(methodId)) {
|
||||
arr.add("泳道图");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
private void updateEffectiveDateProperty(String processInstId, BO bo, Timestamp publishDate, List<BO> bolistN, List<BO> bolistC) {
|
||||
// 对epc、表单、制度图进行生效日期更新和手册重新生成
|
||||
|
||||
Loading…
Reference in New Issue
Block a user