|
@@ -33,10 +33,7 @@ import com.sqx.modules.errand.dto.RiderDeliveryDTO;
|
|
|
import com.sqx.modules.errand.dto.RiderTransferByOrderIdDTO;
|
|
import com.sqx.modules.errand.dto.RiderTransferByOrderIdDTO;
|
|
|
import com.sqx.modules.errand.dto.RiderTransferOrderDTO;
|
|
import com.sqx.modules.errand.dto.RiderTransferOrderDTO;
|
|
|
import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
|
|
import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
|
|
|
-import com.sqx.modules.errand.entity.ErrandAddress;
|
|
|
|
|
-import com.sqx.modules.errand.entity.ErrandEvaluate;
|
|
|
|
|
-import com.sqx.modules.errand.entity.ErrandRedPacket;
|
|
|
|
|
-import com.sqx.modules.errand.entity.TbIndent;
|
|
|
|
|
|
|
+import com.sqx.modules.errand.entity.*;
|
|
|
import com.sqx.modules.errand.service.TbIndentService;
|
|
import com.sqx.modules.errand.service.TbIndentService;
|
|
|
import com.sqx.modules.errand.service.TbIndentSmsSendLogService;
|
|
import com.sqx.modules.errand.service.TbIndentSmsSendLogService;
|
|
|
import com.sqx.modules.errand.service.TbIndentSmsTemplateService;
|
|
import com.sqx.modules.errand.service.TbIndentSmsTemplateService;
|
|
@@ -1078,6 +1075,11 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
MyGlobalThreadPool.execute(() -> {
|
|
MyGlobalThreadPool.execute(() -> {
|
|
|
try {
|
|
try {
|
|
|
// 发送短信并记录短信发送记录
|
|
// 发送短信并记录短信发送记录
|
|
|
|
|
+ TbIndentSmsSendLog tbIndentSmsSendLog=smsSendLogService.getSendSuccessByOrderId(indentOrder.getIndentId());
|
|
|
|
|
+ if(tbIndentSmsSendLog!=null){
|
|
|
|
|
+ log.error("外卖跑腿订单id【{}】短信已发送成功,短信id【{}】",tbIndentSmsSendLog.getOrderId(),tbIndentSmsSendLog.getId());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
SmsSendResult smsSendResult = smsTemplateService.sendSms(smsTemplateId, riderUser, userPhone);
|
|
SmsSendResult smsSendResult = smsTemplateService.sendSms(smsTemplateId, riderUser, userPhone);
|
|
|
// sourceType 1骑手、2商家
|
|
// sourceType 1骑手、2商家
|
|
|
smsSendLogService.saveLog(indentOrder.getIndentId(), "1", smsSendResult);
|
|
smsSendLogService.saveLog(indentOrder.getIndentId(), "1", smsSendResult);
|
|
@@ -1224,7 +1226,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
|
status = transactionManager.getTransaction(new DefaultTransactionDefinition());
|
|
|
// 如果是外卖订单
|
|
// 如果是外卖订单
|
|
|
if (ObjectUtil.equal(indentOrder.getIndentType(), "5")) {
|
|
if (ObjectUtil.equal(indentOrder.getIndentType(), "5")) {
|
|
|
- handTakeoutOrder(indentOrder, userId, deliveryDTO);
|
|
|
|
|
|
|
+ handTakeoutOrder(indentOrder, userId, deliveryDTO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Result result = finshOrder(userId, indentNumber, deliveryDTO.getItemCode());
|
|
Result result = finshOrder(userId, indentNumber, deliveryDTO.getItemCode());
|
|
@@ -1250,10 +1252,10 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
*/
|
|
*/
|
|
|
private void handTakeoutOrder(TbIndent indentOrder, Long userId, RiderDeliveryDTO deliveryDTO) {
|
|
private void handTakeoutOrder(TbIndent indentOrder, Long userId, RiderDeliveryDTO deliveryDTO) {
|
|
|
// 6表示跑腿订单处于已完成状态
|
|
// 6表示跑腿订单处于已完成状态
|
|
|
|
|
+ //锁内用锁外数据进行判断会拿等待锁前的数据判断
|
|
|
if ("6".equals(indentOrder.getIndentState())) {
|
|
if ("6".equals(indentOrder.getIndentState())) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
Long smsTemplateId = deliveryDTO.getSmsTemplateId();
|
|
Long smsTemplateId = deliveryDTO.getSmsTemplateId();
|
|
|
if (ObjectUtil.isNull(smsTemplateId)) {
|
|
if (ObjectUtil.isNull(smsTemplateId)) {
|
|
|
throw new SqxException("短信模板id不能为空");
|
|
throw new SqxException("短信模板id不能为空");
|
|
@@ -1281,7 +1283,12 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
|
|
|
tbOrder.setDeliveryImgs(imgs);
|
|
tbOrder.setDeliveryImgs(imgs);
|
|
|
appOrderService.updateById(tbOrder);
|
|
appOrderService.updateById(tbOrder);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ TbIndentSmsSendLog tbIndentSmsSendLog=smsSendLogService.getSendSuccessByOrderId(indentOrder.getIndentId());
|
|
|
|
|
+// 有发送成功记录则不再发送
|
|
|
|
|
+ if(tbIndentSmsSendLog!=null){
|
|
|
|
|
+ log.error("外卖跑腿订单【{}】短信已发送成功,短信id【{}】", deliveryDTO.getIndentNumber(),tbIndentSmsSendLog.getId());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 发送短信并记录短信发送记录
|
|
// 发送短信并记录短信发送记录
|
|
|
SmsSendResult smsSendResult = smsTemplateService.sendSms(smsTemplateId, riderUser, userPhone);
|
|
SmsSendResult smsSendResult = smsTemplateService.sendSms(smsTemplateId, riderUser, userPhone);
|
|
|
// sourceType 1骑手、2商家
|
|
// sourceType 1骑手、2商家
|