refactor(client): 重构服务类继承关系并统一使用QueryService
重构所有服务类,使其继承自QueryService接口,统一数据查询逻辑。同时为服务类添加@Service注解,确保Spring容器管理。更新相关FXML文件的控制器路径,从manager.ds调整为controller目录结构。调整pom.xml版本号至0.0.84-SNAPSHOT。新增MessageNotitfication和SimpleMessage消息类,提供基础消息结构支持。
This commit is contained in:
@@ -2,16 +2,15 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Bank;
|
||||
import com.ecep.contract.vm.BankViewModel;
|
||||
|
||||
public class BankService implements ViewModelService<Bank, BankViewModel> {
|
||||
@Service
|
||||
public class BankService extends QueryService<Bank, BankViewModel> {
|
||||
public Bank findByName(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<Bank> search(String searchText) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.controlsfx.control.TaskProgressView;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.Desktop;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
@@ -17,7 +18,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import javafx.concurrent.Task;
|
||||
import lombok.Data;
|
||||
|
||||
public class CloudRkService implements ViewModelService<CloudRk, CloudRkViewModel> {
|
||||
@Service
|
||||
public class CloudRkService extends QueryService<CloudRk, CloudRkViewModel> {
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class EntInfo {
|
||||
@@ -27,6 +29,7 @@ public class CloudRkService implements ViewModelService<CloudRk, CloudRkViewMode
|
||||
private String name;
|
||||
private boolean nowName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成定时同步任务
|
||||
*
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.DesktopUtils;
|
||||
@@ -18,7 +15,8 @@ import com.ecep.contract.vm.CloudTycInfoViewModel;
|
||||
|
||||
import javafx.application.Platform;
|
||||
|
||||
public class CloudTycService implements ViewModelService<CloudTyc, CloudTycInfoViewModel> {
|
||||
@Service
|
||||
public class CloudTycService extends QueryService<CloudTyc, CloudTycInfoViewModel> {
|
||||
/**
|
||||
* 天眼查报告,文件名中必须包含 天眼查 字样
|
||||
*
|
||||
@@ -58,36 +56,6 @@ public class CloudTycService implements ViewModelService<CloudTyc, CloudTycInfoV
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudTyc findById(Integer id) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findById'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudTyc save(CloudTyc entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'save'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(CloudTyc entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'delete'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CloudTyc> findAll() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<CloudTyc> findAll(Map<String, Object> params, Pageable pageable) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
public CloudTyc getOrCreateCloudTyc(Company company) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getOrCreateCloudTyc'");
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyBankAccount;
|
||||
import com.ecep.contract.vm.CompanyBankAccountViewModel;
|
||||
|
||||
public class CompanyBankAccountService implements ViewModelService<CompanyBankAccount, CompanyBankAccountViewModel> {
|
||||
@Service
|
||||
public class CompanyBankAccountService extends QueryService<CompanyBankAccount, CompanyBankAccountViewModel> {
|
||||
|
||||
public List<CompanyBankAccount> searchByCompany(Company company, String searchText) {
|
||||
throw new UnsupportedOperationException("未实现");
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.CompanyBlackReason;
|
||||
import com.ecep.contract.vm.CompanyBlackReasonViewModel;
|
||||
|
||||
@Service
|
||||
public class CompanyBlackReasonService
|
||||
implements ViewModelService<CompanyBlackReason, CompanyBlackReasonViewModel> {
|
||||
extends QueryService<CompanyBlackReason, CompanyBlackReasonViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyContact;
|
||||
import com.ecep.contract.vm.CompanyContactViewModel;
|
||||
|
||||
public class CompanyContactService implements ViewModelService<CompanyContact, CompanyContactViewModel> {
|
||||
@Service
|
||||
public class CompanyContactService extends QueryService<CompanyContact, CompanyContactViewModel> {
|
||||
|
||||
public List<CompanyContact> searchByCompany(Company company, String userText) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -5,12 +5,14 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
import com.ecep.contract.model.CompanyCustomerEntity;
|
||||
import com.ecep.contract.vm.CustomerEntityViewModel;
|
||||
|
||||
public class CompanyCustomerEntityService implements ViewModelService<CompanyCustomerEntity, CustomerEntityViewModel> {
|
||||
@Service
|
||||
public class CompanyCustomerEntityService extends QueryService<CompanyCustomerEntity, CustomerEntityViewModel> {
|
||||
public List<CompanyCustomerEntity> findAllByCustomer(CompanyCustomer customer) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
@@ -14,7 +16,8 @@ import com.ecep.contract.model.CompanyCustomerFile;
|
||||
import com.ecep.contract.model.CompanyCustomerFileTypeLocal;
|
||||
import com.ecep.contract.vm.CompanyCustomerFileViewModel;
|
||||
|
||||
public class CompanyCustomerFileService implements ViewModelService<CompanyCustomerFile, CompanyCustomerFileViewModel> {
|
||||
@Service
|
||||
public class CompanyCustomerFileService extends QueryService<CompanyCustomerFile, CompanyCustomerFileViewModel> {
|
||||
public List<CompanyCustomerEvaluationFormFile> findAllCustomerEvaluationFormFiles(CompanyCustomer customer) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
import com.ecep.contract.model.CustomerCatalog;
|
||||
import com.ecep.contract.vm.CompanyCustomerViewModel;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CompanyCustomerService implements ViewModelService<CompanyCustomer, CompanyCustomerViewModel> {
|
||||
@Service
|
||||
public class CompanyCustomerService extends QueryService<CompanyCustomer, CompanyCustomerViewModel> {
|
||||
|
||||
public CompanyCustomer findByCompany(Company company) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyExtendInfo;
|
||||
import com.ecep.contract.vm.CompanyExtendInfoViewModel;
|
||||
|
||||
public class CompanyExtendInfoService implements ViewModelService<CompanyExtendInfo, CompanyExtendInfoViewModel> {
|
||||
@Service
|
||||
public class CompanyExtendInfoService extends QueryService<CompanyExtendInfo, CompanyExtendInfoViewModel> {
|
||||
public CompanyExtendInfo findByCompany(Company company) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByCompany'");
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.CompanyFileType;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Company;
|
||||
@@ -14,7 +16,8 @@ import com.ecep.contract.vm.CompanyFileViewModel;
|
||||
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
public class CompanyFileService implements ViewModelService<CompanyFile, CompanyFileViewModel> {
|
||||
@Service
|
||||
public class CompanyFileService extends QueryService<CompanyFile, CompanyFileViewModel> {
|
||||
|
||||
public boolean reBuildingFiles(Company company, MessageHolder holder) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.ecep.contract.service;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyOldName;
|
||||
import com.ecep.contract.vm.CompanyOldNameViewModel;
|
||||
|
||||
public class CompanyOldNameService implements ViewModelService<CompanyOldName, CompanyOldNameViewModel> {
|
||||
@Service
|
||||
public class CompanyOldNameService extends QueryService<CompanyOldName, CompanyOldNameViewModel> {
|
||||
|
||||
public boolean makePathAbsent(CompanyOldName companyOldName) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -4,22 +4,25 @@ import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.vm.CompanyViewModel;
|
||||
|
||||
public class CompanyService implements ViewModelService<Company, CompanyViewModel> {
|
||||
@Service
|
||||
public class CompanyService extends QueryService<Company, CompanyViewModel> {
|
||||
|
||||
@Override
|
||||
public String getBeanName() {
|
||||
return "companyService";
|
||||
}
|
||||
|
||||
public Company findByName(String name) {
|
||||
// return companyRepository.findByName(name);
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
}
|
||||
|
||||
public List<Company> search(String name) {
|
||||
// return companyRepository.findByName(name);
|
||||
throw new UnsupportedOperationException("Unimplemented method 'search'");
|
||||
}
|
||||
|
||||
public List<Company> findAllByName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAllByName'");
|
||||
@@ -55,10 +58,9 @@ public class CompanyService implements ViewModelService<Company, CompanyViewMode
|
||||
throw new UnsupportedOperationException("Unimplemented method 'makePathAbsent'");
|
||||
}
|
||||
|
||||
public boolean retrieveFromDownloadFiles(Company company, File[] files, MessageHolder holder) {
|
||||
public boolean retrieveFromDownloadFiles(Company company, File[] files, MessageHolder holder) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'retrieveFromDownloadFiles'");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.CompanyVendorApprovedFile;
|
||||
import com.ecep.contract.model.CompanyVendorApprovedList;
|
||||
import com.ecep.contract.vm.CompanyVendorApprovedFileViewModel;
|
||||
|
||||
public class CompanyVendorApprovedFileService implements ViewModelService<CompanyVendorApprovedFile, CompanyVendorApprovedFileViewModel> {
|
||||
@Service
|
||||
public class CompanyVendorApprovedFileService
|
||||
extends QueryService<CompanyVendorApprovedFile, CompanyVendorApprovedFileViewModel> {
|
||||
|
||||
public CompanyVendorApprovedFile findByName(CompanyVendorApprovedList approvedList, String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,12 +2,16 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.CompanyVendor;
|
||||
import com.ecep.contract.model.CompanyVendorApprovedItem;
|
||||
import com.ecep.contract.model.CompanyVendorApprovedList;
|
||||
import com.ecep.contract.vm.CompanyVendorApprovedItemViewModel;
|
||||
|
||||
public class CompanyVendorApprovedItemService implements ViewModelService<CompanyVendorApprovedItem, CompanyVendorApprovedItemViewModel> {
|
||||
@Service
|
||||
public class CompanyVendorApprovedItemService
|
||||
extends QueryService<CompanyVendorApprovedItem, CompanyVendorApprovedItemViewModel> {
|
||||
|
||||
public List<CompanyVendorApprovedItem> findAllByListAndVendor(CompanyVendorApprovedList approvedList,
|
||||
CompanyVendor vendor) {
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.CompanyVendorApprovedList;
|
||||
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
|
||||
|
||||
@Service
|
||||
public class CompanyVendorApprovedListService
|
||||
implements ViewModelService<CompanyVendorApprovedList, CompanyVendorApprovedListViewModel> {
|
||||
extends QueryService<CompanyVendorApprovedList, CompanyVendorApprovedListViewModel> {
|
||||
|
||||
public boolean makePathAbsent(CompanyVendorApprovedList list) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.CompanyVendorEntity;
|
||||
import com.ecep.contract.vm.CompanyVendorEntityViewModel;
|
||||
|
||||
public class CompanyVendorEntityService implements ViewModelService<CompanyVendorEntity, CompanyVendorEntityViewModel> {
|
||||
@Service
|
||||
public class CompanyVendorEntityService extends QueryService<CompanyVendorEntity, CompanyVendorEntityViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -6,13 +6,16 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.CompanyVendorFileType;
|
||||
import com.ecep.contract.model.CompanyVendor;
|
||||
import com.ecep.contract.model.CompanyVendorFile;
|
||||
import com.ecep.contract.model.CompanyVendorFileTypeLocal;
|
||||
import com.ecep.contract.vm.CompanyVendorFileViewModel;
|
||||
|
||||
public class CompanyVendorFileService implements ViewModelService<CompanyVendorFile, CompanyVendorFileViewModel> {
|
||||
@Service
|
||||
public class CompanyVendorFileService extends QueryService<CompanyVendorFile, CompanyVendorFileViewModel> {
|
||||
|
||||
public LocalDate getNextSignDate(CompanyVendor companyVendor, Consumer<String> state) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyVendor;
|
||||
@@ -13,7 +15,8 @@ import com.ecep.contract.model.VendorCatalog;
|
||||
import com.ecep.contract.model.VendorTypeLocal;
|
||||
import com.ecep.contract.vm.CompanyVendorViewModel;
|
||||
|
||||
public class CompanyVendorService implements ViewModelService<CompanyVendor, CompanyVendorViewModel> {
|
||||
@Service
|
||||
public class CompanyVendorService extends QueryService<CompanyVendor, CompanyVendorViewModel> {
|
||||
|
||||
public VendorCatalog findCatalogById(Integer id) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractBidVendor;
|
||||
import com.ecep.contract.vm.ContractBidVendorViewModel;
|
||||
|
||||
public class ContractBidVendorService implements ViewModelService<ContractBidVendor, ContractBidVendorViewModel> {
|
||||
@Service
|
||||
public class ContractBidVendorService extends QueryService<ContractBidVendor, ContractBidVendorViewModel> {
|
||||
|
||||
public List<ContractBidVendor> findByContract(Contract contract) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -3,13 +3,16 @@ package com.ecep.contract.service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractFile;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
import com.ecep.contract.vm.ContractFileViewModel;
|
||||
|
||||
public class ContractFileService implements ViewModelService<ContractFile, ContractFileViewModel> {
|
||||
@Service
|
||||
public class ContractFileService extends QueryService<ContractFile, ContractFileViewModel> {
|
||||
|
||||
public List<ContractFile> findAllByContract(Contract contract) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ContractGroup;
|
||||
import com.ecep.contract.vm.ContractGroupViewModel;
|
||||
|
||||
public class ContractGroupService implements ViewModelService<ContractGroup, ContractGroupViewModel> {
|
||||
@Service
|
||||
public class ContractGroupService extends QueryService<ContractGroup, ContractGroupViewModel> {
|
||||
|
||||
public ContractGroup findByCode(String groupCode) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.ecep.contract.model.Inventory;
|
||||
import com.ecep.contract.vm.ContractItemViewModel;
|
||||
|
||||
@Service
|
||||
public class ContractItemService implements ViewModelService<ContractItem, ContractItemViewModel> {
|
||||
public class ContractItemService extends QueryService<ContractItem, ContractItemViewModel> {
|
||||
|
||||
@Override
|
||||
public ContractItem findById(Integer id) {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ContractKind;
|
||||
import com.ecep.contract.vm.ContractKindViewModel;
|
||||
|
||||
public class ContractKindService implements ViewModelService<ContractKind, ContractKindViewModel> {
|
||||
@Service
|
||||
public class ContractKindService extends QueryService<ContractKind, ContractKindViewModel> {
|
||||
|
||||
public ContractKind findByName(String name) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractPayPlan;
|
||||
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
||||
|
||||
public class ContractPayPlanService implements ViewModelService<ContractPayPlan, ContractPayPlanViewModel> {
|
||||
@Service
|
||||
public class ContractPayPlanService extends QueryService<ContractPayPlan, ContractPayPlanViewModel> {
|
||||
|
||||
public List<ContractPayPlan> findAllByContract(Contract contract) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.CompanyVendor;
|
||||
import com.ecep.contract.model.Contract;
|
||||
@@ -12,7 +14,8 @@ import com.ecep.contract.model.ContractGroup;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.vm.ContractViewModel;
|
||||
|
||||
public class ContractService implements ViewModelService<Contract, ContractViewModel> {
|
||||
@Service
|
||||
public class ContractService extends QueryService<Contract, ContractViewModel> {
|
||||
|
||||
public boolean updateParentCode(Contract contract) {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -28,10 +31,6 @@ public class ContractService implements ViewModelService<Contract, ContractViewM
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByCode'");
|
||||
}
|
||||
|
||||
public List<Contract> search(String searchText) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'search'");
|
||||
}
|
||||
|
||||
public Contract findByName(String name) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
}
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ContractType;
|
||||
import com.ecep.contract.vm.ContractTypeViewModel;
|
||||
|
||||
public class ContractTypeService implements ViewModelService<ContractType, ContractTypeViewModel> {
|
||||
@Service
|
||||
public class ContractTypeService extends QueryService<ContractType, ContractTypeViewModel> {
|
||||
|
||||
public ContractType findByName(String name) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
}
|
||||
|
||||
public List<ContractType> search(String searchText) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'search'");
|
||||
}
|
||||
|
||||
public ContractType findByCode(String typeCode) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByCode'");
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.CustomerSatisfactionSurvey;
|
||||
import com.ecep.contract.vm.CustomerSatisfactionSurveyViewModel;
|
||||
|
||||
public class CustomerSatisfactionSurveyService implements ViewModelService<CustomerSatisfactionSurvey, CustomerSatisfactionSurveyViewModel> {
|
||||
@Service
|
||||
public class CustomerSatisfactionSurveyService
|
||||
extends QueryService<CustomerSatisfactionSurvey, CustomerSatisfactionSurveyViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.DeliverySignMethod;
|
||||
import com.ecep.contract.vm.DeliverySignMethodViewModel;
|
||||
|
||||
public class DeliverySignMethodService implements ViewModelService<DeliverySignMethod, DeliverySignMethodViewModel> {
|
||||
@Service
|
||||
public class DeliverySignMethodService extends QueryService<DeliverySignMethod, DeliverySignMethodViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Department;
|
||||
import com.ecep.contract.vm.DepartmentViewModel;
|
||||
|
||||
public class DepartmentService implements ViewModelService<Department, DepartmentViewModel> {
|
||||
|
||||
public List<Department> search(String searchText) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'search'");
|
||||
}
|
||||
@Service
|
||||
public class DepartmentService extends QueryService<Department, DepartmentViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.ecep.contract.service;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.EmployeeAuthBind;
|
||||
import com.ecep.contract.vm.EmployeeAuthBindViewModel;
|
||||
|
||||
public class EmployeeAuthBindService implements ViewModelService<EmployeeAuthBind, EmployeeAuthBindViewModel> {
|
||||
@Service
|
||||
public class EmployeeAuthBindService extends QueryService<EmployeeAuthBind, EmployeeAuthBindViewModel> {
|
||||
|
||||
public List<EmployeeAuthBind> findAllByEmployee(Object object, Sort unsorted) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.EmployeeLoginHistory;
|
||||
import com.ecep.contract.vm.EmployeeLoginHistoryViewModel;
|
||||
|
||||
@Service
|
||||
public class EmployeeLoginHistoryService
|
||||
implements ViewModelService<EmployeeLoginHistory, EmployeeLoginHistoryViewModel> {
|
||||
extends QueryService<EmployeeLoginHistory, EmployeeLoginHistoryViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.EmployeeRole;
|
||||
import com.ecep.contract.model.Function;
|
||||
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
||||
|
||||
public class EmployeeRoleService implements ViewModelService<EmployeeRole, EmployeeRoleViewModel> {
|
||||
@Service
|
||||
public class EmployeeRoleService extends QueryService<EmployeeRole, EmployeeRoleViewModel> {
|
||||
|
||||
public List<Function> getFunctionsByRoleId(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.EmployeeRole;
|
||||
import com.ecep.contract.vm.EmployeeViewModel;
|
||||
|
||||
public class EmployeeService implements ViewModelService<Employee, EmployeeViewModel> {
|
||||
@Service
|
||||
public class EmployeeService extends QueryService<Employee, EmployeeViewModel> {
|
||||
|
||||
public static final int DEFAULT_SYSTEM_EMPLOYEE_ID = 26;
|
||||
|
||||
@@ -24,12 +27,6 @@ public class EmployeeService implements ViewModelService<Employee, EmployeeViewM
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'updateActive'");
|
||||
}
|
||||
|
||||
public List<Employee> search(String searchText) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'search'");
|
||||
}
|
||||
|
||||
public Employee findByCode(String personCode) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByCode'");
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ExtendVendorInfo;
|
||||
import com.ecep.contract.vm.ExtendVendorInfoViewModel;
|
||||
|
||||
public class ExtendVendorInfoService implements ViewModelService<ExtendVendorInfo, ExtendVendorInfoViewModel> {
|
||||
@Service
|
||||
public class ExtendVendorInfoService extends QueryService<ExtendVendorInfo, ExtendVendorInfoViewModel> {
|
||||
|
||||
public ExtendVendorInfo findByContract(Contract contract) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByContract'");
|
||||
}
|
||||
public ExtendVendorInfo findByContract(Contract contract) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByContract'");
|
||||
}
|
||||
|
||||
public ExtendVendorInfo newInstanceByContract(Contract contract) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Function;
|
||||
import com.ecep.contract.vm.FunctionViewModel;
|
||||
|
||||
public class FunctionService implements ViewModelService<Function, FunctionViewModel> {
|
||||
@Service
|
||||
public class FunctionService extends QueryService<Function, FunctionViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,18 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.InventoryCatalog;
|
||||
import com.ecep.contract.vm.InventoryCatalogViewModel;
|
||||
|
||||
public class InventoryCatalogService implements ViewModelService<InventoryCatalog, InventoryCatalogViewModel> {
|
||||
@Service
|
||||
public class InventoryCatalogService extends QueryService<InventoryCatalog, InventoryCatalogViewModel> {
|
||||
|
||||
public InventoryCatalog findByName(String v) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
}
|
||||
|
||||
public List<InventoryCatalog> search(String searchText) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Inventory;
|
||||
import com.ecep.contract.model.InventoryHistoryPrice;
|
||||
import com.ecep.contract.vm.InventoryHistoryPriceViewModel;
|
||||
|
||||
@Service
|
||||
public class InventoryHistoryPriceService
|
||||
implements ViewModelService<InventoryHistoryPrice, InventoryHistoryPriceViewModel> {
|
||||
extends QueryService<InventoryHistoryPrice, InventoryHistoryPriceViewModel> {
|
||||
|
||||
public InventoryHistoryPrice[] findAllByInventory(Inventory parent) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAllByInventory'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Inventory;
|
||||
import com.ecep.contract.vm.InventoryViewModel;
|
||||
|
||||
public class InventoryService implements ViewModelService<Inventory, InventoryViewModel> {
|
||||
@Service
|
||||
public class InventoryService extends QueryService<Inventory, InventoryViewModel> {
|
||||
|
||||
public Inventory createNewInstance() {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -18,11 +19,6 @@ public class InventoryService implements ViewModelService<Inventory, InventoryVi
|
||||
throw new UnsupportedOperationException("Unimplemented method 'syncInventory'");
|
||||
}
|
||||
|
||||
public List<Inventory> search(String searchText) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAllByProject'");
|
||||
}
|
||||
|
||||
public Inventory findByCode(String code) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByCode'");
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Invoice;
|
||||
import com.ecep.contract.vm.InvoiceViewModel;
|
||||
|
||||
public class InvoiceService implements ViewModelService<Invoice, InvoiceViewModel> {
|
||||
@Service
|
||||
public class InvoiceService extends QueryService<Invoice, InvoiceViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Permission;
|
||||
import com.ecep.contract.vm.PermissionViewModel;
|
||||
|
||||
public class PermissionService implements ViewModelService<Permission, PermissionViewModel> {
|
||||
@Service
|
||||
public class PermissionService extends QueryService<Permission, PermissionViewModel> {
|
||||
|
||||
public List<Permission> findByFunctionId(int i) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProductType;
|
||||
import com.ecep.contract.vm.ProductTypeViewModel;
|
||||
|
||||
public class ProductTypeService implements ViewModelService<ProductType, ProductTypeViewModel> {
|
||||
@Service
|
||||
public class ProductTypeService extends QueryService<ProductType, ProductTypeViewModel> {
|
||||
|
||||
public ProductType findByName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProductUsage;
|
||||
import com.ecep.contract.vm.ProductUsageViewModel;
|
||||
|
||||
public class ProductUsageService implements ViewModelService<ProductUsage, ProductUsageViewModel> {
|
||||
@Service
|
||||
public class ProductUsageService extends QueryService<ProductUsage, ProductUsageViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectBid;
|
||||
import com.ecep.contract.vm.ProjectBidViewModel;
|
||||
|
||||
public class ProjectBidService implements ViewModelService<ProjectBid, ProjectBidViewModel> {
|
||||
@Service
|
||||
public class ProjectBidService extends QueryService<ProjectBid, ProjectBidViewModel> {
|
||||
|
||||
public List<ProjectBid> findAllByProject(Project project) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProjectCost;
|
||||
import com.ecep.contract.model.ProjectCostItem;
|
||||
import com.ecep.contract.vm.ProjectCostItemViewModel;
|
||||
|
||||
public class ProjectCostItemService implements ViewModelService<ProjectCostItem, ProjectCostItemViewModel> {
|
||||
@Service
|
||||
public class ProjectCostItemService extends QueryService<ProjectCostItem, ProjectCostItemViewModel> {
|
||||
|
||||
public List<ProjectCostItem> findByCost(ProjectCost cost) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,12 +2,15 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectCost;
|
||||
import com.ecep.contract.vm.ProjectCostViewModel;
|
||||
|
||||
public class ProjectCostService implements ViewModelService<ProjectCost, ProjectCostViewModel> {
|
||||
@Service
|
||||
public class ProjectCostService extends QueryService<ProjectCost, ProjectCostViewModel> {
|
||||
|
||||
public ProjectCost findAutoCostByProject(Project project) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectFundPlan;
|
||||
import com.ecep.contract.vm.ProjectFundPlanViewModel;
|
||||
|
||||
public class ProjectFundPlanService implements ViewModelService<ProjectFundPlan, ProjectFundPlanViewModel> {
|
||||
@Service
|
||||
public class ProjectFundPlanService extends QueryService<ProjectFundPlan, ProjectFundPlanViewModel> {
|
||||
|
||||
public List<ProjectFundPlan> findAllByProject(Project project) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProjectIndustry;
|
||||
import com.ecep.contract.vm.ProjectIndustryViewModel;
|
||||
|
||||
public class ProjectIndustryService implements ViewModelService<ProjectIndustry, ProjectIndustryViewModel> {
|
||||
@Service
|
||||
public class ProjectIndustryService extends QueryService<ProjectIndustry, ProjectIndustryViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectQuotation;
|
||||
import com.ecep.contract.vm.ProjectQuotationViewModel;
|
||||
|
||||
public class ProjectQuotationService implements ViewModelService<ProjectQuotation, ProjectQuotationViewModel>{
|
||||
@Service
|
||||
public class ProjectQuotationService extends QueryService<ProjectQuotation, ProjectQuotationViewModel> {
|
||||
|
||||
public List<ProjectQuotation> findAllByProject(Project project) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -2,25 +2,18 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.model.ProjectSaleType;
|
||||
import com.ecep.contract.model.ProjectSaleTypeRequireFileType;
|
||||
import com.ecep.contract.vm.ProjectSaleTypeViewModel;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public class ProjectSaleTypeRequireFileTypeService implements ViewModelService<ProjectSaleType, ProjectSaleTypeViewModel>{
|
||||
import com.ecep.contract.model.ProjectSaleTypeRequireFileType;
|
||||
import com.ecep.contract.vm.ProjectSaleTypeRequireFileTypeViewModel;
|
||||
|
||||
@Service
|
||||
public class ProjectSaleTypeRequireFileTypeService
|
||||
extends QueryService<ProjectSaleTypeRequireFileType, ProjectSaleTypeRequireFileTypeViewModel> {
|
||||
|
||||
public List<ProjectSaleTypeRequireFileType> findBySaleTypeId(Integer id) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findBySaleTypeId'");
|
||||
}
|
||||
|
||||
public void save(ProjectSaleTypeRequireFileType entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'save'");
|
||||
}
|
||||
|
||||
public void delete(ProjectSaleTypeRequireFileType entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'delete'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProjectSaleType;
|
||||
import com.ecep.contract.vm.ProjectSaleTypeViewModel;
|
||||
|
||||
public class ProjectSaleTypeService implements ViewModelService<ProjectSaleType, ProjectSaleTypeViewModel> {
|
||||
@Service
|
||||
public class ProjectSaleTypeService extends QueryService<ProjectSaleType, ProjectSaleTypeViewModel> {
|
||||
|
||||
public ProjectSaleType findByCode(String substring) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectSaleType;
|
||||
@@ -8,13 +10,10 @@ import com.ecep.contract.vm.ProjectViewModel;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class ProjectService implements ViewModelService<Project, ProjectViewModel> {
|
||||
@Service
|
||||
public class ProjectService extends QueryService<Project, ProjectViewModel> {
|
||||
|
||||
|
||||
public List<Project> search(String searchText) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Project findByName(String name) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProjectType;
|
||||
import com.ecep.contract.vm.ProjectTypeViewModel;
|
||||
|
||||
public class ProjectTypeService implements ViewModelService<ProjectType, ProjectTypeViewModel> {
|
||||
@Service
|
||||
public class ProjectTypeService extends QueryService<ProjectType, ProjectTypeViewModel> {
|
||||
|
||||
public ProjectType findByName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.PurchaseBillVoucherItem;
|
||||
import com.ecep.contract.vm.PurchaseBillVoucherItemViewModel;
|
||||
|
||||
@Service
|
||||
public class PurchaseBillVoucherItemService
|
||||
implements ViewModelService<PurchaseBillVoucherItem, PurchaseBillVoucherItemViewModel> {
|
||||
extends QueryService<PurchaseBillVoucherItem, PurchaseBillVoucherItemViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.PurchaseBillVoucher;
|
||||
import com.ecep.contract.vm.PurchaseBillVoucherViewModel;
|
||||
|
||||
public class PurchaseBillVoucherService implements ViewModelService<PurchaseBillVoucher, PurchaseBillVoucherViewModel> {
|
||||
@Service
|
||||
public class PurchaseBillVoucherService extends QueryService<PurchaseBillVoucher, PurchaseBillVoucherViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.PurchaseOrderItem;
|
||||
import com.ecep.contract.vm.PurchaseOrderItemViewModel;
|
||||
|
||||
public class PurchaseOrderItemService implements ViewModelService<PurchaseOrderItem, PurchaseOrderItemViewModel> {
|
||||
@Service
|
||||
public class PurchaseOrderItemService extends QueryService<PurchaseOrderItem, PurchaseOrderItemViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.PurchaseOrder;
|
||||
import com.ecep.contract.vm.PurchaseOrderViewModel;
|
||||
|
||||
public class PurchaseOrdersService implements ViewModelService<PurchaseOrder, PurchaseOrderViewModel> {
|
||||
@Service
|
||||
public class PurchaseOrdersService extends QueryService<PurchaseOrder, PurchaseOrderViewModel> {
|
||||
|
||||
}
|
||||
|
||||
156
client/src/main/java/com/ecep/contract/service/QueryService.java
Normal file
156
client/src/main/java/com/ecep/contract/service/QueryService.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import com.ecep.contract.WebSocketService;
|
||||
import com.ecep.contract.model.IdentityEntity;
|
||||
import com.ecep.contract.msg.SimpleMessage;
|
||||
import com.ecep.contract.vm.IdentityViewModel;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel<T>>
|
||||
implements ViewModelService<T, TV> {
|
||||
@Autowired
|
||||
protected WebSocketService webSocketService;
|
||||
@Autowired
|
||||
protected ObjectMapper objectMapper;
|
||||
private long readTimeout = 30000;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public TV createNewViewModel() {
|
||||
try {
|
||||
Type genericSuperclass = getClass().getGenericSuperclass();
|
||||
System.out.println("genericSuperclass = " + genericSuperclass.getClass());
|
||||
|
||||
String typeName = genericSuperclass.getTypeName();
|
||||
// System.out.println("typeName = " + typeName);
|
||||
String clz = typeName.split("<")[1].split(">")[0].split(",")[1].trim();
|
||||
// System.out.println("clz = " + clz);
|
||||
Class<?> clazz = Class.forName(clz);
|
||||
return (TV) clazz.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("无法创建ViewModel实例", e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T createNewEntity() {
|
||||
try {
|
||||
Type genericSuperclass = getClass().getGenericSuperclass();
|
||||
String typeName = genericSuperclass.getTypeName();
|
||||
// System.out.println("typeName = " + typeName);
|
||||
String clz = typeName.split("<")[1].split(">")[0].split(",")[0].trim();
|
||||
// System.out.println("clz = " + clz);
|
||||
Class<?> clazz = Class.forName(clz);
|
||||
return (T) clazz.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("无法创建Entity实例", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T save(T entity) {
|
||||
SimpleMessage msg = new SimpleMessage();
|
||||
msg.setService(getBeanName());
|
||||
msg.setMethod("save");
|
||||
msg.setArguments(entity);
|
||||
try {
|
||||
Object response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
|
||||
if (response != null) {
|
||||
objectMapper.updateValue(entity, response);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(T entity) {
|
||||
SimpleMessage msg = new SimpleMessage();
|
||||
msg.setService(getBeanName());
|
||||
msg.setMethod("delete");
|
||||
msg.setArguments(entity);
|
||||
try {
|
||||
JsonNode response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
|
||||
if (response != null) {
|
||||
objectMapper.updateValue(entity, response);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T findById(Integer id) {
|
||||
SimpleMessage msg = new SimpleMessage();
|
||||
msg.setService(getBeanName());
|
||||
msg.setMethod("findById");
|
||||
msg.setArguments(id);
|
||||
try {
|
||||
JsonNode response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
|
||||
if (response != null) {
|
||||
T newEntity = createNewEntity();
|
||||
objectMapper.updateValue(newEntity, response);
|
||||
return newEntity;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<T> findAll(Map<String, Object> params, Pageable pageable) {
|
||||
SimpleMessage msg = new SimpleMessage();
|
||||
msg.setService(getBeanName());
|
||||
msg.setMethod("findAll");
|
||||
msg.setArguments(params, pageable);
|
||||
try {
|
||||
JsonNode response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
|
||||
if (response != null) {
|
||||
|
||||
List<T> content = new ArrayList<>();
|
||||
JsonNode contentNode = response.get("content");
|
||||
if (contentNode != null && contentNode.isArray()) {
|
||||
for (JsonNode node : contentNode) {
|
||||
T newEntity = createNewEntity();
|
||||
objectMapper.updateValue(newEntity, node);
|
||||
content.add(newEntity);
|
||||
}
|
||||
}
|
||||
|
||||
JsonNode pageNode = response.get("page");
|
||||
|
||||
int total = pageNode.get("totalElements").asInt();
|
||||
int totalPages = pageNode.get("totalPages").asInt();
|
||||
int size = pageNode.get("size").asInt();
|
||||
int number = pageNode.get("number").asInt();
|
||||
|
||||
PageRequest newPageable = PageRequest.of(number, size);
|
||||
return new PageImpl<>(content, newPageable, total);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public List<T> search(String searchText) {
|
||||
Map<String, Object> params = getSpecification(searchText);
|
||||
List<T> list = findAll(params, Pageable.ofSize(10)).getContent();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.SalesOrder;
|
||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||
|
||||
public class SaleOrdersService implements ViewModelService<SalesOrder, SalesOrderViewModel> {
|
||||
@Service
|
||||
public class SaleOrdersService extends QueryService<SalesOrder, SalesOrderViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProjectSaleType;
|
||||
import com.ecep.contract.vm.ProjectSaleTypeViewModel;
|
||||
|
||||
public class SaleTypeService implements ViewModelService<ProjectSaleType, ProjectSaleTypeViewModel> {
|
||||
@Service
|
||||
public class SaleTypeService extends QueryService<ProjectSaleType, ProjectSaleTypeViewModel> {
|
||||
|
||||
public ProjectSaleType findByName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.SalesBillVoucher;
|
||||
import com.ecep.contract.vm.SalesBillVoucherViewModel;
|
||||
|
||||
public class SalesBillVoucherService implements ViewModelService<SalesBillVoucher, SalesBillVoucherViewModel> {
|
||||
@Service
|
||||
public class SalesBillVoucherService extends QueryService<SalesBillVoucher, SalesBillVoucherViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.SalesOrderItem;
|
||||
import com.ecep.contract.vm.SalesOrderItemViewModel;
|
||||
|
||||
public class SalesOrderItemService implements ViewModelService<SalesOrderItem, SalesOrderItemViewModel> {
|
||||
@Service
|
||||
public class SalesOrderItemService extends QueryService<SalesOrderItem, SalesOrderItemViewModel> {
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.SysConf;
|
||||
|
||||
@Service
|
||||
public class SysConfService {
|
||||
|
||||
public SysConf findById(String id) {
|
||||
|
||||
@@ -2,15 +2,18 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.VendorGroupRequireFileType;
|
||||
import com.ecep.contract.vm.VendorGroupRequireFileTypeViewModel;
|
||||
|
||||
@Service
|
||||
public class VendorGroupRequireFileTypeService
|
||||
implements ViewModelService<VendorGroupRequireFileType, VendorGroupRequireFileTypeViewModel> {
|
||||
extends QueryService<VendorGroupRequireFileType, VendorGroupRequireFileTypeViewModel> {
|
||||
|
||||
public List<VendorGroupRequireFileType> findByGroupId(Integer id) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByGroupId'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.VendorGroup;
|
||||
import com.ecep.contract.vm.VendorGroupViewModel;
|
||||
|
||||
public class VendorGroupService implements ViewModelService<VendorGroup, VendorGroupViewModel> {
|
||||
@Service
|
||||
public class VendorGroupService extends QueryService<VendorGroup, VendorGroupViewModel> {
|
||||
|
||||
public VendorGroup newInstance() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -15,14 +16,27 @@ import com.ecep.contract.vm.IdentityViewModel;
|
||||
/**
|
||||
* 视图模型服务接口
|
||||
*
|
||||
* @param <T> 实体类型
|
||||
* @param <TV> 视图模型类型
|
||||
* @author 2025-08-02
|
||||
* @pahor 2025-08-02
|
||||
*/
|
||||
public interface ViewModelService<T extends IdentityEntity, TV extends IdentityViewModel<T>>
|
||||
extends IEntityService<T> {
|
||||
|
||||
// <ID, R extends MyRepository<T, ID>> R getRepository();
|
||||
default String getBeanName() {
|
||||
String className = getClass().getSimpleName();
|
||||
// 按照Spring默认的bean命名规则转换
|
||||
// 1. 如果类名长度大于1且首两个字符都是大写,则不转换
|
||||
// 2. 否则,将首字母转为小写,其余部分保持不变
|
||||
if (className.length() > 1 && Character.isUpperCase(className.charAt(0))
|
||||
&& Character.isUpperCase(className.charAt(1))) {
|
||||
return className;
|
||||
}
|
||||
// 将首字母转为小写
|
||||
if (className.length() > 0) {
|
||||
className = Character.toLowerCase(className.charAt(0)) + className.substring(1);
|
||||
}
|
||||
return className;
|
||||
}
|
||||
|
||||
default T findById(Integer id) {
|
||||
return null;
|
||||
@@ -74,7 +88,6 @@ public interface ViewModelService<T extends IdentityEntity, TV extends IdentityV
|
||||
|
||||
@Override
|
||||
default T save(T entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'save'");
|
||||
}
|
||||
|
||||
@@ -85,8 +98,7 @@ public interface ViewModelService<T extends IdentityEntity, TV extends IdentityV
|
||||
|
||||
@Override
|
||||
default List<T> findAll() {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
return findAll(null, Pageable.unpaged()).getContent();
|
||||
}
|
||||
|
||||
default Page<T> findAll(Map<String, Object> params, Pageable pageable) {
|
||||
@@ -94,7 +106,7 @@ public interface ViewModelService<T extends IdentityEntity, TV extends IdentityV
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
|
||||
}
|
||||
|
||||
default long count(Map<String, Object> params) {
|
||||
default long count(Map<String, Object> params) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'count'");
|
||||
}
|
||||
@@ -105,5 +117,4 @@ public interface ViewModelService<T extends IdentityEntity, TV extends IdentityV
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.controlsfx.control.TaskProgressView;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.Desktop;
|
||||
import com.ecep.contract.model.CloudYu;
|
||||
@@ -16,7 +17,8 @@ import com.ecep.contract.vm.CloudYuInfoViewModel;
|
||||
|
||||
import javafx.concurrent.Task;
|
||||
|
||||
public class YongYouU8Service implements ViewModelService<CloudYu, CloudYuInfoViewModel> {
|
||||
@Service
|
||||
public class YongYouU8Service extends QueryService<CloudYu, CloudYuInfoViewModel> {
|
||||
|
||||
/**
|
||||
* 生成定时同步任务
|
||||
@@ -51,4 +53,5 @@ public class YongYouU8Service implements ViewModelService<CloudYu, CloudYuInfoVi
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getOrCreateCloudYu'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user