Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 4 days ago
parent
commit
4e540b6ef5
  1. 89
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  2. 119
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  3. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java
  4. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java
  5. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

89
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -143,6 +143,8 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity entity = new QualityDeliverEntity();
entity.setId(qualityDeliverEntity.getId());
entity.setCarComplateTime(new Date());
entity.setOrderCode(qualityDeliverEntity.getOrderCode());
entity.setWaybillNumber(qualityDeliverEntity.getWaybillNumber());
entity.setConditions(qualityDeliverEntity.getConditions());
entity.setSignNum(qualityDeliverEntity.getSignNum());
// 查询品类
@ -210,6 +212,7 @@ public class DeliverFinishReportListener implements ReportService {
continue;
}
ExpenseDispatchClientDTO expenseDispatchClientDTO = expenseDispatchClient.findPriceByDriverId(qualityDeliverEntity.getWarehouseId(), driverId, qualityDeliverEntity.getSignCarTypeId(), qualityDeliverEntity.getDeliveryType());
log.info("车次完成计算价格,价格:{}", JSONUtil.toJsonStr(expenseDispatchClientDTO));
if (ObjectUtil.isNotEmpty(expenseDispatchClientDTO)) {
ExpenseDispatchPriceVO priceVO = expenseDispatchClientDTO.getPriceVO();
// 整车计费,则车内的每个包件分摊整车成本费用
@ -253,6 +256,11 @@ public class DeliverFinishReportListener implements ReportService {
}
// 计算配送成本
if (CollUtil.isNotEmpty(priceList)) {
List<ExpenseDispatchPriceCategoryVO> bzjs = priceList.stream().filter(v -> ObjectUtil.equals("标准件", v.getCategoryName())).collect(Collectors.toList());
ExpenseDispatchPriceCategoryVO bzj = null;
if(CollUtil.isNotEmpty(bzjs)){
bzj = bzjs.get(0);
}
Map<Long, ExpenseDispatchPriceCategoryVO> priceMap = priceList.stream().collect(Collectors.toMap(ExpenseDispatchPriceCategoryVO::getCategoryId, v -> v));
// 车的总运费 用于计算是否触发保底
for (QualityDeliverEntity entity : value) {
@ -260,33 +268,10 @@ public class DeliverFinishReportListener implements ReportService {
QualityDeliverEntity entity1 = valueMap.get(id);
if (ObjectUtil.isNotEmpty(entity1.getCostCategoryId()) && priceMap.containsKey(entity1.getCostCategoryId())) {
ExpenseDispatchPriceCategoryVO expenseDispatchPriceCategoryVO = priceMap.get(entity1.getCostCategoryId());
String cost = expenseDispatchPriceCategoryVO.getCost();
Integer unit = expenseDispatchPriceCategoryVO.getUnit();
if (StrUtil.isNotEmpty(cost)) {
if (NumberUtil.equals(unit, 1)) {
// 按件 成本就是单价
BigDecimal mul = NumberUtil.mul(entity.getSignNum(), new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
if (NumberUtil.equals(unit, 2)) {
// 按方 成本 = 总体积 * 单价
BigDecimal volume = entity.getVolume();
if (ObjectUtil.isNotEmpty(volume)) {
BigDecimal mul = NumberUtil.mul(volume, new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
if (NumberUtil.equals(unit, 3)) {
// 按重量 成本 = 总重量 * 单价
BigDecimal weight = entity.getWeight();
if (ObjectUtil.isNotEmpty(weight)) {
BigDecimal mul = NumberUtil.mul(weight, new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
totalFreight = buildDisCost(entity, expenseDispatchPriceCategoryVO, entity1, totalFreight);
}else {
if(ObjectUtil.isNotEmpty(bzj)){
totalFreight = buildDisCost(entity, bzj, entity1, totalFreight);
}
}
}
@ -615,7 +600,7 @@ public class DeliverFinishReportListener implements ReportService {
String overZoneKilometer = priceVO.getOverZoneKilometer();
if (StrUtil.isNotEmpty(overZoneKilometer)) {
if (total.compareTo(new BigDecimal(overZoneKilometer)) > 0) {
String overZoneKilometerCost = StrUtil.isNotEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
String overZoneKilometerCost = StrUtil.isEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
BigDecimal mul = NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometerCost)), new BigDecimal(overZoneKilometer));
buildUltrAllpwCost(valueMap, mul, totalNum);
}
@ -643,7 +628,7 @@ public class DeliverFinishReportListener implements ReportService {
String overZoneKilometer = priceVO.getOverZoneKilometer();
if (StrUtil.isNotEmpty(overZoneKilometer)) {
if (total.compareTo(new BigDecimal(overZoneKilometer)) > 0) {
String overZoneKilometerCost = StrUtil.isNotEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
String overZoneKilometerCost = StrUtil.isEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
BigDecimal mul = NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometerCost)), new BigDecimal(overZoneKilometer));
buildUltrAllpwCost(valueMap, mul, totalNum);
}
@ -705,7 +690,7 @@ public class DeliverFinishReportListener implements ReportService {
String overZoneKilometer = priceVO.getOverZoneKilometer();
if (StrUtil.isNotEmpty(overZoneKilometer)) {
if (total.compareTo(new BigDecimal(overZoneKilometer)) > 0) {
String overZoneKilometerCost = StrUtil.isNotEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
String overZoneKilometerCost = StrUtil.isEmpty(priceVO.getOverZoneKilometerCost()) ? "0" : priceVO.getOverZoneKilometerCost();
BigDecimal mul = NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(overZoneKilometerCost)), new BigDecimal(overZoneKilometer));
buildUltrAllpwCost(valueMap, mul, totalNum);
}
@ -768,7 +753,7 @@ public class DeliverFinishReportListener implements ReportService {
if (!NumberUtil.equals(dkp, 0)) {
dkp = dkp - 1;
}
String siteSubsidyCost = StrUtil.isNotEmpty(priceVO.getSiteSubsidyCost()) ? "0" : priceVO.getSiteSubsidyCost();
String siteSubsidyCost = StrUtil.isEmpty(priceVO.getSiteSubsidyCost()) ? "0" : priceVO.getSiteSubsidyCost();
BigDecimal mul = NumberUtil.mul(dkp, new BigDecimal(siteSubsidyCost));
buildPointAllowCost(valueMap, mul, totalNum);
}
@ -804,7 +789,7 @@ public class DeliverFinishReportListener implements ReportService {
}
}
// 总公里数成本 = (总公里数 * 油费单价) / 总件数
String fuelCost = StrUtil.isNotEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
String fuelCost = StrUtil.isEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
BigDecimal mul = NumberUtil.mul(total, new BigDecimal(fuelCost));
buildFuelCost(valueMap, mul, totalNum);
}
@ -832,7 +817,7 @@ public class DeliverFinishReportListener implements ReportService {
}
}
// 总公里数成本 = (总公里数 * 油费单价) / 总件数
String fuelCost = StrUtil.isNotEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
String fuelCost = StrUtil.isEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
BigDecimal mul = NumberUtil.mul(total, new BigDecimal(fuelCost));
buildFuelCost(valueMap, mul, totalNum);
}
@ -869,7 +854,7 @@ public class DeliverFinishReportListener implements ReportService {
}
}
// 总公里数成本 = (总公里数 * 油费单价) / 总件数
String fuelCost = StrUtil.isNotEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
String fuelCost = StrUtil.isEmpty(priceVO.getFuelCost()) ? "0" : priceVO.getFuelCost();
BigDecimal mul = NumberUtil.mul(total, new BigDecimal(fuelCost));
buildFuelCost(valueMap, mul, totalNum);
}
@ -940,6 +925,38 @@ public class DeliverFinishReportListener implements ReportService {
}
private static BigDecimal buildDisCost(QualityDeliverEntity entity, ExpenseDispatchPriceCategoryVO expenseDispatchPriceCategoryVO, QualityDeliverEntity entity1, BigDecimal totalFreight) {
String cost = expenseDispatchPriceCategoryVO.getCost();
Integer unit = expenseDispatchPriceCategoryVO.getUnit();
if (StrUtil.isNotEmpty(cost)) {
if (NumberUtil.equals(unit, 1)) {
// 按件 成本就是单价
BigDecimal mul = NumberUtil.mul(entity.getSignNum(), new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
if (NumberUtil.equals(unit, 2)) {
// 按方 成本 = 总体积 * 单价
BigDecimal volume = entity.getVolume();
if (ObjectUtil.isNotEmpty(volume)) {
BigDecimal mul = NumberUtil.mul(volume, new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
if (NumberUtil.equals(unit, 3)) {
// 按重量 成本 = 总重量 * 单价
BigDecimal weight = entity.getWeight();
if (ObjectUtil.isNotEmpty(weight)) {
BigDecimal mul = NumberUtil.mul(weight, new BigDecimal(cost));
entity1.setDistributionCost(mul);
totalFreight = totalFreight.add(mul);
}
}
}
return totalFreight;
}
private static void buildUltrAllpwCost(Map<Long, QualityDeliverEntity> valueMap, BigDecimal mul, Integer totalNum) {
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;
@ -995,7 +1012,7 @@ public class DeliverFinishReportListener implements ReportService {
}
private static void buildAllowKilowCost(ExpenseDispatchPriceVO priceVO, BigDecimal total, String subsidyInitKilometer, Map<Long, QualityDeliverEntity> valueMap, Integer totalNum) {
String subsidyCost = StrUtil.isNotEmpty(priceVO.getSubsidyCost()) ? "0" : priceVO.getSubsidyCost();
String subsidyCost = StrUtil.isEmpty(priceVO.getSubsidyCost()) ? "0" : priceVO.getSubsidyCost();
BigDecimal mul = NumberUtil.mul(NumberUtil.sub(total, new BigDecimal(subsidyInitKilometer)), new BigDecimal(subsidyCost));
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;
@ -1015,7 +1032,7 @@ public class DeliverFinishReportListener implements ReportService {
}
private static void buildKilometerCost(ExpenseDispatchPriceVO priceVO, BigDecimal total, Map<Long, QualityDeliverEntity> valueMap, Integer totalNum) {
String kilometerCost = StrUtil.isNotEmpty(priceVO.getKilometerCost()) ? "0" : priceVO.getKilometerCost();
String kilometerCost = StrUtil.isEmpty(priceVO.getKilometerCost()) ? "0" : priceVO.getKilometerCost();
BigDecimal mul = NumberUtil.mul(total, new BigDecimal(kilometerCost));
BigDecimal deliveryFeeSum = BigDecimal.ZERO;
int idex = 0;

119
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -231,6 +231,8 @@
count(DISTINCT lta.waybill_id) waybillNum,
count(lta.waybill_id) openNum,
count(ltcls.id) startNum,
count(lta.id)-count(ltcls.id) noOutNum,
sum(if( ltcls.id is null and now() &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
@ -287,6 +289,8 @@
count(DISTINCT lta.waybill_id) waybillNum,
count(lta.waybill_id) openNum,
count(ltcls.id) startNum,
count(lta.id)-count(ltcls.id) noOutNum,
sum(if( ltcls.id is null and now() &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
@ -346,7 +350,7 @@
sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)) startNum,
sum(IFNULL(t.jgNum,0)) onTimeNum,
IFNULL(round(sum(IFNULL(t.jgNum,0))/sum(lww.total_count)*100,2),'0.00') onTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, t.startTime))/(sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)))/3600,1) '平均发运时效'
round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, t.startTime))/(sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)))/3600,1) avgTime
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
left join (
@ -551,8 +555,10 @@
ldpl.brand_name brand,
sum(ldpl.quantity) incomingNum,
count(ltcls.id) outNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') outOnTimeRate,
sum(ldpl.quantity)-count(ltcls.id) noOutNum,
sum(if(ldpl.order_package_status='20' and now() &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ltcll.start_date &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id
@ -563,6 +569,7 @@
and ldpl.conditions != 3
and ldpl.waybill_id is not null
and ldpl.warehouse_id != ldpl.send_warehouse_id
and ldpl.warehouse_id != ldpl.accept_warehouse_id
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -614,6 +621,8 @@
ldpl.brand_name brand,
sum(ldpl.quantity) incomingNum,
count(ltcls.id) outNum,
sum(ldpl.quantity)-count(ltcls.id) noOutNum,
sum(if(ldpl.order_package_status='20' and now() &lt; DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime
@ -1088,27 +1097,29 @@
sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum,
IFNULL(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'0.00') onTimeArriveRate,
sum(IFNULL(t.oneNum,0)) oneArriveNum,
IFNULL(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'0.00') oneArriveRate,
IFNULL(round(sum(IFNULL(t.oneNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') oneArriveRate,
sum(IFNULL(t.twoNum,0)) twoArriveNum,
IFNULL(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'0.00') twoArriveRate,
IFNULL(round(sum(IFNULL(t.twoNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') twoArriveRate,
sum(IFNULL(t.threeNum,0)) threeArriveNum,
IFNULL(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'0.00') threeArriveRate,
IFNULL(round(sum(IFNULL(t.threeNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') threeArriveRate,
sum(IFNULL(t.fourNum,0)) fourArriveNum,
IFNULL(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'0.00') fourArriveRate,
IFNULL(round(sum(IFNULL(t.fourNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') fourArriveRate,
sum(IFNULL(t.fiveNum,0)) fiveArriveNum,
IFNULL(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'0.00') fiveArriveRate,
IFNULL(round(sum(IFNULL(t.fiveNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') fiveArriveRate,
sum(IFNULL(t.sixNum,0)) sixArriveNum,
IFNULL(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'0.00') sixArriveRate,
IFNULL(round(sum(IFNULL(t.sixNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sixArriveRate,
sum(IFNULL(t.sevenNum,0)) sevenArriveNum,
IFNULL(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenArriveRate,
IFNULL(round(sum(IFNULL(t.sevenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sevenArriveRate,
sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum,
IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenToTenArriveRate,
IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sevenToTenArriveRate,
sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum,
IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'0.00') moreTenArriveRate
from (select lw.id waybillId,
IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') moreTenArriveRate
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
left join (select lw.id waybillId,
lrat.hours_time,
sum(ltcls.unload_num) totalNum,
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond,
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )*ltcls.unload_num) timeSecond,
sum(if(ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),ltcls.unload_num,0)) onTimeNum,
sum(if(ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ltcls.unload_num,0)) oneNum,
sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )&lt;ltcls.unload_time and ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ltcls.unload_num,0)) twoNum,
@ -1152,9 +1163,7 @@
<if test="param.endTime != null ">
and lw.create_time &lt;= #{param.endTime}
</if>
group by lw.id,lrat.hours_time) t
left join logpm_warehouse_waybill lww on lww.id = t.waybillId
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
group by lw.id,lrat.hours_time) t on lww.id = t.waybillId
where 1=1
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
@ -1162,6 +1171,30 @@
#{item}
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lww.departure_warehouse_name,
lww.destination_warehouse_name,
@ -1183,27 +1216,29 @@
sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum,
IFNULL(concat(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') onTimeArriveRate,
sum(IFNULL(t.oneNum,0)) oneArriveNum,
IFNULL(concat(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') oneArriveRate,
IFNULL(concat(round(sum(IFNULL(t.oneNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') oneArriveRate,
sum(IFNULL(t.twoNum,0)) twoArriveNum,
IFNULL(concat(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') twoArriveRate,
IFNULL(concat(round(sum(IFNULL(t.twoNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') twoArriveRate,
sum(IFNULL(t.threeNum,0)) threeArriveNum,
IFNULL(concat(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') threeArriveRate,
IFNULL(concat(round(sum(IFNULL(t.threeNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') threeArriveRate,
sum(IFNULL(t.fourNum,0)) fourArriveNum,
IFNULL(concat(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fourArriveRate,
IFNULL(concat(round(sum(IFNULL(t.fourNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') fourArriveRate,
sum(IFNULL(t.fiveNum,0)) fiveArriveNum,
IFNULL(concat(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fiveArriveRate,
IFNULL(concat(round(sum(IFNULL(t.fiveNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') fiveArriveRate,
sum(IFNULL(t.sixNum,0)) sixArriveNum,
IFNULL(concat(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sixArriveRate,
IFNULL(concat(round(sum(IFNULL(t.sixNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') sixArriveRate,
sum(IFNULL(t.sevenNum,0)) sevenArriveNum,
IFNULL(concat(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenArriveRate,
IFNULL(concat(round(sum(IFNULL(t.sevenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') sevenArriveRate,
sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum,
IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenToTenArriveRate,
IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') sevenToTenArriveRate,
sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum,
IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') moreTenArriveRate
from (select lw.id waybillId,
IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') moreTenArriveRate
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
left join (select lw.id waybillId,
lrat.hours_time,
sum(ltcls.unload_num) totalNum,
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond,
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )*ltcls.unload_num) timeSecond,
sum(if(ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),ltcls.unload_num,0)) onTimeNum,
sum(if(ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ltcls.unload_num,0)) oneNum,
sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )&lt;ltcls.unload_time and ltcls.unload_time &lt;= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ltcls.unload_num,0)) twoNum,
@ -1247,9 +1282,7 @@
<if test="param.endTime != null ">
and lw.create_time &lt;= #{param.endTime}
</if>
group by lw.id,lrat.hours_time) t
left join logpm_warehouse_waybill lww on lww.id = t.waybillId
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
group by lw.id,lrat.hours_time) t on lww.id = t.waybillId
where 1=1
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
@ -1257,6 +1290,30 @@
#{item}
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lww.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0">
and lww.departure_warehouse_id in
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0">
and lww.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lww.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lww.departure_warehouse_name,
lww.destination_warehouse_name,

5
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeStartTimeVO.java

@ -26,6 +26,11 @@ public class ReportPackgeStartTimeVO implements Serializable {
@ExcelProperty(value = "发运件数")
private Integer startNum;
@ExcelProperty(value = "未发运件数")
private Integer noOutNum;
@ExcelProperty(value = "为发运超时件数")
private Integer noOutOverNum;
@ExcelProperty(value = "准时发运件数")
private Integer onTimeNum;
@ExcelProperty(value = "准时发运率")

6
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeTransferTimeVO.java

@ -25,6 +25,12 @@ public class ReportPackgeTransferTimeVO implements Serializable {
@ExcelProperty(value = "中转出库件数")
private Integer outNum;
@ExcelProperty(value = "未出库件数")
private Integer noOutNum;
@ExcelProperty(value = "未出库超时件数")
private Integer noOutOverNum;
@ExcelProperty(value = "中转准时出库件数")
private Integer outOnTimeNum;

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -992,7 +992,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
map.put("备注", warehouseWaybillEntity.getRemark());
map.put("填票人", warehouseWaybillEntity.getAgent());
map.put("托运日期", DateUtil.format(warehouseWaybillEntity.getCreateTime(), "yyyy-MM-dd"));
map.put("托运日期", DateUtil.format(warehouseWaybillEntity.getDocumentMakingTime(), "yyyy-MM-dd"));
// 格式化费用 保留2位小数
map.put("运费总计", formatToTwoDecimalPlaces(sumFreight(warehouseWaybillEntity)));

Loading…
Cancel
Save