|
|
@@ -303,37 +303,40 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
orderDon.setNum(1);
|
|
|
orderDon.setGoodsId(sku.getGoodsId());
|
|
|
orderDon.setStatus(goodsDon.getType() == 1 && goodsDon.getSecondType() == 2 ? OrderDon.Status.complete : OrderDon.Status.hasPayment);
|
|
|
+ if (relation.getStartTime() == null || relation.getExpiryTime() == null) {
|
|
|
+ orderDon.setStatus(OrderDon.Status.hasPayment);
|
|
|
+ }
|
|
|
//兑换码兑换
|
|
|
orderDon.setType(orderDonTye);
|
|
|
orderDon.setUserId(user.getId());
|
|
|
orderDonMapper.insert(orderDon);
|
|
|
}
|
|
|
- if (StrUtil.isNotEmpty(user.getOpenId())) {
|
|
|
- //发送模板消息
|
|
|
- THREAD_POOL_TASK_EXECUTOR.execute(() -> {
|
|
|
- try {
|
|
|
- if (StrUtil.isNotEmpty(user.getOpenId())) {
|
|
|
- log.info("用户{}兑换车位成功,发送新订单模板消息", user.getId());
|
|
|
- templateCommonService.newOderSendMsgByType(orderDon, goodsDon, user, user.getOpenId(), false);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.info("用户{}兑换车位成功,发送消息失败:{}", user.getId(), e);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- THREAD_POOL_TASK_EXECUTOR.execute(() -> {
|
|
|
- try {
|
|
|
- //发送至客服消息
|
|
|
- List<CustomerService> customerServices = customerServiceMapper.selectList(null);
|
|
|
- for (CustomerService customerService : customerServices) {
|
|
|
- log.info("向客服{}发送用户兑换码兑换车票消息通知..", customerService.getNickName());
|
|
|
- templateCommonService.newOderSendMsgByType(orderDon, goodsDon, user, customerService.getOpenId(), true);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("向客服发送用户{}兑换码兑换车票成功,发送消息失败:{}", user.getId(), e);
|
|
|
- }
|
|
|
- });
|
|
|
+// if (StrUtil.isNotEmpty(user.getOpenId())) {
|
|
|
+// //发送模板消息
|
|
|
+// THREAD_POOL_TASK_EXECUTOR.execute(() -> {
|
|
|
+// try {
|
|
|
+// if (StrUtil.isNotEmpty(user.getOpenId())) {
|
|
|
+// log.info("用户{}兑换车位成功,发送新订单模板消息", user.getId());
|
|
|
+// templateCommonService.newOderSendMsgByType(orderDon, goodsDon, user, user.getOpenId(), false);
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.info("用户{}兑换车位成功,发送消息失败:{}", user.getId(), e);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// THREAD_POOL_TASK_EXECUTOR.execute(() -> {
|
|
|
+// try {
|
|
|
+// //发送至客服消息
|
|
|
+// List<CustomerService> customerServices = customerServiceMapper.selectList(null);
|
|
|
+// for (CustomerService customerService : customerServices) {
|
|
|
+// log.info("向客服{}发送用户兑换码兑换车票消息通知..", customerService.getNickName());
|
|
|
+// templateCommonService.newOderSendMsgByType(orderDon, goodsDon, user, customerService.getOpenId(), true);
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("向客服发送用户{}兑换码兑换车票成功,发送消息失败:{}", user.getId(), e);
|
|
|
+// }
|
|
|
+// });
|
|
|
relation.setOrderId(orderDon.getId());
|
|
|
return relation;
|
|
|
}
|