From 17851c0c43a58e23c7b0779222f974724a6ae3a3 Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Wed, 8 Nov 2023 09:41:33 +0800 Subject: [PATCH] =?UTF-8?q?#EC=5FHJ121#=20=E5=BC=BA=E5=88=B6=E5=BD=92?= =?UTF-8?q?=E6=A1=A3=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sendtodo/SendPortalWithAddDoneCmd.java | 96 ++++++- .../web/RequestMonitorListAction.java | 103 ++++++-- .../dito/monitor/SendPortalMonitorUtil.java | 248 ++++++++++++------ 3 files changed, 338 insertions(+), 109 deletions(-) diff --git a/src/com/customization/dito/sendtodo/SendPortalWithAddDoneCmd.java b/src/com/customization/dito/sendtodo/SendPortalWithAddDoneCmd.java index bea3df16..92ee478d 100644 --- a/src/com/customization/dito/sendtodo/SendPortalWithAddDoneCmd.java +++ b/src/com/customization/dito/sendtodo/SendPortalWithAddDoneCmd.java @@ -6,6 +6,7 @@ import com.constant.Constants; import com.engine.core.interceptor.CommandContext; import com.time.util.DateUtil; import org.apache.commons.lang.StringUtils; +import org.jsoup.Connection; import weaver.conn.RecordSet; import weaver.general.BaseBean; import weaver.general.Util; @@ -13,6 +14,7 @@ import weaver.interfaces.dito.comInfo.PropBean; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -27,8 +29,22 @@ public class SendPortalWithAddDoneCmd { public Map execute(CommandContext commandContext) { - List> donelist = (List>)(params.get("doneDatas")); + BaseBean bb = new BaseBean(); + List> allDonelist = (List>)(params.get("doneDatas")); + bb.writeLog("allDonelist:"+allDonelist.size()); String requestid = Util.null2String(params.get("requestid")); + List> donelist = new ArrayList>(); + List userList = getRequestArchivedReamrkUserIds(requestid); + bb.writeLog("userList:"+userList.size()); + for (int i=0;i doneMap = allDonelist.get(i); + String userid = Util.null2String(doneMap.get("id")) ; + if(!userList.contains(userid)){ + donelist.add(doneMap); + } + } + bb.writeLog("donelist:"+donelist.size()); + String bpm_app_workflowurl = PropBean.getUfPropValue("bpm_app_workflowurl"); String bpm_app_requesturl = PropBean.getUfPropValue("bpm_app_requesturl"); String portal_doneurl = PropBean.getUfPropValue("portal_doneurl"); @@ -43,13 +59,74 @@ public class SendPortalWithAddDoneCmd { return null; } - private String getShortMessageTitle(String messageTitle) { - if (messageTitle.length() > 20) { - messageTitle = messageTitle.substring(0, 17) + "..."; + /*** + * + * @param requestid + */ + public List getRequestArchivedReamrkUserIds(String requestid){ + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + List userList = new ArrayList(); + + try{ + if(StringUtils.isNotBlank(requestid)) + { + String currentNodeId = "" ; + String currentNodeType = "" ; + String sql =" select t1.currentnodeid,t1.currentnodetype \n" + + " from workflow_requestbase t1\n" + + " where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" + + " and t1.requestid = "+requestid ; + + bb.writeLog("getRequestArchivedReamrkUserIds--sql2:"+sql); + rs.executeQuery(sql); + if (rs.next()){ + currentNodeId = Util.null2String(rs.getString("currentnodeid")) ; + currentNodeType = Util.null2String(rs.getString("currentnodetype")) ; + } + if("3".equals(currentNodeType)){ + int usercount = 0; + sql = " select id from workflow_currentoperator \n" + + "where requestid = " + requestid + + "and nodeid= " + currentNodeId + + "and isremark = 4 \n" + + "and preisremark = 4 \n" + + "and receivedate in(select max(receivedate ) as receivedate from workflow_currentoperator where requestid = "+requestid+" and nodeid="+currentNodeId+")\n" + + "and receivetime in(select max(receivetime) as receivetime from workflow_currentoperator where requestid = "+requestid+" and nodeid="+currentNodeId+")" ; + rs.executeQuery(sql); + bb.writeLog("getRequestArchivedReamrkUserIds--sql3:"+sql); + while (rs.next()){ + usercount++; + } + + if(usercount >0){ + sql = " select distinct id as userid from workflow_forecastOperator t1 where t1.requestid = "+requestid+" and t1.nodeid ="+currentNodeId+" and t1.operateType in(-3,-4) " ; + bb.writeLog("getRequestArchivedReamrkUserIds-sql:"+sql); + rs.executeQuery(sql); + while (rs.next()) { + String userid = rs.getString("userid"); + userList.add(userid); + } + } + } + } + }catch (Exception e){ + bb.writeLog("e:"+e); } - return messageTitle; + return userList; } + /*** + * + * @param requestid + * @param donelist + * @param portal_doneurl + * @param bpm_app_workflowurl + * @param username + * @param passwd + * @param bpm_workflowurl + * @param bpm_app_requesturl + */ public void sendPortalDoneData(String requestid,List> donelist, String portal_doneurl, String bpm_app_workflowurl, String username, String passwd, String bpm_workflowurl, String bpm_app_requesturl) { BaseBean bb = new BaseBean(); bb.writeLog("sendPortalDoneData"); @@ -255,4 +332,13 @@ public class SendPortalWithAddDoneCmd { } return flag; } + + + private String getShortMessageTitle(String messageTitle) { + if (messageTitle.length() > 20) { + messageTitle = messageTitle.substring(0, 17) + "..."; + } + return messageTitle; + } + } diff --git a/src/com/engine/workflow/web/RequestMonitorListAction.java b/src/com/engine/workflow/web/RequestMonitorListAction.java index e0c534a4..40d7aa28 100644 --- a/src/com/engine/workflow/web/RequestMonitorListAction.java +++ b/src/com/engine/workflow/web/RequestMonitorListAction.java @@ -1,5 +1,6 @@ package com.engine.workflow.web; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; @@ -213,6 +214,17 @@ public class RequestMonitorListAction { @Produces(MediaType.TEXT_PLAIN) public String archivingRequestById(@Context HttpServletRequest request,@Context HttpServletResponse response){ Map apidatas = new HashMap(); + String requestids = Util.null2String(request.getParameter("multiRequestIds")); + try{ + + User user = HrmUserVarify.getUser(request, response); + String f_weaver_belongto_userid=request.getParameter("f_weaver_belongto_userid");//需要增加的代码 + String f_weaver_belongto_usertype=request.getParameter("f_weaver_belongto_usertype");//需要增加的代码 + user = HrmUserVarify.getUser(request, response, f_weaver_belongto_userid, f_weaver_belongto_usertype) ;//需要增加的代码 + addClassInterface2SimpleMode(requestids,user); + }catch (Exception e){ + + } try{ User user = HrmUserVarify.getUser(request, response); String f_weaver_belongto_userid=request.getParameter("f_weaver_belongto_userid");//需要增加的代码 @@ -220,36 +232,81 @@ public class RequestMonitorListAction { user = HrmUserVarify.getUser(request, response, f_weaver_belongto_userid, f_weaver_belongto_usertype) ;//需要增加的代码 setService(user); apidatas = monitorService.archivingRequestById(request, response, user); - - BaseBean bb = new BaseBean(); - try{ - String requestid = Util.null2String(request.getParameter("multiRequestIds")); - String userid = user.getUID()+"" ; - bb.writeLog("archivingRequestById-requestid"+requestid); - bb.writeLog("archivingRequestById-userid"+userid); - - if(StringUtils.isNotEmpty(requestid)){ - String className = "weaver.interfaces.dito.monitor.SendPortalMonitorUtil" ; - String methodName = "monitorArchived" ; - Class clazz = Class.forName(className); - Method method = clazz.getMethod(methodName, String.class,String.class); - Object newInstance = clazz.newInstance(); - method.invoke(newInstance,requestid,userid); - } - }catch (ClassNotFoundException | NoSuchMethodException e){ - e.printStackTrace(); - bb.writeLog("archivingRequestById-ClassNotFoundException"+e); - } - }catch(Exception e){ e.printStackTrace(); apidatas.put("api_status", false); apidatas.put("api_errormsg", "catch exception : " + e.getMessage()); } + + try{ + String f_weaver_belongto_userid=request.getParameter("f_weaver_belongto_userid");//需要增加的代码 + String f_weaver_belongto_usertype=request.getParameter("f_weaver_belongto_usertype");//需要增加的代码 + User user = HrmUserVarify.getUser(request, response); + user = HrmUserVarify.getUser(request, response, f_weaver_belongto_userid, f_weaver_belongto_usertype) ;//需要增加的代码 + String userid = user.getUID()+"" ; + addClassInterface2Monitor(requestids,userid); + }catch (Exception e){ + + } return JSONObject.toJSONString(apidatas); } - - + + /** + * + * @param requestids + */ + private void addClassInterface2SimpleMode(String requestids,User user){ + BaseBean bb = new BaseBean(); + try{ + if(StringUtils.isNotEmpty(requestids)){ + String className = "weaver.interfaces.dito.monitor.SendPortalMonitorUtil" ; + String methodName = "doSimpleModeDataByMonitor" ; + Class clazz = Class.forName(className); + Method method = clazz.getMethod(methodName, String.class,User.class); + Object newInstance = clazz.newInstance(); + method.invoke(newInstance,requestids,user); + } + }catch (ClassNotFoundException | NoSuchMethodException e){ + e.printStackTrace(); + bb.writeLog("archivingRequestById-ClassNotFoundException"+e); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } + + /*** + * + * @param requestid + * @param userid + */ + private void addClassInterface2Monitor(String requestid,String userid){ + BaseBean bb = new BaseBean(); + try{ + bb.writeLog("archivingRequestById-requestid"+requestid); + bb.writeLog("archivingRequestById-userid"+userid); + if(StringUtils.isNotEmpty(requestid)){ + String className = "weaver.interfaces.dito.monitor.SendPortalMonitorUtil" ; + String methodName = "monitorArchived" ; + Class clazz = Class.forName(className); + Method method = clazz.getMethod(methodName, String.class,String.class); + Object newInstance = clazz.newInstance(); + method.invoke(newInstance,requestid,userid); + } + }catch (ClassNotFoundException | NoSuchMethodException e){ + e.printStackTrace(); + bb.writeLog("archivingRequestById-ClassNotFoundException"+e); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } /** * 流程暂停 diff --git a/src/weaver/interfaces/dito/monitor/SendPortalMonitorUtil.java b/src/weaver/interfaces/dito/monitor/SendPortalMonitorUtil.java index 0ae3b547..86f69e69 100644 --- a/src/weaver/interfaces/dito/monitor/SendPortalMonitorUtil.java +++ b/src/weaver/interfaces/dito/monitor/SendPortalMonitorUtil.java @@ -5,11 +5,14 @@ import com.alibaba.fastjson.JSONObject; import com.constant.Constants; import com.customization.dito.sendtodo.HttpRequestUtil; import com.customization.dito.sendtodo.SendPortalErrorUtil; +import com.engine.core.context.Context; +import com.engine.workflowDesign.cmd.autoForecast.GetSimpleModeDataCmd; import com.time.util.DateUtil; import org.apache.commons.lang3.StringUtils; import weaver.conn.RecordSet; import weaver.general.BaseBean; import weaver.general.Util; +import weaver.hrm.User; import weaver.interfaces.dito.comInfo.PropBean; import java.net.URLEncoder; import java.util.HashMap; @@ -466,13 +469,13 @@ public class SendPortalMonitorUtil { SendPortalErrorUtil sendPortalErrorUtil = new SendPortalErrorUtil(); HttpRequestUtil httpRequestUtil = new HttpRequestUtil(); String mobileJumpUrl = PropBean.getUfPropValue("mobileJumpUrl"); - JSONObject requestObject = new JSONObject(); + RecordSet rs = new RecordSet(); BaseBean bb = new BaseBean(); bb.writeLog("SendPortalMonitorUtil--monitorArchivedByToRead4Rquestid"); String terminal = "1" ; String taskType = "1"; - String actionType = "2" ; + String actionType = "0" ; String objectAction = "0"; String objectType = "0" ; try { @@ -520,23 +523,18 @@ public class SendPortalMonitorUtil { if("3".equals(currentnodetype)){ JSONArray taskObjectList = new JSONArray(); - sql = " select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+ - " from workflow_requestbase t1\n" + - " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" + - " left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+ - " left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n" + - " left join workflow_nodebase d1 on d1.id = t2.nodeid "+ - " where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" + - " and t2.isremark =2 and t2.preisremark in (8,9) \n" + - " and t2.islasttimes = 1 \n" + - " and (t2.isprocessing = '' or t2.isprocessing is null)\n" + - " and t2.requestid = "+requestid ; + + sql = " select t2.id as userid,c1."+cus_staff+" as staffid,h1.loginid \n" + + " from ( select distinct id from workflow_forecastOperator t1 where t1.requestid = "+requestid+" and t1.nodeid ="+currentNodeId+" and t1.operateType in(-3,-4) ) t2 " + + " left join cus_fielddata c1 on c1.id = t2.id and c1.scopeid="+scopeid+" and c1.scope = '"+scope+"' \n" + + " left join (select id,lastname,loginid,email from hrmresource where status = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.id \n" ; bb.writeLog("monitorArchivedByToRead4Rquestid-sql:"+sql); rs.executeQuery(sql); while (rs.next()) { String creator = rs.getString("loginid"); String staffid = rs.getString("staffid"); String userid = rs.getString("userid"); + bb.writeLog("monitorArchivedByToRead4Rquestid:"+requestid+" creator:"+creator); if ("sysadmin".equals(creator)) { creator = "Admin"; @@ -555,9 +553,9 @@ public class SendPortalMonitorUtil { String userid = dataObject.getString("userid"); String creator = dataObject.getString("creator"); + JSONObject requestObject = new JSONObject(); requestObject.put("center",center); requestObject.put("title",requestname); - requestObject.put("taskCode","weaver"+requestid); requestObject.put("taskCode", requestid+"_cs_"+userid); requestObject.put("nodeId",currentNodeId); requestObject.put("taskType",taskType); @@ -584,7 +582,7 @@ public class SendPortalMonitorUtil { JSONArray taskArray = new JSONArray(); taskArray.add(taskObject); - requestObject.put("taskObjectList",taskObjectList); + requestObject.put("taskObjectList",taskArray); String auth = username + ":" + passwd; bb.writeLog("monitorArchivedByToRead4Rquestid---requestObject:"+requestObject.toJSONString()); String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth); @@ -789,7 +787,51 @@ public class SendPortalMonitorUtil { } + /*** + * + * @param requestids + * @param user + */ + public void doSimpleModeDataByMonitor(String requestids,User user){ + if(StringUtils.isNotBlank(requestids)) { + String[] lcids = requestids.split(","); + for (int i = 0; i < lcids.length; i++) { + String requestid = lcids[i]; + doSimpleModeDataByMonitor2Requestid(requestid,user); + } + } + } + + /*** + * + * @param requestid + * @param user + */ + public void doSimpleModeDataByMonitor2Requestid(String requestid,User user){ + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + try{ + String workflowid = "" ; + if(StringUtils.isNotBlank(requestid)){ + String sql = " select workflowid from workflow_requestbase where requestid = "+requestid ; + rs.executeQuery(sql); + if(rs.next()){ + workflowid = Util.null2String(rs.getString("workflowid")) ; + } + if(StringUtils.isNotBlank(workflowid)){ + Map params = new HashMap(); + params.put("requestid",requestid); + params.put("workflowid",workflowid); + params.put("resetForecast","1"); + new GetSimpleModeDataCmd(params,user).execute(Context.getCommandComtext()); + } + } + }catch (Exception e){ + e.printStackTrace(); + bb.writeLog("e:"+e.getMessage()); + } + } /*** * intervention 流程干预 @@ -817,7 +859,7 @@ public class SendPortalMonitorUtil { bb.writeLog("SendPortalMonitorUtil--monitorIntervention"); String terminal = "1" ; String taskType = "0"; - String actionType = "2" ; + try { String cus_staff = PropBean.getUfPropValue("cus_staff") ; String scopeid = "-1"; @@ -835,46 +877,33 @@ public class SendPortalMonitorUtil { } bb.writeLog("monitorIntervention-urlDing", urlDing); - int count = 0 ; - String countSql =" select t2.userid \n" + - " from workflow_requestbase t1\n" + - " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\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 ; + String requestname = "" ; + String workflowname = "" ; + String currentNodeId = "" ; + String currentNodeName = "" ; + String currentNodeType = "" ; - bb.writeLog("monitorIntervention--countSql:"+countSql); - rs.executeQuery(countSql); - while (rs.next()){ - count++; - } - bb.writeLog("monitorIntervention--count:"+count); - if(count >0){ - String requestname = "" ; - String workflowname = "" ; - String currentNodeId = "" ; - String currentNodeName = "" ; - - String sql =" select t1.requestname,t1.currentnodeid as nodeid,d1.nodename,t3.workflowname\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 "+ - " where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" + - " and t1.requestid = "+requestid ; + String sql =" select t1.requestname,t1.currentnodeid,d1.nodename,t3.workflowname,t1.currentnodetype \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 "+ + " where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" + + " and t1.requestid = "+requestid ; - bb.writeLog("monitorIntervention--sql2:"+sql); + bb.writeLog("monitorIntervention--sql2:"+sql); - rs.executeQuery(sql); - if (rs.next()){ - requestname = Util.null2String(rs.getString("requestname")) ; - workflowname = Util.null2String(rs.getString("workflowname")) ; - currentNodeId = Util.null2String(rs.getString("nodeid")) ; - currentNodeName = Util.null2String(rs.getString("nodeName")) ; - } + rs.executeQuery(sql); + if (rs.next()){ + requestname = Util.null2String(rs.getString("requestname")) ; + workflowname = Util.null2String(rs.getString("workflowname")) ; + currentNodeId = Util.null2String(rs.getString("currentnodeid")) ; + currentNodeName = Util.null2String(rs.getString("nodeName")) ; + currentNodeType = Util.null2String(rs.getString("currentNodeType")) ; + } + if("3".equals(currentNodeType)){ + String actionType = "3" ; requestObject.put("center",center); requestObject.put("title",requestname); requestObject.put("taskCode","weaver"+requestid); @@ -891,42 +920,12 @@ public class SendPortalMonitorUtil { requestObject.put("nodeName",currentNodeName); requestObject.put("ticketType",workflowname); - JSONArray taskObjectList = new JSONArray(); - sql = " select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+ - " from workflow_requestbase t1\n" + - " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" + - " left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+ - " left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n" + - " left join workflow_nodebase d1 on d1.id = t2.nodeid "+ - " 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 ; - rs.executeQuery(sql); - while (rs.next()) { - String creator = rs.getString("loginid"); - bb.writeLog("monitorIntervention:"+requestid+" creator:"+creator); - if ("sysadmin".equals(creator)) { - creator = "Admin"; - } - JSONObject taskObject = new JSONObject(); - taskObject.put("objectAction", "0"); - taskObject.put("objectType", "0"); - taskObject.put("objectCode", creator); - taskObject.put("objectId", rs.getString("staffid")); - taskObject.put("operatorCode", creator); - taskObjectList.add(taskObject); - } - requestObject.put("taskObjectList",taskObjectList); - String auth = username + ":" + passwd; bb.writeLog("monitorIntervention---requestObject:"+requestObject.toJSONString()); String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth); if (!"".equals(msgdata)) { JSONObject msgObject = JSONObject.parseObject(msgdata); - //{"resultCode":"1","resultMsg":"No Result"} if (msgObject.containsKey("resultCode")) { String resultCode = msgObject.getString("resultCode"); if ("0".equals(resultCode)) { @@ -937,9 +936,96 @@ public class SendPortalMonitorUtil { } } } + }else{ + String actionType = "2" ; + + int count = 0 ; + String countSql = " select t2.userid \n" + + " from workflow_requestbase t1\n" + + " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\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("monitorIntervention--countSql:"+countSql); + rs.executeQuery(countSql); + while (rs.next()){ + count++; + } + bb.writeLog("monitorIntervention--count:"+count); + if(count >0){ + + requestObject.put("center",center); + requestObject.put("title",requestname); + requestObject.put("taskCode","weaver"+requestid); + requestObject.put("nodeId",currentNodeId); + requestObject.put("taskType",taskType); + requestObject.put("actionType",actionType); + requestObject.put("createDate",processTime); + requestObject.put("messageTitle",getShortMessageTitle(requestname)); + requestObject.put("messageContent",requestname); + requestObject.put("terminal",terminal); + requestObject.put("urlPc",urlPc); + requestObject.put("urlApp",urlApp); + requestObject.put("urlDing",urlDing); + requestObject.put("nodeName",currentNodeName); + requestObject.put("ticketType",workflowname); + + JSONArray taskObjectList = new JSONArray(); + sql = " select t2.userid,h1.loginid,h1.lastname,h1.email,t2.isremark,t1.requestid,t2.nodeid,d1.nodename,c1."+cus_staff+" as staffid "+ + " from workflow_requestbase t1\n" + + " inner join workflow_currentoperator t2 on t1.requestid = t2.requestid\n" + + " left join cus_fielddata c1 on c1.id = t2.userid and c1.scopeid= "+scopeid+" and c1.scope = '"+scope+"' "+ + " left join (select id, lastname,loginid,email from hrmresource where STATUS = 1 union all select id,lastname,loginid,'' as email from hrmresourcemanager ) h1 on h1.id = t2.userid\n" + + " left join workflow_nodebase d1 on d1.id = t2.nodeid "+ + " 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 ; + + rs.executeQuery(sql); + while (rs.next()) { + String creator = rs.getString("loginid"); + String staffid = rs.getString("staffid") ; + bb.writeLog("monitorIntervention:"+requestid+" creator:"+creator); + if ("sysadmin".equals(creator)) { + creator = "Admin"; + } + JSONObject taskObject = new JSONObject(); + taskObject.put("objectAction", "0"); + taskObject.put("objectType", "0"); + taskObject.put("objectCode", creator); + taskObject.put("objectId", staffid); + taskObject.put("operatorCode", creator); + taskObjectList.add(taskObject); + } + requestObject.put("taskObjectList",taskObjectList); + + String auth = username + ":" + passwd; + bb.writeLog("monitorIntervention---requestObject:"+requestObject.toJSONString()); + String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth); + + if (!"".equals(msgdata)) { + JSONObject msgObject = JSONObject.parseObject(msgdata); + //{"resultCode":"1","resultMsg":"No Result"} + if (msgObject.containsKey("resultCode")) { + String resultCode = msgObject.getString("resultCode"); + if ("0".equals(resultCode)) { + sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid,currentNodeId,currentNodeName,currentUserId,requestObject.toJSONString(),resultCode,"",zhjkbs); + }else{ + String resultmsg = msgObject.getString("resultMsg"); + sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid,currentNodeId,currentNodeName,currentUserId,requestObject.toJSONString(),resultCode,resultmsg,zhjkbs); + } + } + } + } } } catch (Exception e) { e.printStackTrace(); + bb.writeLog("monitorIntervention-e:"+e); } }