Commit 2a3c2cd7 authored by chenzhao's avatar chenzhao

修改代码

parent ab449410
...@@ -268,6 +268,12 @@ public class PointController extends AbstractBaseController { ...@@ -268,6 +268,12 @@ public class PointController extends AbstractBaseController {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassifys.get(0).getPointId()); List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassifys.get(0).getPointId());
for (PointInputItemNewVo pointClassify : pointClassifys) { for (PointInputItemNewVo pointClassify : pointClassifys) {
List<PointClassify> pointClassifies = iPointClassifyDao.queryByPointIdAndEquipmentId(pointClassify.getPointId(), pointClassify.getEquipmentId());
if (pointClassifies.size() > 0){
throw new RuntimeException(pointClassify.getName()+"已存在,不可添加");
}
PointClassify newPointClassify = new PointClassify(); PointClassify newPointClassify = new PointClassify();
newPointClassify.setEquipmentId(pointClassify.getEquipmentId()); newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName()); newPointClassify.setName(pointClassify.getName());
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.repository; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.repository;
import java.util.List; import java.util.List;
import com.yeejoin.amos.patrol.dao.entity.RoutePoint;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -17,6 +18,9 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> { ...@@ -17,6 +18,9 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Query(value = "select * from p_point_classify where point_id = ?1 and is_delete = 0", nativeQuery = true) @Query(value = "select * from p_point_classify where point_id = ?1 and is_delete = 0", nativeQuery = true)
List<PointClassify> getPointClassifyByPointId(long id); List<PointClassify> getPointClassifyByPointId(long id);
@Query(value = "SELECT * FROM `p_route_point` where point_id = ?1 and equipment_id = ?2", nativeQuery = true)
List<PointClassify> queryByPointIdAndEquipmentId(Long pointId, String equipmentId);
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "select * from p_point_classify where name = ?1", nativeQuery = true) @Query(value = "select * from p_point_classify where name = ?1", nativeQuery = true)
......
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