流程发布表单保存时保存文件类型到主表
This commit is contained in:
parent
be52bcd966
commit
d83318f519
@ -51,75 +51,12 @@ 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模型/泳道图");
|
||||
}
|
||||
|
||||
//List<BO> bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list();
|
||||
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、表单、制度图进行生效日期更新和手册重新生成
|
||||
// epc:process.epc effective_date
|
||||
|
||||
@ -5,11 +5,14 @@ import java.util.List;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.publisher.constant.PublisherConstant;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
|
||||
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
|
||||
import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst;
|
||||
import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.BOQueryAPI;
|
||||
@ -29,6 +32,7 @@ public class SubFormAfterSave extends ExecuteListener {
|
||||
}
|
||||
|
||||
public void execute(ProcessExecutionContext param) throws Exception {
|
||||
String processInstId = param.getProcessInstance().getId();
|
||||
//记录ID
|
||||
String boId = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
|
||||
//表单ID
|
||||
@ -110,15 +114,90 @@ public class SubFormAfterSave extends ExecuteListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SDK.getBOAPI().create(boName, boList, bindId, uid);
|
||||
// 该记录是否新建的状态,由于机制调整,BO对象中的ID是不为空的,不能通过ID判断记录是否处于新建状态还是修改状态
|
||||
boolean isCreate = param.getParameterOfBoolean(ListenerConst.FORM_EVENT_PARAM_ISCREATE);
|
||||
if (isCreate) {
|
||||
SDK.getBOAPI().remove(boName, boId);
|
||||
}
|
||||
|
||||
//保存文件类型到主表
|
||||
saveFileType(processInstId);
|
||||
}
|
||||
}
|
||||
//保存文件类型到主表
|
||||
saveFileType(processInstId);
|
||||
}
|
||||
public String saveFileType(String processInstId) {
|
||||
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("泳道图")) {
|
||||
DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '操作指导/表单模板' WHERE BINDID = '"+processInstId+"'");
|
||||
//SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "操作指导/表单模板");
|
||||
}else {
|
||||
DBSql.update("UPDATE BO_ACT_COE_PUBLISH SET RELEASE_THE_TITLE = '制度模型/EPC模型/泳道图' WHERE BINDID = '"+processInstId+"'");
|
||||
//SDK.getBOAPI().updateByBindId("BO_ACT_COE_PUBLISH", processInstId, "RELEASE_THE_TITLE", "制度模型/EPC模型/泳道图");
|
||||
}
|
||||
return processInstId;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1430,7 +1430,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + publishfileid + "'";
|
||||
RowMap map = DBSql.getMap(sql_n);
|
||||
PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(publishfileid);
|
||||
jsonObject_ehsq.put("version", palRepositoryModel.getVersion()+"");
|
||||
jsonObject_ehsq.put("version", "V"+palRepositoryModel.getVersion()+"");
|
||||
jsonObject_ehsq.put("releasedate", simpleDateFormat.format(new Date()));
|
||||
jsonObject_ehsq.put("effectivedate", simpleDateFormat.format(new Date()));
|
||||
jsonObject_ehsq.put("authorcode", processExecutionContext.getTaskInstance().getTarget()); // jsonObject_ehsq.put("authorcode","00116465");
|
||||
@ -1538,7 +1538,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
String sql_n = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '" + publishfileid + "'";
|
||||
RowMap map = DBSql.getMap(sql_n);
|
||||
PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(publishfileid);
|
||||
jsonObject_ehsq.put("version", palRepositoryModel.getVersion()+"");
|
||||
jsonObject_ehsq.put("version", "V"+palRepositoryModel.getVersion()+"");
|
||||
jsonObject_ehsq.put("releasedate", simpleDateFormat.format(new Date()));
|
||||
jsonObject_ehsq.put("effectivedate", simpleDateFormat.format(new Date()));
|
||||
jsonObject_ehsq.put("authorcode", processExecutionContext.getTaskInstance().getTarget());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user