流程发布,生成流程编号修改
This commit is contained in:
parent
adcf5000b3
commit
2240c127d2
@ -77,7 +77,7 @@ public class ProcesNumberUtil {
|
||||
}
|
||||
String levelnum = levelOne + "." + levelTwo + "." + levelThree;
|
||||
|
||||
String updateSql = "update BO_ACT_COE_PUBLISH_N set PROCESS_NUMBER='%s' where ID = '%s'";
|
||||
String updateSql = "update BO_ACT_COE_PUBLISH_N set PUBLISH_NUMBER='%s' where ID = '%s'";
|
||||
for (BO nowData : dataList) {
|
||||
String number = getProcessNum(levelnum, orgCode);
|
||||
String publishfileid=nowData.getString("PUBLISHFILEID");
|
||||
|
||||
@ -2411,7 +2411,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
obj.put("publishDesc", newBo.getString("PUBLISHDESC"));
|
||||
obj.put("publishFileName", newBo.getString("PUBLISHFILENAME"));
|
||||
obj.put("publishFileId", newBo.getString("PUBLISHFILEID"));
|
||||
obj.put("processNumber", newBo.getString("PROCESS_NUMBER"));
|
||||
obj.put("processNumber", newBo.getString("PUBLISH_NUMBER"));
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(newBo.getString("PUBLISHFILEID"));
|
||||
if (model != null) {
|
||||
obj.put("fileVersion", VersionUtil.getVersionStr(model.getVersion()));
|
||||
|
||||
@ -17,6 +17,9 @@ import com.actionsoft.sdk.local.SDK;
|
||||
* @date 2022/7/14 17:17
|
||||
*/
|
||||
public class PublishLoadBefore extends ExecuteListener {
|
||||
public String getDescription() {
|
||||
return "表单加载前获取内部校对人和流程经理";
|
||||
}
|
||||
|
||||
public void execute(ProcessExecutionContext ctx) throws Exception {
|
||||
String boId = ctx.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
package com.actionsoft.apps.coe.pal.publisher.event;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
@ -14,19 +10,9 @@ 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.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.org.cache.UserCache;
|
||||
import com.actionsoft.bpms.org.model.UserModel;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.actionsoft.sdk.local.api.BOQueryAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.awspaas.user.apps.integrates.XmlDatasUtil;
|
||||
import com.awspaas.user.apps.integrates.util.HttpClientUtil;
|
||||
|
||||
public class SubFormAfterSave extends ExecuteListener {
|
||||
|
||||
@ -50,8 +36,6 @@ public class SubFormAfterSave extends ExecuteListener {
|
||||
//BO表名
|
||||
String boName = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BONAME);
|
||||
BO formData = (BO) param.getParameter(ListenerConst.FORM_EVENT_PARAM_FORMDATA);
|
||||
|
||||
TaskInstance taskInstance = param.getTaskInstance();
|
||||
String bindId = formData.getBindId();
|
||||
String uid = formData.getCreateUser();
|
||||
if (boName.equals("BO_ACT_COE_PUBLISH_N")) {
|
||||
@ -134,137 +118,6 @@ public class SubFormAfterSave extends ExecuteListener {
|
||||
}
|
||||
}
|
||||
|
||||
sendOaPending(taskInstance,param);
|
||||
|
||||
}
|
||||
/**
|
||||
* 发送待办
|
||||
*
|
||||
* @param taskInstance DD
|
||||
*/
|
||||
public void sendOaPending(TaskInstance taskInstance, ProcessExecutionContext pec) throws IOException {
|
||||
|
||||
XmlDatasUtil xmlDatasUtil = new XmlDatasUtil();
|
||||
xmlDatasUtil.setExternal_system_ID("CL");
|
||||
xmlDatasUtil.setOther_system_to_do_ID(taskInstance.getId());
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
|
||||
//http://localhost:8089/portal/r/or?cmd=com.yili_form_page_open&processInstId=3505e654-9217-41cd-a31d-4971846b3219&taskInstId=8a71d75e-3ee0-43a2-a226-ecb01419319c&oauthName=oauthLogin&token=admin
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
if (portalUrl.equals("http://10.114.11.135:8088/portal")){
|
||||
portalUrl = "https://bpm.yili.com:8088/portal/";
|
||||
}
|
||||
xmlDatasUtil.setPcurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&oauthName=oauthLogin&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&oauthName=WechatOauthLogin&casaccount="+pec.getTaskInstance().getTarget()+"&processInstId="+pec.getProcessInstance().getId()+"&taskInstId="+taskInstance.getId());
|
||||
String target = taskInstance.getTarget();
|
||||
if (target.length()==8&&"00".equals(target.substring(0,2))){
|
||||
target = target.substring(2);
|
||||
}
|
||||
System.out.println("当前账户======》》》》"+target);
|
||||
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
|
||||
System.out.println("bo>>>>>>>>>>"+bo_eu_oa_reson);
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setTo_do_login_account(bo_eu_oa_reson.getString("LOGINID"));
|
||||
}
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义格式,不显示毫秒
|
||||
String str = df.format(taskInstance.getBeginTime());
|
||||
String substring = str.substring(str.indexOf(" "), str.length());
|
||||
xmlDatasUtil.setTo_do_creation_time(substring);
|
||||
xmlDatasUtil.setTo_do_completion_time(substring);
|
||||
//if (taskInstance.getState()==1){
|
||||
xmlDatasUtil.setTo_do_status("0");
|
||||
//}
|
||||
xmlDatasUtil.setTo_do_official_type("0");
|
||||
// if (taskInstance.getReadState()==0){
|
||||
// xmlDatasUtil.setViewtype("0");
|
||||
// }else if (taskInstance.getReadState()==1){
|
||||
xmlDatasUtil.setViewtype("0");
|
||||
// }
|
||||
xmlDatasUtil.setCreatedate(str.substring(0, str.indexOf(" ")));
|
||||
xmlDatasUtil.setDonedate(str.substring(0, str.indexOf(" ")));
|
||||
/*String der ="";
|
||||
if (taskInstance.getReadTime()!=null){
|
||||
der = df.format(taskInstance.getReadTime());
|
||||
xmlDatasUtil.setReceivedate(der.substring(0, der.indexOf(" ")));
|
||||
xmlDatasUtil.setReceivetime(der.substring(der.indexOf(" "),der.length()));
|
||||
}else {
|
||||
der = df.format(taskInstance.getBeginTime());
|
||||
xmlDatasUtil.setReceivedate(der.substring(0, der.indexOf(" ")));
|
||||
xmlDatasUtil.setReceivetime(der.substring(der.indexOf(" "),der.length()));
|
||||
}*/
|
||||
xmlDatasUtil.setReceivedate(str.substring(0, str.indexOf(" ")));
|
||||
xmlDatasUtil.setReceivetime(substring);
|
||||
|
||||
xmlDatasUtil.setCurrentnodetype("0");
|
||||
xmlDatasUtil.setRequestcode(pec.getProcessInstance().getId());
|
||||
xmlDatasUtil.setCurrentnodename(SDK.getRepositoryAPI().getProcessNode(pec.getProcessInstance().getProcessDefId(),pec.getTaskInstance().getActivityDefId()).getName());
|
||||
|
||||
// 调用App
|
||||
String sourceAppId = pec.getProcessInstance().getAppId();
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.processtrends/processNodeInfoASLP";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
//流程实例id,必填
|
||||
params.put("processInstId", pec.getProcessInstance().getId());
|
||||
//,必填
|
||||
params.put("sid", pec.getUserContext().getSessionId());
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//流程节点数据
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
String username = "";
|
||||
String userid = "";
|
||||
if (ro.isOk()){
|
||||
List list = new ArrayList();
|
||||
Object processBudgetModelList = ro.get("processBudgetModelList");
|
||||
JSONArray array = JSON.parseArray(String.valueOf(processBudgetModelList));
|
||||
|
||||
if (!array.isEmpty()){
|
||||
for(int i=0;i<array.size();i++){
|
||||
JSONObject jsonObject = JSONObject.parseObject(array.get(i).toString());
|
||||
String executor = jsonObject.get("executor").toString();
|
||||
String userid2 = jsonObject.get("userid2").toString();
|
||||
//String userid2 = jsonArray.getJSONObject(i).getString("userid2");
|
||||
username+=executor+" ";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setNooperator(bo_eu_oa_reson.getString("LOGINID"));
|
||||
}
|
||||
|
||||
xmlDatasUtil.setWorkcode("");
|
||||
xmlDatasUtil.setWorkflowname(pec.getProcessInstance().getTitle());
|
||||
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setCreaterhrcode(bo_eu_oa_reson.getString("LOGINID"));
|
||||
}
|
||||
xmlDatasUtil.setCreaterworkcode("");
|
||||
|
||||
|
||||
|
||||
HttpClientUtil httpClientUtil = new HttpClientUtil();
|
||||
String s = httpClientUtil.SendPend("http://10.105.1.59/services/yili", xmlDatasUtil);
|
||||
System.out.println("状态码============》》》》》》》》》》》"+s);
|
||||
if (s.equals("Success")){
|
||||
//logger.info("发送待办任务完成,请去OA系统上查看是否传输完成");
|
||||
}else if (s.equals("fail")){
|
||||
//logger.error("发送待办任务失败,请联系管理员查看是否出现错误");
|
||||
}
|
||||
// pend.setTitle(taskInstance.getTitle());
|
||||
UserModel targetUserModel = UserCache.getModel(taskInstance.getTarget());
|
||||
// if (null == targetUserModel || StringUtils.isBlank(targetUserModel.getExt5())) {
|
||||
// String msg = "账号对应的OA账号为空!待办不能推送,请补充完善账号信息!BPM账号:" + taskInstance.getTarget();
|
||||
// logger.error(msg);
|
||||
//
|
||||
// // 给 admin 推消息
|
||||
// notificationAPI.sendSystemMessage("admin", msg, "error");
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ function initHtml() {
|
||||
changeHtml += '<th style="background-color:#fff;" class="width_25">流程制度</th>';
|
||||
changeHtml += '<th style="background-color:#fff;" class="width_20">变更后流程制度</th>';
|
||||
changeHtml += '<th style="background-color:#fff;" class="width_20">文件文本</th>';
|
||||
changeHtml += '<th style="background-color:#fff;" class="width_25">变更说明</th>';
|
||||
changeHtml += '<th style="background-color:#fff;" class="width_25">文件编号</th>';
|
||||
changeHtml += '</tr>';
|
||||
changeHtml += '</thead>';
|
||||
changeHtml += '<tbody id="publish_change_tbody"></tbody>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user