update:订单执行日志打印
This commit is contained in:
parent
6ef2974124
commit
c8559a5451
|
@ -40,6 +40,7 @@ import com.doudian.open.core.AccessToken;
|
|||
import com.doudian.open.core.AccessTokenBuilder;
|
||||
import com.doudian.open.core.GlobalConfig;
|
||||
import com.doudian.open.gson.Gson;
|
||||
import com.doudian.open.gson.JsonSyntaxException;
|
||||
import com.doudian.open.msg.refund_RefundAgreed.param.RefundRefundAgreedParam;
|
||||
import com.doudian.open.msg.refund_RefundCreated.param.RefundRefundCreatedParam;
|
||||
import com.doudian.open.msg.refund_ReturnApplyAgreed.param.RefundReturnApplyAgreedParam;
|
||||
|
@ -47,6 +48,7 @@ import com.doudian.open.msg.trade_TradeCanceled.param.TradeTradeCanceledParam;
|
|||
import com.doudian.open.msg.trade_TradePaid.param.TradeTradePaidParam;
|
||||
import com.doudian.open.msg.trade_TradePending.param.TradeTradePendingParam;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -63,6 +65,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||
|
||||
|
||||
|
@ -94,6 +97,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
@Override
|
||||
public void catchOrders(List<Message> catchRepVO) {
|
||||
// 插入日志
|
||||
log.info("抖音消息推送订单,抓取/更新 订单");
|
||||
log.error("抖音订单推送:{}", catchRepVO);
|
||||
try {
|
||||
Gson gson = new Gson();
|
||||
for (Message message : catchRepVO) {
|
||||
String tag = message.getTag();
|
||||
|
@ -114,7 +120,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
TradeTradePaidParam tradeTradePaidParam = gson.fromJson(message.getData()+"", TradeTradePaidParam.class);
|
||||
// 订单id
|
||||
Long pId = tradeTradePaidParam.getPId();
|
||||
// 根据订单id查询订单详情
|
||||
// 根据订单id查询订单详情
|
||||
OrderOrderDetailData orderDetail = orderDetail(String.valueOf(pId));
|
||||
ShopOrderDetail order = orderDetail.getShopOrderDetail();
|
||||
// 所有的订单数据
|
||||
|
@ -137,10 +143,10 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
// 买家备注
|
||||
String buyerWords = order.getBuyerWords();
|
||||
// 收件人电话
|
||||
// String postTel = order.getPostTel();
|
||||
// String postTel = order.getPostTel();
|
||||
String encryptPostTel = order.getEncryptPostTel();
|
||||
// 收件人姓名
|
||||
// String postReceiver = order.getPostReceiver();
|
||||
// String postReceiver = order.getPostReceiver();
|
||||
String encryptPostReceiver = order.getEncryptPostReceiver();
|
||||
// 收件人地址
|
||||
com.doudian.open.api.order_orderDetail.data.PostAddr postAddr = order.getPostAddr();
|
||||
|
@ -152,13 +158,13 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
com.doudian.open.api.order_orderDetail.data.Town town = postAddr.getTown();
|
||||
// 街道/镇
|
||||
com.doudian.open.api.order_orderDetail.data.Street street = postAddr.getStreet();
|
||||
// String detail = postAddr.getDetail();
|
||||
// String detail = postAddr.getDetail();
|
||||
String encryptDetail = postAddr.getEncryptDetail();
|
||||
//用户信息
|
||||
com.doudian.open.api.order_orderDetail.data.UserIdInfo userIdInfo = order.getUserIdInfo();
|
||||
// String idCardNo = userIdInfo.getIdCardNo();
|
||||
// String idCardNo = userIdInfo.getIdCardNo();
|
||||
String encryptIdCardNo = userIdInfo.getEncryptIdCardNo();
|
||||
// String idCardName = userIdInfo.getIdCardName();
|
||||
// String idCardName = userIdInfo.getIdCardName();
|
||||
String encryptIdCardName = userIdInfo.getEncryptIdCardName();
|
||||
List<OrdersDO> orderList = new ArrayList<>();
|
||||
List<OrdersDO> orderListAll = new ArrayList<>();
|
||||
|
@ -169,7 +175,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
com.doudian.open.api.order_orderDetail.data.AfterSaleInfo afterSaleInfo = skuOrderListItem.getAfterSaleInfo();
|
||||
// 售后状态 0-售后初始化, 6-售后申请, 7-售后退货中, 27-拒绝售后申请, 12-售后成功, 28-售后失败, 11-售后已发货, 29-退货后拒绝退款, 13-售后换货商家发货, 14-售后换货用户收货, 51-取消成功, 53-逆向交易完成
|
||||
Long afterSaleStatus = afterSaleInfo.getAfterSaleStatus();
|
||||
// 1-待退款;3-退款成功; 4-退款失败;当买家发起售后后又主动取消售后,此时after_sale_status=28并且refund_status=1的状态不变,不会流转至4状态;
|
||||
// 1-待退款;3-退款成功; 4-退款失败;当买家发起售后后又主动取消售后,此时after_sale_status=28并且refund_status=1的状态不变,不会流转至4状态;
|
||||
Long refundStatus = afterSaleInfo.getRefundStatus();
|
||||
// 商品sku 判断是否抓单
|
||||
String code = skuOrderListItem.getCode();
|
||||
|
@ -191,7 +197,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
// 1 待确认/待支付-订单创建完毕;105-已支付; 2-备货中; 101-部分发货; 3-已发货(全部发货);4- 已取消;5 已完成(已收货);
|
||||
Long HaokaOrderStatus;// 号卡订单状态
|
||||
Long HaokaOrderRefundStatus;// 号卡订单退款状态
|
||||
// 解析订单状态
|
||||
// 解析订单状态
|
||||
if(orderStatus == 105L){
|
||||
HaokaOrderStatus = 100L;
|
||||
ordersDO.setStatus(HaokaOrderStatus);
|
||||
|
@ -297,6 +303,10 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
// 未接入的消息类型
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error("订单解析执行报错,错误原因:{}",e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue