Authored by caoyan

鉴定服务

... ... @@ -425,7 +425,7 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
resp.setAttributesStr(OrderConfigConstant.getAppraiseOrderAttributeStr(order.getAttributes(), RegionEnum.MAINLAND.getCode()));
//卖家物流单号
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(order.getParentOrderCode(),
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(order.getAttributes().equals(OrderAttributes.DEPOSITE.getCode()) ? order.getParentOrderCode() : order.getOrderCode(),
order.getUid(), EnumExpressType.EXPRESS_TYPE_1.getCode());
if(null != sellerExpressRecord) {
resp.setSellerWaybillCode(sellerExpressRecord.getWaybillCode());
... ... @@ -646,7 +646,16 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
Map<String, AppraiseOrderStorage> appraiseStorageMap = appraiseStorageList.stream().collect(Collectors.toMap(AppraiseOrderStorage::getOrderCode, s->s));
//查询卖家快递单号
List<ExpressRecord> expressRecordList =expressRecordMapper.selectByOrderCodeListAndType(orderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
List<String> expressOrderCodeList = Lists.newArrayList();
for(AppraiseOrder item : orderList) {
if(item.getAttributes().equals(OrderAttributes.APPRAISE.getCode())) {
expressOrderCodeList.add(item.getOrderCode());
}else if(item.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
expressOrderCodeList.add(item.getParentOrderCode());
}
}
List<ExpressRecord> expressRecordList =expressRecordMapper.selectByOrderCodeListAndType(expressOrderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
Map<String, ExpressRecord> expressRecordMap = expressRecordList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
return convertToResp(orderList, appraiseGoodsMap, appraiseStorageMap, expressRecordMap);
... ... @@ -662,7 +671,12 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService {
}
AppraiseOrderResp resp = new AppraiseOrderResp();
resp.setOrderCode(item.getOrderCode());
resp.setSellerWaybillCode(null == expressInfoMap.get(item.getOrderCode()) ? "" : expressInfoMap.get(item.getOrderCode()).getWaybillCode());
if(item.getAttributes().equals(OrderAttributes.APPRAISE.getCode())) {
resp.setSellerWaybillCode(null == expressInfoMap.get(item.getOrderCode()) ? "" : expressInfoMap.get(item.getOrderCode()).getWaybillCode());
}else if(item.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
resp.setSellerWaybillCode(null == expressInfoMap.get(item.getParentOrderCode()) ? "" : expressInfoMap.get(item.getParentOrderCode()).getWaybillCode());
}
resp.setProductName(appraiseGoodsMap.get(item.getOrderCode()).getProductName());
resp.setProductImage(ImagesHelper.getImageAbsoluteUrl(appraiseGoodsMap.get(item.getOrderCode()).getImageUrl(), ImagesConstant.BUCKET_GOODS_IMG));
resp.setProductCode(appraiseGoodsMap.get(item.getOrderCode()).getProductCode());
... ...
... ... @@ -962,10 +962,17 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
private List<BuyerOrderResp> convertAppraiseToBuyerOrderResp(List<AppraiseOrder> list, JSONObject jsonObject){
List<BuyerOrderResp> respList = Lists.newArrayList();
Set<String> parentOrderCodeSet = Sets.newHashSet();
List<String> parentOrderCodeList = list.stream().map(AppraiseOrder::getParentOrderCode).collect(Collectors.toList());
List<String> expressOrderCodeList = Lists.newArrayList();
for(AppraiseOrder order : list) {
if(order.getAttributes().equals(OrderAttributes.APPRAISE.getCode())) {
expressOrderCodeList.add(order.getOrderCode());
}else if(order.getAttributes().equals(OrderAttributes.DEPOSITE.getCode())) {
expressOrderCodeList.add(order.getParentOrderCode());
}
}
List<String> orderCodeList = list.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
List<ExpressRecord> expressList = expressRecordMapper.selectByOrderCodeListAndType(parentOrderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
Map<String, ExpressRecord> expressMap = expressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
List<ExpressRecord> expressList = expressRecordMapper.selectByOrderCodeListAndType(expressOrderCodeList, Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
Map<String, String> expressMap = expressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, ExpressRecord::getWaybillCode));
List<AppraiseOrderGoods> goodsList = appraiseOrderGoodsMapper.selectByOrderCodes(orderCodeList);
Map<String, AppraiseOrderGoods> goodsMap = goodsList.stream().collect(Collectors.toMap(AppraiseOrderGoods::getOrderCode, a->a));
List<AppraiseOrderStorage> storageList = appraiseOrderStorageMapper.selectByOrderCodes(orderCodeList);
... ... @@ -973,7 +980,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
for(AppraiseOrder item : list) {
BuyerOrderResp resp = new BuyerOrderResp();
resp.setOrderCode(item.getOrderCode());
resp.setSellerWaybillCode(null == expressMap.get(item.getParentOrderCode()) ? "" : expressMap.get(item.getParentOrderCode()).getWaybillCode());
resp.setSellerWaybillCode(item.getAttributes().equals(OrderAttributes.DEPOSITE.getCode()) ? expressMap.get(item.getParentOrderCode()) : expressMap.get(item.getOrderCode()));
resp.setStatus(item.getStatus());
resp.setStatusStr(Constant.convertOrderStatusStr(item.getStatus()));
resp.setProductImage(ImagesHelper.getImageAbsoluteUrl(goodsMap.get(item.getOrderCode()).getImageUrl(), ImagesConstant.BUCKET_GOODS_IMG));
... ...