|
@@ -3400,6 +3400,30 @@ public class KwtWaybillOrderV1Service {
|
|
|
KwtLogisticsOrderUnit carrierEnt = logisticsOrderUnitMap.getOrDefault(logOrder.getId() + "-" + UnitTypeEnum.CARRIAGE.getCode(), new KwtLogisticsOrderUnit());
|
|
KwtLogisticsOrderUnit carrierEnt = logisticsOrderUnitMap.getOrDefault(logOrder.getId() + "-" + UnitTypeEnum.CARRIAGE.getCode(), new KwtLogisticsOrderUnit());
|
|
|
waybillOrderDetailResp.setTransEntName(transEnt.getFirmName());
|
|
waybillOrderDetailResp.setTransEntName(transEnt.getFirmName());
|
|
|
waybillOrderDetailResp.setCarrierEntName(carrierEnt.getFirmName());
|
|
waybillOrderDetailResp.setCarrierEntName(carrierEnt.getFirmName());
|
|
|
|
|
+
|
|
|
|
|
+ // 计算装货完成率 = (装货量 / 任务量) × 100%
|
|
|
|
|
+ String loadCompleteRate = "0.00%";
|
|
|
|
|
+ if (Objects.nonNull(subtask.getLoadAmount()) && Objects.nonNull(subtask.getEntrustAmount())
|
|
|
|
|
+ && subtask.getEntrustAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ BigDecimal rate = subtask.getLoadAmount()
|
|
|
|
|
+ .divide(subtask.getEntrustAmount(), 4, RoundingMode.HALF_UP)
|
|
|
|
|
+ .multiply(new BigDecimal("100"))
|
|
|
|
|
+ .setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
+ loadCompleteRate = rate.toPlainString() + "%";
|
|
|
|
|
+ }
|
|
|
|
|
+ waybillOrderDetailResp.setLoadCompleteRate(loadCompleteRate);
|
|
|
|
|
+
|
|
|
|
|
+ // 计算货损率 = ((装货量 - 卸货量) / 装货量) × 100%
|
|
|
|
|
+ String lossRate = "0.00%";
|
|
|
|
|
+ if (Objects.nonNull(subtask.getLoadAmount()) && Objects.nonNull(subtask.getUnloadAmount())
|
|
|
|
|
+ && subtask.getLoadAmount().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
|
+ BigDecimal rate = subtask.getLoadAmount().subtract(subtask.getUnloadAmount())
|
|
|
|
|
+ .divide(subtask.getLoadAmount(), 4, RoundingMode.HALF_UP)
|
|
|
|
|
+ .multiply(new BigDecimal("100"))
|
|
|
|
|
+ .setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
+ lossRate = rate.toPlainString() + "%";
|
|
|
|
|
+ }
|
|
|
|
|
+ waybillOrderDetailResp.setLossRate(lossRate);
|
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(nodeList)){
|
|
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(nodeList)){
|
|
|
List<WaybillOrderDetailResp.WeighingRecord> records = nodeList.stream().map(node -> {
|
|
List<WaybillOrderDetailResp.WeighingRecord> records = nodeList.stream().map(node -> {
|
|
|
WaybillOrderDetailResp.WeighingRecord weighingRecord = new WaybillOrderDetailResp.WeighingRecord();
|
|
WaybillOrderDetailResp.WeighingRecord weighingRecord = new WaybillOrderDetailResp.WeighingRecord();
|