Authored by mali

Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.10

@@ -25,7 +25,7 @@ public interface AppraiseOrderMapper { @@ -25,7 +25,7 @@ public interface AppraiseOrderMapper {
25 @Param("limit")int limit); 25 @Param("limit")int limit);
26 26
27 27
28 - int selectSubOrderCntNotDefinedStatus(@Param("parentOrderCode") long parentOrderCode, @Param("statusList")Collection<Integer> statusList); 28 + int selectSubOrderCntIncludeStatus(@Param("parentOrderCode") long parentOrderCode, @Param("statusList")Collection<Integer> statusList);
29 29
30 AppraiseOrder selectByOrderCode(long orderCode); 30 AppraiseOrder selectByOrderCode(long orderCode);
31 31
@@ -60,4 +60,6 @@ public interface AppraiseOrderMapper { @@ -60,4 +60,6 @@ public interface AppraiseOrderMapper {
60 * @return 60 * @return
61 */ 61 */
62 List<AppraiseOrder> selectByOrderCodeList(@Param("orderList")List<Long> orderList); 62 List<AppraiseOrder> selectByOrderCodeList(@Param("orderList")List<Long> orderList);
  63 +
  64 + List<AppraiseOrder> selectSubOrderStatistic(@Param("parentOrderCode")long parentOrderCode);
63 } 65 }
@@ -35,4 +35,8 @@ public class AppraiseOrder { @@ -35,4 +35,8 @@ public class AppraiseOrder {
35 private Integer attributes; 35 private Integer attributes;
36 36
37 private Byte platformDeliveryStatus; 37 private Byte platformDeliveryStatus;
  38 + /**
  39 + * 状态分组统计
  40 + */
  41 + private Integer statusCnt;
38 } 42 }
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 <result column="channel_no" jdbcType="VARCHAR" property="channelNo" /> 17 <result column="channel_no" jdbcType="VARCHAR" property="channelNo" />
18 <result column="attributes" jdbcType="INTEGER" property="attributes" /> 18 <result column="attributes" jdbcType="INTEGER" property="attributes" />
19 <result column="platform_delivery_status" jdbcType="TINYINT" property="platformDeliveryStatus" /> 19 <result column="platform_delivery_status" jdbcType="TINYINT" property="platformDeliveryStatus" />
  20 + <result column="status_cnt" jdbcType="INTEGER" property="statusCnt"/>
20 </resultMap> 21 </resultMap>
21 <sql id="Base_Column_List"> 22 <sql id="Base_Column_List">
22 id, uid, parent_order_code, order_code, client_type, payment, amount, ship_fee, status, 23 id, uid, parent_order_code, order_code, client_type, payment, amount, ship_fee, status,
@@ -32,16 +33,13 @@ @@ -32,16 +33,13 @@
32 </select> 33 </select>
33 34
34 35
35 - <select id="selectSubOrderCntNotDefinedStatus" resultType="java.lang.Integer">  
36 - select  
37 - count(1)  
38 - from appraise_order 36 + <select id="selectSubOrderCntIncludeStatus" resultType="java.lang.Integer">
  37 + select count(*) from appraise_order
39 where parent_order_code = #{parentOrderCode,jdbcType=INTEGER} 38 where parent_order_code = #{parentOrderCode,jdbcType=INTEGER}
40 - and status not in 39 + and status in
41 <foreach collection="statusList" item="status" open="(" close=")" separator=","> 40 <foreach collection="statusList" item="status" open="(" close=")" separator=",">
42 #{status,jdbcType=TINYINT} 41 #{status,jdbcType=TINYINT}
43 </foreach> 42 </foreach>
44 - and is_del=1  
45 </select> 43 </select>
46 44
47 45
@@ -272,4 +270,10 @@ @@ -272,4 +270,10 @@
272 #{orderCode,jdbcType=BIGINT} 270 #{orderCode,jdbcType=BIGINT}
273 </foreach> 271 </foreach>
274 </select> 272 </select>
  273 +
  274 + <select id="selectSubOrderStatistic" resultMap="BaseResultMap">
  275 + select parent_order_code,status, count(*) status_cnt from ufo_order.appraise_order
  276 + where parent_order_code = #{parentOrderCode,jdbcType=BIGINT}
  277 + group by status
  278 + </select>
275 </mapper> 279 </mapper>
@@ -106,9 +106,9 @@ public class AppraiseController { @@ -106,9 +106,9 @@ public class AppraiseController {
106 /** 106 /**
107 * 给付费寄存 and 付费鉴定 发货用<br><br/> 107 * 给付费寄存 and 付费鉴定 发货用<br><br/>
108 * 鉴定结果为以下场景,寄回 108 * 鉴定结果为以下场景,寄回
109 - * 1.瑕疵,鉴定为假,虚假发货,质检不通过取消 109 + * 1.鉴定为假,质检不通过取消
110 * 2.无法鉴定 110 * 2.无法鉴定
111 - * 3.鉴定通过 111 + * 3.鉴定通过 (实物寄存)
112 * 112 *
113 * 提供给运营平台使用 113 * 提供给运营平台使用
114 * @return 114 * @return
  1 +package com.yohoufo.order.event;
  2 +
  3 +import lombok.Getter;
  4 +import lombok.Setter;
  5 +import lombok.ToString;
  6 +
  7 +import java.util.function.Function;
  8 +@ToString(of = { "orderCode" })
  9 +public class SellerDepositOrderStatusConsistencyAsyncEvent
  10 + extends AsyncEvent{
  11 + @Getter@Setter
  12 + private Long orderCode;
  13 +
  14 + public SellerDepositOrderStatusConsistencyAsyncEvent(Function<SellerDepositOrderStatusConsistencyAsyncEvent,Integer> function) {
  15 + super(function);
  16 + }
  17 +
  18 + @Override
  19 + AsyncEvent getAsyncEvent() {
  20 + return this;
  21 + }
  22 +}
@@ -63,7 +63,7 @@ public class AppraiseExpressStageBuilder { @@ -63,7 +63,7 @@ public class AppraiseExpressStageBuilder {
63 if (status == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){ 63 if (status == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){
64 return DEPOSIT_USER_DELIVERY; 64 return DEPOSIT_USER_DELIVERY;
65 }else if (status == AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() 65 }else if (status == AppraiseOrderStatus.PLATFORM_RECEIVE.getCode()
66 - || status == AppraiseOrderStatus.JUDGE_PASS.getCode()){ 66 + || status == AppraiseOrderStatus.FINISH.getCode()){
67 return DEPOSIT_PLATFORM_RECEIPT; 67 return DEPOSIT_PLATFORM_RECEIPT;
68 } 68 }
69 69
@@ -71,7 +71,9 @@ public class AppraiseExpressStageBuilder { @@ -71,7 +71,9 @@ public class AppraiseExpressStageBuilder {
71 // 子订单 71 // 子订单
72 else{ 72 else{
73 73
74 - if (status == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){ 74 + if (status == AppraiseOrderStatus.CHECKING_FAKE.getCode()
  75 + || status == AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()
  76 + || status == AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()){
75 return DEPOSIT_PLATFORM_DELIVER; 77 return DEPOSIT_PLATFORM_DELIVER;
76 } 78 }
77 79
@@ -226,7 +226,6 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements @@ -226,7 +226,6 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
226 add(AppraiseOrderStatus.SELLER_SEND_OUT.getCode()); 226 add(AppraiseOrderStatus.SELLER_SEND_OUT.getCode());
227 add(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode()); 227 add(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode());
228 add(AppraiseOrderStatus.JUDGE_PASS.getCode()); 228 add(AppraiseOrderStatus.JUDGE_PASS.getCode());
229 - add(AppraiseOrderStatus.WAITING_RECEIVE.getCode());  
230 add(AppraiseOrderStatus.CHECKING_FAKE.getCode()); 229 add(AppraiseOrderStatus.CHECKING_FAKE.getCode());
231 add(AppraiseOrderStatus.SHAM_SEND_OUT.getCode()); 230 add(AppraiseOrderStatus.SHAM_SEND_OUT.getCode());
232 add(AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()); 231 add(AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode());
@@ -518,7 +518,7 @@ public class AppraiseService { @@ -518,7 +518,7 @@ public class AppraiseService {
518 /** 518 /**
519 * 给付费寄存 and 付费鉴定 发货用<br><br/> 519 * 给付费寄存 and 付费鉴定 发货用<br><br/>
520 * 鉴定结果为以下场景,寄回 520 * 鉴定结果为以下场景,寄回
521 - * 1.瑕疵,鉴定为假,虚假发货,质检不通过取消 521 + * 1.鉴定为假,质检不通过取消
522 * 2.无法鉴定 522 * 2.无法鉴定
523 * 3.鉴定通过 523 * 3.鉴定通过
524 * 524 *
@@ -586,15 +586,11 @@ public class AppraiseService { @@ -586,15 +586,11 @@ public class AppraiseService {
586 return new ApiResponse(); 586 return new ApiResponse();
587 } 587 }
588 588
589 - AppraiseOrderStorage appraiseOrderStorage = appraiseOrderStorageMapper.selectByOrderCode(orderCode);  
590 - if (appraiseOrderStorage == null){  
591 - LOGGER.warn("appraise order storage not exist {}", orderCode);  
592 - return new ApiResponse();  
593 - }  
594 -  
595 // 子订单对应商品 1:1 589 // 子订单对应商品 1:1
596 AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0); 590 AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0);
597 - inBoxFacade.sendInboxSmsWhenAppraiseFinished(uid, oneAppraiseOrderGood.getProductName(),appraiseOrderStorage.getSizeName(), oneAppraiseOrderGood.getProductCode(), wayBillCode); 591 + inBoxFacade.sendInboxSmsWhenAppraiseFinished(uid, oneAppraiseOrderGood.getProductName(),
  592 + oneAppraiseOrderGood.getProductCode(),
  593 + wayBillCode);
598 } 594 }
599 595
600 if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_DEPOSIT.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态 596 if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_DEPOSIT.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态
@@ -695,6 +695,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -695,6 +695,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
695 return false; 695 return false;
696 } 696 }
697 697
  698 + @Autowired
  699 + private AppraiseOrderMapper appraiseOrderMapper;
698 700
699 @Override 701 @Override
700 public void confirmReceive(long orderCode) { 702 public void confirmReceive(long orderCode) {
@@ -703,7 +705,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -703,7 +705,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
703 logger.info("in confirmReceive isGoodsServiceOrder, orderCode {}", orderCode); 705 logger.info("in confirmReceive isGoodsServiceOrder, orderCode {}", orderCode);
704 706
705 ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode); 707 ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
706 - existenceNode.getGoodsService().platformReceiveGoods(existenceNode.appraiseOrder); 708 + int rows = existenceNode.getGoodsService().platformReceiveGoods(existenceNode.appraiseOrder);
  709 + if (rows==0){
  710 + return;
  711 + }
707 // 确认收货过来的是子订单号 712 // 确认收货过来的是子订单号
708 Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode(); 713 Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
709 if (parentOrderCode == null){ 714 if (parentOrderCode == null){
@@ -714,17 +719,26 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -714,17 +719,26 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
714 expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), orderCode ,expressType.getCode(),expressDataType,operateTransferCode); 719 expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), orderCode ,expressType.getCode(),expressDataType,operateTransferCode);
715 return; 720 return;
716 } 721 }
717 - List<Integer> status = Lists.newArrayList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), AppraiseOrderStatus.CHECKING_FAKE.getCode());  
718 - int cnt = serviceOrderProcessor.getSubOrderCntNotDefinedStatus(parentOrderCode, status); 722 + // 上一个状态是[卖家已发货] 该父订单下状态为[卖家已发货]的子订单数量为0,代表父订单状态应该为 [已收货]
  723 + List<Integer> status = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode());
  724 + int cnt = serviceOrderProcessor.getSubOrderCntIncludeStatus(parentOrderCode, status);
719 logger.info("no confirm delivery sub order cnt is {}, parentOrderCode {}", cnt, parentOrderCode); 725 logger.info("no confirm delivery sub order cnt is {}, parentOrderCode {}", cnt, parentOrderCode);
720 -  
721 - // 父订单下所有的子订单都是 [平台已收货] or [虚假发货] 的情况 726 + int cdt = DateUtil.getCurrentTimeSecond();
  727 + //
722 if (cnt == 0){ 728 if (cnt == 0){
723 // 平台收货 内部调拨信息 729 // 平台收货 内部调拨信息
724 - EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;  
725 - EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;  
726 - EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;  
727 - expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),parentOrderCode ,expressType.getCode(),expressDataType,operateTransferCode); 730 + try {
  731 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  732 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  733 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
  734 + expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), parentOrderCode, expressType.getCode(), expressDataType, operateTransferCode);
  735 + }catch (Exception ex){
  736 + logger.warn("in confirmReceive isGoodsServiceOrder saveOperateTransferExpressInfo fail ,orderCode {} ", orderCode, ex);
  737 + }
  738 + //update
  739 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,
  740 + expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
  741 + appraiseOrderMapper.updateStatusByOrderCode(parentOrderCode, targetStatus.getCode(), expectedStatus.getCode(), cdt);
728 } 742 }
729 743
730 return; 744 return;
@@ -561,6 +561,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -561,6 +561,11 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
561 561
562 } 562 }
563 563
  564 + List<Integer> expressInfoStatus = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(),
  565 + AppraiseOrderStatus.JUDGE_PASS.getCode(),
  566 + AppraiseOrderStatus.CHECKING_FAKE.getCode(),
  567 + AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode(),
  568 + AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode());
564 569
565 /** 570 /**
566 * 付费鉴定 and 付费寄存 物流信息 571 * 付费鉴定 and 付费寄存 物流信息
@@ -579,8 +584,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -579,8 +584,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
579 if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_APPRAISE.getCode()){ 584 if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_APPRAISE.getCode()){
580 585
581 // 用户发货, 待用户收货 只有这两个状态展示物流 586 // 用户发货, 待用户收货 只有这两个状态展示物流
582 - throwServiceExceptionIf(appraiseOrder.getStatus() != AppraiseOrderStatus.SELLER_SEND_OUT.getCode()  
583 - && appraiseOrder.getStatus() != AppraiseOrderStatus.WAITING_RECEIVE.getCode(), "不展示物流信息"); 587 + throwServiceExceptionIf(!expressInfoStatus.contains(appraiseOrder.getStatus()),
  588 + "不展示物流信息");
584 589
585 List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder); 590 List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder);
586 if (CollectionUtils.isEmpty(expressTypeList)) { 591 if (CollectionUtils.isEmpty(expressTypeList)) {
@@ -773,7 +778,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -773,7 +778,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
773 // 用户发货 778 // 用户发货
774 if(status == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){ 779 if(status == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){
775 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode()); 780 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
776 - }else if(status == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){ 781 + }else if(status == AppraiseOrderStatus.JUDGE_PASS.getCode()
  782 + || status == AppraiseOrderStatus.CHECKING_FAKE.getCode()
  783 + || status == AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()
  784 + || status == AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()){
777 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(), 785 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
778 EnumExpressType.EXPRESS_TYPE_3.getCode(), 786 EnumExpressType.EXPRESS_TYPE_3.getCode(),
779 EnumExpressType.EXPRESS_TYPE_REBACK.getCode()); 787 EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
@@ -787,7 +795,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -787,7 +795,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
787 if (isSubOrder){ 795 if (isSubOrder){
788 796
789 // 子订单状态: 虚假发货,质检不通过, 鉴定通过,鉴定不通过,无法鉴定,等待用户收货 797 // 子订单状态: 虚假发货,质检不通过, 鉴定通过,鉴定不通过,无法鉴定,等待用户收货
790 - if (status == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){ 798 + if (status == AppraiseOrderStatus.CHECKING_FAKE.getCode()
  799 + || status == AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()
  800 + || status == AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()){
791 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(), 801 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
792 EnumExpressType.EXPRESS_TYPE_3.getCode(), 802 EnumExpressType.EXPRESS_TYPE_3.getCode(),
793 EnumExpressType.EXPRESS_TYPE_REBACK.getCode()); 803 EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
@@ -800,7 +810,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -800,7 +810,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
800 } 810 }
801 // 这些状态需要展示 平台鉴定 811 // 这些状态需要展示 平台鉴定
802 else if (AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() == status 812 else if (AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() == status
803 - || AppraiseOrderStatus.JUDGE_PASS.getCode() == status) { 813 + || AppraiseOrderStatus.FINISH.getCode() == status) {
804 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(), EnumExpressType.EXPRESS_TYPE_1.getCode()); 814 return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(), EnumExpressType.EXPRESS_TYPE_1.getCode());
805 } 815 }
806 } 816 }
@@ -107,8 +107,8 @@ public class ServiceOrderProcessor { @@ -107,8 +107,8 @@ public class ServiceOrderProcessor {
107 * @param status 107 * @param status
108 * @return 108 * @return
109 */ 109 */
110 - public int getSubOrderCntNotDefinedStatus(long parentOrderCoe, List<Integer> status){  
111 - return appraiseOrderMapper.selectSubOrderCntNotDefinedStatus(parentOrderCoe, status); 110 + public int getSubOrderCntIncludeStatus(long parentOrderCoe, List<Integer> status){
  111 + return appraiseOrderMapper.selectSubOrderCntIncludeStatus(parentOrderCoe, status);
112 } 112 }
113 113
114 114
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
4 import com.yoho.message.sdk.common.model.SendMessageRspBo; 4 import com.yoho.message.sdk.common.model.SendMessageRspBo;
5 import com.yoho.message.sdk.service.ufo.IUFOSendService; 5 import com.yoho.message.sdk.service.ufo.IUFOSendService;
6 import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum; 6 import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
  7 +import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
7 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; 8 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
8 import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel; 9 import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
9 import com.yohobuy.ufo.model.order.vo.GoodsVo; 10 import com.yohobuy.ufo.model.order.vo.GoodsVo;
@@ -18,6 +19,7 @@ import com.yohoufo.inboxclient.model.InBoxResponse; @@ -18,6 +19,7 @@ import com.yohoufo.inboxclient.model.InBoxResponse;
18 import com.yohoufo.inboxclient.model.InboxReqVO; 19 import com.yohoufo.inboxclient.model.InboxReqVO;
19 import com.yohoufo.inboxclient.sdk.InBoxSDK; 20 import com.yohoufo.inboxclient.sdk.InBoxSDK;
20 import com.yohoufo.order.service.impl.function.BuyerNoticeSender; 21 import com.yohoufo.order.service.impl.function.BuyerNoticeSender;
  22 +import com.yohoufo.order.service.seller.deposit.SellerDepositOrderService;
21 import com.yohoufo.order.utils.NamedThreadFactory; 23 import com.yohoufo.order.utils.NamedThreadFactory;
22 import com.yohoufo.order.utils.PaymentHelper; 24 import com.yohoufo.order.utils.PaymentHelper;
23 import lombok.NonNull; 25 import lombok.NonNull;
@@ -77,6 +79,9 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -77,6 +79,9 @@ public class InBoxFacade extends BaseNoticeFacade{
77 @Autowired 79 @Autowired
78 private BuyerNoticeFacade buyerNoticeFacade; 80 private BuyerNoticeFacade buyerNoticeFacade;
79 81
  82 + @Autowired
  83 + private SellerDepositOrderService sellerDepositOrderService;
  84 +
80 @Override 85 @Override
81 public Logger getLogger() { 86 public Logger getLogger() {
82 return log; 87 return log;
@@ -331,30 +336,29 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -331,30 +336,29 @@ public class InBoxFacade extends BaseNoticeFacade{
331 * 鉴定结束发货,发送站内信和短信 336 * 鉴定结束发货,发送站内信和短信
332 * @param uid 337 * @param uid
333 * @param prdName 338 * @param prdName
334 - * @param sizeName  
335 * @param productCode 339 * @param productCode
336 * @param wayBillCode 340 * @param wayBillCode
337 */ 341 */
338 - public void sendInboxSmsWhenAppraiseFinished(int uid, String prdName, String sizeName, String productCode,String wayBillCode){ 342 + public void sendInboxSmsWhenAppraiseFinished(int uid, String prdName, String productCode,String wayBillCode){
339 343
340 try { 344 try {
341 executorService.execute(() -> { 345 executorService.execute(() -> {
342 - String params = buildParams(prdName, sizeName, productCode); 346 + String params = buildParams(prdName, productCode);
343 InboxReqVO req = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED); 347 InboxReqVO req = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED);
344 348
345 InBoxResponse resp = inBoxSDK.addInbox(req); 349 InBoxResponse resp = inBoxSDK.addInbox(req);
346 - log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, resp {}",uid, prdName, resp);  
347 - 350 + log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, wayBillCode {}, resp {}", uid, prdName, wayBillCode, resp);
348 351
349 //短信 352 //短信
350 String phone = userProxyService.getMobile(uid); 353 String phone = userProxyService.getMobile(uid);
351 if (StringUtils.isBlank(phone)){ 354 if (StringUtils.isBlank(phone)){
352 - log.warn("sendInboxSmsComm sms send fail,sellerUid {}, prdName {} timelimitDesc {}",uid, prdName); 355 + log.warn("sendInboxSmsWhenAppraiseFinished sms send fail,sellerUid {}, prdName {} timelimitDesc {}",uid, prdName);
353 return; 356 return;
354 } 357 }
355 List<String> mobileList = Arrays.asList(phone); 358 List<String> mobileList = Arrays.asList(phone);
356 - String content = getReplacedContent(InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED.getContent(),prdName,sizeName,productCode,wayBillCode); 359 + String content = getReplacedContent(InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED.getContent(), prdName ,productCode,wayBillCode);
357 sendSmsService.smsSendByMobile(content, mobileList); 360 sendSmsService.smsSendByMobile(content, mobileList);
  361 + log.info("sendInboxSmsWhenAppraiseFinished sms content {}, mobileList {}", content, mobileList);
358 }); 362 });
359 363
360 } catch (Exception e) { 364 } catch (Exception e) {
@@ -1033,6 +1037,8 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -1033,6 +1037,8 @@ public class InBoxFacade extends BaseNoticeFacade{
1033 .build(); 1037 .build();
1034 } 1038 }
1035 1039
  1040 +
  1041 +
1036 public void sellerDepositOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus){ 1042 public void sellerDepositOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus){
1037 log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus); 1043 log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
1038 try { 1044 try {
@@ -1099,7 +1105,7 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -1099,7 +1105,7 @@ public class InBoxFacade extends BaseNoticeFacade{
1099 inboxParams = buildParams4SellerDepositOrder(orderCode); 1105 inboxParams = buildParams4SellerDepositOrder(orderCode);
1100 1106
1101 break; 1107 break;
1102 - case JUDGE_PASS: 1108 + case JUDGE_PASS_WAIT_WAREHOUSE:
1103 inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_PASS; 1109 inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_PASS;
1104 //get product info 「商品名称」「尺码」「货号」 1110 //get product info 「商品名称」「尺码」「货号」
1105 inboxParams = buildParams4SellerDepositOrder(orderCode); 1111 inboxParams = buildParams4SellerDepositOrder(orderCode);
@@ -1112,11 +1118,15 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -1112,11 +1118,15 @@ public class InBoxFacade extends BaseNoticeFacade{
1112 break; 1118 break;
1113 1119
1114 case FINISH: 1120 case FINISH:
  1121 + //订单编号{},申请{}件,实收{}件,鉴定通过{}件,鉴定为假{}件,无法鉴定{}件,鉴定瑕疵{}件
  1122 + DepositOrderStatisticInfo statisticInfo = sellerDepositOrderService.getAppraiseProgress(uid, orderCode);
1115 inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY; 1123 inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
1116 - inboxParams = new Object[]{orderCode}; 1124 + inboxParams = new Object[]{orderCode, statisticInfo.getApplyTotal(), statisticInfo.getReceiveTotal(),
  1125 + statisticInfo.getPassNum(), statisticInfo.getFakeNum(), statisticInfo.getUnsureNum(),
  1126 + statisticInfo.getFlawNum()};
1117 //sms 1127 //sms
1118 smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY; 1128 smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
1119 - smsParams = new Object[]{orderCode}; 1129 + smsParams = inboxParams;
1120 break; 1130 break;
1121 } 1131 }
1122 1132
1 package com.yohoufo.order.service.seller.deposit; 1 package com.yohoufo.order.service.seller.deposit;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
  4 +import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
4 import com.yohobuy.ufo.model.order.bo.TimeoutBo; 5 import com.yohobuy.ufo.model.order.bo.TimeoutBo;
5 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; 6 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
6 import com.yohobuy.ufo.model.order.common.OrderAttributes; 7 import com.yohobuy.ufo.model.order.common.OrderAttributes;
@@ -43,15 +44,6 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService { @@ -43,15 +44,6 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
43 private AppraiseOrderMapper appraiseOrderMapper; 44 private AppraiseOrderMapper appraiseOrderMapper;
44 45
45 @Autowired 46 @Autowired
46 - private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper;  
47 -  
48 - @Autowired  
49 - private AppraiseOrderStorageMapper appraiseOrderStorageMapper;  
50 -  
51 - @Autowired  
52 - private AppraiseOrderMetaMapper appraiseOrderMetaMapper;  
53 -  
54 - @Autowired  
55 private AppraiseOrderMetaService appraiseOrderMetaService; 47 private AppraiseOrderMetaService appraiseOrderMetaService;
56 48
57 @Autowired 49 @Autowired
@@ -63,9 +55,11 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService { @@ -63,9 +55,11 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
63 @Autowired 55 @Autowired
64 private IExpressInfoService expressInfoService; 56 private IExpressInfoService expressInfoService;
65 57
  58 + @Autowired
  59 + private SellerDepositOrderService sellerDepositOrderService;
  60 +
66 61
67 private static final List<Integer> showEXpressInfoStatusList = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(), 62 private static final List<Integer> showEXpressInfoStatusList = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(),
68 - AppraiseOrderStatus.WAITING_RECEIVE.getCode(),  
69 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), 63 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
70 AppraiseOrderStatus.JUDGE_PASS.getCode(), 64 AppraiseOrderStatus.JUDGE_PASS.getCode(),
71 AppraiseOrderStatus.CHECKING_FAKE.getCode(), 65 AppraiseOrderStatus.CHECKING_FAKE.getCode(),
@@ -74,20 +68,22 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService { @@ -74,20 +68,22 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
74 private static final List<Integer> showUserAddressStatusList = Lists.newArrayList( 68 private static final List<Integer> showUserAddressStatusList = Lists.newArrayList(
75 AppraiseOrderStatus.HAS_PAYED.getCode(), 69 AppraiseOrderStatus.HAS_PAYED.getCode(),
76 AppraiseOrderStatus.SELLER_SEND_OUT.getCode(), 70 AppraiseOrderStatus.SELLER_SEND_OUT.getCode(),
77 - AppraiseOrderStatus.WAITING_RECEIVE.getCode(),  
78 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), 71 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
79 AppraiseOrderStatus.JUDGE_PASS.getCode(), 72 AppraiseOrderStatus.JUDGE_PASS.getCode(),
80 AppraiseOrderStatus.CHECKING_FAKE.getCode(), 73 AppraiseOrderStatus.CHECKING_FAKE.getCode(),
81 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() 74 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()
82 ); 75 );
83 private static final List<Integer> showAppraiseAddressStatusList = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(), 76 private static final List<Integer> showAppraiseAddressStatusList = Lists.newArrayList(AppraiseOrderStatus.SELLER_SEND_OUT.getCode(),
84 - AppraiseOrderStatus.WAITING_RECEIVE.getCode(),  
85 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), 77 AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
86 AppraiseOrderStatus.JUDGE_PASS.getCode(), 78 AppraiseOrderStatus.JUDGE_PASS.getCode(),
87 AppraiseOrderStatus.CHECKING_FAKE.getCode(), 79 AppraiseOrderStatus.CHECKING_FAKE.getCode(),
88 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() 80 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()
89 ); 81 );
90 82
  83 + private static final List<Integer> showAppraiseProgress = Lists.newArrayList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(),
  84 + AppraiseOrderStatus.FINISH.getCode()
  85 + );
  86 +
91 private static final List<Integer> addressUpgradableStatusList = Lists.newArrayList(AppraiseOrderStatus.HAS_PAYED.getCode()); 87 private static final List<Integer> addressUpgradableStatusList = Lists.newArrayList(AppraiseOrderStatus.HAS_PAYED.getCode());
92 88
93 89
@@ -119,6 +115,11 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService { @@ -119,6 +115,11 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
119 if (showUserAddressStatusList.contains(pao.getStatus())){ 115 if (showUserAddressStatusList.contains(pao.getStatus())){
120 userAddress = appraiseOrderMetaService.getHidderUserAddress(orderCode); 116 userAddress = appraiseOrderMetaService.getHidderUserAddress(orderCode);
121 } 117 }
  118 + DepositOrderStatisticInfo orderStatisticInfo = null;
  119 + if (showAppraiseProgress.contains(pao.getStatus())){
  120 + orderStatisticInfo = sellerDepositOrderService.getAppraiseProgress(uid, orderCode);
  121 + }
  122 +
122 boolean addressUpgradable = addressUpgradableStatusList.contains(pao.getStatus()); 123 boolean addressUpgradable = addressUpgradableStatusList.contains(pao.getStatus());
123 SellerDepositOrderPrdListReq sknListReq = SellerDepositOrderPrdListReq.builder() 124 SellerDepositOrderPrdListReq sknListReq = SellerDepositOrderPrdListReq.builder()
124 .orderCode(orderCode) 125 .orderCode(orderCode)
@@ -137,6 +138,7 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService { @@ -137,6 +138,7 @@ public class SellerDepositOrderDetailService extends AbsOrderViewService {
137 .addressUpgradable(addressUpgradable) 138 .addressUpgradable(addressUpgradable)
138 .buttons(aos.detailButtons(oa)) 139 .buttons(aos.detailButtons(oa))
139 .lastExpressInfoDetail(expressInfoService.getLastExpressInfoDetail(pao)) 140 .lastExpressInfoDetail(expressInfoService.getLastExpressInfoDetail(pao))
  141 + .appraiseProgress(orderStatisticInfo)
140 .build() 142 .build()
141 ; 143 ;
142 } 144 }
@@ -3,6 +3,8 @@ package com.yohoufo.order.service.seller.deposit; @@ -3,6 +3,8 @@ package com.yohoufo.order.service.seller.deposit;
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.yoho.error.ServiceError; 4 import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 5 import com.yoho.error.exception.ServiceException;
  6 +import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
  7 +import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
6 import com.yohobuy.ufo.model.order.bo.OrderInfo; 8 import com.yohobuy.ufo.model.order.bo.OrderInfo;
7 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; 9 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
8 import com.yohobuy.ufo.model.order.common.OrderAttributes; 10 import com.yohobuy.ufo.model.order.common.OrderAttributes;
@@ -29,6 +31,7 @@ import com.yohoufo.order.constants.MetaKey; @@ -29,6 +31,7 @@ import com.yohoufo.order.constants.MetaKey;
29 import com.yohoufo.order.event.OrderCancelEvent; 31 import com.yohoufo.order.event.OrderCancelEvent;
30 import com.yohoufo.order.event.PayConfirmEvent; 32 import com.yohoufo.order.event.PayConfirmEvent;
31 import com.yohoufo.order.event.SellerDepositOrderCancelAsyncEvent; 33 import com.yohoufo.order.event.SellerDepositOrderCancelAsyncEvent;
  34 +import com.yohoufo.order.event.SellerDepositOrderStatusConsistencyAsyncEvent;
32 import com.yohoufo.order.model.PayQueryBo; 35 import com.yohoufo.order.model.PayQueryBo;
33 import com.yohoufo.order.model.dto.PlatformFeeDto; 36 import com.yohoufo.order.model.dto.PlatformFeeDto;
34 import com.yohoufo.order.model.dto.SellerDepositOrderContext; 37 import com.yohoufo.order.model.dto.SellerDepositOrderContext;
@@ -52,8 +55,8 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -52,8 +55,8 @@ import org.springframework.beans.factory.annotation.Autowired;
52 import org.springframework.stereotype.Service; 55 import org.springframework.stereotype.Service;
53 56
54 import java.math.BigDecimal; 57 import java.math.BigDecimal;
55 -import java.util.List;  
56 -import java.util.Map; 58 +import java.util.*;
  59 +import java.util.stream.Collectors;
57 60
58 @Service 61 @Service
59 public class SellerDepositOrderService extends AbsGoodsServiceOrderService implements IGoodsService { 62 public class SellerDepositOrderService extends AbsGoodsServiceOrderService implements IGoodsService {
@@ -329,14 +332,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -329,14 +332,20 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
329 */ 332 */
330 @Override 333 @Override
331 public int appraisePass(AppraiseOrder pao){ 334 public int appraisePass(AppraiseOrder pao){
332 - int rows = super.appraisePass(pao); 335 + long orderCode = pao.getOrderCode();
  336 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.JUDGE_PASS_WAIT_WAREHOUSE,
  337 + expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
  338 +
  339 + int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
  340 +
333 if (rows == 0){ 341 if (rows == 0){
334 return rows; 342 return rows;
335 } 343 }
336 - Long orderCode = pao.getOrderCode(); 344 + //
  345 + triggerStatusConsistencyCheck(orderCode);
  346 +
337 Long paidCode = pao.getParentOrderCode(); 347 Long paidCode = pao.getParentOrderCode();
338 - AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.JUDGE_PASS;  
339 - inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus); 348 + inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetStatus);
340 BigDecimal left = calLeftMoney(pao.getAmount(), orderCode); 349 BigDecimal left = calLeftMoney(pao.getAmount(), orderCode);
341 if (left.compareTo(BigDecimal.ZERO)>0){ 350 if (left.compareTo(BigDecimal.ZERO)>0){
342 351
@@ -397,6 +406,10 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -397,6 +406,10 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
397 if (rows == 0){ 406 if (rows == 0){
398 return rows; 407 return rows;
399 } 408 }
  409 + //
  410 + Long orderCode = appraiseOrder.getOrderCode();
  411 + triggerStatusConsistencyCheck(orderCode);
  412 + //
400 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.CHECKING_FAKE; 413 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.CHECKING_FAKE;
401 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus); 414 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
402 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode()); 415 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
@@ -413,6 +426,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -413,6 +426,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
413 if (rows == 0){ 426 if (rows == 0){
414 return rows; 427 return rows;
415 } 428 }
  429 + //
  430 + Long orderCode = appraiseOrder.getOrderCode();
  431 + triggerStatusConsistencyCheck(orderCode);
  432 + //refund amount
  433 + new GoodsServiceRefundHandler()
  434 + .loadLogger(logger)
  435 + .loadUser(appraiseOrder.getUid())
  436 + .loadActionCase(SellerWalletDetail.Type.APPRAISE_UNSURE)
  437 + .loadRefundAction(payRefundService::refund)
  438 + .loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
  439 + .refund();
  440 +
416 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE; 441 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
417 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus); 442 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
418 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode()); 443 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
@@ -430,6 +455,10 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -430,6 +455,10 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
430 if (rows == 0){ 455 if (rows == 0){
431 return rows; 456 return rows;
432 } 457 }
  458 + //
  459 + Long orderCode = appraiseOrder.getOrderCode();
  460 + triggerStatusConsistencyCheck(orderCode);
  461 + //
433 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT; 462 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
434 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus); 463 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
435 //refund amount 464 //refund amount
@@ -550,16 +579,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -550,16 +579,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
550 if (rows == 0){ 579 if (rows == 0){
551 return rows; 580 return rows;
552 } 581 }
  582 + Long orderCode = appraiseOrder.getOrderCode();
  583 + triggerStatusConsistencyCheck(orderCode);
553 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.QUALITY_CHECK_FAKE; 584 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.QUALITY_CHECK_FAKE;
554 - inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus); 585 + inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus);
555 new GoodsServiceRefundHandler() 586 new GoodsServiceRefundHandler()
556 .loadLogger(logger) 587 .loadLogger(logger)
557 .loadUser(appraiseOrder.getUid()) 588 .loadUser(appraiseOrder.getUid())
558 .loadActionCase(SellerWalletDetail.Type.FLAW) 589 .loadActionCase(SellerWalletDetail.Type.FLAW)
559 .loadRefundAction(payRefundService::refund) 590 .loadRefundAction(payRefundService::refund)
560 - .loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount()) 591 + .loadOrder(orderCode, appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
561 .refund(); 592 .refund();
562 - depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode()); 593 + depositService.insertFakeDeposit(appraiseOrder.getUid(), orderCode, appraiseOrder.getParentOrderCode());
563 return rows; 594 return rows;
564 } 595 }
565 596
@@ -587,4 +618,121 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -587,4 +618,121 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
587 logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event); 618 logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
588 619
589 } 620 }
  621 +
  622 +
  623 +
  624 + public List<AppraiseOrderBo> getSubOrderStatistic(long orderCode){
  625 + List<AppraiseOrder> paoList = buildSubOrderStatisticList(orderCode);
  626 + return paoList.parallelStream().map(pao->AppraiseOrderBo.builder()
  627 + .parentOrderCode(pao.getParentOrderCode())
  628 + .orderCode(orderCode).status(pao.getStatus()).statusCnt(pao.getStatusCnt()).build())
  629 + .collect(Collectors.toList());
  630 + }
  631 +
  632 + private List<AppraiseOrder> buildSubOrderStatisticList(long orderCode){
  633 + AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
  634 + if (Objects.isNull(appraiseOrder)){
  635 + logger.warn("in getSubOrderStatistic selectByOrderCode null, orderCode {}", orderCode);
  636 + return new ArrayList<>(0);
  637 + }
  638 + long occ = findoutParentOrderCode(orderCode);
  639 + List<AppraiseOrder> paoList = appraiseOrderMapper.selectSubOrderStatistic(occ);
  640 + logger.info("getSubOrderStatistic orderCode {} ParentOrderCode {} AppraiseOrder list {}", orderCode, occ, paoList);
  641 + return paoList;
  642 + }
  643 +
  644 + private Long findoutParentOrderCode(long orderCode){
  645 + AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
  646 + if (Objects.isNull(appraiseOrder)){
  647 + logger.warn("in getSubOrderStatistic selectByOrderCode null, orderCode {}", orderCode);
  648 + return orderCode;
  649 + }
  650 + return appraiseOrder.getParentOrderCode()==null ? orderCode : appraiseOrder.getParentOrderCode();
  651 + }
  652 +
  653 +
  654 +
  655 + public DepositOrderStatisticInfo getAppraiseProgress(int uid, long orderCode){
  656 + List<AppraiseOrder> paoList = buildSubOrderStatisticList(orderCode);
  657 +
  658 + //申请
  659 + int applyTotal = 0;
  660 + int shamNum = 0;
  661 + //鉴定为假
  662 + Integer fakeNum = 0;
  663 + //无法鉴定
  664 + Integer unsureNum = 0;
  665 + //鉴定通过
  666 + Integer passNum = 0;
  667 + //鉴定瑕疵
  668 + Integer flawNum = 0;
  669 + int waitingAppraiseNum = 0;
  670 + for (AppraiseOrder pao : paoList){
  671 + int cnt = pao.getStatusCnt();
  672 + AppraiseOrderStatus orderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
  673 + switch (orderStatus){
  674 + case SHAM_SEND_OUT:
  675 + shamNum = cnt;
  676 + break;
  677 + case PLATFORM_APPRAISE_UNSURE:
  678 + unsureNum = cnt;
  679 + break;
  680 + case JUDGE_PASS:
  681 + passNum = cnt;
  682 + break;
  683 + case CHECKING_FAKE:
  684 + fakeNum = cnt;
  685 + break;
  686 + case QUALITY_CHECK_FAKE:
  687 + flawNum = cnt;
  688 + break;
  689 + case PLATFORM_RECEIVE:
  690 + waitingAppraiseNum = cnt;
  691 + break;
  692 + }
  693 + applyTotal += cnt;
  694 + }
  695 + //实收
  696 + Integer receiveTotal = applyTotal - shamNum;
  697 + DepositOrderStatisticInfo dosi = DepositOrderStatisticInfo.builder()
  698 + .applyTotal(applyTotal)
  699 + .unsureNum(unsureNum)
  700 + .passNum(passNum)
  701 + .fakeNum(fakeNum)
  702 + .flawNum(flawNum)
  703 + .receiveTotal(receiveTotal)
  704 + .waitingAppraiseNum(waitingAppraiseNum)
  705 + .build();
  706 +
  707 + return dosi;
  708 + }
  709 +
  710 + public int platformFinishReceiveGoods(long parentCode){
  711 + AppraiseOrderStatus targetStatus = AppraiseOrderStatus.FINISH,
  712 + expectedStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
  713 + return triggerStatusChange(parentCode,targetStatus,expectedStatus);
  714 + }
  715 +
  716 +
  717 + public int detectAppraiseFinish(SellerDepositOrderStatusConsistencyAsyncEvent event ){
  718 + logger.info("detectAppraiseFinish event {}", event);
  719 + long orderCode = event.getOrderCode();
  720 + long parentOrderCode = findoutParentOrderCode(orderCode);
  721 + int cnt =appraiseOrderMapper.selectSubOrderCntIncludeStatus(parentOrderCode,Arrays.asList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode()));
  722 + logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt);
  723 + if (cnt == 0){
  724 + int prows = platformFinishReceiveGoods(parentOrderCode);
  725 + logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}",
  726 + orderCode, parentOrderCode, prows);
  727 + return prows;
  728 + }
  729 + return 0;
  730 + }
  731 +
  732 + public void triggerStatusConsistencyCheck(long orderCode){
  733 + SellerDepositOrderStatusConsistencyAsyncEvent asyncEvent
  734 + = new SellerDepositOrderStatusConsistencyAsyncEvent(this::detectAppraiseFinish);
  735 + asyncEvent.setOrderCode(orderCode);
  736 + EventBusPublisher.publishEvent(asyncEvent);
  737 + }
590 } 738 }
@@ -11,6 +11,7 @@ import com.yohoufo.order.service.support.SellerPlatformServiceFeeSupport; @@ -11,6 +11,7 @@ import com.yohoufo.order.service.support.SellerPlatformServiceFeeSupport;
11 import com.yohoufo.order.utils.LoggerUtils; 11 import com.yohoufo.order.utils.LoggerUtils;
12 import com.yohoufo.order.utils.OrderAssist; 12 import com.yohoufo.order.utils.OrderAssist;
13 import com.yohoufo.order.utils.SellerGoodsHelper; 13 import com.yohoufo.order.utils.SellerGoodsHelper;
  14 +import org.apache.commons.collections.CollectionUtils;
14 import org.slf4j.Logger; 15 import org.slf4j.Logger;
15 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
@@ -29,33 +30,11 @@ public class GoodsAmountService { @@ -29,33 +30,11 @@ public class GoodsAmountService {
29 @Autowired 30 @Autowired
30 private SellerPlatformServiceFeeSupport sellerPlatformServiceFeeSupport; 31 private SellerPlatformServiceFeeSupport sellerPlatformServiceFeeSupport;
31 32
32 -  
33 @Autowired 33 @Autowired
34 private OrderDynamicConfig orderDynamicConfig; 34 private OrderDynamicConfig orderDynamicConfig;
35 35
36 - private static Comparator<GoodsServiceFeeRateWrapper> buildGoodsServiceFeeRateWrapperComp(){  
37 - return (GoodsServiceFeeRateWrapper o1, GoodsServiceFeeRateWrapper o2) -> {  
38 - BigDecimal o1gpr = o1.getGoodsPaymentRate(), o2gpr = o2.getGoodsPaymentRate();  
39 -  
40 - if (o1gpr == null){  
41 - if (o2gpr == null){  
42 - return 0;  
43 - }else{  
44 - return 1;  
45 - }  
46 - }else{  
47 - if (o2gpr == null){  
48 - return -1;  
49 - }else {  
50 - return o1gpr.compareTo(o2gpr);  
51 - }  
52 - }  
53 -  
54 - };  
55 - }  
56 36
57 -  
58 - public SellerOrderComputeResult getGoodsServiceFeeRate(int uid, int storageId, PrdPrice prdPrice, SkupType skupType){ 37 + public SellerOrderComputeResult getGoodsServiceFeeRate(int uid, int storageId, PrdPrice prdPrice, SkupType skupType) {
59 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {},prdPrice {} skupType {}", 38 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {},prdPrice {} skupType {}",
60 uid, storageId, prdPrice, skupType); 39 uid, storageId, prdPrice, skupType);
61 ServiceFeeRate rate = orderDynamicConfig.getServiceFeeRate(skupType); 40 ServiceFeeRate rate = orderDynamicConfig.getServiceFeeRate(skupType);
@@ -69,79 +48,48 @@ public class GoodsAmountService { @@ -69,79 +48,48 @@ public class GoodsAmountService {
69 return highPriority; 48 return highPriority;
70 } 49 }
71 } 50 }
72 - List<ServiceFeeRate> allConfig = Lists.newArrayListWithCapacity(4); 51 + List<ServiceFeeRate> allConfig = Lists.newArrayListWithCapacity(3);
73 //build One User One GoodsType 卖家不同商品类型的指定费率 52 //build One User One GoodsType 卖家不同商品类型的指定费率
74 - allConfig.add(buildOneUserOneGoodsType(uid, skupType,rate)); 53 + CollectionUtils.addIgnoreNull(allConfig, buildOneUserOneGoodsType(uid, skupType, rate));
75 // build by skn 54 // build by skn
76 - allConfig.add(buildWithSkn(prdPrice,rate)); 55 + CollectionUtils.addIgnoreNull(allConfig, buildWithSkn(prdPrice, rate));
77 //build by goods type 不同商品类型指定的费率 56 //build by goods type 不同商品类型指定的费率
78 - allConfig.add(buildWithGoodsType(rate)); 57 + CollectionUtils.addIgnoreNull(allConfig, buildWithGoodsType(rate));
79 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {}, skupType {} prdPrice {} allConfig {}", 58 logger.info("in GoodsAmountService.getGoodsServiceFeeRate uid {}, storageId {}, skupType {} prdPrice {} allConfig {}",
80 uid, storageId, skupType, prdPrice, allConfig); 59 uid, storageId, skupType, prdPrice, allConfig);
81 60
82 -// Optional<GoodsServiceFeeRateWrapper> minGSFRW = allConfig.stream()  
83 -// .min(buildGoodsServiceFeeRateWrapperComp());  
84 SellerOrderComputeResult socr = new SellerOrderComputeResult(); 61 SellerOrderComputeResult socr = new SellerOrderComputeResult();
85 -// if(minGSFRW.isPresent()) {  
86 -// rate.setGoodsPaymentRate(minGSFRW.get().getGoodsPaymentRate());  
87 -// }  
88 socr.setServiceFeeRates(allConfig); 62 socr.setServiceFeeRates(allConfig);
89 return socr; 63 return socr;
90 } 64 }
91 65
92 - public GoodsServiceFeeRateWrapper buildWithSkn(PrdPrice prdPrice,ServiceFeeRate rate) {  
93 - GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.SKN,rate);  
94 - if (Objects.nonNull(prdPrice)) {  
95 - gsfrw.setGoodsPaymentRate(prdPrice.getGoodsPaymentRateOfSkn());  
96 - double min = Objects.isNull(prdPrice.getGoodsPaymentMinPriceOfSkn()) ?  
97 - 0 : prdPrice.getGoodsPaymentMinPriceOfSkn().doubleValue();  
98 - double max = Objects.isNull(prdPrice.getGoodsPaymentMaxPriceOfSkn()) ?  
99 - 1000000 : prdPrice.getGoodsPaymentMaxPriceOfSkn().doubleValue();  
100 - gsfrw.setGoodsPaymentPriceRange(PriceRange.builder().min(min).max(max).build()); 66 + private GoodsServiceFeeRateWrapper buildWithSkn(PrdPrice prdPrice, ServiceFeeRate rate) {
  67 + if (Objects.isNull(prdPrice) || Objects.isNull(prdPrice.getGoodsPaymentRateOfSkn())) {
  68 + return null;
101 } 69 }
  70 +
  71 + GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.SKN, rate);
  72 + gsfrw.setGoodsPaymentRate(prdPrice.getGoodsPaymentRateOfSkn());
  73 + double min = Objects.isNull(prdPrice.getGoodsPaymentMinPriceOfSkn()) ?
  74 + 0 : prdPrice.getGoodsPaymentMinPriceOfSkn().doubleValue();
  75 + double max = Objects.isNull(prdPrice.getGoodsPaymentMaxPriceOfSkn()) ?
  76 + 1000000 : prdPrice.getGoodsPaymentMaxPriceOfSkn().doubleValue();
  77 + gsfrw.setGoodsPaymentPriceRange(PriceRange.builder().min(min).max(max).build());
