refactor(client): 重构银行和公司相关代码

- 更新了多个类中的导入语句,替换了模型类为对应的VO类
- 优化了部分方法的参数和返回类型,使用VO类替代模型类
- 重构了自动补全功能,使用统一的泛型方法
- 添加了缓存注解,提高了数据访问性能
- 优化了部分代码结构,提高了可维护性
This commit is contained in:
2025-09-18 09:08:57 +08:00
parent d0645c33f1
commit 2752828094
42 changed files with 341 additions and 243 deletions

View File

@@ -1,36 +1,39 @@
package com.ecep.contract.service;
import com.ecep.contract.model.Company;
import com.ecep.contract.model.CompanyOldName;
import com.ecep.contract.vm.CompanyOldNameViewModel;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
@Service
public class CompanyOldNameService extends QueryService<CompanyOldName, CompanyOldNameViewModel> {
import com.ecep.contract.model.IdentityEntity;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
public boolean makePathAbsent(CompanyOldName companyOldName) {
import com.ecep.contract.model.Company;
import com.ecep.contract.model.CompanyOldName;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyOldNameViewModel;
import com.ecep.contract.vo.CompanyOldNameVo;
import com.ecep.contract.vo.CompanyVo;
@Service
public class CompanyOldNameService extends QueryService<CompanyOldNameVo, CompanyOldNameViewModel> {
public boolean makePathAbsent(CompanyOldNameVo companyOldName) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'makePathAbsent'");
}
public CompanyOldName findMatchByDate(Company company, LocalDate localDate) {
public CompanyOldName findMatchByDate(CompanyVo company, LocalDate localDate) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'findMatchByDate'");
}
public List<CompanyOldName> findAllByCompanyAndName(Company company, String oldName) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'findAllByCompanyAndName'");
public List<CompanyOldNameVo> findAllByCompanyAndName(CompanyVo company, String oldName) {
return findAll(ParamUtils.builder().equals("company", company.getId()).equals("oldName", oldName).build(),
Pageable.unpaged()).getContent();
}
public List<CompanyOldName> findAllByCompany(Company company) {
HashMap<String, Object> params = new HashMap<>();
params.put("company", company.getId());
return findAll(params, Pageable.unpaged()).getContent();
public List<CompanyOldNameVo> findAllByCompany(IdentityEntity company) {
return findAll(ParamUtils.equal("company", company.getId()), Pageable.unpaged()).getContent();
}
}