Commit ea9231fd authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents cad6c711 ba9ca9d0
...@@ -60,4 +60,6 @@ public interface PlanMapper extends BaseMapper { ...@@ -60,4 +60,6 @@ public interface PlanMapper extends BaseMapper {
void initUpdatePlanNextGenDate(); void initUpdatePlanNextGenDate();
Plan getPlan(String planId); Plan getPlan(String planId);
int checkData(@Param("planId")Long planId);
} }
package com.yeejoin.amos.patrol.business.dao.mapper; package com.yeejoin.amos.patrol.business.dao.mapper;
import com.yeejoin.amos.patrol.dao.entity.ESTaskDetailDto;
import com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail; import com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -14,4 +15,6 @@ public interface PlanTaskDetailMapper extends BaseMapper { ...@@ -14,4 +15,6 @@ public interface PlanTaskDetailMapper extends BaseMapper {
List<PlanTaskDetail> findAllByIdInAndStatus(@Param("planTaskIds") List<Long> planTaskNo, @Param("status") String status); List<PlanTaskDetail> findAllByIdInAndStatus(@Param("planTaskIds") List<Long> planTaskNo, @Param("status") String status);
List<ESTaskDetailDto> findAllByTaskNos(@Param("ids") String ids);
} }
...@@ -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(),","));
......
...@@ -174,4 +174,11 @@ ...@@ -174,4 +174,11 @@
<select id="getPlan" resultType="com.yeejoin.amos.patrol.dao.entity.Plan"> <select id="getPlan" resultType="com.yeejoin.amos.patrol.dao.entity.Plan">
select * from p_plan where id = #{planId} select * from p_plan where id = #{planId}
</select> </select>
<select id="checkData" resultType="java.lang.Integer">
SELECT count(1) FROM "p_plan" plan
INNER JOIN p_route_point route on plan.route_id = route.route_id
INNER JOIN p_point_inputitem item on route.point_id = item.point_id
WHERE plan.id = #{planId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -30,4 +30,12 @@ ...@@ -30,4 +30,12 @@
pptd.task_no in <foreach collection="planTaskIds" item="planTaskId" index="index" open="(" separator="," close=")" >#{planTaskId}</foreach> pptd.task_no in <foreach collection="planTaskIds" item="planTaskId" index="index" open="(" separator="," close=")" >#{planTaskId}</foreach>
and pptd.status = #{status} and pptd.status = #{status}
</select> </select>
<select id="findAllByTaskNos" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail">
select
pptd.id
from
"p_plan_task_detail" pptd
where
pptd.task_no in #{ids}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -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