|
|
|
@ -0,0 +1,455 @@
|
|
|
|
|
package com.customization.sendtodo;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.core.cfg.annotation.CommandDynamicProxy;
|
|
|
|
|
import com.engine.core.interceptor.AbstractCommandProxy;
|
|
|
|
|
import com.engine.core.interceptor.Command;
|
|
|
|
|
import com.engine.workflow.cmd.requestForm.ForwardSubmitCmd;
|
|
|
|
|
import org.docx4j.wml.U;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.file.FileUpload;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 转发、转办、意见征询等提交待办推送
|
|
|
|
|
*
|
|
|
|
|
* @author wangj
|
|
|
|
|
* @version 1.00版本
|
|
|
|
|
* @Date 2022/10/11
|
|
|
|
|
*/
|
|
|
|
|
@CommandDynamicProxy(target = ForwardSubmitCmd.class, desc = "流程转发、转办、意见征询等提交后给门户发送代办消息")
|
|
|
|
|
public class SendRemarkOperateTodoCmd extends AbstractCommandProxy<Map<String, Object>> {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> execute(Command<Map<String, Object>> targetCommand) {
|
|
|
|
|
//获取到被代理对象
|
|
|
|
|
ForwardSubmitCmd forwardSubmitCmd = (ForwardSubmitCmd) targetCommand;
|
|
|
|
|
//获取被代理对象的参数
|
|
|
|
|
//对参数做预处理
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
bb.writeLog("-----------SendRemarkOperateTodoCmd------start--");
|
|
|
|
|
HttpServletRequest request = forwardSubmitCmd.getRequest();
|
|
|
|
|
FileUpload fu = new FileUpload(request);
|
|
|
|
|
String requestid = Util.null2String(fu.getParameter("requestid"));
|
|
|
|
|
int forwardflag = 1;
|
|
|
|
|
forwardflag = Util.getIntValue(fu.getParameter("forwardflag"));
|
|
|
|
|
if (forwardflag != 2 && forwardflag != 3 && forwardflag != 5) {
|
|
|
|
|
forwardflag = 1; // 2 征求意见;3 转办 ;1 转发; 5 征询转办
|
|
|
|
|
}
|
|
|
|
|
//参数回写
|
|
|
|
|
//执行标准的业务处理
|
|
|
|
|
Map<String, Object> result = nextExecute(targetCommand);
|
|
|
|
|
|
|
|
|
|
boolean status = (boolean) result.get("success");
|
|
|
|
|
|
|
|
|
|
if (status) {
|
|
|
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
|
recordSet.executeSql("select * from workflow_requestbase where requestid =" + requestid);
|
|
|
|
|
int workflowid = -1;
|
|
|
|
|
String currnodetype0 = "";
|
|
|
|
|
String nodeid = "";
|
|
|
|
|
String requestname = "";
|
|
|
|
|
if (recordSet.next()) {
|
|
|
|
|
nodeid = Util.null2String(recordSet.getString("currentnodeid"));
|
|
|
|
|
}
|
|
|
|
|
User user = forwardSubmitCmd.getUser();
|
|
|
|
|
//执行推送代办
|
|
|
|
|
String portal_todourl = bb.getPropValue("PORTAL_INFO", "portal_todourl");
|
|
|
|
|
String username = bb.getPropValue("PORTAL_INFO", "username");
|
|
|
|
|
String passwd = bb.getPropValue("PORTAL_INFO", "passwd");
|
|
|
|
|
String center = bb.getPropValue("PORTAL_INFO", "center");
|
|
|
|
|
String bpm_workflowurl = bb.getPropValue("PORTAL_INFO", "bpm_workflowurl");
|
|
|
|
|
if (Util.getIntValue(requestid) > 0) {
|
|
|
|
|
sendTodoDataByCreateNode(requestid, nodeid, user, portal_todourl, username, passwd, bpm_workflowurl, center);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("-----------SendRemarkOperateTodoCmd------end--");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param requestid
|
|
|
|
|
* @param noideid
|
|
|
|
|
* @param user
|
|
|
|
|
*/
|
|
|
|
|
public void sendTodoDataByNode(String requestid, String noideid, User user, String portal_todourl, String username, String passwd, String bpm_workflowurl, String center) {
|
|
|
|
|
HttpReqUtils httpReqUtils = new HttpReqUtils();
|
|
|
|
|
JSONObject requestObject = new JSONObject();
|
|
|
|
|
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
bb.writeLog("sendTodoDataByNode");
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String ticketType = center;
|
|
|
|
|
String terminal = "1";
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String currentnodetype = "";
|
|
|
|
|
String sql = " select currentnodetype from workflow_requestbase where requestid=" + requestid;
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:" + sql);
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
currentnodetype = Util.null2String(rs.getString("CURRENTNODETYPE"));
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--currentnodetype:" + currentnodetype);
|
|
|
|
|
if ("3".equals(currentnodetype)) {
|
|
|
|
|
String actionType = "3";
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
String actionType = "";
|
|
|
|
|
int count = 0;
|
|
|
|
|
sql = " select t2.userid,h1.loginid\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" +
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where status = 1 union all select id,lastname,loginid from hrmresourcemanager ) h1 on h1.id = t2.userid\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and ((t2.isremark = '0' and (t2.takisremark is null or t2.takisremark = 0)) or t2.isremark in ('1', '5', '8', '9', '7', '11'))\n" +
|
|
|
|
|
" and t2.islasttimes = 1\n" +
|
|
|
|
|
" and (t2.isprocessing = '' or t2.isprocessing is null)\n" +
|
|
|
|
|
" and t2.REQUESTID = " + requestid +
|
|
|
|
|
" and t2.nodeid = " + noideid;
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:" + sql);
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--count:" + count);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
|
|
|
|
|
JSONArray taskObjectList = new JSONArray();
|
|
|
|
|
actionType = "1";
|
|
|
|
|
|
|
|
|
|
sql = " select t1.requestname,t1.requestmark,t1.creater,t1.createdate,t1.createtime,h1.lastname,h1.loginid,\n" +
|
|
|
|
|
" t1.requestid as taskCode,t1.currentnodeid as nodeid,d1.nodename\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_base t3 on t1.workflowid = t3.id\n" +
|
|
|
|
|
" left join workflow_nodebase d1 on d1.id = t1.currentnodeid " +
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where status = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t1.creater\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and t1.requestid = " + requestid +
|
|
|
|
|
" and t1.currentnodeid = " + noideid;
|
|
|
|
|
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:" + sql);
|
|
|
|
|
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
|
|
|
|
|
String title = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
String creator = Util.null2String(rs.getString("loginid"));
|
|
|
|
|
String taskCode = Util.null2String(rs.getString("taskcode"));
|
|
|
|
|
String nodeId = Util.null2String(rs.getString("nodeid"));
|
|
|
|
|
|
|
|
|
|
String createdate = Util.null2String(rs.getString("createdate"));
|
|
|
|
|
String createtime = Util.null2String(rs.getString("createtime"));
|
|
|
|
|
String messageTitle = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
String messageContent = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
|
|
|
|
|
String taskType = "0";
|
|
|
|
|
|
|
|
|
|
String urlPc = "[newtab]" + bpm_workflowurl + "/workflow/request/ViewRequestForwardSPA.jsp?requestid=" + requestid;
|
|
|
|
|
String urlApp = "[newtab]" + bpm_workflowurl + "/spa/workflow/static4mobileform/index.html#/req?requestid=" + requestid;
|
|
|
|
|
String urlDing = "[newtab]" + bpm_workflowurl + "/spa/workflow/static4mobileform/index.html#/req?requestid=" + requestid;
|
|
|
|
|
String nodeName = Util.null2String(rs.getString("nodeName"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requestObject.put("center", center);
|
|
|
|
|
requestObject.put("title", title);
|
|
|
|
|
requestObject.put("creator", creator);
|
|
|
|
|
requestObject.put("taskCode", taskCode);
|
|
|
|
|
requestObject.put("nodeId", nodeId);
|
|
|
|
|
requestObject.put("taskType", taskType);
|
|
|
|
|
requestObject.put("actionType", actionType);
|
|
|
|
|
requestObject.put("createDate", createdate + " " + createtime);
|
|
|
|
|
requestObject.put("messageTitle", messageTitle);
|
|
|
|
|
requestObject.put("messageContent", messageContent);
|
|
|
|
|
requestObject.put("terminal", terminal);
|
|
|
|
|
requestObject.put("urlPc", urlPc);
|
|
|
|
|
requestObject.put("urlApp", urlApp);
|
|
|
|
|
requestObject.put("urlDing", urlDing);
|
|
|
|
|
requestObject.put("nodeName", nodeName);
|
|
|
|
|
requestObject.put("ticketType", ticketType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject taskObject = new JSONObject();
|
|
|
|
|
String objectAction = "1";
|
|
|
|
|
String objectType = "0";
|
|
|
|
|
String objectCode = user.getLoginid();
|
|
|
|
|
String objectId = "";
|
|
|
|
|
String operatorCode = user.getLoginid();
|
|
|
|
|
|
|
|
|
|
taskObject.put("objectAction", objectAction);
|
|
|
|
|
taskObject.put("objectType", objectType);
|
|
|
|
|
taskObject.put("objectCode", objectCode);
|
|
|
|
|
taskObject.put("objectId", objectId);
|
|
|
|
|
taskObject.put("operatorCode", operatorCode);
|
|
|
|
|
taskObjectList.add(taskObject);
|
|
|
|
|
requestObject.put("taskObjectList", taskObjectList);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
JSONArray taskObjectList = new JSONArray();
|
|
|
|
|
actionType = "2";
|
|
|
|
|
|
|
|
|
|
sql = " select t1.requestname,t1.requestmark,t1.creater,t1.createdate,t1.createtime,h1.lastname,h1.loginid,\n" +
|
|
|
|
|
" t1.requestid as taskCode,t1.currentnodeid as nodeid,d1.nodename\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_base t3 on t1.workflowid = t3.id\n" +
|
|
|
|
|
" left join workflow_nodebase d1 on d1.id = t1.currentnodeid " +
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where status = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t1.creater\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and t1.requestid = " + requestid;
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:" + sql);
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
|
|
|
|
|
String title = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
String creator = Util.null2String(rs.getString("loginid"));
|
|
|
|
|
String taskCode = Util.null2String(rs.getString("taskcode"));
|
|
|
|
|
String nodeId = Util.null2String(rs.getString("nodeid"));
|
|
|
|
|
|
|
|
|
|
String createdate = Util.null2String(rs.getString("createdate"));
|
|
|
|
|
String createtime = Util.null2String(rs.getString("createtime"));
|
|
|
|
|
String messageTitle = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
String messageContent = Util.null2String(rs.getString("requestname"));
|
|
|
|
|
|
|
|
|
|
String taskType = "0";
|
|
|
|
|
|
|
|
|
|
String urlPc = "[newtab]" + bpm_workflowurl + "/workflow/request/ViewRequestForwardSPA.jsp?requestid=" + requestid;
|
|
|
|
|
String urlApp = "[newtab]" + bpm_workflowurl + "/spa/workflow/static4mobileform/index.html#/req?requestid=" + requestid;
|
|
|
|
|
String urlDing = "[newtab]" + bpm_workflowurl + "/spa/workflow/static4mobileform/index.html#/req?requestid=" + requestid;
|
|
|
|
|
String nodeName = Util.null2String(rs.getString("nodeName"));
|
|
|
|
|
|
|
|
|
|
requestObject.put("center", center);
|
|
|
|
|
requestObject.put("title", title);
|
|
|
|
|
requestObject.put("creator", creator);
|
|
|
|
|
requestObject.put("taskCode", taskCode);
|
|
|
|
|
requestObject.put("nodeId", nodeId);
|
|
|
|
|
requestObject.put("taskType", taskType);
|
|
|
|
|
requestObject.put("actionType", actionType);
|
|
|
|
|
requestObject.put("createDate", createdate + " " + createtime);
|
|
|
|
|
requestObject.put("messageTitle", messageTitle);
|
|
|
|
|
requestObject.put("messageContent", messageContent);
|
|
|
|
|
requestObject.put("terminal", terminal);
|
|
|
|
|
requestObject.put("urlPc", urlPc);
|
|
|
|
|
requestObject.put("urlApp", urlApp);
|
|
|
|
|
requestObject.put("urlDing", urlDing);
|
|
|
|
|
requestObject.put("nodeName", nodeName);
|
|
|
|
|
requestObject.put("ticketType", ticketType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// sql = " select t2.userid,h1.loginid\n" +
|
|
|
|
|
// " from workflow_requestbase t1\n" +
|
|
|
|
|
// " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" +
|
|
|
|
|
// " left join (select id, lastname,loginid from hrmresource where STATUS = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t2.userid\n" +
|
|
|
|
|
// " where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
// " and t2.REQUESTID = "+requestid+
|
|
|
|
|
// " and t2.nodeid = " + noideid ;
|
|
|
|
|
// bb.writeLog("sendTodoDataByNode--sql:"+sql);
|
|
|
|
|
// rs.executeQuery(sql);
|
|
|
|
|
// while (rs.next()){
|
|
|
|
|
// JSONObject taskObject = new JSONObject();
|
|
|
|
|
// String objectAction = "1" ;
|
|
|
|
|
// String objectType = "0";
|
|
|
|
|
// String objectCode = user.getLoginid() ;
|
|
|
|
|
// String objectId = "" ;
|
|
|
|
|
// String operatorCode = user.getLoginid() ;
|
|
|
|
|
//
|
|
|
|
|
// taskObject.put("objectAction",objectAction);
|
|
|
|
|
// taskObject.put("objectType",objectType);
|
|
|
|
|
// taskObject.put("objectCode",objectCode);
|
|
|
|
|
// taskObject.put("objectId",objectId);
|
|
|
|
|
// taskObject.put("operatorCode",operatorCode);
|
|
|
|
|
// taskObjectList.add(taskObject);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
sql = " select t2.userid,h1.loginid\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" +
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where STATUS = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t2.userid\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and ((t2.isremark = '0' and (t2.takisremark is null or t2.takisremark = 0)) or t2.isremark in ('1', '5', '8', '9', '7', '11'))\n" +
|
|
|
|
|
" and t2.islasttimes = 1\n" +
|
|
|
|
|
" and (t2.isprocessing = '' or t2.isprocessing is null)\n" +
|
|
|
|
|
" and t2.REQUESTID = " + requestid;
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:" + sql);
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
|
|
|
|
|
String usercode = Util.null2String(rs.getString("loginid"));
|
|
|
|
|
JSONObject taskObject = new JSONObject();
|
|
|
|
|
String objectAction = "0";
|
|
|
|
|
String objectType = "0";
|
|
|
|
|
String objectCode = usercode;
|
|
|
|
|
String objectId = "";
|
|
|
|
|
String operatorCode = usercode;
|
|
|
|
|
|
|
|
|
|
taskObject.put("objectAction", objectAction);
|
|
|
|
|
taskObject.put("objectType", objectType);
|
|
|
|
|
taskObject.put("objectCode", objectCode);
|
|
|
|
|
taskObject.put("objectId", objectId);
|
|
|
|
|
taskObject.put("operatorCode", operatorCode);
|
|
|
|
|
taskObjectList.add(taskObject);
|
|
|
|
|
}
|
|
|
|
|
requestObject.put("taskObjectList", taskObjectList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String username = "admin";
|
|
|
|
|
// String passwd = "Uportal_123";
|
|
|
|
|
// String todourl = "http://172.16.25.133/portal-web/centerTodo/sync" ;
|
|
|
|
|
|
|
|
|
|
//"Basic YWRtaW46VXBvcnRhbF8xMjM="
|
|
|
|
|
|
|
|
|
|
String auth = username + ":" + passwd;
|
|
|
|
|
bb.writeLog("requestObject:" + requestObject.toJSONString());
|
|
|
|
|
String msgdata = httpReqUtils.doPostByAuth2(portal_todourl, requestObject.toJSONString(), auth);
|
|
|
|
|
bb.writeLog("msgdata:" + msgdata);
|
|
|
|
|
if (!"".equals(msgdata)) {
|
|
|
|
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
|
|
|
|
System.out.println(msgObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param requestid
|
|
|
|
|
* @param noideid
|
|
|
|
|
* @param user
|
|
|
|
|
*/
|
|
|
|
|
public void sendTodoDataByCreateNode(String requestid,String noideid,User user,String portal_todourl,String username,String passwd,String bpm_workflowurl,String center){
|
|
|
|
|
|
|
|
|
|
HttpReqUtils httpReqUtils = new HttpReqUtils();
|
|
|
|
|
JSONObject requestObject = new JSONObject();
|
|
|
|
|
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
bb.writeLog("sendTodoDataByCreateNode");
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String ticketType = center ;
|
|
|
|
|
String terminal = "1" ;
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String currentnodetype = "" ;
|
|
|
|
|
String sql = " select currentnodetype from workflow_requestbase where requestid="+requestid;
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:"+sql);
|
|
|
|
|
if (rs.next()){
|
|
|
|
|
currentnodetype = Util.null2String(rs.getString("CURRENTNODETYPE"));
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--currentnodetype:"+currentnodetype);
|
|
|
|
|
if("3".equals(currentnodetype)){
|
|
|
|
|
String actionType = "3" ;
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
String actionType = "1" ;
|
|
|
|
|
|
|
|
|
|
JSONArray taskObjectList = new JSONArray();
|
|
|
|
|
|
|
|
|
|
sql = " select t1.requestname,t1.requestmark,t1.creater,t1.createdate,t1.createtime,h1.lastname,h1.loginid,\n" +
|
|
|
|
|
" t1.requestid as taskCode,t1.currentnodeid as nodeid,d1.nodename\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_base t3 on t1.workflowid = t3.id\n" +
|
|
|
|
|
" left join workflow_nodebase d1 on d1.id = t1.currentnodeid "+
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where status = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t1.creater\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and t1.requestid = "+requestid ;
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:"+sql);
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
if (rs.next()){
|
|
|
|
|
|
|
|
|
|
String title = Util.null2String(rs.getString("requestname")) ;
|
|
|
|
|
String creator = Util.null2String(rs.getString("loginid")) ;
|
|
|
|
|
String taskCode = Util.null2String(rs.getString("taskcode")) ;
|
|
|
|
|
String nodeId = Util.null2String(rs.getString("nodeid")) ;
|
|
|
|
|
|
|
|
|
|
String createdate = Util.null2String(rs.getString("createdate")) ;
|
|
|
|
|
String createtime = Util.null2String(rs.getString("createtime")) ;
|
|
|
|
|
String messageTitle = Util.null2String(rs.getString("requestname")) ;
|
|
|
|
|
String messageContent = Util.null2String(rs.getString("requestname")) ;
|
|
|
|
|
|
|
|
|
|
String taskType = "0";
|
|
|
|
|
|
|
|
|
|
String urlPc = "[newtab]"+bpm_workflowurl+"/workflow/request/ViewRequestForwardSPA.jsp?requestid="+requestid ;
|
|
|
|
|
String urlApp = "[newtab]"+bpm_workflowurl+"/spa/workflow/static4mobileform/index.html#/req?requestid="+requestid;
|
|
|
|
|
String urlDing = "[newtab]"+bpm_workflowurl+"/spa/workflow/static4mobileform/index.html#/req?requestid="+requestid;
|
|
|
|
|
String nodeName = Util.null2String(rs.getString("nodeName")) ;
|
|
|
|
|
|
|
|
|
|
requestObject.put("center",center);
|
|
|
|
|
requestObject.put("title",title);
|
|
|
|
|
requestObject.put("creator",creator);
|
|
|
|
|
requestObject.put("taskCode",taskCode);
|
|
|
|
|
requestObject.put("nodeId",nodeId);
|
|
|
|
|
requestObject.put("taskType",taskType);
|
|
|
|
|
requestObject.put("actionType",actionType);
|
|
|
|
|
requestObject.put("createDate",createdate+" "+createtime);
|
|
|
|
|
requestObject.put("messageTitle",messageTitle);
|
|
|
|
|
requestObject.put("messageContent",messageContent);
|
|
|
|
|
requestObject.put("terminal",terminal);
|
|
|
|
|
requestObject.put("urlPc",urlPc);
|
|
|
|
|
requestObject.put("urlApp",urlApp);
|
|
|
|
|
requestObject.put("urlDing",urlDing);
|
|
|
|
|
requestObject.put("nodeName",nodeName);
|
|
|
|
|
requestObject.put("ticketType",ticketType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sql = " select t2.userid,h1.loginid\n" +
|
|
|
|
|
" from workflow_requestbase t1\n" +
|
|
|
|
|
" inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" +
|
|
|
|
|
" left join (select id, lastname,loginid from hrmresource where STATUS = 1 union all select id, lastname,loginid from hrmresourcemanager ) h1 on h1.id = t2.userid\n" +
|
|
|
|
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
|
|
|
|
" and t2.isremark = '1' \n" +
|
|
|
|
|
" and t2.islasttimes = 1\n" +
|
|
|
|
|
" and (t2.isprocessing = '' or t2.isprocessing is null)\n" +
|
|
|
|
|
" and t2.REQUESTID = "+requestid+" and t2.nodeid = "+noideid;
|
|
|
|
|
bb.writeLog("sendTodoDataByNode--sql:"+sql);
|
|
|
|
|
rs.executeQuery(sql);
|
|
|
|
|
while (rs.next()){
|
|
|
|
|
|
|
|
|
|
String usercode = Util.null2String(rs.getString("loginid")) ;
|
|
|
|
|
JSONObject taskObject = new JSONObject();
|
|
|
|
|
String objectAction = "0" ;
|
|
|
|
|
String objectType = "0";
|
|
|
|
|
String objectCode = usercode ;
|
|
|
|
|
String objectId = "" ;
|
|
|
|
|
String operatorCode = usercode ;
|
|
|
|
|
|
|
|
|
|
taskObject.put("objectAction",objectAction);
|
|
|
|
|
taskObject.put("objectType",objectType);
|
|
|
|
|
taskObject.put("objectCode",objectCode);
|
|
|
|
|
taskObject.put("objectId",objectId);
|
|
|
|
|
taskObject.put("operatorCode",operatorCode);
|
|
|
|
|
taskObjectList.add(taskObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
requestObject.put("taskObjectList",taskObjectList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String username = "admin";
|
|
|
|
|
// String passwd = "Uportal_123";
|
|
|
|
|
// String todourl = "http://172.16.25.133/portal-web/centerTodo/sync" ;
|
|
|
|
|
|
|
|
|
|
String auth = username + ":" + passwd;
|
|
|
|
|
bb.writeLog("requestObject:"+requestObject.toJSONString());
|
|
|
|
|
String msgdata = httpReqUtils.doPostByAuth2(portal_todourl,requestObject.toJSONString(),auth);
|
|
|
|
|
bb.writeLog("msgdata:"+msgdata);
|
|
|
|
|
if(!"".equals(msgdata)){
|
|
|
|
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
|
|
|
|
System.out.println(msgdata);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|