refactor: 重构供应商文件类型枚举及相关服务
feat: 为多个服务添加缓存支持 fix: 修复WebSocket任务管理和远程调用异常处理 refactor: 重命名CompanyVendorFileType为VendorFileType refactor: 优化项目成本导入任务实现 fix: 修复ContractTabSkinBase中的空指针问题 refactor: 统一WebSocket客户端任务调用接口
This commit is contained in:
@@ -13,6 +13,7 @@ import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ecep.contract.controller.project.cost.ProjectCostImportItemsFromContractsTasker;
|
||||
import com.ecep.contract.util.ProxyUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -731,15 +732,16 @@ public class ContractVerifyComm {
|
||||
//
|
||||
boolean needImport = false;
|
||||
|
||||
ProjectCost autoCost = getProjectCostService().findAutoCostByProject(project);
|
||||
ProjectCostService projectCostService = getProjectCostService();
|
||||
ProjectCost autoCost = projectCostService.findAutoCostByProject(project);
|
||||
if (autoCost == null) {
|
||||
// 创建 V0 项目成本
|
||||
ProjectCost cost = getProjectCostService().newInstanceByProject(project);
|
||||
ProjectCost cost = projectCostService.newInstanceByProject(project);
|
||||
cost.setVersion(0);
|
||||
cost.setApplicant(getEmployeeService().findById(EmployeeService.DEFAULT_SYSTEM_EMPLOYEE_ID));
|
||||
cost.setApplyTime(LocalDateTime.now());
|
||||
cost.setDescription("自动导入");
|
||||
autoCost = getProjectCostService().save(cost);
|
||||
autoCost = projectCostService.save(cost);
|
||||
needImport = true;
|
||||
} else {
|
||||
// 检查 V0 项目成本
|
||||
@@ -754,13 +756,21 @@ public class ContractVerifyComm {
|
||||
|
||||
if (needImport && !autoCost.isImportLock()) {
|
||||
holder.debug("更新V0项目成本");
|
||||
getProjectCostService().updateAutoCost(project, holder);
|
||||
ProjectCost cost = projectCostService.findAutoCostByProject(project);
|
||||
if (cost == null) {
|
||||
cost = projectCostService.newInstanceByProject(project);
|
||||
cost.setVersion(0);
|
||||
cost = projectCostService.save(cost);
|
||||
}
|
||||
ProjectCostImportItemsFromContractsTasker tasker = new ProjectCostImportItemsFromContractsTasker();
|
||||
tasker.setCost(cost);
|
||||
|
||||
}
|
||||
|
||||
// 检查最新的项目成本,默认 V1
|
||||
ProjectCost latestCost = getProjectCostService().findLatestByProject(project);
|
||||
ProjectCost latestCost = projectCostService.findLatestByProject(project);
|
||||
if (latestCost == null) {
|
||||
ProjectCost cost = getProjectCostService().newInstanceByProject(project);
|
||||
ProjectCost cost = projectCostService.newInstanceByProject(project);
|
||||
cost.setVersion(1);
|
||||
Employee applicant = project.getApplicant();
|
||||
if (applicant == null) {
|
||||
@@ -768,7 +778,7 @@ public class ContractVerifyComm {
|
||||
}
|
||||
cost.setApplicant(applicant);
|
||||
cost.setApplyTime(project.getCreated().atTime(LocalTime.now()));
|
||||
latestCost = getProjectCostService().save(cost);
|
||||
latestCost = projectCostService.save(cost);
|
||||
} else {
|
||||
//
|
||||
if (latestCost.getGrossProfitMargin() <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user