Просмотр исходного кода

[update] 区间货损统计中在途核算数据获取方式变更为该时间区间中的在途核算记录

miajio 4 дней назад
Родитель
Сommit
38dbe22c51

+ 2 - 1
warehouse-admin-data/src/main/java/com/yr/warehouse/admin/driver/mapper/DriverOnRouteAccountRecordMainMapper.java

@@ -11,6 +11,7 @@ import com.yr.warehouse.admin.driver.data.DriverOnRouteAccountRecordMain;
 import com.yr.warehouse.admin.driver.vo.DriverRouteAccountRecordMainVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -59,7 +60,7 @@ public interface DriverOnRouteAccountRecordMainMapper extends BaseMapper<DriverO
      * @param areaStaffIds 区域员工id
      * @return 结果
      */
-    List<DriverOnRouteAccountRecordMain> selectUnVerified(@Param("areaStaffIds") List<Long> areaStaffIds);
+    List<DriverOnRouteAccountRecordMain> selectUnVerified(@Param("areaStaffIds") List<Long> areaStaffIds, @Param("beginStatDate") LocalDate beginStatDate, @Param("endStatDate") LocalDate endStatDate);
 
     /**
      * 批量绑定司机在途核算记录

+ 8 - 7
warehouse-admin-data/src/main/resources/mapper/driver/DriverOnRouteAccountRecordMainMapper.xml

@@ -103,7 +103,7 @@
         </if>
         order by warehouseId, areaStaffId desc
     </select>
-    <select id="selectUnVerified" resultType="com.yr.warehouse.admin.driver.data.DriverOnRouteAccountRecordMain" parameterType="java.util.List">
+    <select id="selectUnVerified" resultType="com.yr.warehouse.admin.driver.data.DriverOnRouteAccountRecordMain">
         select
         <include refid="Base_As_Column_List">
             <property name="column" value="do1"/>
@@ -112,12 +112,13 @@
         INNER JOIN (
         SELECT areaStaffId, max(id) as lastId from yr_driver_on_route_account_record_main
         where isDelete = 'NORMAL'
-         <if test="areaStaffIds != null and areaStaffIds.size > 0">
-         and areaStaffId in
-        <foreach collection="areaStaffIds" item="item" open="(" separator="," close=")">
-            #{item}
-        </foreach>
-         </if>
+        and statDate between #{beginStatDate} and #{endStatDate}
+        <if test="areaStaffIds != null and areaStaffIds.size > 0">
+            and areaStaffId in
+            <foreach collection="areaStaffIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY areaStaffId
         ) as do2 ON do1.areaStaffId = do2.areaStaffId and do1.id = do2.lastId
         WHERE do1.status = 'UN_VERIFIED' and do1.isDelete = 'NORMAL'

+ 1 - 1
warehouse-admin-server/src/main/java/com/yr/warehouse/admin/service/driver/impl/DriverGoodsLossIntervalServiceImpl.java

@@ -150,7 +150,7 @@ public class DriverGoodsLossIntervalServiceImpl implements DriverGoodsLossInterv
         }
 
         // 获取当前司机下所有未核算的核算记录主表
-        List<DriverOnRouteAccountRecordMain> driverOnRouteAccountRecordMains = driverOnRouteAccountRecordMainMapper.selectUnVerified(bo.getAreaStaffIds());
+        List<DriverOnRouteAccountRecordMain> driverOnRouteAccountRecordMains = driverOnRouteAccountRecordMainMapper.selectUnVerified(bo.getAreaStaffIds(), bo.getBeginStatDate(), bo.getEndStatDate());
         Map<Long, DriverOnRouteAccountRecordMain> driverOnRouteAccountRecordMainMap = new HashMap<>();
         // 获取当前司机下所有未核算的核算记录子表
         Map<Long, List<DriverOnRouteAccountRecordDetail>> driverOnRouteAccountRecordDetailMap = new HashMap<>();