refactor: 移除Hibernate依赖并重构代理对象初始化检查逻辑
feat(controller): 新增多个任务类用于合同和客户相关操作 feat(service): 新增ProxyUtils工具类替代Hibernate.isInitialized检查 refactor(controller): 重构多个控制器和皮肤类,使用ProxyUtils替代Hibernate refactor(service): 重构服务类,移除Hibernate依赖并优化方法实现 fix(controller): 修复表格单元格初始化逻辑,确保代理对象正确加载 chore: 更新项目版本号至0.0.58-SNAPSHOT docs: 添加MyProperties类用于管理下载路径配置
This commit is contained in:
@@ -13,7 +13,6 @@ import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
@@ -286,9 +285,7 @@ public class ContractVerifyComm {
|
||||
holder.error("未关联企业");
|
||||
return;
|
||||
}
|
||||
if (!Hibernate.isInitialized(company)) {
|
||||
company = getCompanyService().findById(company.getId());
|
||||
}
|
||||
company = getCompanyService().findById(company.getId());
|
||||
verify(company, contract, holder);
|
||||
}
|
||||
|
||||
@@ -395,10 +392,8 @@ public class ContractVerifyComm {
|
||||
}
|
||||
|
||||
if (group != null) {
|
||||
if (!Hibernate.isInitialized(group)) {
|
||||
group = getVendorGroupService().findById(group.getId());
|
||||
vendorInfo.setGroup(group);
|
||||
}
|
||||
group = getVendorGroupService().findById(group.getId());
|
||||
vendorInfo.setGroup(group);
|
||||
}
|
||||
if (verifyCustomerSubContractDate.get()) {
|
||||
// 检查子合同日期是否在销售合同之后
|
||||
@@ -470,9 +465,7 @@ public class ContractVerifyComm {
|
||||
loseFile = true;
|
||||
}
|
||||
} else {
|
||||
if (!Hibernate.isInitialized(contractFile)) {
|
||||
contractFile = getContractFileService().findById(contractFile.getId());
|
||||
}
|
||||
contractFile = getContractFileService().findById(contractFile.getId());
|
||||
ContractFileType type = contractFile.getType();
|
||||
if (type != ContractFileType.QuotationSheet) {
|
||||
holder.error("供应商比价:" + contractFile.getFileName() + " 报价表记录异常,类型错误");
|
||||
@@ -543,12 +536,9 @@ public class ContractVerifyComm {
|
||||
}
|
||||
}
|
||||
if (project != null) {
|
||||
if (!Hibernate.isInitialized(project)) {
|
||||
project = getProjectService().findById(project.getId());
|
||||
// fixed
|
||||
contract.setProject(project);
|
||||
}
|
||||
|
||||
project = getProjectService().findById(project.getId());
|
||||
// fixed
|
||||
contract.setProject(project);
|
||||
}
|
||||
|
||||
if (project != null) {
|
||||
@@ -558,10 +548,8 @@ public class ContractVerifyComm {
|
||||
ProjectSaleType saleType = project.getSaleType();
|
||||
if (saleType != null) {
|
||||
if (getContractService().existsContractPath(contract)) {
|
||||
if (!Hibernate.isInitialized(saleType)) {
|
||||
saleType = getSaleTypeService().findById(saleType.getId());
|
||||
project.setSaleType(saleType);
|
||||
}
|
||||
saleType = getSaleTypeService().findById(saleType.getId());
|
||||
project.setSaleType(saleType);
|
||||
if (!contract.getPath().startsWith(saleType.getPath())) {
|
||||
holder.error("合同目录未在销售类型目录下");
|
||||
}
|
||||
@@ -831,9 +819,7 @@ public class ContractVerifyComm {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Hibernate.isInitialized(saleType)) {
|
||||
saleType = getSaleTypeService().findById(saleType.getId());
|
||||
}
|
||||
saleType = getSaleTypeService().findById(saleType.getId());
|
||||
if (saleType.isCriticalProjectDecision()) {
|
||||
if (contract.getAmount() != null && contract.getAmount() >= saleType.getCriticalProjectLimit()) {
|
||||
holder.debug("合同金额 " + contract.getAmount() + " 超过 " + saleType.getCriticalProjectLimit());
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.Message;
|
||||
@@ -95,9 +94,7 @@ public class ContractVerifyResultExportAsExcelFileTasker extends Tasker<Object>
|
||||
List<ContractVerifyWindowController.Model> list = entry.getValue();
|
||||
|
||||
//
|
||||
if (!Hibernate.isInitialized(employee)) {
|
||||
employee = getEmployeeService().findById(employee.getId());
|
||||
}
|
||||
employee = getEmployeeService().findById(employee.getId());
|
||||
holder.info("- " + employee.getName());
|
||||
// 创建工作表
|
||||
String sheetName = employee.getName();
|
||||
|
||||
Reference in New Issue
Block a user