Authored by LUOXC

Merge branch 'dev6.9.8' into test6.9.8

@@ -23,19 +23,4 @@ public class ExpressInfoConstant { @@ -23,19 +23,4 @@ public class ExpressInfoConstant {
23 */ 23 */
24 public static final Integer EXPRESS_STATUS_UNSEND = 2; 24 public static final Integer EXPRESS_STATUS_UNSEND = 2;
25 25
26 - /**  
27 - * 清关成功  
28 - */  
29 - public static final Integer EXPRESS_CLEAR_SUCCESS = 100;  
30 -  
31 - /**  
32 - * 清关失败(平台原因)  
33 - */  
34 - public static final Integer EXPRESS_CLEAR_FAIL_CAUSE_PLATFORM = 101;  
35 -  
36 - /**  
37 - * 清关失败(买家原因)  
38 - */  
39 - public static final Integer EXPRESS_CLEAR_FAIL_CAUSE_BUYER= 102;  
40 -  
41 } 26 }
  1 +package com.yohoufo.order.common;
  2 +
  3 +import java.util.Objects;
  4 +
  5 +public class LogisticsTypes {
  6 +
  7 + /**
  8 + * 判断是否是中通国际快递公司
  9 + *
  10 + * @param logisticsType
  11 + * @return
  12 + */
  13 + public static boolean isZtoInternational(Integer logisticsType) {
  14 + return Objects.isNull(logisticsType) ? false : logisticsType.intValue() == 76;
  15 + }
  16 +
  17 +}
@@ -14,6 +14,7 @@ import com.yohoufo.dal.order.ExpressRecordMapper; @@ -14,6 +14,7 @@ import com.yohoufo.dal.order.ExpressRecordMapper;
14 import com.yohoufo.dal.order.model.BuyerOrder; 14 import com.yohoufo.dal.order.model.BuyerOrder;
15 import com.yohoufo.dal.order.model.ExpressInfo; 15 import com.yohoufo.dal.order.model.ExpressInfo;
16 import com.yohoufo.dal.order.model.ExpressRecord; 16 import com.yohoufo.dal.order.model.ExpressRecord;
  17 +import com.yohoufo.order.common.LogisticsTypes;
17 import com.yohoufo.order.model.bo.ErpExpressBo; 18 import com.yohoufo.order.model.bo.ErpExpressBo;
18 import com.yohoufo.order.mq.publisher.ConsumerExceptionPublisher; 19 import com.yohoufo.order.mq.publisher.ConsumerExceptionPublisher;
19 import com.yohoufo.order.service.IBuyerOrderService; 20 import com.yohoufo.order.service.IBuyerOrderService;
@@ -156,30 +157,9 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -156,30 +157,9 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
156 expressInfo.setExpressType(initExpressType); 157 expressInfo.setExpressType(initExpressType);
157 expressInfo.setState(state); 158 expressInfo.setState(state);
158 159
159 - //清关失败和清关成功的物流信息,需要在OperateTransferCode记录下相应的code ,以便自动确认查询  
160 - if(ExpressInfoConstant.EXPRESS_CLEAR_SUCCESS.equals(state)){  
161 - //清关成功的纪录 160 + // 中通国际快递公司,存在物流则表示清关成功
  161 + if (LogisticsTypes.isZtoInternational(logisticsType)) {
162 expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_success.getCode()); 162 expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_success.getCode());
163 - }else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_PLATFORM.equals(state)){  
164 - //TODO 平台原因清关失败的信息记录下来,需要告诉order,退费  
165 - expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_platform.getCode());  
166 - /*暂时注释掉,等香港仓上线,中通物流返回信息未定  
167 - final CutomsClearanceFailType failType=CutomsClearanceFailType.PLATFORM;  
168 - LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);  
169 - executorService.execute(() -> {  
170 - buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);  
171 - LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);  
172 - });*/  
173 - }else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_BUYER.equals(state)){  
174 - //TODO 买家原因清关失败的信息记录下来,需要告诉order,退费  
175 - expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_buyer.getCode());  
176 - /*暂时注释掉,等香港仓上线,中通物流返回信息未定  
177 - final CutomsClearanceFailType failType=CutomsClearanceFailType.BUYER;  
178 - LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);  
179 - executorService.execute(() -> {  
180 - buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);  
181 - LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);  
182 - });*/  
183 } 163 }
184 expressInfoMapper.insert(expressInfo); 164 expressInfoMapper.insert(expressInfo);
185 165
@@ -44,6 +44,7 @@ import com.yohoufo.order.service.proxy.OrderOperateRecordService; @@ -44,6 +44,7 @@ import com.yohoufo.order.service.proxy.OrderOperateRecordService;
44 import com.yohoufo.order.service.proxy.OrderStatusFlowService; 44 import com.yohoufo.order.service.proxy.OrderStatusFlowService;
45 import com.yohoufo.order.service.proxy.ProductProxyService; 45 import com.yohoufo.order.service.proxy.ProductProxyService;
46 import com.yohoufo.order.service.seller.setting.SellerService; 46 import com.yohoufo.order.service.seller.setting.SellerService;
  47 +import com.yohoufo.order.utils.BuyerOrderUtils;
