no message
parent
f61836144b
commit
988222e450
@ -0,0 +1,12 @@
|
|||||||
|
package com.api.tjbk;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.web.meeting.NewMeet;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
@Path("/oameeting")
|
||||||
|
public class TJBKMeetWeb extends NewMeet
|
||||||
|
{
|
||||||
|
}
|
@ -1,20 +1,64 @@
|
|||||||
package com.engine.custom.corn;
|
package com.engine.custom.corn;
|
||||||
|
|
||||||
|
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.conn.RecordSet;
|
||||||
import weaver.general.BaseBean;
|
import weaver.general.BaseBean;
|
||||||
import weaver.interfaces.schedule.BaseCronJob;
|
import weaver.interfaces.schedule.BaseCronJob;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class WeekReportCorn extends BaseCronJob {
|
public class WeekReportCorn extends BaseCronJob {
|
||||||
|
private String userid = "";
|
||||||
BaseBean baseBean = new BaseBean();
|
BaseBean baseBean = new BaseBean();
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
RecordSet recordSet = new RecordSet();
|
RecordSet recordSet = new RecordSet();
|
||||||
|
int startNum = 0;
|
||||||
|
int endNum = 0;
|
||||||
|
recordSet.executeQuery("select count(1) cnt from xlbb_grzbzz_xda");
|
||||||
|
recordSet.next();
|
||||||
|
startNum = recordSet.getInt("cnt");
|
||||||
recordSet.executeUpdate("insert into xlbb_grzbzz_xda(userid,depid,lczs,ybsl, pjhs, zdhs, zxhs, dbcount, dbzchs , pm,insertdate)select userid,depid,lczs,ybsl,round(pjhs,4) as pjhs,zdhs,zxhs,dbcount,dbzchs ,pm ,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as insertdate from xlbb_grzbzz_xda_view");
|
recordSet.executeUpdate("insert into xlbb_grzbzz_xda(userid,depid,lczs,ybsl, pjhs, zdhs, zxhs, dbcount, dbzchs , pm,insertdate)select userid,depid,lczs,ybsl,round(pjhs,4) as pjhs,zdhs,zxhs,dbcount,dbzchs ,pm ,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as insertdate from xlbb_grzbzz_xda_view");
|
||||||
writeLog("执行sql=====>insert into xlbb_grzbzz_xda(userid,depid,lczs,ybsl, pjhs, zdhs, zxhs, dbcount, dbzchs , pm,insertdate)select userid,depid,lczs,ybsl,round(pjhs,4) as pjhs,zdhs,zxhs,dbcount,dbzchs ,pm ,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as insertdate from xlbb_grzbzz_xda_view");
|
writeLog("执行sql=====>insert into xlbb_grzbzz_xda(userid,depid,lczs,ybsl, pjhs, zdhs, zxhs, dbcount, dbzchs , pm,insertdate)select userid,depid,lczs,ybsl,round(pjhs,4) as pjhs,zdhs,zxhs,dbcount,dbzchs ,pm ,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as insertdate from xlbb_grzbzz_xda_view");
|
||||||
|
recordSet.executeQuery("select count(1) cnt from xlbb_grzbzz_xda");
|
||||||
|
recordSet.next();
|
||||||
|
endNum = recordSet.getInt("cnt");
|
||||||
|
|
||||||
writeLog("执行sql数量=====>"+recordSet.getCounts());
|
writeLog("执行sql数量=====>"+recordSet.getCounts());
|
||||||
|
sendMsg(startNum,endNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeLog(String log){
|
private void writeLog(String log){
|
||||||
baseBean.writeLog(log);
|
baseBean.writeLog(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendMsg(int startNum ,int endNum){
|
||||||
|
MessageType messageType = MessageType.newInstance(1157); // 消息来源(见文档第四点补充 必填)
|
||||||
|
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
|
||||||
|
String[] useridArr = userid.split(",");
|
||||||
|
for (String s : useridArr) {
|
||||||
|
userIdList.add(s);
|
||||||
|
}
|
||||||
|
String title = "个人周报更新提醒"; // 标题
|
||||||
|
String context = "本次周报新增"+(endNum-startNum)+";" +
|
||||||
|
"更新前总数"+startNum+";" +
|
||||||
|
"更新后总数"+endNum+";"; // 内容
|
||||||
|
String linkUrl = ""; // PC端链接
|
||||||
|
String linkMobileUrl = ""; // 移动端链接
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,263 @@
|
|||||||
|
package com.engine.custom.yunxuetang;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import com.engine.custom.yunxuetang.bean.DeptRequestBody;
|
||||||
|
import com.engine.custom.yunxuetang.bean.JobRequestBody;
|
||||||
|
import com.engine.custom.yunxuetang.bean.JobTypeRequestBody;
|
||||||
|
import com.engine.custom.yunxuetang.bean.ResponseData;
|
||||||
|
import com.engine.custom.yunxuetang.util.HttpClientUtil;
|
||||||
|
import com.engine.custom.yunxuetang.util.SyncUtil;
|
||||||
|
import com.weaver.general.Util;
|
||||||
|
import okhttp3.*;
|
||||||
|
import weaver.conn.BatchRecordSet;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.GCONST;
|
||||||
|
import weaver.general.StringUtil;
|
||||||
|
import weaver.hrm.job.JobActivitiesComInfo;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
//查询未封存的分部 数量不大暂不分页
|
||||||
|
public static final String querySubsql = "select ID,SUBCOMPANYNAME,SHOWORDER,SUBCOMPANYCODE from hrmsubcompany where CANCELED is null or CANCELED != 1";
|
||||||
|
//更新分部云学堂id
|
||||||
|
public static final String updateSubyxtid = "update hrmsubcompanydefined set yxtid = ? where subcomid = ?";
|
||||||
|
//查询部门等级sql
|
||||||
|
public static final String queryDeptLevelsql = "select TLEVEL level from HRMDEPARTMENT group by TLEVEL";
|
||||||
|
//根据层级获取对应层级的总数
|
||||||
|
public static final String queryDeptLevelCountsql = "select count(*) cnt from HRMDEPARTMENT where TLEVEL = ?";
|
||||||
|
//查询某级部门
|
||||||
|
public static final String queryDeptsql = "select dept.* from (" +
|
||||||
|
" select id , DEPARTMENTNAME ,DEPARTMENTCODE ,SUBCOMPANYID1 , SUPDEPID,SHOWORDER, " +
|
||||||
|
" ROW_NUMBER() OVER (ORDER BY SHOWORDER) AS rn from HRMDEPARTMENT where TLEVEL = ? " +
|
||||||
|
" ) dept WHERE dept.rn BETWEEN ? AND ? ";
|
||||||
|
//查询删除的部门
|
||||||
|
public static final String queryDelDeptsql = "select id from HRMDEPARTMENT where CANCELED = 1 order by TLEVEL desc";
|
||||||
|
// public static final String queryDelDeptsql = "select id from HRMDEPARTMENT order by TLEVEL desc";
|
||||||
|
//查询删除的分部
|
||||||
|
public static final String queryDelSubsql = "select id from HRMSUBCOMPANY where CANCELED = 1 order by TLEVEL desc";
|
||||||
|
// public static final String queryDelSubsql = "select id from HRMSUBCOMPANY order by TLEVEL desc";
|
||||||
|
//查询岗位分类
|
||||||
|
public static final String queryJobTypesql = "select * from hrmjobactivities";
|
||||||
|
//查询岗位
|
||||||
|
public static final String queryJobsql = "select * from hrmjobtitles";
|
||||||
|
public static final char Separator = Util.getSeparator();
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String rootPath = "D:\\WEAVER2\\ecology\\";
|
||||||
|
GCONST.setRootPath(rootPath);
|
||||||
|
GCONST.setServerName("ecology");
|
||||||
|
// Test test = new Test();
|
||||||
|
//同步部门成功,开始调用删除部门接口同步封存部门
|
||||||
|
// test.syncDeptList();
|
||||||
|
//先删除部门再删除分部
|
||||||
|
// test.deldept();
|
||||||
|
//同步岗位类型 防止有同名岗位
|
||||||
|
// test.syncJobTypeList();
|
||||||
|
//同步岗位
|
||||||
|
// test.syncJobList();
|
||||||
|
JobActivitiesComInfo jobActivitiesComInfo = new JobActivitiesComInfo();
|
||||||
|
jobActivitiesComInfo.getJobActivitiesname();
|
||||||
|
// boolean next = jobActivitiesComInfo.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void syncDeptList() {
|
||||||
|
//同步分部作为一级部门
|
||||||
|
//获取分部beanList
|
||||||
|
SyncUtil syncUtil = new SyncUtil();
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
BatchRecordSet batchRecordSet = new BatchRecordSet();
|
||||||
|
List<DeptRequestBody> subcompanyList = getSubcompanyList(recordSet);
|
||||||
|
List<String> updatesubcompanyList = new ArrayList<>();
|
||||||
|
//推送数据云学堂
|
||||||
|
for (DeptRequestBody deptRequestBody : subcompanyList) {
|
||||||
|
ResponseData responseData = syncUtil.syncDept(deptRequestBody);
|
||||||
|
System.out.println("responseData"+responseData);
|
||||||
|
String yxtid = responseData.getData().getString("id");
|
||||||
|
updatesubcompanyList.add(yxtid+Separator+deptRequestBody.getThirdId());
|
||||||
|
System.out.println("sql==="+yxtid+Separator+deptRequestBody.getThirdId());
|
||||||
|
}
|
||||||
|
batchRecordSet.executeSqlBatchNew(updateSubyxtid,updatesubcompanyList);
|
||||||
|
//同步部门(从一级开始同步,查询一共几级部门,按顺序推送)
|
||||||
|
ArrayList<Integer> levelList = new ArrayList<>();
|
||||||
|
recordSet.executeQuery(queryDeptLevelsql);
|
||||||
|
while (recordSet.next()){
|
||||||
|
int level = Util.getIntValue(recordSet.getString("level"),2);
|
||||||
|
levelList.add(level);
|
||||||
|
}
|
||||||
|
Collections.sort(levelList);
|
||||||
|
//去重,一般不会有这个问题
|
||||||
|
List<Integer> listWithoutDuplicates = new ArrayList<>(new LinkedHashSet<>(levelList));
|
||||||
|
//禁止在循环中创建recordSet对象,防止连接溢出
|
||||||
|
for (int i = 0; i < listWithoutDuplicates.size(); i++) {
|
||||||
|
int total = getTotalRecords(recordSet, listWithoutDuplicates.get(i));
|
||||||
|
int pageSize = 200;
|
||||||
|
int totalPages = (int) Math.ceil((double) total / pageSize);
|
||||||
|
if (i == 0) {
|
||||||
|
//level为2的作为2级部门,上级部门字段为分部
|
||||||
|
for (int pageIndex = 0; pageIndex < totalPages; pageIndex++) {
|
||||||
|
List<DeptRequestBody> pageData = getDeptList(listWithoutDuplicates.get(i),recordSet,pageIndex, pageSize);
|
||||||
|
for (DeptRequestBody deptRequestBody : pageData) {
|
||||||
|
ResponseData responseData = syncUtil.syncDept(deptRequestBody);
|
||||||
|
System.out.println("deptRequestBody===>"+deptRequestBody);
|
||||||
|
System.out.println("responseData===>"+responseData);
|
||||||
|
responseData.getData().getString("id");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//level大于2的上级部门为oa原上级部门
|
||||||
|
for (int pageIndex = 0; pageIndex < totalPages; pageIndex++) {
|
||||||
|
List<DeptRequestBody> pageData = getDeptList(listWithoutDuplicates.get(i),recordSet,pageIndex, pageSize);
|
||||||
|
for (DeptRequestBody deptRequestBody : pageData) {
|
||||||
|
ResponseData responseData = syncUtil.syncDept(deptRequestBody);
|
||||||
|
System.out.println("deptRequestBody===>"+deptRequestBody);
|
||||||
|
System.out.println("responseData===>"+responseData);
|
||||||
|
responseData.getData().getString("id");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DeptRequestBody> getSubcompanyList(RecordSet recordSet){
|
||||||
|
recordSet.executeQuery(querySubsql);
|
||||||
|
ArrayList<DeptRequestBody> subcompanyList = new ArrayList<>();
|
||||||
|
while (recordSet.next()){
|
||||||
|
DeptRequestBody deptRequestBody = new DeptRequestBody();
|
||||||
|
//三方id
|
||||||
|
deptRequestBody.setThirdId(Util.null2String("sub_"+recordSet.getString("ID")));
|
||||||
|
//分部名称
|
||||||
|
deptRequestBody.setName(Util.null2String(recordSet.getString("SUBCOMPANYNAME")));
|
||||||
|
//排序
|
||||||
|
deptRequestBody.setOrderIndex(Util.getIntValue(recordSet.getString("SHOWORDER")));
|
||||||
|
//编码
|
||||||
|
deptRequestBody.setCode(Util.null2String(recordSet.getString("SUBCOMPANYCODE")));
|
||||||
|
subcompanyList.add(deptRequestBody);
|
||||||
|
}
|
||||||
|
return subcompanyList;
|
||||||
|
};
|
||||||
|
|
||||||
|
private List<DeptRequestBody> getDeptList(Integer level, RecordSet recordSet ,int pageIndex, int pageSize) {
|
||||||
|
ArrayList<DeptRequestBody> deptRequestBodyList = new ArrayList<>();
|
||||||
|
int start = pageIndex * pageSize + 1;
|
||||||
|
int end = start + pageSize - 1;
|
||||||
|
recordSet.executeQuery(queryDeptsql,level,start,end);
|
||||||
|
while (recordSet.next()){
|
||||||
|
DeptRequestBody deptRequestBody = new DeptRequestBody();
|
||||||
|
//三方id
|
||||||
|
deptRequestBody.setThirdId("dept_"+Util.null2String(recordSet.getString("ID")));
|
||||||
|
//分部名称
|
||||||
|
deptRequestBody.setName(Util.null2String(recordSet.getString("DEPARTMENTNAME")));
|
||||||
|
//排序
|
||||||
|
deptRequestBody.setOrderIndex(Util.getIntValue(recordSet.getString("SHOWORDER")));
|
||||||
|
//编码
|
||||||
|
deptRequestBody.setCode(Util.null2String(recordSet.getString("DEPARTMENTCODE")));
|
||||||
|
String supdepid = Util.null2String(recordSet.getString("SUPDEPID"));
|
||||||
|
if ("0".equals(supdepid)|| StringUtil.isEmpty(supdepid)){
|
||||||
|
deptRequestBody.setParentThirdId("sub_"+Util.null2String(recordSet.getString("SUBCOMPANYID1")));
|
||||||
|
}else {
|
||||||
|
deptRequestBody.setParentThirdId("dept_"+supdepid);
|
||||||
|
}
|
||||||
|
deptRequestBodyList.add(deptRequestBody);
|
||||||
|
}
|
||||||
|
return deptRequestBodyList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取对应层级总数
|
||||||
|
public static int getTotalRecords(RecordSet recordSet , int level) {
|
||||||
|
recordSet.executeQuery(queryDeptLevelCountsql,level);
|
||||||
|
recordSet.next();
|
||||||
|
return recordSet.getInt("cnt");
|
||||||
|
}
|
||||||
|
//删除部门
|
||||||
|
public void deldept() {
|
||||||
|
SyncUtil syncUtil = new SyncUtil();
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
recordSet.executeQuery(queryDelDeptsql);
|
||||||
|
while (recordSet.next()){
|
||||||
|
syncUtil.syncDelDept("dept_"+recordSet.getString("id"));
|
||||||
|
}
|
||||||
|
recordSet.executeQuery(queryDelSubsql);
|
||||||
|
while (recordSet.next()){
|
||||||
|
syncUtil.syncDelDept("sub_"+recordSet.getString("id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void syncJobList() {
|
||||||
|
SyncUtil syncUtil = new SyncUtil();
|
||||||
|
ArrayList<JobRequestBody> jobRequestBodyList = getJobRequestBodyList();
|
||||||
|
for (JobRequestBody jobRequestBody : jobRequestBodyList) {
|
||||||
|
syncUtil.syncJobs(jobRequestBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void syncJobTypeList() {
|
||||||
|
SyncUtil syncUtil = new SyncUtil();
|
||||||
|
ArrayList<JobTypeRequestBody> jobTypeRequestBodyList = getJobTypeRequestBodyList();
|
||||||
|
for (JobTypeRequestBody jobTypeRequestBody : jobTypeRequestBodyList) {
|
||||||
|
syncUtil.syncJobType(jobTypeRequestBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取岗位
|
||||||
|
private ArrayList<JobRequestBody> getJobRequestBodyList() {
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
ArrayList<JobRequestBody> jobList = new ArrayList<>();
|
||||||
|
recordSet.executeQuery(queryJobsql);
|
||||||
|
|
||||||
|
while (recordSet.next()){
|
||||||
|
String id = recordSet.getString("id");
|
||||||
|
String jobtitlename = recordSet.getString("JOBTITLENAME");
|
||||||
|
JobRequestBody jobRequestBody = new JobRequestBody();
|
||||||
|
jobRequestBody.setThirdId(id);
|
||||||
|
jobRequestBody.setName(jobtitlename);
|
||||||
|
jobList.add(jobRequestBody);
|
||||||
|
}
|
||||||
|
return jobList;
|
||||||
|
}
|
||||||
|
// 获取岗位分类
|
||||||
|
private ArrayList<JobTypeRequestBody> getJobTypeRequestBodyList() {
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
ArrayList<JobTypeRequestBody> jobTypeList = new ArrayList<>();
|
||||||
|
recordSet.executeQuery(queryJobTypesql);
|
||||||
|
while (recordSet.next()){
|
||||||
|
String id = recordSet.getString("id");
|
||||||
|
String jobtitlename = recordSet.getString("JOBACTIVITYNAME");
|
||||||
|
JobTypeRequestBody jobTypeRequestBody = new JobTypeRequestBody();
|
||||||
|
jobTypeRequestBody.setThirdId(id);
|
||||||
|
jobTypeRequestBody.setName(jobtitlename);
|
||||||
|
jobTypeList.add(jobTypeRequestBody);
|
||||||
|
}
|
||||||
|
return jobTypeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String extractChinesePart(String input) {
|
||||||
|
// 正则表达式匹配 ~`~`数字 中文内容`~`数字 的模式
|
||||||
|
Pattern pattern = Pattern.compile("~`~`\\d+ ([\u4e00-\u9fa5]+)`~`");
|
||||||
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
return matcher.group(1); // 返回匹配的第一个分组,即中文内容
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.engine.custom.yunxuetang.bean;
|
||||||
|
|
||||||
|
public class DeptRequestBody {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String deptManagerThirdId;
|
||||||
|
private String description;
|
||||||
|
private int maxUserCount;
|
||||||
|
private String name;
|
||||||
|
private int orderIndex;
|
||||||
|
private String parentThirdId;
|
||||||
|
private boolean recoveryDeleted;
|
||||||
|
private String thirdId;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeptManagerThirdId() {
|
||||||
|
return deptManagerThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptManagerThirdId(String deptManagerThirdId) {
|
||||||
|
this.deptManagerThirdId = deptManagerThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxUserCount() {
|
||||||
|
return maxUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxUserCount(int maxUserCount) {
|
||||||
|
this.maxUserCount = maxUserCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOrderIndex() {
|
||||||
|
return orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderIndex(int orderIndex) {
|
||||||
|
this.orderIndex = orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentThirdId() {
|
||||||
|
return parentThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentThirdId(String parentThirdId) {
|
||||||
|
this.parentThirdId = parentThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRecoveryDeleted() {
|
||||||
|
return recoveryDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecoveryDeleted(boolean recoveryDeleted) {
|
||||||
|
this.recoveryDeleted = recoveryDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdId() {
|
||||||
|
return thirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdId(String thirdId) {
|
||||||
|
this.thirdId = thirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DeptRequestBody{" +
|
||||||
|
"code='" + code + '\'' +
|
||||||
|
", deptManagerThirdId='" + deptManagerThirdId + '\'' +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", maxUserCount=" + maxUserCount +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", orderIndex=" + orderIndex +
|
||||||
|
", parentThirdId='" + parentThirdId + '\'' +
|
||||||
|
", recoveryDeleted=" + recoveryDeleted +
|
||||||
|
", thirdId='" + thirdId + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,123 @@
|
|||||||
|
package com.engine.custom.yunxuetang.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class JobRequestBody {
|
||||||
|
|
||||||
|
private String catalogThirdId;
|
||||||
|
private String code;
|
||||||
|
private String description;
|
||||||
|
private String gradeThirdId;
|
||||||
|
private List<String> gradeThirdIds;
|
||||||
|
private int keyPosition;
|
||||||
|
private String name;
|
||||||
|
private int orderIndex;
|
||||||
|
private String requirement;
|
||||||
|
private String responsibility;
|
||||||
|
private String thirdId;
|
||||||
|
|
||||||
|
public String getCatalogThirdId() {
|
||||||
|
return catalogThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCatalogThirdId(String catalogThirdId) {
|
||||||
|
this.catalogThirdId = catalogThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGradeThirdId() {
|
||||||
|
return gradeThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGradeThirdId(String gradeThirdId) {
|
||||||
|
this.gradeThirdId = gradeThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getGradeThirdIds() {
|
||||||
|
return gradeThirdIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGradeThirdIds(List<String> gradeThirdIds) {
|
||||||
|
this.gradeThirdIds = gradeThirdIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getKeyPosition() {
|
||||||
|
return keyPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyPosition(int keyPosition) {
|
||||||
|
this.keyPosition = keyPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOrderIndex() {
|
||||||
|
return orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderIndex(int orderIndex) {
|
||||||
|
this.orderIndex = orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequirement() {
|
||||||
|
return requirement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequirement(String requirement) {
|
||||||
|
this.requirement = requirement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponsibility() {
|
||||||
|
return responsibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponsibility(String responsibility) {
|
||||||
|
this.responsibility = responsibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdId() {
|
||||||
|
return thirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdId(String thirdId) {
|
||||||
|
this.thirdId = thirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "JobRequestBody{" +
|
||||||
|
"catalogThirdId='" + catalogThirdId + '\'' +
|
||||||
|
", code='" + code + '\'' +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", gradeThirdId='" + gradeThirdId + '\'' +
|
||||||
|
", gradeThirdIds=" + gradeThirdIds +
|
||||||
|
", keyPosition=" + keyPosition +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", orderIndex=" + orderIndex +
|
||||||
|
", requirement='" + requirement + '\'' +
|
||||||
|
", responsibility='" + responsibility + '\'' +
|
||||||
|
", thirdId='" + thirdId + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.engine.custom.yunxuetang.bean;
|
||||||
|
|
||||||
|
public class JobTypeRequestBody {
|
||||||
|
private String name;
|
||||||
|
private int orderIndex;
|
||||||
|
private String parentThirdId;
|
||||||
|
private String thirdId;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOrderIndex() {
|
||||||
|
return orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderIndex(int orderIndex) {
|
||||||
|
this.orderIndex = orderIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentThirdId() {
|
||||||
|
return parentThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentThirdId(String parentThirdId) {
|
||||||
|
this.parentThirdId = parentThirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdId() {
|
||||||
|
return thirdId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdId(String thirdId) {
|
||||||
|
this.thirdId = thirdId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package com.engine.custom.yunxuetang.bean;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public class ResponseData {
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String msg;
|
||||||
|
private String subCode;
|
||||||
|
private String subMsg;
|
||||||
|
private JSONObject data;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ErrorResponse{" +
|
||||||
|
"code='" + code + '\'' +
|
||||||
|
", msg='" + msg + '\'' +
|
||||||
|
", subCode='" + subCode + '\'' +
|
||||||
|
", subMsg='" + subMsg + '\'' +
|
||||||
|
", data=" + data +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubCode() {
|
||||||
|
return subCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubCode(String subCode) {
|
||||||
|
this.subCode = subCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubMsg() {
|
||||||
|
return subMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubMsg(String subMsg) {
|
||||||
|
this.subMsg = subMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JSONObject getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(JSONObject data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,100 @@
|
|||||||
|
package com.engine.custom.yunxuetang.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
public class HttpClientUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以post方式调用第三方接口方法.
|
||||||
|
*
|
||||||
|
* @param pathUrl 请求接口地址.
|
||||||
|
* @param dataStr 请求参数.
|
||||||
|
* @param accessToken accessToken.
|
||||||
|
* @return str.
|
||||||
|
*/
|
||||||
|
public static String doPost(String pathUrl, String dataStr, String accessToken) {
|
||||||
|
|
||||||
|
// 请求参数转换为json字符串
|
||||||
|
// String dataStr = JSON.toJSONString(dataMap);
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
// 组装请求头信息
|
||||||
|
Map<String, String> header = new HashMap<>(2);
|
||||||
|
header.put("Content-Type", "application/json;charset=utf-8");
|
||||||
|
if (accessToken != null && accessToken.length() > 0) {
|
||||||
|
header.put("Authorization", accessToken);
|
||||||
|
}
|
||||||
|
OkHttpClient client = new OkHttpClient().newBuilder().build();
|
||||||
|
MediaType mediaType = MediaType.parse("application/json;charset=utf-8");
|
||||||
|
RequestBody body = RequestBody.create(mediaType, dataStr);
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(pathUrl) // 请求接口地址
|
||||||
|
.method("POST", body) // 设定请求的方法为"POST"
|
||||||
|
.headers(Headers.of(header)) // 请求头信息
|
||||||
|
.build();
|
||||||
|
Response response = client.newBuilder().readTimeout(300000L, TimeUnit.MILLISECONDS).build().newCall(request).execute();
|
||||||
|
result = response.body().string();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("执行包含头部的post请求,url:" + pathUrl + ",请求数据:" + dataStr + ",执行错误信息:" + e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以get方式调用第三方接口方法.
|
||||||
|
*
|
||||||
|
* @param pathUrl 请求接口地址.
|
||||||
|
* @param accessToken accessToken.
|
||||||
|
* @return str.
|
||||||
|
*/
|
||||||
|
public static String doGet(String pathUrl, String accessToken) {
|
||||||
|
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
// 组装请求头信息
|
||||||
|
Map<String, String> header = new HashMap<>(2);
|
||||||
|
header.put("Content-Type", "application/json;charset=utf-8");
|
||||||
|
if (accessToken != null && accessToken.length() > 0) {
|
||||||
|
header.put("Authorization", accessToken);
|
||||||
|
}
|
||||||
|
OkHttpClient client = new OkHttpClient().newBuilder().build();
|
||||||
|
// http创建的request对象默认是get请求
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(pathUrl) // 请求接口地址
|
||||||
|
.headers(Headers.of(header)) // 请求头信息
|
||||||
|
.build();
|
||||||
|
Response response = client.newBuilder().readTimeout(300000L, TimeUnit.MILLISECONDS).build().newCall(request).execute();
|
||||||
|
result = response.body().string();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("执行包含头部的get请求,url:" + pathUrl + ",执行错误信息:" + e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取accessToken
|
||||||
|
public static String getAccessToken(String url,String appId,String appSecret) {
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
String dataStr = JSON.toJSONString(body);
|
||||||
|
// url拼接所需参数
|
||||||
|
String pathUrl = url + "?" + "appId=" + appId + "&appSecret=" + appSecret;
|
||||||
|
// 以post方式调用第三方接口,获取响应结果
|
||||||
|
String result = HttpClientUtil.doPost(pathUrl, dataStr, null);
|
||||||
|
|
||||||
|
// 返回accessToken
|
||||||
|
JSONObject jsonObject = JSON.parseObject(result, JSONObject.class);
|
||||||
|
return jsonObject.getString("accessToken");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.engine.web.meeting;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class NewMeet {
|
||||||
|
@Path("/newMeet")
|
||||||
|
@POST
|
||||||
|
public String newMeet(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
// try {
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
new BaseBean().writeLog("oameeting/newMeet--->" + map);
|
||||||
|
new BaseBean().writeLog("oameeting/newMeet--->" + JSONObject.toJSONString(map));
|
||||||
|
|
||||||
|
// String dataTable = (String) map.get("dataTable");
|
||||||
|
// RecordSet recordSet = new RecordSet();
|
||||||
|
// recordSet.executeQuery("select * from uf_View_resume_perm where sfqy = 0");
|
||||||
|
// StringBuilder s = new StringBuilder();
|
||||||
|
// while (recordSet.next()){
|
||||||
|
// String xld = Utils.null2String(recordSet.getString("xld"));
|
||||||
|
// s.append(xld).append(",");
|
||||||
|
// }
|
||||||
|
// HashMap<String, String> result = new HashMap<>();
|
||||||
|
// if (s.length()>0){
|
||||||
|
// result.put("data",s.toString().substring(0, s.length()-1));
|
||||||
|
// }else {
|
||||||
|
// result.put("data","");
|
||||||
|
// }
|
||||||
|
// result.put("code","200");
|
||||||
|
// return JSONObject.toJSONString(result);
|
||||||
|
// }catch (Exception e){
|
||||||
|
// e.printStackTrace();
|
||||||
|
// HashMap<String, String> result = new HashMap<>();
|
||||||
|
// result.put("data",e.getMessage());
|
||||||
|
// result.put("code","500");
|
||||||
|
return JSONObject.toJSONString(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
<%@ page import="java.util.*" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageType" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.bean.MessageBean" %>
|
||||||
|
<%@ page import="com.cloudstore.dev.api.util.Util_Message" %>
|
||||||
|
<%@ page import="java.io.IOException" %>
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
|
||||||
|
|
||||||
|
<%
|
||||||
|
MessageType messageType = MessageType.newInstance(1154); // 消息来源(见文档第四点补充 必填)
|
||||||
|
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
|
||||||
|
userIdList.add("640");
|
||||||
|
String title = "标题1154"; // 标题
|
||||||
|
String context = "内容1154"; // 内容
|
||||||
|
String linkUrl = "/123"; // PC端链接
|
||||||
|
String linkMobileUrl = "/123"; // 移动端链接
|
||||||
|
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);
|
||||||
|
out.print(1122);
|
||||||
|
} catch (IOException e) {
|
||||||
|
out.print(e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<%!
|
||||||
|
|
||||||
|
%>
|
Loading…
Reference in New Issue