Browse Source

消息推送

master
liupopo 2 years ago
parent
commit
6447b619ce
  1. 26
      supervise-business-ui/src/router/index.js
  2. 28
      supervise-crm-ui/src/router/index.js
  3. 4
      supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue
  4. 27
      supervise-enterprise-ui/src/router/index.js
  5. 28
      supervise-message-ui/src/router/index.js
  6. 28
      supervise-organizational-ui/src/router/index.js
  7. 28
      supervise-portal-ui/src/router/index.js
  8. 26
      supervise-report-ui/src/router/index.js
  9. 28
      supervise-risk-ui/src/router/index.js
  10. 28
      warehousing-system/project_web_ui/src/router/index.js
  11. 2
      yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java
  12. 28
      yxt_supervise/supervise-dispatchcenter/supervise-dispatchcenter-ui/src/router/index.js
  13. 117
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/wx/WxMessage.java
  14. 6
      yxt_supervise/supervise-report/supervise-report-biz/src/test/java/com/yxt/supervise/report/wx/WxMessageTest.java

26
supervise-business-ui/src/router/index.js

@ -32,19 +32,19 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/todo/index',
// component: Layout,
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
supervise-crm-ui/src/router/index.js

@ -32,19 +32,21 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/project/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

4
supervise-customer-ui/src/views/daydataupload/gdinventory/index.vue

@ -55,8 +55,8 @@
>刷新</el-button></div>
<div v-else-if="scope.row.state==4&&scope.row.fileUrl.length>1">
<el-button type="text" @click="toDownload(scope.row)">下载库存日报表</el-button>
<el-button type="text" @click="toDownloadKchz(scope.row)">下载门店商品总表</el-button>
<el-button type="text" @click="toDownloadKchzfb(scope.row)">下载门店商品分表压缩包</el-button>
<!-- <el-button type="text" @click="toDownloadKchz(scope.row)">下载门店商品总表</el-button>
<el-button type="text" @click="toDownloadKchzfb(scope.row)">下载门店商品分表压缩包</el-button> -->
</div>
<div v-else>没有报表文件</div>
</template>

27
supervise-enterprise-ui/src/router/index.js

@ -32,19 +32,20 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/Yjsq/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
supervise-message-ui/src/router/index.js

@ -32,19 +32,21 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/wdxx/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
supervise-organizational-ui/src/router/index.js

@ -32,19 +32,21 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/yhgl/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
supervise-portal-ui/src/router/index.js

