Authored by LUOXC

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

# Conflicts:
#	order/src/main/java/com/yohoufo/order/service/impl/TradeBillsService.java
@@ -15,8 +15,20 @@ public interface AppraiseOrderMetaMapper { @@ -15,8 +15,20 @@ public interface AppraiseOrderMetaMapper {
15 15
16 AppraiseOrderMeta selectByPrimaryKey(Integer id); 16 AppraiseOrderMeta selectByPrimaryKey(Integer id);
17 17
  18 + /**
  19 + * 只适用子订单,使用子订单查询
  20 + * @param condition
  21 + * @return
  22 + */
18 AppraiseOrderMeta selectByOrderCode(AppraiseOrderMeta condition); 23 AppraiseOrderMeta selectByOrderCode(AppraiseOrderMeta condition);
19 24
  25 + /**
  26 + * 适用于卖家鉴定订单 根据父订单查询
  27 + * @param condition
  28 + * @return
  29 + */
  30 + List<AppraiseOrderMeta> selectAllByParentOrderCode(AppraiseOrderMeta condition);
  31 +
20 List<AppraiseOrderMeta> selectByOrderCodeMetaKeys(@Param("orderCode") long orderCode, 32 List<AppraiseOrderMeta> selectByOrderCodeMetaKeys(@Param("orderCode") long orderCode,
21 @Param("metaKeys") Collection<String> metaKeys); 33 @Param("metaKeys") Collection<String> metaKeys);
22 34
@@ -147,6 +147,7 @@ public class AppraiseOrderPaymentService extends AbstractOrderPaymentService { @@ -147,6 +147,7 @@ public class AppraiseOrderPaymentService extends AbstractOrderPaymentService {
147 AppraiseOrderStatus.HAS_PAYED.getCode(), 147 AppraiseOrderStatus.HAS_PAYED.getCode(),
148 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode(), 148 AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode(),
149 AppraiseOrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode(), 149 AppraiseOrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode(),
  150 + AppraiseOrderStatus.CANCEL_BEFORE_DELIVER.getCode(),
150 AppraiseOrderStatus.SHAM_SEND_OUT.getCode(), 151 AppraiseOrderStatus.SHAM_SEND_OUT.getCode(),
151 AppraiseOrderStatus.SEND_OUT_TIMEOUT.getCode() 152 AppraiseOrderStatus.SEND_OUT_TIMEOUT.getCode()
152 ); 153 );
@@ -22,7 +22,7 @@ public class AppraiseExpressStageBuilder { @@ -22,7 +22,7 @@ public class AppraiseExpressStageBuilder {
22 /** 22 /**
23 * 平台确认收货 23 * 平台确认收货
24 * 24 *
25 - * 1卖家发货 == 2平台鉴定 点亮1 25 + * 1卖家发货 == 2平台鉴定 点亮2
26 */ 26 */
27 private static final int DEPOSIT_PLATFORM_RECEIPT = 11; 27 private static final int DEPOSIT_PLATFORM_RECEIPT = 11;
28 28
@@ -16,6 +16,7 @@ import java.util.stream.Collectors; @@ -16,6 +16,7 @@ import java.util.stream.Collectors;
16 16
17 import javax.annotation.Resource; 17 import javax.annotation.Resource;
18 18
  19 +import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
19 import com.yohobuy.ufo.model.order.common.*; 20 import com.yohobuy.ufo.model.order.common.*;
20 import com.yohoufo.dal.order.*; 21 import com.yohoufo.dal.order.*;
21 import com.yohoufo.dal.order.model.*; 22 import com.yohoufo.dal.order.model.*;
@@ -504,9 +505,9 @@ public class AppraiseService { @@ -504,9 +505,9 @@ public class AppraiseService {
504 return apiResponse; 505 return apiResponse;
505 } 506 }
506 507
507 - // 1.瑕疵,鉴定为假,虚假发货,质检不通过取消 508 + // 1.鉴定为假,质检不通过
508 List<Integer> APPRAISE_FAIL_STATUS_CODE = Lists.newArrayList(AppraiseOrderStatus.CHECKING_FAKE.getCode(), 509 List<Integer> APPRAISE_FAIL_STATUS_CODE = Lists.newArrayList(AppraiseOrderStatus.CHECKING_FAKE.getCode(),
509 - AppraiseOrderStatus.SHAM_SEND_OUT.getCode(), AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode()); 510 + AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode());
510 511
511 // 2.无法鉴定 512 // 2.无法鉴定
512 List<Integer> CANNOT_APPRAISE_STATUS_CODE = Lists.newArrayList( 513 List<Integer> CANNOT_APPRAISE_STATUS_CODE = Lists.newArrayList(
@@ -588,10 +589,22 @@ public class AppraiseService { @@ -588,10 +589,22 @@ public class AppraiseService {
588 589
589 // 子订单对应商品 1:1 590 // 子订单对应商品 1:1
590 AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0); 591 AppraiseOrderGoods oneAppraiseOrderGood = appraiseOrderGoods.get(0);
591 - inBoxFacade.sendInboxSmsWhenAppraiseFinished(uid, oneAppraiseOrderGood.getProductName(), 592 +
  593 + if (APPRAISE_FAIL_STATUS_CODE.contains(appraiseOrder.getStatus())
  594 + || APPRAISE_SUCCESS_STATUS_CODE.contains(appraiseOrder.getStatus())){
  595 + inBoxFacade.sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED,
  596 + InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED,
  597 + uid, oneAppraiseOrderGood.getProductName(),
  598 + oneAppraiseOrderGood.getProductCode(),
  599 + wayBillCode);
  600 + }else if(CANNOT_APPRAISE_STATUS_CODE.contains(appraiseOrder.getStatus())){
  601 + inBoxFacade.sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum.INBOX_DELIVERY_CANNOT_APPRAISE,
  602 + InboxBusinessTypeEnum.SMS_DELIVERY_CANNOT_APPRAISE,
  603 + uid, oneAppraiseOrderGood.getProductName(),
592 oneAppraiseOrderGood.getProductCode(), 604 oneAppraiseOrderGood.getProductCode(),
593 wayBillCode); 605 wayBillCode);
594 } 606 }
  607 + }
595 608
596 if (appraiseOrder.getAttributes() == OrderAttributes.DEPOSITE.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态 609 if (appraiseOrder.getAttributes() == OrderAttributes.DEPOSITE.getCode()) { // 鉴定寄存的订单,需要同步修改寄存表的状态
597 setDepositStatus(orderCode); 610 setDepositStatus(orderCode);
@@ -1741,13 +1754,14 @@ public class AppraiseService { @@ -1741,13 +1754,14 @@ public class AppraiseService {
1741 List<Integer> skupList = buyerOrderGoodses.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList()); 1754 List<Integer> skupList = buyerOrderGoodses.stream().map(BuyerOrderGoods::getSkup).collect(Collectors.toList());
1742 1755
1743 sellerOrderGoodsMapper.updateDeptNoBySkups(skupList, appraiseExpressInfoBo.getDepotNum()); 1756 sellerOrderGoodsMapper.updateDeptNoBySkups(skupList, appraiseExpressInfoBo.getDepotNum());
1744 - expressRecordMapper.updateDeptNoByOrder(orderCodeList, EnumExpressType.EXPRESS_TYPE_1.getCode(), appraiseExpressInfoBo.getDepotNum());  
1745 1757
1746 productProxyService.setBatchDepotNum(skupList, appraiseExpressInfoBo.getDepotNum()); 1758 productProxyService.setBatchDepotNum(skupList, appraiseExpressInfoBo.getDepotNum());
1747 } 1759 }
1748 1760
1749 // 更新鉴定订单的鉴定室 1761 // 更新鉴定订单的鉴定室
1750 appraiseOrderGoodsMapper.updateBatchDepotNo(orderCodeList, appraiseExpressInfoBo.getDepotNum()); 1762 appraiseOrderGoodsMapper.updateBatchDepotNo(orderCodeList, appraiseExpressInfoBo.getDepotNum());
  1763 +
  1764 + expressRecordMapper.updateDeptNoByOrder(orderCodeList, EnumExpressType.EXPRESS_TYPE_1.getCode(), appraiseExpressInfoBo.getDepotNum());
1751 } 1765 }
1752 } 1766 }
1753 1767
@@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.ProductInfo; @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.ProductInfo;
6 import com.yohobuy.ufo.model.order.bo.DepositProductBo; 6 import com.yohobuy.ufo.model.order.bo.DepositProductBo;
7 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; 7 import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
8 import com.yohobuy.ufo.model.order.common.OrderAttributes; 8 import com.yohobuy.ufo.model.order.common.OrderAttributes;
  9 +import com.yohobuy.ufo.model.order.constants.DepositSourceEnum;
9 import com.yohobuy.ufo.model.order.resp.DepositOrderComputeResp; 10 import com.yohobuy.ufo.model.order.resp.DepositOrderComputeResp;
10 import com.yohobuy.ufo.model.order.resp.OrderDetailInfo; 11 import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
11 import com.yohobuy.ufo.model.response.StorageDataResp; 12 import com.yohobuy.ufo.model.response.StorageDataResp;
@@ -15,11 +16,9 @@ import com.yohoufo.common.utils.AppVersion; @@ -15,11 +16,9 @@ import com.yohoufo.common.utils.AppVersion;
15 import com.yohoufo.common.utils.DateUtil; 16 import com.yohoufo.common.utils.DateUtil;
16 import com.yohoufo.common.utils.StringUtil; 17 import com.yohoufo.common.utils.StringUtil;
17 import com.yohoufo.dal.order.AppraiseOrderMapper; 18 import com.yohoufo.dal.order.AppraiseOrderMapper;
  19 +import com.yohoufo.dal.order.BuyerOrderMapper;
18 import com.yohoufo.dal.order.DepositCodeMapper; 20 import com.yohoufo.dal.order.DepositCodeMapper;
19 -import com.yohoufo.dal.order.model.AppraiseOrder;  
20 -import com.yohoufo.dal.order.model.DepositCode;  
21 -import com.yohoufo.dal.order.model.SellerOrderGoods;  
22 -import com.yohoufo.dal.order.model.StorageDepositCount; 21 +import com.yohoufo.dal.order.model.*;
23 import org.apache.commons.collections.CollectionUtils; 22 import org.apache.commons.collections.CollectionUtils;
24 import org.apache.commons.lang3.StringUtils; 23 import org.apache.commons.lang3.StringUtils;
25 import org.slf4j.Logger; 24 import org.slf4j.Logger;
@@ -27,10 +26,9 @@ import org.slf4j.LoggerFactory; @@ -27,10 +26,9 @@ import org.slf4j.LoggerFactory;
27 import org.springframework.beans.factory.annotation.Autowired; 26 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.stereotype.Service; 27 import org.springframework.stereotype.Service;
29 28
30 -import java.util.HashMap;  
31 -import java.util.Iterator;  
32 -import java.util.List;  
33 -import java.util.Map; 29 +import java.math.BigDecimal;
  30 +import java.util.*;
  31 +import java.util.function.Function;
