Commit ba9ca9d0 authored by H2T's avatar H2T

暂不巡查直接删除掉对应route_point_item表的关联关系

parent 382450df
...@@ -26,4 +26,5 @@ public interface RoutePointItemMapper extends BaseMapper { ...@@ -26,4 +26,5 @@ public interface RoutePointItemMapper extends BaseMapper {
*/ */
HashMap<String, String> getEquipByCode(String equipCode); HashMap<String, String> getEquipByCode(String equipCode);
int delRoutePointItemInExclude(@Param("routePointId") Long routePointId, @Param("inputItemIds") List<Long> inputItemIds);
} }
...@@ -573,7 +573,11 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement ...@@ -573,7 +573,11 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
// } // }
// }); // });
// List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList()); // List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList());
RoutePoint.setExcludeItems(StringUtils.join(inputItemIds, ",")); List<Long> itemIds = inputItemIds.stream().filter(Objects::nonNull).collect(Collectors.toList());
//保存到route_point的exclude_items字段
RoutePoint.setExcludeItems(StringUtils.join(itemIds, ","));
//删除route_point_item的多余关联项
routePointItemMapper.delRoutePointItemInExclude(RoutePoint.getId(),itemIds);
// } // }
// else { // else {
// RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),",")); // RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),","));
......
...@@ -76,6 +76,16 @@ ...@@ -76,6 +76,16 @@
delete from p_route_point WHERE point_id = #{pointId} and route_id = #{routeId} delete from p_route_point WHERE point_id = #{pointId} and route_id = #{routeId}
</delete> </delete>
<delete id="delRoutePointItemInExclude">
delete from p_route_point_item
WHERE route_point_id = #{routePointId}
and point_input_item_id in
<foreach collection="inputItemIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</delete>
<insert id="insertRoutePointItem"> <insert id="insertRoutePointItem">
insert into p_route_point_item insert into p_route_point_item
(id, route_point_id, order_no, point_input_item_id, creator_id, create_date, point_classify_id, basis_json) (id, route_point_id, order_no, point_input_item_id, creator_id, create_date, point_classify_id, basis_json)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment