Commit 4687dce0 authored by chenzhao's avatar chenzhao

增加检查项绑定

parent 19720387
...@@ -339,7 +339,7 @@ public class RouteServiceImpl implements IRouteService { ...@@ -339,7 +339,7 @@ public class RouteServiceImpl implements IRouteService {
routePointItem.setPointInputItemId(pointInputItem.getId()); routePointItem.setPointInputItemId(pointInputItem.getId());
routePointItem.setRoutePointId(routePointId); routePointItem.setRoutePointId(routePointId);
routePointItem.setRoutePoint(routePoint); routePointItem.setRoutePoint(routePoint);
routePointItem.setPointClassifyId(Long.valueOf(pointInputItem.getClassifyIds()));
routePointList.add(routePointItem); routePointList.add(routePointItem);
} }
iRoutePointItemDao.saveAll(routePointList); iRoutePointItemDao.saveAll(routePointList);
......
...@@ -1280,6 +1280,16 @@ public class PointController extends AbstractBaseController { ...@@ -1280,6 +1280,16 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.success(iPointService.queryItemList4RoutePoint(pointId, classifyId)); return CommonResponseUtil.success(iPointService.queryItemList4RoutePoint(pointId, classifyId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新*查询巡检点对应设备列表新", notes = "新*查询巡检点对应设备列表新")
@GetMapping(value = "/newQueryByIds", produces = "application/json;charset=UTF-8")
public CommonResponse queryItemList4RoutePointNew(
@ApiParam(value = "巡检点ID") @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "路线ID") @RequestParam(value = "routeId") Long routeId) {
return CommonResponseUtil.success(iPointService.queryItemList4RoutePointNew(routeId,pointId, classifyId));
}
/** /**
* 更新巡检点 * 更新巡检点
* *
......
...@@ -51,4 +51,7 @@ public interface IPointInputItemDao extends BaseDao<PointInputItem, Long> { ...@@ -51,4 +51,7 @@ public interface IPointInputItemDao extends BaseDao<PointInputItem, Long> {
@Transactional @Transactional
@Query(value = "DELETE FROM p_point_inputitem WHERE classify_ids IN (?1)", nativeQuery = true) @Query(value = "DELETE FROM p_point_inputitem WHERE classify_ids IN (?1)", nativeQuery = true)
void deleteClassifyId(Long classifyId); void deleteClassifyId(Long classifyId);
@Query(value = "SELECT input_item_id FROM p_point_inputitem WHERE id IN (?1) ", nativeQuery = true)
List<String> selectItemIdByid(List<String> ids);
} }
...@@ -52,5 +52,8 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> { ...@@ -52,5 +52,8 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {
@Query(value = "SELECT prpi.* FROM p_route_point_item prpi LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id WHERE prp.point_id = ?1", nativeQuery = true) @Query(value = "SELECT prpi.* FROM p_route_point_item prpi LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id WHERE prp.point_id = ?1", nativeQuery = true)
List<RoutePointItem> getRoutePointItemByPointId(Long pointId); List<RoutePointItem> getRoutePointItemByPointId(Long pointId);
@Modifying
@Transactional
@Query(value = "SELECT point_input_item_id from p_route_point_item WHERE route_point_id in (?1)", nativeQuery = true)
List<String> selectByroutePointIds(List<String> routePointIds);
} }
...@@ -789,6 +789,32 @@ public class PointServiceImpl implements IPointService { ...@@ -789,6 +789,32 @@ public class PointServiceImpl implements IPointService {
} }
@Override @Override
public List queryItemList4RoutePointNew(Long routeId,Long pointId, Long classifyId) {
if (pointId == null || classifyId == null) {
throw new RuntimeException("查询条件有误");
}
List<Map<String, Object>> resList = pointMapper.queryItemList4RoutePoint(pointId, classifyId);
//给前端返回是否绑定标识
Long[] longs = new Long[]{pointId};
List<RoutePoint> list = iRoutePointDao.queryRoutePoint(routeId, longs);
List<String> rouPonintId = new ArrayList<>();
list.forEach(e->rouPonintId.add(String.valueOf(e.getId())));
List<String> strings = iRoutePointItemDao.selectByroutePointIds(rouPonintId);
String ids = StringUtils.join(strings.toArray(), ",");
resList.forEach(e->{
if (ids.contains(e.get("itemId").toString())){
e.put("checked",false);
}else {
e.put("checked",true);
}
});
return resList;
}
@Override
public Page<List<Point>> queryPointInfoPage(List<DaoCriteria> criterias) { public Page<List<Point>> queryPointInfoPage(List<DaoCriteria> criterias) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
......
...@@ -98,6 +98,8 @@ public interface IPointService { ...@@ -98,6 +98,8 @@ public interface IPointService {
*/ */
Point queryPointById(Long id); Point queryPointById(Long id);
List queryItemList4RoutePointNew(Long routeId, Long pointId, Long classifyId);
/** /**
* 查询巡检点信息 * 查询巡检点信息
*/ */
......
...@@ -402,6 +402,6 @@ ...@@ -402,6 +402,6 @@
</select> </select>
<select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route"> <select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route">
SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')) SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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