feat: 新增多个服务类及工具类,重构部分代码结构
重构服务类结构,将分散的服务统一整合到service包下 新增ProjectConstant常量类及多个实体服务类 添加SecurityUtils安全工具类和BeanCacher工具类 优化部分UI控件和转换器的实现
This commit is contained in:
@@ -19,11 +19,9 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.Desktop;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.ds.project.ProjectCostImportItemsFromContractsTasker;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
import com.ecep.contract.model.CompanyCustomerFile;
|
||||
@@ -42,7 +40,9 @@ import com.ecep.contract.model.ProjectSaleType;
|
||||
import com.ecep.contract.model.ProjectSaleTypeRequireFileType;
|
||||
import com.ecep.contract.model.VendorGroup;
|
||||
import com.ecep.contract.model.VendorGroupRequireFileType;
|
||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||
import com.ecep.contract.service.CompanyCustomerService;
|
||||
import com.ecep.contract.service.CompanyExtendInfoService;
|
||||
import com.ecep.contract.service.CompanyFileService;
|
||||
import com.ecep.contract.service.CompanyService;
|
||||
import com.ecep.contract.service.CompanyVendorService;
|
||||
@@ -310,26 +310,21 @@ public class ContractVerifyComm {
|
||||
holder.debug("公司设定不做校验");
|
||||
} else {
|
||||
if (verifyCompanyPath.get()) {
|
||||
if (!CompanyFileUtils.exists(company.getPath())) {
|
||||
if (!getCompanyService().existsCompanyPath(company)) {
|
||||
holder.error("公司目录未设置");
|
||||
} else {
|
||||
File basePath = getCompanyService().getBasePath();
|
||||
if (!company.getPath().startsWith(basePath.getAbsolutePath())) {
|
||||
if (!getCompanyService().checkCompanyPathInBasePath(company)) {
|
||||
holder.error("公司目录未在规定目录下");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (verifyCompanyStatus.get()) {
|
||||
getCompanyService().verifyEnterpriseStatus(company, setupDate, msg -> {
|
||||
holder.error(company.getName() + ":" + msg);
|
||||
});
|
||||
getCompanyService().verifyEnterpriseStatus(company, setupDate, holder);
|
||||
}
|
||||
|
||||
if (verifyCompanyCredit.get()) {
|
||||
getCompanyFileService().verify(company, contract.getSetupDate(), msg -> {
|
||||
holder.error(company.getName() + ":" + msg);
|
||||
});
|
||||
getCompanyFileService().verify(company, contract.getSetupDate(), holder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,14 +335,14 @@ public class ContractVerifyComm {
|
||||
verifyAsCustomer(company, companyExtendInfo, contract, holder);
|
||||
|
||||
// 销售合同下的采购合同
|
||||
List<Contract> list = getContractService().findAllByParent(contract);
|
||||
List<Contract> list = getContractService().findAllBySaleContract(contract);
|
||||
if (!list.isEmpty()) {
|
||||
for (Contract v : list) {
|
||||
MessageHolder subHolder = holder.sub(v.getCode() + " -> ");
|
||||
subHolder.info("采购合同 : " + v.getName());
|
||||
verify(v, subHolder);
|
||||
if (CompanyFileUtils.exists(v.getPath())) {
|
||||
if (!v.getPath().startsWith(contract.getPath())) {
|
||||
if (getContractService().existsContractPath(v)) {
|
||||
if (!getContractService().checkContractPathInBasePath(v)) {
|
||||
holder.error("合同目录未在规定目录下");
|
||||
}
|
||||
} else {
|
||||
@@ -562,7 +557,7 @@ public class ContractVerifyComm {
|
||||
|
||||
ProjectSaleType saleType = project.getSaleType();
|
||||
if (saleType != null) {
|
||||
if (CompanyFileUtils.exists(contract.getPath())) {
|
||||
if (getContractService().existsContractPath(contract)) {
|
||||
if (!Hibernate.isInitialized(saleType)) {
|
||||
saleType = getSaleTypeService().findById(saleType.getId());
|
||||
project.setSaleType(saleType);
|
||||
@@ -751,12 +746,8 @@ public class ContractVerifyComm {
|
||||
}
|
||||
|
||||
if (needImport && !autoCost.isImportLock()) {
|
||||
ProjectCostImportItemsFromContractsTasker tasker = new ProjectCostImportItemsFromContractsTasker();
|
||||
tasker.setCost(autoCost);
|
||||
tasker.setCurrentUser(() -> getEmployeeService().findById(Desktop.instance.getActiveEmployeeId()));
|
||||
autoCost.setApplyTime(LocalDateTime.now());
|
||||
holder.debug("更新V0项目成本");
|
||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(tasker);
|
||||
getProjectCostService().updateAutoCost(project, holder);
|
||||
}
|
||||
|
||||
// 检查最新的项目成本,默认 V1
|
||||
|
||||
Reference in New Issue
Block a user