102 return gsfrw; 78 return gsfrw;
103 } 79 }
104 80
105 - public GoodsServiceFeeRateWrapper buildWithGoodsType(ServiceFeeRate rate){  
106 - GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.GOODS_TYPE,rate);  
107 - gsfrw.setGoodsPaymentRate(rate == null ? null : rate.getGoodsPaymentRate());  
108 - return gsfrw; 81 + private GoodsServiceFeeRateWrapper buildWithGoodsType(ServiceFeeRate rate) {
  82 + return new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.GOODS_TYPE, rate);
109 } 83 }
110 84
111 - public GoodsServiceFeeRateWrapper buildOneUserOneGoodsType(int uid, SkupType skupType,ServiceFeeRate rate){ 85 + private GoodsServiceFeeRateWrapper buildOneUserOneGoodsType(int uid, SkupType skupType, ServiceFeeRate rate) {
112 BigDecimal feeRate = sellerPlatformServiceFeeSupport.getPlatformServiceFeeRate(uid, skupType); 86 BigDecimal feeRate = sellerPlatformServiceFeeSupport.getPlatformServiceFeeRate(uid, skupType);
113 - GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.ONE_USER_ONE_GOODS_TYPE,rate); 87 + if (Objects.isNull(feeRate)) {
  88 + return null;
  89 + }
  90 + GoodsServiceFeeRateWrapper gsfrw = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.ONE_USER_ONE_GOODS_TYPE, rate);
