|
|
|
@ -9,6 +9,8 @@ import com.xydl.cac.service.ModevTypePointService;
|
|
|
|
|
import com.xydl.cac.service.UnitService;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -29,6 +31,7 @@ public class ModevTypePointServiceImpl implements ModevTypePointService {
|
|
|
|
|
WarnRuleRepository ruleRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Cacheable(value = "typePoint", key = "#modevtypeId")
|
|
|
|
|
public List<ModevTypePoint> listAll(Integer modevtypeId) {
|
|
|
|
|
List<ModevTypePoint> list = repository.findByModevtypeId(modevtypeId);
|
|
|
|
|
for (ModevTypePoint point : list) {
|
|
|
|
@ -40,6 +43,7 @@ public class ModevTypePointServiceImpl implements ModevTypePointService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames = {"typePoint"}, allEntries = true)
|
|
|
|
|
public ModevTypePoint add(ModevTypePoint item) throws Exception {
|
|
|
|
|
item.setId(null);
|
|
|
|
|
List<ModevTypePoint> list = repository.findByModevtypeIdAndField(item.getModevtypeId(), item.getField());
|
|
|
|
@ -50,6 +54,7 @@ public class ModevTypePointServiceImpl implements ModevTypePointService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(cacheNames = {"typePoint"}, allEntries = true)
|
|
|
|
|
public void delete(Integer id) throws Exception {
|
|
|
|
|
List<WarnRule> list = ruleRepository.findByModevtypePointId(id);
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|