Commit acc35a8b by ping.wu

Merge branches 'featur/20210527-配送服务异常回调' and 'master' of…

Merge branches 'featur/20210527-配送服务异常回调' and 'master' of http://gitlab.freemud.com/order-group-application/order-group

# Conflicts:
#	order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
parents 3b65daee f0d87963
......@@ -44,6 +44,13 @@ public class DeliveryController {
return deliveryService.callbackUrl(request);
}
@ApiAnnotation(logMessage = "配送异常回调")
@ApiOperation(value = "配送异常回调", notes = "配送异常回调", produces = "application/json")
@PostMapping("/delivery/errorCallbackUrl")
public BaseResponse errorCallbackUrl(@Valid @LogParams @RequestBody CallbackUrlRequestDto request) {
return deliveryService.errorCallbackUrl(request);
}
@ApiAnnotation(logMessage = "麦咖啡配送回调")
@ApiOperation(value = "麦咖啡配送回调", notes = "麦咖啡配送回调", produces = "application/json")
@PostMapping("/delivery/macCafeCallback")
......
......@@ -76,5 +76,14 @@ public class CallbackUrlRequestDto {
* 配送平台统一异常描述
*/
private String exceptionDesc;
/**
* 异常状态
*/
private String errorStatus;
/**
* 异常信息
*/
private String errorDesc;
private String errorCreateTime;
}
......@@ -15,6 +15,7 @@ public interface ThirdDeliveryService {
* 配送回调
*/
BaseResponse callbackUrl(CallbackUrlRequestDto request);
/**
* 配送回调
*/
......@@ -22,13 +23,17 @@ public interface ThirdDeliveryService {
/**
* 商城配送回调
* 商城配送回调
*/
BaseResponse mallCallbackUrl(CallbackUrlRequestDto request);
/**
* 查询微信配送地址配送费
*/
BaseResponse<DeliveryAmountVo> queryDeliveryAmount(WeixinDeliveryAddressDto request);
/**
* 配送异常回调
*/
BaseResponse errorCallbackUrl(CallbackUrlRequestDto request);
}
......@@ -108,6 +108,9 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
@Autowired
private StoreCenterService storeCenterService;
private final String deliveryEarlyWarningMsg = "运单预警";
@Override
public BaseResponse callbackUrl(CallbackUrlRequestDto request) {
// 获取回调状态
......@@ -329,6 +332,15 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
return ResponseUtil.success(deliveryAmountVo);
}
@Override
public BaseResponse errorCallbackUrl(CallbackUrlRequestDto request) {
// pos获取回调状态
sendPosMessage(request.getPartnerId(), request.getStoreId(), request.getOrderId(), 71, request.getErrorDesc());
//生态回调
sendException(request.getOrderId(), request.getErrorDesc(), request.getErrorCreateTime(), deliveryEarlyWarningMsg);
return ResponseUtil.success();
}
/**
* 配送单异常取消配送单
*/
......@@ -401,8 +413,11 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
message.setContent(content);
pushMessageNoticeDto.setData(new Gson().toJson(message));
messageNoticeClient.createMessage(pushMessageNoticeDto, LogThreadLocal.getTrackingNo());
try {
messageNoticeClient.createMessage(pushMessageNoticeDto, LogThreadLocal.getTrackingNo());
}catch (Exception e){
LogUtil.error("推送消息中心失败,订单编号:{},失败原因:{}", orderId, "", e);
}
}
/**
......@@ -549,9 +564,16 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
SubscribeMessageRequest request = new SubscribeMessageRequest();
OrderExtInfoDto extInfoDto = JSONObject.parseObject(orderBean.getExtInfo(), new TypeReference<OrderExtInfoDto>() {
});
String messageType = "UNUSUAL_ORDER";
if(deliveryEarlyWarningMsg.equals(desc)){
messageType = "DELIVERY_REMIND";
if(orderBean.getStatus() != null && OrderStatus.getByCode(orderBean.getStatus()) != null){
desc = OrderStatus.getByCode(orderBean.getStatus()).getDesc();
}
}
request.setMiniAppId(extInfoDto.getAppid());
SendMessageRequest sendMessageRequest = new SendMessageRequest();
sendMessageRequest.setMessageType("UNUSUAL_ORDER");
sendMessageRequest.setMessageType(messageType);
sendMessageRequest.setMiniAppId(extInfoDto.getAppid());
sendMessageRequest.setOrderId(orderId);
sendMessageRequest.setPartnerId(orderBean.getCompanyId());
......
......@@ -36,6 +36,9 @@ import cn.freemud.entities.dto.delivery.QueryLocusRiderTrackDto;
import cn.freemud.entities.dto.delivery.ResRiderTrackDto;
import cn.freemud.entities.dto.delivery.*;
import cn.freemud.entities.dto.ecology.SendMessageRequest;
import cn.freemud.entities.dto.ecology.SendMessageRequest;
import cn.freemud.entities.dto.ecology.SendMessageResponse;
import cn.freemud.entities.dto.ecology.SubscribeMessageRequest;
import cn.freemud.entities.dto.order.CreateOrderOperateDto;
import cn.freemud.entities.dto.order.CreatePrepayRequestDto;
import cn.freemud.entities.dto.order.FacePayRequestDto;
......@@ -81,6 +84,7 @@ import cn.freemud.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.freemud.api.assortment.datamanager.entity.db.*;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.enums.IappIdType;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment