Authored by caoyan

一个运单号对应多个订单

... ... @@ -14,7 +14,7 @@ public interface ExpressRecordMapper {
List<ExpressRecord> selectByOrderCodeListAndType(@Param("orderCodeList") List<String> orderCodeList,
@Param("expressTypeList") List<Integer> expressTypeList);
ExpressRecord selectByWaybillCode(@Param("waybillCode") String waybillCode);
List<ExpressRecord> selectByWaybillCode(@Param("waybillCode") String waybillCode);
ExpressRecord selectByOrderCodeAndType(@Param("orderCode") String orderCode, @Param("uid") Integer uid,
@Param("expressType") Integer expressType);
... ...
... ... @@ -747,12 +747,12 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
if(StringUtils.isNotEmpty(req.getSellerWaybillCode())) {
ExpressRecord expressRecord = expressRecordMapper.selectByWaybillCode(req.getSellerWaybillCode());
if(null == expressRecord) {
List<ExpressRecord> expressRecordList = expressRecordMapper.selectByWaybillCode(req.getSellerWaybillCode());
if(CollectionUtils.isEmpty(expressRecordList)) {
return false;
}else {
String buyerOrderCode = expressRecord.getOrderCode();
List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectByOrderCode(Lists.newArrayList(buyerOrderCode));
List<String> buyerOrderCodeList = expressRecordList.stream().map(ExpressRecord::getOrderCode).collect(Collectors.toList());
List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectByOrderCode(buyerOrderCodeList);
req.setSkup(buyerOrderGoodsList.get(0).getSkup());
}
}
... ...