...
|
...
|
@@ -130,7 +130,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
private UserProxyService userProxyService;
|
|
|
|
|
|
@Autowired
|
|
|
private AppraiseOrderService appraiseOrderService;
|
|
|
AppraiseOrderMapper appraiseOrderMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private OrderCodeGenerator orderCodeGenerator;
|
...
|
...
|
@@ -544,6 +544,131 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据订单号以及物流类型返回 物流信息
|
|
|
* @param orderCode
|
|
|
* @param expressTypeList
|
|
|
* @return
|
|
|
*/
|
|
|
private List<ExpressInfoDetail> getExpressInfoDetailListByOrderCodeExpressType(long orderCode, List<Integer> expressTypeList){
|
|
|
|
|
|
// 物流信息列表
|
|
|
List<ExpressInfo> list = Lists.newArrayList();
|
|
|
expressTypeList.stream().forEach(expressType -> list.addAll(getExpressInfoList(orderCode, expressType)));
|
|
|
|
|
|
return list.stream().map(expressInfo -> covertToExpressInfoDetail(expressInfo)).collect(Collectors.toList());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 付费鉴定 and 付费寄存 物流信息
|
|
|
* @param orderCode
|
|
|
* @return
|
|
|
*/
|
|
|
public ExpressInfoRespBo queryAppraiseExpressDetailInfo(Long orderCode) {
|
|
|
|
|
|
ExpressInfoRespBo expressInfoRespBo = new ExpressInfoRespBo();
|
|
|
|
|
|
AppraiseOrder appraiseOrder = appraiseOrderMapper.selectByOrderCode(orderCode);
|
|
|
throwServiceExceptionIf(Objects.isNull(appraiseOrder), "订单不存在");
|
|
|
|
|
|
|
|
|
// 付费寄存 无点亮信息,只根据状态展示对应的物流信息
|
|
|
if (appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_APPRAISE.getCode()){
|
|
|
|
|
|
// 用户发货, 待用户收货 只有这两个状态展示物流
|
|
|
throwServiceExceptionIf(appraiseOrder.getStatus() != AppraiseOrderStatus.SELLER_SEND_OUT.getCode()
|
|
|
&& appraiseOrder.getStatus() != AppraiseOrderStatus.WAITING_RECEIVE.getCode(), "不展示物流信息");
|
|
|
|
|
|
List<Integer> expressTypeList = Lists.newArrayList();
|
|
|
// 用户发货
|
|
|
if(appraiseOrder.getStatus() == AppraiseOrderStatus.SELLER_SEND_OUT.getCode()){
|
|
|
expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
|
|
|
}else if(appraiseOrder.getStatus() == AppraiseOrderStatus.WAITING_RECEIVE.getCode()){
|
|
|
expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
|
|
|
EnumExpressType.EXPRESS_TYPE_3.getCode(),
|
|
|
EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
|
|
|
}
|
|
|
|
|
|
// 物流单号信息
|
|
|
constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
|
|
|
// 根据订单号and物流类型 返回物流信息
|
|
|
List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, expressTypeList);
|
|
|
|
|
|
expressInfoRespBo.setExpressInfoDetailTitle("");
|
|
|
expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
|
|
|
|
|
|
return expressInfoRespBo;
|
|
|
|
|
|
}else if(appraiseOrder.getAttributes() == AppraiseOrderAttributes.PAID_DEPOSIT.getCode()){
|
|
|
|
|
|
// 子订单的场合,点亮信息 + 物流信息(不区分阶段)
|
|
|
// 父订单的场合,点亮信息 + 物流信息(区分阶段)
|
|
|
boolean isSubOrder = Objects.nonNull(appraiseOrder.getParentOrderCode()) ? true : false;
|
|
|
|
|
|
// 点亮信息设置
|
|
|
expressInfoRespBo.setStage(new AppraiseExpressStageBuilder(appraiseOrder).build());
|
|
|
|
|
|
// 子订单
|
|
|
if (isSubOrder){
|
|
|
|
|
|
// 寄回物流
|
|
|
List<Integer> expressTypeList = Arrays.asList(EnumExpressType.EXPRESS_TYPE_2.getCode(),
|
|
|
EnumExpressType.EXPRESS_TYPE_3.getCode(),
|
|
|
EnumExpressType.EXPRESS_TYPE_REBACK.getCode());
|
|
|
|
|
|
// 物流单号信息
|
|
|
constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
|
|
|
// 根据订单号and物流类型 返回物流信息
|
|
|
List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, expressTypeList);
|
|
|
|
|
|
expressInfoRespBo.setExpressInfoDetailTitle("");
|
|
|
expressInfoRespBo.setExpressInfoDetailList(expressInfoDetailList);
|
|
|
|
|
|
return expressInfoRespBo;
|
|
|
|
|
|
}
|
|
|
// 父订单
|
|
|
else{
|
|
|
|
|
|
List<Integer> expressTypeList = getAppraiseExpressType(appraiseOrder.getStatus());
|
|
|
if (CollectionUtils.isEmpty(expressTypeList)) {
|
|
|
LOGGER.info("{}, appraise expressTypeList is empty", orderCode);
|
|
|
return expressInfoRespBo;
|
|
|
}
|
|
|
|
|
|
// 物流单号信息
|
|
|
constructWayBillInfo(orderCode, expressTypeList, expressInfoRespBo);
|
|
|
|
|
|
// 其中是否包含了 鉴定中心内部调拨信息
|
|
|
if (expressTypeList.contains(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode())){
|
|
|
|
|
|
// 根据订单号and物流类型 返回物流信息
|
|
|
List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode()));
|
|
|
|
|
|
expressInfoRespBo.setJudgeExpressInfoDetailList(expressInfoDetailList);
|
|
|
expressInfoRespBo.setJudgeExpressInfoDetailTitle("平台鉴定");
|
|
|
}
|
|
|
|
|
|
// 根据订单号and物流类型 返回物流信息
|
|
|
List<ExpressInfoDetail> expressInfoDetailList = getExpressInfoDetailListByOrderCodeExpressType(orderCode, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
|
|
|
|
|
|
expressInfoRespBo.setSupplementExpressInfoDetailTitle("卖家发往平台");
|
|
|
expressInfoRespBo.setSupplementExpressInfoDetailList(expressInfoDetailList);
|
|
|
|
|
|
return expressInfoRespBo;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
LOGGER.info("{}, result is {}", orderCode, JSON.toJSONString(expressInfoRespBo));
|
|
|
return expressInfoRespBo;
|
|
|
}
|
|
|
|
|
|
private void constructSupplementExpress(TabType actor, Long orderCode, Integer expressType, ExpressInfoRespBo expressInfoRespBo) {
|
|
|
if (EnumExpressType.EXPRESS_TYPE_2.getCode().intValue() == expressType.intValue()
|
|
|
|| EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode().intValue() == expressType.intValue()) {
|
...
|
...
|
@@ -635,6 +760,30 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据状态获取物流类型
|
|
|
* @param status
|
|
|
* @return
|
|
|
*/
|
|
|
private List<Integer> getAppraiseExpressType(Integer status) {
|
|
|
if (AppraiseOrderStatus.SELLER_SEND_OUT.getCode() == status) {
|
|
|
return Arrays.asList(EnumExpressType.EXPRESS_TYPE_1.getCode());
|
|
|
}
|
|
|
// 这些状态需要展示 平台鉴定
|
|
|
else if (AppraiseOrderStatus.PLATFORM_RECEIVE.getCode() == status
|
|
|
|| AppraiseOrderStatus.PLATFORM_CHECKING.getCode() == status
|
|
|
|| AppraiseOrderStatus.JUDGE_PASS.getCode() == status
|
|
|
|| AppraiseOrderStatus.WAITING_RECEIVE.getCode() == status
|
|
|
|| AppraiseOrderStatus.CHECKING_FAKE.getCode() == status
|
|
|
|| AppraiseOrderStatus.QUALITY_CHECK_FAKE.getCode() == status
|
|
|
|| AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode() == status) {
|
|
|
return Arrays.asList(EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER.getCode(), EnumExpressType.EXPRESS_TYPE_1.getCode());
|
|
|
}
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* private Integer getCurrentExpressType4ExpressRecordAndSeller(Integer status){
|
|
|
|
|
|
Integer type ;
|
...
|
...
|
@@ -840,6 +989,25 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
return "订单跟踪";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 响应结果类型转换
|
|
|
* @param expressInfo
|
|
|
* @return
|
|
|
*/
|
|
|
private ExpressInfoDetail covertToExpressInfoDetail(ExpressInfo expressInfo){
|
|
|
ExpressInfoDetail expressInfoDetail = new ExpressInfoDetail();
|
|
|
|
|
|
// 运单接收地
|
|
|
expressInfoDetail.setAcceptAddress(expressInfo.getAcceptAddress());
|
|
|
// 运单信息
|
|
|
expressInfoDetail.setAcceptRemark(expressInfo.getAcceptRemark());
|
|
|
expressInfoDetail.setCreateTimeStr(DateUtil.formatDate(expressInfo.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
|
|
|
|
|
expressInfoDetail.setState(expressInfo.getState());
|
|
|
expressInfoDetail.setExpressType(expressInfo.getExpressType().intValue());
|
|
|
|
|
|
return expressInfoDetail;
|
|
|
}
|
|
|
|
|
|
private void constructExpressInfo(TabType actor, List<ExpressInfo> expressInfoList, List<ExpressInfoDetail> detailList) {
|
|
|
if (CollectionUtils.isNotEmpty(expressInfoList)) {
|
...
|
...
|
|