|
@@ -8,11 +8,9 @@ import com.ydd.api.DeliveryService;
|
|
|
import com.ydd.api.MeiTuanApi;
|
|
|
import com.ydd.api.WaimaiApi;
|
|
|
import com.ydd.app.callback.controller.ShanTangSignUtils;
|
|
|
-import com.ydd.app.service.ApiCouponService;
|
|
|
-import com.ydd.app.service.ApiOrderBackService;
|
|
|
-import com.ydd.app.service.ApiOrderNewService;
|
|
|
-import com.ydd.app.service.ApiRiderLocationService;
|
|
|
+import com.ydd.app.service.*;
|
|
|
import com.ydd.app.task.SyncRiderEvent;
|
|
|
+import com.ydd.app.vo.OrderStatusNotifyVo;
|
|
|
import com.ydd.common.core.redis.RedisCache;
|
|
|
import com.ydd.common.enums.DeliveryTypeEnums;
|
|
|
import com.ydd.common.enums.DeliveryTypeMeituanCodeEnums;
|
|
@@ -109,6 +107,8 @@ public class ApiOrderBackServiceImpl implements ApiOrderBackService {
|
|
|
private final IShopJdHomeService iShopJdHomeService;
|
|
|
private final IShopJdHomeCodeService iShopJdHomeCodeService;
|
|
|
|
|
|
+ private final OpenApiNotifyService openApiNotifyService;
|
|
|
+
|
|
|
@Async
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -272,6 +272,27 @@ public class ApiOrderBackServiceImpl implements ApiOrderBackService {
|
|
|
iOrderLogService.addOrderLog(order.getId(), order.getDeliveryStatus());
|
|
|
}
|
|
|
iOrderService.updateById(order);
|
|
|
+
|
|
|
+ // todo: 开放平台推送订单状态
|
|
|
+ Merchant merchant = iMerchantService.getById(order.getMerchantId());
|
|
|
+ if (merchant != null && merchant.getAppId() != null) {
|
|
|
+ OrderStatusNotifyVo notifyVo = OrderStatusNotifyVo.builder()
|
|
|
+ .outOrderSn(order.getOutTradeNo())
|
|
|
+ .orderSn(order.getOrderSn())
|
|
|
+ .status(order.getDeliveryStatus())
|
|
|
+ .deliveryId(order.getDeliveryType())
|
|
|
+ .deliveryName(order.getDeliveryName())
|
|
|
+ .shipperName(order.getShipperName())
|
|
|
+ .shipperPhone(order.getShipperPhone())
|
|
|
+ .deliveryAmount(order.getPayAmount().add(order.getCouponAmount()))
|
|
|
+ .discountAmount(order.getCouponAmount())
|
|
|
+ .needPayAmount(order.getPayAmount())
|
|
|
+ .deductAmount(order.getBreachFee())
|
|
|
+ .build();
|
|
|
+ notifyVo.setAppId(merchant.getAppId());
|
|
|
+ openApiNotifyService.orderStatusNotify(notifyVo);
|
|
|
+ }
|
|
|
+
|
|
|
//若配送的是外卖订单,同步三方外卖平台配送状态
|
|
|
WaimaiOrder waimaiOrder = new WaimaiOrder();
|
|
|
try {
|