|
@@ -427,9 +427,12 @@ public class ConsignOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ List<Long> lists = StringUtils.splitStrToList(orderDto.getIds(), Long.class);
|
|
|
|
|
+ getLogisticsOrderCirculate(lists, returnList);
|
|
|
List<CarWaybillVO> collect = new ArrayList<>();
|
|
List<CarWaybillVO> collect = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(returnList)) {
|
|
if (CollectionUtils.isNotEmpty(returnList)) {
|
|
|
- collect = returnList.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
|
|
|
|
|
|
|
+ collect = returnList.stream().sorted(Comparator.comparing(CarWaybillVO::getLOrderId).reversed()).collect(Collectors.toList());
|
|
|
|
|
+ collect = collect.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
|
|
PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
|
|
|
return HttpResult.ok(result);
|
|
return HttpResult.ok(result);
|
|
@@ -556,6 +559,10 @@ public class ConsignOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (DriverListVo driverListVo : list) {
|
|
for (DriverListVo driverListVo : list) {
|
|
|
|
|
+ if (driverListVo.getCirculateId().isEmpty()) {
|
|
|
|
|
+ driverListVo.setStatus(1);
|
|
|
|
|
+ driverListVo.setStatusLabel(CarWaybillEnum.PENDING_ORDER.getDestination());
|
|
|
|
|
+ }
|
|
|
List<String> objects = new ArrayList<>();
|
|
List<String> objects = new ArrayList<>();
|
|
|
objects.add(driverListVo.getTruckNo());
|
|
objects.add(driverListVo.getTruckNo());
|
|
|
if (!ObjectUtils.isEmpty(truck)) {
|
|
if (!ObjectUtils.isEmpty(truck)) {
|
|
@@ -610,6 +617,7 @@ public class ConsignOrderService {
|
|
|
// .in(KwtLogisticsOrder::getId,list)
|
|
// .in(KwtLogisticsOrder::getId,list)
|
|
|
// .orderByDesc(KwtLogisticsOrder::getId)
|
|
// .orderByDesc(KwtLogisticsOrder::getId)
|
|
|
// );
|
|
// );
|
|
|
|
|
+ /**趟次数据*/
|
|
|
for (Long id : list) {
|
|
for (Long id : list) {
|
|
|
KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
.eq(StringUtils.isNotBlank(id), KwtLogisticsOrder::getId, id)
|
|
.eq(StringUtils.isNotBlank(id), KwtLogisticsOrder::getId, id)
|
|
@@ -694,14 +702,79 @@ public class ConsignOrderService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ /**循环数据*/
|
|
|
|
|
+ getLogisticsOrderCirculate(list, returnList);
|
|
|
List<CarWaybillVO> collect = new ArrayList<>();
|
|
List<CarWaybillVO> collect = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(returnList)) {
|
|
if (CollectionUtils.isNotEmpty(returnList)) {
|
|
|
- collect = returnList.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
|
|
|
|
|
|
|
+ collect = returnList.stream().sorted(Comparator.comparing(CarWaybillVO::getLOrderId).reversed()).collect(Collectors.toList());
|
|
|
|
|
+ collect = collect.stream().skip((orderDto.getPage() - 1) * orderDto.getPageSize()).limit(orderDto.getPageSize()).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
|
|
PageResult result = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), returnList.stream().count(), collect);
|
|
|
return HttpResult.ok(result);
|
|
return HttpResult.ok(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void getLogisticsOrderCirculate(List<Long> list, List<CarWaybillVO> returnList) {
|
|
|
|
|
+ for (Long lOrderId : list) {
|
|
|
|
|
+ KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(lOrderId), KwtLogisticsOrder::getId, lOrderId)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (ObjectUtils.isEmpty(order)) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ List<KwtLogisticsOrderCirculate> logisticsOrderCirculates = kwtLogisticsOrderCirculateMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderCirculate>()
|
|
|
|
|
+ .in(KwtLogisticsOrderCirculate::getLOrderId, lOrderId)
|
|
|
|
|
+ .eq(KwtLogisticsOrderCirculate::getStatus, 0)
|
|
|
|
|
+ .eq(KwtLogisticsOrderCirculate::getDelFlag, 0)
|
|
|
|
|
+ .isNotNull(KwtLogisticsOrderCirculate::getWOrderId)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(logisticsOrderCirculates)) {
|
|
|
|
|
+ for (KwtLogisticsOrderCirculate circulate : logisticsOrderCirculates) {
|
|
|
|
|
+ CarWaybillVO carWaybillVo = new CarWaybillVO();
|
|
|
|
|
+ carWaybillVo.setLOrderNo(order.getLOrderNo());
|
|
|
|
|
+ carWaybillVo.setLOrderId(String.valueOf(lOrderId));
|
|
|
|
|
+ carWaybillVo.setWOrderId(circulate.getWOrderId() == null ? null : String.valueOf(circulate.getWOrderId()));
|
|
|
|
|
+// carWaybillVo.setWOrderNo();
|
|
|
|
|
+ carWaybillVo.setTruckNo(circulate.getTruckNo());
|
|
|
|
|
+ carWaybillVo.setStatus(CarWaybillEnum.PENDING_ORDER.getStatus());
|
|
|
|
|
+ carWaybillVo.setStatusLabel(CarWaybillEnum.PENDING_ORDER.getDestination());
|
|
|
|
|
+ carWaybillVo.setWaybillType(circulate.getType());
|
|
|
|
|
+ carWaybillVo.setDriverName(circulate.getDriverName());
|
|
|
|
|
+// carWaybillVo.setConsignMotorcade();
|
|
|
|
|
+ DecimalFormat decimalFormat = new DecimalFormat("0.00");
|
|
|
|
|
+ carWaybillVo.setSendCarWeigh(circulate.getEntrustAmount() == null ? null : decimalFormat.format(circulate.getEntrustAmount()));
|
|
|
|
|
+ carWaybillVo.setSendCarDate(circulate.getCreateTime() == null ? null : DateUtil.getDateTime(circulate.getCreateTime()));
|
|
|
|
|
+ KwtWaybillOrderTicket loadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(circulate.getId()), KwtWaybillOrderTicket::getWOrderId, circulate.getId())
|
|
|
|
|
+ .eq(KwtWaybillOrderTicket::getType, NumberConstant.ONE));
|
|
|
|
|
+ KwtWaybillOrderTicket unloadTicket = kwtWaybillOrderTicketMapper.selectOne(new LambdaQueryWrapper<KwtWaybillOrderTicket>()
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(circulate.getId()), KwtWaybillOrderTicket::getWOrderId, circulate.getId())
|
|
|
|
|
+ .eq(KwtWaybillOrderTicket::getType, NumberConstant.TWO));
|
|
|
|
|
+ if (loadTicket != null) {
|
|
|
|
|
+ carWaybillVo.setLoadAmount(loadTicket.getAmount() == null ? null : String.valueOf(loadTicket.getAmount()));
|
|
|
|
|
+ carWaybillVo.setLoadDateTime(loadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(loadTicket.getOperateTime()));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ carWaybillVo.setLoadAmount(null);
|
|
|
|
|
+ carWaybillVo.setLoadDateTime(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (unloadTicket != null) {
|
|
|
|
|
+ carWaybillVo.setUnloadAmount(unloadTicket.getAmount() == null ? null : String.valueOf(unloadTicket.getAmount()));
|
|
|
|
|
+ carWaybillVo.setUnloadDateTime(unloadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getOperateTime()));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ carWaybillVo.setUnloadAmount(null);
|
|
|
|
|
+ carWaybillVo.setUnloadDateTime(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ carWaybillVo.setDefectiveWeigh("0.00");
|
|
|
|
|
+ carWaybillVo.setDeduct(new BigDecimal("0.00"));
|
|
|
|
|
+ carWaybillVo.setLoss(order.getLoss());
|
|
|
|
|
+ SysDictResDto sysDictResDto = remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.TAX_RATE_TYPE.getType(), order.getLossUnit());
|
|
|
|
|
+ carWaybillVo.setLossLabel(sysDictResDto == null ? null : sysDictResDto.getLabel());
|
|
|
|
|
+ carWaybillVo.setCreateTime(circulate.getCreateTime());
|
|
|
|
|
+ returnList.add(carWaybillVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 托运订单/承运订单-获取车辆信息
|
|
* 托运订单/承运订单-获取车辆信息
|
|
|
*
|
|
*
|