|
|
@@ -19,6 +19,7 @@ import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.excel.utils.DateUtil;
|
|
|
import com.sckw.excel.utils.ValidUtil;
|
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
|
+import com.sckw.fleet.api.model.vo.RTruckVo;
|
|
|
import com.sckw.mongo.enums.BusinessTypeEnum;
|
|
|
import com.sckw.mongo.model.SckwLogisticsOrder;
|
|
|
import com.sckw.product.api.dubbo.GoodsInfoService;
|
|
|
@@ -291,7 +292,7 @@ public class ConsignOrderService {
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
List<CarWaybillVO> returnList = new ArrayList<>();
|
|
|
- list= list.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
|
|
+ list = list.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList());
|
|
|
for (String id : list) {
|
|
|
KwtLogisticsOrder order = kwtLogisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
.eq(StringUtils.isNotBlank(id), KwtLogisticsOrder::getId, Long.parseLong(id))
|
|
|
@@ -320,10 +321,11 @@ public class ConsignOrderService {
|
|
|
* 合理损耗值=装货量*合理损耗
|
|
|
扣亏量/吨->亏吨量-合理损耗值
|
|
|
*/
|
|
|
+ BigDecimal loadAmount = kwtWaybillOrder.getLoadAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getLoadAmount();
|
|
|
//已委托量
|
|
|
BigDecimal entrustAmount = kwtWaybillOrder.getEntrustAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getEntrustAmount();
|
|
|
//合理损耗值
|
|
|
- BigDecimal multiply = entrustAmount.multiply(loss.divide(BigDecimal.valueOf(1000L)));
|
|
|
+ BigDecimal multiply = loadAmount.multiply(loss.divide(BigDecimal.valueOf(1000L)));
|
|
|
//亏吨量
|
|
|
BigDecimal defectiveWeigh = kwtWaybillOrder.getDeficitAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getDeficitAmount();
|
|
|
//扣亏量/吨
|
|
|
@@ -346,14 +348,14 @@ public class ConsignOrderService {
|
|
|
carWaybillVo.setSendCarDate(DateUtil.getDateTime(kwtWaybillOrder.getCreateTime()));
|
|
|
if (loadTicket != null) {
|
|
|
carWaybillVo.setLoadAmount(loadTicket.getAmount() == null ? null : String.valueOf(loadTicket.getAmount()));
|
|
|
- carWaybillVo.setLoadDateTime(loadTicket.getCreateTime() == null ? null : DateUtil.getDateTime(loadTicket.getCreateTime()));
|
|
|
+ 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.getCreateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getCreateTime()));
|
|
|
+ carWaybillVo.setUnloadDateTime(unloadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getOperateTime()));
|
|
|
} else {
|
|
|
carWaybillVo.setUnloadAmount(null);
|
|
|
carWaybillVo.setUnloadDateTime(null);
|
|
|
@@ -365,6 +367,8 @@ public class ConsignOrderService {
|
|
|
carWaybillVo.setCreateTime(kwtWaybillOrder.getCreateTime());
|
|
|
// carWaybillVo.setAppointor(remoteSystemService.queryUserCacheById(kwtWaybillOrder.getCreateBy()) == null ?
|
|
|
// String.valueOf(kwtWaybillOrder.getCreateBy()) : remoteSystemService.queryUserCacheById(kwtWaybillOrder.getCreateBy()).getName());
|
|
|
+ carWaybillVo.setLOrderNo(order.getLOrderNo());
|
|
|
+ carWaybillVo.setLOrderId(String.valueOf(order.getId()));
|
|
|
returnList.add(carWaybillVo);
|
|
|
}
|
|
|
}
|
|
|
@@ -424,10 +428,11 @@ public class ConsignOrderService {
|
|
|
* 合理损耗值=装货量*合理损耗
|
|
|
扣亏量/吨->亏吨量-合理损耗值
|
|
|
*/
|
|
|
+ BigDecimal loadAmount = kwtWaybillOrder.getLoadAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getLoadAmount();
|
|
|
//已委托量
|
|
|
BigDecimal entrustAmount = kwtWaybillOrder.getEntrustAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getEntrustAmount();
|
|
|
//合理损耗值
|
|
|
- BigDecimal multiply = entrustAmount.multiply(loss.divide(BigDecimal.valueOf(1000L)));
|
|
|
+ BigDecimal multiply = loadAmount.multiply(loss.divide(BigDecimal.valueOf(1000L)));
|
|
|
//亏吨量
|
|
|
BigDecimal defectiveWeigh = kwtWaybillOrder.getDeficitAmount() == null ? new BigDecimal("0.00") : kwtWaybillOrder.getDeficitAmount();
|
|
|
//扣亏量/吨
|
|
|
@@ -448,14 +453,14 @@ public class ConsignOrderService {
|
|
|
carWaybillVo.setSendCarDate(DateUtil.getDateTime(kwtWaybillOrder.getCreateTime()));
|
|
|
if (loadTicket != null) {
|
|
|
carWaybillVo.setLoadAmount(loadTicket.getAmount() == null ? null : String.valueOf(loadTicket.getAmount()));
|
|
|
- carWaybillVo.setLoadDateTime(loadTicket.getCreateTime() == null ? null : DateUtil.getDateTime(loadTicket.getCreateTime()));
|
|
|
+ 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.getCreateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getCreateTime()));
|
|
|
+ carWaybillVo.setUnloadDateTime(unloadTicket.getOperateTime() == null ? null : DateUtil.getDateTime(unloadTicket.getOperateTime()));
|
|
|
} else {
|
|
|
carWaybillVo.setUnloadAmount(null);
|
|
|
carWaybillVo.setUnloadDateTime(null);
|
|
|
@@ -467,6 +472,8 @@ public class ConsignOrderService {
|
|
|
carWaybillVo.setCreateTime(kwtWaybillOrder.getCreateTime());
|
|
|
// carWaybillVo.setAppointor(remoteSystemService.queryUserCacheById(kwtWaybillOrder.getCreateBy()) == null ?
|
|
|
// String.valueOf(kwtWaybillOrder.getCreateBy()) : remoteSystemService.queryUserCacheById(kwtWaybillOrder.getCreateBy()).getName());
|
|
|
+ carWaybillVo.setLOrderNo(order.getLOrderNo());
|
|
|
+ carWaybillVo.setLOrderId(String.valueOf(order.getId()));
|
|
|
returnList.add(carWaybillVo);
|
|
|
}
|
|
|
}
|
|
|
@@ -510,16 +517,19 @@ public class ConsignOrderService {
|
|
|
if (CollectionUtils.isEmpty(stringList)) {
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
- List<OrderCarDTO> list = kwtWaybillOrderMapper.selectWaybillOrderCarListGroupByTruckNo(stringList, orderDto.getPage()-1, orderDto.getPageSize());
|
|
|
-// if (CollectionUtils.isNotEmpty(list)) {
|
|
|
-// List<String> stringList = list.stream().map(OrderCarDTO::getTruckNo).collect(Collectors.toList());
|
|
|
-// Map<String, RTruckVo> truck = remoteFleetService.findTruck(stringList);
|
|
|
-// for (OrderCarDTO dto : list) {
|
|
|
-// dto.setLoadAmount(truck.get(dto.getTruckNo()) == null ?
|
|
|
-// null : (truck.get(dto.getTruckNo()).getActualWeight() == null ?
|
|
|
-// null : (String.valueOf(truck.get(dto.getTruckNo()).getActualWeight()))));
|
|
|
-// }
|
|
|
-// }
|
|
|
+ List<Integer> statusList = new ArrayList<>();
|
|
|
+ statusList.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
|
|
|
+ statusList.add(CarWaybillEnum.APPROVAL_PASS.getCode());
|
|
|
+ List<OrderCarDTO> list = kwtWaybillOrderMapper.selectWaybillOrderCarListGroupByTruckNo(stringList, statusList,orderDto.getPage() - 1, orderDto.getPageSize());
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ List<String> stringLists = list.stream().map(OrderCarDTO::getTruckNo).collect(Collectors.toList());
|
|
|
+ Map<String, RTruckVo> truck = remoteFleetService.findTruck(stringLists);
|
|
|
+ for (OrderCarDTO dto : list) {
|
|
|
+ dto.setLoadAmount(truck.get(dto.getTruckNo()) == null ?
|
|
|
+ null : (truck.get(dto.getTruckNo()).getActualWeight() == null ?
|
|
|
+ null : (String.valueOf(truck.get(dto.getTruckNo()).getActualWeight()))));
|
|
|
+ }
|
|
|
+ }
|
|
|
PageResult build = PageResult.build(orderDto.getPage(), orderDto.getPageSize(), (long) list.size(), list);
|
|
|
return HttpResult.ok(build);
|
|
|
}
|