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', path: '/index',
component: Layout, redirect: '/todo/index',
redirect: '/index', // component: Layout,
children: [{ // children: [{
path: '/index', // path: '/index',
component: () => // component: () =>
import('@/views/index.vue'), // import('@/views/index.vue'),
name: 'index', // name: 'index',
meta: { // meta: {
title: '主页', // title: '主页',
noCache: true, // noCache: true,
affix: true // affix: true
} // }
}] // }]
}, },
...codemenu, ...codemenu,
{ {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -25,19 +25,21 @@ export const constantRoutes = [
}, },
{ {
path: '/index', path: '/index',
component: Layout, redirect: '/initial_value/storehouse'
redirect: '/index',
children: [{ // component: Layout,
path: '/index', // redirect: '/index',
component: () => // children: [{
import('@/views/index.vue'), // path: '/index',
name: 'index', // component: () =>
meta: { // import('@/views/index.vue'),
title: '主页', // name: 'index',
noCache: true, // meta: {
affix: true // title: '主页',
} // noCache: true,
}] // affix: true
// }
// }]
}, },
...codemenu, ...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.updateById(gdlog);
gdInventoryLogService.buildExcelById(gdlog.getIdStr()); gdInventoryLogService.buildExcelById(gdlog.getIdStr());
reportInventoryFeign.asyncXlsxMdspkc(); // reportInventoryFeign.asyncXlsxMdspkc();
} }
private RowHandler createRowHandler(GdInventoryLog gdlog) { 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', path: '/index',
component: Layout, redirect: '/dispatchmodletemplate/index'
redirect: '/index',
children: [{ // component: Layout,
path: '/index', // redirect: '/index',
component: () => // children: [{
import('@/views/index.vue'), // path: '/index',
name: 'index', // component: () =>
meta: { // import('@/views/index.vue'),
title: '主页', // name: 'index',
noCache: true, // meta: {
affix: true // title: '主页',
} // noCache: true,
}] // affix: true
// }
// }]
}, },
{ {
path: '/dispatchpatrolplan', 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 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"; 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()); String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data); Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data);
@ -55,7 +55,7 @@ public class WxMessage {
return mp_template_msg; 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()); String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, data); Map<String, Object> mp_template_msg = buildMsg(template_id, data);
@ -76,7 +76,7 @@ public class WxMessage {
* @param data * @param data
* @return * @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()); String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data); Map<String, Object> mp_template_msg = buildMsg(template_id, pagepath, data);
@ -102,7 +102,7 @@ public class WxMessage {
* @param data * @param data
* @return * @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()); String wxUrl = MP_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.mpAccessToken());
Map<String, Object> mp_template_msg = buildMsg(template_id, data); Map<String, Object> mp_template_msg = buildMsg(template_id, data);
@ -129,28 +129,113 @@ public class WxMessage {
* @param data * @param data
* @return * @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()); String wxUrl = WX_URL_MESSAGE_SEND.replace("ACCESS_TOKEN", WxConfig.wxAccessToken());
//拼接base参数 //拼接base参数
Map<String, Object> sendBody = new HashMap<>(); Map<String, Object> sendBody = buildMessageBody(template_id, pagepath, data);
sendBody.put("template_id", template_id);// 模板Id
sendBody.put("touser", touser); // openId sendBody.put("touser", touser); // openId
Map<String, String> miniprogram = new HashMap<>(); ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class);
miniprogram.put("appid", WxConfig.MP_APPID); RespMessReturn body = forEntity.getBody();
miniprogram.put("pagepath", pagepath); body.setSendData(sendBody);
sendBody.put("miniprogram", miniprogram); 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<>(); Map<String, TemplateDataValue> sendData = new HashMap<>();
data.forEach((key, val) -> { data.forEach((key, val) -> {
sendData.put(key, new TemplateDataValue(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", ""); // 点击模板信息跳转地址 private static Map<String, Object> buildMessageBody(String template_id, String pagepath, Map<String, String> data) {
sendBody.put("topcolor", "#FF0000"); // 顶色 //拼接base参数
Map<String, Object> mp_template_msg = buildMessageBody(template_id, data);
ResponseEntity<RespMessReturn> forEntity = new RestTemplate().postForEntity(wxUrl, sendBody, RespMessReturn.class); Map<String, String> miniprogram = new HashMap<>();
return forEntity.getBody(); 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("time1", "2003-03-15");
data.put("thing2", "监管数据总览"); data.put("thing2", "监管数据总览");
data.put("thing3", "aaa"); data.put("thing3", "aaa");
RespMessReturn respMessReturn = WxMessage.messageTemplateSend(template_id, touser, pagepath, data); // RespMessReturn respMessReturn = WxMessage.messageTemplateSend(template_id, touser, pagepath, data);
System.out.println(respMessReturn.getErrcode()); // System.out.println(respMessReturn.getErrcode());
System.out.println(respMessReturn.getErrmsg()); // System.out.println(respMessReturn.getErrmsg());
} }
// @Test // @Test
public void testSendMessage() { public void testSendMessage() {

Loading…
Cancel
Save