no message

master
rengp 2 years ago
parent cca5205632
commit 749c30c590

@ -3,7 +3,9 @@ package com.api.tjbk;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wbi.util.ParamUtil;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
@ -31,6 +33,8 @@ import java.util.Map;
*/
@Path("/tjbk/MsgTopDialog")
public class TJBKMsgTopDialog {
private BaseBean bb = new BaseBean();
private String className = this.getClass().getName()+"-----";
@GET
@Path("/getDialog")
@ -39,12 +43,16 @@ public class TJBKMsgTopDialog {
Map<String, Object> apidatas = new HashMap<String, Object>();
try {
//获取当前用户
User user = HrmUserVarify.getUser(request, response);
// User user = HrmUserVarify.getUser(request, response);
RecordSet rs = new RecordSet();
RecordSet recordSet = new RecordSet();
JSONArray conArr = new JSONArray();
JSONObject dataObj = new JSONObject();
String userid = user.getUID() + "";
// bb.writeLog(className+user);
// bb.writeLog(className+user.getLoginid());
Map paramMap = ParamUtil.request2Map(request);
bb.writeLog(className+paramMap );
String userid = (String) paramMap.get("userid");
boolean isdialog = true;
LocalDate now = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@ -60,7 +68,7 @@ public class TJBKMsgTopDialog {
String dataid = Util.null2String(rs.getString("id"));
String scope = Util.null2String(rs.getString("scope"));
String role = Util.null2String(rs.getString("role"));
boolean isLatest = getLatestData(dataid, user, recordSet, scope, role);
boolean isLatest = getLatestData(dataid, new User(Util.getIntValue(userid)), recordSet, scope, role);
if (isLatest) {
id = Util.null2String(rs.getString("id"));
title = Util.null2String(rs.getString("title"));
@ -93,6 +101,7 @@ public class TJBKMsgTopDialog {
apidatas.put("api_status", true);
} catch (Exception e) {
e.printStackTrace();
bb.writeLog(e.getMessage());
apidatas.put("api_status", false);
apidatas.put("api_errormsg", "getVersionInfo catch exception : " + e.getMessage());
}
@ -107,8 +116,10 @@ public class TJBKMsgTopDialog {
Map<String, Object> apidatas = new HashMap<String, Object>();
try {
//获取当前用户
User user = HrmUserVarify.getUser(request, response);
String userid = user.getUID() + "";
// User user = HrmUserVarify.getUser(request, response);
Map paramMap = ParamUtil.request2Map(request);
bb.writeLog(className+paramMap );
String userid = (String) paramMap.get("userid");
String mainid = Util.null2String(request.getParameter("id"));
String sql = "insert into uf_MsgTopDialog_dt2 (mainid,hrmid) values ('" + mainid + "','" + userid + "')";
RecordSet rs = new RecordSet();

@ -91,7 +91,7 @@ public class TJBKYearReport {
fourthMap.put("grwdgx",Util.null2String(recordSet.getString("grwdgx")));
fourthMap.put("xwhycs",Util.null2String(recordSet.getString("xwhycs")));
fifthMap.put("sktxysfxs",Util.null2String(recordSet.getString("sktxysfxs")));
fifthMap.put("sktxcycs",Util.null2String(recordSet.getString("sktxysfxs")));
fifthMap.put("sktxcycs",Util.null2String(recordSet.getString("sktxcycs")));
sixthMap.put("gczgw",Util.null2String(recordSet.getString("gczgw")));
sixthMap.put("ljjyzz",Util.null2String(recordSet.getString("ljjyzz")));
sixthMap.put("ljjp",Util.null2String(recordSet.getString("ljjp")));
@ -111,8 +111,8 @@ public class TJBKYearReport {
// eighthMap.put("dlcscgrszb",Util.null2String(recordSet.getString("dlcscgrszb")));
}
String gjc = Util.null2String(recordSet.getString("gjc"));
if ("统全局".equals(gjc)){
ninthMap.put("gjc","统全局");
if ("统全局".equals(gjc)){
ninthMap.put("gjc","统全局");
ninthMap.put("filed1",Util.null2String(recordSet.getString("sktxcycs")));
ninthMap.put("filed2","2023-12-05 23:24:45");
}else if("天行守护者".equals(gjc)){
@ -126,7 +126,7 @@ public class TJBKYearReport {
ninthMap.put("filed2","2023-12-05 23:24:45");
}else if("智慧OA最亲密的朋友".equals(gjc)){
ninthMap.put("gjc","智慧OA最亲密的朋友");
ninthMap.put("filed1",112);
ninthMap.put("filed1",Util.null2String(recordSet.getString("ljdloacs")));
ninthMap.put("filed2","90%");
}else if("社交天花板".equals(gjc)){
ninthMap.put("gjc","社交天花板");
@ -135,12 +135,25 @@ public class TJBKYearReport {
ninthMap.put("filed3","90%");
}else if("人形公文处理机".equals(gjc)){
ninthMap.put("gjc","人形公文处理机");
ninthMap.put("filed1","547");
ninthMap.put("filed1",Util.null2String(recordSet.getString("qnljclgw")));
ninthMap.put("filed2","90%");
}else if("宝藏事务挖掘机".equals(gjc)){
ninthMap.put("gjc","宝藏事务挖掘机");
ninthMap.put("filed1","547");
ninthMap.put("filed1",Util.null2String(recordSet.getString("grswsps")));
ninthMap.put("filed2","90%");
}else if("走南闯北 遥遥领先".equals(gjc)){
ninthMap.put("gjc","走南闯北 遥遥领先");
ninthMap.put("filed1","90%");
}else if("知识分享之光".equals(gjc)){
ninthMap.put("gjc","知识分享之光");
ninthMap.put("filed1",Util.null2String(recordSet.getString("grwdgx")));
ninthMap.put("filed2","90%");
}else if("会议守护者".equals(gjc)) {
ninthMap.put("gjc", "会议守护者");
ninthMap.put("filed1", Util.null2String(recordSet.getString("grhycycs")));
ninthMap.put("filed2", "90%");
}else if("智慧OA探索家".equals(gjc)){
ninthMap.put("gjc","智慧OA探索家");
}
ninthMap.put("url",getGJCUrl(gjc));
apidatas.put("first",firstMap);

@ -61,8 +61,9 @@ public class YearReportCorn extends BaseCronJob {
.collect(Collectors.toList());;
String weekStr = String.join(",",allWeekendsOfYear);
String wfids = Prop.getPropValue("yearReport", "gwwfid");
String slwfid = Prop.getPropValue("yearReport", "slwfid");
String AffairsWfid = getAffairsWfid(rs);
String updateuserSql = "update uf_personreport set grhycycs = ? ,grwdgx = ? ,jjrclgw = ? ,qnljclgw = ?,cgbl = ? ,ljdloacs = ?,clgwzwrq = ?,grswsps = ?,grcylts = ?,grfsxxrs = ?,grfsxxqlss=? where ry = ?";
String updateuserSql = "update uf_personreport set grhycycs = ? ,grwdgx = ? ,jjrclgw = ? ,qnljclgw = ?,cgbl = ? ,ljdloacs = ?,clgwzwrq = ?,grswsps = ?,grcylts = ?,grfsxxrs = ?,grfsxxqlss=?,ljsyslcs = ? where ry = ?";
//开始更新个人的不同的数据
for (int i = 0; i < pageTotle; i++) {
String sqlhrmWhere = sqlhrm + i*100;
@ -80,7 +81,8 @@ public class YearReportCorn extends BaseCronJob {
int MsgCount = Util.getIntValue(ReportUtil.getMsgCountByUserid(emprs, id)+"",0);
int PeopleCount = Util.getIntValue(ReportUtil.getMsgPeopleCountByUserid(emprs, id)+"",0);
int MsgGangHsienCount = Util.getIntValue(ReportUtil.getMsgGangHsienCountByUserid(emprs, id)+"",0);
rs.executeUpdate(updateuserSql,personMeetCount,shareDocCnt,holidayOfficialWfCount,yearOfficialWfCount,officialWfCountPercentage,loginDayCount,lastTimeDate,AffairsWfCount,MsgCount,PeopleCount,MsgGangHsienCount,id);
int BusinessWfCount = Util.getIntValue(ReportUtil.getBusinessWfCount(rs2, id,slwfid)+"",0);
rs.executeUpdate(updateuserSql,personMeetCount,shareDocCnt,holidayOfficialWfCount,yearOfficialWfCount,officialWfCountPercentage,loginDayCount,lastTimeDate,AffairsWfCount,MsgCount,PeopleCount,MsgGangHsienCount,BusinessWfCount,id);
}
}

@ -318,6 +318,29 @@ public class ReportUtil {
return rs.getInt("cnt");
}
/**
*
* 使
* @param rs
*
*
* @param userid
* @param Wfid
* @return
*/
public static int getBusinessWfCount(RecordSet rs , String userid ,String Wfid){
String dateFormat = "yyyy-MM-dd";
String[] startEndOfYear = getStartEndOfYear(dateFormat);
System.out.println("Start of Year: " + startEndOfYear[0]);
System.out.println("End of Year: " + startEndOfYear[1]);
String getMsgCountSql = "select count(1) cnt from workflow_requestbase where creater = "+userid+" and workflowid in ( "+Wfid+" ) " +
" and createdate >= '"+startEndOfYear[0]+"' and createdate <= '"+startEndOfYear[1]+"'";
rs.execute(getMsgCountSql);
rs.next();
bb.writeLog("getBusinessWfCount=="+getMsgCountSql);
return rs.getInt("cnt");
}
public static void main(String[] args) {
getMsgCount();
}

@ -14,7 +14,7 @@ import java.util.zip.ZipOutputStream;
public class HgUtils {
static String tranCode = "025801";
public static String putFile(String localFileName, String remoteFileName) throws FtpException, IOException, FtpException {
public static String putFile(String localFileName, String remoteFileName) throws FtpException, IOException, FtpException {
FtpClientConfig config = FtpClientConfig.getInstance("/opt/weaver/ecology/WEB-INF/prop/FtpClientConfig.properties");
FtpPut ftpPut = new FtpPut(localFileName, remoteFileName, tranCode, true, true, config);
String filePath = ftpPut.doPutFile();

@ -17,35 +17,40 @@ public class TravelToEsbBean {
private String expnsAmt;
private String expnsRsn;
private String remark;
private String costDeptCode;
private String costDeptHame;
private List<ExpenseItem> expndArray;
private List<JourneyInfo> jrnyInfoArray;
private List<acsryItem> acsryArray;
public String toXMLString() {
StringBuilder xmlString = new StringBuilder(
"<oaTrvlBnsExpnsAcctNo>" + oaTrvlBnsExpnsAcctNo +"</oaTrvlBnsExpnsAcctNo>" +
"<operatorNo>" + operatorNo + "</operatorNo>" +
"<operatorName>" + operatorName + "</operatorName>" +
"<acsryNums>" + acsryNums + "</acsryNums>" +
"<expnsAmt>" + expnsAmt + "</expnsAmt>" +
"<expnsRsn>" + expnsRsn +"</expnsRsn>" +
"<remark>" + remark + "</remark>") ;
StringBuilder xmlString = new StringBuilder(
"<oaTrvlBnsExpnsAcctNo>" + oaTrvlBnsExpnsAcctNo + "</oaTrvlBnsExpnsAcctNo>" +
"<operatorNo>" + operatorNo + "</operatorNo>" +
"<operatorName>" + operatorName + "</operatorName>" +
"<acsryNums>" + acsryNums + "</acsryNums>" +
"<expnsAmt>" + expnsAmt + "</expnsAmt>" +
"<expnsRsn>" + expnsRsn + "</expnsRsn>" +
"<remark>" + remark + "</remark>" +
"<costDeptCode>" + costDeptCode + "</costDeptCode>" +
"<costDeptHame>" + costDeptHame + "</costDeptHame>");
for (ExpenseItem expenseItem : expndArray) {
xmlString.append(convertObjectToXml(expenseItem,"expndArray"));
xmlString.append(convertObjectToXml(expenseItem, "expndArray"));
}
for (JourneyInfo journeyInfo : jrnyInfoArray) {
xmlString.append(convertObjectToXml(journeyInfo,"jrnyInfoArray"));
xmlString.append(convertObjectToXml(journeyInfo, "jrnyInfoArray"));
}
for (acsryItem acsryItem : acsryArray) {
xmlString.append(convertObjectToXml(acsryItem,"acsryArray"));
xmlString.append(convertObjectToXml(acsryItem, "acsryArray"));
}
return xmlString.toString();
}
@Override
public String toString() {
return "TravelToEsbBean{" +
@ -71,10 +76,6 @@ public class TravelToEsbBean {
}
public String getOaTrvlBnsExpnsAcctNo() {
return oaTrvlBnsExpnsAcctNo;
}
@ -147,10 +148,10 @@ public class TravelToEsbBean {
this.jrnyInfoArray = jrnyInfoArray;
}
public static String convertObjectToXml(Object object , String RootName) {
public static String convertObjectToXml(Object object, String RootName) {
StringBuilder xmlBuilder = new StringBuilder("<" + (StringUtil.isEmpty(RootName)?object.getClass().getSimpleName():RootName )+ ">");
StringBuilder xmlBuilder = new StringBuilder("<" + (StringUtil.isEmpty(RootName) ? object.getClass().getSimpleName() : RootName) + ">");
Field[] fields = object.getClass().getDeclaredFields();
Map<String, Object> attributes = new LinkedHashMap<>();
@ -168,10 +169,26 @@ public class TravelToEsbBean {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
xmlBuilder.append("</" + (StringUtil.isEmpty(RootName)?object.getClass().getSimpleName():RootName ) + ">");
xmlBuilder.append("</" + (StringUtil.isEmpty(RootName) ? object.getClass().getSimpleName() : RootName) + ">");
return xmlBuilder.toString();
}
public String getCostDeptCode() {
return costDeptCode;
}
public void setCostDeptCode(String costDeptCode) {
this.costDeptCode = costDeptCode;
}
public String getCostDeptHame() {
return costDeptHame;
}
public void setCostDeptHame(String costDeptHame) {
this.costDeptHame = costDeptHame;
}
public static void main(String[] args) throws IOException {
File tempFile = File.createTempFile("tempfile", ".tmp");
System.out.println("临时文件路径: " + tempFile.getAbsolutePath());

@ -8,6 +8,7 @@ import com.engine.util.XMLUtils;
import com.icbc.api.internal.apache.http.impl.cookie.S;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans;
import weaver.file.Prop;
import weaver.general.BaseBean;
import weaver.general.GCONST;
import weaver.general.StringUtil;
@ -16,11 +17,13 @@ import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestService;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
* @author 13
*/
public class CWGLSocketExecute extends BaseBean implements SocketExecute {
@Override
public String execute(String param) {
@ -73,7 +76,10 @@ public class CWGLSocketExecute extends BaseBean implements SocketExecute {
try {
updateStatus(requestid, flowStatus);
String sqr = getsqrbyBH(oaTrvlBnsExpnsAcctNo, "formtable_main_281");
sendMsgForSuccess(sqr);
if("3".equals(flowStatus)){
sendMsgForSuccess(sqr,oaTrvlBnsExpnsAcctNo,requestid);
}
} catch (Exception e) {
e.printStackTrace();
return XMLUtils.CW2XML(paramMap, "1", e.getMessage());
@ -84,17 +90,19 @@ public class CWGLSocketExecute extends BaseBean implements SocketExecute {
}
}
private void sendMsgForSuccess(String userid) {
private void sendMsgForSuccess(String userid, String oaTrvlBnsExpnsAcctNo, int requestid) {
MessageType messageType = MessageType.newInstance(1674); // 消息来源(见文档第四点补充 必填)
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
String[] useridArr = userid.split(",");
String proplinkUrl = Prop.getPropValue("subsidy_reminder", "linkUrl");
String proplinkMobileUrl = Prop.getPropValue("subsidy_reminder", "linkMobileUrl");
for (String s : useridArr) {
userIdList.add(s);
}
String title = "补助提醒"; // 标题
String context = "您有新的差旅补助到账,请您查收";
String linkUrl = ""; // PC端链接
String linkMobileUrl = ""; // 移动端链接
String title = "您有新的差旅补助到账,请您查收"; // 标题
String context = "差补报销("+oaTrvlBnsExpnsAcctNo+")";
String linkUrl = StringUtil.isEmpty(proplinkUrl) ? "" : proplinkUrl+requestid; // PC端链接
String linkMobileUrl = StringUtil.isEmpty(proplinkMobileUrl) ? "" :proplinkMobileUrl+requestid; // 移动端链接
try {
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(1);// 创建人id
@ -161,10 +169,5 @@ public class CWGLSocketExecute extends BaseBean implements SocketExecute {
}
}
public static void main(String[] args) {
HashMap<String, String> paramMap = new HashMap<>();
String sgntrOpn = paramMap.get("sgntrOpn");
sgntrOpn = "(" + 1111 + "):" + sgntrOpn;
System.out.println(sgntrOpn);
}
}

@ -0,0 +1,124 @@
<%@ page import="com.engine.custom.sl.entity.EsbRequestHeader" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.engine.custom.sl.entity.TravelToEsbBean" %>
<%@ page import="java.nio.charset.StandardCharsets" %>
<%@ page import="com.engine.util.SocketClientUtil" %>
<%@ page import="com.engine.util.XMLUtils" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.engine.common.util.ParamUtil" %>
<%@ page import="java.net.Socket" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.StringUtil" %>
<%@ page import="java.io.*" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
// Map<String, Object> param = ParamUtil.request2Map(request);
// String workCode = param.get("workCode").toString();
String workCode = HrmUserVarify.getUser(request, response).getLoginid();
String timeStr = generateTimestamp();
EsbRequestHeader esbRequestHeader = new EsbRequestHeader();
esbRequestHeader.setService_sn(timeStr+workCode);
esbRequestHeader.setSystem_id("0217");
esbRequestHeader.setRequester_id("0170");
esbRequestHeader.setBranch_id("KHCP0003");
esbRequestHeader.setChannel_id("24");
esbRequestHeader.setService_time(timeStr);
esbRequestHeader.setNeed_request("");
esbRequestHeader.setSvcCd("500130012");
esbRequestHeader.setSvcScn("24");
String bnkSrlNo = esbRequestHeader.getRequester_id() + timeStr + workCode;
esbRequestHeader.setBnkSrlNo(bnkSrlNo);
esbRequestHeader.setFileFlg("0");
String Service_Body = "<Service_Body><request><oaTrvlBnsExpnsAcctNo>BTSQD-202312180027</oaTrvlBnsExpnsAcctNo><apprvrNo>10110726</apprvrNo><apprvrName>商博君</apprvrName><flowStatus>3</flowStatus><sgntrOpn>付款成功</sgntrOpn></request></Service_Body>" ;
String Service_Header = TravelToEsbBean.convertObjectToXml(esbRequestHeader,"Service_Header");
String serviceXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Service>";
// out.print("UTF_8_serviceXML==="+ serviceXML);
serviceXML = serviceXML + Service_Header + Service_Body;
serviceXML = serviceXML + "</Service>";
// out.print("UTF_8_serviceXML==="+ serviceXML);
String length = String.format("%08d", serviceXML.length());
serviceXML = length + serviceXML;
serviceXML = new String(serviceXML.getBytes(StandardCharsets.UTF_8));
String send = "";
try {
send = send(serviceXML);
out.print("返回=="+send);
}catch (Exception e){
out.print("异常=="+ e.getMessage());
}
// SocketClientUtil scketClient = new SocketClientUtil("14.1.76.116",10149);
// String substring = send.substring(0, 8);
// String substring1 = send.substring(8);
// out.print(substring);
// Map<String, String> map = XMLUtils.parseXMLToMap(send);
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("count", Util.getIntValue(map.get("count")));
// out.print(jsonObject.toJSONString());
%>
<%!
public String send(String request) throws Exception {
// bs.writeLog("Client Start...");
BaseBean bs = new BaseBean();
Socket socket = null;
try {
//创建一个流套接字并将其连接到指定主机上的指定端口号
socket = new Socket("14.1.209.146",8090);
// String str = "00000612<?xml version=\"1.0\" encoding=\"UTF-8\"?><Service><Service_Header><service_sn>1010157060000081243</service_sn><system_id>0258</system_id><requester_id>0157</requester_id><branch_id>010231100</branch_id><channel_id>01</channel_id><service_time>20230905104426</service_time><need_request>true</need_request><SvcCd>500130004</SvcCd><SvcScn>13</SvcScn><BnkSrlNo>015720230905060000081243</BnkSrlNo><FileFlg>0</FileFlg></Service_Header><Service_Body><request><path>todo</path><method>getCount</method><args><entry><key>userNum</key><value>10913026任广鹏是个大刷币</value></entry></args></request></Service_Body></Service>";
// System.out.println(str);
//读取服务器端数据
BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8));
//向服务器端发送数据
// PrintStream out = new PrintStream(new OutputStreamWriter(socket.getOutputStream(),StandardCharsets.UTF_8));
PrintWriter out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(),StandardCharsets.UTF_8),true);
out.println(request);
char[] datalen=new char[8];//报文前八位为报文体总长度
input.read(datalen,0,8);
String lendata=new String (datalen);
int length=Integer.parseInt(lendata);
new BaseBean().writeLog("报文长度"+length);
char[] data=new char[length];
int datalength = input.read(data,0,length);
String requestData = new String(data);
new BaseBean().writeLog("requestData",requestData);
// String ret = input.readLine();
System.out.println("服务器端返回过来的是: " + requestData);
bs.writeLog("服务器端返回过来的是: " + requestData);
// 如接收到 "OK" 则断开连接
if (!StringUtil.isEmpty(requestData)) {
bs.writeLog("客户端将关闭连接");
System.out.println("客户端将关闭连接: " + requestData);
Thread.sleep(500);
}
out.close();
input.close();
return requestData;
} catch (Exception e) {
bs.writeLog("客户端异常:" + e.getMessage());
throw e;
} finally {
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
socket = null;
bs.writeLog("客户端 finally 异常:" + e.getMessage());
}
}
}
// return "-1";
}
public static String generateTimestamp() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date currentDate = new Date();
return dateFormat.format(currentDate);
}
%>

@ -29,14 +29,14 @@
//请休假审批单-总行部门副职 formtable_main_214
//差旅审批单-总行员工正式 formtable_main_217
//测试环境的
String ZZform = "formtable_main_213";
String FZform = "formtable_main_214";
String YGform = "formtable_main_217";
// String ZZform = "formtable_main_213";
// String FZform = "formtable_main_214";
// String YGform = "formtable_main_217";
//生产环境的
// String ZZform = "formtable_main_214";
// String FZform = "formtable_main_215";
// String YGform = "formtable_main_292";
String ZZform = "formtable_main_214";
String FZform = "formtable_main_215";
String YGform = "formtable_main_292";
String sql = "select main.*,req.*,record.workflowcode from ";
if ("0".equals(type)){
sql += ZZform;
@ -80,8 +80,8 @@
// out.print(requestid.toString());
//查看变更单是否有对冲突时间流程的修改
String querybgdsql = "select * from formtable_main_282 where id = " +
"(select max(id) from formtable_main_282 where dcyslc = ? )";
String querybgdsql = "select * from formtable_main_293 where id = " +
"(select max(id) from formtable_main_293 where dcyslc = ? )";
ArrayList<String> requestidNew = new ArrayList<>();
for (String rid : requestid) {
recordSet.executeQuery(querybgdsql,rid);
@ -109,7 +109,7 @@
requestid = requestidNew;
//再查询下变更表里有没有变更后冲突的数据
String queryBGBSql = "select main.*,req.*,record.workflowcode from formtable_main_282 main left join workflow_requestBase base " +
String queryBGBSql = "select main.*,req.*,record.workflowcode from formtable_main_293 main left join workflow_requestBase base " +
"on main.requestid = base.requestid " +
" left join workflow_codeseqrecord record on main.REQUESTID = record.REQUESTID " +
"where dcyslc not in ( " +String.join(",",requestid)+" ) " +

@ -35,6 +35,9 @@
//在审批状态
sql += "and req.currentnodetype != 0 ";
sql += "and req.REQUESTID != ? ";
// out.print(sql);
RecordSet recordSet = new RecordSet();
recordSet.executeQuery(sql,sqr,endDate,startDate,reqid);
writeLog(sql,sqr,endDate,startDate,reqid);
@ -144,7 +147,7 @@
public static boolean isOverlapping(String start1, String end1, String start2, String end2) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
try {
LocalDateTime dateTimeStart1 = LocalDateTime.parse(start1, formatter);
LocalDateTime dateTimeEnd1 = LocalDateTime.parse(end1, formatter);

@ -4,34 +4,116 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
out.print("<br/>关键词更新开始执行");
String execute = execute();
out.print(execute);
out.print("<br/>关键词更新结束");
%>
<%!
public void execute() {
RecordSetDataSource em7rs = new RecordSetDataSource("em7");
RecordSetDataSource emprs = new RecordSetDataSource("emp_msg");
RecordSet rs = new RecordSet();
RecordSet rs2 = new RecordSet();
RecordSet rs3 = new RecordSet();
String roleMember = ReportUtil.getRoleMember(rs);
updateRoleGjc(rs,roleMember);
updateGjcOfficialWf(rs);
public String execute() {
RecordSetDataSource em7rs = new RecordSetDataSource("em7");
RecordSetDataSource emprs = new RecordSetDataSource("emp_msg");
RecordSet rs = new RecordSet();
RecordSet rs2 = new RecordSet();
RecordSet rs3 = new RecordSet();
String roleMember = ReportUtil.getRoleMember(rs);
String out = "";
int i = updateRoleGjc(rs, roleMember);
out = out + "<br/>updateRoleGjc==>" + i;
int i1 = updateGjcOfficialWf(rs, 200);
out = out + "<br/>updateGjcOfficialWf==>" + i1;
int i2 = updateGjcAffairsWf(rs, 200);
out = out + "<br/>updateGjcAffairsWf==>" + i2;
int i3 = updateGjcBusinessWf(rs, 200);
out = out + "<br/>updateGjcBusinessWf==>" + i3;
int i4 = updateGjcShareDoc(rs, 200);
out = out + "<br/>updateGjcShareDoc==>" + i4;
int i5 = updateGjcMeeting(rs, 200);
out = out + "<br/>updateGjcMeeting==>" + i5;
int i6 = updateGjcLogin(rs, 200);
out = out + "<br/>updateGjcLogin==>" + i6;
int i7 = updateGjcMsg(rs, 200);
out = out + "<br/>updateGjcMsg==>" + i7;
int i8 = updateGjcNull(rs);
out = out + "<br/>updateGjcNull==>" + i8;
return out;
}
private void updateRoleGjc(RecordSet rs, String roleMember) {
rs.executeUpdate(" update uf_personreport set gjc = '统筹全局' where ry in ( " + roleMember + ")" );
private int updateRoleGjc(RecordSet rs, String roleMember) {
rs.executeUpdate(" update uf_personreport set gjc = '统筹全局' where ry in ( " + roleMember + ")");
return rs.getUpdateCount();
}
//更新公文办理数前10的人
private void updateGjcOfficialWf(RecordSet rs ,int rownum ){
//更新公文办理数前10%的人
private int updateGjcOfficialWf(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '人形公文处理机' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY qnljclgw DESC) AS rank , * from uf_personreport where qnljclgw is not null and qnljclgw != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum );
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
public static void main(String[] args) {
//更新事务审批数前10%的人
private int updateGjcAffairsWf(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '宝藏事务挖掘机' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY grswsps DESC) AS rank , * from uf_personreport where grswsps is not null and grswsps != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
//更新商旅使用数前10%的人
private int updateGjcBusinessWf(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '走南闯北 遥遥领先' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY ljsyslcs DESC) AS rank , * from uf_personreport where ljsyslcs is not null and ljsyslcs != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum+ ")");
return rs.getUpdateCount();
}
//更新分享文档数前10%的人
private int updateGjcShareDoc(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '知识分享之光' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY grwdgx DESC) AS rank , * from uf_personreport where grwdgx is not null and grwdgx != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
//更新创建会议数前10%的人
private int updateGjcMeeting(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '会议守护者' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY grhycycs DESC) AS rank , * from uf_personreport where grhycycs is not null and grhycycs != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
//更新登录次数前10%的人
private int updateGjcLogin(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '智慧OA最亲密的朋友' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY ljdloacs DESC) AS rank , * from uf_personreport where ljdloacs is not null and ljdloacs != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
//更新聊天次数前10%的人
private int updateGjcMsg(RecordSet rs, int rownum) {
rs.executeUpdate(" update uf_personreport set gjc = '社交天花板' where id in( " +
" select rk.id from ( " +
" select ROW_NUMBER() OVER (ORDER BY grcylts DESC) AS rank , * from uf_personreport where grcylts is not null and grcylts != 0 and gjc is null" +
" ) rk where rk.rank < " + rownum + ")");
return rs.getUpdateCount();
}
//无关键词的人
private int updateGjcNull(RecordSet rs) {
rs.executeUpdate(" update uf_personreport set gjc = '智慧OA探索家' where gjc = '' or gjc is null");
return rs.getUpdateCount();
}
%>

@ -0,0 +1,55 @@
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%@ page import="java.util.regex.Pattern" %>
<%@ page import="java.util.regex.Matcher" %>
<%@ page import="java.io.*" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="org.apache.http.impl.client.CloseableHttpClient" %>
<%@ page import="org.apache.http.impl.client.HttpClients" %>
<%@ page import="org.apache.http.client.methods.HttpPost" %>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="org.apache.http.entity.StringEntity" %>
<%@ page import="org.apache.http.client.methods.CloseableHttpResponse" %>
<%@ page import="org.apache.http.HttpStatus" %>
<%@ page import="org.apache.http.HttpEntity" %>
<%@ page import="org.apache.http.util.EntityUtils" %>
<%@ page import="org.apache.http.client.ClientProtocolException" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="java.net.URL" %>
<%@ page import="java.net.HttpURLConnection" %>
<%@ page import="org.apache.http.HttpException" %>
<%@ page import="org.apache.http.client.HttpClient" %>
<%@ page import="org.apache.commons.httpclient.methods.PostMethod" %>
<%@ page import="org.apache.commons.httpclient.params.HttpMethodParams" %>
<%@ page import="org.apache.http.NameValuePair" %>
<%@ page import="org.apache.http.message.BasicNameValuePair" %>
<%@ page import="org.apache.http.client.entity.UrlEncodedFormEntity" %>
<%@ page import="weaver.rsa.security.RSA" %>
<%@ page import="java.security.interfaces.RSAPublicKey" %>
<%@ page import="java.security.KeyFactory" %>
<%@ page import="java.security.spec.X509EncodedKeySpec" %>
<%@ page import="javax.crypto.Cipher" %>
<%@ page import="org.apache.commons.codec.binary.Base64" %>
<%@ page import="java.nio.charset.StandardCharsets" %>
<%@ page import="org.apache.http.impl.client.HttpClientBuilder" %>
<%@ page import="org.apache.http.client.methods.HttpGet" %>
<%@ page import="com.engine.common.util.ParamUtil" %>
<%@ page import="com.wbi.util.StringUtil" %>
<%@ page import="org.json.JSONException" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
response.sendError(500,"报错测试");
%>
<%!
%>

@ -70,7 +70,7 @@
Socket socket = null;
try {
//创建一个流套接字并将其连接到指定主机上的指定端口号
socket = new Socket("14.1.78.197",10149);
socket = new Socket("14.1.71.90",10149);
// String str = "00000612<?xml version=\"1.0\" encoding=\"UTF-8\"?><Service><Service_Header><service_sn>1010157060000081243</service_sn><system_id>0258</system_id><requester_id>0157</requester_id><branch_id>010231100</branch_id><channel_id>01</channel_id><service_time>20230905104426</service_time><need_request>true</need_request><SvcCd>500130004</SvcCd><SvcScn>13</SvcScn><BnkSrlNo>015720230905060000081243</BnkSrlNo><FileFlg>0</FileFlg></Service_Header><Service_Body><request><path>todo</path><method>getCount</method><args><entry><key>userNum</key><value>10913026任广鹏是个大刷币</value></entry></args></request></Service_Body></Service>";
// System.out.println(str);
//读取服务器端数据

@ -70,7 +70,7 @@
Socket socket = null;
try {
//创建一个流套接字并将其连接到指定主机上的指定端口号
socket = new Socket("14.1.78.197",10149);
socket = new Socket("14.1.71.90",10149);
// String str = "00000612<?xml version=\"1.0\" encoding=\"UTF-8\"?><Service><Service_Header><service_sn>1010157060000081243</service_sn><system_id>0258</system_id><requester_id>0157</requester_id><branch_id>010231100</branch_id><channel_id>01</channel_id><service_time>20230905104426</service_time><need_request>true</need_request><SvcCd>500130004</SvcCd><SvcScn>13</SvcScn><BnkSrlNo>015720230905060000081243</BnkSrlNo><FileFlg>0</FileFlg></Service_Header><Service_Body><request><path>todo</path><method>getCount</method><args><entry><key>userNum</key><value>10913026任广鹏是个大刷币</value></entry></args></request></Service_Body></Service>";
// System.out.println(str);
//读取服务器端数据

@ -54,6 +54,7 @@
<%@ page import="okhttp3.*" %>
<%@ page import="javax.servlet.http.Cookie" %>
<%@ page import="weaver.file.Prop" %>
<%@ page import="com.alibaba.fastjson.JSONException" %>
<%!
//获取分页sql
public static String getPaginationSql(String sql, String orderby, int pageNo, int pageSize) {
@ -705,6 +706,13 @@
if(stMsg.has("ST")){
ST = Util.null2String(stMsg.get("ST").toString());
}else{
try {
if (stMsg.has("errorCode")&&"2009".equals(stMsg.getString("errorCode"))){
response.sendRedirect("https://office.bankoftianjin.com/interface/transfer/mobile/noPermissons2.html");
}
} catch (JSONException e) {
bb.writeLog(e);
}
out.print(Util.null2String(stMsg.getString("message")));
return;
}
@ -800,6 +808,13 @@
if(stMsg.has("ST")){
ST = Util.null2String(stMsg.get("ST").toString());
}else{
try {
if (stMsg.has("errorCode")&&"2009".equals(stMsg.getString("errorCode"))){
response.sendRedirect("https://office.bankoftianjin.com/interface/transfer/mobile/noPermissons2.html");
}
} catch (JSONException e) {
bb.writeLog(e);
}
out.print(Util.null2String(stMsg.getString("message")));
return;
}

@ -15,7 +15,6 @@ import weaver.general.StringUtil;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.general.BaseBean;
import weaver.interfaces.workflow.action.WorkflowToDoc;
import weaver.soa.workflow.request.RequestInfo;
import java.io.*;
@ -26,6 +25,7 @@ import java.util.*;
/**
* (
*
*/
public class Action20230911062023 extends BaseBean implements Action {
/**
@ -33,7 +33,6 @@ public class Action20230911062023 extends BaseBean implements Action {
*/
@Override
public String execute(RequestInfo request) {
new WorkflowToDoc().execute(request);
writeLog("推送商旅节点后附加操作====>");
// if(error) {
// request.getRequestManager().setMessageid("90001");
@ -79,7 +78,7 @@ public class Action20230911062023 extends BaseBean implements Action {
writeLog("serviceXML==="+ serviceXML);
// serviceXML = new String(serviceXML.getBytes(StandardCharsets.UTF_8));
writeLog("UTF_8_serviceXML==="+ serviceXML);
SocketClientUtil scketClient = new SocketClientUtil("14.1.78.197",10149);
SocketClientUtil scketClient = new SocketClientUtil("14.1.76.116",10149);
String send = scketClient.send(serviceXML);
String substring = send.substring(0, 8);
String substring1 = send.substring(8);
@ -114,9 +113,18 @@ public class Action20230911062023 extends BaseBean implements Action {
String imageFileName = ifm.getImageFileName();
writeLog("imageFileName"+imageFileName);
String[] filename = imageFileName.split("\\.");
int lastIndex = imageFileName.lastIndexOf('.');
String part1 = "";
String part2 = "";
if (lastIndex != -1) {
part1 = imageFileName.substring(0, lastIndex);
part2 = imageFileName.substring(lastIndex + 1);
}else {
part1 = imageFileName;
}
String tempFilePath = "";
try {
File tempFile = File.createTempFile(filename[0],filename.length ==2 ?filename[1]:"");
File tempFile = File.createTempFile(part1,part2.length() == 0 ? "" :part2);
// 创建一个输出流,将数据写入临时文件
OutputStream outputStream = new FileOutputStream(tempFile);
@ -135,7 +143,7 @@ public class Action20230911062023 extends BaseBean implements Action {
}catch (Exception e){
e.printStackTrace();
writeLog( "创建本地文件异常"+e.getMessage());
throw new Exception("创建本地文件异常");
throw new Exception("创建"+imageFileName+"文件异常"+e.getMessage());
}
//推送ESB服务器
String ftpPath = "";
@ -168,7 +176,7 @@ public class Action20230911062023 extends BaseBean implements Action {
//OA差旅报销单单据编号
toEsbBean.setOaTrvlBnsExpnsAcctNo(rs.getString(Util.null2String("djbh")));
//经办人工号
toEsbBean.setOperatorNo(Util.null2String(rs.getString("jbrgh")));
toEsbBean.setOperatorNo(processString(Util.null2String(rs.getString("jbrgh"))));
//经办人姓名 id
toEsbBean.setOperatorName(Util.null2String(rs.getString("jbrxm")));
String lastname = new User(Util.getIntValue(toEsbBean.getOperatorName())).getLastname();
@ -178,6 +186,8 @@ public class Action20230911062023 extends BaseBean implements Action {
toEsbBean.setAcsryNums(Util.null2String(rs.getString("fjzs")));
//报销金额
toEsbBean.setExpnsAmt(multiply100(Util.null2String(rs.getString("bxjedwf"))));
toEsbBean.setCostDeptCode((Util.null2String(rs.getString("cbzxbm"))));
toEsbBean.setCostDeptHame((Util.null2String(rs.getString("cbzxmc"))));
//报销事由 Jsoup.parse(htmlContent).text()
String expnsRsn = Util.null2String(rs.getString("bxsy"));
String text = Jsoup.parse(expnsRsn).text();
@ -186,12 +196,18 @@ public class Action20230911062023 extends BaseBean implements Action {
toEsbBean.setRemark(Util.null2String(rs.getString("bz")));
fj = Util.null2String(rs.getString("fj"));
spdfj = Util.null2String(rs.getString("spdfj"));
spwhscpdfwj = Util.null2String(rs.getString("spwhscpdfwj"));
// spwhscpdfwj = Util.null2String(rs.getString("clspdpdffj"));
spwhscpdfwj = Util.null2String(rs.getString("spdfj"));
// String formData = rs.getString("formData");
}
// 封装文件数组
//现在是id
List<String> fjids = new ArrayList<>( Arrays.asList(fj.split(",")));
List<String> fjids;
if(!StringUtil.isEmpty(fj)){
fjids = new ArrayList<>( Arrays.asList(fj.split(",")));
}else {
fjids = new ArrayList<>();
}
//
writeLog("fjids"+fjids);
try {
@ -326,16 +342,25 @@ public class Action20230911062023 extends BaseBean implements Action {
return "";
}
public static String processString(String input) {
// 检查字符串长度是否大于8
if (input.length() > 8) {
// 如果是,截取前八位
return input.substring(0, 8);
} else {
// 否则,返回原字符串
return input;
}
}
public static void main(String[] args) {
String htmlContent = "2023-10-05 07:00" ;
System.out.println(htmlContent.contains(" "));
if (htmlContent.indexOf(" ") == -1){
}
String imageFileName = "11.16天津-成都去程机票 (1).jpg";
int lastIndex = imageFileName.lastIndexOf('.');
String part1 = imageFileName.substring(0, lastIndex);
String part2 = imageFileName.substring(lastIndex + 1);
System.out.println(part1);
System.out.println(part2);
}

@ -122,6 +122,9 @@ public class Action20231015024217 extends BaseBean implements Action {
}else {
part1 = imageFileName;
}
if(part1.length()<=3){
part1 = part1+"文件";
}
String tempFilePath = "";
try {
File tempFile = File.createTempFile(part1,part2.length() == 0 ? "" :part2);

@ -0,0 +1,79 @@
package weaver.interfaces.workflow.action.javacode;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import weaver.conn.RecordSet;
import weaver.file.Prop;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.interfaces.workflow.action.Action;
import weaver.general.BaseBean;
import weaver.soa.workflow.request.RequestInfo;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
/**
* Online custom action interface
*/
public class Action20231221053557 extends BaseBean implements Action {
/**
* After selecting aciton after the process path node, this method will be executed after the node is submitted.
*/
@Override
public String execute(RequestInfo request) {
String requestid = request.getRequestid();
String billTableName = request.getRequestManager().getBillTableName();
String sqr = getsqrbyReqid(requestid, billTableName);
String bh = getBHbyreqId(requestid, billTableName);
sendMsgForSuccess(sqr,bh,Util.getIntValue(requestid));
return Action.SUCCESS;
}
private void sendMsgForSuccess(String userid, String oaTrvlBnsExpnsAcctNo, int requestid) {
MessageType messageType = MessageType.newInstance(1674); // 消息来源(见文档第四点补充 必填)
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
String[] useridArr = userid.split(",");
String proplinkUrl = Prop.getPropValue("subsidy_reminder", "linkUrl");
String proplinkMobileUrl = Prop.getPropValue("subsidy_reminder", "linkMobileUrl");
for (String s : useridArr) {
userIdList.add(s);
}
String title = "您有新的差旅补助到账,请您查收节点后"; // 标题
String context = "差补报销(" + oaTrvlBnsExpnsAcctNo + ")";
String linkUrl = StringUtil.isEmpty(proplinkUrl) ? "" : proplinkUrl + requestid; // PC端链接
String linkMobileUrl = StringUtil.isEmpty(proplinkMobileUrl) ? "" : proplinkMobileUrl + requestid; // 移动端链接
try {
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(1);// 创建人id
//message.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理
//messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入
Util_Message.store(messageBean);
} catch (IOException e) {
e.printStackTrace();
}
}
public String getsqrbyReqid(String requestid, String tableName) {
RecordSet recordSet = new RecordSet();
HashMap<String, String> resultMap = new HashMap<>();
String sql = "select jbrxm from " + tableName + " where requestid = ?";
recordSet.executeQuery(sql, requestid);
recordSet.next();
return Util.null2String(recordSet.getString("jbrxm"));
}
public String getBHbyreqId(String requestid, String tableName) {
RecordSet recordSet = new RecordSet();
HashMap<String, String> resultMap = new HashMap<>();
String sql = "select djbh from " + tableName + " where requestid = ?";
recordSet.executeQuery(sql, requestid);
recordSet.next();
return Util.null2String(recordSet.getString("djbh"));
}
}

@ -0,0 +1,85 @@
package weaver.interfaces.workflow.action.javacode;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import weaver.conn.RecordSet;
import weaver.file.Prop;
import weaver.general.StringUtil;
import weaver.general.Util;
import weaver.interfaces.workflow.action.Action;
import weaver.general.BaseBean;
import weaver.soa.workflow.request.RequestInfo;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
/**
* Online custom action interface
*/
public class Action20231221085819 extends BaseBean implements Action {
/**
* After selecting aciton after the process path node, this method will be executed after the node is submitted.
*/
@Override
public String execute(RequestInfo request) {
try {
String requestid = request.getRequestid();
String billTableName = request.getRequestManager().getBillTableName();
String sqr = getsqrbyReqid(requestid, billTableName);
String bh = getBHbyreqId(requestid, billTableName);
sendMsgForSuccess(sqr,bh,Util.getIntValue(requestid));
}catch (Exception e){
e.printStackTrace();
writeLog("补助提醒异常"+e.getMessage());
}
return Action.SUCCESS;
}
private void sendMsgForSuccess(String userid, String oaTrvlBnsExpnsAcctNo, int requestid) {
MessageType messageType = MessageType.newInstance(1371); // 消息来源(见文档第四点补充 必填)
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
String[] useridArr = userid.split(",");
String proplinkUrl = Prop.getPropValue("subsidy_reminder", "linkUrl");
String proplinkMobileUrl = Prop.getPropValue("subsidy_reminder", "linkMobileUrl");
for (String s : useridArr) {
userIdList.add(s);
}
String title = "您有新的差旅补助到账,请您查收"; // 标题
String context = "差补报销(" + oaTrvlBnsExpnsAcctNo + ")";
String linkUrl = "/spa/workflow/static4form/index.html#/main/workflow/req?requestid=" + requestid; // PC端链接
String linkMobileUrl = "/spa/workflow/static4mobileform/index.html#/req?requestid=" + requestid; // 移动端链接
try {
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(1);// 创建人id
//message.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理
//messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入
Util_Message.store(messageBean);
} catch (IOException e) {
e.printStackTrace();
}
}
public String getsqrbyReqid(String requestid, String tableName) {
RecordSet recordSet = new RecordSet();
HashMap<String, String> resultMap = new HashMap<>();
String sql = "select jbrxm from " + tableName + " where requestid = ?";
recordSet.executeQuery(sql, requestid);
recordSet.next();
return Util.null2String(recordSet.getString("jbrxm"));
}
public String getBHbyreqId(String requestid, String tableName) {
RecordSet recordSet = new RecordSet();
HashMap<String, String> resultMap = new HashMap<>();
String sql = "select djbh from " + tableName + " where requestid = ?";
recordSet.executeQuery(sql, requestid);
recordSet.next();
return Util.null2String(recordSet.getString("djbh"));
}
}
Loading…
Cancel
Save