@ -34,19 +34,21 @@ export const constantRoutes = [
},
{
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: 'organizationManage'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
}, {
path: '/region',
component: Layout,

26
supervise-report-ui/src/router/index.js

@ -32,19 +32,19 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/projectDaily/index',
// component: Layout,
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
supervise-risk-ui/src/router/index.js

@ -34,19 +34,21 @@ export const constantRoutes = [
},
{
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/bjzx/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

28
warehousing-system/project_web_ui/src/router/index.js

@ -25,19 +25,21 @@ export const constantRoutes = [
},
{
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/initial_value/storehouse'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
...codemenu,
{

2
yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/gdinventoryok/GdInventoryOkService.java

@ -185,7 +185,7 @@ public class GdInventoryOkService extends MybatisBaseService<GdInventoryOkMapper
gdInventoryLogService.updateById(gdlog);
gdInventoryLogService.buildExcelById(gdlog.getIdStr());
reportInventoryFeign.asyncXlsxMdspkc();
// reportInventoryFeign.asyncXlsxMdspkc();
}
private RowHandler createRowHandler(GdInventoryLog gdlog) {

28
yxt_supervise/supervise-dispatchcenter/supervise-dispatchcenter-ui/src/router/index.js

@ -32,19 +32,21 @@ export const constantRoutes = [
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
redirect: '/dispatchmodletemplate/index'
// component: Layout,
// redirect: '/index',
// children: [{
// path: '/index',
// component: () =>
// import('@/views/index.vue'),
// name: 'index',
// meta: {
// title: '主页',
// noCache: true,
// affix: true
// }
// }]
},
{
path: '/dispatchpatrolplan',

117
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/wx/WxMessage.java

@ -15,7 +15,7 @@ public class WxMessage {
private static final String WX_URL_MESSAGE_SEND = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
private static final String MP_URL_MESSAGE_SEND = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN";
public static RespMessReturn sendMessage(String template_id, String touser, String pagepath, Map<String, String> data) {
public static RespMessReturn sendMessageMiniProgram(String template_id, String touser, String pagepath, Map<String, String> data) {
String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data);
@ -55,7 +55,7 @@ public class WxMessage {
return mp_template_msg;
}
public static RespMessReturn sendMessage(String template_id, String touser, Map<String, String> data) {
public static RespMessReturn sendMessageMiniProgram(String template_id, String touser, Map<String, String> data) {
String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, data);
@ -76,7 +76,7 @@ public class WxMessage {
* @param data
* @return
*/
public static Map<String, RespMessReturn> sendMessages(String template_id, List<String> tousers, String pagepath, Map<String, String> data) {
public static Map<String, RespMessReturn> sendMessagesMiniProgram(String template_id, List<String> tousers, String pagepath, Map<String, String> data) {
String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data);
@ -102,7 +102,7 @@ public class WxMessage {
* @param data
* @return
*/
public static Map<String, RespMessReturn> sendMessages(String template_id, List<String> tousers, Map<String, String> data) {
public static Map<String, RespMessReturn> sendMessagesMiniProgram(String template_id, List<String> tousers, Map<String, String> data) {
String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, data);
@ -129,28 +129,113 @@ public class WxMessage {
* @param data
* @return
*/
public static RespMessReturn messageTemplateSend(String template_id, String touser, String pagepath, Map<String, String> data) {
public static RespMessReturn sendMessage(String template_id, String touser, String pagepath, Map<String, String> data) {
String wxUrl = WX_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.wxAccessToken());
//拼接base参数
Map<String, Object> sendBody = new HashMap<>();
sendBody.put("template_id", template_id);// 模板Id
Map<String, Object> sendBody = buildMessageBody(template_id, pagepath, data);
sendBody.put("touser", touser); // openId
Map<String, String> miniprogram = new HashMap<>();
miniprogram.put("appid", WxConfig.MP_APPID);
miniprogram.put("pagepath", pagepath);
sendBody.put("miniprogram", miniprogram);
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
RespMessReturn body = forEntity.getBody();
body.setSendData(sendBody);
return body;
}
/**
* 微信公众号发送消息不打开小程序
*
* @param template_id
* @param touser
* @param data
* @return
*/
public static RespMessReturn sendMessage(String template_id, String touser, Map<String, String> data) {
String wxUrl = WX_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.wxAccessToken());
Map<String, Object> sendBody = buildMessageBody(template_id, data);
sendBody.put("touser", touser); // openId
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
RespMessReturn body = forEntity.getBody();
body.setSendData(sendBody);
return body;
}
/**
* 微信公众号发送消息向多个用户发送
*
* @param template_id
* @param tousers
* @param pagepath
* @param data
* @return
*/
public static Map<String, RespMessReturn> sendMessages(String template_id, List<String> tousers, String pagepath, Map<String, String> data) {
String wxUrl = WX_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.wxAccessToken());
//拼接base参数
Map<String, Object> sendBody = buildMessageBody(template_id, pagepath, data);
Map<String, RespMessReturn> ret = new HashMap<>();
for (String touser : tousers) {
sendBody.put("touser", touser);
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
RespMessReturn body = forEntity.getBody();
body.setSendData(sendBody);
ret.put(touser, body);
}
return ret;
}
/**
* 微信公众号发送消息不打开小程序向多个用户发送
*
* @param template_id
* @param tousers
* @param data
* @return
*/
public static Map<String, RespMessReturn> sendMessages(String template_id, List<String> tousers, Map<String, String> data) {
String wxUrl = WX_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.wxAccessToken());
Map<String, Object> sendBody = buildMessageBody(template_id, data);
Map<String, RespMessReturn> ret = new HashMap<>();
for (String touser : tousers) {
sendBody.put("touser", touser);
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
RespMessReturn body = forEntity.getBody();
body.setSendData(sendBody);
ret.put(touser, body);
}
return ret;
}
private static Map<String, Object> buildMessageBody(String template_id, Map<String, String> data) {
//拼接base参数
Map<String, Object> mp_template_msg = new HashMap<>();
mp_template_msg.put("template_id", template_id);// 模板Id
Map<String, TemplateDataValue> sendData = new HashMap<>();
data.forEach((key, val) -> {
sendData.put(key, new TemplateDataValue(val));
});
sendBody.put("data", sendData);
mp_template_msg.put("data", sendData);
mp_template_msg.put("url", ""); // 点击模板信息跳转地址
mp_template_msg.put("topcolor", "#FF0000"); // 顶色
return mp_template_msg;
}
sendBody.put("url", ""); // 点击模板信息跳转地址
sendBody.put("topcolor", "#FF0000"); // 顶色
private static Map<String, Object> buildMessageBody(String template_id, String pagepath, Map<String, String> data) {
//拼接base参数
Map<String, Object> mp_template_msg = buildMessageBody(template_id, data);
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
return forEntity.getBody();
Map<String, String> miniprogram = new HashMap<>();
miniprogram.put("appid", WxConfig.MP_APPID);
miniprogram.put("pagepath", pagepath);
mp_template_msg.put("miniprogram", miniprogram);
return mp_template_msg;
}
}

6
yxt_supervise/supervise-report/supervise-report-biz/src/test/java/com/yxt/supervise/report/wx/WxMessageTest.java

@ -16,9 +16,9 @@ public class WxMessageTest {
data.put("time1", "2003-03-15");
data.put("thing2", "监管数据总览");
data.put("thing3", "aaa");
RespMessReturn respMessReturn = WxMessage.messageTemplateSend(template_id, touser, pagepath, data);
System.out.println(respMessReturn.getErrcode());
System.out.println(respMessReturn.getErrmsg());
// RespMessReturn respMessReturn = WxMessage.messageTemplateSend(template_id, touser, pagepath, data);
// System.out.println(respMessReturn.getErrcode());
// System.out.println(respMessReturn.getErrmsg());
}
// @Test
public void testSendMessage() {

Loading…
Cancel
Save