|
@@ -78,11 +78,24 @@ public class ShopMessTask {
|
|
|
String theme = "以下械字号商品的资质证书将于" + contentDay + "后失效,请及时提醒供应商更换证书。";
|
|
|
MessageCenterPo messageCenter = new MessageCenterPo();
|
|
|
messageCenter.userType(2).messageType(2).shopMessType(5).content(content);
|
|
|
+ WechatTemplateMessage wechat = new WechatTemplateMessage();
|
|
|
+ wechat.templateId("gpD9TqBpkgaw3YSM_JPk4WSTwKZY0hxrBCH0SjzNKY4").url("https://www.caimei365.com/").appid("wxf3cd4ae0cdd11c36")
|
|
|
+ .first("您好,您有商品资质证书即将到期。").pagePath("");
|
|
|
pro.forEach(p -> {
|
|
|
productNames.append("(").append(p.productId()).append(")").append(p.productName());
|
|
|
productIds.append(p.productId()).append(",");
|
|
|
messageCenter.productId(p.productId());
|
|
|
messageCenterMapper.addMessageCenter(messageCenter);
|
|
|
+ ArrayList<String> strings = new ArrayList<>();
|
|
|
+ strings.add(p.shopName());
|
|
|
+ strings.add("医疗器械注册证");
|
|
|
+ strings.add(p.qualificationNo());
|
|
|
+ strings.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
+ //todo 傻逼写法,拿不到值,有空再改
|
|
|
+ String openid = messageCenterMapper.getOpenidListByPermission(p.shopId());
|
|
|
+ wechat.remark(p.productName()).openId(openid).keyWords(strings);
|
|
|
+ MessageModel<WechatTemplateMessage> we = new MessageModel<>();
|
|
|
+ messageSender.messageSend(we.code(MessageType.WECHAT_TEMPLATE_MESSAGE).info(wechat));
|
|
|
});
|
|
|
String names = productNames.toString();
|
|
|
String ids = productIds.toString();
|
|
@@ -125,7 +138,7 @@ public class ShopMessTask {
|
|
|
strings.add(s.getValidityDate());
|
|
|
strings.add(s.getDateStrings());
|
|
|
strings.add(s.getReceiptAmount().toString());
|
|
|
- WechatTemplateMessage weChat = new WechatTemplateMessage().first(firsts).openId(openid).pagePath(pagePath)
|
|
|
+ WechatTemplateMessage weChat = new WechatTemplateMessage().first(firsts).openId(openid).pagePath(pagePath).keyWords(strings)
|
|
|
.templateId("jYUIq63wP6mGFvkgNHgTOXAgF7j6h_VZKgST_-2fqCo").remark("为了更好给您服务,请及时联系采美客服缴费!").appid("wx91c4152b60ca91a3").url(pagePath);
|
|
|
MessageModel<WechatTemplateMessage> weChatMessage = wechatTemplateMessageMessageModel.code(MessageType.WECHAT_TEMPLATE_MESSAGE).info(weChat);
|
|
|
messageSender.messageSend(weChatMessage);
|