|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@@ -1443,22 +1444,22 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
}
|
|
|
List<ArchiveOrderDto> archiveOrderDtos = BeanUtil.copyToList(kwtWaybillOrders, ArchiveOrderDto.class);
|
|
|
|
|
|
- List<Long> ids = new ArrayList<>();//物流运单id
|
|
|
- List<Long> lids = new ArrayList<>();//物流订单id
|
|
|
- List<Long> tids = new ArrayList<>();//车辆id
|
|
|
- for (ArchiveOrderDto archiveOrderDto : archiveOrderDtos) {
|
|
|
+ Set<Long> ids = new HashSet<>();//物流运单id
|
|
|
+ Set<Long> lids = new HashSet<>();//物流订单id
|
|
|
+ Set<Long> tids = new HashSet<>();//车辆id
|
|
|
+ for (KwtWaybillOrder archiveOrderDto : kwtWaybillOrders) {
|
|
|
ids.add(archiveOrderDto.getId());
|
|
|
lids.add(archiveOrderDto.getLOrderId());
|
|
|
tids.add(archiveOrderDto.getTruckId());
|
|
|
}
|
|
|
//物流订单
|
|
|
List<KwtLogisticsOrder> kwtLogisticsOrders = logisticsOrderMapper.selectList(Wrappers.lambdaQuery(KwtLogisticsOrder.class)
|
|
|
- .select(KwtLogisticsOrder::getTOrderId, KwtLogisticsOrder::getLOrderNo, KwtLogisticsOrder::getTOrderNo)
|
|
|
+ .select(KwtLogisticsOrder::getId, KwtLogisticsOrder::getTOrderId, KwtLogisticsOrder::getLOrderNo, KwtLogisticsOrder::getTOrderNo, KwtLogisticsOrder::getPrice, KwtLogisticsOrder::getGoodsPrice)
|
|
|
.in(KwtLogisticsOrder::getId, lids));
|
|
|
Map<Long, KwtLogisticsOrder> lmap = kwtLogisticsOrders.stream().collect(Collectors.toMap(KwtLogisticsOrder::getId, Function.identity(), (a, b) -> a));
|
|
|
//商品
|
|
|
List<KwtLogisticsOrderGoods> kwtLogisticsOrderGoods = logisticsOrderGoodsMapper.selectList(Wrappers.lambdaQuery(KwtLogisticsOrderGoods.class)
|
|
|
- .select(KwtLogisticsOrderGoods::getGoodsId, KwtLogisticsOrderGoods::getLOrderNo, KwtLogisticsOrderGoods::getGoodsName, KwtLogisticsOrderGoods::getGoodsType)
|
|
|
+ .select(KwtLogisticsOrderGoods::getLOrderId, KwtLogisticsOrderGoods::getGoodsId, KwtLogisticsOrderGoods::getLOrderNo, KwtLogisticsOrderGoods::getGoodsName, KwtLogisticsOrderGoods::getGoodsType)
|
|
|
.in(KwtLogisticsOrderGoods::getLOrderId, lids));
|
|
|
Map<Long, Long> godmap = kwtLogisticsOrderGoods.stream().collect(Collectors.toMap(KwtLogisticsOrderGoods::getLOrderId, KwtLogisticsOrderGoods::getGoodsId, (a, b) -> a));
|
|
|
List<Long> goodsId = kwtLogisticsOrderGoods.stream().map(KwtLogisticsOrderGoods::getGoodsId).distinct().toList();
|
|
|
@@ -1493,7 +1494,7 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
Map<Long, List<KwtWaybillOrderWeighbridge>> weighMap = kwtWaybillOrderWeighbridges.stream().collect(Collectors.groupingBy(KwtWaybillOrderWeighbridge::getWOrderId));
|
|
|
|
|
|
//车辆
|
|
|
- List<RTruckVo> truckByTruckIds = remoteFleetService.findTruckByTruckIds(tids);
|
|
|
+ List<RTruckVo> truckByTruckIds = remoteFleetService.findTruckByTruckIds(new ArrayList<>(tids));
|
|
|
Map<Long, RTruckVo> tMap = truckByTruckIds.stream().collect(Collectors.toMap(RTruckVo::getId, Function.identity(), (a, b) -> a));
|
|
|
|
|
|
for (ArchiveOrderDto archiveOrderDto : archiveOrderDtos) {
|
|
|
@@ -1505,6 +1506,8 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
archiveOrderDto.setTOrderNo(kwtLogisticsOrder.getTOrderNo());
|
|
|
archiveOrderDto.setPrice(kwtLogisticsOrder.getPrice());
|
|
|
archiveOrderDto.setGoodsPrice(kwtLogisticsOrder.getGoodsPrice());
|
|
|
+ } else {
|
|
|
+ log.error("为空 {} {}", JSONObject.toJSONString(archiveOrderDto), JSONObject.toJSONString(lmap));
|
|
|
}
|
|
|
|
|
|
List<KwtWaybillOrderWeighbridge> kwtWaybillOrderWeighbridges1 = weighMap.get(id);
|
|
|
@@ -1515,13 +1518,13 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
archiveOrderDto.setWeigh(kwtWaybillOrderWeighbridges1.stream().map(d -> {
|
|
|
WeighDto bean = BeanUtil.toBean(d, WeighDto.class);
|
|
|
bean.setCreateTime(LocalDateTimeUtil.of(d.getCreateTime()));
|
|
|
- bean.setName(map.get(d.getWeighbridgeId()));
|
|
|
+ bean.setName(map.getOrDefault(d.getWeighbridgeId(), "-"));
|
|
|
return bean;
|
|
|
}).toList());
|
|
|
}
|
|
|
|
|
|
RTruckVo rTruckVo = tMap.get(archiveOrderDto.getTruckId());
|
|
|
- if(Objects.nonNull(rTruckVo)){
|
|
|
+ if (Objects.nonNull(rTruckVo)) {
|
|
|
archiveOrderDto.setTruckType(Integer.parseInt(rTruckVo.getTruckType()));
|
|
|
archiveOrderDto.setAxes(rTruckVo.getCarAxis());
|
|
|
}
|