|
@@ -2,6 +2,7 @@ package com.xjrsoft.module.organization.controller;
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.xjrsoft.common.constant.GlobalConstant;
|
|
@@ -10,6 +11,7 @@ import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.RedisUtil;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.common.utils.WeChatUtil;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatDepartPageDto;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatPageDto;
|
|
|
import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
|
|
@@ -44,6 +46,8 @@ public class WechatController {
|
|
|
|
|
|
private final RedisUtil redisUtil;
|
|
|
|
|
|
+ private final WeChatUtil weChatUtil;
|
|
|
+
|
|
|
@PutMapping("/sync-user")
|
|
|
@ApiOperation(value="微信信息更新")
|
|
|
public R updateInfo(){
|
|
@@ -75,7 +79,32 @@ public class WechatController {
|
|
|
@ApiOperation(value="微信公众号发送消息")
|
|
|
public R sendMessage(WeChatSendMessageDto dto){
|
|
|
|
|
|
- WeChatService.sendMessage(dto);
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("touser","o8d_c6c-0yamdT-sEvX1Umgof1fE");
|
|
|
+ object.put("template_id","sHsmz7LRj7HLd7GSTS3r2uKMhE2f1iDAW15RqSK_6KM");
|
|
|
+ object.put("url","");
|
|
|
+ object.put("client_msg_id","MSG_000001");
|
|
|
+
|
|
|
+ JSONObject data=new JSONObject();
|
|
|
+
|
|
|
+ JSONObject data1=new JSONObject();
|
|
|
+ data1.put("value","关于某某事项的审批");
|
|
|
+ data.put("thing2",data1);
|
|
|
+
|
|
|
+ JSONObject data2=new JSONObject();
|
|
|
+ data2.put("value","张三");
|
|
|
+ data.put("phrase5",data2);
|
|
|
+
|
|
|
+ JSONObject data3=new JSONObject();
|
|
|
+ data3.put("value","2022-02-22 11:24:00");
|
|
|
+ data.put("time3",data3);
|
|
|
+
|
|
|
+ object.put("data",data);
|
|
|
+
|
|
|
+ weChatUtil.sendTemplateMessage(object);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return R.ok();
|
|
|
}
|
|
|
|