47 import com.yohoufo.order.utils.PaymentHelper; 48 import com.yohoufo.order.utils.PaymentHelper;
48 import com.yohoufo.order.utils.PubThreadFactory; 49 import com.yohoufo.order.utils.PubThreadFactory;
49 import lombok.Data; 50 import lombok.Data;
@@ -195,6 +196,7 @@ public class AppraiseService { @@ -195,6 +196,7 @@ public class AppraiseService {
195 * 正常发货 196 * 正常发货
196 * 鉴定通过 -- 待收货 197 * 鉴定通过 -- 待收货
197 * 瑕疵接收 -- 待收货 198 * 瑕疵接收 -- 待收货
  199 + * 寄存完成 -- 待收货
198 */ 200 */
199 public void deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo) { 201 public void deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo) {
200 LOGGER.info("deliveryGoodsToBuyer enter req {}", appraiseExpressInfoBo); 202 LOGGER.info("deliveryGoodsToBuyer enter req {}", appraiseExpressInfoBo);
@@ -211,6 +213,11 @@ public class AppraiseService { @@ -211,6 +213,11 @@ public class AppraiseService {
211 expectOrderStatus = OrderStatus.JUDGE_PASS; 213 expectOrderStatus = OrderStatus.JUDGE_PASS;
212 } else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) { 214 } else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) {
213 expectOrderStatus = OrderStatus.MINI_FAULT_ACCEPT; 215 expectOrderStatus = OrderStatus.MINI_FAULT_ACCEPT;
  216 + }
  217 + // 寄存订单已完成
  218 + else if (BuyerOrderUtils.isDeposit(buyerOrder.getAttributes())
  219 + && buyerOrder.getStatus() == OrderStatus.DONE.getCode()) {
  220 + expectOrderStatus = OrderStatus.DONE;
214 } else { 221 } else {
215 LOGGER.warn("in deliveryGoodsToBuyer, buyer Order orderCode {} pstatus {}, expect Order Status JUDGE_PASS or MINI_FAULT_ACCEPT ", 222 LOGGER.warn("in deliveryGoodsToBuyer, buyer Order orderCode {} pstatus {}, expect Order Status JUDGE_PASS or MINI_FAULT_ACCEPT ",
216 orderCode, buyerOrder.getStatus()); 223 orderCode, buyerOrder.getStatus());
@@ -42,4 +42,11 @@ public class BuyerOrderUtils { @@ -42,4 +42,11 @@ public class BuyerOrderUtils {
42 42
43 return isOffline(orderInfo.getAttributes()); 43 return isOffline(orderInfo.getAttributes());
44 } 44 }
  45 +
  46 + /**
  47 + * 是否寄存订单
  48 + */
  49 + public static boolean isDeposit(Integer attributes) {
  50 + return OrderAttributes.getOrderAttributes(attributes) == OrderAttributes.DEPOSITE;
  51 + }
45 } 52 }