|
@@ -1167,18 +1167,23 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
receiptMapper.updateReceipt(receiptPo);
|
|
receiptMapper.updateReceipt(receiptPo);
|
|
|
|
|
|
// 关联成功推送模板消息给指定人员(用户权限: 1收款列表访问,2收款详情分享,3收款录入,4收款关联订单,5收款关联返佣,6收款关联供应商退款,7收款审核)
|
|
// 关联成功推送模板消息给指定人员(用户权限: 1收款列表访问,2收款详情分享,3收款录入,4收款关联订单,5收款关联返佣,6收款关联供应商退款,7收款审核)
|
|
- List<String> openidList = receiptMapper.getOpenidListByPermission(Collections.singletonList(7));
|
|
|
|
- openidList.removeIf(Objects::isNull);
|
|
|
|
- double associateAmount = receiptMapper.countAssociateAmountById(receipt.getId());
|
|
|
|
- String associateTitle = "收款和订单已确认关联,请及时审核!";
|
|
|
|
- String associateDate = receipt.getReceiptDate();
|
|
|
|
- String associateType = receiptMapper.getReceiptTypeStrById(receipt.getPayType());
|
|
|
|
- String remarkText = "收款类型:" + associateType + ",确认时间:"+receipt.getConfirmDate();
|
|
|
|
- // 跳转到【普通款项待审核】页面
|
|
|
|
- String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
|
|
- for (String openid : openidList) {
|
|
|
|
- // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
|
|
- weChatService.sendTemplateMsg(openid, associateTitle, associateAmount, associateDate, remarkText, pagePath);
|
|
|
|
|
|
+ try {
|
|
|
|
+ String accessToken = weChatService.getAccessToken();
|
|
|
|
+ List<String> openidList = receiptMapper.getOpenidListByPermission(Collections.singletonList(7));
|
|
|
|
+ openidList.removeIf(Objects::isNull);
|
|
|
|
+ double associateAmount = receiptMapper.countAssociateAmountById(receipt.getId());
|
|
|
|
+ String associateTitle = "收款和订单已确认关联,请及时审核!";
|
|
|
|
+ String associateDate = receipt.getReceiptDate();
|
|
|
|
+ String associateType = receiptMapper.getReceiptTypeStrById(receipt.getPayType());
|
|
|
|
+ String remarkText = "收款类型:" + associateType + ",确认时间:"+receipt.getConfirmDate();
|
|
|
|
+ // 跳转到【普通款项待审核】页面
|
|
|
|
+ String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
|
|
+ for (String openid : openidList) {
|
|
|
|
+ // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
|
|
+ weChatService.sendTemplateMsg(accessToken, openid, associateTitle, associateAmount, associateDate, remarkText, pagePath);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("获取微信公众号access_token异常!", e);
|
|
}
|
|
}
|
|
return ResponseJson.success("关联收款信息成功!", null);
|
|
return ResponseJson.success("关联收款信息成功!", null);
|
|
}
|
|
}
|
|
@@ -1665,20 +1670,26 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
|
|
|
|
// 审核未通过 推送模板消息给指定人员
|
|
// 审核未通过 推送模板消息给指定人员
|
|
if (4 == receiptStatus) {
|
|
if (4 == receiptStatus) {
|
|
- // 审核未通过
|
|
|
|
- String title = "订单审核未通过,请重新确认审核!";
|
|
|
|
- String date = receipt.getReceiptDate();
|
|
|
|
- String receiptTypeStr = receiptMapper.getReceiptTypeStrById(receipt.getPayType());
|
|
|
|
- String remarkText = "收款类型:"+ receiptTypeStr +";"+"审核时间:"+receiptPo.getReviewDate();
|
|
|
|
- double associateAmount = receiptMapper.countAssociateAmountById(receipt.getId());
|
|
|
|
- // (用户权限: 1收款列表访问,2收款详情分享,3收款录入,4收款关联订单,5收款关联返佣,6收款关联供应商退款,7收款审核)
|
|
|
|
- List<String> openidList = receiptMapper.getOpenidListByPermission(Collections.singletonList(4));
|
|
|
|
- openidList.removeIf(Objects::isNull);
|
|
|
|
- // 跳转到【普通款项待审核】页面
|
|
|
|
- String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
|
|
- for (String openid : openidList) {
|
|
|
|
- // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
|
|
- weChatService.sendTemplateMsg(openid, title, associateAmount, date, remarkText, pagePath);
|
|
|
|
|
|
+ log.info(">>>>>>>>审核未通过,请重新确认审核!收款Id:" + receipt.getId());
|
|
|
|
+ try {
|
|
|
|
+ String accessToken = weChatService.getAccessToken();
|
|
|
|
+ // 审核未通过
|
|
|
|
+ String title = "审核未通过,请重新确认审核!";
|
|
|
|
+ String date = receipt.getReceiptDate();
|
|
|
|
+ String receiptTypeStr = receiptMapper.getReceiptTypeStrById(receipt.getPayType());
|
|
|
|
+ String remarkText = "收款类型:"+ receiptTypeStr +";"+"审核时间:"+receiptPo.getReviewDate();
|
|
|
|
+ double associateAmount = receiptMapper.countAssociateAmountById(receipt.getId());
|
|
|
|
+ // (用户权限: 1收款列表访问,2收款详情分享,3收款录入,4收款关联订单,5收款关联返佣,6收款关联供应商退款,7收款审核)
|
|
|
|
+ List<String> openidList = receiptMapper.getOpenidListByPermission(Collections.singletonList(4));
|
|
|
|
+ openidList.removeIf(Objects::isNull);
|
|
|
|
+ // 跳转到【普通款项待审核】页面
|
|
|
|
+ String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
|
|
+ for (String openid : openidList) {
|
|
|
|
+ // sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
|
|
+ weChatService.sendTemplateMsg(accessToken, openid, title, associateAmount, date, remarkText, pagePath);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("获取微信公众号access_token异常!", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ResponseJson.success("审核收款信息成功!", null);
|
|
return ResponseJson.success("审核收款信息成功!", null);
|
|
@@ -1688,7 +1699,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
* 微信收款信息推送(待确认超时)
|
|
* 微信收款信息推送(待确认超时)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void sendWechatMsgConfirmTimeout() {
|
|
|
|
|
|
+ public void sendWechatMsgConfirmTimeout(String accessToken) {
|
|
//待确认超时
|
|
//待确认超时
|
|
ReceiptParamsBo paramsBo = new ReceiptParamsBo();
|
|
ReceiptParamsBo paramsBo = new ReceiptParamsBo();
|
|
String[] receiptStatusArr = "1".split(",");
|
|
String[] receiptStatusArr = "1".split(",");
|
|
@@ -1722,7 +1733,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
String remarkText = "收款类型:" + receiptTypeStr;
|
|
String remarkText = "收款类型:" + receiptTypeStr;
|
|
for (String openid : openidList) {
|
|
for (String openid : openidList) {
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
- weChatService.sendTemplateMsg(openid, title, amount, date, remarkText, pagePath);
|
|
|
|
|
|
+ weChatService.sendTemplateMsg(accessToken, openid, title, amount, date, remarkText, pagePath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1731,7 +1742,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
* 微信收款信息推送(待审核超时)
|
|
* 微信收款信息推送(待审核超时)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void sendWechatMsgAuditTimeout() {
|
|
|
|
|
|
+ public void sendWechatMsgAuditTimeout(String accessToken) {
|
|
//待审核超时
|
|
//待审核超时
|
|
ReceiptParamsBo paramsBo = new ReceiptParamsBo();
|
|
ReceiptParamsBo paramsBo = new ReceiptParamsBo();
|
|
String[] receiptStatusArr = "2".split(",");
|
|
String[] receiptStatusArr = "2".split(",");
|
|
@@ -1752,7 +1763,7 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
String pagePath = "/pages/relation/ordinary/examine-detail?id="+receipt.getId();
|
|
for (String openid : openidList) {
|
|
for (String openid : openidList) {
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
// sendTemplateMsg(openid, 标题, 金额, 收款日期, 备注, 跳转链接)
|
|
- weChatService.sendTemplateMsg(openid, title, amount, date, remarkText, pagePath);
|
|
|
|
|
|
+ weChatService.sendTemplateMsg(accessToken, openid, title, amount, date, remarkText, pagePath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|