114 gsfrw.setGoodsPaymentRate(feeRate); 91 gsfrw.setGoodsPaymentRate(feeRate);
115 return gsfrw; 92 return gsfrw;
116 } 93 }
117 94
118 -  
119 -  
120 - public static void main(String[] args) {  
121 - ServiceFeeRate rate = new ServiceFeeRate();  
122 - rate.setGoodsPaymentRate(BigDecimal.valueOf(0.05));  
123 - List<GoodsServiceFeeRateWrapper> allConfig = Lists.newArrayListWithCapacity(4);  
124 -  
125 - GoodsServiceFeeRateWrapper gsfrw4 = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.GOODS_TYPE,rate);  
126 - gsfrw4.setGoodsPaymentRate(new BigDecimal(0.045D));  
127 - allConfig.add(gsfrw4);  
128 -  
129 - GoodsServiceFeeRateWrapper gsfrw3 = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.ONE_USER_ONE_SKN,rate);  
130 - //gsfrw3.setGoodsPaymentRate(BigDecimal.ZERO);  
131 - allConfig.add(gsfrw3);  
132 -  
133 - GoodsServiceFeeRateWrapper gsfrw2 = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.ONE_USER_ONE_GOODS_TYPE,rate);  
134 - gsfrw2.setGoodsPaymentRate(new BigDecimal(0.05D));  
135 - allConfig.add(gsfrw2);  
136 -  
137 - GoodsServiceFeeRateWrapper gsfrw1 = new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.SKN,rate);  
138 - allConfig.add(gsfrw1);  
139 -  
140 - //  
141 - GoodsServiceFeeRateWrapper minGSFRW = allConfig.stream()  
142 - .min(buildGoodsServiceFeeRateWrapperComp())  
143 - .orElse(new GoodsServiceFeeRateWrapper(GoodsServiceFeeRateDimension.GOODS_TYPE,rate));  
144 -  
145 - System.out.println("test getGoodsServiceFeeRate -> " + minGSFRW);  
146 - }  
147 } 95 }
  1 +package com.yohoufo.order.service.seller.deposit;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
  5 +import com.yohoufo.order.BaseWebTest;
  6 +import org.junit.Test;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +
  9 +import java.util.List;
  10 +
  11 +public class SellerDepositOrderServiceTest extends BaseWebTest {
  12 + @Autowired
  13 + private SellerDepositOrderService sellerDepositOrderService;
  14 +
  15 + @Test
  16 + public void testGetSubOrderStatistic(){
  17 + //sub 36378862305176
  18 + //parent 36378836393815L
  19 + long orderCode = 36378862305176L;//
  20 + List<AppraiseOrderBo> list = sellerDepositOrderService.getSubOrderStatistic(orderCode);
  21 + System.out.println("in testGetSubOrderStatistic result" + JSONObject.toJSONString(list));
  22 + }
  23 +}
@@ -35,6 +35,20 @@ datasources: @@ -35,6 +35,20 @@ datasources:
35 - com.yohoufo.dal.product.PriceTrendMonthMapper 35 - com.yohoufo.dal.product.PriceTrendMonthMapper
36 - com.yohoufo.dal.product.PriceTrendHalfYearMapper 36 - com.yohoufo.dal.product.PriceTrendHalfYearMapper
37 - com.yohoufo.dal.product.PriceTrendDayMapper 37 - com.yohoufo.dal.product.PriceTrendDayMapper
  38 + - com.yohoufo.dal.product.ProductImportTranItemMapper
  39 + - com.yohoufo.dal.product.TransferRecordsMapper
  40 + - com.yohoufo.dal.product.TransferRecordsHistoryMapper
  41 + - com.yohoufo.dal.product.ProductSalesMapper
  42 + - com.yohoufo.dal.product.ProductLimitSaleMapper
  43 + - com.yohoufo.dal.product.ProductSelfShelvesMapper
  44 + - com.yohoufo.dal.product.ProductSelfShelvesPicMapper
  45 + - com.yohoufo.dal.product.SecondhandFlawMapper
  46 + - com.yohoufo.dal.product.SecondhandImagesMapper
  47 + - com.yohoufo.dal.product.SecondhandInfoMapper
  48 + - com.yohoufo.dal.product.SelfSizeMapper
  49 + - com.yohoufo.dal.product.SelfSizeUidMapper
  50 + - com.yohoufo.dal.product.ProductProfitMapper
  51 +
38 52
39 ufo_order: 53 ufo_order:
40 servers: 54 servers:
@@ -79,9 +93,31 @@ datasources: @@ -79,9 +93,31 @@ datasources:
79 - com.yohoufo.dal.order.SellerEnterApplyMapper 93 - com.yohoufo.dal.order.SellerEnterApplyMapper
80 - com.yohoufo.dal.order.SellerFuncMapper 94 - com.yohoufo.dal.order.SellerFuncMapper
81 - com.yohoufo.dal.order.SellerLevelFuncMapper 95 - com.yohoufo.dal.order.SellerLevelFuncMapper
  96 + - com.yohoufo.dal.order.OrderOverTimeMapper
  97 + - com.yohoufo.dal.order.BuyerOrderViewMapper
  98 + - com.yohoufo.dal.order.SellerJoinHistoryMapper
  99 + - com.yohoufo.dal.order.SellerChangePriceRecordMapper
  100 + - com.yohoufo.dal.order.InviteActivityMapper
  101 + - com.yohoufo.dal.order.InviteRecordMapper
  102 + - com.yohoufo.dal.order.InviterMapper
  103 + - com.yohoufo.dal.order.InviteSettlementItemMapper
  104 + - com.yohoufo.dal.order.InviteSettlementMapper
  105 + - com.yohoufo.dal.order.InviteCodeSequenceMapper
  106 + - com.yohoufo.dal.order.InviteCodeSequenceRandomMapper
  107 + - com.yohoufo.dal.order.SellerGoodsStatusFlowMapper
  108 + - com.yohoufo.dal.order.CmsPayMapper
  109 + - com.yohoufo.dal.order.OrdersPayHbfqMapper
  110 + - com.yohoufo.dal.order.BlackUserMapper
  111 + - com.yohoufo.dal.order.StorageDepositMapper
  112 + - com.yohoufo.dal.order.DepositOrderMapper
82 - com.yohoufo.dal.order.SellerOrderStatsConfigMapper 113 - com.yohoufo.dal.order.SellerOrderStatsConfigMapper
83 - com.yohoufo.dal.order.SellerOrderStatsResultMapper 114 - com.yohoufo.dal.order.SellerOrderStatsResultMapper
84 - com.yohoufo.dal.order.AlipayBlackUserMapper 115 - com.yohoufo.dal.order.AlipayBlackUserMapper
  116 + - com.yohoufo.dal.order.AppraiseOrderMapper
  117 + - com.yohoufo.dal.order.AppraiseOrderGoodsMapper
  118 + - com.yohoufo.dal.order.AppraiseOrderMetaMapper
  119 + - com.yohoufo.dal.order.AppraiseOrderStorageMapper
  120 + - com.yohoufo.dal.order.DepositCodeMapper
85 - com.yohoufo.dal.order.SellerServiceFeeRuleMapper 121 - com.yohoufo.dal.order.SellerServiceFeeRuleMapper
86 122
87 ufo_promotion: 123 ufo_promotion:
@@ -44,7 +44,8 @@ public class CertificationController { @@ -44,7 +44,8 @@ public class CertificationController {
44 public ApiResponse alipayCertification(RealNameAuthorizeReqVO reqVO) throws GatewayException { 44 public ApiResponse alipayCertification(RealNameAuthorizeReqVO reqVO) throws GatewayException {
45 logger.info("CertificationController.alipayCertification: Enter alipayCertification param reqVO is {}", reqVO); 45 logger.info("CertificationController.alipayCertification: Enter alipayCertification param reqVO is {}", reqVO);
46 //若版本低于6.9.9, 提示升级版本 46 //若版本低于6.9.9, 提示升级版本
47 - if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){ 47 + if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.10") < 0){
  48 + logger.info("CertificationController.alipayCertification: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
48 throw new VersionNotSupportException(); 49 throw new VersionNotSupportException();
49 } 50 }
50 //(1) 必要参数的校验 51 //(1) 必要参数的校验
@@ -75,7 +76,8 @@ public class CertificationController { @@ -75,7 +76,8 @@ public class CertificationController {
75 public ApiResponse alipayCertifyResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException { 76 public ApiResponse alipayCertifyResultQuery(RealNameAuthorizeReqVO reqVO) throws GatewayException {
76 logger.info("CertificationController.alipayCertifyResultQuery: Enter. RealNameAuthorizeReqVO is {}", reqVO); 77 logger.info("CertificationController.alipayCertifyResultQuery: Enter. RealNameAuthorizeReqVO is {}", reqVO);
77 //若版本低于6.9.9提示升级版本 78 //若版本低于6.9.9提示升级版本
78 - if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && reqVO.getApp_version().compareTo("6.9.9") < 0){ 79 + if(configReader.getBoolean("ufo.user.idCertUpdateVersionSwitch",false) && compareVersion(reqVO.getApp_version(), "6.9.10") < 0 ){
  80 + logger.info("CertificationController.alipayCertifyResultQuery: version need update, version is {}, uid is {}", reqVO.getApp_version(), reqVO.getUid());
79 throw new VersionNotSupportException(); 81 throw new VersionNotSupportException();
80 } 82 }
81 //(1) 校验请求的参数 83 //(1) 校验请求的参数
@@ -89,6 +91,31 @@ public class CertificationController { @@ -89,6 +91,31 @@ public class CertificationController {
89 } 91 }
90 92
91 93
  94 + private int compareVersion(String curVersion,String sysVersion){
  95 + boolean isCurBlank = StringUtils.isBlank(curVersion);
  96 + boolean isSysBlank = StringUtils.isBlank(sysVersion);
  97 + if(isCurBlank && isSysBlank){
  98 + return 0;
  99 + }
  100 + if(isCurBlank){
  101 + return -1;
  102 + }
  103 + if(isSysBlank){
  104 + return 1;
  105 + }
  106 + String[] curArr = curVersion.split("\\.");
  107 + String[] sysArr = sysVersion.split("\\.");
  108 + for(int i=0;i<3;i++){
  109 + int cur = Integer.parseInt(curArr[i]);
  110 + int sys = Integer.parseInt(sysArr[i]);
  111 + if(cur != sys){
  112 + return cur-sys;
  113 + }
  114 + }
  115 + return 0;
  116 + }
  117 +
  118 +
92 119
93 120
94 121