Authored by LUOXC

Merge branch 'master' into test6.9.21

  1 +package com.yohoufo.common.config;
  2 +
  3 +import com.yoho.core.config.ConfigReader;
  4 +import com.yohobuy.ufo.model.order.constants.DepotType;
  5 +import lombok.extern.slf4j.Slf4j;
  6 +import org.apache.commons.lang3.tuple.Pair;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import java.util.Optional;
  11 +
  12 +@Slf4j
  13 +@Service
  14 +public class SpecialTimeConfigReader {
  15 +
  16 + @Autowired
  17 + private ConfigReader configReader;
  18 +
  19 + /**
  20 + * 特殊时期
  21 + *
  22 + * @return
  23 + */
  24 + public Pair<Integer, Integer> specialTimeRange() {
  25 + // 2020.1.31武汉病毒(2020-01-30 23:59:59到2020-02-29 23:59:59)
  26 + Pair<Integer, Integer> specialTimeRange = Pair.of(1580399999, 1582991999);
  27 + return specialTimeRange;
  28 + }
  29 +
  30 + public Optional<DepotType> specialTimeDepotType(Integer time) {
  31 + Pair<Integer, Integer> specialTimeRange = specialTimeRange();
  32 + boolean isAtSpecialTime = time > specialTimeRange.getLeft() && time <= specialTimeRange.getRight();
  33 + if (isAtSpecialTime) {
  34 + return Optional.of(DepotType.NJ);
  35 + } else {
  36 + return Optional.empty();
  37 + }
  38 + }
  39 +
  40 +}
@@ -27,7 +27,7 @@ import org.springframework.stereotype.Component; @@ -27,7 +27,7 @@ import org.springframework.stereotype.Component;
27 @Component 27 @Component
28 public class ExpressInfoUpdateConsumer implements YhConsumer { 28 public class ExpressInfoUpdateConsumer implements YhConsumer {
29 29
30 -private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); 30 + private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
31 31
32 32
33 private final String topic = "ufo.order.updateExpressInfo"; 33 private final String topic = "ufo.order.updateExpressInfo";
@@ -64,7 +64,7 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -64,7 +64,7 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
64 64
65 private void updateExpressInfo(Object message) { 65 private void updateExpressInfo(Object message) {
66 ErpExpressBo erpExpressBo = convertErpJsonToObject(message); 66 ErpExpressBo erpExpressBo = convertErpJsonToObject(message);
67 - if (erpExpressBo==null||!checkValidMessage(erpExpressBo)) { 67 + if (erpExpressBo == null || !checkValidMessage(erpExpressBo)) {
68 return; 68 return;
69 } 69 }
70 70
@@ -85,22 +85,22 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -85,22 +85,22 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
85 85
86 //根据uid,orderCode,waybillCode查状态expressType 86 //根据uid,orderCode,waybillCode查状态expressType
87 //初始的expressType 87 //初始的expressType
88 - Byte initExpressType=0;  
89 - ExpressRecord firstExpressRecord = expressRecordMapper.queryExpressRecord(uid,orderCode,waybillCode);  
90 - if(firstExpressRecord==null){  
91 - LOGGER.warn("updateExpressInfo first express info not exist, uid is {} orderCode is {} waybillCode is {}", uid,orderCode,waybillCode); 88 + Byte initExpressType = 0;
  89 + ExpressRecord firstExpressRecord = expressRecordMapper.queryExpressRecord(uid, orderCode, waybillCode);
  90 + if (firstExpressRecord == null) {
  91 + LOGGER.warn("updateExpressInfo first express info not exist, uid is {} orderCode is {} waybillCode is {}", uid, orderCode, waybillCode);
92 //throw new ServiceException(400,"not find express type info"); 92 //throw new ServiceException(400,"not find express type info");
93 - }else{ 93 + } else {
94 initExpressType = firstExpressRecord.getExpressType(); 94 initExpressType = firstExpressRecord.getExpressType();
95 - if(initExpressType==null){  
96 - LOGGER.warn("updateExpressInfo first express info express type is null, uid is {} orderCode is {} waybillCode is {}", uid,orderCode,waybillCode); 95 + if (initExpressType == null) {
  96 + LOGGER.warn("updateExpressInfo first express info express type is null, uid is {} orderCode is {} waybillCode is {}", uid, orderCode, waybillCode);
97 initExpressType = 0; 97 initExpressType = 0;
98 } 98 }
99 } 99 }
100 100
101 // 正常订单,签收消息 101 // 正常订单,签收消息
102 if (state == ExpressInfoConstant.EXPRESS_STATUS_SIGN) { 102 if (state == ExpressInfoConstant.EXPRESS_STATUS_SIGN) {
103 - handleAcceptExpress(erpExpressBo,initExpressType); 103 + handleAcceptExpress(erpExpressBo, initExpressType);
104 return; 104 return;
105 } 105 }
106 106
@@ -111,23 +111,22 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -111,23 +111,22 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
111 state = ExpressInfoConstant.EXPRESS_STATUS_UNSEND; 111 state = ExpressInfoConstant.EXPRESS_STATUS_UNSEND;
112 } 112 }
113 113
114 - processExpressInfo( state, logisticsType, orderCode, waybillCode, acceptAddress, acceptRemark, createTime, uid, initExpressType); 114 + processExpressInfo(state, logisticsType, orderCode, waybillCode, acceptAddress, acceptRemark, createTime, uid, initExpressType);
115 } 115 }
116 116
117 /** 117 /**
118 - *  
119 - * @param state 快递状态  
120 - * @param logisticsType 快递公司id  
121 - * @param orderCode 订单号  
122 - * @param waybillCode 快递单号  
123 - * @param acceptAddress 运单接收地  
124 - * @param acceptRemark 运单信息  
125 - * @param createTime 创建时间 118 + * @param state 快递状态
  119 + * @param logisticsType 快递公司id
  120 + * @param orderCode 订单号
  121 + * @param waybillCode 快递单号
  122 + * @param acceptAddress 运单接收地
  123 + * @param acceptRemark 运单信息
  124 + * @param createTime 创建时间
126 * @param uid 125 * @param uid
127 * @param initExpressType 物流类型 126 * @param initExpressType 物流类型
128 */ 127 */
129 - private void processExpressInfo( Integer state, Integer logisticsType, Long orderCode, String waybillCode,  
130 - String acceptAddress, String acceptRemark, Integer createTime, Integer uid, Byte initExpressType) { 128 + private void processExpressInfo(Integer state, Integer logisticsType, Long orderCode, String waybillCode,
  129 + String acceptAddress, String acceptRemark, Integer createTime, Integer uid, Byte initExpressType) {
131 130
132 ExpressInfo expressInfo = new ExpressInfo(); 131 ExpressInfo expressInfo = new ExpressInfo();
133 expressInfo.setDataType(EnumExpressDataType.erp_logistics.getCode()); 132 expressInfo.setDataType(EnumExpressDataType.erp_logistics.getCode());
@@ -140,6 +139,13 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -140,6 +139,13 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
140 expressInfo.setCreateTime(createTime); 139 expressInfo.setCreateTime(createTime);
141 expressInfo.setExpressType(initExpressType); 140 expressInfo.setExpressType(initExpressType);
142 expressInfo.setState(state); 141 expressInfo.setState(state);
  142 + // 武汉疫情鉴定中心不能收货,重置物流文案
  143 + if (isWuhanNewpneumoniaHolidayTime()
  144 + && isSellerSendExpress(expressInfo)
  145 + && StringUtils.contains(expressInfo.getAcceptRemark(), "因休息日或假期客户不便收件")
  146 + ) {
  147 + expressInfo.setAcceptRemark("受疫情影响,平台将于2月10日开始收货");
  148 + }
143 149
144 // 中通国际快递公司,存在物流则表示清关成功 150 // 中通国际快递公司,存在物流则表示清关成功
145 if (LogisticsTypes.isZtoInternational(logisticsType) && isHkClearSuccess(acceptAddress, acceptRemark)) { 151 if (LogisticsTypes.isZtoInternational(logisticsType) && isHkClearSuccess(acceptAddress, acceptRemark)) {
@@ -147,7 +153,13 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -147,7 +153,13 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
147 } 153 }
148 expressInfoMapper.insert(expressInfo); 154 expressInfoMapper.insert(expressInfo);
149 155
150 - updateSellerDeliverStatusAfterInsertExpress(orderCode,expressInfo); 156 + updateSellerDeliverStatusAfterInsertExpress(orderCode, expressInfo);
  157 + }
  158 +
  159 + private boolean isWuhanNewpneumoniaHolidayTime() {
  160 + int now = DateUtil.getCurrentTimeSecond();
  161 + // 武汉疫情鉴定中心不能收货(2020-01-30 23:59:59到2020-02-09 23:59:59)
  162 + return now > 1580399999 && now <= 1581263999;
151 } 163 }
152 164
153 /** 165 /**
@@ -160,11 +172,10 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -160,11 +172,10 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
160 } 172 }
161 173
162 174
163 -  
164 /** 175 /**
165 * 确认收货处理 176 * 确认收货处理
166 */ 177 */
167 - private void handleAcceptExpress(ErpExpressBo erpExpressBo,Byte expressType) { 178 + private void handleAcceptExpress(ErpExpressBo erpExpressBo, Byte expressType) {
168 String waybillCode = erpExpressBo.getWaybillCode(); 179 String waybillCode = erpExpressBo.getWaybillCode();
169 int logisticsType = erpExpressBo.getLogisticsType(); 180 int logisticsType = erpExpressBo.getLogisticsType();
170 String acceptAddress = erpExpressBo.getAcceptAddress(); 181 String acceptAddress = erpExpressBo.getAcceptAddress();
@@ -174,14 +185,14 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -174,14 +185,14 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
174 int uid = erpExpressBo.getUid(); 185 int uid = erpExpressBo.getUid();
175 186
176 int createTime = erpExpressBo.getCreateTime(); 187 int createTime = erpExpressBo.getCreateTime();
177 - if(createTime<=0){ 188 + if (createTime <= 0) {
178 createTime = DateUtil.getCurrentTimeSecond(); 189 createTime = DateUtil.getCurrentTimeSecond();
179 } 190 }
180 191
181 192
182 // TODO 只有鉴定中心到买家的类型 ,才需要确认收货的,需要调用 193 // TODO 只有鉴定中心到买家的类型 ,才需要确认收货的,需要调用
183 - if(expressType!=null&&EnumExpressType.EXPRESS_TYPE_2.getCode().intValue()==expressType.intValue()){  
184 - LOGGER.info("handle accept express,orderCode {},uid {},waybillCode {},state {} ", orderCode,uid,waybillCode,state); 194 + if (expressType != null && EnumExpressType.EXPRESS_TYPE_2.getCode().intValue() == expressType.intValue()) {
  195 + LOGGER.info("handle accept express,orderCode {},uid {},waybillCode {},state {} ", orderCode, uid, waybillCode, state);
185 /* 暂时注释掉,等香港仓开发上线 196 /* 暂时注释掉,等香港仓开发上线
186 executorService.execute(() -> { 197 executorService.execute(() -> {
187 OrderRequest orderRequest = OrderRequest.builder() 198 OrderRequest orderRequest = OrderRequest.builder()
@@ -193,32 +204,37 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -193,32 +204,37 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
193 }); 204 });
194 */ 205 */
195 } 206 }
196 - processExpressInfo( state, logisticsType, orderCode, waybillCode, acceptAddress, acceptRemark, createTime, uid, expressType); 207 + processExpressInfo(state, logisticsType, orderCode, waybillCode, acceptAddress, acceptRemark, createTime, uid, expressType);
197 } 208 }
198 209
199 210
200 - private void updateSellerDeliverStatusAfterInsertExpress(long orderCode,ExpressInfo expressInfo ){ 211 + private void updateSellerDeliverStatusAfterInsertExpress(long orderCode, ExpressInfo expressInfo) {
201 //卖家物流的情形 212 //卖家物流的情形
202 - LOGGER.info("ExpressInfoUpdateConsumer update SellerDeliveryStatus enter orderCode {}",orderCode);  
203 - if(expressInfo.getExpressType()!=null&&expressInfo.getExpressType().intValue()== EnumExpressType.EXPRESS_TYPE_1.getCode().intValue()){ 213 + LOGGER.info("ExpressInfoUpdateConsumer update SellerDeliveryStatus enter orderCode {}", orderCode);
  214 + if (isSellerSendExpress(expressInfo)) {
204 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 215 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
205 - if(buyerOrder==null){ 216 + if (buyerOrder == null) {
206 LOGGER.warn("ExpressInfoUpdateConsumer updateSellerDeliverStatus buyerOrder is null,order code {} ", orderCode); 217 LOGGER.warn("ExpressInfoUpdateConsumer updateSellerDeliverStatus buyerOrder is null,order code {} ", orderCode);
207 - return ; 218 + return;
208 } 219 }
209 - if(buyerOrder.getSellerDeliveryStatus()==null||buyerOrder.getSellerDeliveryStatus().intValue()==0){ 220 + if (buyerOrder.getSellerDeliveryStatus() == null || buyerOrder.getSellerDeliveryStatus().intValue() == 0) {
210 //卖家发货的物流存在,但是状态仍然是未更新,更新一下就可以了 221 //卖家发货的物流存在,但是状态仍然是未更新,更新一下就可以了
211 buyerOrderMapper.updateSellerDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(), 222 buyerOrderMapper.updateSellerDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
212 1); 223 1);
213 - LOGGER.info("ExpressInfoUpdateConsumer update SellerDeliveryStatus with express info ,buyerOrder {},expressInfo {} ", buyerOrder,expressInfo); 224 + LOGGER.info("ExpressInfoUpdateConsumer update SellerDeliveryStatus with express info ,buyerOrder {},expressInfo {} ", buyerOrder, expressInfo);
214 } 225 }
215 } 226 }
216 } 227 }
217 - 228 +
  229 + private boolean isSellerSendExpress(ExpressInfo expressInfo) {
  230 + return expressInfo.getExpressType() != null
  231 + && expressInfo.getExpressType().intValue() == EnumExpressType.EXPRESS_TYPE_1.getCode().intValue();
  232 + }
  233 +
218 private ErpExpressBo convertErpJsonToObject(Object message) { 234 private ErpExpressBo convertErpJsonToObject(Object message) {
219 - try{ 235 + try {
220 JSONObject jsonMsg = JSONObject.parseObject(message.toString()); 236 JSONObject jsonMsg = JSONObject.parseObject(message.toString());
221 - ErpExpressBo bo=new ErpExpressBo(); 237 + ErpExpressBo bo = new ErpExpressBo();
222 bo.setBusinessType(jsonMsg.getIntValue("businessType")); 238 bo.setBusinessType(jsonMsg.getIntValue("businessType"));
223 bo.setWaybillCode(jsonMsg.getString("waybillCode")); 239 bo.setWaybillCode(jsonMsg.getString("waybillCode"));
224 bo.setLogisticsType(jsonMsg.getIntValue("logisticsType")); 240 bo.setLogisticsType(jsonMsg.getIntValue("logisticsType"));
@@ -230,7 +246,7 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger(); @@ -230,7 +246,7 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
230 bo.setUid(jsonMsg.getIntValue("uid")); 246 bo.setUid(jsonMsg.getIntValue("uid"));
231 bo.setOrderCode(jsonMsg.getLongValue("orderCode")); 247 bo.setOrderCode(jsonMsg.getLongValue("orderCode"));
232 return bo; 248 return bo;
233 - }catch (Exception e){ 249 + } catch (Exception e) {
234 LOGGER.warn("convertErpJsonToObject express info message error,message is {}.", message); 250 LOGGER.warn("convertErpJsonToObject express info message error,message is {}.", message);
235 return null; 251 return null;
236 } 252 }
@@ -21,6 +21,7 @@ import com.yohobuy.ufo.model.order.resp.MiniFaultForSecondDetail; @@ -21,6 +21,7 @@ import com.yohobuy.ufo.model.order.resp.MiniFaultForSecondDetail;
21 import com.yohobuy.ufo.model.order.vo.AddressInfo; 21 import com.yohobuy.ufo.model.order.vo.AddressInfo;
22 import com.yohobuy.ufo.model.resp.product.SecondDetailResp; 22 import com.yohobuy.ufo.model.resp.product.SecondDetailResp;
23 import com.yohoufo.common.caller.UfoServiceCaller; 23 import com.yohoufo.common.caller.UfoServiceCaller;
  24 +import com.yohoufo.common.config.SpecialTimeConfigReader;
24 import com.yohoufo.common.constant.ExpressInfoConstant; 25 import com.yohoufo.common.constant.ExpressInfoConstant;
25 import com.yohoufo.common.exception.UfoServiceException; 26 import com.yohoufo.common.exception.UfoServiceException;
26 import com.yohoufo.common.lock.RedisLock; 27 import com.yohoufo.common.lock.RedisLock;
@@ -52,6 +53,7 @@ import com.yohoufo.order.utils.OrderAssist; @@ -52,6 +53,7 @@ import com.yohoufo.order.utils.OrderAssist;
52 import lombok.NonNull; 53 import lombok.NonNull;
53 import org.apache.commons.collections.CollectionUtils; 54 import org.apache.commons.collections.CollectionUtils;
54 import org.apache.commons.lang3.StringUtils; 55 import org.apache.commons.lang3.StringUtils;
  56 +import org.apache.commons.lang3.tuple.Pair;
55 import org.slf4j.Logger; 57 import org.slf4j.Logger;
56 import org.slf4j.LoggerFactory; 58 import org.slf4j.LoggerFactory;
57 import org.springframework.beans.factory.annotation.Autowired; 59 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,6 +62,7 @@ import org.springframework.stereotype.Service; @@ -60,6 +62,7 @@ import org.springframework.stereotype.Service;
60 import javax.annotation.Resource; 62 import javax.annotation.Resource;
61 import java.util.*; 63 import java.util.*;
62 import java.util.concurrent.TimeUnit; 64 import java.util.concurrent.TimeUnit;
  65 +import java.util.function.Predicate;
63 import java.util.function.Supplier; 66 import java.util.function.Supplier;
64 import java.util.stream.Collectors; 67 import java.util.stream.Collectors;
65 68
@@ -152,6 +155,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -152,6 +155,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
152 155
153 @Autowired 156 @Autowired
154 private SellerService sellerService; 157 private SellerService sellerService;
  158 + @Autowired
  159 + private SpecialTimeConfigReader specialTimeConfigReader;
155 160
156 private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data"; 161 private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
157 162
@@ -1503,7 +1508,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -1503,7 +1508,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
1503 String deliverDesc=SellerConfig.DeliverDesc.SELLER_DEPOSIT_ORDER; 1508 String deliverDesc=SellerConfig.DeliverDesc.SELLER_DEPOSIT_ORDER;
1504 switch (oa){ 1509 switch (oa){
1505 case APPRAISE: 1510 case APPRAISE:
1506 - depotType = DepotType.BJ; 1511 + depotType = DepotType.NJ;
1507 deliverDesc = SellerConfig.DeliverDesc.APPRAISE_ORDER; 1512 deliverDesc = SellerConfig.DeliverDesc.APPRAISE_ORDER;
1508 break; 1513 break;
1509 case DEPOSITE: 1514 case DEPOSITE:
@@ -1525,6 +1530,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -1525,6 +1530,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
1525 return resp; 1530 return resp;
1526 } 1531 }
1527 1532
  1533 + Optional<DepotType> specialTimeDepotType = specialTimeConfigReader.specialTimeDepotType(DateUtil.getCurrentTimeSecond());
  1534 +
  1535 + if(specialTimeDepotType.isPresent()){
  1536 + resp = appraiseAddressService.findByDepotType(specialTimeDepotType.get().getCode());
  1537 + resp.setDeliverDesc(commonDeliverDescSupplier.get());
  1538 + resp.setWarnTips(warnTipsSupplier.get());
  1539 + return resp;
  1540 + }
1528 1541
1529 //寄存订单 1542 //寄存订单
1530 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 1543 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
@@ -13,6 +13,7 @@ import com.yohobuy.ufo.model.order.constants.OrderDetailDesc; @@ -13,6 +13,7 @@ import com.yohobuy.ufo.model.order.constants.OrderDetailDesc;
13 import com.yohobuy.ufo.model.order.constants.SkupType; 13 import com.yohobuy.ufo.model.order.constants.SkupType;
14 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; 14 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
15 import com.yohobuy.ufo.model.order.vo.AddressInfo; 15 import com.yohobuy.ufo.model.order.vo.AddressInfo;
  16 +import com.yohoufo.common.config.SpecialTimeConfigReader;
16 import com.yohoufo.common.utils.DateUtil; 17 import com.yohoufo.common.utils.DateUtil;
17 import com.yohoufo.dal.order.*; 18 import com.yohoufo.dal.order.*;
18 import com.yohoufo.dal.order.model.*; 19 import com.yohoufo.dal.order.model.*;
@@ -39,12 +40,14 @@ import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta; @@ -39,12 +40,14 @@ import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
39 import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper; 40 import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper;
40 import com.yohoufo.order.utils.*; 41 import com.yohoufo.order.utils.*;
41 import org.apache.commons.lang3.StringUtils; 42 import org.apache.commons.lang3.StringUtils;
  43 +import org.apache.commons.lang3.tuple.Pair;
42 import org.slf4j.Logger; 44 import org.slf4j.Logger;
43 import org.springframework.beans.factory.annotation.Autowired; 45 import org.springframework.beans.factory.annotation.Autowired;
44 import org.springframework.stereotype.Service; 46 import org.springframework.stereotype.Service;
45 47
46 import java.math.BigDecimal; 48 import java.math.BigDecimal;
47 import java.util.*; 49 import java.util.*;
  50 +import java.util.function.Predicate;
48 import java.util.function.Supplier; 51 import java.util.function.Supplier;
49 52
50 /** 53 /**
@@ -96,6 +99,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -96,6 +99,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
96 99
97 @Autowired 100 @Autowired
98 private SellerGoodsStatusFlowMapper sellerGoodsStatusFlowMapper; 101 private SellerGoodsStatusFlowMapper sellerGoodsStatusFlowMapper;
  102 + @Autowired
  103 + private SpecialTimeConfigReader specialTimeConfigReader;
99 104
100 105
101 private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL, 106 private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
@@ -180,18 +185,23 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -180,18 +185,23 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
180 Integer pboa = pbo.getAttributes(); 185 Integer pboa = pbo.getAttributes();
181 boolean isQuickDeliver = SellerGoodsHelper.isQuickDeliver(skupType); 186 boolean isQuickDeliver = SellerGoodsHelper.isQuickDeliver(skupType);
182 boolean isInstockDepositOrder = BuyerOrderUtils.isInstockDeposit(skupType, pboa); 187 boolean isInstockDepositOrder = BuyerOrderUtils.isInstockDeposit(skupType, pboa);
183 - boolean isSpecialDepot = isInstockDepositOrder; 188 + boolean isAssignNjDepot = isInstockDepositOrder;
184 AppraiseAddressInfo aai = null; 189 AppraiseAddressInfo aai = null;
185 //big prepare condition : not isQuickDeliver 190 //big prepare condition : not isQuickDeliver
186 - if(!isQuickDeliver){  
187 - if (isSpecialDepot) { 191 + if (!isQuickDeliver) {
  192 + if (isAssignNjDepot) {
188 AppraiseAddressResp aaResp = appraiseAddressService.findByDepotType(DepotType.NJ.getCode()); 193 AppraiseAddressResp aaResp = appraiseAddressService.findByDepotType(DepotType.NJ.getCode());
189 aai = AppraiseAddressService.convert2AppraiseAddressInfo(aaResp); 194 aai = AppraiseAddressService.convert2AppraiseAddressInfo(aaResp);
190 - }else {  
191 - // 收货地址 and 用户信息 195 + } else {
  196 + // 卖家寄回收货地址
192 if (Objects.nonNull(buildNode.userAddress)) { 197 if (Objects.nonNull(buildNode.userAddress)) {
193 - //卖家订单详情里才会有,买家没有  
194 - aai = appraiseAddressService.findAppraiseAddress(buildNode.userAddress.getAreaCode()); 198 + Optional<DepotType> specialTimeDepotType = specialTimeConfigReader.specialTimeDepotType(pbo.getCreateTime());
  199 + if (specialTimeDepotType.isPresent()) {
  200 + AppraiseAddressResp aaResp = appraiseAddressService.findByDepotType(specialTimeDepotType.get().getCode());
  201 + aai = AppraiseAddressService.convert2AppraiseAddressInfo(aaResp);
  202 + } else {
  203 + aai = appraiseAddressService.findAppraiseAddress(buildNode.userAddress.getAreaCode());
  204 + }
195 } 205 }
196 } 206 }
197 orderDetailInfo.setAppraiseAddress(aai); 207 orderDetailInfo.setAppraiseAddress(aai);