Authored by tanling

平台已收货

@@ -24,6 +24,9 @@ public interface AppraiseOrderMapper { @@ -24,6 +24,9 @@ public interface AppraiseOrderMapper {
24 @Param("offset")int offset, 24 @Param("offset")int offset,
25 @Param("limit")int limit); 25 @Param("limit")int limit);
26 26
  27 +
  28 + int selectSubOrderCntNotDefinedStatus(@Param("parentOrderCode") long parentOrderCode, @Param("statusList")Collection<Integer> statusList);
  29 +
27 AppraiseOrder selectByOrderCode(long orderCode); 30 AppraiseOrder selectByOrderCode(long orderCode);
28 31
29 32
@@ -32,6 +32,19 @@ @@ -32,6 +32,19 @@
32 </select> 32 </select>
33 33
34 34
  35 + <select id="selectSubOrderCntNotDefinedStatus" resultType="java.lang.Integer">
  36 + select
  37 + count(1)
  38 + from appraise_order
  39 + where parent_order_code = #{parentOrderCode,jdbcType=INTEGER}
  40 + and status not in
  41 + <foreach collection="statusList" item="status" open="(" close=")" separator=",">
  42 + #{status,jdbcType=TINYINT}
  43 + </foreach>
  44 + and is_del=1
  45 + </select>
  46 +
  47 +
35 <select id="selectSubOrderCnt" parameterType="java.lang.Long" resultType="java.lang.Integer"> 48 <select id="selectSubOrderCnt" parameterType="java.lang.Long" resultType="java.lang.Integer">
36 select count(*) from appraise_order 49 select count(*) from appraise_order
37 where parent_order_code = #{parentOrderCode,jdbcType=INTEGER} 50 where parent_order_code = #{parentOrderCode,jdbcType=INTEGER}
@@ -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.common.*; 8 import com.yohobuy.ufo.model.order.common.*;
@@ -704,11 +705,29 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -704,11 +705,29 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
704 705
705 ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode); 706 ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
706 707
  708 + // 确认收货过来的是子订单号
  709 + Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
  710 + if (parentOrderCode == null){
707 // 平台收货 内部调拨信息 711 // 平台收货 内部调拨信息
708 EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER; 712 EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
709 EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer; 713 EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
710 EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive; 714 EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
711 - expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),orderCode,expressType.getCode(),expressDataType,operateTransferCode); 715 + expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), orderCode ,expressType.getCode(),expressDataType,operateTransferCode);
  716 + return;
  717 + }
  718 + List<Integer> status = Lists.newArrayList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), AppraiseOrderStatus.CHECKING_FAKE.getCode());
  719 + int cnt = serviceOrderProcessor.getSubOrderCntNotDefinedStatus(parentOrderCode, status);
  720 + logger.info("no confirm delivery sub order cnt is {}, parentOrderCode {}", cnt, parentOrderCode);
  721 +
  722 + // 父订单下所有的子订单都是 [平台已收货] or [虚假发货] 的情况
  723 + if (cnt == 0){
  724 + // 平台收货 内部调拨信息
  725 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  726 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  727 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
  728 + expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),parentOrderCode ,expressType.getCode(),expressDataType,operateTransferCode);
  729 + }
  730 +
712 return; 731 return;
713 } 732 }
714 733
@@ -18,6 +18,7 @@ import org.slf4j.Logger; @@ -18,6 +18,7 @@ import org.slf4j.Logger;
18 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
19 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
20 20
  21 +import java.util.List;
21 import java.util.Objects; 22 import java.util.Objects;
22 23
23 @Service 24 @Service
@@ -100,6 +101,17 @@ public class ServiceOrderProcessor { @@ -100,6 +101,17 @@ public class ServiceOrderProcessor {
100 } 101 }
101 102
102 103
  104 + /**
  105 + * 查看父订单下的是否存在 平台没有收获的子订单
  106 + * @param parentOrderCoe
  107 + * @param status
  108 + * @return
  109 + */
  110 + public int getSubOrderCntNotDefinedStatus(long parentOrderCoe, List<Integer> status){
  111 + return appraiseOrderMapper.selectSubOrderCntNotDefinedStatus(parentOrderCoe, status);
  112 + }
  113 +
  114 +
103 115
104 /** 116 /**
105 * 是否付费鉴定订单 117 * 是否付费鉴定订单