源码修改和代码修改1018
parent
04d8078f75
commit
cadd64ab0f
@ -0,0 +1,199 @@
|
|||||||
|
package com.customization.dito.sendtodo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.constant.Constants;
|
||||||
|
import com.time.util.DateUtil;
|
||||||
|
import org.apache.commons.lang.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.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title
|
||||||
|
* @Author wangchaofa
|
||||||
|
* @CreateDate 2023/9/26
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
public class SendPortalAtAddTodoCmd {
|
||||||
|
|
||||||
|
private Map<String,Object> params;
|
||||||
|
public static String EMAIL_REGEX_DEFAULT = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
|
||||||
|
|
||||||
|
public SendPortalAtAddTodoCmd(){
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendPortalAtAddTodoCmd(Map<String,Object> params){
|
||||||
|
this.params=params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShortMessageTitle(String messageTitle) {
|
||||||
|
if (messageTitle.length() > 20) {
|
||||||
|
messageTitle = messageTitle.substring(0, 17) + "...";
|
||||||
|
}
|
||||||
|
return messageTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param username
|
||||||
|
* @param passwd
|
||||||
|
* @param portal_todourl
|
||||||
|
* @param bpm_workflowurl
|
||||||
|
* @param bpm_app_workflowurl
|
||||||
|
* @param bpm_app_requesturl
|
||||||
|
*/
|
||||||
|
public void sendTodoDataByNode(String requestid, List<Map<String,Object>> todolist, String username, String passwd, String center, String portal_todourl, String bpm_workflowurl, String bpm_app_workflowurl, String bpm_app_requesturl){
|
||||||
|
HttpRequestUtil httpRequestUtil = new HttpRequestUtil();
|
||||||
|
|
||||||
|
String mobileJumpUrl = PropBean.getUfPropValue("mobileJumpUrl");
|
||||||
|
|
||||||
|
JSONObject requestObject = new JSONObject();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
bb.writeLog("SendPortalQithRawRunnable--sendTodoDataByNode");
|
||||||
|
|
||||||
|
String terminal = "1" ;
|
||||||
|
String taskType = "0";
|
||||||
|
String actionType = "0" ;
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalAtAddTodoCmd sleep start");
|
||||||
|
Thread.sleep(2000);
|
||||||
|
bb.writeLog("sleep end ");
|
||||||
|
|
||||||
|
String sql = "";
|
||||||
|
|
||||||
|
String processTime = DateUtil.getCurrentTime("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
String urlPc = "[newtab]"+bpm_workflowurl+"/workflow/request/ViewRequestForwardSPA.jsp?requestid="+requestid ;
|
||||||
|
String replace = bpm_app_workflowurl.replace("/bpm", "");
|
||||||
|
String urlDing = replace+bpm_app_requesturl+requestid;
|
||||||
|
String urlApp = replace+bpm_app_requesturl+requestid;
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(mobileJumpUrl)){
|
||||||
|
urlDing += "&returnUrl="+ URLEncoder.encode(mobileJumpUrl,"UTF-8");
|
||||||
|
urlApp += "&returnUrl="+URLEncoder.encode(mobileJumpUrl,"UTF-8");
|
||||||
|
}
|
||||||
|
bb.writeLog("urlDing", urlDing);
|
||||||
|
|
||||||
|
|
||||||
|
String requestname = "" ;
|
||||||
|
String workflowname = "" ;
|
||||||
|
String nodeId = "" ;
|
||||||
|
String nodeName = "" ;
|
||||||
|
String lastName = "";
|
||||||
|
sql =" select t1.requestname,t1.currentnodeid as nodeid,d1.nodename,t3.workflowname,h2.lastname,h2.loginid"+
|
||||||
|
" 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 ) h2 on h2.id = t1.creater \n" +
|
||||||
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
||||||
|
" and t1.requestid = "+requestid ;
|
||||||
|
|
||||||
|
bb.writeLog("sendTodoDataByNode--sql2:"+sql);
|
||||||
|
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()){
|
||||||
|
requestname = Util.null2String(rs.getString("requestname")) ;
|
||||||
|
workflowname = Util.null2String(rs.getString("workflowname")) ;
|
||||||
|
nodeId = Util.null2String(rs.getString("nodeid")) ;
|
||||||
|
nodeName = Util.null2String(rs.getString("nodeName")) ;
|
||||||
|
lastName = Util.null2String(rs.getString("loginid")) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
requestObject.put("center",center);
|
||||||
|
requestObject.put("title",requestname);
|
||||||
|
requestObject.put("creator",lastName);
|
||||||
|
// requestObject.put("taskCode","weaver"+requestid);
|
||||||
|
|
||||||
|
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",nodeName);
|
||||||
|
requestObject.put("ticketType",workflowname);
|
||||||
|
|
||||||
|
|
||||||
|
JSONArray taskObjectList = new JSONArray();
|
||||||
|
for (Map<String,Object> todoMap: todolist){
|
||||||
|
JSONObject taskObject = new JSONObject();
|
||||||
|
JSONArray list = new JSONArray();
|
||||||
|
JSONObject requestObject2 = new JSONObject();
|
||||||
|
requestObject2.putAll(requestObject);
|
||||||
|
|
||||||
|
SendPortalErrorUtil sendPortalErrorUtil = new SendPortalErrorUtil();
|
||||||
|
requestObject2.put("nodeName",todoMap.get("nodename"));
|
||||||
|
requestObject2.put("nodeId",todoMap.get("nodeid"));
|
||||||
|
requestObject2.put("taskCode",requestid+"_at_"+todoMap.get("id"));
|
||||||
|
|
||||||
|
|
||||||
|
String creator = (String) todoMap.get("loginid");
|
||||||
|
if("sysadmin".equals(creator)){
|
||||||
|
creator = "Admin";
|
||||||
|
}
|
||||||
|
taskObject.put("objectAction","0");
|
||||||
|
taskObject.put("objectType","0");
|
||||||
|
taskObject.put("objectCode",creator);
|
||||||
|
taskObject.put("objectId",todoMap.get("id"));
|
||||||
|
taskObject.put("operatorCode",creator);
|
||||||
|
list.add(taskObject);
|
||||||
|
|
||||||
|
requestObject2.put("messageTitle",getShortMessageTitle(requestname));
|
||||||
|
requestObject2.put("messageContent", requestname);
|
||||||
|
requestObject2.put("terminal", "1");
|
||||||
|
requestObject2.put("taskType", "1");
|
||||||
|
requestObject2.put("actionType", "0");
|
||||||
|
|
||||||
|
requestObject2.put("taskObjectList",list);
|
||||||
|
|
||||||
|
String auth = username + ":" + passwd;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalToReadUtil--requestObject:" + requestObject2.toJSONString());
|
||||||
|
String msgdata = httpRequestUtil.doPostByAuth(Constants.portal_todourl, requestObject2.toJSONString(), auth);
|
||||||
|
bb.writeLog("SendPortalToReadUtil-msgdata:" + msgdata);
|
||||||
|
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.doRecordPortalErrorInfo(requestid,nodeId,rs.getString("nodename"),rs.getString("userid"),requestObject2.toJSONString(),resultCode,"");
|
||||||
|
}else if ("TODO-FAIL-002".equals(resultCode)){
|
||||||
|
//The task does not exist.任务不存在,则新增
|
||||||
|
User user = new User();
|
||||||
|
user.setUid(Integer.valueOf(todoMap.get("id").toString()));
|
||||||
|
SendPortalToReadUtil sendPortalToReadUtil = new SendPortalToReadUtil();
|
||||||
|
sendPortalToReadUtil.sendToReadDataByCreateNode(requestid,user,portal_todourl,bpm_app_workflowurl,username,passwd,bpm_workflowurl,center,bpm_app_requesturl);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
String resultmsg = msgObject.getString("resultMsg");
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,rs.getString("nodename"),rs.getString("userid"),requestObject2.toJSONString(),resultCode,resultmsg);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,600 @@
|
|||||||
|
package com.customization.dito.sendtodo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.constant.Constants;
|
||||||
|
import com.time.util.DateUtil;
|
||||||
|
import org.apache.commons.lang.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;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title
|
||||||
|
* @Author wangchaofa
|
||||||
|
* @CreateDate 2023/10/9
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
public class SendPortalForwardCmd {
|
||||||
|
|
||||||
|
private Map<String,Object> params;
|
||||||
|
public static String EMAIL_REGEX_DEFAULT = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
|
||||||
|
Pattern regex = Pattern.compile(EMAIL_REGEX_DEFAULT);
|
||||||
|
|
||||||
|
public BaseBean bb = new BaseBean();
|
||||||
|
|
||||||
|
HttpRequestUtil httpRequestUtil = new HttpRequestUtil();
|
||||||
|
SendPortalErrorUtil sendPortalErrorUtil = new SendPortalErrorUtil();
|
||||||
|
SendMailUtil sendMailUtil = new SendMailUtil();
|
||||||
|
|
||||||
|
String scopeid = "-1";
|
||||||
|
String scope = "HrmCustomFieldByInfoType" ;
|
||||||
|
|
||||||
|
public SendPortalForwardCmd(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendPortalForwardCmd(Map<String,Object> params){
|
||||||
|
this.params=params;
|
||||||
|
}
|
||||||
|
|
||||||
|
//转发
|
||||||
|
public void forwardSendPortal(String requestid,int currentnodeid,User user) {
|
||||||
|
bb.writeLog("======== SendPortalForwardCmd forwardSendPortal =========================");
|
||||||
|
String bpm_app_workflowurl = PropBean.getUfPropValue("bpm_app_workflowurl");
|
||||||
|
String bpm_app_requesturl = PropBean.getUfPropValue("bpm_app_requesturl");
|
||||||
|
String portal_todourl = PropBean.getUfPropValue("portal_todourl");
|
||||||
|
String username = PropBean.getUfPropValue("username");
|
||||||
|
String passwd = PropBean.getUfPropValue("passwd");
|
||||||
|
String center = PropBean.getUfPropValue("center");
|
||||||
|
String bpm_workflowurl = PropBean.getUfPropValue("bpm_workflowurl");
|
||||||
|
String mobileJumpUrl = PropBean.getUfPropValue("mobileJumpUrl");
|
||||||
|
String portal_doneurl = PropBean.getUfPropValue("portal_doneurl");
|
||||||
|
String cus_staff = PropBean.getUfPropValue("cus_staff") ;
|
||||||
|
String processTime = DateUtil.getCurrentTime("yyyy-MM-dd HH:mm:ss");
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
try {
|
||||||
|
String zhjkbs = "com.customization.dito.sendtodo.SendPortalForwardCmd.forwardSendPortal";
|
||||||
|
String actionType = "0";
|
||||||
|
String terminal = "1";
|
||||||
|
String taskType = "0";
|
||||||
|
String objectAction = "0";
|
||||||
|
String objectType = "0";
|
||||||
|
|
||||||
|
String sql = "";
|
||||||
|
String workflowname = "";
|
||||||
|
String nodeId = "";
|
||||||
|
String nodeName = "";
|
||||||
|
JSONObject requestObject = new JSONObject();
|
||||||
|
String urlPc = "[newtab]" + bpm_workflowurl + "/workflow/request/ViewRequestForwardSPA.jsp?requestid=" + requestid;
|
||||||
|
String replace = bpm_app_workflowurl.replace("/bpm", "");
|
||||||
|
String urlDing = replace + bpm_app_requesturl + requestid;
|
||||||
|
String urlApp = replace + bpm_app_requesturl + requestid;
|
||||||
|
|
||||||
|
String msgdata = "";
|
||||||
|
String requestname = "";
|
||||||
|
String lastname = "";
|
||||||
|
String userids = "";
|
||||||
|
String loginid = "";
|
||||||
|
String emailArray = "";
|
||||||
|
|
||||||
|
sql = " select t1.requestname,t1.currentnodeid as nodeid,d1.nodename,t3.workflowname,h2.lastname,h2.loginid " +
|
||||||
|
" 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 ) h2 on h2.id = t1.creater \n" +
|
||||||
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
||||||
|
" and t1.requestid = " + requestid;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd --sql2:" + sql);
|
||||||
|
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
requestname = Util.null2String(rs.getString("requestname"));
|
||||||
|
workflowname = Util.null2String(rs.getString("workflowname"));
|
||||||
|
nodeId = Util.null2String(rs.getString("nodeid") + user.getUID());
|
||||||
|
nodeName = Util.null2String(rs.getString("nodeName"));
|
||||||
|
lastname = Util.null2String(rs.getString("lastname"));
|
||||||
|
loginid = Util.null2String(rs.getString("loginid"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(mobileJumpUrl)) {
|
||||||
|
urlDing += "&returnUrl=" + URLEncoder.encode(mobileJumpUrl, "UTF-8");
|
||||||
|
urlApp += "&returnUrl=" + URLEncoder.encode(mobileJumpUrl, "UTF-8");
|
||||||
|
}
|
||||||
|
JSONArray taskObjectList = new JSONArray();
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd urlDing", urlDing);
|
||||||
|
|
||||||
|
requestObject.put("center", center);
|
||||||
|
requestObject.put("title", requestname);
|
||||||
|
requestObject.put("creator", loginid);
|
||||||
|
requestObject.put("taskCode", "weaver_zf_" + 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", getNodeName(currentnodeid));
|
||||||
|
requestObject.put("ticketType", workflowname);
|
||||||
|
|
||||||
|
sql = " select t2.userid,h1.loginid,h1.email,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" +
|
||||||
|
" 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', '7','11'))\n" +
|
||||||
|
" and t2.islasttimes = 1\n" +
|
||||||
|
" and (t2.isprocessing = '' or t2.isprocessing is null)\n" +
|
||||||
|
" and t2.requestid = " + requestid;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd forward --sql:" + sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()) {
|
||||||
|
JSONObject taskObject = new JSONObject();
|
||||||
|
|
||||||
|
String usercode = Util.null2String(rs.getString("loginid"));
|
||||||
|
String staffid = Util.null2String(rs.getString("staffid"));
|
||||||
|
String userid1 = Util.null2String(rs.getString("userid"));
|
||||||
|
userids += StringUtils.isEmpty(userids) ? userid1 : "," + userid1;
|
||||||
|
|
||||||
|
if ("sysadmin".equals(usercode)) {
|
||||||
|
usercode = "Admin";
|
||||||
|
}
|
||||||
|
|
||||||
|
String objectCode = usercode;
|
||||||
|
String operatorCode = usercode;
|
||||||
|
|
||||||
|
taskObject.put("objectAction", objectAction);
|
||||||
|
taskObject.put("objectType", objectType);
|
||||||
|
taskObject.put("objectCode", objectCode);
|
||||||
|
taskObject.put("objectId", staffid);
|
||||||
|
taskObject.put("operatorCode", operatorCode);
|
||||||
|
taskObjectList.add(taskObject);
|
||||||
|
|
||||||
|
String email = Util.null2String(rs.getString("email"));
|
||||||
|
bb.writeLog("SendPortalForwardCmd email3:" + email);
|
||||||
|
Matcher matcher = regex.matcher(email);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
emailArray += StringUtils.isEmpty(emailArray) ? email : "," + email;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taskObjectList.size() > 0) {
|
||||||
|
requestObject.put("taskObjectList", taskObjectList);
|
||||||
|
} else {
|
||||||
|
requestObject.put("actionType", "3");
|
||||||
|
}
|
||||||
|
bb.writeLog("SendPortalForwardCmd requestObject:" + requestObject.toJSONString());
|
||||||
|
String auth = username + ":" + passwd;
|
||||||
|
msgdata = httpRequestUtil.doPostByAuth(portal_todourl, requestObject.toJSONString(), auth);
|
||||||
|
if (!"".equals(msgdata)) {
|
||||||
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
||||||
|
if (msgObject.containsKey("resultCode")) {
|
||||||
|
String resultCode = msgObject.getString("resultCode");
|
||||||
|
if ("0".equals(resultCode)) {
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd emailArray:" + emailArray);
|
||||||
|
if (StringUtils.isNotEmpty(emailArray)) {
|
||||||
|
|
||||||
|
Map<String, String> templateMap = getEmailTemplate(requestname, lastname, processTime);
|
||||||
|
String notificationSubject = templateMap.get("notificationSubject");
|
||||||
|
String notificationContent = templateMap.get("notificationContent");
|
||||||
|
|
||||||
|
sendMailUtil.sendMail(requestid, emailArray, notificationSubject, notificationContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, nodeId, nodeName, userids, requestObject.toJSONString(), resultCode, "", zhjkbs);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
String resultmsg = msgObject.getString("resultMsg");
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, nodeId, nodeName, userids, requestObject.toJSONString(), resultCode, resultmsg, zhjkbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog(e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//转办
|
||||||
|
public void transferSendPortal(String requestid,int currentnodeid,User user){
|
||||||
|
bb.writeLog("======== SendPortalForwardCmd transferSendPortal =========================");
|
||||||
|
String bpm_app_workflowurl = PropBean.getUfPropValue("bpm_app_workflowurl");
|
||||||
|
String bpm_app_requesturl = PropBean.getUfPropValue("bpm_app_requesturl");
|
||||||
|
String portal_todourl = PropBean.getUfPropValue("portal_todourl");
|
||||||
|
String username = PropBean.getUfPropValue("username");
|
||||||
|
String passwd = PropBean.getUfPropValue("passwd");
|
||||||
|
String center = PropBean.getUfPropValue("center");
|
||||||
|
String bpm_workflowurl = PropBean.getUfPropValue("bpm_workflowurl");
|
||||||
|
String mobileJumpUrl = PropBean.getUfPropValue("mobileJumpUrl");
|
||||||
|
String portal_doneurl = PropBean.getUfPropValue("portal_doneurl");
|
||||||
|
String cus_staff = PropBean.getUfPropValue("cus_staff") ;
|
||||||
|
String processTime = DateUtil.getCurrentTime("yyyy-MM-dd HH:mm:ss");
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
try {
|
||||||
|
String zhjkbs = "com.customization.dito.sendtodo.SendPortalForwardCmd.transferSendPortal";
|
||||||
|
String actionType = "2";
|
||||||
|
String terminal = "1";
|
||||||
|
String taskType = "0";
|
||||||
|
String objectAction = "0";
|
||||||
|
String objectType = "0";
|
||||||
|
|
||||||
|
String sql = "";
|
||||||
|
String workflowname = "";
|
||||||
|
String nodeId = "";
|
||||||
|
String nodeName = "";
|
||||||
|
JSONObject requestObject = new JSONObject();
|
||||||
|
|
||||||
|
String urlPc = "[newtab]"+ Constants.bpm_workflowurl+"/workflow/request/ViewRequestForwardSPA.jsp?requestid="+requestid ;
|
||||||
|
String replace = bpm_app_workflowurl.replace("/bpm", "");
|
||||||
|
String urlDing = replace+bpm_app_requesturl+requestid ;
|
||||||
|
String urlApp = replace+bpm_app_requesturl+requestid ;
|
||||||
|
|
||||||
|
if(StringUtils.isNotEmpty(mobileJumpUrl)){
|
||||||
|
urlDing += "&returnUrl="+URLEncoder.encode(mobileJumpUrl,"UTF-8");
|
||||||
|
urlApp += "&returnUrl="+URLEncoder.encode(mobileJumpUrl,"UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String msgdata = "";
|
||||||
|
String requestname = "";
|
||||||
|
String lastname = "";
|
||||||
|
String userids = "";
|
||||||
|
String loginid = "";
|
||||||
|
String emailArray = "";
|
||||||
|
|
||||||
|
sql = " select t1.requestname,t1.currentnodeid as nodeid,d1.nodename,t3.workflowname,h2.lastname,h2.loginid " +
|
||||||
|
" 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 ) h2 on h2.id = t1.creater \n" +
|
||||||
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
||||||
|
" and t1.requestid = " + requestid;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd --sql2:" + sql);
|
||||||
|
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
requestname = Util.null2String(rs.getString("requestname"));
|
||||||
|
workflowname = Util.null2String(rs.getString("workflowname"));
|
||||||
|
nodeId = Util.null2String(rs.getString("nodeid") + user.getUID());
|
||||||
|
nodeName = Util.null2String(rs.getString("nodeName"));
|
||||||
|
lastname = Util.null2String(rs.getString("lastname"));
|
||||||
|
loginid = Util.null2String(rs.getString("loginid"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(mobileJumpUrl)) {
|
||||||
|
urlDing += "&returnUrl=" + URLEncoder.encode(mobileJumpUrl, "UTF-8");
|
||||||
|
urlApp += "&returnUrl=" + URLEncoder.encode(mobileJumpUrl, "UTF-8");
|
||||||
|
}
|
||||||
|
JSONArray taskObjectList = new JSONArray();
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd urlDing", urlDing);
|
||||||
|
|
||||||
|
requestObject.put("center", center);
|
||||||
|
requestObject.put("title", requestname);
|
||||||
|
requestObject.put("creator", loginid);
|
||||||
|
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", getNodeName(currentnodeid));
|
||||||
|
requestObject.put("ticketType", workflowname);
|
||||||
|
|
||||||
|
sql = " select t2.userid,h1.loginid,h1.email,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" +
|
||||||
|
" 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', '7','11'))\n" +
|
||||||
|
" and t2.islasttimes = 1\n" +
|
||||||
|
" and (t2.isprocessing = '' or t2.isprocessing is null)\n" +
|
||||||
|
" and t2.requestid = " + requestid;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd forward --sql:" + sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
while (rs.next()) {
|
||||||
|
JSONObject taskObject = new JSONObject();
|
||||||
|
|
||||||
|
String usercode = Util.null2String(rs.getString("loginid"));
|
||||||
|
String staffid = Util.null2String(rs.getString("staffid"));
|
||||||
|
String userid1 = Util.null2String(rs.getString("userid"));
|
||||||
|
userids += StringUtils.isEmpty(userids) ? userid1 : "," + userid1;
|
||||||
|
|
||||||
|
if ("sysadmin".equals(usercode)) {
|
||||||
|
usercode = "Admin";
|
||||||
|
}
|
||||||
|
|
||||||
|
String objectCode = usercode;
|
||||||
|
String operatorCode = usercode;
|
||||||
|
|
||||||
|
taskObject.put("objectAction", objectAction);
|
||||||
|
taskObject.put("objectType", objectType);
|
||||||
|
taskObject.put("objectCode", objectCode);
|
||||||
|
taskObject.put("objectId", staffid);
|
||||||
|
taskObject.put("operatorCode", operatorCode);
|
||||||
|
taskObjectList.add(taskObject);
|
||||||
|
|
||||||
|
String email = Util.null2String(rs.getString("email"));
|
||||||
|
bb.writeLog("SendPortalForwardCmd email3:" + email);
|
||||||
|
Matcher matcher = regex.matcher(email);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
emailArray += StringUtils.isEmpty(emailArray) ? email : "," + email;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (taskObjectList.size() > 0) {
|
||||||
|
requestObject.put("taskObjectList", taskObjectList);
|
||||||
|
} else {
|
||||||
|
requestObject.put("actionType", "3");
|
||||||
|
}
|
||||||
|
bb.writeLog("================ SendPortalForwardCmd requestObject ============= "+ requestObject.toJSONString());
|
||||||
|
String auth = username + ":" + passwd;
|
||||||
|
msgdata = httpRequestUtil.doPostByAuth(portal_todourl, requestObject.toJSONString(), auth);
|
||||||
|
if (!"".equals(msgdata)) {
|
||||||
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
||||||
|
if (msgObject.containsKey("resultCode")) {
|
||||||
|
String resultCode = msgObject.getString("resultCode");
|
||||||
|
if ("0".equals(resultCode)) {
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalForwardCmd emailArray:" + emailArray);
|
||||||
|
if (StringUtils.isNotEmpty(emailArray)) {
|
||||||
|
|
||||||
|
Map<String, String> templateMap = getEmailTemplate(requestname, lastname, processTime);
|
||||||
|
String notificationSubject = templateMap.get("notificationSubject");
|
||||||
|
String notificationContent = templateMap.get("notificationContent");
|
||||||
|
|
||||||
|
sendMailUtil.sendMail(requestid, emailArray, notificationSubject, notificationContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, nodeId, nodeName, userids, requestObject.toJSONString(), resultCode, "",zhjkbs);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
String resultmsg = msgObject.getString("resultMsg");
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, nodeId, nodeName, userids, requestObject.toJSONString(), resultCode, resultmsg ,zhjkbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog(e);
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//流程归档转发处理
|
||||||
|
public void delTodoAddDoneSendPortal(String requestid,int currentnodeid,User user){
|
||||||
|
bb.writeLog("======== SendPortalForwardCmd delTodoAddDoneSendPortal =========================");
|
||||||
|
String bpm_app_workflowurl = PropBean.getUfPropValue("bpm_app_workflowurl");
|
||||||
|
String bpm_app_requesturl = PropBean.getUfPropValue("bpm_app_requesturl");
|
||||||
|
String portal_todourl = PropBean.getUfPropValue("portal_todourl");
|
||||||
|
String username = PropBean.getUfPropValue("username");
|
||||||
|
String passwd = PropBean.getUfPropValue("passwd");
|
||||||
|
String center = PropBean.getUfPropValue("center");
|
||||||
|
String bpm_workflowurl = PropBean.getUfPropValue("bpm_workflowurl");
|
||||||
|
String mobileJumpUrl = PropBean.getUfPropValue("mobileJumpUrl");
|
||||||
|
String portal_doneurl = PropBean.getUfPropValue("portal_doneurl");
|
||||||
|
String cus_staff = PropBean.getUfPropValue("cus_staff") ;
|
||||||
|
String processTime = DateUtil.getCurrentTime("yyyy-MM-dd HH:mm:ss");
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
try {
|
||||||
|
String zhjkbs = "com.customization.dito.sendtodo.SendPortalForwardCmd.delTodoAddDoneSendPortal";
|
||||||
|
String sql = "";
|
||||||
|
String workflowname = "";
|
||||||
|
String nodeId = "";
|
||||||
|
String nodeName = "";
|
||||||
|
JSONObject requestObject = new JSONObject();
|
||||||
|
String urlPc = "[newtab]" + bpm_workflowurl + "/workflow/request/ViewRequestForwardSPA.jsp?requestid=" + requestid;
|
||||||
|
String replace = bpm_app_workflowurl.replace("/bpm", "");
|
||||||
|
String urlDing = replace + bpm_app_requesturl + requestid;
|
||||||
|
String urlApp = replace + bpm_app_requesturl + requestid;
|
||||||
|
|
||||||
|
String msgdata = "";
|
||||||
|
String requestname = "";
|
||||||
|
String lastname = "";
|
||||||
|
String loginid = "";
|
||||||
|
|
||||||
|
sql = " select t1.requestname,t1.currentnodeid as nodeid,d1.nodename,t3.workflowname,h2.lastname,h2.loginid " +
|
||||||
|
" 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 ) h2 on h2.id = t1.creater \n" +
|
||||||
|
" where (t1.deleted <> 1 or t1.deleted is null or t1.deleted = '')\n" +
|
||||||
|
" and t1.requestid = " + requestid;
|
||||||
|
|
||||||
|
bb.writeLog("SendPortalWithAddTodoCmd delTodoAddDoneSendPortal --sql:" + sql);
|
||||||
|
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
requestname = Util.null2String(rs.getString("requestname"));
|
||||||
|
workflowname = Util.null2String(rs.getString("workflowname"));
|
||||||
|
nodeId = Util.null2String(rs.getString("nodeid") + user.getUID());
|
||||||
|
nodeName = Util.null2String(rs.getString("nodeName"));
|
||||||
|
loginid = Util.null2String(rs.getString("loginid"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否为转发节点
|
||||||
|
sql = "SELECT c1." + PropBean.getUfPropValue("cus_staff") + " as staffid FROM workflow_currentoperator t1 left join cus_fielddata c1 on c1.id = t1.userid and c1.scopeid= " + scopeid + " and c1.scope = '" + scope + "' WHERE t1.preisremark=1 and t1.REQUESTID=? and t1.USERID=?";
|
||||||
|
rs.executeQuery(sql, requestid, user.getUID());
|
||||||
|
if (rs.next()) {
|
||||||
|
//删除转发的待办
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
||||||
|
jsonObject.put("center", center);
|
||||||
|
jsonObject.put("title", requestname);
|
||||||
|
jsonObject.put("creator", loginid);
|
||||||
|
jsonObject.put("taskCode", "weaver_zf_" + requestid);
|
||||||
|
|
||||||
|
jsonObject.put("taskType", "0");
|
||||||
|
jsonObject.put("actionType", "1");
|
||||||
|
jsonObject.put("createDate", processTime);
|
||||||
|
jsonObject.put("messageTitle", getShortMessageTitle(requestname));
|
||||||
|
jsonObject.put("messageContent", requestname);
|
||||||
|
jsonObject.put("terminal", "1");
|
||||||
|
jsonObject.put("urlPc", urlPc);
|
||||||
|
jsonObject.put("urlApp", urlApp);
|
||||||
|
jsonObject.put("urlDing", urlDing);
|
||||||
|
jsonObject.put("nodeName", nodeName);
|
||||||
|
jsonObject.put("ticketType", workflowname);
|
||||||
|
|
||||||
|
JSONArray list = new JSONArray();
|
||||||
|
JSONObject taskObject = new JSONObject();
|
||||||
|
list.add(taskObject);
|
||||||
|
taskObject.put("objectAction", "1");
|
||||||
|
taskObject.put("objectType", "0");
|
||||||
|
taskObject.put("objectCode", user.getLoginid());
|
||||||
|
taskObject.put("objectId", rs.getString("staffid"));
|
||||||
|
taskObject.put("operatorCode", user.getLoginid());
|
||||||
|
jsonObject.put("taskObjectList", list);
|
||||||
|
bb.writeLog("SendPortalWithAddDoneCmd--delTodoAddDoneSendPortal--requestObject:" + jsonObject.toJSONString());
|
||||||
|
String auth = username + ":" + passwd;
|
||||||
|
msgdata = httpRequestUtil.doPostByAuth(Constants.portal_todourl, jsonObject.toJSONString(), auth);
|
||||||
|
bb.writeLog("SendPortalWithAddDoneCmd-delTodoAddDoneSendPortal-msgdata:" + msgdata);
|
||||||
|
if (StringUtils.isNotEmpty(msgdata)) {
|
||||||
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
||||||
|
if (msgObject.containsKey("resultCode")) {
|
||||||
|
String resultCode = msgObject.getString("resultCode");
|
||||||
|
if (!"0".equals(resultCode)) {
|
||||||
|
String resultmsg = msgObject.getString("resultMsg");
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, user.getUID() + "", nodeName, user.getUID() + "", jsonObject.toJSONString(), resultCode, resultmsg, zhjkbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 增加已办
|
||||||
|
requestObject.put("center", center);
|
||||||
|
requestObject.put("taskCode", "weaver" + requestid);
|
||||||
|
requestObject.put("nodeId", nodeId);
|
||||||
|
requestObject.put("ticketType", workflowname);
|
||||||
|
requestObject.put("title", requestname);
|
||||||
|
requestObject.put("creator", loginid);
|
||||||
|
requestObject.put("processStaff", loginid);
|
||||||
|
requestObject.put("processTime", processTime);
|
||||||
|
requestObject.put("isRecall", "1");
|
||||||
|
requestObject.put("actionType", "0");
|
||||||
|
requestObject.put("urlPC", urlPc);
|
||||||
|
requestObject.put("urlApp", urlApp);
|
||||||
|
requestObject.put("urlDing", urlDing);
|
||||||
|
|
||||||
|
String auth = username + ":" + passwd;
|
||||||
|
bb.writeLog("delTodoAddDoneSendPortal done requestObject:" + requestObject.toJSONString());
|
||||||
|
msgdata = httpRequestUtil.doPostByAuth(portal_doneurl, requestObject.toJSONString(), auth);
|
||||||
|
bb.writeLog("delTodoAddDoneSendPortal done msgdata:" + msgdata);
|
||||||
|
if (StringUtils.isNotEmpty(msgdata)) {
|
||||||
|
JSONObject msgObject = JSONObject.parseObject(msgdata);
|
||||||
|
//{"resultCode":"1","resultMsg":"No Result"}
|
||||||
|
if (msgObject.containsKey("resultCode")) {
|
||||||
|
String resultCode = msgObject.getString("resultCode");
|
||||||
|
if (!"0".equals(resultCode)) {
|
||||||
|
String resultmsg = msgObject.getString("resultMsg");
|
||||||
|
sendPortalErrorUtil.doRecordPortalErrorInfo4Phase2(requestid, nodeId, nodeName, user.getUID() + "", requestObject.toJSONString(), resultCode, resultmsg, zhjkbs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
rs.writeLog(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShortMessageTitle(String messageTitle) {
|
||||||
|
if (messageTitle.length() > 20) {
|
||||||
|
messageTitle = messageTitle.substring(0, 17) + "...";
|
||||||
|
}
|
||||||
|
return messageTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @param requestname
|
||||||
|
* @param operator
|
||||||
|
* @param operatorTime
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,String> getEmailTemplate(String requestname,String operator,String operatorTime){
|
||||||
|
Map<String,String> dataMap = new HashMap<String,String>();
|
||||||
|
|
||||||
|
String notificationSubject = "You have a new To-Read - <"+requestname+"> ";
|
||||||
|
String notificationContent = operator + " created this task on "+operatorTime+"\n" +
|
||||||
|
" Please handle it in time.";
|
||||||
|
|
||||||
|
dataMap.put("notificationSubject",notificationSubject);
|
||||||
|
dataMap.put("notificationContent",notificationContent);
|
||||||
|
return dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断流程节点是否是 超时处理提交的
|
||||||
|
* @param requestid
|
||||||
|
* @param nodeid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean checkIsOvertime(String requestid,String nodeid){
|
||||||
|
boolean flag = false;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeQuery("select * from workflow_currentoperator where requestid=? and nodeid=?",requestid,nodeid);
|
||||||
|
if(rs.next()){
|
||||||
|
double overtime = Util.getDoubleValue(rs.getString("overtime"),0);
|
||||||
|
if(overtime > 0){
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上一节点id
|
||||||
|
* @param requestid
|
||||||
|
* @param nodeid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getLastnodeid(String requestid,int nodeid){
|
||||||
|
String result = "";
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeQuery("select * from workflow_requestbase where requestid=? and currentnodeid=?",requestid,nodeid);
|
||||||
|
if(rs.next()){
|
||||||
|
result = Util.null2String(rs.getString("lastnodeid"));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获取节点名称
|
||||||
|
* @param nodeid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getNodeName(int nodeid){
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
String name = "";
|
||||||
|
rs.executeQuery(" select nodename from workflow_nodebase where id = ?",nodeid);
|
||||||
|
while (rs.next()){
|
||||||
|
name = Util.null2String(rs.getString("nodename"));
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,155 @@
|
|||||||
|
package com.customization.qc2563600;
|
||||||
|
|
||||||
|
import com.cloudstore.dev.api.bean.MessageType;
|
||||||
|
import com.engine.workflow.biz.requestForm.RequestRemindBiz;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.workflow.msg.MsgPushUtil;
|
||||||
|
import weaver.workflow.msg.entity.MsgEntity;
|
||||||
|
import weaver.workflow.msg.entity.MsgNoticeType;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CCOperatorUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加抄送人
|
||||||
|
*/
|
||||||
|
public static void sendMessage(int requestid, List<String> userIds, String nodeid, MessageType messageType, MsgNoticeType msgNoticeType,User user) {
|
||||||
|
List<MsgEntity> requestMsgEntity = requestFlowMsg(requestid, userIds, nodeid, requestid + "", messageType, msgNoticeType, true);
|
||||||
|
//发送消息提醒
|
||||||
|
new MsgPushUtil().pushMsg(requestMsgEntity);
|
||||||
|
//先判断是否开启了流程邮件提醒功能,如果开启了则发送邮件提醒
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
recordSet.executeQuery("select a.isemailremind,a.id from workflow_base a left join workflow_requestbase b on b.workflowid = a.id where b.requestid = ?",requestid);
|
||||||
|
if(recordSet.next()) {
|
||||||
|
if("1".equals(recordSet.getString("isemailremind"))){
|
||||||
|
int workflowid = recordSet.getInt("id");
|
||||||
|
String src = "submit";
|
||||||
|
RequestRemindBiz requestRemindBiz = new RequestRemindBiz(user,requestid,workflowid,src);
|
||||||
|
requestRemindBiz.doRemind(requestid,user.getUID(),workflowid,src,"0","1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MsgEntity> requestFlowMsg(int requestId, List<String> userIds, String current_node, String targetid, MessageType messageType, MsgNoticeType msgNoticeType,boolean isRejectCC) {
|
||||||
|
|
||||||
|
List<MsgEntity> innerMsg = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
MsgEntity baseEntity = getBaseInfo(Util.null2String(requestId));
|
||||||
|
if (baseEntity == null) return null;
|
||||||
|
//MessageType.WF_COPY WF_ALREADY_TIMEOUT
|
||||||
|
//MessageType.CC OVERED_TIME
|
||||||
|
baseEntity.setMsgType(messageType);
|
||||||
|
baseEntity.setNoticeType(msgNoticeType);
|
||||||
|
//流程流转提醒消息
|
||||||
|
baseEntity.addAllUserId(userIds);
|
||||||
|
baseEntity.setDetailTitleParams("current_node", current_node); //当前节点
|
||||||
|
baseEntity.setDetailId(targetid);
|
||||||
|
innerMsg.add(baseEntity);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return innerMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MsgEntity getBaseInfo(String requestId) {
|
||||||
|
MsgEntity msgEntity = null;
|
||||||
|
//查询流程基本信息
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeQuery("select requestname,requestnamenew,workflowid,creater,createdate,createtime from workflow_requestbase where requestid = ? and (deleted = 0 or deleted is null)", requestId);
|
||||||
|
if (rs.next()) {
|
||||||
|
msgEntity = new MsgEntity();
|
||||||
|
String detailName = Util.null2String(rs.getString("requestname"));
|
||||||
|
String detailTitle = Util.null2String(rs.getString("requestnamenew"));
|
||||||
|
String workflowId = Util.null2String(rs.getString("workflowid"));
|
||||||
|
String creator = Util.null2String(rs.getString("creater"));
|
||||||
|
String createDate = Util.null2String(rs.getString("createdate"));
|
||||||
|
String createTime = Util.null2String(rs.getString("createtime"));
|
||||||
|
|
||||||
|
msgEntity.setDetailId(requestId);
|
||||||
|
msgEntity.setDetailName(detailName);
|
||||||
|
msgEntity.setDetailTitle(detailTitle);
|
||||||
|
msgEntity.setDetailBaseId(workflowId);
|
||||||
|
msgEntity.setCreator(creator);
|
||||||
|
msgEntity.setCreateDate(createDate);
|
||||||
|
msgEntity.setCreateTime(createTime);
|
||||||
|
|
||||||
|
rs.executeQuery("select wfb.workflowname,wft.id,wft.typename from workflow_base wfb,workflow_type wft where wfb.id = ? and wfb.workflowtype = wft.id", workflowId);
|
||||||
|
if (rs.next()) {
|
||||||
|
msgEntity.setDetailBaseName(Util.null2String(rs.getString("workflowname")));
|
||||||
|
msgEntity.setDetailTypeId(Util.null2String(rs.getString("id")));
|
||||||
|
msgEntity.setDetailTypeName(Util.null2String(rs.getString("typename")));
|
||||||
|
}
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
msgEntity.setOperaterDate(sdf.format(new Date()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return msgEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void insert(String requestid, List<String> addUsers, String nodeid, String isremark, User user) {
|
||||||
|
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
Date date = new Date();
|
||||||
|
String receivedate = simpleDateFormat.format(date);
|
||||||
|
String receivetime = simpleDateFormat1.format(date);
|
||||||
|
|
||||||
|
int showOrder = 0;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
RecordSet rs3 = new RecordSet();
|
||||||
|
rs.executeQuery("select requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime," +
|
||||||
|
"viewtype,iscomplete,islasttimes,groupdetailid,needwfback,isremark,preisremark,multiTakLevel " +
|
||||||
|
"from workflow_currentoperator where requestid=? and nodeid=? order by groupid desc", requestid, nodeid);
|
||||||
|
if (rs.next()) {
|
||||||
|
int groupid = Util.getIntValue(rs.getString("groupid"));
|
||||||
|
ArrayList<List> lists = new ArrayList<>();
|
||||||
|
for (String addUser : addUsers) {
|
||||||
|
groupid++;
|
||||||
|
String userIdTemp = addUser;
|
||||||
|
String agentorbyagentid = "-1";
|
||||||
|
String agenttype = "0";
|
||||||
|
showOrder = rs.getInt("showorder") + 1;
|
||||||
|
ArrayList list = new ArrayList();
|
||||||
|
list.add(rs.getString("requestid"));
|
||||||
|
list.add(userIdTemp);
|
||||||
|
list.add(groupid);
|
||||||
|
list.add(rs.getString("workflowid"));
|
||||||
|
list.add(rs.getString("workflowtype"));
|
||||||
|
list.add(0);
|
||||||
|
list.add(rs.getString("nodeid"));
|
||||||
|
list.add(agentorbyagentid);
|
||||||
|
list.add(agenttype);
|
||||||
|
list.add(showOrder);
|
||||||
|
list.add(receivedate);
|
||||||
|
list.add(receivetime);
|
||||||
|
list.add(0);
|
||||||
|
list.add(0);
|
||||||
|
list.add(1);
|
||||||
|
list.add(0);
|
||||||
|
list.add(rs.getString("needwfback"));
|
||||||
|
list.add(isremark);
|
||||||
|
list.add(isremark);
|
||||||
|
// list.add(takid);
|
||||||
|
// list.add(2);
|
||||||
|
// list.add(rs.getString("multiTakLevel"));
|
||||||
|
|
||||||
|
lists.add(list);
|
||||||
|
rs3.executeUpdate("update workflow_currentoperator set islasttimes = 0 where requestid = ? and userid = ?", requestid, userIdTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
RecordSet rs2 = new RecordSet();
|
||||||
|
boolean b = rs2.executeBatchSql("INSERT into workflow_currentoperator(requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime,viewtype,iscomplete,islasttimes,groupdetailid,needwfback,isremark,preisremark) " +
|
||||||
|
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", lists);
|
||||||
|
if (b) {
|
||||||
|
//发送消息给抄送人
|
||||||
|
sendMessage(Util.getIntValue(requestid), addUsers, nodeid, MessageType.WF_COPY, MsgNoticeType.CC,user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.engine.dito.reqremark.service;
|
||||||
|
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title
|
||||||
|
* @Author wangchaofa
|
||||||
|
* @CreateDate 2023/9/28
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
public interface AtRequestRemarkService {
|
||||||
|
|
||||||
|
Map<String,Object> AtRequestRemarkSubmit(Map<String, Object> datas, User user);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.engine.dito.reqremark.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.dito.reqremark.cmd.AtRequestRemarkCmd;
|
||||||
|
import com.engine.dito.reqremark.service.AtRequestRemarkService;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title
|
||||||
|
* @Author wangchaofa
|
||||||
|
* @CreateDate 2023/9/28
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
public class AtRequestRemarkServiceImpl extends Service implements AtRequestRemarkService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> AtRequestRemarkSubmit(Map<String, Object> datas, User user) {
|
||||||
|
return commandExecutor.execute(new AtRequestRemarkCmd(datas,user));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.engine.dito.reqremark.web;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.dito.reqremark.service.AtRequestRemarkService;
|
||||||
|
import com.engine.dito.reqremark.service.impl.AtRequestRemarkServiceImpl;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title
|
||||||
|
* @Author wangchaofa
|
||||||
|
* @CreateDate 2023/9/27
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description
|
||||||
|
*/
|
||||||
|
public class AtRequestRemarkAction {
|
||||||
|
|
||||||
|
public AtRequestRemarkService getService(){
|
||||||
|
return (AtRequestRemarkService) ServiceUtil.getService(AtRequestRemarkServiceImpl.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/atreqsubmit")
|
||||||
|
@Produces({MediaType.TEXT_PLAIN})
|
||||||
|
public String AtRequestRemarkSubmit(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
bb.writeLog("createAuthData");
|
||||||
|
Map<String,Object> apidatas = new HashMap<String,Object>();
|
||||||
|
try{
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String,Object> dataMap = ParamUtil.request2Map(request);
|
||||||
|
apidatas.putAll(getService().AtRequestRemarkSubmit(dataMap,user));
|
||||||
|
apidatas.put("api_status",true);
|
||||||
|
}catch (Exception e){
|
||||||
|
apidatas.put("api_status",false);
|
||||||
|
apidatas.put("api_errormsg","exception:"+e.getMessage());
|
||||||
|
}
|
||||||
|
bb.writeLog("apidatas:"+ JSONObject.toJSONString(apidatas));
|
||||||
|
return JSONObject.toJSONString(apidatas);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,205 @@
|
|||||||
|
package weaver.workflow.request;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
import weaver.conn.ConnStatement;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.resource.ResourceComInfo;
|
||||||
|
import weaver.interfaces.dito.comInfo.PropBean;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class RequestSignRelevanceWithMe extends BaseBean {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取与我相关的Logid
|
||||||
|
* @param wfid
|
||||||
|
* @param reqid
|
||||||
|
* @param userid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getRelevanceinfo(String wfid, String reqid, String userid) {
|
||||||
|
String result = "";
|
||||||
|
//所有@我的log
|
||||||
|
String sql = "select t2.logid from workflow_requestlogatinfo t1 inner join workflow_requestlog t2 "
|
||||||
|
+ " on t1.nodeid=t2.nodeid "
|
||||||
|
+ " and t1.logtype=t2.logtype "
|
||||||
|
+ " and t1.operatedate=t2.operatedate "
|
||||||
|
+ " and t1.operatetime=t2.operatetime "
|
||||||
|
+ " and t1.operator=t2.operator"
|
||||||
|
+ " where t1.workflowid=" + wfid + " and t1.requestid=" + reqid + " and ((t1.atuserid is not null and t1.atuserid=" + userid + ") or (t1.forwardresource is not null and t1.forwardresource like '%," + userid + ",%'))";
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeSql(sql);
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
result += Util.null2String(rs.getString(1)) + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
result += "0";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入关联信息
|
||||||
|
* @param remark 签字意见
|
||||||
|
* @param wfid 流程id
|
||||||
|
* @param reqid 请求id
|
||||||
|
* @param nodeid 节点id
|
||||||
|
* @param logtype 日志类型
|
||||||
|
* @param operatedate 操作日期
|
||||||
|
* @param operatetime 操作时间
|
||||||
|
* @param operator 操作人
|
||||||
|
* @param atuserid @人
|
||||||
|
* @return 是否保存成功
|
||||||
|
*/
|
||||||
|
public void inertRelevanceInfo(String wfid, String reqid, String nodeid, String logtype, String operatedate, String operatetime, String operator, String remark) {
|
||||||
|
inertRelevanceInfo(wfid, reqid, nodeid, logtype, operatedate, operatetime, operator, remark, null);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 插入关联信息
|
||||||
|
* @param wfid 流程id
|
||||||
|
* @param reqid 请求id
|
||||||
|
* @param nodeid 节点id
|
||||||
|
* @param logtype 日志类型
|
||||||
|
* @param operatedate 操作日期
|
||||||
|
* @param operatetime 操作时间
|
||||||
|
* @param operator 操作人
|
||||||
|
* @param remark 签字意见
|
||||||
|
* @param resourceids @人
|
||||||
|
* @return 是否保存成功
|
||||||
|
*/
|
||||||
|
public void inertRelevanceInfo(String wfid, String reqid, String nodeid, String logtype, String operatedate, String operatetime, String operator, String remark, String resourceids) {
|
||||||
|
List<String> atlist = this.parseRemark(remark);
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
try {
|
||||||
|
RecordSet rs1 = new RecordSet();
|
||||||
|
List<Map<String, Object>> todolist = new ArrayList();
|
||||||
|
for (int i = 0; i < atlist.size(); i++) {
|
||||||
|
String atuserid = atlist.get(i);
|
||||||
|
String sql = "insert into workflow_requestlogAtInfo(workflowid, requestid, nodeid, logtype, operatedate, operatetime, operator, atuserid)";
|
||||||
|
sql += " values (" + wfid + ", " + reqid + ", " + nodeid + ", '" + logtype + "', '" + operatedate + "', '" + operatetime + "', " + operator + ", " + atuserid + ")";
|
||||||
|
rs.execute(sql);
|
||||||
|
|
||||||
|
Map<String, Object> rsojson = new HashMap<>();
|
||||||
|
rs1.executeQuery("select * from workflow_requestbase where requestid=?", reqid);
|
||||||
|
rs1.next();
|
||||||
|
String requestname = Util.null2String(rs1.getString("requestname"));
|
||||||
|
|
||||||
|
rs1.executeQuery("select * from workflow_nodebase where id=?", nodeid);
|
||||||
|
rs1.next();
|
||||||
|
String nodename = Util.null2String(rs1.getString("nodename"));
|
||||||
|
|
||||||
|
rsojson.put("requestname", requestname);
|
||||||
|
rsojson.put("requestid", reqid);
|
||||||
|
rsojson.put("username", new ResourceComInfo().getLastname(atuserid) + "(" + atuserid + ")");
|
||||||
|
rsojson.put("id", atuserid);
|
||||||
|
rsojson.put("nodeid", nodeid);
|
||||||
|
rsojson.put("nodename", nodename);
|
||||||
|
rsojson.put("isremark", "8");//抄送无需提交
|
||||||
|
rsojson.put("loginid", new ResourceComInfo().getLoginID(atuserid));
|
||||||
|
|
||||||
|
rs.writeLog("=================== RequestSignRelevanceWithMe inertRelevanceInfo ============== "+ rsojson);
|
||||||
|
todolist.add(rsojson);
|
||||||
|
}
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("TodoDatas", todolist);
|
||||||
|
params.put("requestid", reqid);
|
||||||
|
|
||||||
|
String bpm_app_workflowurl = PropBean.getUfPropValue("bpm_app_workflowurl");
|
||||||
|
String bpm_app_requesturl = PropBean.getUfPropValue("bpm_app_requesturl");
|
||||||
|
String portal_todourl = PropBean.getUfPropValue("portal_todourl");
|
||||||
|
String username = PropBean.getUfPropValue("username");
|
||||||
|
String passwd = PropBean.getUfPropValue("passwd");
|
||||||
|
String center = PropBean.getUfPropValue("center");
|
||||||
|
String bpm_workflowurl = PropBean.getUfPropValue("bpm_workflowurl");
|
||||||
|
|
||||||
|
Class<?> clazz = Class.forName("com.customization.dito.sendtodo.SendPortalAtAddTodoCmd");
|
||||||
|
if(clazz.getMethod("sendTodoDataByNode",new Class[]{String.class,List.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class}) != null) {
|
||||||
|
Method method = clazz.getMethod("sendTodoDataByNode",new Class[]{String.class,List.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class});
|
||||||
|
|
||||||
|
Object newInstance = clazz.newInstance();
|
||||||
|
method.invoke(newInstance,reqid,todolist,username,passwd,center,portal_todourl,bpm_workflowurl,bpm_app_workflowurl,bpm_app_requesturl);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
rs.writeLog(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resourceids != null && resourceids.length() > 0) {
|
||||||
|
resourceids = "," + resourceids + ",";
|
||||||
|
String sql = "insert into workflow_requestlogAtInfo(workflowid, requestid, nodeid, logtype, operatedate, operatetime, operator, forwardresource)";
|
||||||
|
if(rs.getDBType().equals("oracle")&&!Util.null2String(rs.getOrgindbtype()).equals("dm")&&!Util.null2String(rs.getOrgindbtype()).equals("st")){
|
||||||
|
sql += " values (" + wfid + ", " + reqid + ", " + nodeid + ", '" + logtype + "', '" + operatedate + "', '" + operatetime + "', " + operator + ", '')";
|
||||||
|
}else{
|
||||||
|
sql += " values (" + wfid + ", " + reqid + ", " + nodeid + ", '" + logtype + "', '" + operatedate + "', '" + operatetime + "', " + operator + ", '" + resourceids + "')";
|
||||||
|
}
|
||||||
|
rs.execute(sql);
|
||||||
|
/***多人力clob***/
|
||||||
|
if(rs.getDBType().equals("oracle")&&!Util.null2String(rs.getOrgindbtype()).equals("dm")&&!Util.null2String(rs.getOrgindbtype()).equals("st")){
|
||||||
|
ConnStatement hrmsta = null;
|
||||||
|
try {
|
||||||
|
String maxidsql = "select max(id) maxid from workflow_requestlogAtInfo where workflowid = " + wfid + " and requestid =" + reqid;
|
||||||
|
rs.executeSql(maxidsql);
|
||||||
|
if(rs.next()){
|
||||||
|
String maxid = Util.null2String(rs.getString("maxid"));
|
||||||
|
if(!"".equals(maxid)){
|
||||||
|
String hrmsql = "update workflow_requestlogAtInfo set forwardresource = ? where id = "+maxid;
|
||||||
|
hrmsta = new ConnStatement();
|
||||||
|
hrmsta.setStatementSql(hrmsql);
|
||||||
|
hrmsta.setString(1, resourceids);
|
||||||
|
hrmsta.executeUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
writeLog(e);
|
||||||
|
}finally {
|
||||||
|
if(hrmsta!=null) {
|
||||||
|
hrmsta.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
}
|
||||||
|
/******/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析签字意见内容中的at人
|
||||||
|
* @param remark 签字意见
|
||||||
|
* @return at列表
|
||||||
|
*/
|
||||||
|
public List<String> parseRemark(String remark) {
|
||||||
|
List<String> result = new ArrayList<String>();
|
||||||
|
if (Strings.isNullOrEmpty(remark)) return result;
|
||||||
|
try {
|
||||||
|
//匹配atsome="@3"
|
||||||
|
Pattern ptrn = Pattern.compile("atsome=\\\"@[\\d]+\\\"");
|
||||||
|
Pattern atptrn = Pattern.compile("[\\d]+");
|
||||||
|
Matcher matcher = ptrn.matcher(remark);
|
||||||
|
if(ptrn == null || atptrn == null){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
String atsome = matcher.group();
|
||||||
|
Matcher atMatcher = atptrn.matcher(atsome);
|
||||||
|
if (atMatcher.find()) {
|
||||||
|
if (!result.contains(atMatcher.group())) {
|
||||||
|
result.add(atMatcher.group());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue