...
|
...
|
@@ -9,6 +9,7 @@ import com.yoho.error.exception.ServiceException; |
|
|
import com.yohobuy.ufo.model.order.common.*;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoRespBo;
|
|
|
import com.yohobuy.ufo.model.order.resp.MiniFaultConfirm;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.constant.ExpressInfoConstant;
|
...
|
...
|
@@ -90,6 +91,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
@Autowired
|
|
|
private OrderStatusFlowService orderStatusFlowService;
|
|
|
|
|
|
@Autowired
|
|
|
private QualityCheckMapper qualityCheckMapper;
|
|
|
|
|
|
//private static String EXPRESS_MQ_SEND = "logistics.logistics_data";
|
|
|
//private static String EXPRESS_MQ_SEND = "order.updateChangeRefundOrderExpressInfo";
|
|
|
private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
|
...
|
...
|
@@ -364,12 +368,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
//2.设定最近一个阶段的物流
|
|
|
expressInfoRespBo.setExpressInfoDetailList(Lists.newArrayList());
|
|
|
List<ExpressInfo> expressInfoList = getExpressInfoListByStage(actor, orderCode, expressType);
|
|
|
constructExpressInfo(expressInfoList, expressInfoRespBo.getExpressInfoDetailList());
|
|
|
constructExpressInfo(actor,expressInfoList, expressInfoRespBo.getExpressInfoDetailList());
|
|
|
|
|
|
//3.设定鉴定的物流调拨信息
|
|
|
expressInfoRespBo.setJudgeExpressInfoDetailList(Lists.newArrayList());
|
|
|
List<ExpressInfo> judgeExpressInfoList=getExpressInfoListByStage(actor, orderCode, EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode());
|
|
|
constructExpressInfo(judgeExpressInfoList, expressInfoRespBo.getJudgeExpressInfoDetailList());
|
|
|
constructExpressInfo(actor,judgeExpressInfoList, expressInfoRespBo.getJudgeExpressInfoDetailList());
|
|
|
|
|
|
//4.获取上一阶段的辅助物流信息
|
|
|
List<ExpressInfoDetail> supplementExpressInfoDetailList = Lists.newArrayList();
|
...
|
...
|
@@ -395,6 +399,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
// 2 卖家发货 == 平台鉴定 -- 交易成功 ,其中卖家发货和平台鉴定点亮
|
|
|
// 3 卖家发货 == 平台鉴定 == 交易成功 ,全部点亮
|
|
|
// 4 卖家发货 == 平台鉴定 == 交易失败 ,全部点亮
|
|
|
//5 卖家发货 == 交易关闭 ,全部点亮
|
|
|
expressInfoRespBo.setStage(1);
|
|
|
if(OrderStatus.PLATFORM_RECEIVE.getCode()==status
|
|
|
||OrderStatus.PLATFORM_CHECKING.getCode()==status){
|
...
|
...
|
@@ -403,6 +408,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
expressInfoRespBo.setStage(3);
|
|
|
}else if(OrderStatus.CHECKING_FAKE.getCode()==status){
|
|
|
expressInfoRespBo.setStage(4);
|
|
|
}else if(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()==status){
|
|
|
expressInfoRespBo.setStage(5);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -415,7 +422,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
}
|
|
|
//卖家物流详细
|
|
|
List<ExpressInfo> previousExpressInfoList = getExpressInfoListByStage(actor, orderCode, EnumExpressType.EXPRESS_TYPE_1.getCode());
|
|
|
constructExpressInfo(previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList());
|
|
|
constructExpressInfo(actor,previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList());
|
|
|
}else if(EnumExpressType.EXPRESS_TYPE_3.getCode().intValue()==expressType.intValue()
|
|
|
||EnumExpressType.EXPRESS_TYPE_REBACK.getCode().intValue()==expressType.intValue()){
|
|
|
//卖家这个时候看自己上一阶段的物流
|
...
|
...
|
@@ -425,7 +432,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
constructWayBillInfo(orderCode,EnumExpressType.EXPRESS_TYPE_1.getCode(),expressInfoRespBo);
|
|
|
}
|
|
|
List<ExpressInfo> previousExpressInfoList = getExpressInfoListByStage(actor,orderCode, EnumExpressType.EXPRESS_TYPE_1.getCode());
|
|
|
constructExpressInfo(previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList());
|
|
|
constructExpressInfo(actor,previousExpressInfoList, expressInfoRespBo.getSupplementExpressInfoDetailList());
|
|
|
}
|
|
|
|
|
|
}
|
...
|
...
|
@@ -505,17 +512,32 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
if(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().equals(expressType)){
|
|
|
LOGGER.info("getExpressInfoListByStage out because of expressType is judge center ,orderCode = {} ,expressType = {} ",orderCode,expressType);
|
|
|
List<ExpressInfo> ls = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
|
|
|
if(actor!=null&&TabType.BUY==actor&&CollectionUtils.isNotEmpty(ls)){
|
|
|
if(actor!=null&&CollectionUtils.isNotEmpty(ls)){
|
|
|
for(ExpressInfo info:ls){
|
|
|
if(info.getOperateTransferCode()==null){
|
|
|
continue;
|
|
|
}
|
|
|
if(EnumExpressDataOperateTransferCode.mini_fault_create.getCode()==info.getOperateTransferCode()){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_create_buyer.getOperateTransferDesc());
|
|
|
if(TabType.BUY==actor){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_create_buyer.getOperateTransferDesc());
|
|
|
}
|
|
|
|
|
|
//存在需要瑕疵确认的信息
|
|
|
QualityCheck qualityCheck = qualityCheckMapper.selectByOrderCode(orderCode);
|
|
|
if(qualityCheck!=null
|
|
|
&&qualityCheck.getType()!=null
|
|
|
&&EnumQualityCheckType.MINI_FAULT.getCode()==qualityCheck.getType().intValue()){
|
|
|
|
|
|
info.setQualityCheck(qualityCheck);
|
|
|
}
|
|
|
}else if(EnumExpressDataOperateTransferCode.mini_fault_accept.getCode()==info.getOperateTransferCode()){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_accept_buyer.getOperateTransferDesc());
|
|
|
if(TabType.BUY==actor){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_accept_buyer.getOperateTransferDesc());
|
|
|
}
|
|
|
}else if(EnumExpressDataOperateTransferCode.mini_fault_reject.getCode()==info.getOperateTransferCode()){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_reject_buyer.getOperateTransferDesc());
|
|
|
if(TabType.BUY==actor){
|
|
|
info.setAcceptRemark(EnumExpressDataOperateTransferCode.mini_fault_reject_buyer.getOperateTransferDesc());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -562,7 +584,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
ExpressInfo last=expressInfoList_All.get(0);
|
|
|
List<ExpressInfo> expressInfoList = Arrays.asList(last);
|
|
|
List<ExpressInfoDetail> expressInfoDetailList= Lists.newArrayList();
|
|
|
constructExpressInfo(expressInfoList,expressInfoDetailList);
|
|
|
constructExpressInfo(actor,expressInfoList,expressInfoDetailList);
|
|
|
|
|
|
LOGGER.info("queryLastExpressDetailInfo.queryExpressDetailInfo result = {}", JSON.toJSONString(expressInfoDetailList));
|
|
|
return expressInfoDetailList;
|
...
|
...
|
@@ -634,7 +656,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
}
|
|
|
|
|
|
|
|
|
private void constructExpressInfo(List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> detailList) {
|
|
|
private void constructExpressInfo(TabType actor,List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> detailList) {
|
|
|
if (CollectionUtils.isNotEmpty(expressInfoList)) {
|
|
|
for (ExpressInfo expressInfo : expressInfoList) {
|
|
|
ExpressInfoDetail expressInfoDetail = new ExpressInfoDetail();
|
...
|
...
|
@@ -643,6 +665,22 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
// 运单信息
|
|
|
expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
|
|
|
expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
|
|
|
|
|
//瑕疵确认信息
|
|
|
if(expressInfo.getQualityCheck()!=null){
|
|
|
QualityCheck qualityCheck = expressInfo.getQualityCheck();
|
|
|
boolean showBtn=false;
|
|
|
if(TabType.BUY==actor&&qualityCheck.getStatus()!=null&&EnumQualityCheckStatus.WAIT_CONFIRM.getCode()==qualityCheck.getStatus().intValue()){
|
|
|
showBtn=true;
|
|
|
}
|
|
|
MiniFaultConfirm miniFaultConfirm=new MiniFaultConfirm();
|
|
|
miniFaultConfirm.setShowBtn(showBtn);
|
|
|
miniFaultConfirm.setCreateTime(qualityCheck.getCreateTime());
|
|
|
miniFaultConfirm.setText(qualityCheck.getCheckText());
|
|
|
miniFaultConfirm.setImageUrls(StringUtils.isEmpty(qualityCheck.getImageUrl())?new ArrayList<>():Arrays.asList(qualityCheck.getImageUrl().split(",")));
|
|
|
expressInfoDetail.setMiniFaultConfirm(miniFaultConfirm);
|
|
|
}
|
|
|
|
|
|
detailList.add(expressInfoDetail);
|
|
|
}
|
|
|
}
|
...
|
...
|
|