Ver código fonte

[update] 生成区间统计异常问题修复

miajio 1 semana atrás
pai
commit
a956c8bae5

+ 1 - 1
warehouse-admin-data/src/main/resources/mapper/driver/DriverEquipmentLossRecordMapper.xml

@@ -35,7 +35,7 @@
             )
         </foreach>
     </insert>
-    <delete id="deleteOld" parameterType="java.time.LocalDate">
+    <delete id="deleteOld" >
         delete from yr_driver_equipment_loss_record where operatorId = #{operatorId} and statDate = #{statDate}
     </delete>
     <select id="searchByStatDate" resultType="com.yr.warehouse.admin.driver.data.DriverEquipmentLossRecord"

+ 1 - 1
warehouse-admin-data/src/main/resources/mapper/driver/DriverGoodsLossRecordMapper.xml

@@ -41,7 +41,7 @@
             )
         </foreach>
     </insert>
-    <delete id="deleteOld" parameterType="java.time.LocalDate">
+    <delete id="deleteOld">
         delete from yr_driver_goods_loss_record where operatorId = #{operatorId} and statDate = #{statDate}
     </delete>
     <select id="searchByStatDate"

+ 1 - 1
warehouse-admin-data/src/main/resources/mapper/driver/DriverOnRouteDetailLogMapper.xml

@@ -38,7 +38,7 @@
             #{item.profitLossNum})
         </foreach>
     </insert>
-    <delete id="deleteOld" parameterType="java.time.LocalDate">
+    <delete id="deleteOld" >
         delete from yr_driver_on_route_detail_log where operatorId = #{operatorId} and statDate = #{statDate}
     </delete>
     <select id="searchByStatDate" resultType="com.yr.warehouse.admin.driver.data.DriverOnRouteDetailLog"

+ 4 - 1
warehouse-admin-server/src/main/java/com/yr/warehouse/admin/service/statistics/impl/DriverStatisticsServiceImpl.java

@@ -125,7 +125,10 @@ public class DriverStatisticsServiceImpl implements DriverStatisticsService {
     public DriverStatisticsVo generatorDriverStatisticsVo(List<Long> areaStaffIds, LocalDateTime beginTime, LocalDateTime endTime) {
         // 司机设备库存 - 不含商品id - 需锚定司机设备库存, 保证异常情况后重新查询时设备库存值不变
         List<DriverGoodsOrderNumVo> deviceInventoryNumVos = queryDriverDeviceInventoryNum(beginTime, endTime);
-        return priGeneratorDriverStatisticsVo(deviceInventoryNumVos, areaStaffIds, null, beginTime, endTime);
+
+        // 获取endTime 的 年月日 作为 statDate
+        LocalDate statDate = endTime.toLocalDate();
+        return priGeneratorDriverStatisticsVo(deviceInventoryNumVos, areaStaffIds, statDate, beginTime, endTime);
     }
 
     private DriverStatisticsVo priGeneratorDriverStatisticsVo(List<DriverGoodsOrderNumVo> deviceInventoryNumVos,