fix
This commit is contained in:
@@ -43,12 +43,12 @@ public class OverdueOrderHandlerTask {
|
||||
}
|
||||
|
||||
/**
|
||||
* 每秒钟检测,判断任务是否到期
|
||||
* 每10秒钟检测,判断任务是否到期
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024/8/15 13:47
|
||||
**/
|
||||
@Scheduled(fixedRate = 1000)
|
||||
@Scheduled(fixedRate = 10000)
|
||||
public void processMessages() {
|
||||
long now = System.currentTimeMillis() / 1000;
|
||||
Set<String> messages = stringRedisTemplate.opsForZSet().rangeByScore(QUEUE_KEY, 0, now);
|
||||
@@ -74,7 +74,12 @@ public class OverdueOrderHandlerTask {
|
||||
}
|
||||
// 如果订单未接单,进行退款处理
|
||||
if ("0".equals(orderInfo.getOrderStatus())) {
|
||||
try {
|
||||
playOrderInfoService.updateStateTo4("2", "admin", orderInfo.getId(), "订单长时间未接单", new ArrayList<>());
|
||||
}catch (Exception e){
|
||||
log.error("订单退款失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,10 +308,10 @@ public class WxCustomMpService {
|
||||
|
||||
public void sendOrderCancelMessage(PlayOrderInfoEntity orderInfo, String refundReason) {
|
||||
SysTenantEntity tenant = tenantService.selectSysTenantByTenantId(orderInfo.getTenantId());
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(orderInfo.getAcceptBy());
|
||||
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(orderInfo.getPurchaserBy());
|
||||
|
||||
WxMpTemplateMessage templateMessage = getWxMpTemplateMessage(tenant.getQuxiaodingdantongzhiTemplateId(), clerkUserInfo.getOpenid(), "http://" + tenant.getTenantKey() + ".july.hucs.top/clerk/#/orderDetail/" + orderInfo.getId());
|
||||
WxMpTemplateMessage templateMessage = getWxMpTemplateMessage(tenant.getQuxiaodingdantongzhiTemplateId(), customUserInfo.getOpenid(), "http://" + tenant.getTenantKey() + ".july.hucs.top/user/#/orderDetail/" + orderInfo.getId());
|
||||
List<WxMpTemplateData> data = new ArrayList<>();
|
||||
data.add(new WxMpTemplateData("character_string2", orderInfo.getOrderNo()));
|
||||
data.add(new WxMpTemplateData("thing5", StringUtils.isEmpty(refundReason) ? "已取消" : refundReason));
|
||||
@@ -323,8 +323,11 @@ public class WxCustomMpService {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
templateMessage.setToUser(customUserInfo.getOpenid());
|
||||
templateMessage.setUrl("http://" + tenant.getTenantKey() + ".july.hucs.top/user/#/orderDetail/" + orderInfo.getId());
|
||||
if(StringUtils.isNotEmpty(orderInfo.getAcceptBy())){
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(orderInfo.getAcceptBy());
|
||||
|
||||
templateMessage.setToUser(clerkUserInfo.getOpenid());
|
||||
templateMessage.setUrl("http://" + tenant.getTenantKey() + ".july.hucs.top/clerk/#/orderDetail/" + orderInfo.getId());
|
||||
try {
|
||||
proxyWxMpService().getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||
} catch (WxErrorException e) {
|
||||
@@ -332,4 +335,6 @@ public class WxCustomMpService {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user