|
@@ -102,6 +102,11 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
DriverStatisticsVo vo = priGeneratorDriverStatisticsVo(deviceInventoryNumVos, areaStaffIds, statDate, beginTime, endTime);
|
|
DriverStatisticsVo vo = priGeneratorDriverStatisticsVo(deviceInventoryNumVos, areaStaffIds, statDate, beginTime, endTime);
|
|
|
List<DriverGoodsLossRecord> driverGoodsLossRecords = vo.getDriverGoodsLossRecords();
|
|
List<DriverGoodsLossRecord> driverGoodsLossRecords = vo.getDriverGoodsLossRecords();
|
|
|
List<DriverEquipmentLossRecord> driverEquipmentLossRecords = vo.getDriverEquipmentLossRecords();
|
|
List<DriverEquipmentLossRecord> driverEquipmentLossRecords = vo.getDriverEquipmentLossRecords();
|
|
|
|
|
+
|
|
|
|
|
+ if (null == driverGoodsLossRecords || driverGoodsLossRecords.isEmpty() || null == driverEquipmentLossRecords || driverEquipmentLossRecords.isEmpty()) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
driverGoodsLossRecordMapper.insertBatch(driverGoodsLossRecords);
|
|
driverGoodsLossRecordMapper.insertBatch(driverGoodsLossRecords);
|
|
|
driverEquipmentLossRecordMapper.insertBatch(driverEquipmentLossRecords);
|
|
driverEquipmentLossRecordMapper.insertBatch(driverEquipmentLossRecords);
|
|
|
|
|
|
|
@@ -114,7 +119,7 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
driverStatisticsMergeLogic.groupByAreaStaffGoods(vo.getDriverReplenishNumVos()),
|
|
driverStatisticsMergeLogic.groupByAreaStaffGoods(vo.getDriverReplenishNumVos()),
|
|
|
driverStatisticsMergeLogic.groupByAreaStaffGoods(vo.getDriverReturnNumVos())
|
|
driverStatisticsMergeLogic.groupByAreaStaffGoods(vo.getDriverReturnNumVos())
|
|
|
);
|
|
);
|
|
|
- if (!driverOnRouteDetailLogs.isEmpty()) {
|
|
|
|
|
|
|
+ if (null != driverOnRouteDetailLogs && !driverOnRouteDetailLogs.isEmpty()) {
|
|
|
driverOnRouteDetailLogMapper.insertBatch(driverOnRouteDetailLogs);
|
|
driverOnRouteDetailLogMapper.insertBatch(driverOnRouteDetailLogs);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -136,6 +141,9 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
LocalDate statDate,
|
|
LocalDate statDate,
|
|
|
LocalDateTime beginTime,
|
|
LocalDateTime beginTime,
|
|
|
LocalDateTime endTime) {
|
|
LocalDateTime endTime) {
|
|
|
|
|
+
|
|
|
|
|
+ List<DriverGoodsOrderNumVo> inDeviceInventoryNumVos = deviceInventoryNumVos.stream().filter(deviceInventoryNumVo -> areaStaffIds.contains(deviceInventoryNumVo.getAreaStaffId())).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
// 司机拣货单开单数 - 含商品id
|
|
// 司机拣货单开单数 - 含商品id
|
|
|
List<DriverGoodsOrderNumVo> pickingBillingQuantityNumVos = billingQuantityStatisticsMapper.queryPickingBillingQuantity(areaStaffIds, beginTime, endTime);
|
|
List<DriverGoodsOrderNumVo> pickingBillingQuantityNumVos = billingQuantityStatisticsMapper.queryPickingBillingQuantity(areaStaffIds, beginTime, endTime);
|
|
|
// 司机整件单开单数 - 含商品id
|
|
// 司机整件单开单数 - 含商品id
|
|
@@ -156,7 +164,7 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
|
|
|
|
|
// 提取所有数据中的司机ID并去重
|
|
// 提取所有数据中的司机ID并去重
|
|
|
List<Long> allAreaStaffIds = driverStatisticsMergeLogic.getAreaStaffIds(
|
|
List<Long> allAreaStaffIds = driverStatisticsMergeLogic.getAreaStaffIds(
|
|
|
- deviceInventoryNumVos,
|
|
|
|
|
|
|
+ inDeviceInventoryNumVos,
|
|
|
pickingBillingQuantityNumVos,
|
|
pickingBillingQuantityNumVos,
|
|
|
aggregationBillingQuantityNumVos,
|
|
aggregationBillingQuantityNumVos,
|
|
|
unOutStockCancelNumVos,
|
|
unOutStockCancelNumVos,
|
|
@@ -186,7 +194,7 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
areaStaffMap,
|
|
areaStaffMap,
|
|
|
driverStatisticsMergeLogic.groupByAreaStaffId(deviceReplenishNumVos),
|
|
driverStatisticsMergeLogic.groupByAreaStaffId(deviceReplenishNumVos),
|
|
|
driverStatisticsMergeLogic.groupByAreaStaffId(driverDeviceSalesNumVos),
|
|
driverStatisticsMergeLogic.groupByAreaStaffId(driverDeviceSalesNumVos),
|
|
|
- driverStatisticsMergeLogic.groupByAreaStaffId(deviceInventoryNumVos)
|
|
|
|
|
|
|
+ driverStatisticsMergeLogic.groupByAreaStaffId(inDeviceInventoryNumVos)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
DriverStatisticsVo res = new DriverStatisticsVo();
|
|
DriverStatisticsVo res = new DriverStatisticsVo();
|
|
@@ -377,7 +385,11 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
|
|
|
Map<Long, Map<Integer, Long>> driverReplenishNumVoMap,
|
|
Map<Long, Map<Integer, Long>> driverReplenishNumVoMap,
|
|
|
Map<Long, Map<Integer, Long>> driverReturnNumVoMap
|
|
Map<Long, Map<Integer, Long>> driverReturnNumVoMap
|
|
|
) {
|
|
) {
|
|
|
- List<DriverOnRouteDetailLog> yesterdayDriverOnRouteDetailLogs = driverOnRouteDetailLogMapper.searchByStatDate(statDate.minusDays(1));
|
|
|
|
|
|
|
+ if (null == driverGoodsLossRecords || driverGoodsLossRecords.isEmpty()) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Long> areaStaffIds = driverGoodsLossRecords.stream().map(DriverGoodsLossRecord::getAreaStaffId).distinct().collect(Collectors.toList());
|
|
|
|
|
+ List<DriverOnRouteDetailLog> yesterdayDriverOnRouteDetailLogs = driverOnRouteDetailLogMapper.searchByStatDate(areaStaffIds, statDate.minusDays(1));
|
|
|
Map<Long, Map<Integer, Long>> yesterdayDriverOnRouteDetailLogMap;
|
|
Map<Long, Map<Integer, Long>> yesterdayDriverOnRouteDetailLogMap;
|
|
|
if (null != yesterdayDriverOnRouteDetailLogs && !yesterdayDriverOnRouteDetailLogs.isEmpty()) {
|
|
if (null != yesterdayDriverOnRouteDetailLogs && !yesterdayDriverOnRouteDetailLogs.isEmpty()) {
|
|
|
yesterdayDriverOnRouteDetailLogMap = yesterdayDriverOnRouteDetailLogs.stream()
|
|
yesterdayDriverOnRouteDetailLogMap = yesterdayDriverOnRouteDetailLogs.stream()
|