Browse Source

装卸货点位时间段重叠判断功能问题调整

shasha 3 weeks ago
parent
commit
348656ec89

+ 1 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadtime/mapper/BizLoadTimeMapper.java

@@ -31,7 +31,7 @@ public interface BizLoadTimeMapper extends BaseMapper<BizLoadTime> {
 
     Page<BizLoadTime> page(@Param("page") Page<BizLoadTime> page, @Param("ew") QueryWrapper<BizLoadTime> wrapper);
 
-    List<BizLoadTime> getSearch(@Param("pointId") String pointId, @Param("noPointId") String noPointId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
+    List<BizLoadTime> getSearch(@Param("noId") String noId, @Param("pointId") String pointId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
 
 
 }

+ 3 - 3
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadtime/mapper/mapping/BizLoadTimeMapper.xml

@@ -28,12 +28,12 @@
             t.already_number alreadyNumber
         from biz_load_time t
         where t.delete_flag = 'NOT_DELETE'
+            <if test="noId != null">
+                and t.id != #{noId}
+            </if>
             <if test="pointId != null">
                 and t.point_id = #{pointId}
             </if>
-            <if test="noPointId != null">
-                and t.point_id != #{noPointId}
-            </if>
             and #{endTime} > t.begin_time
             and t.end_time > #{startTime}
     </select>

+ 2 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadtime/service/impl/BizLoadTimeServiceImpl.java

@@ -153,7 +153,7 @@ public class BizLoadTimeServiceImpl extends ServiceImpl<BizLoadTimeMapper, BizLo
             // 结束时间
             Date endTime = bizGoodsConf.getConfEndTime();
             // 根据时间段和装货点位ID过滤装货时间配置
-            List<BizLoadTime> list = this.baseMapper.getSearch(pointId,null, startTime, endTime);
+            List<BizLoadTime> list = this.baseMapper.getSearch(null, pointId, startTime, endTime);
             return list;
         }else{
             return null;
@@ -192,7 +192,7 @@ public class BizLoadTimeServiceImpl extends ServiceImpl<BizLoadTimeMapper, BizLo
 
     // 校验同一个点位的时间段是否有交集
     public Boolean checkBizLoadTime(BizLoadTime bizLoadTime){
-        List<BizLoadTime> list = this.baseMapper.getSearch(null, bizLoadTime.getPointId(), bizLoadTime.getBeginTime(), bizLoadTime.getEndTime());
+        List<BizLoadTime> list = this.baseMapper.getSearch(bizLoadTime.getId(), bizLoadTime.getPointId(), bizLoadTime.getBeginTime(), bizLoadTime.getEndTime());
         if(null != list && list.size() > 0){
             return false;
         }else{