refactor(vo): 重构VO类及相关模型,添加Voable接口实现
feat(constant): 添加WebSocket错误码常量 docs(model): 为模型类添加注释 fix(service): 修复ProductUsageService缓存键问题 refactor(converter): 重构字符串转换器,移除EntityStringConverter依赖 feat(tab): 添加ComboBoxUtils工具类,优化下拉框初始化 style: 移除无用导入和字段
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.converter.BankStringConverter;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.BankViewModel;
|
||||
import com.ecep.contract.vo.BankVo;
|
||||
import javafx.util.StringConverter;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -8,15 +13,12 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.BankViewModel;
|
||||
import com.ecep.contract.vo.BankVo;
|
||||
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "bank")
|
||||
public class BankService extends QueryService<BankVo, BankViewModel> {
|
||||
|
||||
private final BankStringConverter stringConverter = new BankStringConverter(this);
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
@Override
|
||||
public BankVo findById(Integer id) {
|
||||
@@ -31,32 +33,20 @@ public class BankService extends QueryService<BankVo, BankViewModel> {
|
||||
return page.getContent().getFirst();
|
||||
}
|
||||
|
||||
@Caching(evict = { @CacheEvict(key = "#p0.id") })
|
||||
@Caching(evict = {@CacheEvict(key = "#p0.id")})
|
||||
@Override
|
||||
public BankVo save(BankVo entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Caching(evict = { @CacheEvict(key = "#p0.id") })
|
||||
@Caching(evict = {@CacheEvict(key = "#p0.id")})
|
||||
@Override
|
||||
public void delete(BankVo entity) {
|
||||
super.delete(entity);
|
||||
}
|
||||
|
||||
private StringConverter<BankVo> stringConverter = new StringConverter<BankVo>() {
|
||||
@Override
|
||||
public String toString(BankVo object) {
|
||||
return object == null ? "" : object.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BankVo fromString(String string) {
|
||||
return findByName(string);
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public StringConverter<BankVo> getStringConverter() {
|
||||
public BankStringConverter getStringConverter() {
|
||||
return stringConverter;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user