UP
This commit is contained in:
@@ -19,13 +19,11 @@ import lombok.Setter;
|
||||
public class CloudRkSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CloudRkSyncTask.class);
|
||||
|
||||
@Setter
|
||||
private CompanyVo company;
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle(String.format("集团相关方平台同步任务[%s]", company.getName()));
|
||||
return callRemoteTask(holder, getLocale(), company.getId());
|
||||
updateTitle("集团相关方平台同步任务");
|
||||
return callRemoteTask(holder, getLocale());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.ecep.contract.task;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 客户文件重建任务类
|
||||
* 用于通过WebSocket与服务器通信,重建客户相关文件
|
||||
*/
|
||||
public class CompanyCustomerRebuildFilesTasker extends Tasker<Object> implements WebSocketClientTasker {
|
||||
@Getter
|
||||
@Setter
|
||||
private CompanyCustomerVo companyCustomer;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
protected boolean filesUpdated = false;
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "CompanyCustomerRebuildFilesTasker";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long current, long total) {
|
||||
super.updateProgress(current, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("重建客户文件");
|
||||
return callRemoteTask(holder, getLocale(), companyCustomer.getId());
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.task;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.service.CloudRkService;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
import lombok.Setter;
|
||||
@@ -23,7 +24,7 @@ public class CompanyRkUpdateTasker extends Tasker<Object> implements WebSocketCl
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("合并更新 " + company.getName());
|
||||
updateTitle("从 集团相关方平台 拉取数据更新 " + company.getName() + " 企业信息");
|
||||
return callRemoteTask(holder, getLocale(), company.getId());
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,32 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.vo.VendorVo;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 更新供应商评价表
|
||||
*/
|
||||
public class CompanyVendorEvaluationFormUpdateTask extends Tasker<Object> {
|
||||
public class CompanyVendorEvaluationFormUpdateTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CompanyVendorEvaluationFormUpdateTask.class);
|
||||
@Setter
|
||||
private VendorVo vendor;
|
||||
|
||||
@Override
|
||||
public void updateProgress(long current, long total) {
|
||||
super.updateProgress(current, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "CompanyVendorEvaluationFormUpdateTask";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("更新供应商评价表");
|
||||
return null;
|
||||
return callRemoteTask(holder, getLocale(), vendor.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ import com.ecep.contract.*;
|
||||
import com.ecep.contract.controller.project.cost.ProjectCostImportItemsFromContractsTasker;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
import com.ecep.contract.service.*;
|
||||
import com.ecep.contract.util.ContextUtils;
|
||||
import com.ecep.contract.vo.*;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.ObservableMap;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -20,173 +22,101 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class ContractVerifyComm {
|
||||
// Project
|
||||
private ProjectService projectService;
|
||||
private ProjectSaleTypeRequireFileTypeService saleTypeRequireFileTypeService;
|
||||
private ProjectSaleTypeService saleTypeService;
|
||||
private ProjectCostService projectCostService;
|
||||
private ProjectQuotationService projectQuotationService;
|
||||
private ProjectBidService projectBidService;
|
||||
// Contract
|
||||
private ContractService contractService;
|
||||
private ContractFileService contractFileService;
|
||||
private ContractFileTypeService contractFileTypeService;
|
||||
private ContractBidVendorService contractBidVendorService;
|
||||
public class ContractVerifyComm implements ContextUtils {
|
||||
ContextUtils parent;
|
||||
|
||||
// Company
|
||||
private CompanyService companyService;
|
||||
private CompanyFileService companyFileService;
|
||||
// Vendor
|
||||
private VendorService vendorService;
|
||||
private VendorGroupService vendorGroupService;
|
||||
private VendorGroupRequireFileTypeService vendorGroupRequireFileTypeService;
|
||||
private ExtendVendorInfoService extendVendorInfoService;
|
||||
// Customer
|
||||
private CompanyCustomerService companyCustomerService;
|
||||
private CompanyCustomerFileService companyCustomerFileService;
|
||||
private CompanyExtendInfoService companyExtendInfoService;
|
||||
// Employee
|
||||
private EmployeeService employeeService;
|
||||
public ContractVerifyComm(ContextUtils parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getBean(Class<T> requiredType) throws BeansException {
|
||||
return parent.getBean(requiredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCachedBean(Class<T> requiredType) throws BeansException {
|
||||
return parent.getCachedBean(requiredType);
|
||||
}
|
||||
|
||||
private ProjectService getProjectService() {
|
||||
if (projectService == null) {
|
||||
projectService = SpringApp.getBean(ProjectService.class);
|
||||
}
|
||||
return projectService;
|
||||
return getCachedBean(ProjectService.class);
|
||||
}
|
||||
|
||||
private ProjectSaleTypeService getSaleTypeService() {
|
||||
if (saleTypeService == null) {
|
||||
saleTypeService = SpringApp.getBean(ProjectSaleTypeService.class);
|
||||
}
|
||||
return saleTypeService;
|
||||
return getCachedBean(ProjectSaleTypeService.class);
|
||||
}
|
||||
|
||||
ProjectCostService getProjectCostService() {
|
||||
if (projectCostService == null) {
|
||||
projectCostService = SpringApp.getBean(ProjectCostService.class);
|
||||
}
|
||||
return projectCostService;
|
||||
private ProjectCostService getProjectCostService() {
|
||||
return getCachedBean(ProjectCostService.class);
|
||||
}
|
||||
|
||||
ProjectQuotationService getProjectQuotationService() {
|
||||
if (projectQuotationService == null) {
|
||||
projectQuotationService = SpringApp.getBean(ProjectQuotationService.class);
|
||||
}
|
||||
return projectQuotationService;
|
||||
private ProjectQuotationService getProjectQuotationService() {
|
||||
return getCachedBean(ProjectQuotationService.class);
|
||||
}
|
||||
|
||||
ProjectBidService getProjectBidService() {
|
||||
if (projectBidService == null) {
|
||||
projectBidService = SpringApp.getBean(ProjectBidService.class);
|
||||
}
|
||||
return projectBidService;
|
||||
private ProjectBidService getProjectBidService() {
|
||||
return getCachedBean(ProjectBidService.class);
|
||||
}
|
||||
|
||||
private ProjectSaleTypeRequireFileTypeService getSaleTypeRequireFileTypeService() {
|
||||
if (saleTypeRequireFileTypeService == null) {
|
||||
saleTypeRequireFileTypeService = SpringApp.getBean(ProjectSaleTypeRequireFileTypeService.class);
|
||||
}
|
||||
return saleTypeRequireFileTypeService;
|
||||
return getCachedBean(ProjectSaleTypeRequireFileTypeService.class);
|
||||
}
|
||||
|
||||
public ContractService getContractService() {
|
||||
if (contractService == null) {
|
||||
contractService = SpringApp.getBean(ContractService.class);
|
||||
}
|
||||
return contractService;
|
||||
return getCachedBean(ContractService.class);
|
||||
}
|
||||
|
||||
private ContractFileService getContractFileService() {
|
||||
if (contractFileService == null) {
|
||||
contractFileService = SpringApp.getBean(ContractFileService.class);
|
||||
}
|
||||
return contractFileService;
|
||||
return getCachedBean(ContractFileService.class);
|
||||
}
|
||||
|
||||
private ContractFileTypeService getContractFileTypeService() {
|
||||
if (contractFileTypeService == null) {
|
||||
contractFileTypeService = SpringApp.getBean(ContractFileTypeService.class);
|
||||
}
|
||||
return contractFileTypeService;
|
||||
return getCachedBean(ContractFileTypeService.class);
|
||||
}
|
||||
|
||||
private ContractBidVendorService getContractBidVendorService() {
|
||||
if (contractBidVendorService == null) {
|
||||
contractBidVendorService = SpringApp.getBean(ContractBidVendorService.class);
|
||||
}
|
||||
return contractBidVendorService;
|
||||
return getCachedBean(ContractBidVendorService.class);
|
||||
}
|
||||
|
||||
private CompanyService getCompanyService() {
|
||||
if (companyService == null) {
|
||||
companyService = SpringApp.getBean(CompanyService.class);
|
||||
}
|
||||
return companyService;
|
||||
return getBean(CompanyService.class);
|
||||
}
|
||||
|
||||
private CompanyFileService getCompanyFileService() {
|
||||
if (companyFileService == null) {
|
||||
companyFileService = SpringApp.getBean(CompanyFileService.class);
|
||||
}
|
||||
return companyFileService;
|
||||
return getCachedBean(CompanyFileService.class);
|
||||
}
|
||||
|
||||
private VendorGroupService getVendorGroupService() {
|
||||
if (vendorGroupService == null) {
|
||||
vendorGroupService = SpringApp.getBean(VendorGroupService.class);
|
||||
}
|
||||
return vendorGroupService;
|
||||
return getCachedBean(VendorGroupService.class);
|
||||
}
|
||||
|
||||
private VendorGroupRequireFileTypeService getVendorGroupRequireFileTypeService() {
|
||||
if (vendorGroupRequireFileTypeService == null) {
|
||||
vendorGroupRequireFileTypeService = SpringApp.getBean(VendorGroupRequireFileTypeService.class);
|
||||
}
|
||||
return vendorGroupRequireFileTypeService;
|
||||
return getCachedBean(VendorGroupRequireFileTypeService.class);
|
||||
}
|
||||
|
||||
private ExtendVendorInfoService getExtendVendorInfoService() {
|
||||
if (extendVendorInfoService == null) {
|
||||
extendVendorInfoService = SpringApp.getBean(ExtendVendorInfoService.class);
|
||||
}
|
||||
return extendVendorInfoService;
|
||||
return getCachedBean(ExtendVendorInfoService.class);
|
||||
}
|
||||
|
||||
private VendorService getVendorService() {
|
||||
if (vendorService == null) {
|
||||
vendorService = SpringApp.getBean(VendorService.class);
|
||||
}
|
||||
return vendorService;
|
||||
return getCachedBean(VendorService.class);
|
||||
}
|
||||
|
||||
private CompanyCustomerService getCompanyCustomerService() {
|
||||
if (companyCustomerService == null) {
|
||||
companyCustomerService = SpringApp.getBean(CompanyCustomerService.class);
|
||||
}
|
||||
return companyCustomerService;
|
||||
private CustomerService getCompanyCustomerService() {
|
||||
return getCachedBean(CustomerService.class);
|
||||
}
|
||||
|
||||
private CompanyCustomerFileService getCompanyCustomerFileService() {
|
||||
if (companyCustomerFileService == null) {
|
||||
companyCustomerFileService = SpringApp.getBean(CompanyCustomerFileService.class);
|
||||
}
|
||||
return companyCustomerFileService;
|
||||
return getCachedBean(CompanyCustomerFileService.class);
|
||||
}
|
||||
|
||||
private CompanyExtendInfoService getCompanyExtendInfoService() {
|
||||
if (companyExtendInfoService == null) {
|
||||
companyExtendInfoService = SpringApp.getBean(CompanyExtendInfoService.class);
|
||||
}
|
||||
return companyExtendInfoService;
|
||||
return getCachedBean(CompanyExtendInfoService.class);
|
||||
}
|
||||
|
||||
private EmployeeService getEmployeeService() {
|
||||
if (employeeService == null) {
|
||||
employeeService = SpringApp.getBean(EmployeeService.class);
|
||||
}
|
||||
return employeeService;
|
||||
return getCachedBean(EmployeeService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,6 +319,7 @@ public class ContractVerifyComm {
|
||||
}
|
||||
}
|
||||
if (verifyVendor.get()) {
|
||||
|
||||
getVendorService().verify(contract, holder);
|
||||
}
|
||||
|
||||
@@ -581,7 +512,7 @@ public class ContractVerifyComm {
|
||||
valid = false;
|
||||
}
|
||||
|
||||
CompanyCustomerVo companyCustomer = getCompanyCustomerService().findByCompany(company);
|
||||
CustomerVo companyCustomer = getCompanyCustomerService().findByCompany(company);
|
||||
if (companyCustomer == null) {
|
||||
holder.warn("合同未关联客户");
|
||||
valid = false;
|
||||
@@ -602,7 +533,7 @@ public class ContractVerifyComm {
|
||||
return valid;
|
||||
}
|
||||
|
||||
private boolean verifyCustomerFileByContract(CompanyCustomerVo companyCustomer, ContractVo contract,
|
||||
private boolean verifyCustomerFileByContract(CustomerVo companyCustomer, ContractVo contract,
|
||||
MessageHolder holder) {
|
||||
List<LocalDate> verifyDates = new ArrayList<>();
|
||||
LocalDate minDate = LocalDate.of(2022, 1, 1);
|
||||
@@ -655,14 +586,14 @@ public class ContractVerifyComm {
|
||||
}
|
||||
|
||||
// 客户
|
||||
List<CompanyCustomerFileVo> files = getCompanyCustomerFileService().findAllByCustomer(companyCustomer);
|
||||
List<CustomerFileVo> files = getCompanyCustomerFileService().findAllByCustomer(companyCustomer);
|
||||
if (files == null || files.isEmpty()) {
|
||||
holder.warn("未见客户评估表");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (LocalDate verifyDate : verifyDates) {
|
||||
CompanyCustomerFileVo customerFile = files.stream()
|
||||
CustomerFileVo customerFile = files.stream()
|
||||
.filter(v -> v.getSignDate() != null && v.isValid())
|
||||
.filter(v -> v.getType() == CustomerFileType.EvaluationForm)
|
||||
.filter(v -> MyDateTimeUtils.dateValidFilter(verifyDate, v.getSignDate(),
|
||||
@@ -673,10 +604,10 @@ public class ContractVerifyComm {
|
||||
}
|
||||
}
|
||||
|
||||
CompanyCustomerFileVo latestFile = files.stream()
|
||||
CustomerFileVo latestFile = files.stream()
|
||||
.filter(v -> v.getSignDate() != null && v.isValid())
|
||||
.filter(v -> v.getType() == CustomerFileType.EvaluationForm)
|
||||
.max(Comparator.comparing(CompanyCustomerFileVo::getSignDate))
|
||||
.max(Comparator.comparing(CustomerFileVo::getSignDate))
|
||||
.orElse(null);
|
||||
|
||||
if (latestFile == null) {
|
||||
|
||||
@@ -1,4 +1,55 @@
|
||||
package com.ecep.contract.task;
|
||||
|
||||
public class VendorReBuildFilesTasker {
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.vo.VendorVo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 供应商文件重建任务器客户端实现
|
||||
* 用于通过WebSocket与服务器通信,重建供应商相关文件
|
||||
*/
|
||||
public class VendorReBuildFilesTasker extends Tasker<Object> implements WebSocketClientTasker {
|
||||
private static final Logger logger = LoggerFactory.getLogger(VendorReBuildFilesTasker.class);
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private VendorVo vendor;
|
||||
|
||||
@Getter
|
||||
protected boolean modified = false;
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "VendorReBuildFilesTasker";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long current, long total) {
|
||||
super.updateProgress(current, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("重建供应商文件");
|
||||
if (vendor == null) {
|
||||
holder.addMessage(java.util.logging.Level.SEVERE, "供应商信息不能为空");
|
||||
return null;
|
||||
}
|
||||
return callRemoteTask(holder, getLocale(), vendor.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理从服务器返回的修改状态
|
||||
* 当服务器端更新此属性时,客户端会接收到更新
|
||||
*
|
||||
* @param modified 文件是否被修改
|
||||
*/
|
||||
public void setModified(boolean modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user