Authored by qinchao

Merge branch 'dev6.8.6.5-quality4app' into test6.8.6.5

# Conflicts:
#	order/src/main/java/com/yohoufo/order/service/impl/AppraiseService.java
@@ -50,6 +50,11 @@ public interface BuyerOrderMapper { @@ -50,6 +50,11 @@ public interface BuyerOrderMapper {
50 // 修改订单状态 50 // 修改订单状态
51 int updateStatusByOrderCode(@Param("orderCode")long orderCode, @Param("uid")int uid, @Param("status")int status, @Param("targetStatus")int targetStatus, @Param("currentTime")int currentTime); 51 int updateStatusByOrderCode(@Param("orderCode")long orderCode, @Param("uid")int uid, @Param("status")int status, @Param("targetStatus")int targetStatus, @Param("currentTime")int currentTime);
52 52
  53 + //修改订单状态 , 6.8.7版本以后去掉 ,不要引用该方法
  54 + //拆分出瑕疵确认状态,系统上线之初存在多种状态的情况
  55 + @Deprecated
  56 + int updateStatusByOrderCodeMoreExpectStatus(@Param("orderCode")long orderCode, @Param("uid")int uid, @Param("expectStatusList")List<Integer> expectStatusList, @Param("targetStatus")int targetStatus, @Param("currentTime")int currentTime);
  57 +
53 // 根据uid查询订单总数 58 // 根据uid查询订单总数
54 Integer selectOrderNumByUid(@Param("uid")int uid); 59 Integer selectOrderNumByUid(@Param("uid")int uid);
55 60
@@ -381,6 +381,17 @@ @@ -381,6 +381,17 @@
381 where uid = #{uid,jdbcType=INTEGER} and order_code = #{orderCode,jdbcType=BIGINT} and status = #{status, jdbcType=INTEGER} 381 where uid = #{uid,jdbcType=INTEGER} and order_code = #{orderCode,jdbcType=BIGINT} and status = #{status, jdbcType=INTEGER}
382 </update> 382 </update>
383 383
  384 + <update id="updateStatusByOrderCodeMoreExpectStatus">
  385 + update buyer_order set
  386 + status = #{targetStatus,jdbcType=INTEGER},
  387 + update_time = #{currentTime,jdbcType=INTEGER}
  388 + where uid = #{uid,jdbcType=INTEGER} and order_code = #{orderCode,jdbcType=BIGINT}
  389 + and status in
  390 + <foreach item="item" index="index" collection="expectStatusList" open="(" separator="," close=")">
  391 + #{item}
  392 + </foreach>
  393 + </update>
  394 +
384 <select id="selectOrderNumByUid" resultType="java.lang.Integer"> 395 <select id="selectOrderNumByUid" resultType="java.lang.Integer">
385 select count(*) from buyer_order where uid = #{uid,jdbcType=INTEGER} and buyer_order_status = 1 396 select count(*) from buyer_order where uid = #{uid,jdbcType=INTEGER} and buyer_order_status = 1
386 </select> 397 </select>
@@ -24,10 +24,15 @@ public class ActionStatusHold { @@ -24,10 +24,15 @@ public class ActionStatusHold {
24 OrderStatus.SELLER_SEND_OUT.getCode(), 24 OrderStatus.SELLER_SEND_OUT.getCode(),
25 OrderStatus.PLATFORM_RECEIVE.getCode(), 25 OrderStatus.PLATFORM_RECEIVE.getCode(),
26 OrderStatus.PLATFORM_CHECKING.getCode(), 26 OrderStatus.PLATFORM_CHECKING.getCode(),
27 - //OrderStatus.JUDGE_PASS.getCode(), 27 + OrderStatus.MINI_FAULT_WAITING.getCode(),
  28 + OrderStatus.MINI_FAULT_ACCEPT.getCode(),
  29 + OrderStatus.JUDGE_PASS.getCode(),
28 OrderStatus.WAITING_RECEIVE.getCode(), 30 OrderStatus.WAITING_RECEIVE.getCode(),
29 OrderStatus.DONE.getCode(), 31 OrderStatus.DONE.getCode(),
30 OrderStatus.CHECKING_FAKE.getCode(), 32 OrderStatus.CHECKING_FAKE.getCode(),
  33 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  34 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  35 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
31 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode() 36 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()
32 ); 37 );
33 38
@@ -38,6 +43,9 @@ public class ActionStatusHold { @@ -38,6 +43,9 @@ public class ActionStatusHold {
38 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), 43 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
39 OrderStatus.SEND_OUT_TIMEOUT.getCode(), 44 OrderStatus.SEND_OUT_TIMEOUT.getCode(),
40 OrderStatus.CHECKING_FAKE.getCode(),//鉴权不通过 45 OrderStatus.CHECKING_FAKE.getCode(),//鉴权不通过
  46 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  47 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  48 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
41 OrderStatus.WAITING_RECEIVE.getCode(),// 49 OrderStatus.WAITING_RECEIVE.getCode(),//
42 OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(), 50 OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
43 OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(), 51 OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(),
@@ -58,7 +66,9 @@ public class ActionStatusHold { @@ -58,7 +66,9 @@ public class ActionStatusHold {
58 OrderStatus.PLATFORM_CHECKING.getCode(), 66 OrderStatus.PLATFORM_CHECKING.getCode(),
59 OrderStatus.WAITING_RECEIVE.getCode(), 67 OrderStatus.WAITING_RECEIVE.getCode(),
60 OrderStatus.PLATFORM_RECEIVE.getCode(), 68 OrderStatus.PLATFORM_RECEIVE.getCode(),
61 - //OrderStatus.JUDGE_PASS.getCode(), 69 + OrderStatus.MINI_FAULT_WAITING.getCode(),
  70 + OrderStatus.MINI_FAULT_ACCEPT.getCode(),
  71 + OrderStatus.JUDGE_PASS.getCode(),
62 OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(), 72 OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(),
63 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()); 73 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
64 } 74 }
@@ -89,8 +99,13 @@ public class ActionStatusHold { @@ -89,8 +99,13 @@ public class ActionStatusHold {
89 final static List<Integer> View_Express_Status = Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(), 99 final static List<Integer> View_Express_Status = Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(),
90 OrderStatus.PLATFORM_RECEIVE.getCode(), 100 OrderStatus.PLATFORM_RECEIVE.getCode(),
91 OrderStatus.PLATFORM_CHECKING.getCode(), 101 OrderStatus.PLATFORM_CHECKING.getCode(),
92 - //OrderStatus.JUDGE_PASS.getCode(), 102 + OrderStatus.MINI_FAULT_WAITING.getCode(),
  103 + OrderStatus.MINI_FAULT_ACCEPT.getCode(),
  104 + OrderStatus.JUDGE_PASS.getCode(),
93 OrderStatus.CHECKING_FAKE.getCode(), 105 OrderStatus.CHECKING_FAKE.getCode(),
  106 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  107 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  108 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
94 OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode(), 109 OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode(),
95 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()); 110 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
96 // 111 //
@@ -144,6 +159,9 @@ public class ActionStatusHold { @@ -144,6 +159,9 @@ public class ActionStatusHold {
144 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), 159 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
145 OrderStatus.SEND_OUT_TIMEOUT.getCode(), 160 OrderStatus.SEND_OUT_TIMEOUT.getCode(),
146 OrderStatus.CHECKING_FAKE.getCode(), 161 OrderStatus.CHECKING_FAKE.getCode(),
  162 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  163 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  164 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
147 OrderStatus.WAITING_RECEIVE.getCode(), 165 OrderStatus.WAITING_RECEIVE.getCode(),
148 OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(), 166 OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
149 OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(), 167 OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(),
1 package com.yohoufo.order.controller; 1 package com.yohoufo.order.controller;
2 2
3 import com.yoho.core.rest.annotation.ServiceDesc; 3 import com.yoho.core.rest.annotation.ServiceDesc;
  4 +import com.yoho.error.exception.ServiceException;
4 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo; 5 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
5 import com.yohobuy.ufo.model.order.common.OrderStatus; 6 import com.yohobuy.ufo.model.order.common.OrderStatus;
6 import com.yohoufo.common.ApiResponse; 7 import com.yohoufo.common.ApiResponse;
7 import com.yohoufo.common.annotation.IgnoreSession; 8 import com.yohoufo.common.annotation.IgnoreSession;
8 import com.yohoufo.common.annotation.IgnoreSignature; 9 import com.yohoufo.common.annotation.IgnoreSignature;
9 import com.yohoufo.order.service.impl.AppraiseService; 10 import com.yohoufo.order.service.impl.AppraiseService;
  11 +import org.apache.commons.lang3.StringUtils;
10 import org.slf4j.Logger; 12 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
@@ -63,9 +65,20 @@ public class AppraiseController { @@ -63,9 +65,20 @@ public class AppraiseController {
63 @IgnoreSignature 65 @IgnoreSignature
64 public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 66 public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
65 logger.info("in appraise Fail, req {}", appraiseExpressInfoBo); 67 logger.info("in appraise Fail, req {}", appraiseExpressInfoBo);
66 - OrderStatus expectStatus = OrderStatus.PLATFORM_CHECKING;  
67 - //1 鉴定不通过 ;2 质检不通过 ;  
68 - return appraiseService.appraiseFail(appraiseExpressInfoBo,expectStatus,true); 68 + return appraiseService.appraiseFailAndDelivery(appraiseExpressInfoBo);
  69 + }
  70 +
  71 +
  72 + /**
  73 + * 商品鉴定不通过,不发物流
  74 + * @return
  75 + */
  76 + @RequestMapping(value="/judgeCenterNotPass")
  77 + @IgnoreSession
  78 + @IgnoreSignature
  79 + public ApiResponse judgeCenterNotPass(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
  80 + logger.info("in judgeCenterNotPass, req {}", appraiseExpressInfoBo);
  81 + return appraiseService.judgeCenterNotPass(appraiseExpressInfoBo);
69 } 82 }
70 83
71 /** 84 /**
@@ -80,9 +93,7 @@ public class AppraiseController { @@ -80,9 +93,7 @@ public class AppraiseController {
80 @IgnoreSignature 93 @IgnoreSignature
81 public ApiResponse appraiseFailWithoutExpress(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 94 public ApiResponse appraiseFailWithoutExpress(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
82 logger.info("in appraiseFailWithoutExpress , req {}", appraiseExpressInfoBo); 95 logger.info("in appraiseFailWithoutExpress , req {}", appraiseExpressInfoBo);
83 - OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;  
84 - //1 鉴定不通过 ;2 质检不通过 ;  
85 - return appraiseService.appraiseFail( appraiseExpressInfoBo,expectStatus,false); 96 + return appraiseService.qualityCheckReject(appraiseExpressInfoBo);
86 } 97 }
87 98
88 99
@@ -111,7 +122,34 @@ public class AppraiseController { @@ -111,7 +122,34 @@ public class AppraiseController {
111 @IgnoreSignature 122 @IgnoreSignature
112 public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 123 public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
113 logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo); 124 logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo);
114 - return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile()); 125 + return appraiseService.appraiseSuccessAndDelivery(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
  126 + }
  127 +
  128 +
  129 + /**
  130 + * TODO 手机质检: 鉴定通过流程,订单进入JUDGE_PASS状态,但是没有发货
  131 + * 瑕疵确认通过 -->鉴定通过
  132 + * 平台鉴定中 -->鉴定通过
  133 + */
  134 + @RequestMapping(value="/judgeCenterPass")
  135 + @IgnoreSession
  136 + @IgnoreSignature
  137 + public ApiResponse judgeCenterPass(Long orderCode){
  138 + logger.info("in judgeCenterPass, orderCode {}", orderCode);
  139 + return appraiseService.judgeCenterPass(orderCode);
  140 + }
  141 +
  142 + /**
  143 + * TODO 手机质检: 发货
  144 + * 鉴定通过 -- 待收货
  145 + */
  146 + @RequestMapping(value="/deliveryGoodsToBuyer")
  147 + @IgnoreSession
  148 + @IgnoreSignature
  149 + public ApiResponse deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo){
  150 + logger.info("in deliveryGoodsToBuyer, appraiseExpressInfoBo {}", appraiseExpressInfoBo);
  151 + appraiseService.deliveryGoodsToBuyer(appraiseExpressInfoBo);
  152 + return new ApiResponse();
115 } 153 }
116 154
117 /* 155 /*
@@ -57,6 +57,9 @@ public class AlarmEventBuilder { @@ -57,6 +57,9 @@ public class AlarmEventBuilder {
57 AlarmConfig alarmConfig; 57 AlarmConfig alarmConfig;
58 switch(orderStatus){ 58 switch(orderStatus){
59 case CHECKING_FAKE: 59 case CHECKING_FAKE:
  60 + case QUALITY_CHECK_FAKE:
  61 + case MINI_FAULT_REJECT:
  62 + case MINI_FAULT_OUT_TIME_REJECT:
60 alarmConfig = AlarmConfig.APPRAISE_FAIL; 63 alarmConfig = AlarmConfig.APPRAISE_FAIL;
61 smsAlarmEvent = new SmsAlarmEvent(alarmConfig.getRefundName(), alarmConfig.name(), content); 64 smsAlarmEvent = new SmsAlarmEvent(alarmConfig.getRefundName(), alarmConfig.name(), content);
62 break; 65 break;
@@ -36,14 +36,10 @@ public class BuyerOrderMiniFaultOuterTimeDelayMsgConsumer implements YhConsumer @@ -36,14 +36,10 @@ public class BuyerOrderMiniFaultOuterTimeDelayMsgConsumer implements YhConsumer
36 logger.info("BuyerOrderMiniFaultOuterTimeDelayMsgConsumer topic {}, msg {} ", getMessageTopic(), o); 36 logger.info("BuyerOrderMiniFaultOuterTimeDelayMsgConsumer topic {}, msg {} ", getMessageTopic(), o);
37 37
38 BuyerMiniFaultOuterTimeEvent event = JSONObject.parseObject(o.toString(), BuyerMiniFaultOuterTimeEvent.class); 38 BuyerMiniFaultOuterTimeEvent event = JSONObject.parseObject(o.toString(), BuyerMiniFaultOuterTimeEvent.class);
39 - //Integer buyerUid = event.getUid();  
40 Long orderCode = event.getOrderCode(); 39 Long orderCode = event.getOrderCode();
41 40
42 - //AppraiseExpressInfoBo appraiseExpressInfoBo = new AppraiseExpressInfoBo();  
43 - //appraiseExpressInfoBo.setOrderCode(orderCode);  
44 - //OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;  
45 - //int type= 4; //1 鉴定不通过 ;2 质检不通过 ; 3,瑕疵确认不通过 ,4,瑕疵确认不通过(超时)  
46 - appraiseService.miniFaultReject(orderCode,true); 41 + OrderStatus targetStatus = OrderStatus.MINI_FAULT_OUT_TIME_REJECT;
  42 + appraiseService.miniFaultReject(orderCode,targetStatus,true);
47 43
48 logger.info("BuyerOrderMiniFaultOuterTimeDelayMsgConsumer topic {}, msg {} finish", getMessageTopic(), event); 44 logger.info("BuyerOrderMiniFaultOuterTimeDelayMsgConsumer topic {}, msg {} finish", getMessageTopic(), event);
49 } 45 }
@@ -255,6 +255,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { @@ -255,6 +255,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
255 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), 255 OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
256 OrderStatus.SEND_OUT_TIMEOUT.getCode(), 256 OrderStatus.SEND_OUT_TIMEOUT.getCode(),
257 OrderStatus.CHECKING_FAKE.getCode(), 257 OrderStatus.CHECKING_FAKE.getCode(),
  258 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  259 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  260 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
258 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), 261 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
259 OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(), 262 OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(),
260 // 支付成功回调超时,但已经被超时取消,这种场景是可以退款的 263 // 支付成功回调超时,但已经被超时取消,这种场景是可以退款的
@@ -95,6 +95,9 @@ public interface IExpressInfoService { @@ -95,6 +95,9 @@ public interface IExpressInfoService {
95 95
96 List<Integer> status2OnlySellerExpressType = Arrays.asList(OrderStatus.PLATFORM_RECEIVE.getCode(), 96 List<Integer> status2OnlySellerExpressType = Arrays.asList(OrderStatus.PLATFORM_RECEIVE.getCode(),
97 OrderStatus.PLATFORM_CHECKING.getCode(), OrderStatus.WAITING_RECEIVE.getCode(), 97 OrderStatus.PLATFORM_CHECKING.getCode(), OrderStatus.WAITING_RECEIVE.getCode(),
  98 + OrderStatus.MINI_FAULT_WAITING.getCode(),
  99 + OrderStatus.MINI_FAULT_ACCEPT.getCode(),
  100 + OrderStatus.JUDGE_PASS.getCode(),
98 OrderStatus.DONE.getCode()); 101 OrderStatus.DONE.getCode());
99 102
100 /** 103 /**
@@ -104,7 +107,10 @@ public interface IExpressInfoService { @@ -104,7 +107,10 @@ public interface IExpressInfoService {
104 List<Integer> types = null; 107 List<Integer> types = null;
105 if(Objects.equals(OrderStatus.SELLER_SEND_OUT.getCode(), status)){ 108 if(Objects.equals(OrderStatus.SELLER_SEND_OUT.getCode(), status)){
106 types = Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode()); 109 types = Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
107 - }else if (Objects.equals(OrderStatus.CHECKING_FAKE.getCode(), status)){ 110 + }else if (Objects.equals(OrderStatus.CHECKING_FAKE.getCode(), status)
  111 + ||Objects.equals(OrderStatus.QUALITY_CHECK_FAKE.getCode(), status)
  112 + ||Objects.equals(OrderStatus.MINI_FAULT_REJECT.getCode(), status)
  113 + ||Objects.equals(OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(), status)){
108 types = Arrays.asList( EnumExpressType.EXPRESS_TYPE_3.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 114 types = Arrays.asList( EnumExpressType.EXPRESS_TYPE_3.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
109 }else if(Objects.equals(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), status)){ 115 }else if(Objects.equals(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(), status)){
110 types = Arrays.asList( EnumExpressType.EXPRESS_TYPE_REBACK.getCode() ,EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 116 types = Arrays.asList( EnumExpressType.EXPRESS_TYPE_REBACK.getCode() ,EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
@@ -117,8 +123,13 @@ public interface IExpressInfoService { @@ -117,8 +123,13 @@ public interface IExpressInfoService {
117 List<Integer> status2BuyerDeliverExpressStatusList = Arrays.asList( 123 List<Integer> status2BuyerDeliverExpressStatusList = Arrays.asList(
118 OrderStatus.PLATFORM_RECEIVE.getCode(), 124 OrderStatus.PLATFORM_RECEIVE.getCode(),
119 OrderStatus.PLATFORM_CHECKING.getCode(), 125 OrderStatus.PLATFORM_CHECKING.getCode(),
120 - //OrderStatus.JUDGE_PASS.getCode(), 126 + OrderStatus.MINI_FAULT_WAITING.getCode(),
  127 + OrderStatus.MINI_FAULT_ACCEPT.getCode(),
  128 + OrderStatus.JUDGE_PASS.getCode(),
121 OrderStatus.CHECKING_FAKE.getCode(), 129 OrderStatus.CHECKING_FAKE.getCode(),
  130 + OrderStatus.QUALITY_CHECK_FAKE.getCode(),
  131 + OrderStatus.MINI_FAULT_REJECT.getCode(),
  132 + OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
122 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode() 133 OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()
123 ); 134 );
124 135
@@ -297,7 +297,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService { @@ -297,7 +297,11 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
297 } 297 }
298 298
299 final static List<Integer> canRefundStatusList = Arrays.asList(OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(), 299 final static List<Integer> canRefundStatusList = Arrays.asList(OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
300 - OrderStatus.SEND_OUT_TIMEOUT.getCode(), OrderStatus.CHECKING_FAKE.getCode()); 300 + OrderStatus.SEND_OUT_TIMEOUT.getCode()
  301 + , OrderStatus.CHECKING_FAKE.getCode()
  302 + ,OrderStatus.QUALITY_CHECK_FAKE.getCode()
  303 + ,OrderStatus.MINI_FAULT_REJECT.getCode()
  304 + ,OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode());
301 305
302 @Override 306 @Override
303 public boolean canRefund(OrderInfo orderInfo) { 307 public boolean canRefund(OrderInfo orderInfo) {
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
  4 +import com.google.common.collect.Lists;
4 import com.yoho.error.ServiceError; 5 import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 6 import com.yoho.error.exception.ServiceException;
6 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo; 7 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
@@ -36,6 +37,7 @@ import com.yohoufo.order.service.proxy.OrderOperateRecordService; @@ -36,6 +37,7 @@ import com.yohoufo.order.service.proxy.OrderOperateRecordService;
36 import com.yohoufo.order.service.proxy.OrderStatusFlowService; 37 import com.yohoufo.order.service.proxy.OrderStatusFlowService;
37 import com.yohoufo.order.utils.PaymentHelper; 38 import com.yohoufo.order.utils.PaymentHelper;
38 import com.yohoufo.order.utils.PubThreadFactory; 39 import com.yohoufo.order.utils.PubThreadFactory;
  40 +import lombok.Data;
39 import org.apache.commons.lang3.StringUtils; 41 import org.apache.commons.lang3.StringUtils;
40 import org.slf4j.Logger; 42 import org.slf4j.Logger;
41 import org.slf4j.LoggerFactory; 43 import org.slf4j.LoggerFactory;
@@ -45,6 +47,7 @@ import org.springframework.stereotype.Service; @@ -45,6 +47,7 @@ import org.springframework.stereotype.Service;
45 47
46 import java.math.BigDecimal; 48 import java.math.BigDecimal;
47 import java.util.Arrays; 49 import java.util.Arrays;
  50 +import java.util.List;
48 import java.util.Objects; 51 import java.util.Objects;
49 import java.util.concurrent.ArrayBlockingQueue; 52 import java.util.concurrent.ArrayBlockingQueue;
50 import java.util.concurrent.ExecutorService; 53 import java.util.concurrent.ExecutorService;
@@ -169,7 +172,7 @@ public class AppraiseService { @@ -169,7 +172,7 @@ public class AppraiseService {
169 /** 172 /**
170 * 鉴定不通过退回 173 * 鉴定不通过退回
171 * (1)记录物流 174 * (1)记录物流
172 - * (2)消息 :寄回有三种情形: 质检不通过的而商品、瑕疵不接受的 、瑕疵不接受(超时)的 175 + * (2)消息 :寄回有4种情形: 鉴定不通过、质检不通过的商品、瑕疵不接受的 、瑕疵不接受(超时)的
173 */ 176 */
174 public void returnBackOrderCauseOfJudgeFailure(AppraiseExpressInfoBo appraiseExpressInfoBo){ 177 public void returnBackOrderCauseOfJudgeFailure(AppraiseExpressInfoBo appraiseExpressInfoBo){
175 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId(); 178 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
@@ -185,12 +188,46 @@ public class AppraiseService { @@ -185,12 +188,46 @@ public class AppraiseService {
185 throw new ServiceException(ServiceError.ORDER_NULL); 188 throw new ServiceException(ServiceError.ORDER_NULL);
186 } 189 }
187 190
188 - OrderStatus expectStatus = OrderStatus.CHECKING_FAKE;  
189 - if (buyerOrder.getStatus() != expectStatus.getCode()){  
190 - LOGGER.warn("returnBackOrderCauseOfJudgeFailure expectStatus {}, actual status {}, orderCode {}", expectStatus, 191 + OrderStatus expectStatus ;
  192 +
  193 + int type = 0 ;//鉴定不通过
  194 + if (buyerOrder.getStatus() == OrderStatus.CHECKING_FAKE.getCode()){
  195 + expectStatus = OrderStatus.CHECKING_FAKE;
  196 +
  197 + //TODO 新版本6.8.7以后,判断type可直接根据状态,而不再需要根据qualityCheck,可去掉以下if判断
  198 + //TODO 现在6.8.6.5手机质检版本上线,还需要保留,存在过度订单,鉴定不通过都是类型:13
  199 + QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(orderCode);
  200 + if(qualityCheck!=null&&qualityCheck.getType()!=null){
  201 + if(EnumQualityCheckType.CHECK_NOT_PASS.getCode().intValue()==qualityCheck.getType().intValue()){
  202 + type = 1;//质检不通过
  203 + }else if(EnumQualityCheckType.MINI_FAULT.getCode().intValue()==qualityCheck.getType().intValue()){
  204 + if(qualityCheck.getStatus()!=null){
  205 + if(EnumQualityCheckStatus.REJECT_BY_BUYER.getCode().intValue()==qualityCheck.getStatus().intValue()){
  206 + type = 2;//用户不接受瑕疵
  207 + }else if(EnumQualityCheckStatus.REJECT_BY_OUTER_TIME.getCode().intValue()==qualityCheck.getStatus().intValue()){
  208 + type = 3;//用户不接受超时
  209 + }
  210 + }
  211 + }
  212 + }
  213 + }else if(buyerOrder.getStatus() == OrderStatus.QUALITY_CHECK_FAKE.getCode()){
  214 + type = 1;//质检不通过
  215 + expectStatus = OrderStatus.QUALITY_CHECK_FAKE;
  216 + }else if(buyerOrder.getStatus() == OrderStatus.MINI_FAULT_REJECT.getCode()){
  217 + type = 2;//用户不接受瑕疵
  218 + expectStatus = OrderStatus.MINI_FAULT_REJECT;
  219 + }else if(buyerOrder.getStatus() == OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode()){
  220 + type = 3;//用户不接受超时
  221 + expectStatus = OrderStatus.MINI_FAULT_OUT_TIME_REJECT;
  222 + }else{
  223 + //if (buyerOrder.getStatus() != expectStatus.getCode()){
  224 + LOGGER.warn("returnBackOrderCauseOfJudgeFailure expectStatus CHECKING_FAKE QUALITY_CHECK_FAKE MINI_FAULT_REJECT or MINI_FAULT_OUT_TIME_REJECT, actual status {}, orderCode {}",
191 buyerOrder.getStatus(), orderCode); 225 buyerOrder.getStatus(), orderCode);
192 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE); 226 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
193 } 227 }
  228 + LOGGER.info("returnBackOrderCauseOfJudgeFailure check status ok expectStatus {}, actual status {}, orderCode {}",expectStatus,
  229 + buyerOrder.getStatus(), orderCode);
  230 +
194 231
195 //更新物流信息 232 //更新物流信息
196 int sellerUid = buyerOrder.getSellerUid(); 233 int sellerUid = buyerOrder.getSellerUid();
@@ -199,6 +236,7 @@ public class AppraiseService { @@ -199,6 +236,7 @@ public class AppraiseService {
199 //清缓存 236 //清缓存
200 SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(),buyerOrder.getUid(),buyerOrder.getSellerUid()); 237 SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(),buyerOrder.getUid(),buyerOrder.getSellerUid());
201 238
  239 + /*
202 //发消息给卖家 240 //发消息给卖家
203 QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(orderCode); 241 QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(orderCode);
204 int type = 1 ;//鉴定不通过 242 int type = 1 ;//鉴定不通过
@@ -211,6 +249,7 @@ public class AppraiseService { @@ -211,6 +249,7 @@ public class AppraiseService {
211 } 249 }
212 250
213 } 251 }
  252 + */
214 inBoxFacade.sellerQualityCheckNotPass_send_back(sellerOrderGoods,orderCode,wayBillCode, type); 253 inBoxFacade.sellerQualityCheckNotPass_send_back(sellerOrderGoods,orderCode,wayBillCode, type);
215 } 254 }
216 255
@@ -271,9 +310,12 @@ public class AppraiseService { @@ -271,9 +310,12 @@ public class AppraiseService {
271 * @outTimeFlag 超时 310 * @outTimeFlag 超时
272 * @return 311 * @return
273 */ 312 */
274 - public ApiResponse miniFaultReject(Long orderCode,boolean outTimeFlag){  
275 - LOGGER.info("miniFaultReject enter , orderCode {} ,outTimeFlag {}", orderCode ,outTimeFlag);  
276 - OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE; 313 + public ApiResponse miniFaultReject(Long orderCode,OrderStatus targetStatus,boolean outTimeFlag){
  314 + LOGGER.info("miniFaultReject enter , orderCode {} ,targetStatus {},outTimeFlag {}", orderCode ,targetStatus ,outTimeFlag);
  315 + OrderStatus expectStatusNew = OrderStatus.MINI_FAULT_WAITING;
  316 + //拆分状态,版本升级之后存在的特殊订单
  317 + OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
  318 + List<Integer> expectStatusList= Lists.newArrayList(expectStatusNew.getCode(),expectStatusAnother.getCode());
277 ApiResponse apiResponse=new ApiResponse(); 319 ApiResponse apiResponse=new ApiResponse();
278 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 320 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
279 321
@@ -282,16 +324,18 @@ public class AppraiseService { @@ -282,16 +324,18 @@ public class AppraiseService {
282 throw new ServiceException(ServiceError.ORDER_NULL); 324 throw new ServiceException(ServiceError.ORDER_NULL);
283 } 325 }
284 326
285 - if (buyerOrder.getStatus() != expectStatus.getCode()){  
286 - LOGGER.warn("miniFaultReject expectStatus {}, actual status {}, orderCode {}", expectStatus, 327 + //if (buyerOrder.getStatus() != expectStatus.getCode()){
  328 + if (!expectStatusList.contains(buyerOrder.getStatus())){
  329 + LOGGER.warn("miniFaultReject expectStatus {}, actual status {}, orderCode {}", expectStatusList,
287 buyerOrder.getStatus(), orderCode); 330 buyerOrder.getStatus(), orderCode);
288 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE); 331 throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
289 } 332 }
290 - // 更新买家订单状态 为鉴定不通过 333 + // 更新买家订单状态
291 int buyerUid = buyerOrder.getUid(); 334 int buyerUid = buyerOrder.getUid();
292 - OrderStatus targetStatus = OrderStatus.CHECKING_FAKE;  
293 LOGGER.info("miniFaultReject update buyer order {} ", buyerOrder); 335 LOGGER.info("miniFaultReject update buyer order {} ", buyerOrder);
294 - int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(), 336 + /* int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(),
  337 + DateUtil.getCurrentTimeSecond());*/
  338 + int rows = buyerOrderMapper.updateStatusByOrderCodeMoreExpectStatus(orderCode, buyerUid, expectStatusList, targetStatus.getCode(),
295 DateUtil.getCurrentTimeSecond()); 339 DateUtil.getCurrentTimeSecond());
296 340
297 if (rows > 0){ 341 if (rows > 0){
@@ -383,7 +427,7 @@ public class AppraiseService { @@ -383,7 +427,7 @@ public class AppraiseService {
383 427
384 }else{ 428 }else{
385 LOGGER.warn("in miniFaultReject, buyer Order now status {}, expect expectStatus {}", 429 LOGGER.warn("in miniFaultReject, buyer Order now status {}, expect expectStatus {}",
386 - buyerOrder.getStatus(), expectStatus); 430 + buyerOrder.getStatus(), expectStatusList);
387 apiResponse.setCode(400); 431 apiResponse.setCode(400);
388 apiResponse.setMessage("订单状态发生变化"); 432 apiResponse.setMessage("订单状态发生变化");
389 } 433 }
@@ -418,11 +462,12 @@ public class AppraiseService { @@ -418,11 +462,12 @@ public class AppraiseService {
418 * 更新发到卖家的物流信息 462 * 更新发到卖家的物流信息
419 * 将卖家的保证金分账给平台和买家 463 * 将卖家的保证金分账给平台和买家
420 * 更新买家订单状态 464 * 更新买家订单状态
421 - * appraiseFlag 鉴定标志,//true 鉴定不通过 ;false 质检不通过 ;  
422 * @return 465 * @return
423 */ 466 */
424 - public ApiResponse appraiseFail(AppraiseExpressInfoBo appraiseExpressInfoBo,OrderStatus expectStatus,boolean appraiseNotPassFlag){  
425 - LOGGER.info("appraiseFail enter , appraiseExpressInfoBo {} ,appraiseNotPassFlag {}", appraiseExpressInfoBo ,appraiseNotPassFlag); 467 + public ApiResponse appraiseFailAndDelivery(AppraiseExpressInfoBo appraiseExpressInfoBo){
  468 + LOGGER.info("appraiseFail enter , appraiseExpressInfoBo {} ,appraiseNotPassFlag {}", appraiseExpressInfoBo );
  469 + OrderStatus expectStatus = OrderStatus.PLATFORM_CHECKING;
  470 + OrderStatus targetStatus = OrderStatus.CHECKING_FAKE;
426 Long orderCode = appraiseExpressInfoBo.getOrderCode(); 471 Long orderCode = appraiseExpressInfoBo.getOrderCode();
427 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId(); 472 Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
428 String wayBillCode = appraiseExpressInfoBo.getWayBillCode(); 473 String wayBillCode = appraiseExpressInfoBo.getWayBillCode();
@@ -444,18 +489,19 @@ public class AppraiseService { @@ -444,18 +489,19 @@ public class AppraiseService {
444 } 489 }
445 // 更新买家订单状态 为鉴定不通过 490 // 更新买家订单状态 为鉴定不通过
446 int buyerUid = buyerOrder.getUid(); 491 int buyerUid = buyerOrder.getUid();
447 - OrderStatus targetStatus = OrderStatus.CHECKING_FAKE; 492 + int sellerUid = buyerOrder.getSellerUid();
448 LOGGER.info("appraiseFail update buyer order {} ", buyerOrder); 493 LOGGER.info("appraiseFail update buyer order {} ", buyerOrder);
449 int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(), 494 int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(),
450 DateUtil.getCurrentTimeSecond()); 495 DateUtil.getCurrentTimeSecond());
451 496
452 if (rows > 0){ 497 if (rows > 0){
  498 + /*
453 //refund coupons of buyer 499 //refund coupons of buyer
454 BuyerRefundCouponEvent brce = BuyerRefundCouponEvent.builder().bizCase(BuyerRefundCouponEvent.BizCase.APPRAISE_FAIL) 500 BuyerRefundCouponEvent brce = BuyerRefundCouponEvent.builder().bizCase(BuyerRefundCouponEvent.BizCase.APPRAISE_FAIL)
455 .uid(buyerUid).orderCode(orderCode).build(); 501 .uid(buyerUid).orderCode(orderCode).build();
456 EventBusPublisher.publishEvent(brce); 502 EventBusPublisher.publishEvent(brce);
457 // 503 //
458 - int sellerUid = buyerOrder.getSellerUid(); 504 +
459 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(buyerUid, orderCode); 505 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(buyerUid, orderCode);
460 int skup = bog.getSkup(); 506 int skup = bog.getSkup();
461 507
@@ -512,6 +558,11 @@ public class AppraiseService { @@ -512,6 +558,11 @@ public class AppraiseService {
512 .loadRefundAction(payRefundService::refund) 558 .loadRefundAction(payRefundService::refund)
513 .loadLogger(LOGGER) 559 .loadLogger(LOGGER)
514 .refund(); 560 .refund();
  561 + */
  562 + RefundMoneyResultModel refundMoneyResultModel= operateMoneyWhenCheckFail(buyerOrder,orderCode,targetStatus);
  563 + boolean refundGoodsMoneyFlag = refundMoneyResultModel.isRefundGoodsMoneyFlag();
  564 + SellerOrderGoods sellerOrderGoods = refundMoneyResultModel.getSellerOrderGoods();
  565 +
515 if (!refundGoodsMoneyFlag){ 566 if (!refundGoodsMoneyFlag){
516 apiResponse.setCode(400); 567 apiResponse.setCode(400);
517 String content = "鉴定不通过时,退用户" + sellerUid + "货款订单"+ orderCode +"失败"; 568 String content = "鉴定不通过时,退用户" + sellerUid + "货款订单"+ orderCode +"失败";
@@ -524,15 +575,9 @@ public class AppraiseService { @@ -524,15 +575,9 @@ public class AppraiseService {
524 orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetStatus.getCode()); 575 orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetStatus.getCode());
525 576
526 //TODO 消息 577 //TODO 消息
527 - if(appraiseNotPassFlag){  
528 - //鉴定不通过 ,其余的情况不发消息,改成寄回的时候再发消息  
529 - inBoxFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode);  
530 - inBoxFacade.buyerGetEarnestMoneyWhenAppraiseFail(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());  
531 - }else {  
532 - //质检不通过  
533 - inBoxFacade.noticeBuyerWhenQualityCheckNotPass(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());  
534 - inBoxFacade.sellerQualityCheckNotPass(sellerOrderGoods,orderCode);  
535 - } 578 + //鉴定不通过 ,其余的情况不发消息,改成寄回的时候再发消息
  579 + inBoxFacade.noticeSellerWhenAppraiseFail(sellerOrderGoods, orderCode, wayBillCode);
  580 + inBoxFacade.buyerGetEarnestMoneyWhenAppraiseFail(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());
536 581
537 }catch(Exception ex) { 582 }catch(Exception ex) {
538 LOGGER.warn("in appraiseFail orderStatusFlowService or notice fail orderCode {}", orderCode, ex); 583 LOGGER.warn("in appraiseFail orderStatusFlowService or notice fail orderCode {}", orderCode, ex);
@@ -541,30 +586,15 @@ public class AppraiseService { @@ -541,30 +586,15 @@ public class AppraiseService {
541 executorService.execute(()->{ 586 executorService.execute(()->{
542 //更新物流信息,写到最后 587 //更新物流信息,写到最后
543 //鉴定不通过,发物流 588 //鉴定不通过,发物流
544 - if(appraiseNotPassFlag){  
545 - //补:鉴定不通过  
546 - EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
547 - EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;  
548 - EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;  
549 - expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode); 589 + //补:鉴定不通过
  590 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  591 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  592 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;
  593 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
550 594
551 - //发货物流(平台已发货)  
552 - expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);  
553 - }else {  
554 - //质检不通过,不发物流 595 + //发货物流(平台已发货)
  596 + expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
555 597
556 - //先补加一条鉴定中物流  
557 - EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
558 - EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;  
559 - EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judging;  
560 - expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);  
561 -  
562 - //再加一个鉴定不通过的物流  
563 - operateTransferCode = EnumExpressDataOperateTransferCode.quality_check_reject;  
564 - expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
565 - expressDataType = EnumExpressDataType.operate_transfer;  
566 - expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);  
567 - }  
568 }); 598 });
569 599
570 } 600 }
@@ -648,7 +678,418 @@ public class AppraiseService { @@ -648,7 +678,418 @@ public class AppraiseService {
648 } 678 }
649 } 679 }
650 680
651 - public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){ 681 + @Data
  682 + class RefundMoneyResultModel{
  683 + boolean refundGoodsMoneyFlag;
  684 + SellerOrderGoods sellerOrderGoods;
  685 + }
  686 +
  687 + /**
  688 + * 鉴定不通或者质检不通过
  689 + * 操作钱
  690 + */
  691 + private RefundMoneyResultModel operateMoneyWhenCheckFail(BuyerOrder buyerOrder, Long orderCode, OrderStatus targetStatus){
  692 + LOGGER.info("operateMoney enter , orderCode {},targetStatus {} ", orderCode ,targetStatus);
  693 + RefundMoneyResultModel model = new RefundMoneyResultModel();
  694 + int buyerUid = buyerOrder.getUid();
  695 + int sellerUid = buyerOrder.getSellerUid();
  696 +
  697 + //refund coupons of buyer
  698 + BuyerRefundCouponEvent brce = BuyerRefundCouponEvent.builder().bizCase(BuyerRefundCouponEvent.BizCase.APPRAISE_FAIL)
  699 + .uid(buyerUid).orderCode(orderCode).build();
  700 + EventBusPublisher.publishEvent(brce);
  701 + //
  702 +
  703 + BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(buyerUid, orderCode);
  704 + int skup = bog.getSkup();
  705 +
  706 + SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
  707 + long sellerOrderCode = sellerOrder.getOrderCode();
  708 +
  709 + final SellerOrderStatus expectSOStatus = SellerOrderStatus.HAS_PAYED;
  710 + final SellerOrderStatus targetSoStatus = SellerOrderStatus.APPRAISAL_FAIL_COMPENSATE;
  711 +
  712 + SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid ,sellerOrderCode,expectSOStatus,targetSoStatus,
  713 + skup, orderCode, buyerUid);
  714 +
  715 + //将卖家的保证金分账给平台和买家
  716 + PenaltyResult penaltyResult = SellerEarnestMoney2BuyerPenaltyCalculator.from(sellerOrderMetaMapper.selectByMetaKey(sellerUid, skup, "fee"))
  717 + .calculate()
  718 + .orElse(null);
  719 + if(Objects.nonNull(penaltyResult)){
  720 + TransferCase transferCase = TransferCase.EARNEST_MONEY_TO_BUYER;
  721 + TranseferCellNode transeferCellNode = new TranseferCellNode();
  722 + transeferCellNode.setUid(buyerUid);
  723 + transeferCellNode.setAmount(penaltyResult.getPenaltyAmountWithoutYhServiceAmount());
  724 + TransferMoneyRequest tmReq = TransferMoneyRequest.builder()
  725 + .sellerUid(sellerUid)
  726 + .buyerOrderCode(orderCode)
  727 + .type(transferCase.getCode())
  728 + .transferCase(transferCase)
  729 + .transeferCellNode(transeferCellNode)
  730 + .swdType(SellerWalletDetail.Type.APPRAISE_FAIL)
  731 + .alarmConfig(AlarmConfig.APPRAISE_FAIL)
  732 + .build();
  733 +
  734 + //先校验,提前把错误抛出
  735 + paymentService.transferMonCheck(tmReq);
  736 + //再分账
  737 +
  738 + //改成异步的分账,不关心分账执行结果
  739 + executorService.execute(()->{
  740 + LOGGER.info("in appraiseFail,begin transfer async");
  741 + transferService.transfer(tmReq);
  742 + });
  743 + }
  744 +
  745 +
  746 + //退钱给买家
  747 + BigDecimal goodsMoney = buyerOrder.getAmount();
  748 + BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
  749 + .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode)
  750 + .payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY)
  751 + .amount(goodsMoney)
  752 + .skup(skup);
  753 + boolean refundGoodsMoneyFlag = new RefundGoodsMoneyHandler().loadPaymentRequest(buyerUid,orderCode,goodsMoney)
  754 + .loadBillLogEventBuilder(bleb)
  755 + .loadTargetOrderStatus(targetStatus)
  756 + .loadRefundAction(payRefundService::refund)
  757 + .loadLogger(LOGGER)
  758 + .refund();
  759 +
  760 + model.setRefundGoodsMoneyFlag(refundGoodsMoneyFlag);
  761 + model.setSellerOrderGoods(sellerOrderGoods);
  762 + return model;
  763 + }
  764 +
  765 + /**
  766 + * 鉴定不通过 3->13 或者 MINI_FAULT_ACCEPT ->13
  767 + * 不发物流
  768 + */
  769 + public ApiResponse judgeCenterNotPass(AppraiseExpressInfoBo appraiseExpressInfoBo){
  770 + LOGGER.info("judgeCenterNotPass enter , appraiseExpressInfoBo {} ", appraiseExpressInfoBo );
  771 + OrderStatus expectStatus ;
  772 + OrderStatus targetStatus = OrderStatus.CHECKING_FAKE;
  773 + Long orderCode = appraiseExpressInfoBo.getOrderCode();
  774 +
  775 + ApiResponse apiResponse=new ApiResponse();
  776 + BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
  777 +
  778 + if (buyerOrder == null){
  779 + LOGGER.warn("judgeCenterNotPass getOrderInfo order not exist, orderCode {}", orderCode);
  780 + throw new ServiceException(ServiceError.ORDER_NULL);
  781 + }
  782 +
  783 + if(buyerOrder.getStatus() == OrderStatus.PLATFORM_CHECKING.getCode()){
  784 + expectStatus = OrderStatus.PLATFORM_CHECKING;
  785 + }else if(buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()){
  786 + expectStatus = OrderStatus.MINI_FAULT_ACCEPT;
  787 + }else{
  788 + LOGGER.warn("judgeCenterNotPass expectStatus PLATFORM_CHECKING or MINI_FAULT_ACCEPT, actual status {}, orderCode {}",
  789 + buyerOrder.getStatus(), orderCode);
  790 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  791 + }
  792 + // 更新买家订单状态
  793 + int buyerUid = buyerOrder.getUid();
  794 + int sellerUid = buyerOrder.getSellerUid();
  795 + LOGGER.info("judgeCenterNotPass update buyer order {} ", buyerOrder);
  796 + int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(),
  797 + DateUtil.getCurrentTimeSecond());
  798 +
  799 + if (rows > 0){
  800 + RefundMoneyResultModel refundMoneyResultModel= operateMoneyWhenCheckFail(buyerOrder,orderCode,targetStatus);
  801 + boolean refundGoodsMoneyFlag = refundMoneyResultModel.isRefundGoodsMoneyFlag();
  802 + SellerOrderGoods sellerOrderGoods = refundMoneyResultModel.getSellerOrderGoods();
  803 + if (!refundGoodsMoneyFlag){
  804 + apiResponse.setCode(400);
  805 + String content = "后台鉴定商品不通过,退用户" + sellerUid + "货款订单"+ orderCode +"失败";
  806 + apiResponse.setMessage(content);
  807 + }
  808 +
  809 + //记录订单的状态变更信息
  810 + LOGGER.info("in judgeCenterNotPass record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
  811 + try {
  812 + orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetStatus.getCode());
  813 +
  814 + //鉴定不通过
  815 + inBoxFacade.noticeBuyerWhenQualityCheckNotPass(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());
  816 + inBoxFacade.sellerQualityCheckNotPass(sellerOrderGoods,orderCode);
  817 +
  818 + }catch(Exception ex) {
  819 + LOGGER.warn("in judgeCenterNotPass orderStatusFlowService or notice fail orderCode {}", orderCode, ex);
  820 + }finally {
  821 + /// 物流信息异步执行
  822 + executorService.execute(()->{
  823 + //鉴定通过,不发物流
  824 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  825 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  826 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;
  827 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
  828 +
  829 + });
  830 +
  831 + }
  832 +
  833 + }else{
  834 + LOGGER.warn("in judgeCenterNotPass, buyer Order now status {}, expect expectStatus {}",
  835 + buyerOrder.getStatus(), expectStatus);
  836 + apiResponse.setCode(400);
  837 + apiResponse.setMessage("订单状态发生变化");
  838 + }
  839 + return apiResponse;
  840 + }
  841 +
  842 + /**
  843 + * 质检不通过 31->20
  844 + * 不发物流
  845 + */
  846 + public ApiResponse qualityCheckReject(AppraiseExpressInfoBo appraiseExpressInfoBo){
  847 + LOGGER.info("qualityCheckReject enter , appraiseExpressInfoBo {} ", appraiseExpressInfoBo );
  848 + OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
  849 + OrderStatus targetStatus = OrderStatus.QUALITY_CHECK_FAKE;
  850 + Long orderCode = appraiseExpressInfoBo.getOrderCode();
  851 +
  852 + ApiResponse apiResponse=new ApiResponse();
  853 + BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
  854 +
  855 + if (buyerOrder == null){
  856 + LOGGER.warn("qualityCheckReject getOrderInfo order not exist, orderCode {}", orderCode);
  857 + throw new ServiceException(ServiceError.ORDER_NULL);
  858 + }
  859 +
  860 + if (buyerOrder.getStatus() != expectStatus.getCode()){
  861 + LOGGER.warn("qualityCheckReject expectStatus {}, actual status {}, orderCode {}", expectStatus,
  862 + buyerOrder.getStatus(), orderCode);
  863 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  864 + }
  865 + // 更新买家订单状态
  866 + int buyerUid = buyerOrder.getUid();
  867 + int sellerUid = buyerOrder.getSellerUid();
  868 + LOGGER.info("qualityCheckReject update buyer order {} ", buyerOrder);
  869 + int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expectStatus.getCode(), targetStatus.getCode(),
  870 + DateUtil.getCurrentTimeSecond());
  871 +
  872 + if (rows > 0){
  873 + RefundMoneyResultModel refundMoneyResultModel= operateMoneyWhenCheckFail(buyerOrder,orderCode,targetStatus);
  874 + boolean refundGoodsMoneyFlag = refundMoneyResultModel.isRefundGoodsMoneyFlag();
  875 + SellerOrderGoods sellerOrderGoods = refundMoneyResultModel.getSellerOrderGoods();
  876 + if (!refundGoodsMoneyFlag){
  877 + apiResponse.setCode(400);
  878 + String content = "后台质检不通过时,退用户" + sellerUid + "货款订单"+ orderCode +"失败";
  879 + apiResponse.setMessage(content);
  880 + }
  881 +
  882 + //记录订单的状态变更信息
  883 + LOGGER.info("in qualityCheckReject record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
  884 + try {
  885 + orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetStatus.getCode());
  886 +
  887 + //质检不通过
  888 + inBoxFacade.noticeBuyerWhenQualityCheckNotPass(buyerUid, buyerOrder.getOrderCode(), sellerOrderGoods.getProductName());
  889 + inBoxFacade.sellerQualityCheckNotPass(sellerOrderGoods,orderCode);
  890 +
  891 + }catch(Exception ex) {
  892 + LOGGER.warn("in qualityCheckReject orderStatusFlowService or notice fail orderCode {}", orderCode, ex);
  893 + }finally {
  894 + /// 物流信息异步执行
  895 + executorService.execute(()->{
  896 + //质检不通过,不发物流
  897 + //先补加一条鉴定中物流
  898 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  899 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  900 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judging;
  901 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
  902 +
  903 + //再加一个鉴定不通过的物流
  904 + operateTransferCode = EnumExpressDataOperateTransferCode.quality_check_reject;
  905 + expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  906 + expressDataType = EnumExpressDataType.operate_transfer;
  907 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
  908 +
  909 + });
  910 +
  911 + }
  912 +
  913 + }else{
  914 + LOGGER.warn("in qualityCheckReject, buyer Order now status {}, expect expectStatus {}",
  915 + buyerOrder.getStatus(), expectStatus);
  916 + apiResponse.setCode(400);
  917 + apiResponse.setMessage("订单状态发生变化");
  918 + }
  919 + return apiResponse;
  920 + }
  921 +
  922 + /**
  923 + * 正常发货
  924 + * 鉴定通过 -- 待收货
  925 + */
  926 + public void deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo){
  927 + LOGGER.info("deliveryGoodsToBuyer enter req {}", appraiseExpressInfoBo);
  928 + final OrderStatus expectOrderStatus = OrderStatus.JUDGE_PASS;
  929 + final OrderStatus targetOrderStatus = OrderStatus.WAITING_RECEIVE;
  930 + Long orderCode = appraiseExpressInfoBo.getOrderCode();
  931 + BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
  932 +
  933 + if (buyerOrder == null){
  934 + LOGGER.warn("deliveryGoodsToBuyer getOrderInfo order not exist, orderCode is {}", orderCode);
  935 + throw new ServiceException(ServiceError.ORDER_NULL);
  936 + }
  937 +
  938 + if (expectOrderStatus.getCode() != buyerOrder.getStatus().intValue()){
  939 + LOGGER.warn("in deliveryGoodsToBuyer, buyer Order orderCode {} pstatus {}, expect Order Status {}",
  940 + orderCode, buyerOrder.getStatus(), expectOrderStatus);
  941 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  942 + }
  943 +
  944 + Integer buyerUid = buyerOrder.getUid();
  945 + int updateBuyerCnt = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid,
  946 + expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond());
  947 + if (updateBuyerCnt == 1){
  948 + //发货,这个时候产生:买家确认收货的mq
  949 + BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
  950 + EventBusPublisher.publishEvent(buyerConfirmEvent);
  951 +
  952 + //记录物流信息
  953 + //发物流
  954 + expressInfoService.deliverGoods(buyerUid, appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
  955 +
  956 + //记录订单的状态变更信息
  957 + orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetOrderStatus.getCode());
  958 +
  959 + //TODO 平台已发货给买家
  960 +
  961 + //清缓存
  962 + cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(),buyerOrder.getUid(),buyerOrder.getSellerUid());
  963 + }else{
  964 + LOGGER.warn("in deliveryGoodsToBuyer update status number zero, buyer Order orderCode {} pstatus {}, expect Order Status {}",
  965 + orderCode, buyerOrder.getStatus(), expectOrderStatus);
  966 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  967 + }
  968 + }
  969 +
  970 + /**
  971 + * 鉴定通过,但是不发货
  972 + * @return
  973 + */
  974 + public ApiResponse judgeCenterPass(Long orderCode){
  975 + LOGGER.info("judgeCenterPass enter orderCode {}", orderCode);
  976 + ApiResponse apiResponse=new ApiResponse();
  977 + BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
  978 +
  979 + if (buyerOrder == null){
  980 + LOGGER.warn("judgeCenterPass getOrderInfo order not exist, orderCode is {}", orderCode);
  981 + throw new ServiceException(ServiceError.ORDER_NULL);
  982 + }
  983 + final OrderStatus expectOrderStatus ;
  984 + final OrderStatus targetOrderStatus = OrderStatus.JUDGE_PASS;
  985 + if( OrderStatus.PLATFORM_CHECKING.getCode() == buyerOrder.getStatus().intValue()){
  986 + expectOrderStatus = OrderStatus.PLATFORM_CHECKING;
  987 + }else if(OrderStatus.MINI_FAULT_ACCEPT.getCode() == buyerOrder.getStatus().intValue()){
  988 + expectOrderStatus = OrderStatus.MINI_FAULT_ACCEPT;
  989 + }else{
  990 + LOGGER.warn("in judgeCenterPass, buyer Order orderCode {} status {}, expect Order Status is OrderStatus.PLATFORM_CHECKING or OrderStatus.MINI_FAULT_ACCEPT ",
  991 + orderCode, buyerOrder.getStatus());
  992 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  993 + }
  994 + LOGGER.info("judgeCenterPass enter orderCode {} ,expectOrderStatus {}", orderCode ,expectOrderStatus);
  995 +
  996 + Integer buyerUid = buyerOrder.getUid();
  997 + BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(buyerUid, orderCode);
  998 + int skup = bog.getSkup();
  999 + SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(skup);
  1000 +
  1001 +
  1002 + int updateBuyerCnt = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid,
  1003 + expectOrderStatus.getCode(), targetOrderStatus.getCode(), DateUtil.getCurrentTimeSecond());
  1004 +
  1005 + if (updateBuyerCnt == 1){
  1006 + final Integer sellerUid = sellerOrder.getUid();
  1007 + final Long sellerOrderCode = sellerOrder.getOrderCode();
  1008 + final SellerOrderStatus expectSOStatus = SellerOrderStatus.HAS_PAYED;
  1009 + final SellerOrderStatus targetSoStatus = SellerOrderStatus.FINISH;
  1010 +
  1011 + /**
  1012 + * 更新卖家订单状态,
  1013 + */
  1014 + SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid ,sellerOrderCode,expectSOStatus,targetSoStatus,
  1015 + skup, orderCode, buyerUid);
  1016 +
  1017 +
  1018 + //退款给卖家(仅退一次)
  1019 + PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid,orderCode,skup,sellerOrder,targetSoStatus);
  1020 +
  1021 + try {
  1022 + //记录订单的状态变更信息
  1023 + LOGGER.info("in judgeCenterPass record status change, orderCode {},uid {} ,sellerUid {}", orderCode,buyerUid,sellerUid);
  1024 + orderStatusFlowService.addAsy(buyerOrder.getOrderCode(),targetOrderStatus.getCode());
  1025 +
  1026 + //TODO 鉴定通过,等待发货,消息
  1027 + //inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods);
  1028 + }catch (Exception ex){
  1029 + LOGGER.warn("in judgeCenterPass,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex);
  1030 + String content = "后台鉴定通过商品,订单"+ orderCode + "退还保证金失败";
  1031 + apiResponse.setCode(400);
  1032 + apiResponse.setMessage(content);
  1033 + }finally {
  1034 + //记录调拨信息
  1035 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  1036 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  1037 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_pass;
  1038 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
  1039 + }
  1040 +
  1041 + LOGGER.info("in judgeCenterPass, refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
  1042 + sellerUid, sellerOrderCode, skup, sellerOrder.getEarnestMoney() );
  1043 +
  1044 +
  1045 + }else{
  1046 + LOGGER.warn("in judgeCenterPass, buyer Order pstatus {}, expect expectOrderStatus {}",
  1047 + buyerOrder.getStatus(), expectOrderStatus);
  1048 + apiResponse.setCode(400);
  1049 + apiResponse.setMessage("订单状态发生变化");
  1050 + }
  1051 +
  1052 + return apiResponse;
  1053 + }
  1054 +
  1055 +
  1056 + /**
  1057 + * 通过时 ,操作钱
  1058 + */
  1059 + private PaymentRequest operateMoneyWhenOk(Integer buyerUid,Long orderCode,int skup,SellerOrder sellerOrder,SellerOrderStatus targetSoStatus){
  1060 + final Integer sellerUid = sellerOrder.getUid();
  1061 + BigDecimal saleIncome = getSaleIncome(sellerUid, skup);
  1062 +
  1063 + TransferCase transferCase = TransferCase.ALL_GOODS_MONEY_TO_SELLER;
  1064 + TranseferCellNode transeferCellNode = new TranseferCellNode();
  1065 + transeferCellNode.setUid(sellerUid);
  1066 + transeferCellNode.setAmount(saleIncome);
  1067 + TransferMoneyRequest tmReq = TransferMoneyRequest.builder()
  1068 + .buyerOrderCode(orderCode)
  1069 + .type(transferCase.getCode())
  1070 + .transferCase(transferCase)
  1071 + .transeferCellNode(transeferCellNode)
  1072 + .alarmConfig(AlarmConfig.APPRAISE_SUCCESS)
  1073 + .build();
  1074 +
  1075 + //先校验,提前把错误抛出
  1076 + paymentService.transferMonCheck(tmReq);
  1077 +
  1078 + //改成异步的分账,不关心分账执行结果
  1079 + executorService.execute(()->{
  1080 + LOGGER.info("in appraiseSuccess,begin transfer async");
  1081 + transferService.transfer(tmReq);
  1082 + });
  1083 +
  1084 + //退保证金给卖家
  1085 + //refund earnestMoney
  1086 + BigDecimal earnestMoney = sellerOrder.getEarnestMoney();
  1087 + PaymentRequest refundReqOfSeller = refundEarnestMoney(SellerWalletDetail.Type.APPRAISE_OK,orderCode,sellerUid ,sellerOrder,skup,buyerUid,targetSoStatus,earnestMoney.doubleValue());
  1088 + LOGGER.info("in appraiseSuccess,refund ok, refundReqOfSeller {}", refundReqOfSeller);
  1089 + return refundReqOfSeller;
  1090 + }
  1091 +
  1092 + public ApiResponse appraiseSuccessAndDelivery(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){
652 ApiResponse apiResponse=new ApiResponse(); 1093 ApiResponse apiResponse=new ApiResponse();
653 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 1094 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
654 1095
@@ -683,6 +1124,7 @@ public class AppraiseService { @@ -683,6 +1124,7 @@ public class AppraiseService {
683 * 退款给卖家(仅退一次) 1124 * 退款给卖家(仅退一次)
684 * 1125 *
685 */ 1126 */
  1127 + /*
686 SellerOrder tso = new SellerOrder(); 1128 SellerOrder tso = new SellerOrder();
687 tso.setUid(sellerUid); 1129 tso.setUid(sellerUid);
688 tso.setOrderCode(sellerOrderCode); 1130 tso.setOrderCode(sellerOrderCode);
@@ -690,6 +1132,15 @@ public class AppraiseService { @@ -690,6 +1132,15 @@ public class AppraiseService {
690 tso.setUpdateTime(DateUtil.getCurrentTimeSecond()); 1132 tso.setUpdateTime(DateUtil.getCurrentTimeSecond());
691 tso.setExceptStatus(expectSOStatus.getCode()); 1133 tso.setExceptStatus(expectSOStatus.getCode());
692 int soCnt = sellerOrderMapper.updateByOrderCode(tso); 1134 int soCnt = sellerOrderMapper.updateByOrderCode(tso);
  1135 + */
  1136 + //更新卖家订单状态
  1137 + SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid ,sellerOrderCode,expectSOStatus,targetSoStatus,
  1138 + skup, orderCode, buyerUid);
  1139 + //退款给卖家(仅退一次)
  1140 + PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid,orderCode,skup,sellerOrder,targetSoStatus);
  1141 +
  1142 +
  1143 + /*
693 BigDecimal saleIncome = getSaleIncome(sellerUid, skup); 1144 BigDecimal saleIncome = getSaleIncome(sellerUid, skup);
694 1145
695 TransferCase transferCase = TransferCase.ALL_GOODS_MONEY_TO_SELLER; 1146 TransferCase transferCase = TransferCase.ALL_GOODS_MONEY_TO_SELLER;
@@ -713,15 +1164,14 @@ public class AppraiseService { @@ -713,15 +1164,14 @@ public class AppraiseService {
713 transferService.transfer(tmReq); 1164 transferService.transfer(tmReq);
714 }); 1165 });
715 1166
716 - /**  
717 - * 退保证金给卖家  
718 - */ 1167 + //退保证金给卖家
719 //refund earnestMoney 1168 //refund earnestMoney
720 BigDecimal earnestMoney = sellerOrder.getEarnestMoney(); 1169 BigDecimal earnestMoney = sellerOrder.getEarnestMoney();
721 PaymentRequest refundReqOfSeller = refundEarnestMoney(SellerWalletDetail.Type.APPRAISE_OK,orderCode,sellerUid ,sellerOrder,skup,buyerUid,targetSoStatus,earnestMoney.doubleValue()); 1170 PaymentRequest refundReqOfSeller = refundEarnestMoney(SellerWalletDetail.Type.APPRAISE_OK,orderCode,sellerUid ,sellerOrder,skup,buyerUid,targetSoStatus,earnestMoney.doubleValue());
722 LOGGER.info("in appraiseSuccess,refund ok, refundReqOfSeller {}", refundReqOfSeller); 1171 LOGGER.info("in appraiseSuccess,refund ok, refundReqOfSeller {}", refundReqOfSeller);
723 1172
724 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 1173 SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
  1174 + */
725 try { 1175 try {
726 //鉴定通过后自动发货,这个时候产生:买家确认收货的mq 1176 //鉴定通过后自动发货,这个时候产生:买家确认收货的mq
727 BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); 1177 BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
@@ -749,6 +1199,7 @@ public class AppraiseService { @@ -749,6 +1199,7 @@ public class AppraiseService {
749 expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode); 1199 expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
750 } 1200 }
751 1201
  1202 + /*
752 cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()), 1203 cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
753 CacheKeyBuilder.orderListKey(buyerUid, TabType.BUY.getValue()), 1204 CacheKeyBuilder.orderListKey(buyerUid, TabType.BUY.getValue()),
754 CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods), 1205 CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods),
@@ -758,9 +1209,10 @@ public class AppraiseService { @@ -758,9 +1209,10 @@ public class AppraiseService {
758 1209
759 ErpBuyerOrderEvent event = new ErpBuyerOrderEvent(buyerUid); 1210 ErpBuyerOrderEvent event = new ErpBuyerOrderEvent(buyerUid);
760 EventBusPublisher.publishEvent(event); 1211 EventBusPublisher.publishEvent(event);
  1212 + */
761 1213
762 LOGGER.info("in appraiseSuccess, refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}", 1214 LOGGER.info("in appraiseSuccess, refund earnestMoney finish, seller {}, order code {}, skup {}, earnestMoney {}",
763 - sellerUid, sellerOrderCode, skup, earnestMoney ); 1215 + sellerUid, sellerOrderCode, skup, sellerOrder.getEarnestMoney() );
764 1216
765 1217
766 }else{ 1218 }else{
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl; @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
2 2
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
  5 +import com.google.common.collect.Lists;
5 import com.yoho.error.ServiceError; 6 import com.yoho.error.ServiceError;
6 import com.yoho.error.exception.ServiceException; 7 import com.yoho.error.exception.ServiceException;
7 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo; 8 import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
@@ -482,6 +483,43 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -482,6 +483,43 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
482 node.buyerOrderInDB = buyerOrder; 483 node.buyerOrderInDB = buyerOrder;
483 return node; 484 return node;
484 } 485 }
  486 +
  487 + /**
  488 + * 该方法再6.8.6.5版本中使用,拆分订单的时候,存在多种情况expectStatus
  489 + * 瑕疵接受
  490 + * 瑕疵不接受 这两种情形使用
  491 + */
  492 + @Deprecated
  493 + private void checkStatusWithMoreExpectStatus(DataNode node, OrderRequest orderRequest, List<Integer> expectStatusList ) {
  494 +
  495 + BuyerOrder buyerOrder = node.buyerOrderInDB;
  496 + // 检查 订单状态
  497 + int status = buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus().intValue();
  498 + OrderStatus orderStatus = OrderStatus.getOrderStatus(status);
  499 + if (orderStatus == null || !expectStatusList.contains(orderStatus.getCode())){
  500 + logger.warn("check status invalidate, uid is {}, orderCode is {}, status is {}",
  501 + orderRequest.getUid(), orderRequest.getOrderCode(), buyerOrder.getStatus());
  502 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  503 + }
  504 +
  505 + // 状态是待支付的场合,到第三方检查是否支付过了
  506 + Payment payment = Payment.getPayment(buyerOrder.getPayment());
  507 + if (payment != null && status == OrderStatus.WAITING_PAY.getCode()){
  508 + /*AbstractPayService payService = paymentService.getPayService(payment.getCode());
  509 + PayQueryBo payQueryBo = payService.payQuery(String.valueOf(buyerOrder.getOrderCode()));
  510 +
  511 + if (payQueryBo != null && payQueryBo.isPayStatus()){
  512 + logger.warn("check status failed ,confirm paid, uid is {}, orderCode is {}, status is {}",
  513 + orderRequest.getUid(), orderRequest.getOrderCode(), buyerOrder.getStatus());
  514 + // 主动触发支付结果确认
  515 + PayConfirmEvent event = new PayConfirmEvent(buyerOrder.getUid(), buyerOrder.getOrderCode(), buyerOrder.getPayment());
  516 + EventBusPublisher.publishEvent(event);
  517 +
  518 + throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
  519 + }*/
  520 + }
  521 + }
  522 +
