refactor(contract): 重构客户文件类型相关代码,统一命名和继承结构
- 将 CompanyCustomerFileType 重命名为 CustomerFileType - 统一相关 VO 和 model 的继承结构,使用 BaseEnumEntity - 更新所有引用点,保持代码一致性 - 优化表格单元格显示逻辑,使用专用单元格工厂
This commit is contained in:
@@ -12,7 +12,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
@@ -49,7 +49,7 @@ public class CompanyCustomerFileService extends QueryService<CompanyCustomerFile
|
||||
|
||||
// 检索评估表
|
||||
List<CompanyCustomerFileVo> files = findAllByCustomerAndType(companyCustomer,
|
||||
CompanyCustomerFileType.EvaluationForm);
|
||||
CustomerFileType.EvaluationForm);
|
||||
CompanyCustomerFileVo latestFile = files.stream()
|
||||
.filter(v -> v.getSignDate() != null && v.isValid())
|
||||
.max(Comparator.comparing(CompanyCustomerFileVo::getSignDate))
|
||||
@@ -104,7 +104,7 @@ public class CompanyCustomerFileService extends QueryService<CompanyCustomerFile
|
||||
.getContent();
|
||||
}
|
||||
|
||||
public List<CompanyCustomerFileVo> findAllByCustomerAndType(CompanyCustomerVo customer, CompanyCustomerFileType type) {
|
||||
public List<CompanyCustomerFileVo> findAllByCustomerAndType(CompanyCustomerVo customer, CustomerFileType type) {
|
||||
return findAll(ParamUtils.builder()
|
||||
.equals("customer", customer.getId())
|
||||
.equals("type", type.name())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.model.CompanyCustomerFileTypeLocal;
|
||||
import com.ecep.contract.vm.CompanyCustomerFileTypeLocalViewModel;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
|
||||
@CacheConfig(cacheNames = "company-file-type")
|
||||
public class CompanyCustomerFileTypeService extends QueryService<CompanyCustomerFileTypeLocal, CompanyCustomerFileTypeLocalViewModel>{
|
||||
@Cacheable
|
||||
public Map<CompanyCustomerFileType, CompanyCustomerFileTypeLocal> findAll(Locale locale) {
|
||||
public Map<CustomerFileType, CompanyCustomerFileTypeLocal> findAll(Locale locale) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("lang", locale.toLanguageTag());
|
||||
return findAll(params, Pageable.unpaged()).stream()
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.model.VendorTypeLocal;
|
||||
import com.ecep.contract.vm.VendorTypeLocalViewModel;
|
||||
import com.ecep.contract.vo.VendorTypeLocalVo;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -12,28 +13,28 @@ import java.util.List;
|
||||
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "vendor-type")
|
||||
public class VendorTypeService extends QueryService<VendorTypeLocal, VendorTypeLocalViewModel> {
|
||||
public class VendorTypeService extends QueryService<VendorTypeLocalVo, VendorTypeLocalViewModel> {
|
||||
@Cacheable(key = "#p0")
|
||||
@Override
|
||||
public VendorTypeLocal findById(Integer id) {
|
||||
public VendorTypeLocalVo findById(Integer id) {
|
||||
return super.findById(id);
|
||||
}
|
||||
|
||||
@Cacheable(key = "'all'")
|
||||
@Override
|
||||
public List<VendorTypeLocal> findAll() {
|
||||
public List<VendorTypeLocalVo> findAll() {
|
||||
return super.findAll();
|
||||
}
|
||||
|
||||
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||
@Override
|
||||
public VendorTypeLocal save(VendorTypeLocal entity) {
|
||||
public VendorTypeLocalVo save(VendorTypeLocalVo entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||
@Override
|
||||
public void delete(VendorTypeLocal entity) {
|
||||
public void delete(VendorTypeLocalVo entity) {
|
||||
super.delete(entity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user