Commit 3ba88fbc authored by chenzhao's avatar chenzhao

修改代码

parent 2818540a
......@@ -198,7 +198,7 @@ public class PointController extends AbstractBaseController {
}else{
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> classList = pointClassify.getEquipIputDetailData();
newInputItemList.addAll(classList);
......@@ -334,23 +334,26 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "删除巡查对象", notes = "删除巡查对象")
@GetMapping(value = "/deletPointClassify", produces = "application/json;charset=UTF-8")
public CommonResponse deletPointClassify(@ApiParam(value = "巡查对象id", required = true) @RequestParam Long id) {
@DeleteMapping(value = "/deletPointClassify", produces = "application/json;charset=UTF-8")
public CommonResponse deletPointClassify(@ApiParam(value = "巡查对象id", required = true) @RequestParam List<Long> ids) {
try {
//如果点下只有一个对象,并且点已经关联线路就不能删除
PointClassify pointClassify=iPointClassifyDao.getOne(id);
List<PointClassify> list=iPointClassifyDao.getPointClassifyByPointId(pointClassify.getPointId());
List<RoutePointItem> listp=iRoutePointItemDao.getRoutePointItemByPointId(pointClassify.getPointId());
if(list.size()==1&&listp!=null&&listp.size()>0){
return CommonResponseUtil.failure("巡查点已绑定路线,最少保留一个巡查对象!");
for (Long id : ids) {
PointClassify pointClassify=iPointClassifyDao.getOne(id);
List<PointClassify> list=iPointClassifyDao.getPointClassifyByPointId(pointClassify.getPointId());
List<RoutePointItem> listp=iRoutePointItemDao.getRoutePointItemByPointId(pointClassify.getPointId());
if(list.size()==1&&listp!=null&&listp.size()>0){
return CommonResponseUtil.failure("巡查点已绑定路线,最少保留一个巡查对象!");
}
//删除对象
iPointClassifyDao.deleteById(id);
//删除检查项
iPointInputItemDao.deleteClassifyId(id);
//删除巡检路线和项的关系表
iRoutePointItemDao.delRoutePointItemByPointClassifyId(id);
}
//删除对象
iPointClassifyDao.deleteById(id);
//删除检查项
iPointInputItemDao.deleteClassifyId(id);
//删除巡检路线和项的关系表
iRoutePointItemDao.delRoutePointItemByPointClassifyId(id);
//如果点下只有一个对象,并且点已经关联线路就不能删除
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
......
......@@ -1480,6 +1480,19 @@ public class PointServiceImpl implements IPointService {
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
public List<PointResponse> getPointConfigDom() {
// TODO Auto-generated method stub
......@@ -1632,9 +1645,6 @@ public class PointServiceImpl implements IPointService {
@Override
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<Map<String, Object>> list = Collections.EMPTY_LIST;
// 传入riskSourceId为-2请求的是巡检点区域为空
......
......@@ -371,4 +371,6 @@ public interface IPointService {
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