485 /** 523 /**
486 * 524 *
487 * @param orderRequest 525 * @param orderRequest
@@ -743,6 +781,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -743,6 +781,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
743 public void miniFaultCreate(long orderCode){ 781 public void miniFaultCreate(long orderCode){
744 logger.info("in miniFaultCreate, orderCode {}", orderCode); 782 logger.info("in miniFaultCreate, orderCode {}", orderCode);
745 OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE; 783 OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;
  784 + OrderStatus targetStatus = OrderStatus.MINI_FAULT_WAITING;
746 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode); 785 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
747 if (buyerOrder == null ){ 786 if (buyerOrder == null ){
748 throw new ServiceException(400,"订单为空"); 787 throw new ServiceException(400,"订单为空");
@@ -754,30 +793,33 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -754,30 +793,33 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
754 int uid = buyerOrder.getUid(); 793 int uid = buyerOrder.getUid();
755 int sellerUid = buyerOrder.getSellerUid(); 794 int sellerUid = buyerOrder.getSellerUid();
756 795
  796 + if (1 == buyerOrderMapper.updateStatusByOrderCode(orderCode, uid,
  797 + expectStatus.getCode(),
  798 + targetStatus.getCode(),
  799 + DateUtil.getCurrentTimeSecond())) {
  800 + //先补一条鉴定中
  801 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  802 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  803 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judging;
  804 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
757 805
758 - //先补一条鉴定中  
759 - EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
760 - EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;  
761 - EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judging;  
762 - expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);  
763 -  
764 - //记录调拨信息(只保存卖家一条)  
765 - expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
766 - expressDataType = EnumExpressDataType.operate_transfer;  
767 - operateTransferCode = EnumExpressDataOperateTransferCode.mini_fault_create;  
768 - expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);  
769 -  
770 - //TODO 产生一个延时队列(24小时后,超时确认)  
771 - BuyerMiniFaultOuterTimeEvent miniFaultOuterTimeEvent = BuyerMiniFaultOuterTimeEvent.builder().uid(uid).orderCode(orderCode).build();  
772 - logger.info("in miniFaultCreate, push event uid {} ,order code {} ", miniFaultOuterTimeEvent.getUid(),miniFaultOuterTimeEvent.getOrderCode());  
773 - EventBusPublisher.publishEvent(miniFaultOuterTimeEvent); 806 + //记录调拨信息(只保存卖家一条)
  807 + expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  808 + expressDataType = EnumExpressDataType.operate_transfer;
  809 + operateTransferCode = EnumExpressDataOperateTransferCode.mini_fault_create;
  810 + expressInfoService.saveOperateTransferExpressInfo(sellerUid,orderCode,expressType.getCode(),expressDataType,operateTransferCode);
774 811
  812 + //TODO 产生一个延时队列(24小时后,超时确认)
  813 + BuyerMiniFaultOuterTimeEvent miniFaultOuterTimeEvent = BuyerMiniFaultOuterTimeEvent.builder().uid(uid).orderCode(orderCode).build();
  814 + logger.info("in miniFaultCreate, push event uid {} ,order code {} ", miniFaultOuterTimeEvent.getUid(),miniFaultOuterTimeEvent.getOrderCode());
  815 + EventBusPublisher.publishEvent(miniFaultOuterTimeEvent);
775 816
776 - SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(orderCode,uid,sellerUid);  
777 817
778 - //消息  
779 - inBoxFacade.buyerMiniFaultCreate(uid,orderCode,sellerOrderGoods.getProductName()); 818 + SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(orderCode,uid,sellerUid);
780 819
  820 + //消息
  821 + inBoxFacade.buyerMiniFaultCreate(uid,orderCode,sellerOrderGoods.getProductName());
  822 + }
781 } 823 }
782 824
783 /** 825 /**
@@ -788,18 +830,21 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -788,18 +830,21 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
788 public void miniFaultAccept(OrderRequest orderRequest){ 830 public void miniFaultAccept(OrderRequest orderRequest){
789 logger.info("Buyer Order miniFaultAccept (OrderRequest) {}", orderRequest); 831 logger.info("Buyer Order miniFaultAccept (OrderRequest) {}", orderRequest);
790 //订单状态变更为鉴定中 ,记录调拨的物流信息 ,发消息 , 832 //订单状态变更为鉴定中 ,记录调拨的物流信息 ,发消息 ,
791 - OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;  
792 - OrderStatus targetStatus = OrderStatus.PLATFORM_CHECKING; 833 + OrderStatus expectStatusNew = OrderStatus.MINI_FAULT_WAITING;
  834 + //拆分状态,版本升级之后存在的特殊订单
  835 + OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
  836 + List<Integer> expectStatusList= Lists.newArrayList(expectStatusNew.getCode(),expectStatusAnother.getCode());
  837 + OrderStatus targetStatus = OrderStatus.MINI_FAULT_ACCEPT;
793 // 参数检查 838 // 参数检查
794 DataNode node = checkBase(orderRequest); 839 DataNode node = checkBase(orderRequest);
795 - checkStatus(node,orderRequest, expectStatus); 840 + checkStatusWithMoreExpectStatus(node,orderRequest, expectStatusList);
796 int uid=orderRequest.getUid(); 841 int uid=orderRequest.getUid();
797 long orderCode=orderRequest.getOrderCode(); 842 long orderCode=orderRequest.getOrderCode();
798 843
799 BuyerOrder buyerOrder = node.buyerOrderInDB; 844 BuyerOrder buyerOrder = node.buyerOrderInDB;
800 int sellerUid = buyerOrder.getSellerUid(); 845 int sellerUid = buyerOrder.getSellerUid();
801 - if (1 == buyerOrderMapper.updateStatusByOrderCode(orderCode, uid,  
802 - expectStatus.getCode(), 846 + if (1 == buyerOrderMapper.updateStatusByOrderCodeMoreExpectStatus(orderCode, uid,
  847 + expectStatusList,
803 targetStatus.getCode(), 848 targetStatus.getCode(),
804 DateUtil.getCurrentTimeSecond())) { 849 DateUtil.getCurrentTimeSecond())) {
805 logger.info("Buyer Order miniFaultAccept (OrderRequest) {} ,update status success ", orderRequest); 850 logger.info("Buyer Order miniFaultAccept (OrderRequest) {} ,update status success ", orderRequest);
@@ -832,21 +877,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -832,21 +877,16 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
832 public void miniFaultReject(OrderRequest orderRequest){ 877 public void miniFaultReject(OrderRequest orderRequest){
833 logger.info("Buyer Order miniFaultReject (OrderRequest) {}", orderRequest); 878 logger.info("Buyer Order miniFaultReject (OrderRequest) {}", orderRequest);
834 //订单状态变更为 鉴定不通过 ,记录调拨的物流信息 ,发消息 , 879 //订单状态变更为 鉴定不通过 ,记录调拨的物流信息 ,发消息 ,
835 - OrderStatus expectStatus = OrderStatus.PLATFORM_RECEIVE;  
836 - //OrderStatus targetStatus = OrderStatus.CHECKING_FAKE; 880 + OrderStatus expectStatusNew = OrderStatus.MINI_FAULT_WAITING;
  881 + //拆分状态,版本升级之后存在的特殊订单
  882 + OrderStatus expectStatusAnother = OrderStatus.PLATFORM_RECEIVE;
  883 + List<Integer> expectStatusList= Lists.newArrayList(expectStatusNew.getCode(),expectStatusAnother.getCode());
  884 + OrderStatus targetStatus = OrderStatus.MINI_FAULT_REJECT;
837 // 参数检查 885 // 参数检查
838 DataNode node = checkBase(orderRequest); 886 DataNode node = checkBase(orderRequest);
839 - checkStatus(node,orderRequest, expectStatus);  
840 - //int uid=orderRequest.getUid(); 887 + checkStatusWithMoreExpectStatus(node,orderRequest, expectStatusList);
841 long orderCode=orderRequest.getOrderCode(); 888 long orderCode=orderRequest.getOrderCode();
842 -  
843 - //BuyerOrder buyerOrder = node.buyerOrderInDB;  
844 - //int sellerUid = buyerOrder.getSellerUid();  
845 -  
846 - //调用鉴定不通过的逻辑  
847 - //AppraiseExpressInfoBo appraiseExpressInfoBo=new AppraiseExpressInfoBo();  
848 - //appraiseExpressInfoBo.setOrderCode(orderCode);  
849 - ApiResponse result=appraiseService.miniFaultReject(orderCode,false); 889 + ApiResponse result=appraiseService.miniFaultReject(orderCode,targetStatus,false);
850 890
851 if(result!=null&&result.getCode()==200){ 891 if(result!=null&&result.getCode()==200){
852 //TODO 发消息 892 //TODO 发消息
@@ -440,7 +440,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -440,7 +440,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
440 //5 卖家发货 == 交易关闭 ,全部点亮 440 //5 卖家发货 == 交易关闭 ,全部点亮
441 expressInfoRespBo.setStage(1); 441 expressInfoRespBo.setStage(1);
442 if(OrderStatus.PLATFORM_RECEIVE.getCode()==status 442 if(OrderStatus.PLATFORM_RECEIVE.getCode()==status
443 - ||OrderStatus.PLATFORM_CHECKING.getCode()==status){ 443 + ||OrderStatus.PLATFORM_CHECKING.getCode()==status
  444 + ||OrderStatus.MINI_FAULT_WAITING.getCode()==status
  445 + ||OrderStatus.MINI_FAULT_ACCEPT.getCode()==status
  446 + ||OrderStatus.JUDGE_PASS.getCode()==status){
444 expressInfoRespBo.setStage(2); 447 expressInfoRespBo.setStage(2);
445 }else if(OrderStatus.WAITING_RECEIVE.getCode()==status){ 448 }else if(OrderStatus.WAITING_RECEIVE.getCode()==status){
446 if(TabType.BUY==actor){ 449 if(TabType.BUY==actor){
@@ -452,7 +455,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -452,7 +455,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
452 } 455 }
453 }else if(OrderStatus.DONE.getCode()==status){ 456 }else if(OrderStatus.DONE.getCode()==status){
454 expressInfoRespBo.setStage(3); 457 expressInfoRespBo.setStage(3);
455 - }else if(OrderStatus.CHECKING_FAKE.getCode()==status){ 458 + }else if(OrderStatus.CHECKING_FAKE.getCode()==status
  459 + ||OrderStatus.QUALITY_CHECK_FAKE.getCode()==status
  460 + ||OrderStatus.MINI_FAULT_REJECT.getCode()==status
  461 + ||OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode()==status){
456 expressInfoRespBo.setStage(4); 462 expressInfoRespBo.setStage(4);
457 }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){ 463 }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){
458 expressInfoRespBo.setStage(5); 464 expressInfoRespBo.setStage(5);
@@ -519,12 +525,18 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -519,12 +525,18 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
519 ){ 525 ){
520 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode()); 526 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
521 }else if(OrderStatus.PLATFORM_RECEIVE.getCode()==status 527 }else if(OrderStatus.PLATFORM_RECEIVE.getCode()==status
522 - ||OrderStatus.PLATFORM_CHECKING.getCode()==status){ 528 + ||OrderStatus.PLATFORM_CHECKING.getCode()==status
  529 + ||OrderStatus.MINI_FAULT_WAITING.getCode()==status
  530 + ||OrderStatus.MINI_FAULT_ACCEPT.getCode()==status
  531 + ||OrderStatus.JUDGE_PASS.getCode()==status){
523 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 532 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
524 }else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){ 533 }else if(OrderStatus.WAITING_RECEIVE.getCode()==status||OrderStatus.DONE.getCode()==status){
525 //4 和 5 状态有问题 ,买家查看物流是没问题的,卖家查看物流有问题啊. 534 //4 和 5 状态有问题 ,买家查看物流是没问题的,卖家查看物流有问题啊.
526 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 535 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
527 - }else if(OrderStatus.CHECKING_FAKE.getCode()==status){ 536 + }else if(OrderStatus.CHECKING_FAKE.getCode()==status
  537 + ||OrderStatus.QUALITY_CHECK_FAKE.getCode()==status
  538 + ||OrderStatus.MINI_FAULT_REJECT.getCode()==status
  539 + ||OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode()==status){
528 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_3.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 540 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_3.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
529 }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){ 541 }else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){
530 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_REBACK.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode()); 542 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_REBACK.getCode(),EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(),EnumExpressType.EXPRESS_TYPE_1.getCode());
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <properties> 18 <properties>
19 <qiniu.version>7.0.5</qiniu.version> 19 <qiniu.version>7.0.5</qiniu.version>
20 <project-name>yohoufo-fore</project-name> 20 <project-name>yohoufo-fore</project-name>
21 - <model.version>6.0-SNAPSHOT</model.version> 21 + <model.version>6.5-SNAPSHOT</model.version>
22 </properties> 22 </properties>
23 23
24 <dependencyManagement> 24 <dependencyManagement>