|
|
|
@ -2,8 +2,10 @@ package com.xydl.cac.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.xydl.cac.entity.Jg;
|
|
|
|
|
import com.xydl.cac.entity.Lx;
|
|
|
|
|
import com.xydl.cac.entity.Modev;
|
|
|
|
|
import com.xydl.cac.entity.Zsb;
|
|
|
|
|
import com.xydl.cac.repository.LxRepository;
|
|
|
|
|
import com.xydl.cac.repository.ModevRepository;
|
|
|
|
|
import com.xydl.cac.repository.ZsbRepository;
|
|
|
|
|
import com.xydl.cac.service.JgService;
|
|
|
|
|
import com.xydl.cac.service.ZsbService;
|
|
|
|
@ -27,6 +29,8 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
|
JgService jgService;
|
|
|
|
|
@Resource
|
|
|
|
|
LxRepository lxRepository;
|
|
|
|
|
@Resource
|
|
|
|
|
ModevRepository modevRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Zsb> listAll(Integer jgid) throws Exception {
|
|
|
|
@ -111,6 +115,10 @@ public class ZsbServiceImpl implements ZsbService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(Integer id) throws Exception {
|
|
|
|
|
List<Modev> modevList = modevRepository.findByZsbid(id);
|
|
|
|
|
if (!CollectionUtils.isEmpty(modevList)) {
|
|
|
|
|
throw new Exception("已被监测装置使用不能删除");
|
|
|
|
|
}
|
|
|
|
|
repository.deleteById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|