Commit d03f5ca3 authored by tangwei's avatar tangwei

修改bug

parent 68a5d751
...@@ -204,6 +204,15 @@ public class PointController extends AbstractBaseController { ...@@ -204,6 +204,15 @@ public class PointController extends AbstractBaseController {
public CommonResponse addPointXcdx(@ApiParam(value = "新增巡查对象", required = true) @RequestBody PointInputItemNewVo pointClassify){ public CommonResponse addPointXcdx(@ApiParam(value = "新增巡查对象", required = true) @RequestBody PointInputItemNewVo pointClassify){
try { try {
//增加判断
PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
if(PointClassifyk!=null){
if(PointClassifyk.getId()!=pointClassify.getId()){
return CommonResponseUtil.failure("巡查对象code,不能重复!");
}
}
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId()); List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify(); PointClassify newPointClassify = new PointClassify();
...@@ -334,6 +343,14 @@ public class PointController extends AbstractBaseController { ...@@ -334,6 +343,14 @@ public class PointController extends AbstractBaseController {
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) {
PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
if(PointClassifyk!=null){
if(PointClassifyk.getId()!=pointClassify.getId()){
return CommonResponseUtil.failure("巡查对象code,不能重复!");
}
}
PointClassify newPointClassify = new PointClassify(); PointClassify newPointClassify = new PointClassify();
newPointClassify.setEquipmentId(pointClassify.getEquipmentId()); newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName()); newPointClassify.setName(pointClassify.getName());
......
package com.yeejoin.amos.patrol.business.dao.mapper; package com.yeejoin.amos.patrol.business.dao.mapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem; import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
public interface RoutePointItemMapper extends BaseMapper { public interface RoutePointItemMapper extends BaseMapper {
......
...@@ -50,4 +50,9 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> { ...@@ -50,4 +50,9 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
List<PointClassify> selectByOriginalId(String id); List<PointClassify> selectByOriginalId(String id);
PointClassify findByOriginalId(String originalId); PointClassify findByOriginalId(String originalId);
@Query(value = "select * from p_point_classify where point_id = ?1 and code = ?2 and is_delete = 0 ", nativeQuery = true)
PointClassify getPointClassifyByPointIdandcode(long id,String code);
} }
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
(`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`)
VALUES( VALUES(
#{id}, #{id},
#{route_point_id}, #{routePointId},
#{order_no}, #{orderNo},
#{point_input_item_id}, #{pointInputItemId},
#{creator_id}, #{creatorId},
#{create_date}, #{createDate},
#{point_classify_id}, #{pointClassifyId},
#{basis_json}) #{basisJson})
</insert> </insert>
......
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