Authored by mali

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

... ... @@ -24,6 +24,9 @@ public interface AppraiseOrderMapper {
@Param("offset")int offset,
@Param("limit")int limit);
int selectSubOrderCntNotDefinedStatus(@Param("parentOrderCode") long parentOrderCode, @Param("statusList")Collection<Integer> statusList);
AppraiseOrder selectByOrderCode(long orderCode);
... ...
... ... @@ -32,6 +32,19 @@
</select>
<select id="selectSubOrderCntNotDefinedStatus" resultType="java.lang.Integer">
select
count(1)
from appraise_order
where parent_order_code = #{parentOrderCode,jdbcType=INTEGER}
and status not in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status,jdbcType=TINYINT}
</foreach>
and is_del=1
</select>
<select id="selectSubOrderCnt" parameterType="java.lang.Long" resultType="java.lang.Integer">
select count(*) from appraise_order
where parent_order_code = #{parentOrderCode,jdbcType=INTEGER}
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.common.*;
... ... @@ -704,11 +705,29 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
// 确认收货过来的是子订单号
Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
if (parentOrderCode == null){
// 平台收货 内部调拨信息
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),orderCode,expressType.getCode(),expressDataType,operateTransferCode);
expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(), orderCode ,expressType.getCode(),expressDataType,operateTransferCode);
return;
}
List<Integer> status = Lists.newArrayList(AppraiseOrderStatus.PLATFORM_RECEIVE.getCode(), AppraiseOrderStatus.CHECKING_FAKE.getCode());
int cnt = serviceOrderProcessor.getSubOrderCntNotDefinedStatus(parentOrderCode, status);
logger.info("no confirm delivery sub order cnt is {}, parentOrderCode {}", cnt, parentOrderCode);
// 父订单下所有的子订单都是 [平台已收货] or [虚假发货] 的情况
if (cnt == 0){
// 平台收货 内部调拨信息
EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.platform_receive;
expressInfoService.saveOperateTransferExpressInfo(existenceNode.getAppraiseOrder().getUid(),parentOrderCode ,expressType.getCode(),expressDataType,operateTransferCode);
}
return;
}
... ...
... ... @@ -18,6 +18,7 @@ import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
@Service
... ... @@ -100,6 +101,17 @@ public class ServiceOrderProcessor {
}
/**
* 查看父订单下的是否存在 平台没有收获的子订单
* @param parentOrderCoe
* @param status
* @return
*/
public int getSubOrderCntNotDefinedStatus(long parentOrderCoe, List<Integer> status){
return appraiseOrderMapper.selectSubOrderCntNotDefinedStatus(parentOrderCoe, status);
}
/**
* 是否付费鉴定订单
... ...