Commit 3ba88fbc authored by chenzhao's avatar chenzhao

修改代码

parent 2818540a
...@@ -198,7 +198,7 @@ public class PointController extends AbstractBaseController { ...@@ -198,7 +198,7 @@ public class PointController extends AbstractBaseController {
}else{ }else{
newPointClassify.setId(pointClassify.getId()); newPointClassify.setId(pointClassify.getId());
List<PointInputItemVo> oldInputItemList =iPointService. queryOldPointInputItem(pointClassify.getPointId()); // 新的巡检项的补集,即需要删除的项 List<PointInputItemVo> oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
List<PointInputItemVo> newInputItemList = new ArrayList<>(); List<PointInputItemVo> newInputItemList = new ArrayList<>();
List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData(); List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData();
newInputItemList.addAll(classList); newInputItemList.addAll(classList);
...@@ -334,10 +334,10 @@ public class PointController extends AbstractBaseController { ...@@ -334,10 +334,10 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "删除巡查对象", notes = "删除巡查对象") @ApiOperation(value = "删除巡查对象", notes = "删除巡查对象")
@GetMapping(value = "/deletPointClassify", produces = "application/json;charset=UTF-8") @DeleteMapping(value = "/deletPointClassify", produces = "application/json;charset=UTF-8")
public CommonResponse deletPointClassify(@ApiParam(value = "巡查对象id", required = true) @RequestParam Long id) { public CommonResponse deletPointClassify(@ApiParam(value = "巡查对象id", required = true) @RequestParam List<Long> ids) {
try { try {
//如果点下只有一个对象,并且点已经关联线路就不能删除 for (Long id : ids) {
PointClassify pointClassify=iPointClassifyDao.getOne(id); PointClassify pointClassify=iPointClassifyDao.getOne(id);
List<PointClassify> list=iPointClassifyDao.getPointClassifyByPointId(pointClassify.getPointId()); List<PointClassify> list=iPointClassifyDao.getPointClassifyByPointId(pointClassify.getPointId());
List<RoutePointItem> listp=iRoutePointItemDao.getRoutePointItemByPointId(pointClassify.getPointId()); List<RoutePointItem> listp=iRoutePointItemDao.getRoutePointItemByPointId(pointClassify.getPointId());
...@@ -351,6 +351,9 @@ public class PointController extends AbstractBaseController { ...@@ -351,6 +351,9 @@ public class PointController extends AbstractBaseController {
//删除巡检路线和项的关系表 //删除巡检路线和项的关系表
iRoutePointItemDao.delRoutePointItemByPointClassifyId(id); iRoutePointItemDao.delRoutePointItemByPointClassifyId(id);
}
//如果点下只有一个对象,并且点已经关联线路就不能删除
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -1480,6 +1480,19 @@ public class PointServiceImpl implements IPointService { ...@@ -1480,6 +1480,19 @@ public class PointServiceImpl implements IPointService {
return list; return list;
} }
public List<PointInputItemVo> queryOldPointInputItemNew(Long pointId,Long classifyId) {
List<PointInputItemVo> inputItemList = pointMapper.getPointInputItemById1(pointId, classifyId);
Map<Long, PointInputItemVo> itemMap = new HashMap<>();
for (PointInputItemVo itemVo : inputItemList) {
itemMap.put(itemVo.getPointItemId(), itemVo);
}
List<PointInputItemVo> list = new ArrayList<>();
itemMap.values().forEach(item -> {
list.add(item);
});
return list;
}
@Override @Override
public List<PointResponse> getPointConfigDom() { public List<PointResponse> getPointConfigDom() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -1632,9 +1645,6 @@ public class PointServiceImpl implements IPointService { ...@@ -1632,9 +1645,6 @@ public class PointServiceImpl implements IPointService {
@Override @Override
public Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size) { public Page queryPointList4RouteNew(String bizOrgCode,Long riskSourceId, String pointNo, String name, int current, int size) {
if (current < 1 || size < 0) {
throw new RuntimeException("查询条件有误");
}
List<Long> structureIdList = null; List<Long> structureIdList = null;
List<Map<String, Object>> list = Collections.EMPTY_LIST; List<Map<String, Object>> list = Collections.EMPTY_LIST;
// 传入riskSourceId为-2请求的是巡检点区域为空 // 传入riskSourceId为-2请求的是巡检点区域为空
......
...@@ -371,4 +371,6 @@ public interface IPointService { ...@@ -371,4 +371,6 @@ public interface IPointService {
void syncPointClassify(Map<String,Object> map); void syncPointClassify(Map<String,Object> map);
List<PointInputItemVo> queryOldPointInputItemNew(Long pointId, Long id);
} }
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