34 import java.util.stream.Collectors; 32 import java.util.stream.Collectors;
35 33
36 /** 34 /**
@@ -49,6 +47,9 @@ public class DepositHelpService { @@ -49,6 +47,9 @@ public class DepositHelpService {
49 @Autowired 47 @Autowired
50 private AppraiseOrderMapper appraiseOrderMapper; 48 private AppraiseOrderMapper appraiseOrderMapper;
51 49
  50 + @Autowired
  51 + private BuyerOrderMapper buyerOrderMapper;
  52 +
52 // 是否 24小时反馈时间 如果是则返回true 53 // 是否 24小时反馈时间 如果是则返回true
53 public boolean isFeedback(int depositRemainDay) { 54 public boolean isFeedback(int depositRemainDay) {
54 return -1 * DepositOrderComputeResp.FEEDBACK_DAY <= depositRemainDay && depositRemainDay <= 0; 55 return -1 * DepositOrderComputeResp.FEEDBACK_DAY <= depositRemainDay && depositRemainDay <= 0;
@@ -249,4 +250,27 @@ public class DepositHelpService { @@ -249,4 +250,27 @@ public class DepositHelpService {
249 public String queryEarnestMoneyStatus(Integer status) { 250 public String queryEarnestMoneyStatus(Integer status) {
250 return Integer.valueOf(AppraiseOrderStatus.CHECKING_FAKE.getCode()).equals(status) ? "已扣除" : "原路退还"; 251 return Integer.valueOf(AppraiseOrderStatus.CHECKING_FAKE.getCode()).equals(status) ? "已扣除" : "原路退还";
251 } 252 }
  253 +
  254 + /**
  255 + * 获取入手价
  256 + * @param countInfoList
  257 + * @return
  258 + */
  259 + public Map<Long, BuyerOrder> getOrderAmountMap(List<StorageDeposit> depositList) {
  260 + if (CollectionUtils.isEmpty(depositList)) {
  261 + return Maps.newHashMap();
  262 + }
  263 +
  264 + Collection<Long> orderCodeList = depositList.stream()
  265 + .filter(item -> DepositSourceEnum.SOURCE_BUYER.getCode().equals(item.getSource())).map(StorageDeposit::getOrderCode).collect(Collectors.toList());
  266 +
  267 + if (CollectionUtils.isEmpty(orderCodeList)) {
  268 + return Maps.newHashMap();
  269 + }
  270 +
  271 + List<BuyerOrder> buyerGoodsList = buyerOrderMapper.selectByOrderCodes(orderCodeList, null);
  272 + Map<Long, BuyerOrder> buyerGoodsMap = buyerGoodsList.stream().map(Function.identity()).collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity()));
  273 +
  274 + return buyerGoodsMap;
  275 + }
