From 9e4051be4019f3dae7aab6a8cff194b7d09f9136 Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Wed, 11 Oct 2023 16:55:01 +0800 Subject: [PATCH] =?UTF-8?q?#EC=5FHJ31#=20=E5=B7=B2=E4=B8=8A=E7=BA=BF?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=EF=BC=8C=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=A5=E5=BF=97=E3=80=81=E5=AF=B9email?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DoRemind_InfoCenterRemindCmd.java | 90 +++++++++++++++++++ .../dito/filter/HttpRequestUtil.java | 13 +-- .../interfaces/dito/mq/RocketmqUtil.java | 30 +++++-- 3 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 src/com/engine/workflow/cmd/workflowOvertime/DoRemind_InfoCenterRemindCmd.java diff --git a/src/com/engine/workflow/cmd/workflowOvertime/DoRemind_InfoCenterRemindCmd.java b/src/com/engine/workflow/cmd/workflowOvertime/DoRemind_InfoCenterRemindCmd.java new file mode 100644 index 00000000..c2d69f64 --- /dev/null +++ b/src/com/engine/workflow/cmd/workflowOvertime/DoRemind_InfoCenterRemindCmd.java @@ -0,0 +1,90 @@ +package com.engine.workflow.cmd.workflowOvertime; + +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.workflow.entity.workflowOvertime.OvertimeEntity; +import com.engine.workflow.entity.workflowOvertime.RemindEntity; +import org.apache.commons.lang3.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.Util; +import weaver.workflow.logging.Logger; +import weaver.workflow.logging.LoggerFactory; +import weaver.workflow.msg.MsgPushUtil; +import weaver.workflow.msg.PoppupRemindInfoUtil; +import weaver.workflow.msg.entity.MsgEntity; + +import weaver.workflow.request.RequestComInfo; +import weaver.workflow.request.RequestOperationMsgManager; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; + +/** + * 流程超时-信息中心提醒 + */ +public class DoRemind_InfoCenterRemindCmd extends DoRemind_CommonInitCmd { + private final static Logger log = LoggerFactory.getLogger(DoRemind_InfoCenterRemindCmd.class); + + private RequestComInfo requestcominfo; + + public DoRemind_InfoCenterRemindCmd(OvertimeEntity overtimeEntity, RemindEntity remindEntity) { + super(overtimeEntity,remindEntity); + try { + requestcominfo = new RequestComInfo(); + }catch (Exception e){ + e.printStackTrace(); + } + } + + @Override + public BizLogContext getLogContext() { + return null; + } + + @Override + public Boolean execute(CommandContext commandContext) { + boolean result = true; + + int remindtype = remindEntity.getRemindtype(); + int requestid = overtimeEntity.getRequestId(); + log.info("信息中心提醒开始:requestid:"+requestid+" remindtype:"+remindtype +" remindUserIdList:"+remindUserIdList); + /*PoppupRemindInfoUtil popUtil = new PoppupRemindInfoUtil(); + for (int j = 0; j < remindUserIdList.size(); j++) { + result = popUtil.addPoppupRemindInfo(Util.getIntValue("" + remindUserIdList.get(j)), 10, "" + remindUserTypeList.get(j), requestid, requestcominfo.getRequestname(requestid + "")); + if (!result) { + log.info("信息中心提醒失败!相关参数userid:" + remindUserIdList.get(j) + " type:10 logintype:" + remindUserTypeList.get(j) + " requestid:" + requestid + " requestname:" + requestcominfo.getRequestname(requestid + "")); + } + }*//* + RecordSet rs = new RecordSet(); + if (remindtype == 0) { // 超时前提 + rs.executeUpdate("update workflow_currentoperator set wfreminduser='" + remindUserIds + "',wfusertypes='" + remindUserTypes + "' where isremark='0' and requestid=" + requestid); + } else { // 超时后提醒 + rs.executeUpdate("update workflow_currentoperator set wfreminduser_csh='" + remindUserIds + "',wfusertypes_csh='" + remindUserTypes + "' where isremark='0' and requestid=" + requestid); + }*/ + + RequestOperationMsgManager romm = new RequestOperationMsgManager(); + List requestMsgEntity = romm.requestOverTimeNoticeMsg(requestid, remindUserIdList, remindtype); + new MsgPushUtil().pushMsg(requestMsgEntity); + + try{ + Class clazz = Class.forName("weaver.interfaces.dito.msg.SendPortalOverTimeMsgUtil"); + if(clazz.getMethod("SendOverTimeMsg") != null) { + Method method = clazz.getMethod("SendOverTimeMsg", List.class); + + Object newInstance = clazz.newInstance(); + method.invoke(newInstance,requestMsgEntity); + } + }catch (ClassNotFoundException | NoSuchMethodException e){ + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + + return result; + } +} diff --git a/src/weaver/interfaces/dito/filter/HttpRequestUtil.java b/src/weaver/interfaces/dito/filter/HttpRequestUtil.java index c0e88655..31500508 100644 --- a/src/weaver/interfaces/dito/filter/HttpRequestUtil.java +++ b/src/weaver/interfaces/dito/filter/HttpRequestUtil.java @@ -157,7 +157,6 @@ public class HttpRequestUtil extends BaseBean{ } RecordSet rs = new RecordSet(); - RecordSet rslog = new RecordSet(); User newUser = null; String loginUserId = "" ; @@ -239,10 +238,14 @@ public class HttpRequestUtil extends BaseBean{ session.setAttribute("isie", Util.null2String(request.getParameter("isie"))); session.setAttribute("browser_isie", Util.null2String(request.getParameter("isie"))); - Calendar today = Calendar.getInstance(); - String currentdate = Util.add0(today.get(1), 4) + "-" + Util.add0(today.get(2) + 1, 2) + "-" + Util.add0(today.get(5), 2); - char separater = Util.getSeparator(); - rslog.execute("HrmResource_UpdateLoginDate", loginUserId + separater + currentdate); +// try{ +// Calendar today = Calendar.getInstance(); +// String currentdate = Util.add0(today.get(1), 4) + "-" + Util.add0(today.get(2) + 1, 2) + "-" + Util.add0(today.get(5), 2); +// char separater = Util.getSeparator(); +// rs.execute("HrmResource_UpdateLoginDate", loginUserId + separater + currentdate); +// }catch (Exception e){ +// bb.writeLog("HttpRequestUtil--e:"+e); +// } boolean moreAccountLanding = GCONST.getMOREACCOUNTLANDING(); if (moreAccountLanding) { diff --git a/src/weaver/interfaces/dito/mq/RocketmqUtil.java b/src/weaver/interfaces/dito/mq/RocketmqUtil.java index 210a0714..a412e8b6 100644 --- a/src/weaver/interfaces/dito/mq/RocketmqUtil.java +++ b/src/weaver/interfaces/dito/mq/RocketmqUtil.java @@ -137,7 +137,13 @@ public class RocketmqUtil { String staffCode = Util.null2String(jsonObject.get("staffCode")); String actType = Util.null2String(jsonObject.get("actType")); - String email = Util.null2String(jsonObject.get("email")); + String email = "" ; + if(jsonObject.containsKey("eMail")){ + email = Util.null2String(jsonObject.get("eMail")); + }else if(jsonObject.containsKey("email")){ + email = Util.null2String(jsonObject.get("email")); + } + String sysUserId = Util.null2String(jsonObject.get("sysUserId")); String sysUserCode = Util.null2String(jsonObject.get("sysUserCode")); String userName = Util.null2String(jsonObject.get("userName")); @@ -707,7 +713,7 @@ public class RocketmqUtil { if("A".equals(actType) || "M".equals(actType)) { //当岗位为主岗位时才更新,1:主岗位 - if ("1".equals(defaultFlag)){ +// if ("1".equals(defaultFlag)){ String updateUserJobSql = " update hrmresource set jobtitle=?,modified=?,modifier=? where id=? "; bb.writeLog("updateUserJobSql:"+updateUserJobSql); boolean flag = rs.executeUpdate(updateUserJobSql,new Object[]{jobtitlesId,currentDateTime,updateStaff,userId}); @@ -722,7 +728,7 @@ public class RocketmqUtil { dataMap.put("errmessage","更新人员岗位sql执行成功"); } recordErrorData(dataMap); - } +// } }else if("D".equals(actType)){ jobtitlesId = null; String updateUserJobSql = " update hrmresource set jobtitle=?,modified=?,modifier=? where id=? "; @@ -1163,8 +1169,13 @@ public class RocketmqUtil { String staffName = Util.null2String(jsonObject.get("staffName")); String staffCode = Util.null2String(jsonObject.get("staffCode")); String actType = Util.null2String(jsonObject.get("actType")); + String email = "" ; + if(jsonObject.containsKey("eMail")){ + email = Util.null2String(jsonObject.get("eMail")); + }else if(jsonObject.containsKey("email")){ + email = Util.null2String(jsonObject.get("email")); + } - String email = Util.null2String(jsonObject.get("email")); String pwdSmsTel = Util.null2String(jsonObject.get("pwdSmsTel")); String loginedNum = Util.null2String(jsonObject.get("sysUserId")); @@ -1175,7 +1186,12 @@ public class RocketmqUtil { String lastname = staffName; String staffId = Util.null2String(jsonObject.get("staffId")); - String eId = Util.null2String(jsonObject.get("eId")); + String eId = "" ; + if(jsonObject.containsKey("eid")){ + eId = Util.null2String(jsonObject.get("eid")); + }else if(jsonObject.containsKey("eId")){ + eId = Util.null2String(jsonObject.get("eId")); + } bb.writeLog("eId:"+eId); bb.writeLog("staffId:"+staffId); @@ -1214,9 +1230,9 @@ public class RocketmqUtil { if("M".equalsIgnoreCase(actType)) { String userUpdateSql = " update hrmresource set lastname=?,departmentid=?,subcompanyid1=?," + - " creater=?,email=?,mobile=?,jobtitle=?,status=?,dsporder=?,lastmoddate=?,modified=? where workcode=? "; + " creater=?,email=?,mobile=?,status=?,dsporder=?,lastmoddate=?,modified=? where workcode=? "; bb.writeLog("userUpdateSql:"+userUpdateSql); - boolean flag = rs.executeUpdate(userUpdateSql,new Object[]{lastname,deptId,subcompanyid1,creator,email,pwdSmsTel,jobTitleId,status,loginedNum,currentDate,currentDateTime,staffCode}); + boolean flag = rs.executeUpdate(userUpdateSql,new Object[]{lastname,deptId,subcompanyid1,creator,email,pwdSmsTel,status,loginedNum,currentDate,currentDateTime,staffCode}); bb.writeLog("flag:"+flag); Map dataMap = new HashMap(); dataMap.put("syndate",nowDateTime);