|
|
@ -5,6 +5,8 @@ import com.xydl.cac.exception.BusinessException;
|
|
|
|
import com.xydl.cac.repository.IcdTransformRepository;
|
|
|
|
import com.xydl.cac.repository.IcdTransformRepository;
|
|
|
|
import com.xydl.cac.service.IcdTransformService;
|
|
|
|
import com.xydl.cac.service.IcdTransformService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
@ -22,6 +24,7 @@ public class IcdTransformServiceImpl implements IcdTransformService {
|
|
|
|
IcdTransformRepository transformRepository;
|
|
|
|
IcdTransformRepository transformRepository;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@CacheEvict(cacheNames = {"listTransform"}, allEntries = true)
|
|
|
|
public IcdTransform addTransform(IcdTransform icdTransform) {
|
|
|
|
public IcdTransform addTransform(IcdTransform icdTransform) {
|
|
|
|
icdTransform.setId(null);
|
|
|
|
icdTransform.setId(null);
|
|
|
|
IcdTransform save = transformRepository.save(icdTransform);
|
|
|
|
IcdTransform save = transformRepository.save(icdTransform);
|
|
|
@ -29,6 +32,7 @@ public class IcdTransformServiceImpl implements IcdTransformService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@CacheEvict(cacheNames = {"listTransform"}, allEntries = true)
|
|
|
|
public void deleteTransform(Integer id) throws Exception {
|
|
|
|
public void deleteTransform(Integer id) throws Exception {
|
|
|
|
Optional<IcdTransform> byId = transformRepository.findById(id);
|
|
|
|
Optional<IcdTransform> byId = transformRepository.findById(id);
|
|
|
|
if (!byId.isPresent()) {
|
|
|
|
if (!byId.isPresent()) {
|
|
|
@ -38,11 +42,13 @@ public class IcdTransformServiceImpl implements IcdTransformService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@CacheEvict(cacheNames = {"listTransform"}, allEntries = true)
|
|
|
|
public void clearTransform() {
|
|
|
|
public void clearTransform() {
|
|
|
|
transformRepository.deleteAll();
|
|
|
|
transformRepository.deleteAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Cacheable(value = "listTransform")
|
|
|
|
public List<IcdTransform> listTransform() {
|
|
|
|
public List<IcdTransform> listTransform() {
|
|
|
|
return transformRepository.findAll();
|
|
|
|
return transformRepository.findAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|