252 } 276 }
@@ -131,14 +131,13 @@ public class DepositServiceImpl implements DepositService { @@ -131,14 +131,13 @@ public class DepositServiceImpl implements DepositService {
131 } 131 }
132 // 召回或者到期退回的 132 // 召回或者到期退回的
133 List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit); 133 List<StorageDeposit> depositList = storageDepositMapper.queryUserDopositBack(uid, (page - 1) * limit, limit);
134 - List<BuyerOrder> buyerGoodsList = buyerOrderMapper.selectByOrderCodes(depositList.stream()  
135 - .filter(item -> DepositSourceEnum.SOURCE_BUYER.getCode().equals(item.getSource())).map(StorageDeposit::getOrderCode).collect(Collectors.toList()), null); 134 +
136 135
137 // 查询现货寄存订单的状态 136 // 查询现货寄存订单的状态
138 Map<Long, String> appraiseOrderStatusMap = depositHelpService.queryAppraiseOrderStatus(depositList.stream() 137 Map<Long, String> appraiseOrderStatusMap = depositHelpService.queryAppraiseOrderStatus(depositList.stream()
139 .filter(item -> DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(item.getOutType())).map(StorageDeposit::getOrderCode).collect(Collectors.toList())); 138 .filter(item -> DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(item.getOutType())).map(StorageDeposit::getOrderCode).collect(Collectors.toList()));
140 139
141 - Map<Long, BuyerOrder> buyerGoodsMap = buyerGoodsList.stream().map(Function.identity()).collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity())); 140 + Map<Long, BuyerOrder> buyerGoodsMap = depositHelpService.getOrderAmountMap(depositList);
142 141
143 142
144 List<Integer> storageList = depositList.stream().map(StorageDeposit::getStorageId).collect(Collectors.toList()); 143 List<Integer> storageList = depositList.stream().map(StorageDeposit::getStorageId).collect(Collectors.toList());
@@ -258,6 +258,7 @@ public class QiniuLiveRecordService { @@ -258,6 +258,7 @@ public class QiniuLiveRecordService {
258 resp.setProductId(item.getProductId()); 258 resp.setProductId(item.getProductId());
259 resp.setProductPicUrl(null == orderVideoResp ? "" : orderVideoResp.getProductPicUrl()); 259 resp.setProductPicUrl(null == orderVideoResp ? "" : orderVideoResp.getProductPicUrl());
260 resp.setAppraise_result(item.getAppraiseResult()); 260 resp.setAppraise_result(item.getAppraiseResult());
  261 + resp.setOrderCode(item.getOrderCode());
261 result.add(resp); 262 result.add(resp);
262 }); 263 });
263 264
@@ -2,17 +2,14 @@ package com.yohoufo.order.service.impl; @@ -2,17 +2,14 @@ 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.yohobuy.ufo.model.order.common.Payment;
5 import com.yohoufo.common.alarm.CommonAlarmEventPublisher; 6 import com.yohoufo.common.alarm.CommonAlarmEventPublisher;
6 import com.yohoufo.common.utils.BigDecimalHelper; 7 import com.yohoufo.common.utils.BigDecimalHelper;
7 import com.yohoufo.common.utils.DateUtil; 8 import com.yohoufo.common.utils.DateUtil;
8 -import com.yohoufo.dal.order.AppraiseOrderMetaMapper;  
9 import com.yohoufo.dal.order.SellerOrderMetaMapper; 9 import com.yohoufo.dal.order.SellerOrderMetaMapper;
10 import com.yohoufo.dal.order.TradeBillsMapper; 10 import com.yohoufo.dal.order.TradeBillsMapper;
11 -import com.yohoufo.dal.order.model.AppraiseOrderMeta;  
12 -import com.yohoufo.dal.order.model.SellerOrder;  
13 import com.yohoufo.dal.order.model.SellerOrderMeta; 11 import com.yohoufo.dal.order.model.SellerOrderMeta;
14 import com.yohoufo.dal.order.model.TradeBills; 12 import com.yohoufo.dal.order.model.TradeBills;
15 -import com.yohobuy.ufo.model.order.common.Payment;  
16 import com.yohoufo.order.common.BillTradeStatus; 13 import com.yohoufo.order.common.BillTradeStatus;
17 import com.yohoufo.order.constants.MetaKey; 14 import com.yohoufo.order.constants.MetaKey;
18 import com.yohoufo.order.model.dto.SellerOrderComputeResult; 15 import com.yohoufo.order.model.dto.SellerOrderComputeResult;
@@ -43,8 +40,6 @@ public class TradeBillsService { @@ -43,8 +40,6 @@ public class TradeBillsService {
43 @Autowired 40 @Autowired
44 private ServiceOrderProcessor serviceOrderProcessor; 41 private ServiceOrderProcessor serviceOrderProcessor;
45 42
46 - @Autowired  
47 - private AppraiseOrderMetaMapper appraiseOrderMetaMapper;  
48 43
49 /** 44 /**
50 * 退保证金流水记录 45 * 退保证金流水记录
@@ -65,28 +60,32 @@ public class TradeBillsService { @@ -65,28 +60,32 @@ public class TradeBillsService {
65 60
66 String computeResultVal = null; 61 String computeResultVal = null;
67 62
  63 + BigDecimal earnestMoney = null;
  64 + BigDecimal systemAmount = null;
68 if (serviceOrderProcessor.isGoodsServiceOrder(orderCode)){ 65 if (serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
69 - AppraiseOrderMeta feeCondition = new AppraiseOrderMeta();  
70 - feeCondition.setOrderCode(orderCode);  
71 - feeCondition.setMetaKey(MetaKey.SELLER_FEE);  
72 - AppraiseOrderMeta feeMeta = appraiseOrderMetaMapper.selectByOrderCode(feeCondition);  
73 - computeResultVal = Objects.nonNull(feeMeta) ? feeMeta.getMetaValue() : null;  
74 - logger.info("in backPayEnsureRecord isGoodsServiceOrder orderCode {} computeResultVal {}", orderCode, computeResultVal); 66 + ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.isAppraiseOrder(orderCode);
  67 + if(!existenceNode.isExisted()){
  68 + return;
  69 + }
  70 + earnestMoney = existenceNode.getAppraiseOrder().getAmount();
  71 + systemAmount = earnestMoney.negate();
  72 + logger.info("in backPayEnsureRecord isGoodsServiceOrder orderCode {} earnestMoney {}", orderCode, computeResultVal);
75 }else { 73 }else {
76 SellerOrderMeta meta = sellerOrderMetaMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE); 74 SellerOrderMeta meta = sellerOrderMetaMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE);
77 computeResultVal = Objects.nonNull(meta) ? meta.getMetaValue() : null; 75 computeResultVal = Objects.nonNull(meta) ? meta.getMetaValue() : null;
78 logger.info("in backPayEnsureRecord buyerorder orderCode {} computeResultVal {}", orderCode, computeResultVal); 76 logger.info("in backPayEnsureRecord buyerorder orderCode {} computeResultVal {}", orderCode, computeResultVal);
  77 + SellerOrderComputeResult socr = JSONObject.parseObject(computeResultVal, SellerOrderComputeResult.class);
  78 + earnestMoney = socr.getEarnestMoney().getEarnestMoney();
  79 + systemAmount = calSystemAmountByComputeResult(socr);
79 } 80 }
80 81
81 - if (Objects.isNull(computeResultVal)) {  
82 - logger.error("PayRecordErr记录交易到数据库出错 err=meta费率信息未查到, uid = {}, skup={}", uid, skup); 82 + if (Objects.isNull(systemAmount) || Objects.isNull(systemAmount)) {
  83 + logger.error("PayRecordErr记录交易到数据库出错 err=meta费率信息未查到, uid = {}, orderCode {}", uid, orderCode);
83 return; 84 return;
84 } 85 }
85 try{ 86 try{
86 - SellerOrderComputeResult socr = JSONObject.parseObject(computeResultVal, SellerOrderComputeResult.class);  
87 - BigDecimal earnestMoney = socr.getEarnestMoney().getEarnestMoney();  
88 - BigDecimal systemAmount = calSystemAmountByComputeResult(socr);  
89 - backPayEnsureRecord0(uid, orderCode, paidOrderCode, payType, tradeStatus, earnestMoney, systemAmount); 87 +
  88 + backPayEnsureRecord0(uid, orderCode,paidOrderCode, payType, tradeStatus, earnestMoney, systemAmount);
90 89
91 }catch (Exception ex){ 90 }catch (Exception ex){
92 logger.error("backPayEnsureRecord error, uid {},orderCode {} computeResultVal {}", 91 logger.error("backPayEnsureRecord error, uid {},orderCode {} computeResultVal {}",
@@ -318,7 +317,6 @@ public class TradeBillsService { @@ -318,7 +317,6 @@ public class TradeBillsService {
318 * @param amount 317 * @param amount
319 */ 318 */
320 public void addPayRechargeEnsureRecord(Integer uid, Long orderCode, Integer payment, BigDecimal amount) { 319 public void addPayRechargeEnsureRecord(Integer uid, Long orderCode, Integer payment, BigDecimal amount) {
321 -  
322 Integer payType = adaptPayType(payment); 320 Integer payType = adaptPayType(payment);
323 TradeBills record = new TradeBills(); 321 TradeBills record = new TradeBills();
324 record.setUid(uid); 322 record.setUid(uid);
@@ -339,12 +339,13 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -339,12 +339,13 @@ public class InBoxFacade extends BaseNoticeFacade{
339 * @param productCode 339 * @param productCode
340 * @param wayBillCode 340 * @param wayBillCode
341 */ 341 */
342 - public void sendInboxSmsWhenAppraiseFinished(int uid, String prdName, String productCode,String wayBillCode){ 342 + public void sendInboxSmsWhenAppraiseFinished(InboxBusinessTypeEnum inbox, InboxBusinessTypeEnum sms,
  343 + int uid, String prdName, String productCode,String wayBillCode){
343 344
344 try { 345 try {
345 executorService.execute(() -> { 346 executorService.execute(() -> {
346 String params = buildParams(prdName, productCode); 347 String params = buildParams(prdName, productCode);
347 - InboxReqVO req = buildInboxReqVO(uid, params, InboxBusinessTypeEnum.INBOX_DELIVERY_APPRAISE_FINISHED); 348 + InboxReqVO req = buildInboxReqVO(uid, params, inbox);
348 349
349 InBoxResponse resp = inBoxSDK.addInbox(req); 350 InBoxResponse resp = inBoxSDK.addInbox(req);
350 log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, wayBillCode {}, resp {}", uid, prdName, wayBillCode, resp); 351 log.info("record sendInboxSmsWhenAppraiseFinished inbox msg, uid {}, prdName {}, wayBillCode {}, resp {}", uid, prdName, wayBillCode, resp);
@@ -356,7 +357,7 @@ public class InBoxFacade extends BaseNoticeFacade{ @@ -356,7 +357,7 @@ public class InBoxFacade extends BaseNoticeFacade{
356 return; 357 return;
357 } 358 }
358 List<String> mobileList = Arrays.asList(phone); 359 List<String> mobileList = Arrays.asList(phone);
359 - String content = getReplacedContent(InboxBusinessTypeEnum.SMS_DELIVERY_APPRAISE_FINISHED.getContent(), prdName ,productCode,wayBillCode); 360 + String content = getReplacedContent(sms.getContent(), prdName ,productCode,wayBillCode);
360 sendSmsService.smsSendByMobile(content, mobileList); 361 sendSmsService.smsSendByMobile(content, mobileList);
361 log.info("sendInboxSmsWhenAppraiseFinished sms content {}, mobileList {}", content, mobileList); 362 log.info("sendInboxSmsWhenAppraiseFinished sms content {}, mobileList {}", content, mobileList);
362 }); 363 });
@@ -6,10 +6,7 @@ import com.yoho.error.exception.ServiceException; @@ -6,10 +6,7 @@ import com.yoho.error.exception.ServiceException;
6 import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo; 6 import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
7 import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo; 7 import com.yohobuy.ufo.model.order.bo.DepositOrderStatisticInfo;
8 import com.yohobuy.ufo.model.order.bo.OrderInfo; 8 import com.yohobuy.ufo.model.order.bo.OrderInfo;
9 -import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;  
10 -import com.yohobuy.ufo.model.order.common.OrderAttributes;  
11 -import com.yohobuy.ufo.model.order.common.OrderCodeType;  
12 -import com.yohobuy.ufo.model.order.common.Payment; 9 +import com.yohobuy.ufo.model.order.common.*;
13 import com.yohobuy.ufo.model.order.req.*; 10 import com.yohobuy.ufo.model.order.req.*;
14 import com.yohobuy.ufo.model.order.resp.SellerDepositOrderComputeResp; 11 import com.yohobuy.ufo.model.order.resp.SellerDepositOrderComputeResp;
15 import com.yohobuy.ufo.model.order.resp.SellerDepositOrderSubmitResp; 12 import com.yohobuy.ufo.model.order.resp.SellerDepositOrderSubmitResp;
@@ -38,6 +35,7 @@ import com.yohoufo.order.mq.DelayTime; @@ -38,6 +35,7 @@ import com.yohoufo.order.mq.DelayTime;
38 import com.yohoufo.order.mq.TopicConstants; 35 import com.yohoufo.order.mq.TopicConstants;
39 import com.yohoufo.order.mq.producer.TradeMqSender; 36 import com.yohoufo.order.mq.producer.TradeMqSender;
40 import com.yohoufo.order.service.DepositService; 37 import com.yohoufo.order.service.DepositService;
  38 +import com.yohoufo.order.service.IExpressInfoService;
41 import com.yohoufo.order.service.IGoodsService; 39 import com.yohoufo.order.service.IGoodsService;
42 import com.yohoufo.order.service.IPaymentService; 40 import com.yohoufo.order.service.IPaymentService;
43 import com.yohoufo.order.service.handler.GoodsServiceRefundHandler; 41 import com.yohoufo.order.service.handler.GoodsServiceRefundHandler;
@@ -66,7 +64,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -66,7 +64,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
66 private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper; 64 private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper;
67 65
68 @Autowired 66 @Autowired
69 - private AppraiseOrderStorageMapper appraiseOrderStorageMapper; 67 + private IExpressInfoService expressInfoService;
70 68
71 @Autowired 69 @Autowired
72 private SellerDepositOrderPrepareService sellerDepositOrderPrepareService; 70 private SellerDepositOrderPrepareService sellerDepositOrderPrepareService;
@@ -697,7 +695,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -697,7 +695,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
697 case PLATFORM_APPRAISE_UNSURE: 695 case PLATFORM_APPRAISE_UNSURE:
698 unsureNum = cnt; 696 unsureNum = cnt;
699 break; 697 break;
700 - case JUDGE_PASS: 698 + case JUDGE_PASS_WAIT_WAREHOUSE:
701 passNum = cnt; 699 passNum = cnt;
702 break; 700 break;
703 case CHECKING_FAKE: 701 case CHECKING_FAKE:
@@ -758,6 +756,13 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -758,6 +756,13 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
758 logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt); 756 logger.info("detectAppraiseFinish event {},parentOrderCode {} PLATFORM_RECEIVE count {}", event, parentOrderCode, cnt);
759 if (cnt == 0){ 757 if (cnt == 0){
760 int prows = platformFinishAppraiseGoods(parentOrderCode); 758 int prows = platformFinishAppraiseGoods(parentOrderCode);
  759 +
  760 + // 鉴定已经完成的物流信息
  761 + EnumExpressType expressType = EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
  762 + EnumExpressDataType expressDataType = EnumExpressDataType.operate_transfer;
  763 + EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.appraise_finished;
  764 + expressInfoService.saveOperateTransferExpressInfo(appraiseOrder.getUid(), orderCode ,expressType.getCode(),expressDataType,operateTransferCode);
  765 +
761 logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}", 766 logger.info("detectAppraiseFinish platformFinishReceiveGoods, orderCode {},parentOrderCode {} parent count {}",
762 orderCode, parentOrderCode, prows); 767 orderCode, parentOrderCode, prows);
763 if (prows>0){ 768 if (prows>0){
@@ -3,6 +3,7 @@ package com.yohoufo.order.service.seller.deposit; @@ -3,6 +3,7 @@ package com.yohoufo.order.service.seller.deposit;
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo; 4 import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
5 import com.yohoufo.order.BaseWebTest; 5 import com.yohoufo.order.BaseWebTest;
  6 +import com.yohoufo.order.event.OrderCancelEvent;
6 import org.junit.Test; 7 import org.junit.Test;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
8 9
@@ -20,4 +21,12 @@ public class SellerDepositOrderServiceTest extends BaseWebTest { @@ -20,4 +21,12 @@ public class SellerDepositOrderServiceTest extends BaseWebTest {
20 List<AppraiseOrderBo> list = sellerDepositOrderService.getSubOrderStatistic(orderCode); 21 List<AppraiseOrderBo> list = sellerDepositOrderService.getSubOrderStatistic(orderCode);
21 System.out.println("in testGetSubOrderStatistic result" + JSONObject.toJSONString(list)); 22 System.out.println("in testGetSubOrderStatistic result" + JSONObject.toJSONString(list));
22 } 23 }
  24 +
  25 + @Test
  26 + public void testcancelByTimeout(){
  27 + String json = "{\"orderCode\":36379748458307,\"payExpire\":10,\"retry\":0,\"uid\":500031424}";
  28 + OrderCancelEvent orderCancelEvent = JSONObject.parseObject(json, OrderCancelEvent.class);
  29 + sellerDepositOrderService.cancelByTimeout(orderCancelEvent);
  30 +
  31 + }
23 } 32 }