feat: 添加VendorGroupRequireFileTypeVo及相关服务功能
refactor: 重构多个服务类和方法,优化代码结构 fix: 修复PermissionVo中code字段更名为key的问题 docs: 更新create_vo.md文档,添加新创建的VO记录 perf: 优化WebSocketClientService中的session关闭逻辑 style: 清理无用导入和注释,统一代码格式
This commit is contained in:
@@ -330,7 +330,7 @@ public class WebSocketClientService {
|
|||||||
public void closeSession(WebSocketClientSession session) {
|
public void closeSession(WebSocketClientSession session) {
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
sessions.remove(session.getSessionId());
|
sessions.remove(session.getSessionId());
|
||||||
session.close();
|
// session.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
package com.ecep.contract.controller.customer;
|
package com.ecep.contract.controller.customer;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import static com.ecep.contract.util.ExcelUtils.setCellValue;
|
||||||
import com.ecep.contract.MyDateTimeUtils;
|
|
||||||
import com.ecep.contract.vo.CompanyCustomerVo;
|
import java.io.File;
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import java.io.FileInputStream;
|
||||||
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
import java.io.FileNotFoundException;
|
||||||
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
import java.io.FileOutputStream;
|
||||||
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
import java.io.InputStream;
|
||||||
import com.ecep.contract.service.CompanyCustomerEntityService;
|
import java.io.OutputStream;
|
||||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
import java.time.LocalDate;
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import java.time.LocalDateTime;
|
||||||
import com.ecep.contract.task.Tasker;
|
import java.util.Comparator;
|
||||||
import com.ecep.contract.util.UITools;
|
import java.util.List;
|
||||||
import lombok.Setter;
|
|
||||||
import org.apache.poi.ss.SpreadsheetVersion;
|
import org.apache.poi.ss.SpreadsheetVersion;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.PrintSetup;
|
||||||
|
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.ss.usermodel.WorkbookFactory;
|
||||||
import org.apache.poi.ss.util.AreaReference;
|
import org.apache.poi.ss.util.AreaReference;
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||||
@@ -24,13 +29,22 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import com.ecep.contract.MessageHolder;
|
||||||
import java.time.LocalDate;
|
import com.ecep.contract.MyDateTimeUtils;
|
||||||
import java.time.LocalDateTime;
|
import com.ecep.contract.service.CompanyCustomerEntityService;
|
||||||
import java.util.Comparator;
|
import com.ecep.contract.service.CompanyCustomerEvaluationFormFileService;
|
||||||
import java.util.List;
|
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||||
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
|
import com.ecep.contract.task.Tasker;
|
||||||
|
import com.ecep.contract.util.ExcelUtils;
|
||||||
|
import com.ecep.contract.util.UITools;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
|
||||||
import static com.ecep.contract.util.ExcelUtils.*;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(CompanyCustomerExportExcelTasker.class);
|
private static final Logger logger = LoggerFactory.getLogger(CompanyCustomerExportExcelTasker.class);
|
||||||
@@ -41,6 +55,7 @@ public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
|||||||
CompanyCustomerService customerService;
|
CompanyCustomerService customerService;
|
||||||
CompanyCustomerEntityService customerEntityService;
|
CompanyCustomerEntityService customerEntityService;
|
||||||
CompanyCustomerFileService customerFileService;
|
CompanyCustomerFileService customerFileService;
|
||||||
|
CompanyCustomerEvaluationFormFileService customerEvaluationFormFileService;
|
||||||
|
|
||||||
CompanyCustomerService getCustomerService() {
|
CompanyCustomerService getCustomerService() {
|
||||||
if (customerService == null)
|
if (customerService == null)
|
||||||
@@ -60,6 +75,12 @@ public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
|||||||
return customerEntityService;
|
return customerEntityService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompanyCustomerEvaluationFormFileService getCustomerEvaluationFormFileService() {
|
||||||
|
if (customerEvaluationFormFileService == null)
|
||||||
|
customerEvaluationFormFileService = getBean(CompanyCustomerEvaluationFormFileService.class);
|
||||||
|
return customerEvaluationFormFileService;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
if (destFile.exists()) {
|
if (destFile.exists()) {
|
||||||
@@ -115,30 +136,15 @@ public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCustomerFileService()
|
CompanyCustomerFileVo customerFile = getCustomerFileService()
|
||||||
.findAllCustomerEvaluationFormFiles(customer).stream().filter(v -> {
|
.findAllByCustomer(customer).stream().filter(v -> v.isValid())
|
||||||
Integer customerFileId = v.getCustomerFile();
|
.max(Comparator.comparing(v -> v.getSignDate())).orElse(null);
|
||||||
CompanyCustomerFileVo customerFile = getCustomerFileService().findById(customerFileId);
|
|
||||||
if (customerFile == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return customerFile.isValid();
|
|
||||||
}).max(Comparator.comparing(v -> {
|
|
||||||
Integer customerFileId = v.getCustomerFile();
|
|
||||||
CompanyCustomerFileVo customerFile = getCustomerFileService().findById(customerFileId);
|
|
||||||
if (customerFile == null) {
|
|
||||||
return LocalDate.MIN;
|
|
||||||
}
|
|
||||||
return customerFile.getSignDate();
|
|
||||||
})).orElse(null);
|
|
||||||
|
|
||||||
if (evaluationFormFile == null) {
|
if (customerFile == null) {
|
||||||
holder.warn(company.getName() + " 未匹配的客户评估");
|
holder.warn(company.getName() + " 未匹配的客户评估");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyCustomerFileVo customerFile = getCustomerFileService()
|
|
||||||
.findById(evaluationFormFile.getCustomerFile());
|
|
||||||
if (devDate != null && devDate.isAfter(customerFile.getSignDate())) {
|
if (devDate != null && devDate.isAfter(customerFile.getSignDate())) {
|
||||||
holder.debug(company.getName() + " 最新评估日期早于客户开发日期,评估日期:" + customerFile.getSignDate() + ", 开发日期:"
|
holder.debug(company.getName() + " 最新评估日期早于客户开发日期,评估日期:" + customerFile.getSignDate() + ", 开发日期:"
|
||||||
+ devDate);
|
+ devDate);
|
||||||
@@ -149,12 +155,12 @@ public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
|||||||
if (rowIndex > 11) {
|
if (rowIndex > 11) {
|
||||||
// 插入行,并复制行的格式
|
// 插入行,并复制行的格式
|
||||||
sheet.shiftRows(rowIndex + 3, sheet.getLastRowNum(), 1);
|
sheet.shiftRows(rowIndex + 3, sheet.getLastRowNum(), 1);
|
||||||
Row templateRow = getRow(sheet, rowIndex + 2, true);
|
Row templateRow = ExcelUtils.getRow(sheet, rowIndex + 2, true);
|
||||||
Row newRow = getRow(sheet, rowIndex + 3, true);
|
Row newRow = ExcelUtils.getRow(sheet, rowIndex + 3, true);
|
||||||
if (templateRow != null && newRow != null) {
|
if (templateRow != null && newRow != null) {
|
||||||
for (int i = 0; i < templateRow.getLastCellNum(); i++) {
|
for (int i = 0; i < templateRow.getLastCellNum(); i++) {
|
||||||
Cell templateCell = templateRow.getCell(i);
|
Cell templateCell = templateRow.getCell(i);
|
||||||
Cell newCell = getCell(newRow, i, true);
|
Cell newCell = ExcelUtils.getCell(newRow, i, true);
|
||||||
if (templateCell != null && newCell != null) {
|
if (templateCell != null && newCell != null) {
|
||||||
newCell.setCellStyle(templateCell.getCellStyle());
|
newCell.setCellStyle(templateCell.getCellStyle());
|
||||||
}
|
}
|
||||||
@@ -162,7 +168,9 @@ public class CompanyCustomerExportExcelTasker extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row row = getRow(sheet, rowIndex + 3, true);
|
Row row = ExcelUtils.getRow(sheet, rowIndex + 3, true);
|
||||||
|
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCustomerEvaluationFormFileService()
|
||||||
|
.findByCustomerFile(customerFile);
|
||||||
|
|
||||||
setCellValue(row, 0, rowIndex);
|
setCellValue(row, 0, rowIndex);
|
||||||
setCellValue(row, 1, company.getName());
|
setCellValue(row, 1, company.getName());
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class CompanyCustomerManagerSkin
|
|||||||
@Override
|
@Override
|
||||||
public void initializeTable() {
|
public void initializeTable() {
|
||||||
controller.idColumn.setCellValueFactory(param -> param.getValue().getId());
|
controller.idColumn.setCellValueFactory(param -> param.getValue().getId());
|
||||||
controller.companyColumn.setCellValueFactory(param -> param.getValue().getCompany().getCompanyName());
|
controller.companyColumn.setCellValueFactory(param -> param.getValue().getCompany());
|
||||||
controller.companyColumn.setCellFactory(param -> new CompanyTableCell<>(getCompanyService()));
|
controller.companyColumn.setCellFactory(param -> new CompanyTableCell<>(getCompanyService()));
|
||||||
|
|
||||||
controller.developDateColumn.setCellValueFactory(param -> param.getValue().getDevelopDate());
|
controller.developDateColumn.setCellValueFactory(param -> param.getValue().getDevelopDate());
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public class CompanyCustomerTabSkinBase
|
|||||||
initializeCompanyFieldAutoCompletion(controller.companyField);
|
initializeCompanyFieldAutoCompletion(controller.companyField);
|
||||||
initializeContactFieldAutoCompletion(controller.contactField);
|
initializeContactFieldAutoCompletion(controller.contactField);
|
||||||
|
|
||||||
|
UITools.autoCompletion(controller.contactField, viewModel.getContact(), getCompanyContactService());
|
||||||
|
|
||||||
LocalDateStringConverter converter = new LocalDateStringConverter(DateTimeFormatter.ISO_LOCAL_DATE, null);
|
LocalDateStringConverter converter = new LocalDateStringConverter(DateTimeFormatter.ISO_LOCAL_DATE, null);
|
||||||
|
|
||||||
controller.developDateField.setConverter(converter);
|
controller.developDateField.setConverter(converter);
|
||||||
@@ -82,16 +84,11 @@ public class CompanyCustomerTabSkinBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeContactFieldAutoCompletion(TextField textField) {
|
private void initializeContactFieldAutoCompletion(TextField textField) {
|
||||||
EntityStringConverter<CompanyContactVo> stringConverter = new EntityStringConverter<>();
|
UITools.autoCompletion(textField, viewModel.getContact(), getCompanyContactService());
|
||||||
stringConverter.setInitialized(cc -> getCompanyContactService().findById(cc.getId()));
|
|
||||||
UITools.autoCompletion(textField, viewModel.getContact(),
|
|
||||||
p -> getCompanyContactService().searchByCompany(viewModel.getCompany().get(), p.getUserText()),
|
|
||||||
stringConverter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeCompanyFieldAutoCompletion(TextField textField) {
|
private void initializeCompanyFieldAutoCompletion(TextField textField) {
|
||||||
CompanyStringConverter converter = SpringApp.getBean(CompanyStringConverter.class);
|
UITools.autoCompletion(textField, viewModel.getCompany(), getCompanyService());
|
||||||
UITools.autoCompletion(textField, viewModel.getCompany(), converter::suggest, converter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCompanyCustomerCreatePathAction(ActionEvent event) {
|
public void onCompanyCustomerCreatePathAction(ActionEvent event) {
|
||||||
|
|||||||
@@ -1,24 +1,22 @@
|
|||||||
package com.ecep.contract.controller.customer;
|
package com.ecep.contract.controller.customer;
|
||||||
|
|
||||||
import com.ecep.contract.SpringApp;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.ecep.contract.controller.table.cell.CustomerCatalogTableCell;
|
||||||
|
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
|
||||||
import com.ecep.contract.converter.EntityStringConverter;
|
|
||||||
import com.ecep.contract.vo.CompanyCustomerVo;
|
|
||||||
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
|
||||||
import com.ecep.contract.vo.CustomerCatalogVo;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerEntityService;
|
import com.ecep.contract.service.CompanyCustomerEntityService;
|
||||||
import com.ecep.contract.service.CustomerCatalogService;
|
import com.ecep.contract.service.CustomerCatalogService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.CustomerEntityViewModel;
|
import com.ecep.contract.vm.CustomerEntityViewModel;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||||
|
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@FxmlPath("/ui/company/customer/customer-tab-entity.fxml")
|
@FxmlPath("/ui/company/customer/customer-tab-entity.fxml")
|
||||||
public class CustomerTabSkinEntity
|
public class CustomerTabSkinEntity
|
||||||
@@ -26,13 +24,13 @@ public class CustomerTabSkinEntity
|
|||||||
|
|
||||||
// 关联项 tab
|
// 关联项 tab
|
||||||
public TableColumn<CustomerEntityViewModel, Number> entityTable_idColumn;
|
public TableColumn<CustomerEntityViewModel, Number> entityTable_idColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_catalogColumn;
|
public TableColumn<CustomerEntityViewModel, Integer> entityTable_catalogColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_nameColumn;
|
public TableColumn<CustomerEntityViewModel, String> entityTable_nameColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_abbNameColumn;
|
public TableColumn<CustomerEntityViewModel, String> entityTable_abbNameColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_codeColumn;
|
public TableColumn<CustomerEntityViewModel, String> entityTable_codeColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_creatorColumn;
|
public TableColumn<CustomerEntityViewModel, Integer> entityTable_creatorColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_developDateColumn;
|
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_developDateColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, String> entityTable_modifierColumn;
|
public TableColumn<CustomerEntityViewModel, Integer> entityTable_modifierColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_modifyDateColumn;
|
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_modifyDateColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_updatedDateColumn;
|
public TableColumn<CustomerEntityViewModel, LocalDate> entityTable_updatedDateColumn;
|
||||||
public TableColumn<CustomerEntityViewModel, LocalDateTime> fetchedTimeColumn;
|
public TableColumn<CustomerEntityViewModel, LocalDateTime> fetchedTimeColumn;
|
||||||
@@ -40,9 +38,6 @@ public class CustomerTabSkinEntity
|
|||||||
public MenuItem entityTable_menu_refresh;
|
public MenuItem entityTable_menu_refresh;
|
||||||
public MenuItem entityTable_menu_del;
|
public MenuItem entityTable_menu_del;
|
||||||
|
|
||||||
@Setter
|
|
||||||
private CompanyCustomerEntityService customerEntityService;
|
|
||||||
|
|
||||||
public CustomerTabSkinEntity(CompanyCustomerWindowController controller) {
|
public CustomerTabSkinEntity(CompanyCustomerWindowController controller) {
|
||||||
super(controller);
|
super(controller);
|
||||||
}
|
}
|
||||||
@@ -60,35 +55,28 @@ public class CustomerTabSkinEntity
|
|||||||
entityTable_nameColumn.setCellValueFactory(param -> param.getValue().getName());
|
entityTable_nameColumn.setCellValueFactory(param -> param.getValue().getName());
|
||||||
entityTable_abbNameColumn.setCellValueFactory(param -> param.getValue().getAbbName());
|
entityTable_abbNameColumn.setCellValueFactory(param -> param.getValue().getAbbName());
|
||||||
entityTable_codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
entityTable_codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
||||||
initializeEntityTabCatalogColumn(entityTable_catalogColumn);
|
|
||||||
|
|
||||||
EmployeeStringConverter stringConverter = SpringApp.getBean(EmployeeStringConverter.class);
|
entityTable_catalogColumn.setCellValueFactory(param -> param.getValue().getCatalog());
|
||||||
|
entityTable_catalogColumn.setCellFactory(CustomerCatalogTableCell.forTableColumn(getCustomerCatalogService()));
|
||||||
|
|
||||||
entityTable_developDateColumn.setCellValueFactory(param -> param.getValue().getDevelopDate());
|
entityTable_developDateColumn.setCellValueFactory(param -> param.getValue().getDevelopDate());
|
||||||
entityTable_modifyDateColumn.setCellValueFactory(param -> param.getValue().getModifyDate());
|
entityTable_modifyDateColumn.setCellValueFactory(param -> param.getValue().getModifyDate());
|
||||||
entityTable_creatorColumn
|
|
||||||
.setCellValueFactory(param -> param.getValue().getCreator().map(stringConverter::toString));
|
|
||||||
entityTable_modifierColumn
|
|
||||||
.setCellValueFactory(param -> param.getValue().getModifier().map(stringConverter::toString));
|
|
||||||
entityTable_updatedDateColumn.setCellValueFactory(param -> param.getValue().getUpdatedDate());
|
entityTable_updatedDateColumn.setCellValueFactory(param -> param.getValue().getUpdatedDate());
|
||||||
|
|
||||||
fetchedTimeColumn.setCellValueFactory(param -> param.getValue().getFetchedTime());
|
fetchedTimeColumn.setCellValueFactory(param -> param.getValue().getFetchedTime());
|
||||||
fetchedTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
fetchedTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
|
entityTable_creatorColumn.setCellValueFactory(param -> param.getValue().getCreator());
|
||||||
|
entityTable_creatorColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
|
entityTable_modifierColumn.setCellValueFactory(param -> param.getValue().getModifier());
|
||||||
|
entityTable_modifierColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
|
|
||||||
entityTable_menu_refresh.setOnAction(this::onTableRefreshAction);
|
entityTable_menu_refresh.setOnAction(this::onTableRefreshAction);
|
||||||
entityTable_menu_del.setOnAction(this::onTableDeleteAction);
|
entityTable_menu_del.setOnAction(this::onTableDeleteAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeEntityTabCatalogColumn(TableColumn<CustomerEntityViewModel, String> column) {
|
|
||||||
EntityStringConverter<CustomerCatalogVo> converter = new EntityStringConverter<>();
|
|
||||||
converter.setInitialized(v -> getCachedBean(CustomerCatalogService.class).findById(v.getId()));
|
|
||||||
column.setCellValueFactory(param -> param.getValue().getCatalog().map(converter::toString));
|
|
||||||
}
|
|
||||||
|
|
||||||
CompanyCustomerEntityService getCompanyCustomerEntityService() {
|
CompanyCustomerEntityService getCompanyCustomerEntityService() {
|
||||||
if (customerEntityService == null) {
|
return getCachedBean(CompanyCustomerEntityService.class);
|
||||||
customerEntityService = getBean(CompanyCustomerEntityService.class);
|
|
||||||
}
|
|
||||||
return customerEntityService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,6 +84,10 @@ public class CustomerTabSkinEntity
|
|||||||
return getCompanyCustomerEntityService();
|
return getCompanyCustomerEntityService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomerCatalogService getCustomerCatalogService() {
|
||||||
|
return getCachedBean(CustomerCatalogService.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParamUtils.Builder getSpecification(CompanyCustomerVo parent) {
|
public ParamUtils.Builder getSpecification(CompanyCustomerVo parent) {
|
||||||
ParamUtils.Builder params = getSpecification();
|
ParamUtils.Builder params = getSpecification();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.ecep.contract.constant.CompanyCustomerConstant;
|
|||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.model.BaseEnumEntity;
|
import com.ecep.contract.model.BaseEnumEntity;
|
||||||
import com.ecep.contract.model.CompanyCustomerFileTypeLocal;
|
import com.ecep.contract.model.CompanyCustomerFileTypeLocal;
|
||||||
|
import com.ecep.contract.service.CompanyCustomerEvaluationFormFileService;
|
||||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||||
import com.ecep.contract.service.CompanyCustomerFileTypeService;
|
import com.ecep.contract.service.CompanyCustomerFileTypeService;
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
@@ -26,6 +27,7 @@ import com.ecep.contract.util.FxmlPath;
|
|||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.CompanyCustomerFileViewModel;
|
import com.ecep.contract.vm.CompanyCustomerFileViewModel;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
||||||
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
||||||
import com.ecep.contract.vo.CompanyCustomerVo;
|
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
@@ -156,10 +158,13 @@ public class CustomerTabSkinFile
|
|||||||
protected void onTableRowDoubleClickedAction(CompanyCustomerFileViewModel item) {
|
protected void onTableRowDoubleClickedAction(CompanyCustomerFileViewModel item) {
|
||||||
CompanyCustomerFileType fileType = item.getType().get();
|
CompanyCustomerFileType fileType = item.getType().get();
|
||||||
if (fileType == CompanyCustomerFileType.EvaluationForm) {
|
if (fileType == CompanyCustomerFileType.EvaluationForm) {
|
||||||
|
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCachedBean(
|
||||||
|
CompanyCustomerEvaluationFormFileService.class).findByCustomerFile(item.getId().get());
|
||||||
// 文件不是 Excel 文件时,打开编辑UI
|
// 文件不是 Excel 文件时,打开编辑UI
|
||||||
if (!FileUtils.withExtensions(item.getFilePath().get(), FileUtils.XLS,
|
if (!FileUtils.withExtensions(item.getFilePath().get(), FileUtils.XLS,
|
||||||
FileUtils.XLSX)) {
|
FileUtils.XLSX)) {
|
||||||
CompanyCustomerEvaluationFormFileWindowController.show(item, controller.root.getScene().getWindow());
|
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
||||||
|
controller.root.getScene().getWindow());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,7 +210,11 @@ public class CustomerTabSkinFile
|
|||||||
CompanyCustomerFileViewModel model = new CompanyCustomerFileViewModel();
|
CompanyCustomerFileViewModel model = new CompanyCustomerFileViewModel();
|
||||||
model.update(saved);
|
model.update(saved);
|
||||||
dataSet.add(model);
|
dataSet.add(model);
|
||||||
CompanyCustomerEvaluationFormFileWindowController.show(model,
|
|
||||||
|
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCachedBean(
|
||||||
|
CompanyCustomerEvaluationFormFileService.class).findByCustomerFile(saved);
|
||||||
|
|
||||||
|
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
||||||
getTableView().getScene().getWindow());
|
getTableView().getScene().getWindow());
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ public class CustomerTabSkinSatisfactionSurvey
|
|||||||
|
|
||||||
// 关联项 tab
|
// 关联项 tab
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> idColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> idColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, ProjectVo> projectColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Integer> projectColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, String> codeColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, String> codeColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> totalScoreColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> totalScoreColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, EmployeeVo> applicantColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Integer> applicantColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDateTime> applyTimeColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDateTime> applyTimeColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, String> descriptionColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, String> descriptionColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDate> dateColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDate> dateColumn;
|
||||||
@@ -62,8 +62,9 @@ public class CustomerTabSkinSatisfactionSurvey
|
|||||||
|
|
||||||
bindNumberColumn(idColumn, CustomerSatisfactionSurveyViewModel::getId);
|
bindNumberColumn(idColumn, CustomerSatisfactionSurveyViewModel::getId);
|
||||||
bindColumn(codeColumn, CustomerSatisfactionSurveyViewModel::getCode);
|
bindColumn(codeColumn, CustomerSatisfactionSurveyViewModel::getCode);
|
||||||
|
|
||||||
projectColumn.setCellValueFactory(param -> param.getValue().getProject());
|
projectColumn.setCellValueFactory(param -> param.getValue().getProject());
|
||||||
projectColumn.setCellFactory(cell -> new ProjectTableCell<>(getProjectService()));
|
projectColumn.setCellFactory(ProjectTableCell.forTableColumn(getProjectService()));
|
||||||
bindLocalDateColumn(dateColumn, CustomerSatisfactionSurveyViewModel::getDate);
|
bindLocalDateColumn(dateColumn, CustomerSatisfactionSurveyViewModel::getDate);
|
||||||
bindNumberColumn(totalScoreColumn, CustomerSatisfactionSurveyViewModel::getTotalScore);
|
bindNumberColumn(totalScoreColumn, CustomerSatisfactionSurveyViewModel::getTotalScore);
|
||||||
applicantColumn.setCellValueFactory(param -> param.getValue().getApplicant());
|
applicantColumn.setCellValueFactory(param -> param.getValue().getApplicant());
|
||||||
@@ -75,12 +76,6 @@ public class CustomerTabSkinSatisfactionSurvey
|
|||||||
entityTable_menu_del.setOnAction(this::onTableDeleteAction);
|
entityTable_menu_del.setOnAction(this::onTableDeleteAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeEntityTabCatalogColumn(TableColumn<CustomerEntityViewModel, String> column) {
|
|
||||||
EntityStringConverter<CustomerCatalogVo> converter = new EntityStringConverter<>();
|
|
||||||
converter.setInitialized(v -> getCachedBean(CustomerCatalogService.class).findById(v.getId()));
|
|
||||||
column.setCellValueFactory(param -> param.getValue().getCatalog().map(converter::toString));
|
|
||||||
}
|
|
||||||
|
|
||||||
private CustomerSatisfactionSurveyService getCustomerSatisfactionSurveyService() {
|
private CustomerSatisfactionSurveyService getCustomerSatisfactionSurveyService() {
|
||||||
if (satisfactionSurveyService == null) {
|
if (satisfactionSurveyService == null) {
|
||||||
satisfactionSurveyService = getBean(CustomerSatisfactionSurveyService.class);
|
satisfactionSurveyService = getBean(CustomerSatisfactionSurveyService.class);
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.model.EmployeeLoginHistory;
|
|
||||||
import com.ecep.contract.service.EmployeeLoginHistoryService;
|
import com.ecep.contract.service.EmployeeLoginHistoryService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
|
import com.ecep.contract.vo.EmployeeLoginHistoryVo;
|
||||||
import com.ecep.contract.vm.EmployeeLoginHistoryViewModel;
|
import com.ecep.contract.vm.EmployeeLoginHistoryViewModel;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
@@ -15,7 +15,7 @@ import javafx.scene.control.TableColumn;
|
|||||||
|
|
||||||
@FxmlPath("/ui/employee/employee-login-history.fxml")
|
@FxmlPath("/ui/employee/employee-login-history.fxml")
|
||||||
public class EmployeeTabSkinLoginHistory
|
public class EmployeeTabSkinLoginHistory
|
||||||
extends AbstEmployeeTableTabSkin<EmployeeLoginHistory, EmployeeLoginHistoryViewModel>
|
extends AbstEmployeeTableTabSkin<EmployeeLoginHistoryVo, EmployeeLoginHistoryViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
public TableColumn<EmployeeLoginHistoryViewModel, Number> idColumn;
|
public TableColumn<EmployeeLoginHistoryViewModel, Number> idColumn;
|
||||||
public TableColumn<EmployeeLoginHistoryViewModel, String> ipColumn;
|
public TableColumn<EmployeeLoginHistoryViewModel, String> ipColumn;
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
package com.ecep.contract.controller.employee;
|
package com.ecep.contract.controller.employee;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.model.Employee;
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
|
||||||
import com.ecep.contract.service.EmployeeRoleService;
|
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.collections.ListChangeListener;
|
import javafx.collections.ListChangeListener;
|
||||||
import javafx.scene.control.ListCell;
|
import javafx.scene.control.ListCell;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class EmployeeTabSkinRole
|
public class EmployeeTabSkinRole
|
||||||
extends AbstEmployeeBasedTabSkin
|
extends AbstEmployeeBasedTabSkin
|
||||||
@@ -41,7 +41,7 @@ public class EmployeeTabSkinRole
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadSelectedRoles() {
|
private void loadSelectedRoles() {
|
||||||
List<EmployeeRole> selectedRoles = getEmployeeService().getRolesByEmployeeId(viewModel.getId().get());
|
List<EmployeeRoleVo> selectedRoles = getEmployeeService().getRolesByEmployeeId(viewModel.getId().get());
|
||||||
controller.rolesField.getTargetItems().setAll(selectedRoles);
|
controller.rolesField.getTargetItems().setAll(selectedRoles);
|
||||||
changed.set(false);
|
changed.set(false);
|
||||||
}
|
}
|
||||||
@@ -49,13 +49,13 @@ public class EmployeeTabSkinRole
|
|||||||
private void initializeListView() {
|
private void initializeListView() {
|
||||||
// 非系统内置账户
|
// 非系统内置账户
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
List<EmployeeRole> roles = getEmployeeRoleService().findAll(params, Pageable.ofSize(500)).getContent();
|
List<EmployeeRoleVo> roles = getEmployeeRoleService().findAll(params, Pageable.ofSize(500)).getContent();
|
||||||
|
|
||||||
controller.rolesField.getSourceItems().setAll(roles);
|
controller.rolesField.getSourceItems().setAll(roles);
|
||||||
controller.rolesField.setCellFactory(param -> {
|
controller.rolesField.setCellFactory(param -> {
|
||||||
return new ListCell<>() {
|
return new ListCell<EmployeeRoleVo>() {
|
||||||
@Override
|
@Override
|
||||||
protected void updateItem(EmployeeRole item, boolean empty) {
|
protected void updateItem(EmployeeRoleVo item, boolean empty) {
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
if (item == null || empty) {
|
if (item == null || empty) {
|
||||||
setText(null);
|
setText(null);
|
||||||
@@ -66,10 +66,10 @@ public class EmployeeTabSkinRole
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.rolesField.getTargetItems().addListener((ListChangeListener<EmployeeRole>) change -> {
|
controller.rolesField.getTargetItems().addListener((ListChangeListener<EmployeeRoleVo>) change -> {
|
||||||
while (change.next()) {
|
while (change.next()) {
|
||||||
List<? extends EmployeeRole> added = change.getAddedSubList();
|
List<? extends EmployeeRoleVo> added = change.getAddedSubList();
|
||||||
List<? extends EmployeeRole> removed = change.getRemoved();
|
List<? extends EmployeeRoleVo> removed = change.getRemoved();
|
||||||
if (!added.isEmpty() || !removed.isEmpty()) {
|
if (!added.isEmpty() || !removed.isEmpty()) {
|
||||||
changed.set(true);
|
changed.set(true);
|
||||||
}
|
}
|
||||||
@@ -79,9 +79,7 @@ public class EmployeeTabSkinRole
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save() {
|
public void save() {
|
||||||
Employee entity = getEntity();
|
getEmployeeService().getUpdateEmployeeRoles(viewModel.getId().get(), controller.rolesField.getTargetItems());
|
||||||
entity.setRoles(controller.rolesField.getTargetItems());
|
|
||||||
save(entity);
|
|
||||||
loadSelectedRoles();
|
loadSelectedRoles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.ecep.contract.controller.employee;
|
package com.ecep.contract.controller.employee;
|
||||||
|
|
||||||
import com.ecep.contract.vo.EmployeeVo;
|
|
||||||
import org.controlsfx.control.ListSelectionView;
|
import org.controlsfx.control.ListSelectionView;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -10,11 +9,11 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstEntityController;
|
import com.ecep.contract.controller.AbstEntityController;
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
|
||||||
import com.ecep.contract.service.EmployeeService;
|
import com.ecep.contract.service.EmployeeService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.EmployeeViewModel;
|
import com.ecep.contract.vm.EmployeeViewModel;
|
||||||
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
|
import com.ecep.contract.vo.EmployeeVo;
|
||||||
|
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.DatePicker;
|
import javafx.scene.control.DatePicker;
|
||||||
@@ -61,7 +60,7 @@ public class EmployeeWindowController extends AbstEntityController<EmployeeVo, E
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
public Tab rolesTab;
|
public Tab rolesTab;
|
||||||
public ListSelectionView<EmployeeRole> rolesField;
|
public ListSelectionView<EmployeeRoleVo> rolesField;
|
||||||
|
|
||||||
public Tab loginHistoryTab;
|
public Tab loginHistoryTab;
|
||||||
public Tab authBindTab;
|
public Tab authBindTab;
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstManagerWindowController;
|
import com.ecep.contract.controller.AbstManagerWindowController;
|
||||||
import com.ecep.contract.model.Function;
|
|
||||||
import com.ecep.contract.service.FunctionService;
|
import com.ecep.contract.service.FunctionService;
|
||||||
import com.ecep.contract.service.PermissionService;
|
import com.ecep.contract.service.PermissionService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
@@ -25,7 +25,7 @@ import javafx.stage.Stage;
|
|||||||
@FxmlPath("/ui/employee/functions-manager.fxml")
|
@FxmlPath("/ui/employee/functions-manager.fxml")
|
||||||
@Component
|
@Component
|
||||||
public class EmployeeFunctionsManagerWindowController
|
public class EmployeeFunctionsManagerWindowController
|
||||||
extends AbstManagerWindowController<Function, FunctionViewModel, FunctionManagerSkin> {
|
extends AbstManagerWindowController<FunctionVo, FunctionViewModel, FunctionManagerSkin> {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PermissionService permissionService;
|
PermissionService permissionService;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.ecep.contract.controller.permission;
|
|||||||
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
||||||
import com.ecep.contract.controller.ManagerSkin;
|
import com.ecep.contract.controller.ManagerSkin;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
import com.ecep.contract.service.PermissionService;
|
import com.ecep.contract.service.PermissionService;
|
||||||
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@ import lombok.Setter;
|
|||||||
|
|
||||||
public class EmployeeRoleManagerSkin
|
public class EmployeeRoleManagerSkin
|
||||||
extends
|
extends
|
||||||
AbstEntityManagerSkin<EmployeeRole, EmployeeRoleViewModel, EmployeeRoleManagerSkin, EmployeeRoleManagerWindowController>
|
AbstEntityManagerSkin<EmployeeRoleVo, EmployeeRoleViewModel, EmployeeRoleManagerSkin, EmployeeRoleManagerWindowController>
|
||||||
implements ManagerSkin, EditableEntityTableTabSkin<EmployeeRole, EmployeeRoleViewModel> {
|
implements ManagerSkin, EditableEntityTableTabSkin<EmployeeRoleVo, EmployeeRoleViewModel> {
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstManagerWindowController;
|
import com.ecep.contract.controller.AbstManagerWindowController;
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
|
||||||
import com.ecep.contract.service.EmployeeRoleService;
|
import com.ecep.contract.service.EmployeeRoleService;
|
||||||
import com.ecep.contract.service.PermissionService;
|
import com.ecep.contract.service.PermissionService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
||||||
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
@@ -23,7 +23,7 @@ import javafx.stage.Stage;
|
|||||||
@Component
|
@Component
|
||||||
@FxmlPath("/ui/employee/roles-manager.fxml")
|
@FxmlPath("/ui/employee/roles-manager.fxml")
|
||||||
public class EmployeeRoleManagerWindowController
|
public class EmployeeRoleManagerWindowController
|
||||||
extends AbstManagerWindowController<EmployeeRole, EmployeeRoleViewModel, EmployeeRoleManagerSkin> {
|
extends AbstManagerWindowController<EmployeeRoleVo, EmployeeRoleViewModel, EmployeeRoleManagerSkin> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EmployeeRoleManagerWindowController.class);
|
private static final Logger logger = LoggerFactory.getLogger(EmployeeRoleManagerWindowController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.ecep.contract.controller.permission;
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
||||||
import com.ecep.contract.model.Function;
|
|
||||||
import com.ecep.contract.service.FunctionService;
|
import com.ecep.contract.service.FunctionService;
|
||||||
import com.ecep.contract.service.PermissionService;
|
import com.ecep.contract.service.PermissionService;
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.cell.CheckBoxTableCell;
|
import javafx.scene.control.cell.CheckBoxTableCell;
|
||||||
@@ -12,7 +12,7 @@ import javafx.scene.control.cell.TextFieldTableCell;
|
|||||||
|
|
||||||
public class FunctionManagerSkin
|
public class FunctionManagerSkin
|
||||||
extends
|
extends
|
||||||
AbstEntityManagerSkin<Function, FunctionViewModel, FunctionManagerSkin, EmployeeFunctionsManagerWindowController> {
|
AbstEntityManagerSkin<FunctionVo, FunctionViewModel, FunctionManagerSkin, EmployeeFunctionsManagerWindowController> {
|
||||||
|
|
||||||
public FunctionManagerSkin(EmployeeFunctionsManagerWindowController controller) {
|
public FunctionManagerSkin(EmployeeFunctionsManagerWindowController controller) {
|
||||||
super(controller);
|
super(controller);
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.ecep.contract.controller.permission;
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
|
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
|
||||||
import com.ecep.contract.model.Function;
|
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
|
|
||||||
public class FunctionTabSkinBase
|
public class FunctionTabSkinBase
|
||||||
extends AbstEntityBasedTabSkin<FunctionWindowController, Function, FunctionViewModel> {
|
extends AbstEntityBasedTabSkin<FunctionWindowController, FunctionVo, FunctionViewModel> {
|
||||||
|
|
||||||
public FunctionTabSkinBase(FunctionWindowController controller) {
|
public FunctionTabSkinBase(FunctionWindowController controller) {
|
||||||
super(controller);
|
super(controller);
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package com.ecep.contract.controller.permission;
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.ecep.contract.util.ParamUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
||||||
@@ -10,8 +7,11 @@ import com.ecep.contract.model.Function;
|
|||||||
import com.ecep.contract.model.Permission;
|
import com.ecep.contract.model.Permission;
|
||||||
import com.ecep.contract.service.PermissionService;
|
import com.ecep.contract.service.PermissionService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
import com.ecep.contract.vm.PermissionViewModel;
|
import com.ecep.contract.vm.PermissionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
import com.ecep.contract.vo.PermissionVo;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
@@ -20,7 +20,7 @@ import javafx.scene.control.TableColumn;
|
|||||||
@FxmlPath("/ui/employee/function-tab-permission.fxml")
|
@FxmlPath("/ui/employee/function-tab-permission.fxml")
|
||||||
public class FunctionTabSkinPermission
|
public class FunctionTabSkinPermission
|
||||||
extends
|
extends
|
||||||
AbstEntityTableTabSkin<FunctionWindowController, Function, FunctionViewModel, Permission, PermissionViewModel> {
|
AbstEntityTableTabSkin<FunctionWindowController, FunctionVo, FunctionViewModel, PermissionVo, PermissionViewModel> {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public TableColumn<PermissionViewModel, Number> idColumn;
|
public TableColumn<PermissionViewModel, Number> idColumn;
|
||||||
@@ -62,7 +62,7 @@ public class FunctionTabSkinPermission
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParamUtils.Builder getSpecification(Function parent) {
|
public ParamUtils.Builder getSpecification(FunctionVo parent) {
|
||||||
ParamUtils.Builder params = getSpecification();
|
ParamUtils.Builder params = getSpecification();
|
||||||
params.equals("function", parent.getId());
|
params.equals("function", parent.getId());
|
||||||
return params;
|
return params;
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstEntityController;
|
import com.ecep.contract.controller.AbstEntityController;
|
||||||
import com.ecep.contract.model.Function;
|
|
||||||
import com.ecep.contract.service.FunctionService;
|
import com.ecep.contract.service.FunctionService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
@@ -28,7 +29,7 @@ import lombok.Getter;
|
|||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
@Component
|
@Component
|
||||||
@FxmlPath("/ui/employee/function.fxml")
|
@FxmlPath("/ui/employee/function.fxml")
|
||||||
public class FunctionWindowController extends AbstEntityController<Function, FunctionViewModel> {
|
public class FunctionWindowController extends AbstEntityController<FunctionVo, FunctionViewModel> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(FunctionWindowController.class);
|
private static final Logger logger = LoggerFactory.getLogger(FunctionWindowController.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,8 +62,8 @@ public class FunctionWindowController extends AbstEntityController<Function, Fun
|
|||||||
@FXML
|
@FXML
|
||||||
public Label versionLabel;
|
public Label versionLabel;
|
||||||
|
|
||||||
public static void show(Function function, Window owner) {
|
public static void show(FunctionVo functionVo, Window owner) {
|
||||||
FunctionViewModel model = FunctionViewModel.from(function);
|
FunctionViewModel model = FunctionViewModel.from(functionVo);
|
||||||
show(model, owner);
|
show(model, owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
package com.ecep.contract.controller.permission;
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.ecep.contract.util.ParamUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.ecep.contract.controller.ManagerSkin;
|
import com.ecep.contract.controller.ManagerSkin;
|
||||||
import com.ecep.contract.controller.table.TableTabSkin;
|
import com.ecep.contract.controller.table.TableTabSkin;
|
||||||
import com.ecep.contract.model.Permission;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.FunctionViewModel;
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
import com.ecep.contract.vm.PermissionViewModel;
|
import com.ecep.contract.vm.PermissionViewModel;
|
||||||
|
import com.ecep.contract.vo.PermissionVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.property.Property;
|
import javafx.beans.property.Property;
|
||||||
@@ -29,7 +27,7 @@ import javafx.scene.control.TableColumn;
|
|||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class PermissionManagerSkin implements ManagerSkin, TableTabSkin<Permission, PermissionViewModel> {
|
public class PermissionManagerSkin implements ManagerSkin, TableTabSkin<PermissionVo, PermissionViewModel> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PermissionManagerSkin.class);
|
private static final Logger logger = LoggerFactory.getLogger(PermissionManagerSkin.class);
|
||||||
EmployeeFunctionsManagerWindowController controller;
|
EmployeeFunctionsManagerWindowController controller;
|
||||||
|
|
||||||
@@ -100,11 +98,9 @@ public class PermissionManagerSkin implements ManagerSkin, TableTabSkin<Permissi
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onTableCreateNewAction(ActionEvent event) {
|
protected void onTableCreateNewAction(ActionEvent event) {
|
||||||
Permission newRow = new Permission();
|
PermissionVo newRow = new PermissionVo();
|
||||||
com.ecep.contract.model.Function function = controller.functionService.findById(viewModel.getId().get());
|
newRow.setFunctionId(viewModel.getId().get());
|
||||||
newRow.setFunction(function);
|
PermissionVo saved = controller.getPermissionService().save(newRow);
|
||||||
|
|
||||||
Permission saved = controller.permissionService.save(newRow);
|
|
||||||
PermissionViewModel row = PermissionViewModel.from(saved);
|
PermissionViewModel row = PermissionViewModel.from(saved);
|
||||||
dataSet.add(row);
|
dataSet.add(row);
|
||||||
}
|
}
|
||||||
@@ -129,7 +125,17 @@ public class PermissionManagerSkin implements ManagerSkin, TableTabSkin<Permissi
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean deleteRow(PermissionViewModel row) {
|
protected boolean deleteRow(PermissionViewModel row) {
|
||||||
throw new UnsupportedOperationException("未实现");
|
try {
|
||||||
|
int id = row.getId().get();
|
||||||
|
PermissionVo permissionVo = controller.permissionService.findById(id);
|
||||||
|
if (permissionVo != null) {
|
||||||
|
controller.permissionService.delete(permissionVo);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleException("删除权限失败", e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onNameColumnEditCommitAction(TableColumn.CellEditEvent<PermissionViewModel, String> event) {
|
private void onNameColumnEditCommitAction(TableColumn.CellEditEvent<PermissionViewModel, String> event) {
|
||||||
@@ -185,9 +191,9 @@ public class PermissionManagerSkin implements ManagerSkin, TableTabSkin<Permissi
|
|||||||
|
|
||||||
protected void save(PermissionViewModel row) {
|
protected void save(PermissionViewModel row) {
|
||||||
int id = row.getId().get();
|
int id = row.getId().get();
|
||||||
Permission type = controller.permissionService.findById(id);
|
PermissionVo permissionVo = controller.permissionService.findById(id);
|
||||||
if (row.copyTo(type)) {
|
if (permissionVo != null && row.copyTo(permissionVo)) {
|
||||||
Permission saved = controller.permissionService.save(type);
|
PermissionVo saved = controller.permissionService.save(permissionVo);
|
||||||
row.update(saved);
|
row.update(saved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ import com.ecep.contract.converter.CompanyStringConverter;
|
|||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
import com.ecep.contract.model.CompanyCustomerEvaluationFormFile;
|
import com.ecep.contract.model.CompanyCustomerEvaluationFormFile;
|
||||||
import com.ecep.contract.model.Employee;
|
import com.ecep.contract.model.Employee;
|
||||||
import com.ecep.contract.model.Project;
|
|
||||||
import com.ecep.contract.model.ProjectBid;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.ProjectBidService;
|
import com.ecep.contract.service.ProjectBidService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ProjectBidViewModel;
|
import com.ecep.contract.vm.ProjectBidViewModel;
|
||||||
|
import com.ecep.contract.vo.ProjectBidVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TableCell;
|
import javafx.scene.control.TableCell;
|
||||||
@@ -31,8 +31,8 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@FxmlPath("/ui/project/project-tab-bid.fxml")
|
@FxmlPath("/ui/project/project-tab-bid.fxml")
|
||||||
public class ProjectTabSkinBid
|
public class ProjectTabSkinBid
|
||||||
extends AbstProjectTableTabSkin<ProjectBid, ProjectBidViewModel>
|
extends AbstProjectTableTabSkin<ProjectBidVo, ProjectBidViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ProjectBid, ProjectBidViewModel>, RefreshableSkin {
|
implements TabSkin, EditableEntityTableTabSkin<ProjectBidVo, ProjectBidViewModel>, RefreshableSkin {
|
||||||
|
|
||||||
public TableColumn<ProjectBidViewModel, Number> idColumn;
|
public TableColumn<ProjectBidViewModel, Number> idColumn;
|
||||||
public TableColumn<ProjectBidViewModel, Number> versionColumn;
|
public TableColumn<ProjectBidViewModel, Number> versionColumn;
|
||||||
@@ -107,9 +107,11 @@ public class ProjectTabSkinBid
|
|||||||
@Override
|
@Override
|
||||||
protected ProjectBidViewModel createNewViewModel() {
|
protected ProjectBidViewModel createNewViewModel() {
|
||||||
ProjectBidViewModel model = new ProjectBidViewModel();
|
ProjectBidViewModel model = new ProjectBidViewModel();
|
||||||
Project project = getParent();
|
ProjectVo project = getParent();
|
||||||
model.getProject().set(project);
|
model.getProject().set(project.getId());
|
||||||
model.getApplicant().set(project.getApplicant());
|
if (project.getApplicantId() != null) {
|
||||||
|
model.getApplicant().set(project.getApplicantId());
|
||||||
|
}
|
||||||
if (project.getAmount() != null) {
|
if (project.getAmount() != null) {
|
||||||
model.getAmount().set(project.getAmount());
|
model.getAmount().set(project.getAmount());
|
||||||
}
|
}
|
||||||
@@ -178,17 +180,17 @@ public class ProjectTabSkinBid
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteRowData(ProjectBid entity) {
|
public void deleteRowData(ProjectBidVo entity) {
|
||||||
getProjectBidService().delete(entity);
|
getProjectBidService().delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectBid loadRowData(ProjectBidViewModel row) {
|
public ProjectBidVo loadRowData(ProjectBidViewModel row) {
|
||||||
return getProjectBidService().findById(row.getId().get());
|
return getProjectBidService().findById(row.getId().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectBid saveRowData(ProjectBid entity) {
|
public ProjectBidVo saveRowData(ProjectBidVo entity) {
|
||||||
return getProjectBidService().save(entity);
|
return getProjectBidService().save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import java.time.LocalDate;
|
|||||||
|
|
||||||
import com.ecep.contract.controller.contract.ContractWindowController;
|
import com.ecep.contract.controller.contract.ContractWindowController;
|
||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.service.ContractService;
|
import com.ecep.contract.service.ContractService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ContractViewModel;
|
import com.ecep.contract.vm.ContractViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
@@ -16,7 +17,7 @@ import javafx.scene.control.TableColumn;
|
|||||||
|
|
||||||
@FxmlPath("/ui/project/project-tab-contract.fxml")
|
@FxmlPath("/ui/project/project-tab-contract.fxml")
|
||||||
public class ProjectTabSkinContract
|
public class ProjectTabSkinContract
|
||||||
extends AbstProjectTableTabSkin<Contract, ContractViewModel>
|
extends AbstProjectTableTabSkin<ContractVo, ContractViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
public TableColumn<ContractViewModel, Number> idColumn;
|
public TableColumn<ContractViewModel, Number> idColumn;
|
||||||
public TableColumn<ContractViewModel, String> codeColumn;
|
public TableColumn<ContractViewModel, String> codeColumn;
|
||||||
@@ -66,6 +67,30 @@ public class ProjectTabSkinContract
|
|||||||
ContractWindowController.show(item, controller.root.getScene().getWindow());
|
ContractWindowController.show(item, controller.root.getScene().getWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ContractViewModel createNewViewModel() {
|
||||||
|
ContractViewModel model = new ContractViewModel();
|
||||||
|
ProjectVo project = getParent();
|
||||||
|
model.getProject().set(project.getId());
|
||||||
|
saveRow(model);
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteRowData(ContractVo entity) {
|
||||||
|
getContractService().delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractVo loadRowData(ContractViewModel row) {
|
||||||
|
return getContractService().findById(row.getId().get());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractVo saveRowData(ContractVo entity) {
|
||||||
|
return getContractService().save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
private ContractService getContractService() {
|
private ContractService getContractService() {
|
||||||
return controller.contractService;
|
return controller.contractService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ import com.ecep.contract.controller.project.cost.ProjectCostWindowController;
|
|||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Project;
|
|
||||||
import com.ecep.contract.model.ProjectCost;
|
|
||||||
import com.ecep.contract.model.ProjectCostItem;
|
import com.ecep.contract.model.ProjectCostItem;
|
||||||
import com.ecep.contract.service.ContractItemService;
|
import com.ecep.contract.service.ContractItemService;
|
||||||
import com.ecep.contract.service.ProjectCostItemService;
|
import com.ecep.contract.service.ProjectCostItemService;
|
||||||
@@ -17,6 +14,9 @@ import com.ecep.contract.service.ProjectCostService;
|
|||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ProjectCostItemViewModel;
|
import com.ecep.contract.vm.ProjectCostItemViewModel;
|
||||||
import com.ecep.contract.vm.ProjectCostViewModel;
|
import com.ecep.contract.vm.ProjectCostViewModel;
|
||||||
|
import com.ecep.contract.vo.ProjectCostItemVo;
|
||||||
|
import com.ecep.contract.vo.ProjectCostVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@@ -31,13 +31,19 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@FxmlPath("/ui/project/project-tab-cost.fxml")
|
@FxmlPath("/ui/project/project-tab-cost.fxml")
|
||||||
public class ProjectTabSkinCost
|
public class ProjectTabSkinCost
|
||||||
extends AbstProjectTableTabSkin<ProjectCost, ProjectCostViewModel>
|
extends AbstProjectTableTabSkin<ProjectCostVo, ProjectCostViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
|
|
||||||
public TableColumn<ProjectCostViewModel, Number> idColumn;
|
public TableColumn<ProjectCostViewModel, Number> idColumn;
|
||||||
public TableColumn<ProjectCostViewModel, Employee> applicantColumn;
|
/**
|
||||||
|
* 申请人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ProjectCostViewModel, Integer> applicantColumn;
|
||||||
public TableColumn<ProjectCostViewModel, LocalDateTime> applyTimeColumn;
|
public TableColumn<ProjectCostViewModel, LocalDateTime> applyTimeColumn;
|
||||||
public TableColumn<ProjectCostViewModel, Employee> authorizerColumn;
|
/**
|
||||||
|
* 审批人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ProjectCostViewModel, Integer> authorizerColumn;
|
||||||
public TableColumn<ProjectCostViewModel, LocalDateTime> authorizationTimeColumn;
|
public TableColumn<ProjectCostViewModel, LocalDateTime> authorizationTimeColumn;
|
||||||
|
|
||||||
public TableColumn<ProjectCostViewModel, Number> grossProfitMarginColumn;
|
public TableColumn<ProjectCostViewModel, Number> grossProfitMarginColumn;
|
||||||
@@ -96,29 +102,37 @@ public class ProjectTabSkinCost
|
|||||||
super.initializeTable();
|
super.initializeTable();
|
||||||
idColumn.setCellValueFactory(param -> param.getValue().getId());
|
idColumn.setCellValueFactory(param -> param.getValue().getId());
|
||||||
|
|
||||||
|
// 申请人, Employee
|
||||||
applicantColumn.setCellValueFactory(param -> param.getValue().getApplicant());
|
applicantColumn.setCellValueFactory(param -> param.getValue().getApplicant());
|
||||||
applicantColumn.setCellFactory(cell -> new EmployeeTableCell<>());
|
applicantColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
|
// 申请时间
|
||||||
applyTimeColumn.setCellValueFactory(param -> param.getValue().getApplyTime());
|
applyTimeColumn.setCellValueFactory(param -> param.getValue().getApplyTime());
|
||||||
applyTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
applyTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
|
// 审批人, Employee
|
||||||
authorizerColumn.setCellValueFactory(param -> param.getValue().getAuthorizer());
|
authorizerColumn.setCellValueFactory(param -> param.getValue().getAuthorizer());
|
||||||
authorizerColumn.setCellFactory(cell -> new EmployeeTableCell<>());
|
authorizerColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
|
// 审批时间
|
||||||
authorizationTimeColumn.setCellValueFactory(param -> param.getValue().getAuthorizationTime());
|
authorizationTimeColumn.setCellValueFactory(param -> param.getValue().getAuthorizationTime());
|
||||||
authorizationTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
authorizationTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
inTaxAmountColumn.setCellValueFactory(param -> param.getValue().getInTaxAmount());
|
inTaxAmountColumn.setCellValueFactory(param -> param.getValue().getInTaxAmount());
|
||||||
inTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
inTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
||||||
inExclusiveTaxAmountColumn.setCellValueFactory(param -> param.getValue().getInExclusiveTaxAmount());
|
inExclusiveTaxAmountColumn.setCellValueFactory(param -> param.getValue().getInExclusiveTaxAmount());
|
||||||
inExclusiveTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
inExclusiveTaxAmountColumn
|
||||||
|
.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
||||||
outTaxAmountColumn.setCellValueFactory(param -> param.getValue().getOutTaxAmount());
|
outTaxAmountColumn.setCellValueFactory(param -> param.getValue().getOutTaxAmount());
|
||||||
outTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
outTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
||||||
outExclusiveTaxAmountColumn.setCellValueFactory(param -> param.getValue().getOutExclusiveTaxAmount());
|
outExclusiveTaxAmountColumn.setCellValueFactory(param -> param.getValue().getOutExclusiveTaxAmount());
|
||||||
outExclusiveTaxAmountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
outExclusiveTaxAmountColumn
|
||||||
|
.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
||||||
|
|
||||||
grossProfitMarginColumn.setCellValueFactory(param -> param.getValue().getGrossProfitMargin());
|
grossProfitMarginColumn.setCellValueFactory(param -> param.getValue().getGrossProfitMargin());
|
||||||
NumberFormat numberInstance = NumberFormat.getNumberInstance(getLocale());
|
NumberFormat numberInstance = NumberFormat.getNumberInstance(getLocale());
|
||||||
numberInstance.setMaximumFractionDigits(2);
|
numberInstance.setMaximumFractionDigits(2);
|
||||||
numberInstance.setMinimumFractionDigits(2);
|
numberInstance.setMinimumFractionDigits(2);
|
||||||
grossProfitMarginColumn.setCellFactory(TextFieldTableCell.forTableColumn(new NumberStringConverter(numberInstance)));
|
grossProfitMarginColumn
|
||||||
|
.setCellFactory(TextFieldTableCell.forTableColumn(new NumberStringConverter(numberInstance)));
|
||||||
|
|
||||||
versionColumn.setCellValueFactory(param -> param.getValue().getVersion());
|
versionColumn.setCellValueFactory(param -> param.getValue().getVersion());
|
||||||
descriptionColumn.setCellValueFactory(param -> param.getValue().getDescription());
|
descriptionColumn.setCellValueFactory(param -> param.getValue().getDescription());
|
||||||
@@ -128,13 +142,12 @@ public class ProjectTabSkinCost
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ProjectCostViewModel createNewViewModel() {
|
protected ProjectCostViewModel createNewViewModel() {
|
||||||
ProjectCostViewModel model = new ProjectCostViewModel();
|
ProjectCostViewModel model = new ProjectCostViewModel();
|
||||||
Project project = getParent();
|
ProjectVo project = getParent();
|
||||||
model.getProject().set(project);
|
model.getProject().set(project.getId());
|
||||||
ProjectCost latest = getCostService().findLatestByProject(project);
|
ProjectCostVo latest = getCostService().findLatestByProject(project);
|
||||||
if (latest != null) {
|
if (latest != null) {
|
||||||
model.getVersion().set(latest.getVersion() + 1);
|
model.getVersion().set(latest.getVersion() + 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -142,7 +155,9 @@ public class ProjectTabSkinCost
|
|||||||
}
|
}
|
||||||
model.getStampTax().set(0.03f);
|
model.getStampTax().set(0.03f);
|
||||||
model.getTaxAndSurcharges().set(11);
|
model.getTaxAndSurcharges().set(11);
|
||||||
model.getApplicant().set(project.getApplicant());
|
if (project.getApplicantId() != null) {
|
||||||
|
model.getApplicant().set(project.getApplicantId());
|
||||||
|
}
|
||||||
model.getApplyTime().set(LocalDateTime.now());
|
model.getApplyTime().set(LocalDateTime.now());
|
||||||
saveRow(model);
|
saveRow(model);
|
||||||
return model;
|
return model;
|
||||||
@@ -166,21 +181,20 @@ public class ProjectTabSkinCost
|
|||||||
private void onTableCopyAction(ActionEvent event) {
|
private void onTableCopyAction(ActionEvent event) {
|
||||||
ProjectCostViewModel selectedItem = table.getSelectionModel().getSelectedItem();
|
ProjectCostViewModel selectedItem = table.getSelectionModel().getSelectedItem();
|
||||||
|
|
||||||
ProjectCost selectedCost = loadRowData(selectedItem);
|
ProjectCostVo selectedCost = loadRowData(selectedItem);
|
||||||
ProjectCost projectCost = new ProjectCost();
|
ProjectCostVo projectCost = new ProjectCostVo();
|
||||||
selectedItem.copyTo(projectCost);
|
selectedItem.copyTo(projectCost);
|
||||||
projectCost.setId(null);
|
projectCost.setId(null);
|
||||||
projectCost.setVersion(selectedItem.getVersion().get() + 1);
|
projectCost.setVersion(selectedItem.getVersion().get() + 1);
|
||||||
projectCost.setApplyTime(LocalDateTime.now());
|
projectCost.setApplyTime(LocalDateTime.now());
|
||||||
projectCost = saveRowData(projectCost);
|
projectCost = saveRowData(projectCost);
|
||||||
|
|
||||||
|
|
||||||
ProjectCostItemService costItemService = getCostItemService();
|
ProjectCostItemService costItemService = getCostItemService();
|
||||||
for (ProjectCostItem selectedCostItem : costItemService.findByCost(selectedCost)) {
|
for (ProjectCostItemVo selectedCostItem : costItemService.findByCost(selectedCost)) {
|
||||||
ProjectCostItem item = new ProjectCostItem();
|
ProjectCostItemVo item = new ProjectCostItemVo();
|
||||||
ProjectCostItemViewModel.from(selectedCostItem).copyTo(item);
|
ProjectCostItemViewModel.from(selectedCostItem).copyTo(item);
|
||||||
item.setId(null);
|
item.setId(null);
|
||||||
item.setCost(projectCost);
|
item.setCostId(projectCost.getId());
|
||||||
costItemService.save(item);
|
costItemService.save(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ecep.contract.controller.project;
|
package com.ecep.contract.controller.project;
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
@@ -10,15 +11,14 @@ import com.ecep.contract.controller.tab.RefreshableSkin;
|
|||||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||||
import com.ecep.contract.converter.CompanyStringConverter;
|
import com.ecep.contract.converter.CompanyStringConverter;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
import com.ecep.contract.model.CustomerSatisfactionSurvey;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Project;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.CustomerSatisfactionSurveyService;
|
import com.ecep.contract.service.CustomerSatisfactionSurveyService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.CustomerSatisfactionSurveyViewModel;
|
import com.ecep.contract.vm.CustomerSatisfactionSurveyViewModel;
|
||||||
|
import com.ecep.contract.vo.CustomerSatisfactionSurveyVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
@@ -27,13 +27,16 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@FxmlPath("/ui/project/project-tab-customer-satisfaction-survey.fxml")
|
@FxmlPath("/ui/project/project-tab-customer-satisfaction-survey.fxml")
|
||||||
public class ProjectTabSkinCustomerSatisfactionSurvey
|
public class ProjectTabSkinCustomerSatisfactionSurvey
|
||||||
extends AbstProjectTableTabSkin<CustomerSatisfactionSurvey, CustomerSatisfactionSurveyViewModel>
|
extends AbstProjectTableTabSkin<CustomerSatisfactionSurveyVo, CustomerSatisfactionSurveyViewModel>
|
||||||
implements RefreshableSkin {
|
implements RefreshableSkin {
|
||||||
|
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> idColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> idColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, String> codeColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, String> codeColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> totalScoreColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Number> totalScoreColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, Employee> applicantColumn;
|
/**
|
||||||
|
* 申请方, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<CustomerSatisfactionSurveyViewModel, Integer> applicantColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDateTime> applyTimeColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDateTime> applyTimeColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, String> descriptionColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, String> descriptionColumn;
|
||||||
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDate> dateColumn;
|
public TableColumn<CustomerSatisfactionSurveyViewModel, LocalDate> dateColumn;
|
||||||
@@ -84,8 +87,8 @@ public class ProjectTabSkinCustomerSatisfactionSurvey
|
|||||||
@Override
|
@Override
|
||||||
protected CustomerSatisfactionSurveyViewModel createNewViewModel() {
|
protected CustomerSatisfactionSurveyViewModel createNewViewModel() {
|
||||||
CustomerSatisfactionSurveyViewModel model = super.createNewViewModel();
|
CustomerSatisfactionSurveyViewModel model = super.createNewViewModel();
|
||||||
Project project = getParent();
|
ProjectVo project = getParent();
|
||||||
model.getApplicant().set(controller.getCurrentUser());
|
model.getApplicant().set(com.ecep.contract.Desktop.instance.getActiveEmployeeId());
|
||||||
LocalDate created = project.getCreated();
|
LocalDate created = project.getCreated();
|
||||||
if (created == null) {
|
if (created == null) {
|
||||||
created = LocalDate.now();
|
created = LocalDate.now();
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.ecep.contract.vo.ContractVo;
|
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -15,8 +13,6 @@ import com.ecep.contract.ContractPayWay;
|
|||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.controller.table.cell.NumberTableCell;
|
import com.ecep.contract.controller.table.cell.NumberTableCell;
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.ContractPayPlan;
|
|
||||||
import com.ecep.contract.model.Project;
|
import com.ecep.contract.model.Project;
|
||||||
import com.ecep.contract.model.ProjectFundPlan;
|
import com.ecep.contract.model.ProjectFundPlan;
|
||||||
import com.ecep.contract.service.ContractPayPlanService;
|
import com.ecep.contract.service.ContractPayPlanService;
|
||||||
@@ -25,6 +21,10 @@ import com.ecep.contract.service.ProjectFundPlanService;
|
|||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.NumberUtils;
|
import com.ecep.contract.util.NumberUtils;
|
||||||
import com.ecep.contract.vm.ProjectFundPlanViewModel;
|
import com.ecep.contract.vm.ProjectFundPlanViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.ProjectFundPlanVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
@@ -39,8 +39,8 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/project/project-tab-fund-plan.fxml")
|
@FxmlPath("/ui/project/project-tab-fund-plan.fxml")
|
||||||
public class ProjectTabSkinFundPlan
|
public class ProjectTabSkinFundPlan
|
||||||
extends AbstProjectTableTabSkin<ProjectFundPlan, ProjectFundPlanViewModel>
|
extends AbstProjectTableTabSkin<ProjectFundPlanVo, ProjectFundPlanViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ProjectFundPlan, ProjectFundPlanViewModel> {
|
implements TabSkin, EditableEntityTableTabSkin<ProjectFundPlanVo, ProjectFundPlanViewModel> {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ProjectTabSkinFundPlan.class);
|
private static final Logger logger = LoggerFactory.getLogger(ProjectTabSkinFundPlan.class);
|
||||||
|
|
||||||
public TableColumn<ProjectFundPlanViewModel, Number> idColumn;
|
public TableColumn<ProjectFundPlanViewModel, Number> idColumn;
|
||||||
@@ -114,7 +114,7 @@ public class ProjectTabSkinFundPlan
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProjectFundPlanViewModel> loadTableData(Project parent) {
|
public List<ProjectFundPlanViewModel> loadTableData(ProjectVo parent) {
|
||||||
List<ProjectFundPlanViewModel> rows = super.loadTableData(parent);
|
List<ProjectFundPlanViewModel> rows = super.loadTableData(parent);
|
||||||
if (rows == null) {
|
if (rows == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -152,12 +152,12 @@ public class ProjectTabSkinFundPlan
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ProjectFundPlan> fundPlans = getViewModelService().findAllByProject(project);
|
List<ProjectFundPlanVo> fundPlans = getViewModelService().findAllByProject(project);
|
||||||
// 将现有的项目资金计划转为以 ContractPayPlan 的id为key的map
|
// 将现有的项目资金计划转为以 ContractPayPlan 的id为key的map
|
||||||
java.util.Map<Number, ProjectFundPlan> fundPlansMap = fundPlans.stream()
|
java.util.Map<Number, ProjectFundPlanVo> fundPlansMap = fundPlans.stream()
|
||||||
.filter(plan -> plan.getContractPayPlan() != null && plan.getContractPayPlan().getId() != null)
|
.filter(plan -> plan.getContractPayPlanId() != null)
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
plan -> plan.getContractPayPlan().getId(),
|
plan -> plan.getContractPayPlanId(),
|
||||||
plan -> plan));
|
plan -> plan));
|
||||||
|
|
||||||
// 获取项目关联的所有合同
|
// 获取项目关联的所有合同
|
||||||
@@ -170,14 +170,14 @@ public class ProjectTabSkinFundPlan
|
|||||||
// 遍历所有合同
|
// 遍历所有合同
|
||||||
for (ContractVo contract : contracts) {
|
for (ContractVo contract : contracts) {
|
||||||
// 获取合同的付款计划
|
// 获取合同的付款计划
|
||||||
List<ContractPayPlan> payPlans = getContractPayPlanService().findAllByContract(contract);
|
List<ContractPayPlanVo> payPlans = getContractPayPlanService().findAllByContract(contract);
|
||||||
|
|
||||||
// 遍历每个付款计划
|
// 遍历每个付款计划
|
||||||
for (ContractPayPlan payPlan : payPlans) {
|
for (ContractPayPlanVo payPlan : payPlans) {
|
||||||
// 检查是否已存在相同的合同付款计划
|
// 检查是否已存在相同的合同付款计划
|
||||||
if (fundPlansMap.containsKey(payPlan.getId())) {
|
if (fundPlansMap.containsKey(payPlan.getId())) {
|
||||||
// 更新
|
// 更新
|
||||||
ProjectFundPlan fundPlan = fundPlansMap.remove(payPlan.getId());
|
ProjectFundPlanVo fundPlan = fundPlansMap.remove(payPlan.getId());
|
||||||
// 检查是否需要更新
|
// 检查是否需要更新
|
||||||
boolean needsUpdate = false;
|
boolean needsUpdate = false;
|
||||||
if (!Objects.equals(fundPlan.getPayWay(), contract.getPayWay())) {
|
if (!Objects.equals(fundPlan.getPayWay(), contract.getPayWay())) {
|
||||||
@@ -201,7 +201,7 @@ public class ProjectTabSkinFundPlan
|
|||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
fundPlan.setContractPayPlan(payPlan);
|
fundPlan.setContractPayPlanId(payPlan.getId());
|
||||||
fundPlan.setUpdateDate(LocalDateTime.now());
|
fundPlan.setUpdateDate(LocalDateTime.now());
|
||||||
saveRowData(fundPlan);
|
saveRowData(fundPlan);
|
||||||
}
|
}
|
||||||
@@ -209,14 +209,14 @@ public class ProjectTabSkinFundPlan
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建新的项目资金计划
|
// 创建新的项目资金计划
|
||||||
ProjectFundPlan fundPlan = getViewModelService().newInstanceByProject(project);
|
ProjectFundPlanVo fundPlan = getViewModelService().newInstanceByProject(project);
|
||||||
// 设置资金计划的属性
|
// 设置资金计划的属性
|
||||||
fundPlan.setPayDate(payPlan.getPayDate());
|
fundPlan.setPayDate(payPlan.getPayDate());
|
||||||
fundPlan.setPayWay(contract.getPayWay());
|
fundPlan.setPayWay(contract.getPayWay());
|
||||||
fundPlan.setPayRatio(payPlan.getPayRatio());
|
fundPlan.setPayRatio(payPlan.getPayRatio());
|
||||||
fundPlan.setPayTerm(payPlan.getPayTerm());
|
fundPlan.setPayTerm(payPlan.getPayTerm());
|
||||||
fundPlan.setPayCurrency(payPlan.getPayCurrency());
|
fundPlan.setPayCurrency(payPlan.getPayCurrency());
|
||||||
fundPlan.setContractPayPlan(payPlan);
|
fundPlan.setContractPayPlanId(payPlan.getId());
|
||||||
fundPlan.setUpdateDate(LocalDateTime.now());
|
fundPlan.setUpdateDate(LocalDateTime.now());
|
||||||
saveRowData(fundPlan);
|
saveRowData(fundPlan);
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ public class ProjectTabSkinFundPlan
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
if (!fundPlansMap.isEmpty()) {
|
if (!fundPlansMap.isEmpty()) {
|
||||||
for (ProjectFundPlan fundPlan : fundPlansMap.values()) {
|
for (ProjectFundPlanVo fundPlan : fundPlansMap.values()) {
|
||||||
getViewModelService().delete(fundPlan);
|
getViewModelService().delete(fundPlan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -237,12 +237,11 @@ public class ProjectTabSkinFundPlan
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ProjectFundPlanViewModel createNewViewModel() {
|
protected ProjectFundPlanViewModel createNewViewModel() {
|
||||||
ProjectFundPlanViewModel model = new ProjectFundPlanViewModel();
|
ProjectFundPlanViewModel newViewModel = getViewModelService().createNewViewModel();
|
||||||
Project project = getParent();
|
ProjectVo project = getParent();
|
||||||
model.getProject().set(project);
|
newViewModel.getProject().set(project.getId());
|
||||||
model.getUpdateDate().set(LocalDateTime.now());
|
saveRow(newViewModel);
|
||||||
saveRow(model);
|
return newViewModel;
|
||||||
return model;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -259,17 +258,17 @@ public class ProjectTabSkinFundPlan
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteRowData(ProjectFundPlan entity) {
|
public void deleteRowData(ProjectFundPlanVo entity) {
|
||||||
getProjectFundPlanService().delete(entity);
|
getProjectFundPlanService().delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectFundPlan loadRowData(ProjectFundPlanViewModel row) {
|
public ProjectFundPlanVo loadRowData(ProjectFundPlanViewModel row) {
|
||||||
return getProjectFundPlanService().findById(row.getId().get());
|
return getProjectFundPlanService().findById(row.getId().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectFundPlan saveRowData(ProjectFundPlan entity) {
|
public ProjectFundPlanVo saveRowData(ProjectFundPlanVo entity) {
|
||||||
return getProjectFundPlanService().save(entity);
|
return getProjectFundPlanService().save(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,16 +14,14 @@ import com.ecep.contract.controller.table.cell.EvaluationFileTableCell;
|
|||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.converter.CompanyStringConverter;
|
import com.ecep.contract.converter.CompanyStringConverter;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
import com.ecep.contract.model.CompanyCustomerEvaluationFormFile;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Project;
|
|
||||||
import com.ecep.contract.model.ProjectQuotation;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.ProjectQuotationService;
|
import com.ecep.contract.service.ProjectQuotationService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ProjectQuotationViewModel;
|
import com.ecep.contract.vm.ProjectQuotationViewModel;
|
||||||
|
import com.ecep.contract.vo.ProjectQuotationVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TableCell;
|
import javafx.scene.control.TableCell;
|
||||||
@@ -35,17 +33,26 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@FxmlPath("/ui/project/project-tab-quotation.fxml")
|
@FxmlPath("/ui/project/project-tab-quotation.fxml")
|
||||||
public class ProjectTabSkinQuotation
|
public class ProjectTabSkinQuotation
|
||||||
extends AbstProjectTableTabSkin<ProjectQuotation, ProjectQuotationViewModel>
|
extends AbstProjectTableTabSkin<ProjectQuotationVo, ProjectQuotationViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ProjectQuotation, ProjectQuotationViewModel>, RefreshableSkin {
|
implements TabSkin, EditableEntityTableTabSkin<ProjectQuotationVo, ProjectQuotationViewModel>, RefreshableSkin {
|
||||||
|
|
||||||
public TableColumn<ProjectQuotationViewModel, Number> idColumn;
|
public TableColumn<ProjectQuotationViewModel, Number> idColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, Number> versionColumn;
|
public TableColumn<ProjectQuotationViewModel, Number> versionColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, CompanyCustomerEvaluationFormFile> evaluationFileColumn;
|
/**
|
||||||
|
* 合同文件, CompanyCustomerEvaluationFormFile
|
||||||
|
*/
|
||||||
|
public TableColumn<ProjectQuotationViewModel, Integer> evaluationFileColumn;
|
||||||
|
|
||||||
public TableColumn<ProjectQuotationViewModel, String> descriptionColumn;
|
public TableColumn<ProjectQuotationViewModel, String> descriptionColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, Employee> applicantColumn;
|
/**
|
||||||
|
* 申请人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ProjectQuotationViewModel, Integer> applicantColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, LocalDateTime> applyTimeColumn;
|
public TableColumn<ProjectQuotationViewModel, LocalDateTime> applyTimeColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, Employee> authorizerColumn;
|
/**
|
||||||
|
* 审批人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ProjectQuotationViewModel, Integer> authorizerColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, LocalDateTime> authorizationTimeColumn;
|
public TableColumn<ProjectQuotationViewModel, LocalDateTime> authorizationTimeColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, Number> levelColumn;
|
public TableColumn<ProjectQuotationViewModel, Number> levelColumn;
|
||||||
public TableColumn<ProjectQuotationViewModel, String> standardPayWayColumn;
|
public TableColumn<ProjectQuotationViewModel, String> standardPayWayColumn;
|
||||||
@@ -66,7 +73,6 @@ public class ProjectTabSkinQuotation
|
|||||||
@Setter
|
@Setter
|
||||||
private CompanyCustomerFileService customerFileService;
|
private CompanyCustomerFileService customerFileService;
|
||||||
|
|
||||||
|
|
||||||
public ProjectTabSkinQuotation(ProjectWindowController controller) {
|
public ProjectTabSkinQuotation(ProjectWindowController controller) {
|
||||||
super(controller);
|
super(controller);
|
||||||
}
|
}
|
||||||
@@ -86,11 +92,11 @@ public class ProjectTabSkinQuotation
|
|||||||
super.initializeTable();
|
super.initializeTable();
|
||||||
levelColumn.setCellValueFactory(param -> param.getValue().getLevel());
|
levelColumn.setCellValueFactory(param -> param.getValue().getLevel());
|
||||||
levelColumn.setCellFactory(param -> new LevelTableCell());
|
levelColumn.setCellFactory(param -> new LevelTableCell());
|
||||||
standardPayWayColumn.setCellValueFactory(param -> param.getValue().getStandardPayWay().map(value -> value == null ? "" : (value ? "标准" : "非标准")));
|
standardPayWayColumn.setCellValueFactory(param -> param.getValue().getStandardPayWay()
|
||||||
|
.map(value -> value == null ? "" : (value ? "标准" : "非标准")));
|
||||||
evaluationFileColumn.setCellValueFactory(param -> param.getValue().getEvaluationFile());
|
evaluationFileColumn.setCellValueFactory(param -> param.getValue().getEvaluationFile());
|
||||||
evaluationFileColumn.setCellFactory(param -> new EvaluationFileTableCell<>(getCompanyCustomerFileService()));
|
evaluationFileColumn.setCellFactory(param -> new EvaluationFileTableCell<>(getCompanyCustomerFileService()));
|
||||||
|
|
||||||
|
|
||||||
amountColumn.setCellValueFactory(param -> param.getValue().getAmount());
|
amountColumn.setCellValueFactory(param -> param.getValue().getAmount());
|
||||||
amountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
amountColumn.setCellFactory(TextFieldTableCell.forTableColumn(new CurrencyStringConverter(getLocale())));
|
||||||
|
|
||||||
@@ -103,7 +109,6 @@ public class ProjectTabSkinQuotation
|
|||||||
authorizationTimeColumn.setCellValueFactory(param -> param.getValue().getAuthorizationTime());
|
authorizationTimeColumn.setCellValueFactory(param -> param.getValue().getAuthorizationTime());
|
||||||
authorizationTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
authorizationTimeColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
|
|
||||||
descriptionColumn.setCellValueFactory(param -> param.getValue().getDescription());
|
descriptionColumn.setCellValueFactory(param -> param.getValue().getDescription());
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -111,9 +116,9 @@ public class ProjectTabSkinQuotation
|
|||||||
@Override
|
@Override
|
||||||
protected ProjectQuotationViewModel createNewViewModel() {
|
protected ProjectQuotationViewModel createNewViewModel() {
|
||||||
ProjectQuotationViewModel model = new ProjectQuotationViewModel();
|
ProjectQuotationViewModel model = new ProjectQuotationViewModel();
|
||||||
Project project = getParent();
|
ProjectVo project = getParent();
|
||||||
model.getProject().set(project);
|
model.getProject().set(project.getId());
|
||||||
model.getApplicant().set(project.getApplicant());
|
model.getApplicant().set(project.getApplicantId());
|
||||||
if (project.getAmount() != null) {
|
if (project.getAmount() != null) {
|
||||||
model.getAmount().set(project.getAmount());
|
model.getAmount().set(project.getAmount());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ package com.ecep.contract.controller.project.usage;
|
|||||||
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
import com.ecep.contract.controller.AbstEntityManagerSkin;
|
||||||
import com.ecep.contract.controller.ManagerSkin;
|
import com.ecep.contract.controller.ManagerSkin;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.model.ProductUsage;
|
|
||||||
import com.ecep.contract.service.ProductUsageService;
|
import com.ecep.contract.service.ProductUsageService;
|
||||||
import com.ecep.contract.service.ProjectService;
|
import com.ecep.contract.service.ProjectService;
|
||||||
import com.ecep.contract.vm.ProductUsageViewModel;
|
import com.ecep.contract.vm.ProductUsageViewModel;
|
||||||
|
import com.ecep.contract.vo.ProductUsageVo;
|
||||||
|
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.cell.TextFieldTableCell;
|
import javafx.scene.control.cell.TextFieldTableCell;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class ProductUsageManagerSkin
|
public class ProductUsageManagerSkin
|
||||||
extends AbstEntityManagerSkin<ProductUsage, ProductUsageViewModel, ProductUsageManagerSkin, ProductUsageManagerWindowController>
|
extends AbstEntityManagerSkin<ProductUsageVo, ProductUsageViewModel, ProductUsageManagerSkin, ProductUsageManagerWindowController>
|
||||||
implements ManagerSkin , EditableEntityTableTabSkin<ProductUsage, ProductUsageViewModel> {
|
implements ManagerSkin , EditableEntityTableTabSkin<ProductUsageVo, ProductUsageViewModel> {
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private ProjectService projectService;
|
private ProjectService projectService;
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import org.springframework.context.annotation.Scope;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstManagerWindowController;
|
import com.ecep.contract.controller.AbstManagerWindowController;
|
||||||
import com.ecep.contract.model.ProductUsage;
|
|
||||||
import com.ecep.contract.service.ProductUsageService;
|
import com.ecep.contract.service.ProductUsageService;
|
||||||
import com.ecep.contract.service.ProjectService;
|
import com.ecep.contract.service.ProjectService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ProductUsageViewModel;
|
import com.ecep.contract.vm.ProductUsageViewModel;
|
||||||
|
import com.ecep.contract.vo.ProductUsageVo;
|
||||||
|
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
@@ -23,7 +23,7 @@ import javafx.stage.Stage;
|
|||||||
@Component
|
@Component
|
||||||
@FxmlPath("/ui/project/product-usage-manager.fxml")
|
@FxmlPath("/ui/project/product-usage-manager.fxml")
|
||||||
public class ProductUsageManagerWindowController
|
public class ProductUsageManagerWindowController
|
||||||
extends AbstManagerWindowController<ProductUsage, ProductUsageViewModel, ProductUsageManagerSkin> {
|
extends AbstManagerWindowController<ProductUsageVo, ProductUsageViewModel, ProductUsageManagerSkin> {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectService projectService;
|
private ProjectService projectService;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class CompanyTabSkinFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onTableCopyAsMatchedAction_(Consumer<String> state) {
|
private void onTableCopyAsMatchedAction_(Consumer<String> state) {
|
||||||
Company company = getParent();
|
CompanyVo company = getParent();
|
||||||
|
|
||||||
CompanyFileViewModel selectedItem = getSelectedItem();
|
CompanyFileViewModel selectedItem = getSelectedItem();
|
||||||
if (selectedItem == null) {
|
if (selectedItem == null) {
|
||||||
@@ -279,12 +279,12 @@ public class CompanyTabSkinFile
|
|||||||
state.accept("新文件复制失败:" + e.getMessage());
|
state.accept("新文件复制失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyFile companyFile = new CompanyFile();
|
CompanyFileVo companyFile = new CompanyFileVo();
|
||||||
companyFile.setFilePath(dest.getAbsolutePath());
|
companyFile.setFilePath(dest.getAbsolutePath());
|
||||||
companyFile.setApplyDate(nextCreditReportDate);
|
companyFile.setApplyDate(nextCreditReportDate);
|
||||||
companyFile.setExpiringDate(nextCreditReportDate.plusYears(1));
|
companyFile.setExpiringDate(nextCreditReportDate.plusYears(1));
|
||||||
companyFile.setType(CompanyFileType.CreditReport);
|
companyFile.setType(CompanyFileType.CreditReport);
|
||||||
companyFile.setCompany(company);
|
companyFile.setCompanyId(company.getId());
|
||||||
saveRowData(companyFile);
|
saveRowData(companyFile);
|
||||||
|
|
||||||
state.accept("新文件已记录");
|
state.accept("新文件已记录");
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
|
|||||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
import com.ecep.contract.model.Invoice;
|
|
||||||
import com.ecep.contract.service.InvoiceService;
|
import com.ecep.contract.service.InvoiceService;
|
||||||
import com.ecep.contract.service.PurchaseBillVoucherService;
|
import com.ecep.contract.service.PurchaseBillVoucherService;
|
||||||
import com.ecep.contract.service.YongYouU8Service;
|
import com.ecep.contract.service.YongYouU8Service;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.InvoiceViewModel;
|
import com.ecep.contract.vm.InvoiceViewModel;
|
||||||
|
import com.ecep.contract.vo.InvoiceVo;
|
||||||
|
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
@@ -27,8 +27,8 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/company/company-tab-invoice.fxml")
|
@FxmlPath("/ui/company/company-tab-invoice.fxml")
|
||||||
public class CompanyTabSkinInvoice
|
public class CompanyTabSkinInvoice
|
||||||
extends AbstCompanyTableTabSkin<Invoice, InvoiceViewModel>
|
extends AbstCompanyTableTabSkin<InvoiceVo, InvoiceViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<Invoice, InvoiceViewModel> {
|
implements TabSkin, EditableEntityTableTabSkin<InvoiceVo, InvoiceViewModel> {
|
||||||
|
|
||||||
public TableColumn<InvoiceViewModel, Number> idColumn;
|
public TableColumn<InvoiceViewModel, Number> idColumn;
|
||||||
public TableColumn<InvoiceViewModel, String> codeColumn;
|
public TableColumn<InvoiceViewModel, String> codeColumn;
|
||||||
@@ -63,14 +63,6 @@ public class CompanyTabSkinInvoice
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeTab() {
|
public void initializeTab() {
|
||||||
|
|
||||||
if (u8Service == null) {
|
|
||||||
try {
|
|
||||||
u8Service = getBean(YongYouU8Service.class);
|
|
||||||
} catch (BeansException ignored) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
searchKeyField.setOnKeyReleased(event -> {
|
searchKeyField.setOnKeyReleased(event -> {
|
||||||
if (event.getCode() == KeyCode.ENTER) {
|
if (event.getCode() == KeyCode.ENTER) {
|
||||||
searchBtn.fire();
|
searchBtn.fire();
|
||||||
@@ -96,18 +88,11 @@ public class CompanyTabSkinInvoice
|
|||||||
// ContractWindowController.show(item, controller.root.getScene().getWindow());
|
// ContractWindowController.show(item, controller.root.getScene().getWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private PurchaseBillVoucherService getPurchaseBillVoucherService() {
|
private YongYouU8Service getU8Service() {
|
||||||
if (purchaseBillVoucherService == null) {
|
if (u8Service == null) {
|
||||||
purchaseBillVoucherService = getBean(PurchaseBillVoucherService.class);
|
u8Service = getBean(YongYouU8Service.class);
|
||||||
}
|
}
|
||||||
return purchaseBillVoucherService;
|
return u8Service;
|
||||||
}
|
|
||||||
|
|
||||||
private EmployeeStringConverter getEmployeeStringConverter() {
|
|
||||||
if (employeeStringConverter == null) {
|
|
||||||
employeeStringConverter = getBean(EmployeeStringConverter.class);
|
|
||||||
}
|
|
||||||
return employeeStringConverter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private InvoiceService getInvoiceService() {
|
private InvoiceService getInvoiceService() {
|
||||||
|
|||||||
@@ -19,11 +19,7 @@ import com.ecep.contract.MyDateTimeUtils;
|
|||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
import com.ecep.contract.controller.company.AbstCompanyBasedTabSkin;
|
import com.ecep.contract.controller.company.AbstCompanyBasedTabSkin;
|
||||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||||
import com.ecep.contract.model.CloudRk;
|
|
||||||
import com.ecep.contract.model.CloudTyc;
|
|
||||||
import com.ecep.contract.model.CloudYu;
|
|
||||||
import com.ecep.contract.model.Company;
|
import com.ecep.contract.model.Company;
|
||||||
import com.ecep.contract.model.CompanyExtendInfo;
|
|
||||||
import com.ecep.contract.service.CloudRkService;
|
import com.ecep.contract.service.CloudRkService;
|
||||||
import com.ecep.contract.service.CloudTycService;
|
import com.ecep.contract.service.CloudTycService;
|
||||||
import com.ecep.contract.service.CompanyExtendInfoService;
|
import com.ecep.contract.service.CompanyExtendInfoService;
|
||||||
@@ -35,6 +31,11 @@ import com.ecep.contract.vm.CloudRkViewModel;
|
|||||||
import com.ecep.contract.vm.CloudTycInfoViewModel;
|
import com.ecep.contract.vm.CloudTycInfoViewModel;
|
||||||
import com.ecep.contract.vm.CloudYuInfoViewModel;
|
import com.ecep.contract.vm.CloudYuInfoViewModel;
|
||||||
import com.ecep.contract.vm.CompanyExtendInfoViewModel;
|
import com.ecep.contract.vm.CompanyExtendInfoViewModel;
|
||||||
|
import com.ecep.contract.vo.CloudRkVo;
|
||||||
|
import com.ecep.contract.vo.CloudTycVo;
|
||||||
|
import com.ecep.contract.vo.CloudYuVo;
|
||||||
|
import com.ecep.contract.vo.CompanyExtendInfoVo;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@@ -145,7 +146,7 @@ public class CompanyTabSkinOther
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabShown() {
|
public void onTabShown() {
|
||||||
Company parent = getEntity();
|
CompanyVo parent = getEntity();
|
||||||
updateRKCloudPane(parent, rkCloudPane);
|
updateRKCloudPane(parent, rkCloudPane);
|
||||||
updateTYCCloudPane(parent, tycCloudPane);
|
updateTYCCloudPane(parent, tycCloudPane);
|
||||||
updateYuCloudPane(parent, yuCloudPane);
|
updateYuCloudPane(parent, yuCloudPane);
|
||||||
@@ -194,12 +195,12 @@ public class CompanyTabSkinOther
|
|||||||
public void save(CloudRkViewModel viewModel) {
|
public void save(CloudRkViewModel viewModel) {
|
||||||
int infoId = viewModel.getId().get();
|
int infoId = viewModel.getId().get();
|
||||||
CloudRkService service = getCloudRkService();
|
CloudRkService service = getCloudRkService();
|
||||||
CloudRk cloudRk = service.findById(infoId);
|
CloudRkVo cloudRk = service.findById(infoId);
|
||||||
if (cloudRk == null) {
|
if (cloudRk == null) {
|
||||||
throw new RuntimeException("CloudRk not found");
|
throw new RuntimeException("CloudRk not found");
|
||||||
}
|
}
|
||||||
if (viewModel.copyTo(cloudRk)) {
|
if (viewModel.copyTo(cloudRk)) {
|
||||||
CloudRk saved = service.save(cloudRk);
|
CloudRkVo saved = service.save(cloudRk);
|
||||||
if (Platform.isFxApplicationThread()) {
|
if (Platform.isFxApplicationThread()) {
|
||||||
viewModel.update(saved);
|
viewModel.update(saved);
|
||||||
} else {
|
} else {
|
||||||
@@ -234,7 +235,7 @@ public class CompanyTabSkinOther
|
|||||||
*/
|
*/
|
||||||
private void onCloudRkUpdateButtonClicked(ActionEvent actionEvent) throws IOException {
|
private void onCloudRkUpdateButtonClicked(ActionEvent actionEvent) throws IOException {
|
||||||
Button button = (Button) actionEvent.getSource();
|
Button button = (Button) actionEvent.getSource();
|
||||||
Company company = getEntity();
|
CompanyVo company = getEntity();
|
||||||
MessageHolder holder = (level, message) -> {
|
MessageHolder holder = (level, message) -> {
|
||||||
setStatus(message);
|
setStatus(message);
|
||||||
if (level == Level.WARNING) {
|
if (level == Level.WARNING) {
|
||||||
@@ -245,7 +246,7 @@ public class CompanyTabSkinOther
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CloudRk cloudRk = getCloudRkService().updateCloudRk(company, holder);
|
CloudRkVo cloudRk = getCloudRkService().updateCloudRk(company, holder);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
rkCloudInfoViewModel.update(cloudRk);
|
rkCloudInfoViewModel.update(cloudRk);
|
||||||
});
|
});
|
||||||
@@ -284,14 +285,14 @@ public class CompanyTabSkinOther
|
|||||||
if (StringUtils.hasText(cloudId)) {
|
if (StringUtils.hasText(cloudId)) {
|
||||||
url = String.format(CloudServiceConstant.TYC_URL_COMPANY, cloudId);
|
url = String.format(CloudServiceConstant.TYC_URL_COMPANY, cloudId);
|
||||||
} else {
|
} else {
|
||||||
Company company = getEntity();
|
CompanyVo company = getEntity();
|
||||||
url = String.format(CloudServiceConstant.TYC_URL_COMPANY_SEARCH, company.getName());
|
url = String.format(CloudServiceConstant.TYC_URL_COMPANY_SEARCH, company.getName());
|
||||||
}
|
}
|
||||||
DesktopUtils.showInBrowse(url);
|
DesktopUtils.showInBrowse(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTycCloudPaneHyperLinkInnerViewClickedAction(ActionEvent event) {
|
public void onTycCloudPaneHyperLinkInnerViewClickedAction(ActionEvent event) {
|
||||||
Company company = getEntity();
|
CompanyVo company = getEntity();
|
||||||
String cloudId = tycCloudInfoViewModel.getCloudId().get();
|
String cloudId = tycCloudInfoViewModel.getCloudId().get();
|
||||||
|
|
||||||
String url = String.format(CloudServiceConstant.TYC_URL_COMPANY_SEARCH, company.getName());
|
String url = String.format(CloudServiceConstant.TYC_URL_COMPANY_SEARCH, company.getName());
|
||||||
@@ -441,11 +442,10 @@ public class CompanyTabSkinOther
|
|||||||
button.setDisable(false);
|
button.setDisable(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCloudYuUpdateButtonClicked(ActionEvent event) {
|
private void onCloudYuUpdateButtonClicked(ActionEvent event) {
|
||||||
Company company = getEntity();
|
CompanyVo company = getEntity();
|
||||||
// service.syncVendor(company);
|
// service.syncVendor(company);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -473,12 +473,12 @@ public class CompanyTabSkinOther
|
|||||||
public void save(CompanyExtendInfoViewModel viewModel) {
|
public void save(CompanyExtendInfoViewModel viewModel) {
|
||||||
int infoId = viewModel.getId().get();
|
int infoId = viewModel.getId().get();
|
||||||
CompanyExtendInfoService service = getExtendInfoService();
|
CompanyExtendInfoService service = getExtendInfoService();
|
||||||
CompanyExtendInfo cloudRk = service.findById(infoId);
|
CompanyExtendInfoVo cloudRk = service.findById(infoId);
|
||||||
if (cloudRk == null) {
|
if (cloudRk == null) {
|
||||||
throw new RuntimeException("CloudRk not found");
|
throw new RuntimeException("CompanyExtendInfo not found");
|
||||||
}
|
}
|
||||||
if (viewModel.copyTo(cloudRk)) {
|
if (viewModel.copyTo(cloudRk)) {
|
||||||
CompanyExtendInfo saved = service.save(cloudRk);
|
CompanyExtendInfoVo saved = service.save(cloudRk);
|
||||||
if (Platform.isFxApplicationThread()) {
|
if (Platform.isFxApplicationThread()) {
|
||||||
viewModel.update(saved);
|
viewModel.update(saved);
|
||||||
} else {
|
} else {
|
||||||
@@ -489,38 +489,39 @@ public class CompanyTabSkinOther
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRKCloudPane(Company company, TitledPane pane) {
|
private void updateRKCloudPane(CompanyVo company, TitledPane pane) {
|
||||||
CloudRkViewModel viewModel = rkCloudInfoViewModel;
|
CloudRkViewModel viewModel = rkCloudInfoViewModel;
|
||||||
CloudRk cloudRk = getCloudRkService().getOrCreateCloudRk(company);
|
CloudRkVo cloudRk = getCloudRkService().getOrCreateCloudRk(company);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
viewModel.update(cloudRk);
|
viewModel.update(cloudRk);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTYCCloudPane(Company company, TitledPane pane) {
|
private void updateTYCCloudPane(CompanyVo company, TitledPane pane) {
|
||||||
CloudTycInfoViewModel viewModel = tycCloudInfoViewModel;
|
CloudTycInfoViewModel viewModel = tycCloudInfoViewModel;
|
||||||
CloudTyc cloudTyc = getCloudTycService().getOrCreateCloudTyc(company);
|
CloudTycVo cloudTyc = getCloudTycService().getOrCreateCloudTyc(company);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
viewModel.update(cloudTyc);
|
viewModel.update(cloudTyc);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateYuCloudPane(Company company, TitledPane pane) {
|
private void updateYuCloudPane(CompanyVo company, TitledPane pane) {
|
||||||
CloudYuInfoViewModel viewModel = yuCloudInfoViewModel;
|
CloudYuInfoViewModel viewModel = yuCloudInfoViewModel;
|
||||||
if (yongYouU8Service == null) {
|
if (yongYouU8Service == null) {
|
||||||
setStatus("未启用 " + CloudServiceConstant.U8_NAME + " 服务");
|
setStatus("未启用 " + CloudServiceConstant.U8_NAME + " 服务");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CloudYu cloudYu = yongYouU8Service.getOrCreateCloudYu(company);
|
|
||||||
|
CloudYuVo cloudYu = yongYouU8Service.getOrCreateCloudYu(company);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
viewModel.update(cloudYu);
|
viewModel.update(cloudYu);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateExtendInfoPane(Company company, TitledPane pane) {
|
private void updateExtendInfoPane(CompanyVo company, TitledPane pane) {
|
||||||
CompanyExtendInfoViewModel viewModel = extendInfoViewModel;
|
CompanyExtendInfoViewModel viewModel = extendInfoViewModel;
|
||||||
CompanyExtendInfoService service = getExtendInfoService();
|
CompanyExtendInfoService service = getExtendInfoService();
|
||||||
CompanyExtendInfo extendInfo = service.findByCompany(company);
|
CompanyExtendInfoVo extendInfo = service.findByCompany(company);
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
viewModel.update(extendInfo);
|
viewModel.update(extendInfo);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|
||||||
import com.ecep.contract.util.FxmlPath;
|
|
||||||
import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
|
import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
|
||||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Invoice;
|
|
||||||
import com.ecep.contract.model.PurchaseBillVoucher;
|
|
||||||
import com.ecep.contract.service.InvoiceService;
|
|
||||||
import com.ecep.contract.service.YongYouU8Service;
|
|
||||||
import com.ecep.contract.service.PurchaseBillVoucherService;
|
|
||||||
import com.ecep.contract.vm.PurchaseBillVoucherViewModel;
|
|
||||||
import com.ecep.contract.controller.table.cell.InvoiceTableCell;
|
import com.ecep.contract.controller.table.cell.InvoiceTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
|
import com.ecep.contract.model.Invoice;
|
||||||
|
import com.ecep.contract.service.InvoiceService;
|
||||||
|
import com.ecep.contract.service.PurchaseBillVoucherService;
|
||||||
|
import com.ecep.contract.service.YongYouU8Service;
|
||||||
|
import com.ecep.contract.util.FxmlPath;
|
||||||
|
import com.ecep.contract.vm.PurchaseBillVoucherViewModel;
|
||||||
|
import com.ecep.contract.vo.PurchaseBillVoucherVo;
|
||||||
|
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
@@ -32,18 +32,30 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/company/company-tab-purchase-bill-voucher.fxml")
|
@FxmlPath("/ui/company/company-tab-purchase-bill-voucher.fxml")
|
||||||
public class CompanyTabSkinPurchaseBillVoucher
|
public class CompanyTabSkinPurchaseBillVoucher
|
||||||
extends AbstCompanyTableTabSkin<PurchaseBillVoucher, PurchaseBillVoucherViewModel>
|
extends AbstCompanyTableTabSkin<PurchaseBillVoucherVo, PurchaseBillVoucherViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
|
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Number> contractTable_idColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, Number> contractTable_idColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Number> contractTable_refIdColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, Number> contractTable_refIdColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Invoice> invoiceColumn;
|
/**
|
||||||
|
* 发票, Invoice
|
||||||
|
*/
|
||||||
|
public TableColumn<PurchaseBillVoucherViewModel, Integer> invoiceColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, String> contractTable_codeColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, String> contractTable_codeColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Employee> employeeColumn;
|
/**
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Employee> makerColumn;
|
* 关联的员工, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<PurchaseBillVoucherViewModel, Integer> employeeColumn;
|
||||||
|
/**
|
||||||
|
* 制单人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<PurchaseBillVoucherViewModel, Integer> makerColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> makerDateColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> makerDateColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> modifyDateColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> modifyDateColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, Employee> verifierColumn;
|
/**
|
||||||
|
* 审核人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<PurchaseBillVoucherViewModel, Integer> verifierColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> verifierDateColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, LocalDateTime> verifierDateColumn;
|
||||||
public TableColumn<PurchaseBillVoucherViewModel, String> descriptionColumn;
|
public TableColumn<PurchaseBillVoucherViewModel, String> descriptionColumn;
|
||||||
|
|
||||||
@@ -53,7 +65,6 @@ public class CompanyTabSkinPurchaseBillVoucher
|
|||||||
public MenuItem contractTable_menu_add;
|
public MenuItem contractTable_menu_add;
|
||||||
public MenuItem contractTable_menu_del;
|
public MenuItem contractTable_menu_del;
|
||||||
|
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private PurchaseBillVoucherService purchaseBillVoucherService;
|
private PurchaseBillVoucherService purchaseBillVoucherService;
|
||||||
@Setter
|
@Setter
|
||||||
@@ -100,21 +111,20 @@ public class CompanyTabSkinPurchaseBillVoucher
|
|||||||
contractTable_codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
contractTable_codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
||||||
|
|
||||||
employeeColumn.setCellValueFactory(param -> param.getValue().getEmployee());
|
employeeColumn.setCellValueFactory(param -> param.getValue().getEmployee());
|
||||||
employeeColumn.setCellFactory(TextFieldTableCell.forTableColumn(getEmployeeStringConverter()));
|
employeeColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
|
|
||||||
invoiceColumn.setCellValueFactory(param -> param.getValue().getInvoice());
|
|
||||||
invoiceColumn.setCellFactory(param -> new InvoiceTableCell<>(getInvoiceService()));
|
|
||||||
|
|
||||||
|
invoiceColumn.setCellValueFactory(param -> param.getValue().getInvoiceId());
|
||||||
|
invoiceColumn.setCellFactory(InvoiceTableCell.forTableColumn(getInvoiceService()));
|
||||||
|
|
||||||
makerColumn.setCellValueFactory(param -> param.getValue().getMaker());
|
makerColumn.setCellValueFactory(param -> param.getValue().getMaker());
|
||||||
makerColumn.setCellFactory(TextFieldTableCell.forTableColumn(getEmployeeStringConverter()));
|
makerColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
makerDateColumn.setCellValueFactory(param -> param.getValue().getMakerDate());
|
makerDateColumn.setCellValueFactory(param -> param.getValue().getMakerDate());
|
||||||
makerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
makerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
modifyDateColumn.setCellValueFactory(param -> param.getValue().getModifyDate());
|
modifyDateColumn.setCellValueFactory(param -> param.getValue().getModifyDate());
|
||||||
modifyDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
modifyDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
verifierColumn.setCellValueFactory(param -> param.getValue().getVerifier());
|
verifierColumn.setCellValueFactory(param -> param.getValue().getVerifier());
|
||||||
verifierColumn.setCellFactory(TextFieldTableCell.forTableColumn(getEmployeeStringConverter()));
|
verifierColumn.setCellFactory(EmployeeTableCell.forTableColumn(getEmployeeService()));
|
||||||
verifierDateColumn.setCellValueFactory(param -> param.getValue().getVerifierDate());
|
verifierDateColumn.setCellValueFactory(param -> param.getValue().getVerifierDate());
|
||||||
verifierDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
verifierDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
package com.ecep.contract.controller.tab;
|
package com.ecep.contract.controller.tab;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.task.Tasker;
|
import com.ecep.contract.task.Tasker;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class ContractFilesRebuildTasker extends Tasker<Object> {
|
public class ContractFilesRebuildTasker extends Tasker<Object> {
|
||||||
@Setter
|
@Setter
|
||||||
private Contract contract;
|
private ContractVo contract;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public Object execute(MessageHolder holder) {
|
||||||
|
|||||||
@@ -7,15 +7,9 @@ import java.util.List;
|
|||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
import java.util.stream.StreamSupport;
|
|
||||||
|
|
||||||
import javafx.beans.value.ObservableValue;
|
|
||||||
import org.controlsfx.control.textfield.TextFields;
|
import org.controlsfx.control.textfield.TextFields;
|
||||||
import org.controlsfx.glyphfont.Glyph;
|
import org.controlsfx.glyphfont.Glyph;
|
||||||
import com.ecep.contract.util.ProxyUtils;
|
|
||||||
import org.springframework.util.StreamUtils;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.ContractPayWay;
|
import com.ecep.contract.ContractPayWay;
|
||||||
@@ -27,16 +21,8 @@ import com.ecep.contract.controller.project.ProjectWindowController;
|
|||||||
import com.ecep.contract.controller.vendor.CompanyVendorWindowController;
|
import com.ecep.contract.controller.vendor.CompanyVendorWindowController;
|
||||||
import com.ecep.contract.converter.CompanyStringConverter;
|
import com.ecep.contract.converter.CompanyStringConverter;
|
||||||
import com.ecep.contract.converter.ContractStringConverter;
|
import com.ecep.contract.converter.ContractStringConverter;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
|
||||||
import com.ecep.contract.converter.ProjectStringConverter;
|
import com.ecep.contract.converter.ProjectStringConverter;
|
||||||
import com.ecep.contract.model.Company;
|
|
||||||
import com.ecep.contract.model.CompanyCustomer;
|
|
||||||
import com.ecep.contract.model.CompanyVendor;
|
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.ContractType;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Project;
|
import com.ecep.contract.model.Project;
|
||||||
import com.ecep.contract.model.ProjectSaleType;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
import com.ecep.contract.service.CompanyVendorService;
|
import com.ecep.contract.service.CompanyVendorService;
|
||||||
import com.ecep.contract.service.ContractGroupService;
|
import com.ecep.contract.service.ContractGroupService;
|
||||||
@@ -48,6 +34,14 @@ import com.ecep.contract.service.ProjectSaleTypeService;
|
|||||||
import com.ecep.contract.service.ProjectService;
|
import com.ecep.contract.service.ProjectService;
|
||||||
import com.ecep.contract.service.VendorGroupService;
|
import com.ecep.contract.service.VendorGroupService;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||||
|
import com.ecep.contract.vo.CompanyVendorVo;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
import com.ecep.contract.vo.ContractTypeVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.EmployeeVo;
|
||||||
|
import com.ecep.contract.vo.ProjectSaleTypeVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
@@ -113,47 +107,23 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
|
|
||||||
initializeBaseTabCompanyFieldAutoCompletion(controller.companyField);
|
initializeBaseTabCompanyFieldAutoCompletion(controller.companyField);
|
||||||
|
|
||||||
controller.groupField.textProperty().bind(viewModel.getGroup().map(group -> {
|
UITools.autoCompletion(controller.groupField, viewModel.getGroup(), getContractGroupService());
|
||||||
ContractGroupService groupService = getContractGroupService();
|
UITools.autoCompletion(controller.typeField, viewModel.getType(), getContractTypeService());
|
||||||
if (!ProxyUtils.isInitialized(group)) {
|
UITools.autoCompletion(controller.kindField, viewModel.getKind(), getContractKindService());
|
||||||
group = groupService.findById(group.getId());
|
|
||||||
}
|
|
||||||
return group.getCode() + " " + group.getName() + " " + group.getTitle();
|
|
||||||
}));
|
|
||||||
|
|
||||||
controller.typeField.textProperty().bind(viewModel.getType().map(type -> {
|
|
||||||
ContractTypeService typeService = controller.getCachedBean(ContractTypeService.class);
|
|
||||||
if (!ProxyUtils.isInitialized(type)) {
|
|
||||||
type = typeService.findById(type.getId());
|
|
||||||
}
|
|
||||||
return type.getCode() + " " + type.getCatalog() + " " + type.getName() + " " + type.getTitle() + "("
|
|
||||||
+ type.getDirection() + ")";
|
|
||||||
}));
|
|
||||||
|
|
||||||
controller.kindField.textProperty().bind(viewModel.getKind().map(kind -> {
|
|
||||||
ContractKindService kindService = controller.getCachedBean(ContractKindService.class);
|
|
||||||
if (!ProxyUtils.isInitialized(kind)) {
|
|
||||||
kind = kindService.findById(kind.getId());
|
|
||||||
}
|
|
||||||
return kind.getCode() + " " + kind.getName() + " " + kind.getTitle();
|
|
||||||
}));
|
|
||||||
|
|
||||||
// as customer
|
// as customer
|
||||||
controller.openRelativeCompanyCustomerBtn.setOnAction(this::onContractOpenRelativeCompanyCustomerAction);
|
controller.openRelativeCompanyCustomerBtn.setOnAction(this::onContractOpenRelativeCompanyCustomerAction);
|
||||||
controller.openRelativeCompanyCustomerBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> {
|
controller.openRelativeCompanyCustomerBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> {
|
||||||
|
Integer typeId = viewModel.getType().get();
|
||||||
ContractType type = viewModel.getType().get();
|
if (typeId == null) {
|
||||||
if (type == null) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Company company = viewModel.getCompany().get();
|
Integer companyId = viewModel.getCompany().get();
|
||||||
if (company == null) {
|
if (companyId == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!ProxyUtils.isInitialized(type)) {
|
|
||||||
ContractTypeService typeService = controller.getCachedBean(ContractTypeService.class);
|
ContractTypeService typeService = controller.getCachedBean(ContractTypeService.class);
|
||||||
type = typeService.findById(type.getId());
|
ContractTypeVo type = typeService.findById(typeId);
|
||||||
}
|
|
||||||
return !Objects.equals(type.getDirection(), "收");
|
return !Objects.equals(type.getDirection(), "收");
|
||||||
}, viewModel.getType()));
|
}, viewModel.getType()));
|
||||||
controller.openRelativeCompanyCustomerBtn.managedProperty()
|
controller.openRelativeCompanyCustomerBtn.managedProperty()
|
||||||
@@ -164,18 +134,16 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
// as vendor
|
// as vendor
|
||||||
controller.openRelativeCompanyVendorBtn.setOnAction(this::onContractOpenRelativeCompanyVendorAction);
|
controller.openRelativeCompanyVendorBtn.setOnAction(this::onContractOpenRelativeCompanyVendorAction);
|
||||||
controller.openRelativeCompanyVendorBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> {
|
controller.openRelativeCompanyVendorBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> {
|
||||||
ContractType type = viewModel.getType().get();
|
Integer typeId = viewModel.getType().get();
|
||||||
if (type == null) {
|
if (typeId == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Company company = viewModel.getCompany().get();
|
Integer companyId = viewModel.getCompany().get();
|
||||||
if (company == null) {
|
if (companyId == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!ProxyUtils.isInitialized(type)) {
|
|
||||||
ContractTypeService typeService = controller.getCachedBean(ContractTypeService.class);
|
ContractTypeService typeService = controller.getCachedBean(ContractTypeService.class);
|
||||||
type = typeService.findById(type.getId());
|
ContractTypeVo type = typeService.findById(typeId);
|
||||||
}
|
|
||||||
return !Objects.equals(type.getDirection(), "付");
|
return !Objects.equals(type.getDirection(), "付");
|
||||||
}, viewModel.getType()));
|
}, viewModel.getType()));
|
||||||
controller.openRelativeCompanyVendorBtn.managedProperty()
|
controller.openRelativeCompanyVendorBtn.managedProperty()
|
||||||
@@ -199,17 +167,16 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
controller.varyDateField.setConverter(localDateStringConverter);
|
controller.varyDateField.setConverter(localDateStringConverter);
|
||||||
controller.varyDateField.valueProperty().bindBidirectional(viewModel.getVaryDate());
|
controller.varyDateField.valueProperty().bindBidirectional(viewModel.getVaryDate());
|
||||||
|
|
||||||
EmployeeStringConverter employeeStringConverter = SpringApp.getBean(EmployeeStringConverter.class);
|
|
||||||
UITools.autoCompletion(controller.setupPersonField, viewModel.getSetupPerson(),
|
UITools.autoCompletion(controller.setupPersonField, viewModel.getSetupPerson(),
|
||||||
employeeStringConverter::suggest, employeeStringConverter);
|
controller.getEmployeeService());
|
||||||
UITools.autoCompletion(controller.inurePersonField, viewModel.getInurePerson(),
|
UITools.autoCompletion(controller.inurePersonField, viewModel.getInurePerson(),
|
||||||
employeeStringConverter::suggest, employeeStringConverter);
|
controller.getEmployeeService());
|
||||||
UITools.autoCompletion(controller.varyPersonField, viewModel.getVaryPerson(),
|
UITools.autoCompletion(controller.varyPersonField, viewModel.getVaryPerson(),
|
||||||
employeeStringConverter::suggest, employeeStringConverter);
|
controller.getEmployeeService());
|
||||||
UITools.autoCompletion(controller.employeeField, viewModel.getEmployee(),
|
UITools.autoCompletion(controller.employeeField, viewModel.getEmployee(),
|
||||||
employeeStringConverter::suggest, employeeStringConverter);
|
controller.getEmployeeService());
|
||||||
UITools.autoCompletion(controller.handlerField, viewModel.getHandler(),
|
UITools.autoCompletion(controller.handlerField, viewModel.getHandler(),
|
||||||
employeeStringConverter::suggest, employeeStringConverter);
|
controller.getEmployeeService());
|
||||||
|
|
||||||
initializeBaseTabProjectFieldAutoCompletion(controller.projectField);
|
initializeBaseTabProjectFieldAutoCompletion(controller.projectField);
|
||||||
|
|
||||||
@@ -237,13 +204,13 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
|
|
||||||
private void parentCodeFieldAutoCompletion(TextField textField) {
|
private void parentCodeFieldAutoCompletion(TextField textField) {
|
||||||
ContractStringConverter converter = SpringApp.getBean(ContractStringConverter.class);
|
ContractStringConverter converter = SpringApp.getBean(ContractStringConverter.class);
|
||||||
converter.setFormater(Contract::getCode);
|
converter.setFormater(ContractVo::getCode);
|
||||||
TextFields.bindAutoCompletion(textField, converter::suggest, converter);
|
TextFields.bindAutoCompletion(textField, converter::suggest, converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calcMainContractNoAction(ActionEvent event) {
|
private void calcMainContractNoAction(ActionEvent event) {
|
||||||
try {
|
try {
|
||||||
Contract contract = controller.getEntity();
|
ContractVo contract = controller.getEntity();
|
||||||
if (getContractService().updateParentCode(contract)) {
|
if (getContractService().updateParentCode(contract)) {
|
||||||
save(contract);
|
save(contract);
|
||||||
}
|
}
|
||||||
@@ -253,8 +220,13 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onLinkContractProjectAction(ActionEvent event) {
|
public void onLinkContractProjectAction(ActionEvent event) {
|
||||||
Project project = viewModel.getProject().get();
|
Integer projectId = viewModel.getProject().get();
|
||||||
if (project != null) {
|
if (projectId != null) {
|
||||||
|
ProjectVo project = getProjectService().findById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
setStatus("未找到关联项目");
|
||||||
|
return;
|
||||||
|
}
|
||||||
ProjectWindowController.show(project, null);
|
ProjectWindowController.show(project, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -271,15 +243,19 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project = getProjectService().findByCode(code);
|
ProjectVo project = getProjectService().findByCode(code);
|
||||||
if (project == null) {
|
if (project != null) {
|
||||||
if (code.contains("-")) {
|
viewModel.getProject().set(project.getId());
|
||||||
setStatus("未找到关联项目");
|
save();
|
||||||
|
setStatus("已关联项目");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
project = new Project();
|
if (code.contains("-")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
project = new ProjectVo();
|
||||||
String name = viewModel.getName().get();
|
String name = viewModel.getName().get();
|
||||||
if (StringUtils.hasText(name)) {
|
if (StringUtils.hasText(name)) {
|
||||||
project.setName(name);
|
project.setName(name);
|
||||||
@@ -300,17 +276,18 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
dates.stream().min(LocalDate::compareTo).ifPresent(project::setCreated);
|
dates.stream().min(LocalDate::compareTo).ifPresent(project::setCreated);
|
||||||
|
|
||||||
Employee applicant = viewModel.getEmployee().get();
|
Integer applicantId = viewModel.getEmployee().get();
|
||||||
|
EmployeeVo applicant = controller.getEmployeeService().findById(applicantId);
|
||||||
if (applicant != null) {
|
if (applicant != null) {
|
||||||
project.setApplicant(applicant);
|
project.setApplicantId(applicant.getId());
|
||||||
}
|
}
|
||||||
if (viewModel.getAmount().get() > 0) {
|
if (viewModel.getAmount().get() > 0) {
|
||||||
project.setAmount((int) viewModel.getAmount().get());
|
project.setAmount((int) viewModel.getAmount().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
project = getProjectService().save(project);
|
project = getProjectService().save(project);
|
||||||
}
|
|
||||||
viewModel.getProject().set(project);
|
viewModel.getProject().set(project.getId());
|
||||||
|
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
@@ -332,7 +309,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
public void onContractOpenMainContractAction(ActionEvent event) {
|
public void onContractOpenMainContractAction(ActionEvent event) {
|
||||||
String parentCode = viewModel.getParentCode().get();
|
String parentCode = viewModel.getParentCode().get();
|
||||||
|
|
||||||
Contract parent = null;
|
ContractVo parent = null;
|
||||||
try {
|
try {
|
||||||
parent = getContractService().findByCode(parentCode);
|
parent = getContractService().findByCode(parentCode);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -350,7 +327,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
* 创建合同存储目录
|
* 创建合同存储目录
|
||||||
*/
|
*/
|
||||||
public void onContractCreatePathAction(ActionEvent event) {
|
public void onContractCreatePathAction(ActionEvent event) {
|
||||||
Contract contract = getEntity();
|
ContractVo contract = getEntity();
|
||||||
ContractService contractService = getContractService();
|
ContractService contractService = getContractService();
|
||||||
if (contractService.existsContractPath(contract)) {
|
if (contractService.existsContractPath(contract)) {
|
||||||
File dir = new File(contract.getPath());
|
File dir = new File(contract.getPath());
|
||||||
@@ -370,7 +347,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
|
|
||||||
public void onContractChangePathAction(ActionEvent event) {
|
public void onContractChangePathAction(ActionEvent event) {
|
||||||
DirectoryChooser chooser = new DirectoryChooser();
|
DirectoryChooser chooser = new DirectoryChooser();
|
||||||
Contract entity = getEntity();
|
ContractVo entity = getEntity();
|
||||||
String path = entity.getPath();
|
String path = entity.getPath();
|
||||||
File initialDirectory = null;
|
File initialDirectory = null;
|
||||||
// 如果当前已经设置了目录并且路径有效,则设置初始目录为该目录
|
// 如果当前已经设置了目录并且路径有效,则设置初始目录为该目录
|
||||||
@@ -383,17 +360,11 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
if (initialDirectory == null) {
|
if (initialDirectory == null) {
|
||||||
if (entity.getPayWay() == ContractPayWay.RECEIVE) {
|
if (entity.getPayWay() == ContractPayWay.RECEIVE) {
|
||||||
// 根据项目设置初始目录
|
// 根据项目设置初始目录
|
||||||
Project project = entity.getProject();
|
ProjectVo project = getProjectService().findById(entity.getProject());
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
if (!ProxyUtils.isInitialized(project)) {
|
|
||||||
project = getProjectService().findById(project.getId());
|
|
||||||
}
|
|
||||||
// 根据项目销售方式设置初始目录
|
// 根据项目销售方式设置初始目录
|
||||||
ProjectSaleType saleType = project.getSaleType();
|
ProjectSaleTypeVo saleType = getSaleTypeService().findById(project.getSaleTypeId());
|
||||||
if (saleType != null) {
|
if (saleType != null) {
|
||||||
if (!ProxyUtils.isInitialized(saleType)) {
|
|
||||||
saleType = getSaleTypeService().findById(saleType.getId());
|
|
||||||
}
|
|
||||||
File dir = new File(saleType.getPath());
|
File dir = new File(saleType.getPath());
|
||||||
if (saleType.isStoreByYear()) {
|
if (saleType.isStoreByYear()) {
|
||||||
dir = new File(dir, "20" + project.getCodeYear());
|
dir = new File(dir, "20" + project.getCodeYear());
|
||||||
@@ -406,7 +377,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
String parentCode = entity.getParentCode();
|
String parentCode = entity.getParentCode();
|
||||||
if (StringUtils.hasText(parentCode)) {
|
if (StringUtils.hasText(parentCode)) {
|
||||||
try {
|
try {
|
||||||
Contract parent = getContractService().findByCode(parentCode);
|
ContractVo parent = getContractService().findByCode(parentCode);
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
if (StringUtils.hasText(parent.getPath())) {
|
if (StringUtils.hasText(parent.getPath())) {
|
||||||
File dir = new File(parent.getPath());
|
File dir = new File(parent.getPath());
|
||||||
@@ -437,7 +408,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onContractPathSameAsNameAction(ActionEvent event) {
|
public void onContractPathSameAsNameAction(ActionEvent event) {
|
||||||
Contract contract = getEntity();
|
ContractVo contract = getEntity();
|
||||||
String path = contract.getPath();
|
String path = contract.getPath();
|
||||||
if (!StringUtils.hasText(path)) {
|
if (!StringUtils.hasText(path)) {
|
||||||
return;
|
return;
|
||||||
@@ -459,7 +430,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onContractPathSameAsCodeAction(ActionEvent event) {
|
public void onContractPathSameAsCodeAction(ActionEvent event) {
|
||||||
Contract contract = getEntity();
|
ContractVo contract = getEntity();
|
||||||
String path = contract.getPath();
|
String path = contract.getPath();
|
||||||
if (!StringUtils.hasText(path)) {
|
if (!StringUtils.hasText(path)) {
|
||||||
return;
|
return;
|
||||||
@@ -480,45 +451,26 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onContractOpenRelativeCompanyCustomerAction(ActionEvent event) {
|
public void onContractOpenRelativeCompanyCustomerAction(ActionEvent event) {
|
||||||
Contract contract = getEntity();
|
ContractVo contract = getEntity();
|
||||||
Company company = contract.getCompany();
|
CompanyVo company = controller.getCompanyService().findById(contract.getCompanyId());
|
||||||
CompanyCustomer companyCustomer = getCompanyCustomerService().findByCompany(company);
|
CompanyCustomerVo companyCustomer = getCompanyCustomerService().findByCompany(company);
|
||||||
CompanyCustomerWindowController.show(companyCustomer, null);
|
CompanyCustomerWindowController.show(companyCustomer, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onContractOpenRelativeCompanyVendorAction(ActionEvent event) {
|
public void onContractOpenRelativeCompanyVendorAction(ActionEvent event) {
|
||||||
Contract contract = getEntity();
|
ContractVo contract = getEntity();
|
||||||
Company company = contract.getCompany();
|
CompanyVo company = controller.getCompanyService().findById(contract.getCompanyId());
|
||||||
CompanyVendorService service = SpringApp.getBean(CompanyVendorService.class);
|
CompanyVendorService service = SpringApp.getBean(CompanyVendorService.class);
|
||||||
CompanyVendor companyVendor = service.findByCompany(company);
|
CompanyVendorVo companyVendor = service.findByCompany(company);
|
||||||
CompanyVendorWindowController.show(companyVendor, null);
|
CompanyVendorWindowController.show(companyVendor, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeBaseTabCompanyFieldAutoCompletion(TextField textField) {
|
private void initializeBaseTabCompanyFieldAutoCompletion(TextField textField) {
|
||||||
CompanyStringConverter converter = SpringApp.getBean(CompanyStringConverter.class);
|
UITools.autoCompletion(textField, viewModel.getCompany(), controller.getCompanyService());
|
||||||
UITools.autoCompletion(textField, viewModel.getCompany(), converter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeBaseTabProjectFieldAutoCompletion(TextField textField) {
|
private void initializeBaseTabProjectFieldAutoCompletion(TextField textField) {
|
||||||
ProjectStringConverter converter = SpringApp.getBean(ProjectStringConverter.class);
|
UITools.autoCompletion(textField, viewModel.getProject(), getProjectService());
|
||||||
StringConverter<Project> stringConverter = new StringConverter<>() {
|
|
||||||
@Override
|
|
||||||
public String toString(Project object) {
|
|
||||||
Project project = converter.prefixObject(object);
|
|
||||||
if (project == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return project.getCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Project fromString(String string) {
|
|
||||||
return converter.fromString(string);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
converter.setFormater(Project::getCode);
|
|
||||||
UITools.autoCompletion(textField, viewModel.getProject(), converter::suggest, stringConverter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompanyCustomerService getCompanyCustomerService() {
|
public CompanyCustomerService getCompanyCustomerService() {
|
||||||
@@ -541,6 +493,14 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
return getCachedBean(ContractGroupService.class);
|
return getCachedBean(ContractGroupService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ContractTypeService getContractTypeService() {
|
||||||
|
return getCachedBean(ContractTypeService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContractKindService getContractKindService() {
|
||||||
|
return getCachedBean(ContractKindService.class);
|
||||||
|
}
|
||||||
|
|
||||||
public VendorGroupService getVendorGroupService() {
|
public VendorGroupService getVendorGroupService() {
|
||||||
return getCachedBean(VendorGroupService.class);
|
return getCachedBean(VendorGroupService.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,12 +38,13 @@ import com.ecep.contract.controller.table.cell.LocalDateFieldTableCell;
|
|||||||
import com.ecep.contract.model.Contract;
|
import com.ecep.contract.model.Contract;
|
||||||
import com.ecep.contract.model.ContractFile;
|
import com.ecep.contract.model.ContractFile;
|
||||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||||
import com.ecep.contract.model.ContractType;
|
|
||||||
import com.ecep.contract.service.ContractFileService;
|
import com.ecep.contract.service.ContractFileService;
|
||||||
import com.ecep.contract.service.ContractFileTypeService;
|
import com.ecep.contract.service.ContractFileTypeService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.ContractFileViewModel;
|
import com.ecep.contract.vm.ContractFileViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractFileVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
@@ -70,8 +71,8 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/contract/contract-tab-file.fxml")
|
@FxmlPath("/ui/contract/contract-tab-file.fxml")
|
||||||
public class ContractTabSkinFiles
|
public class ContractTabSkinFiles
|
||||||
extends AbstContractTableTabSkin<ContractFile, ContractFileViewModel>
|
extends AbstContractTableTabSkin<ContractFileVo, ContractFileViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ContractFile, ContractFileViewModel> {
|
implements TabSkin, EditableEntityTableTabSkin<ContractFileVo, ContractFileViewModel> {
|
||||||
|
|
||||||
public Button fileTableReBuildBtn;
|
public Button fileTableReBuildBtn;
|
||||||
public MenuItem fileTable_menu_refresh;
|
public MenuItem fileTable_menu_refresh;
|
||||||
@@ -133,7 +134,6 @@ public class ContractTabSkinFiles
|
|||||||
public void initializeTab() {
|
public void initializeTab() {
|
||||||
TableView<ContractFileViewModel> table = getTableView();
|
TableView<ContractFileViewModel> table = getTableView();
|
||||||
ContractPayWay payWay = viewModel.getPayWay().get();
|
ContractPayWay payWay = viewModel.getPayWay().get();
|
||||||
ContractType contractType = viewModel.getType().get();
|
|
||||||
boolean isCustomer = payWay == ContractPayWay.RECEIVE;
|
boolean isCustomer = payWay == ContractPayWay.RECEIVE;
|
||||||
boolean isVendor = payWay == ContractPayWay.PAY;
|
boolean isVendor = payWay == ContractPayWay.PAY;
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ public class ContractTabSkinFiles
|
|||||||
* @param event 菜单事件
|
* @param event 菜单事件
|
||||||
*/
|
*/
|
||||||
private void onFileTableComposePDFAction(ActionEvent event) {
|
private void onFileTableComposePDFAction(ActionEvent event) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
if (!StringUtils.hasText(contract.getPath())) {
|
if (!StringUtils.hasText(contract.getPath())) {
|
||||||
setStatus("合同未设置路径");
|
setStatus("合同未设置路径");
|
||||||
return;
|
return;
|
||||||
@@ -329,7 +329,7 @@ public class ContractTabSkinFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContractFileViewModel append = new ContractFileViewModel();
|
ContractFileViewModel append = new ContractFileViewModel();
|
||||||
append.getContract().set(contract);
|
append.getContract().set(contract.getId());
|
||||||
append.getFileName().set(dest.getName());
|
append.getFileName().set(dest.getName());
|
||||||
append.getType().set(ContractFileType.General);
|
append.getType().set(ContractFileType.General);
|
||||||
saveRow(append);
|
saveRow(append);
|
||||||
@@ -343,7 +343,7 @@ public class ContractTabSkinFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onFileTableComposePDFAction_V2(ActionEvent event) {
|
private void onFileTableComposePDFAction_V2(ActionEvent event) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
if (!StringUtils.hasText(contract.getPath())) {
|
if (!StringUtils.hasText(contract.getPath())) {
|
||||||
setStatus("合同未设置路径");
|
setStatus("合同未设置路径");
|
||||||
return;
|
return;
|
||||||
@@ -426,7 +426,7 @@ public class ContractTabSkinFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContractFileViewModel append = new ContractFileViewModel();
|
ContractFileViewModel append = new ContractFileViewModel();
|
||||||
append.getContract().set(contract);
|
append.getContract().set(contract.getId());
|
||||||
append.getFileName().set(dest.getName());
|
append.getFileName().set(dest.getName());
|
||||||
append.getType().set(ContractFileType.General);
|
append.getType().set(ContractFileType.General);
|
||||||
saveRow(append);
|
saveRow(append);
|
||||||
@@ -482,7 +482,7 @@ public class ContractTabSkinFiles
|
|||||||
item.setText("成本核算审批表");
|
item.setText("成本核算审批表");
|
||||||
item.visibleProperty().bind(viewModel.getPayWay().isEqualTo(ContractPayWay.RECEIVE));
|
item.visibleProperty().bind(viewModel.getPayWay().isEqualTo(ContractPayWay.RECEIVE));
|
||||||
item.setOnAction(event -> {
|
item.setOnAction(event -> {
|
||||||
Contract contract = getContractService().findById(viewModel.getId().get());
|
ContractVo contract = getContractService().findById(viewModel.getId().get());
|
||||||
if (contract == null) {
|
if (contract == null) {
|
||||||
setStatus("异常,对应的合同不存在#" + viewModel.getId().get());
|
setStatus("异常,对应的合同不存在#" + viewModel.getId().get());
|
||||||
return;
|
return;
|
||||||
@@ -502,8 +502,8 @@ public class ContractTabSkinFiles
|
|||||||
.filter(v -> v.getType().get().equals(ContractFileType.Cost))
|
.filter(v -> v.getType().get().equals(ContractFileType.Cost))
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
if (model == null) {
|
if (model == null) {
|
||||||
ContractFile file = new ContractFile();
|
ContractFileVo file = new ContractFileVo();
|
||||||
file.setContract(contract);
|
file.setContractId(contract.getId());
|
||||||
file.setType(ContractFileType.Cost);
|
file.setType(ContractFileType.Cost);
|
||||||
file.setApplyDate(LocalDate.now());
|
file.setApplyDate(LocalDate.now());
|
||||||
|
|
||||||
@@ -657,27 +657,17 @@ public class ContractTabSkinFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContractFile loadRowData(ContractFileViewModel row) {
|
public ContractFileVo loadRowData(ContractFileViewModel row) {
|
||||||
return getContractFileService().findById(row.getId().get());
|
return getContractFileService().findById(row.getId().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContractFile saveRowData(ContractFile entity) {
|
|
||||||
return getContractFileService().save(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteRowData(ContractFile entity) {
|
|
||||||
getContractFileService().delete(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置文件
|
* 重置文件
|
||||||
* <br>
|
* <br>
|
||||||
* 依据已存在的文件重建
|
* 依据已存在的文件重建
|
||||||
*/
|
*/
|
||||||
public void onFileReBuildingAction(ActionEvent event) {
|
public void onFileReBuildingAction(ActionEvent event) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
ContractFilesRebuildTasker task = new ContractFilesRebuildTasker();
|
ContractFilesRebuildTasker task = new ContractFilesRebuildTasker();
|
||||||
task.setContract(contract);
|
task.setContract(contract);
|
||||||
UITools.showTaskDialogAndWait("文件重置", task, null);
|
UITools.showTaskDialogAndWait("文件重置", task, null);
|
||||||
@@ -698,13 +688,13 @@ public class ContractTabSkinFiles
|
|||||||
setStatus("目录错误,不存在");
|
setStatus("目录错误,不存在");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
|
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
File dest = new File(dir, file.getName());
|
File dest = new File(dir, file.getName());
|
||||||
if (file.renameTo(dest)) {
|
if (file.renameTo(dest)) {
|
||||||
ContractFile ccf = new ContractFile();
|
ContractFileVo ccf = new ContractFileVo();
|
||||||
ccf.setContract(contract);
|
ccf.setContractId(contract.getId());
|
||||||
ccf.setType(ContractFileType.General);
|
ccf.setType(ContractFileType.General);
|
||||||
ccf.setFileName(dest.getName());
|
ccf.setFileName(dest.getName());
|
||||||
getContractFileService().save(ccf);
|
getContractFileService().save(ccf);
|
||||||
@@ -721,7 +711,7 @@ public class ContractTabSkinFiles
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
if (!StringUtils.hasText(contract.getPath())) {
|
if (!StringUtils.hasText(contract.getPath())) {
|
||||||
setStatus("合同未设置路径");
|
setStatus("合同未设置路径");
|
||||||
return;
|
return;
|
||||||
@@ -757,12 +747,12 @@ public class ContractTabSkinFiles
|
|||||||
File outputFile = new File(contractPath, name + "-" + (i + 1) + ".pdf");
|
File outputFile = new File(contractPath, name + "-" + (i + 1) + ".pdf");
|
||||||
page.save(outputFile);
|
page.save(outputFile);
|
||||||
page.close();
|
page.close();
|
||||||
ContractFile contractFile = new ContractFile();
|
ContractFileVo contractFile = new ContractFileVo();
|
||||||
contractFile.setContract(contract);
|
contractFile.setContractId(contract.getId());
|
||||||
getContractService().syncContractFile(contractFile, outputFile, (lv, message) -> {
|
getContractService().syncContractFile(contractFile, outputFile, (lv, message) -> {
|
||||||
setStatus(message);
|
setStatus(message);
|
||||||
});
|
});
|
||||||
ContractFile saved = getContractFileService().save(contractFile);
|
ContractFileVo saved = getContractFileService().save(contractFile);
|
||||||
dataSet.add(ContractFileViewModel.from(saved));
|
dataSet.add(ContractFileViewModel.from(saved));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -775,7 +765,7 @@ public class ContractTabSkinFiles
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onTableDeleteAction(ActionEvent event) {
|
protected void onTableDeleteAction(ActionEvent event) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
String path = contract.getPath();
|
String path = contract.getPath();
|
||||||
if (!StringUtils.hasText(path)) {
|
if (!StringUtils.hasText(path)) {
|
||||||
setStatus("未设置目录");
|
setStatus("未设置目录");
|
||||||
@@ -792,7 +782,7 @@ public class ContractTabSkinFiles
|
|||||||
protected boolean deleteRow(ContractFileViewModel row, boolean confirm) {
|
protected boolean deleteRow(ContractFileViewModel row, boolean confirm) {
|
||||||
boolean deleted = super.deleteRow(row);
|
boolean deleted = super.deleteRow(row);
|
||||||
if (deleted) {
|
if (deleted) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
File file = new File(contract.getPath(), row.getFileName().get());
|
File file = new File(contract.getPath(), row.getFileName().get());
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
setStatus(file.getAbsolutePath() + " 文件不存在, 无法删除");
|
setStatus(file.getAbsolutePath() + " 文件不存在, 无法删除");
|
||||||
|
|||||||
@@ -10,19 +10,17 @@ import com.ecep.contract.controller.contract.ContractWindowController;
|
|||||||
import com.ecep.contract.controller.inventory.InventoryWindowController;
|
import com.ecep.contract.controller.inventory.InventoryWindowController;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||||
|
import com.ecep.contract.controller.table.cell.InventoryTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.converter.EntityStringConverter;
|
|
||||||
import com.ecep.contract.model.Contract;
|
import com.ecep.contract.model.Contract;
|
||||||
import com.ecep.contract.model.ContractItem;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.model.Inventory;
|
|
||||||
import com.ecep.contract.service.ContractItemService;
|
import com.ecep.contract.service.ContractItemService;
|
||||||
import com.ecep.contract.service.InventoryService;
|
import com.ecep.contract.service.InventoryService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.ProxyUtils;
|
|
||||||
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
||||||
import com.ecep.contract.vm.ContractItemViewModel;
|
import com.ecep.contract.vm.ContractItemViewModel;
|
||||||
import com.ecep.contract.vm.InventoryViewModel;
|
import com.ecep.contract.vm.InventoryViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractItemVo;
|
||||||
|
import com.ecep.contract.vo.InventoryVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.scene.control.ContextMenu;
|
import javafx.scene.control.ContextMenu;
|
||||||
@@ -36,9 +34,8 @@ import lombok.Setter;
|
|||||||
|
|
||||||
@FxmlPath("/ui/contract/contract-tab-item-v2.fxml")
|
@FxmlPath("/ui/contract/contract-tab-item-v2.fxml")
|
||||||
public class ContractTabSkinItemsV2
|
public class ContractTabSkinItemsV2
|
||||||
extends AbstContractTableTabSkin<ContractItem, ContractItemViewModel>
|
extends AbstContractTableTabSkin<ContractItemVo, ContractItemViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ContractItem, ContractItemViewModel> {
|
implements TabSkin, EditableEntityTableTabSkin<ContractItemVo, ContractItemViewModel> {
|
||||||
|
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
ContractItemService itemService;
|
ContractItemService itemService;
|
||||||
@@ -50,13 +47,21 @@ public class ContractTabSkinItemsV2
|
|||||||
public TableColumn<ContractItemViewModel, String> titleColumn;
|
public TableColumn<ContractItemViewModel, String> titleColumn;
|
||||||
public TableColumn<ContractItemViewModel, String> specificationColumn;
|
public TableColumn<ContractItemViewModel, String> specificationColumn;
|
||||||
public TableColumn<ContractItemViewModel, String> unitColumn;
|
public TableColumn<ContractItemViewModel, String> unitColumn;
|
||||||
|
/**
|
||||||
public TableColumn<ContractItemViewModel, Inventory> inventoryColumn;
|
* 合同内容, Inventory
|
||||||
|
*/
|
||||||
|
public TableColumn<ContractItemViewModel, Integer> inventoryColumn;
|
||||||
public TableColumn<ContractItemViewModel, Number> refIdColumn;
|
public TableColumn<ContractItemViewModel, Number> refIdColumn;
|
||||||
public TableColumn<ContractItemViewModel, String> codeColumn;
|
public TableColumn<ContractItemViewModel, String> codeColumn;
|
||||||
public TableColumn<ContractItemViewModel, Employee> creatorColumn;
|
/**
|
||||||
|
* 合同内容, 合同创建人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ContractItemViewModel, Integer> creatorColumn;
|
||||||
public TableColumn<ContractItemViewModel, LocalDateTime> createDateColumn;
|
public TableColumn<ContractItemViewModel, LocalDateTime> createDateColumn;
|
||||||
public TableColumn<ContractItemViewModel, Employee> updaterColumn;
|
/**
|
||||||
|
* 合同内容, 合同更新人, Employee
|
||||||
|
*/
|
||||||
|
public TableColumn<ContractItemViewModel, Integer> updaterColumn;
|
||||||
public TableColumn<ContractItemViewModel, LocalDateTime> updateDateColumn;
|
public TableColumn<ContractItemViewModel, LocalDateTime> updateDateColumn;
|
||||||
|
|
||||||
public TableColumn<ContractItemViewModel, LocalDate> startDateColumn;
|
public TableColumn<ContractItemViewModel, LocalDate> startDateColumn;
|
||||||
@@ -99,11 +104,7 @@ public class ContractTabSkinItemsV2
|
|||||||
unitColumn.setCellValueFactory(param -> param.getValue().getUnit());
|
unitColumn.setCellValueFactory(param -> param.getValue().getUnit());
|
||||||
|
|
||||||
inventoryColumn.setCellValueFactory(param -> param.getValue().getInventory());
|
inventoryColumn.setCellValueFactory(param -> param.getValue().getInventory());
|
||||||
EntityStringConverter<Inventory> converter = new EntityStringConverter<>();
|
inventoryColumn.setCellFactory(InventoryTableCell.forTableColumn(getInventoryService()));
|
||||||
converter.setInitialized(v -> getInventoryService().findById(v.getId()));
|
|
||||||
converter.setFormater(Inventory::getCode);
|
|
||||||
inventoryColumn.setCellFactory(TextFieldTableCell.forTableColumn(converter));
|
|
||||||
|
|
||||||
|
|
||||||
exclusiveTaxPriceColumn.setCellValueFactory(param -> param.getValue().getExclusiveTaxPrice());
|
exclusiveTaxPriceColumn.setCellValueFactory(param -> param.getValue().getExclusiveTaxPrice());
|
||||||
exclusiveTaxPriceColumn.setCellFactory(TextFieldTableCell.forTableColumn(currencyStringConverter));
|
exclusiveTaxPriceColumn.setCellFactory(TextFieldTableCell.forTableColumn(currencyStringConverter));
|
||||||
@@ -147,29 +148,38 @@ public class ContractTabSkinItemsV2
|
|||||||
}
|
}
|
||||||
return itemService;
|
return itemService;
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryService getInventoryService() {
|
InventoryService getInventoryService() {
|
||||||
if (inventoryService == null) {
|
if (inventoryService == null) {
|
||||||
inventoryService = getBean(InventoryService.class);
|
inventoryService = getBean(InventoryService.class);
|
||||||
}
|
}
|
||||||
return inventoryService;
|
return inventoryService;
|
||||||
}
|
}
|
||||||
private void sum(ContractItemComposeViewModel model, Contract contract, HashMap<String, ContractItemComposeViewModel> map) {
|
|
||||||
double inQuantity = map.values().stream().map(ContractItemComposeViewModel::getIn).mapToDouble(v -> v.getQuantity().get()).sum();
|
private void sum(ContractItemComposeViewModel model, Contract contract,
|
||||||
|
HashMap<String, ContractItemComposeViewModel> map) {
|
||||||
|
double inQuantity = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||||
|
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||||
Platform.runLater(() -> model.getIn().getQuantity().set(inQuantity));
|
Platform.runLater(() -> model.getIn().getQuantity().set(inQuantity));
|
||||||
|
|
||||||
double inTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn).mapToDouble(v -> v.getTaxAmount().get()).sum();
|
double inTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||||
|
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||||
Platform.runLater(() -> model.getIn().getTaxAmount().set(inTaxAmount));
|
Platform.runLater(() -> model.getIn().getTaxAmount().set(inTaxAmount));
|
||||||
|
|
||||||
double inExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn).mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
double inExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||||
|
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||||
Platform.runLater(() -> model.getIn().getExclusiveTaxAmount().set(inExclusiveTaxAmount));
|
Platform.runLater(() -> model.getIn().getExclusiveTaxAmount().set(inExclusiveTaxAmount));
|
||||||
|
|
||||||
double outQuantity = map.values().stream().map(ContractItemComposeViewModel::getOut).mapToDouble(v -> v.getQuantity().get()).sum();
|
double outQuantity = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||||
|
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||||
Platform.runLater(() -> model.getOut().getQuantity().set(outQuantity));
|
Platform.runLater(() -> model.getOut().getQuantity().set(outQuantity));
|
||||||
|
|
||||||
double outTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut).mapToDouble(v -> v.getTaxAmount().get()).sum();
|
double outTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||||
|
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||||
Platform.runLater(() -> model.getOut().getTaxAmount().set(outTaxAmount));
|
Platform.runLater(() -> model.getOut().getTaxAmount().set(outTaxAmount));
|
||||||
|
|
||||||
double outExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut).mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
double outExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||||
|
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||||
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,12 +189,13 @@ public class ContractTabSkinItemsV2
|
|||||||
MenuItem showInventory = new MenuItem("查看存货");
|
MenuItem showInventory = new MenuItem("查看存货");
|
||||||
showInventory.setOnAction(event -> {
|
showInventory.setOnAction(event -> {
|
||||||
ContractItemViewModel selectedItem = getTableView().getSelectionModel().getSelectedItem();
|
ContractItemViewModel selectedItem = getTableView().getSelectionModel().getSelectedItem();
|
||||||
Inventory inventory = selectedItem.getInventory().get();
|
Integer inventoryId = selectedItem.getInventory().get();
|
||||||
if (inventory == null) {
|
if (inventoryId == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!ProxyUtils.isInitialized(inventory)) {
|
InventoryVo inventory = getInventoryService().findById(inventoryId);
|
||||||
inventory = getInventoryService().findById(inventory.getId());
|
if (inventory == null) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
showInOwner(InventoryWindowController.class, InventoryViewModel.from(inventory));
|
showInOwner(InventoryWindowController.class, InventoryViewModel.from(inventory));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.ecep.contract.service.ContractPayPlanService;
|
|||||||
import com.ecep.contract.service.ViewModelService;
|
import com.ecep.contract.service.ViewModelService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||||
|
|
||||||
import javafx.scene.control.ContextMenu;
|
import javafx.scene.control.ContextMenu;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
@@ -21,7 +22,7 @@ import javafx.util.converter.CurrencyStringConverter;
|
|||||||
import javafx.util.converter.NumberStringConverter;
|
import javafx.util.converter.NumberStringConverter;
|
||||||
|
|
||||||
@FxmlPath("/ui/contract/contract-tab-pay-plan.fxml")
|
@FxmlPath("/ui/contract/contract-tab-pay-plan.fxml")
|
||||||
public class ContractTabSkinPayPlan extends AbstContractTableTabSkin<ContractPayPlan, ContractPayPlanViewModel> {
|
public class ContractTabSkinPayPlan extends AbstContractTableTabSkin<ContractPayPlanVo, ContractPayPlanViewModel> {
|
||||||
|
|
||||||
public TableColumn<ContractPayPlanViewModel, Number> idColumn;
|
public TableColumn<ContractPayPlanViewModel, Number> idColumn;
|
||||||
public TableColumn<ContractPayPlanViewModel, LocalDate> payDateColumn;
|
public TableColumn<ContractPayPlanViewModel, LocalDate> payDateColumn;
|
||||||
@@ -50,7 +51,7 @@ public class ContractTabSkinPayPlan extends AbstContractTableTabSkin<ContractPay
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ViewModelService<ContractPayPlan, ContractPayPlanViewModel> getViewModelService() {
|
protected ContractPayPlanService getViewModelService() {
|
||||||
return getPayPlanService();
|
return getPayPlanService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,12 @@ import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
|||||||
import com.ecep.contract.controller.contract.ContractWindowController;
|
import com.ecep.contract.controller.contract.ContractWindowController;
|
||||||
import com.ecep.contract.controller.vendor.PurchaseOrderWindowController;
|
import com.ecep.contract.controller.vendor.PurchaseOrderWindowController;
|
||||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||||
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.PurchaseOrdersService;
|
import com.ecep.contract.service.PurchaseOrdersService;
|
||||||
import com.ecep.contract.vm.PurchaseOrderViewModel;
|
import com.ecep.contract.vm.PurchaseOrderViewModel;
|
||||||
|
import com.ecep.contract.vo.PurchaseOrderVo;
|
||||||
import com.ecep.contract.model.PurchaseOrder;
|
import com.ecep.contract.model.PurchaseOrder;
|
||||||
|
import com.ecep.contract.controller.table.cell.CompanyTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
|
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
@@ -22,19 +25,16 @@ import javafx.scene.control.TableColumn;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/contract/contract-tab-purchase-orders.fxml")
|
@FxmlPath("/ui/contract/contract-tab-purchase-orders.fxml")
|
||||||
public class ContractTabSkinPurchaseOrders
|
public class ContractTabSkinPurchaseOrders
|
||||||
extends AbstContractTableTabSkin<PurchaseOrder, PurchaseOrderViewModel>
|
extends AbstContractTableTabSkin<PurchaseOrderVo, PurchaseOrderViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
|
|
||||||
private PurchaseOrdersService purchaseOrdersService;
|
|
||||||
private EmployeeStringConverter employeeStringConverter;
|
|
||||||
|
|
||||||
public TableColumn<PurchaseOrderViewModel, Number> idColumn;
|
public TableColumn<PurchaseOrderViewModel, Number> idColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, String> codeColumn;
|
public TableColumn<PurchaseOrderViewModel, String> codeColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, String> table_makerColumn;
|
public TableColumn<PurchaseOrderViewModel, Integer> table_makerColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_makerDateColumn;
|
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_makerDateColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, String> table_verifierColumn;
|
public TableColumn<PurchaseOrderViewModel, Integer> table_verifierColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_verifierDateColumn;
|
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_verifierDateColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, String> table_closerColumn;
|
public TableColumn<PurchaseOrderViewModel, Integer> table_closerColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_closerDateColumn;
|
public TableColumn<PurchaseOrderViewModel, LocalDateTime> table_closerDateColumn;
|
||||||
public TableColumn<PurchaseOrderViewModel, String> table_descriptionColumn;
|
public TableColumn<PurchaseOrderViewModel, String> table_descriptionColumn;
|
||||||
|
|
||||||
@@ -72,13 +72,16 @@ public class ContractTabSkinPurchaseOrders
|
|||||||
codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
codeColumn.setCellValueFactory(param -> param.getValue().getCode());
|
||||||
|
|
||||||
EmployeeStringConverter converter = getEmployeeStringConverter();
|
EmployeeStringConverter converter = getEmployeeStringConverter();
|
||||||
table_makerColumn.setCellValueFactory(param -> param.getValue().getMaker().map(converter::toString));
|
table_makerColumn.setCellValueFactory(param -> param.getValue().getMaker());
|
||||||
|
table_makerColumn.setCellFactory(CompanyTableCell.forTableColumn(getCompanyService()));
|
||||||
table_makerDateColumn.setCellValueFactory(param -> param.getValue().getMakerDate());
|
table_makerDateColumn.setCellValueFactory(param -> param.getValue().getMakerDate());
|
||||||
table_makerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
table_makerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
table_verifierColumn.setCellValueFactory(param -> param.getValue().getMaker().map(converter::toString));
|
table_verifierColumn.setCellValueFactory(param -> param.getValue().getMaker());
|
||||||
|
table_verifierColumn.setCellFactory(CompanyTableCell.forTableColumn(getCompanyService()));
|
||||||
table_verifierDateColumn.setCellValueFactory(param -> param.getValue().getVerifierDate());
|
table_verifierDateColumn.setCellValueFactory(param -> param.getValue().getVerifierDate());
|
||||||
table_verifierDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
table_verifierDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
table_closerColumn.setCellValueFactory(param -> param.getValue().getMaker().map(converter::toString));
|
table_closerColumn.setCellValueFactory(param -> param.getValue().getMaker());
|
||||||
|
table_closerColumn.setCellFactory(CompanyTableCell.forTableColumn(getCompanyService()));
|
||||||
table_closerDateColumn.setCellValueFactory(param -> param.getValue().getCloserDate());
|
table_closerDateColumn.setCellValueFactory(param -> param.getValue().getCloserDate());
|
||||||
table_closerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
table_closerDateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
@@ -92,16 +95,14 @@ public class ContractTabSkinPurchaseOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
PurchaseOrdersService getPurchaseOrdersService() {
|
PurchaseOrdersService getPurchaseOrdersService() {
|
||||||
if (purchaseOrdersService == null) {
|
return getBean(PurchaseOrdersService.class);
|
||||||
purchaseOrdersService = getBean(PurchaseOrdersService.class);
|
|
||||||
}
|
|
||||||
return purchaseOrdersService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EmployeeStringConverter getEmployeeStringConverter() {
|
EmployeeStringConverter getEmployeeStringConverter() {
|
||||||
if (employeeStringConverter == null) {
|
return getBean(EmployeeStringConverter.class);
|
||||||
employeeStringConverter = getBean(EmployeeStringConverter.class);
|
|
||||||
}
|
}
|
||||||
return employeeStringConverter;
|
|
||||||
|
CompanyService getCompanyService() {
|
||||||
|
return controller.getCompanyService();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,12 @@ import java.time.LocalDate;
|
|||||||
import com.ecep.contract.ContractPayWay;
|
import com.ecep.contract.ContractPayWay;
|
||||||
import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
||||||
import com.ecep.contract.controller.contract.ContractWindowController;
|
import com.ecep.contract.controller.contract.ContractWindowController;
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.service.ContractService;
|
import com.ecep.contract.service.ContractService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ContractViewModel;
|
import com.ecep.contract.vm.ContractViewModel;
|
||||||
|
|
||||||
import com.ecep.contract.vo.ContractVo;
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
@@ -61,7 +60,7 @@ public class ContractTabSkinSubContract
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParamUtils.Builder getSpecification(Contract parent) {
|
public ParamUtils.Builder getSpecification(ContractVo parent) {
|
||||||
ParamUtils.Builder params = getSpecification();
|
ParamUtils.Builder params = getSpecification();
|
||||||
params.equals("parentCode", parent.getCode());
|
params.equals("parentCode", parent.getCode());
|
||||||
return params;
|
return params;
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import com.ecep.contract.SpringApp;
|
|||||||
import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
||||||
import com.ecep.contract.controller.contract.ContractWindowController;
|
import com.ecep.contract.controller.contract.ContractWindowController;
|
||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
|
import com.ecep.contract.controller.table.cell.CompanyTableCell;
|
||||||
|
import com.ecep.contract.controller.table.cell.ContractFileTableCell;
|
||||||
import com.ecep.contract.controller.vendor.VendorBidWindowController;
|
import com.ecep.contract.controller.vendor.VendorBidWindowController;
|
||||||
import com.ecep.contract.model.Company;
|
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.ContractBidVendor;
|
import com.ecep.contract.model.ContractBidVendor;
|
||||||
import com.ecep.contract.model.ContractFile;
|
import com.ecep.contract.model.ContractFile;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
@@ -21,6 +21,9 @@ import com.ecep.contract.util.FxmlPath;
|
|||||||
import com.ecep.contract.util.ProxyUtils;
|
import com.ecep.contract.util.ProxyUtils;
|
||||||
import com.ecep.contract.vm.CompanyViewModel;
|
import com.ecep.contract.vm.CompanyViewModel;
|
||||||
import com.ecep.contract.vm.ContractBidVendorViewModel;
|
import com.ecep.contract.vm.ContractBidVendorViewModel;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
import com.ecep.contract.vo.ContractBidVendorVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
@@ -39,13 +42,16 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
@FxmlPath("/ui/contract/contract-tab-bid.fxml")
|
@FxmlPath("/ui/contract/contract-tab-bid.fxml")
|
||||||
public class ContractTabSkinVendorBid
|
public class ContractTabSkinVendorBid
|
||||||
extends AbstContractTableTabSkin<ContractBidVendor, ContractBidVendorViewModel>
|
extends AbstContractTableTabSkin<ContractBidVendorVo, ContractBidVendorViewModel>
|
||||||
implements TabSkin, EditableEntityTableTabSkin<ContractBidVendor, ContractBidVendorViewModel> {
|
implements TabSkin, EditableEntityTableTabSkin<ContractBidVendorVo, ContractBidVendorViewModel> {
|
||||||
@Setter
|
@Setter
|
||||||
private ContractBidVendorService service;
|
private ContractBidVendorService service;
|
||||||
public TableColumn<ContractBidVendorViewModel, Number> bidVendorTable_idColumn;
|
public TableColumn<ContractBidVendorViewModel, Number> bidVendorTable_idColumn;
|
||||||
public TableColumn<ContractBidVendorViewModel, String> bidVendorTable_companyColumn;
|
public TableColumn<ContractBidVendorViewModel, Integer> bidVendorTable_companyColumn;
|
||||||
public TableColumn<ContractBidVendorViewModel, ContractFile> bidVendorTable_quotationSheetColumn;
|
/**
|
||||||
|
* 报价单, 合同文件, ContractFile
|
||||||
|
*/
|
||||||
|
public TableColumn<ContractBidVendorViewModel, Integer> bidVendorTable_quotationSheetColumn;
|
||||||
|
|
||||||
public Button bidVendorCreateBtn;
|
public Button bidVendorCreateBtn;
|
||||||
public MenuItem bidVendorTable_menu_refresh;
|
public MenuItem bidVendorTable_menu_refresh;
|
||||||
@@ -73,32 +79,6 @@ public class ContractTabSkinVendorBid
|
|||||||
return controller.bidVendorTab;
|
return controller.bidVendorTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class QuotationSheetColumnTableCell extends TableCell<ContractBidVendorViewModel, ContractFile> {
|
|
||||||
private ContractFileService contractFileService;
|
|
||||||
|
|
||||||
public ContractFileService getContractFileService() {
|
|
||||||
if (contractFileService == null) {
|
|
||||||
contractFileService = SpringApp.getBean(ContractFileService.class);
|
|
||||||
}
|
|
||||||
return contractFileService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateItem(ContractFile item, boolean empty) {
|
|
||||||
super.updateItem(item, empty);
|
|
||||||
if (empty || item == null) {
|
|
||||||
setText(null);
|
|
||||||
} else {
|
|
||||||
if (!ProxyUtils.isInitialized(item)) {
|
|
||||||
item = getContractFileService().findById(item.getId());
|
|
||||||
ContractBidVendorViewModel viewModel = getTableRow().getItem();
|
|
||||||
viewModel.getQuotationSheet().set(item);
|
|
||||||
}
|
|
||||||
setText(item.getFileName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeTab() {
|
public void initializeTab() {
|
||||||
bidVendorCreateBtn.setOnAction(this::onBidVendorTableCreateAction);
|
bidVendorCreateBtn.setOnAction(this::onBidVendorTableCreateAction);
|
||||||
@@ -107,15 +87,10 @@ public class ContractTabSkinVendorBid
|
|||||||
bidVendorTable_menu_chose_sheet.setOnAction(this::onBidVendorTableChoseQuotationSheetAction);
|
bidVendorTable_menu_chose_sheet.setOnAction(this::onBidVendorTableChoseQuotationSheetAction);
|
||||||
|
|
||||||
bidVendorTable_idColumn.setCellValueFactory(param -> param.getValue().getId());
|
bidVendorTable_idColumn.setCellValueFactory(param -> param.getValue().getId());
|
||||||
bidVendorTable_companyColumn.setCellValueFactory(param -> param.getValue().getCompany().map(c -> {
|
bidVendorTable_companyColumn.setCellValueFactory(param -> param.getValue().getCompanyId());
|
||||||
if (c == null) {
|
bidVendorTable_companyColumn.setCellFactory(CompanyTableCell.forTableColumn(getCompanyService()));
|
||||||
return null;
|
bidVendorTable_quotationSheetColumn.setCellValueFactory(param -> param.getValue().getQuotationSheetFileId());
|
||||||
} else {
|
bidVendorTable_quotationSheetColumn.setCellFactory(ContractFileTableCell.forTableColumn(getContractService()));
|
||||||
return c.getName();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
bidVendorTable_quotationSheetColumn.setCellValueFactory(param -> param.getValue().getQuotationSheet());
|
|
||||||
bidVendorTable_quotationSheetColumn.setCellFactory(param -> new QuotationSheetColumnTableCell());
|
|
||||||
|
|
||||||
super.initializeTab();
|
super.initializeTab();
|
||||||
}
|
}
|
||||||
@@ -126,8 +101,7 @@ public class ContractTabSkinVendorBid
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onBidVendorTableCreateAction(ActionEvent event) {
|
public void onBidVendorTableCreateAction(ActionEvent event) {
|
||||||
Contract contract = getParent();
|
ContractVo contract = getParent();
|
||||||
|
|
||||||
|
|
||||||
ChoiceDialog<String> dialog = new ChoiceDialog<>();
|
ChoiceDialog<String> dialog = new ChoiceDialog<>();
|
||||||
dialog.setTitle("添加比价供应商");
|
dialog.setTitle("添加比价供应商");
|
||||||
@@ -154,13 +128,13 @@ public class ContractTabSkinVendorBid
|
|||||||
comboBox.setEditable(true);
|
comboBox.setEditable(true);
|
||||||
dialog.showAndWait().ifPresent(selectedItem -> {
|
dialog.showAndWait().ifPresent(selectedItem -> {
|
||||||
|
|
||||||
Company company = getCompanyService().findAllByName(selectedItem).getFirst();
|
CompanyVo company = getCompanyService().findAllByName(selectedItem).getFirst();
|
||||||
|
|
||||||
List<ContractBidVendor> list = getService().findByContractAndCompany(contract, company);
|
List<ContractBidVendorVo> list = getService().findByContractAndCompany(contract, company);
|
||||||
if (list == null || list.isEmpty()) {
|
if (list == null || list.isEmpty()) {
|
||||||
ContractBidVendor bidVendor = new ContractBidVendor();
|
ContractBidVendorVo bidVendor = new ContractBidVendorVo();
|
||||||
bidVendor.setContract(contract);
|
bidVendor.setContractId(contract.getId());
|
||||||
bidVendor.setCompany(company);
|
bidVendor.setCompanyId(company.getId());
|
||||||
getService().save(bidVendor);
|
getService().save(bidVendor);
|
||||||
loadTableDataSet();
|
loadTableDataSet();
|
||||||
} else {
|
} else {
|
||||||
@@ -172,7 +146,6 @@ public class ContractTabSkinVendorBid
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 匹配报价表
|
* 匹配报价表
|
||||||
*
|
*
|
||||||
@@ -198,5 +171,4 @@ public class ContractTabSkinVendorBid
|
|||||||
return controller.getCompanyService();
|
return controller.getCompanyService();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,6 @@ import java.util.logging.Level;
|
|||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.model.ContractGroup;
|
|
||||||
import com.ecep.contract.model.ContractKind;
|
|
||||||
import com.ecep.contract.model.ContractType;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.service.CompanyCustomerService;
|
import com.ecep.contract.service.CompanyCustomerService;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.CompanyVendorService;
|
import com.ecep.contract.service.CompanyVendorService;
|
||||||
@@ -20,6 +16,10 @@ import com.ecep.contract.service.ContractTypeService;
|
|||||||
import com.ecep.contract.service.EmployeeService;
|
import com.ecep.contract.service.EmployeeService;
|
||||||
import com.ecep.contract.service.YongYouU8Service;
|
import com.ecep.contract.service.YongYouU8Service;
|
||||||
import com.ecep.contract.util.BeanCacher;
|
import com.ecep.contract.util.BeanCacher;
|
||||||
|
import com.ecep.contract.vo.ContractGroupVo;
|
||||||
|
import com.ecep.contract.vo.ContractKindVo;
|
||||||
|
import com.ecep.contract.vo.ContractTypeVo;
|
||||||
|
import com.ecep.contract.vo.EmployeeVo;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -127,26 +127,26 @@ public class ContractUpdater implements MessageHolder {
|
|||||||
return getBean(EmployeeService.class);
|
return getBean(EmployeeService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContractType getTypeByCode(String typeCode) {
|
private ContractTypeVo getTypeByCode(String typeCode) {
|
||||||
ContractType type = getBean(ContractTypeService.class).findByCode(typeCode);
|
ContractTypeVo type = getBean(ContractTypeService.class).findByCode(typeCode);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContractGroup getGroupByCode(String groupCode) {
|
private ContractGroupVo getGroupByCode(String groupCode) {
|
||||||
ContractGroup group = getBean(ContractGroupService.class).findByCode(groupCode);
|
ContractGroupVo group = getBean(ContractGroupService.class).findByCode(groupCode);
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContractKind getKindByName(String kindName) {
|
private ContractKindVo getKindByName(String kindName) {
|
||||||
ContractKind kind = getBean(ContractKindService.class).findByName(kindName);
|
ContractKindVo kind = getBean(ContractKindService.class).findByName(kindName);
|
||||||
return kind;
|
return kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Employee findEmployeeByCode(String personCode) {
|
private EmployeeVo findEmployeeByCode(String personCode) {
|
||||||
return getEmployeeService().findByCode(personCode);
|
return getEmployeeService().findByCode(personCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Employee findEmployeeByName(String personName) {
|
private EmployeeVo findEmployeeByName(String personName) {
|
||||||
if (personName == null) {
|
if (personName == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package com.ecep.contract.controller.tab;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.task.Tasker;
|
import com.ecep.contract.task.Tasker;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class CustomerContractCostFormUpdateTask extends Tasker<Object> {
|
public class CustomerContractCostFormUpdateTask extends Tasker<Object> {
|
||||||
@Setter
|
@Setter
|
||||||
private Contract contract;
|
private ContractVo contract;
|
||||||
/**
|
/**
|
||||||
* 成本表文件名
|
* 成本表文件名
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.ecep.contract.service.CompanyService;
|
|||||||
import com.ecep.contract.service.ContractFileService;
|
import com.ecep.contract.service.ContractFileService;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||||
|
import com.ecep.contract.vo.SalesOrderVo;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.scene.control.Tab;
|
import javafx.scene.control.Tab;
|
||||||
@@ -19,7 +20,7 @@ import javafx.scene.control.TextField;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class SalesOrderTabSkinBase
|
public class SalesOrderTabSkinBase
|
||||||
extends AbstEntityBasedTabSkin<SalesOrderWindowController, SalesOrder, SalesOrderViewModel>
|
extends AbstEntityBasedTabSkin<SalesOrderWindowController, SalesOrderVo, SalesOrderViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@@ -45,7 +46,6 @@ public class SalesOrderTabSkinBase
|
|||||||
initializeEmployeeField(controller.makerField, viewModel.getMaker());
|
initializeEmployeeField(controller.makerField, viewModel.getMaker());
|
||||||
initializeEmployeeField(controller.verifierField, viewModel.getVerifier());
|
initializeEmployeeField(controller.verifierField, viewModel.getVerifier());
|
||||||
|
|
||||||
|
|
||||||
controller.makeDateField.textProperty().bind(viewModel.getMakerDate().map(MyDateTimeUtils::format));
|
controller.makeDateField.textProperty().bind(viewModel.getMakerDate().map(MyDateTimeUtils::format));
|
||||||
controller.verifierDateField.textProperty().bind(viewModel.getVerifierDate().map(MyDateTimeUtils::format));
|
controller.verifierDateField.textProperty().bind(viewModel.getVerifierDate().map(MyDateTimeUtils::format));
|
||||||
|
|
||||||
@@ -63,9 +63,8 @@ public class SalesOrderTabSkinBase
|
|||||||
return MyDateTimeUtils.format(dateTime);
|
return MyDateTimeUtils.format(dateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeEmployeeField(TextField textField, SimpleObjectProperty<Employee> property) {
|
private void initializeEmployeeField(TextField textField, SimpleObjectProperty<Integer> property) {
|
||||||
EmployeeStringConverter converter = getEmployeeStringConverter();
|
UITools.autoCompletion(textField, property, controller.getEmployeeService());
|
||||||
UITools.autoCompletion(textField, property, converter::suggest, converter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompanyService getCompanyService() {
|
public CompanyService getCompanyService() {
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import com.ecep.contract.util.ProxyUtils;
|
|||||||
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
||||||
import com.ecep.contract.vm.SalesBillVoucherViewModel;
|
import com.ecep.contract.vm.SalesBillVoucherViewModel;
|
||||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractItemVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
import com.ecep.contract.vo.SalesBillVoucherVo;
|
import com.ecep.contract.vo.SalesBillVoucherVo;
|
||||||
import com.ecep.contract.vo.SalesOrderVo;
|
import com.ecep.contract.vo.SalesOrderVo;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
@@ -179,13 +181,9 @@ public class SalesOrderTabSkinBillVoucher
|
|||||||
setText(String.format(format, item));
|
setText(String.format(format, item));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTooltip(ObservableList<ContractItem> list, Function<ContractItem, Double> getPrice) {
|
private void setTooltip(ObservableList<ContractItemVo> list, Function<ContractItemVo, Double> getPrice) {
|
||||||
String text = list.stream().map(v -> {
|
String text = list.stream().map(v -> {
|
||||||
Contract contract = v.getContract();
|
ContractVo contract = SpringApp.getBean(ContractService.class).findById(v.getContractId());
|
||||||
if (!ProxyUtils.isInitialized(contract)) {
|
|
||||||
|
|
||||||
contract = SpringApp.getBean(ContractService.class).findById(contract.getId());
|
|
||||||
}
|
|
||||||
Double price = getPrice.apply(v);
|
Double price = getPrice.apply(v);
|
||||||
double quantity = v.getQuantity();
|
double quantity = v.getQuantity();
|
||||||
return contract.getCode() + " " + String.format(format, price) + " x " + quantity + " = "
|
return contract.getCode() + " " + String.format(format, price) + " x " + quantity + " = "
|
||||||
|
|||||||
@@ -6,26 +6,24 @@ import java.util.List;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.ecep.contract.vo.SalesOrderItemVo;
|
|
||||||
import com.ecep.contract.vo.SalesOrderVo;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.SpringApp;
|
import com.ecep.contract.SpringApp;
|
||||||
import com.ecep.contract.controller.customer.SalesOrderWindowController;
|
import com.ecep.contract.controller.customer.SalesOrderWindowController;
|
||||||
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
||||||
import com.ecep.contract.model.Contract;
|
import com.ecep.contract.model.Contract;
|
||||||
import com.ecep.contract.model.ContractItem;
|
|
||||||
import com.ecep.contract.model.SalesOrder;
|
|
||||||
import com.ecep.contract.model.SalesOrderItem;
|
|
||||||
import com.ecep.contract.service.ContractService;
|
import com.ecep.contract.service.ContractService;
|
||||||
import com.ecep.contract.service.SaleOrdersService;
|
import com.ecep.contract.service.SaleOrdersService;
|
||||||
import com.ecep.contract.service.SalesOrderItemService;
|
import com.ecep.contract.service.SalesOrderItemService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.util.ProxyUtils;
|
|
||||||
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
||||||
import com.ecep.contract.vm.SalesOrderItemViewModel;
|
import com.ecep.contract.vm.SalesOrderItemViewModel;
|
||||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractItemVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.SalesOrderItemVo;
|
||||||
|
import com.ecep.contract.vo.SalesOrderVo;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
@@ -106,13 +104,13 @@ public class SalesOrderTabSkinItems
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParamUtils.Builder getSpecification(SalesOrder parent) {
|
public ParamUtils.Builder getSpecification(SalesOrderVo parent) {
|
||||||
ParamUtils.Builder params = getSpecification();
|
ParamUtils.Builder params = getSpecification();
|
||||||
params.equals("order", parent);
|
params.equals("order", parent);
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractItemComposeViewModel createNew(String key, ContractItem item) {
|
ContractItemComposeViewModel createNew(String key, ContractItemVo item) {
|
||||||
ContractItemComposeViewModel m = new ContractItemComposeViewModel();
|
ContractItemComposeViewModel m = new ContractItemComposeViewModel();
|
||||||
// set key
|
// set key
|
||||||
m.getTitle().set(item.getTitle());
|
m.getTitle().set(item.getTitle());
|
||||||
@@ -120,8 +118,8 @@ public class SalesOrderTabSkinItems
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIn(HashMap<String, ContractItemComposeViewModel> map, List<ContractItem> list) {
|
private void addIn(HashMap<String, ContractItemComposeViewModel> map, List<ContractItemVo> list) {
|
||||||
for (ContractItem item : list) {
|
for (ContractItemVo item : list) {
|
||||||
String key = makeKey(item);
|
String key = makeKey(item);
|
||||||
ContractItemComposeViewModel model = map.computeIfAbsent(key, k -> createNew(k, item));
|
ContractItemComposeViewModel model = map.computeIfAbsent(key, k -> createNew(k, item));
|
||||||
model.getUnit().set(item.getUnit());
|
model.getUnit().set(item.getUnit());
|
||||||
@@ -129,8 +127,8 @@ public class SalesOrderTabSkinItems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addOut(List<ContractItem> list, HashMap<String, ContractItemComposeViewModel> map) {
|
private void addOut(List<ContractItemVo> list, HashMap<String, ContractItemComposeViewModel> map) {
|
||||||
for (ContractItem item : list) {
|
for (ContractItemVo item : list) {
|
||||||
String key = makeKey(item);
|
String key = makeKey(item);
|
||||||
ContractItemComposeViewModel model = map.computeIfAbsent(key, k -> createNew(k, item));
|
ContractItemComposeViewModel model = map.computeIfAbsent(key, k -> createNew(k, item));
|
||||||
model.getUnit().set(item.getUnit());
|
model.getUnit().set(item.getUnit());
|
||||||
@@ -222,7 +220,7 @@ public class SalesOrderTabSkinItems
|
|||||||
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
||||||
}
|
}
|
||||||
|
|
||||||
String makeKey(ContractItem item) {
|
String makeKey(ContractItemVo item) {
|
||||||
return item.getTitle() + "-" + item.getSpecification();
|
return item.getTitle() + "-" + item.getSpecification();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,12 +245,10 @@ public class SalesOrderTabSkinItems
|
|||||||
setText(String.format(format, item));
|
setText(String.format(format, item));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTooltip(ObservableList<ContractItem> list, Function<ContractItem, Double> getPrice) {
|
private void setTooltip(ObservableList<ContractItemVo> list, Function<ContractItemVo, Double> getPrice) {
|
||||||
String text = list.stream().map(v -> {
|
String text = list.stream().map(v -> {
|
||||||
Contract contract = v.getContract();
|
Integer contractId = v.getContractId();
|
||||||
if (!ProxyUtils.isInitialized(contract)) {
|
ContractVo contract = SpringApp.getBean(ContractService.class).findById(contractId);
|
||||||
contract = SpringApp.getBean(ContractService.class).findById(contract.getId());
|
|
||||||
}
|
|
||||||
Double price = getPrice.apply(v);
|
Double price = getPrice.apply(v);
|
||||||
double quantity = v.getQuantity();
|
double quantity = v.getQuantity();
|
||||||
return contract.getCode() + " " + String.format(format, price) + " x " + quantity + " = "
|
return contract.getCode() + " " + String.format(format, price) + " x " + quantity + " = "
|
||||||
|
|||||||
@@ -13,17 +13,18 @@ import com.ecep.contract.controller.company.CompanyWindowController;
|
|||||||
import com.ecep.contract.controller.vendor.VendorBidWindowController;
|
import com.ecep.contract.controller.vendor.VendorBidWindowController;
|
||||||
import com.ecep.contract.converter.CompanyStringConverter;
|
import com.ecep.contract.converter.CompanyStringConverter;
|
||||||
import com.ecep.contract.converter.EntityStringConverter;
|
import com.ecep.contract.converter.EntityStringConverter;
|
||||||
import com.ecep.contract.model.Company;
|
|
||||||
import com.ecep.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.ContractBidVendor;
|
|
||||||
import com.ecep.contract.model.ContractFile;
|
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.ContractFileService;
|
import com.ecep.contract.service.ContractFileService;
|
||||||
|
import com.ecep.contract.service.ContractService;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.BaseViewModel;
|
import com.ecep.contract.vm.BaseViewModel;
|
||||||
import com.ecep.contract.vm.ContractBidVendorViewModel;
|
import com.ecep.contract.vm.ContractBidVendorViewModel;
|
||||||
import com.ecep.contract.vm.ContractFileViewModel;
|
import com.ecep.contract.vm.ContractFileViewModel;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
import com.ecep.contract.vo.ContractBidVendorVo;
|
||||||
|
import com.ecep.contract.vo.ContractFileVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.BooleanProperty;
|
import javafx.beans.property.BooleanProperty;
|
||||||
@@ -35,13 +36,8 @@ import javafx.util.converter.LocalDateStringConverter;
|
|||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
public class VendorBidTabSkinBase
|
public class VendorBidTabSkinBase
|
||||||
extends AbstEntityBasedTabSkin<VendorBidWindowController, ContractBidVendor, ContractBidVendorViewModel>
|
extends AbstEntityBasedTabSkin<VendorBidWindowController, ContractBidVendorVo, ContractBidVendorViewModel>
|
||||||
implements TabSkin {
|
implements TabSkin {
|
||||||
|
|
||||||
@Setter
|
|
||||||
private ContractFileService companyContactService;
|
|
||||||
@Setter
|
|
||||||
private CompanyService companyService;
|
|
||||||
private final ContractFileViewModel quotationSheetViewModel = new ContractFileViewModel();
|
private final ContractFileViewModel quotationSheetViewModel = new ContractFileViewModel();
|
||||||
|
|
||||||
private final SimpleBooleanProperty changed = new SimpleBooleanProperty(false);
|
private final SimpleBooleanProperty changed = new SimpleBooleanProperty(false);
|
||||||
@@ -75,8 +71,13 @@ public class VendorBidTabSkinBase
|
|||||||
controller.developDateField.setConverter(converter);
|
controller.developDateField.setConverter(converter);
|
||||||
controller.developDateField.valueProperty().bindBidirectional(quotationSheetViewModel.getApplyDate());
|
controller.developDateField.valueProperty().bindBidirectional(quotationSheetViewModel.getApplyDate());
|
||||||
|
|
||||||
viewModel.getQuotationSheet()
|
viewModel.getQuotationSheetFileId()
|
||||||
.addListener((observable, oldValue, newValue) -> quotationSheetViewModel.update(newValue));
|
.addListener((observable, oldValue, newValue) -> {
|
||||||
|
if (newValue != null) {
|
||||||
|
ContractFileVo file = getContractFileService().findById(newValue);
|
||||||
|
quotationSheetViewModel.update(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
quotationSheetViewModel.getApplyDate()
|
quotationSheetViewModel.getApplyDate()
|
||||||
.addListener((observable, oldValue, newValue) -> quotationSheetViewModel.getChanged().set(true));
|
.addListener((observable, oldValue, newValue) -> quotationSheetViewModel.getChanged().set(true));
|
||||||
|
|
||||||
@@ -91,16 +92,21 @@ public class VendorBidTabSkinBase
|
|||||||
// );
|
// );
|
||||||
// controller.versionLabel.textProperty().bind(viewModel.getVersion().asString());
|
// controller.versionLabel.textProperty().bind(viewModel.getVersion().asString());
|
||||||
|
|
||||||
controller.relativeCompanyBtn.disableProperty().bind(viewModel.getCompany().isNull());
|
controller.relativeCompanyBtn.disableProperty().bind(viewModel.getCompanyId().isNull());
|
||||||
controller.relativeCompanyBtn.setOnAction(event -> {
|
controller.relativeCompanyBtn.setOnAction(event -> {
|
||||||
Company company = viewModel.getCompany().get();
|
Integer companyId = viewModel.getCompanyId().get();
|
||||||
if (company != null) {
|
if (companyId != null) {
|
||||||
|
CompanyVo company = getCompanyService().findById(companyId);
|
||||||
CompanyWindowController.show(company, controller.tabPane.getScene().getWindow());
|
CompanyWindowController.show(company, controller.tabPane.getScene().getWindow());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (viewModel.getQuotationSheet().get() != null) {
|
if (viewModel.getQuotationSheetFileId() != null) {
|
||||||
quotationSheetViewModel.update(viewModel.getQuotationSheet().get());
|
Integer fileId = viewModel.getQuotationSheetFileId().get();
|
||||||
|
if (fileId != null) {
|
||||||
|
ContractFileVo file = getContractFileService().findById(fileId);
|
||||||
|
quotationSheetViewModel.update(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,11 +119,12 @@ public class VendorBidTabSkinBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializeFileFieldAutoCompletion(TextField textField) {
|
private void initializeFileFieldAutoCompletion(TextField textField) {
|
||||||
EntityStringConverter<ContractFile> stringConverter = new EntityStringConverter<>();
|
EntityStringConverter<ContractFileVo> stringConverter = new EntityStringConverter<>();
|
||||||
stringConverter.setInitialized(cc -> getContractFileService().findById(cc.getId()));
|
stringConverter.setInitialized(cc -> getContractFileService().findById(cc.getId()));
|
||||||
stringConverter.setFormater(ContractFile::getFileName);
|
stringConverter.setFormater(ContractFileVo::getFileName);
|
||||||
stringConverter.setSuggestion(p -> {
|
stringConverter.setSuggestion(p -> {
|
||||||
Contract contract = viewModel.getContract().get();
|
Integer contractId = viewModel.getContractId().get();
|
||||||
|
ContractVo contract = getContractService().findById(contractId);
|
||||||
if (contract == null) {
|
if (contract == null) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
@@ -125,26 +132,23 @@ public class VendorBidTabSkinBase
|
|||||||
params.put("searchText", p);
|
params.put("searchText", p);
|
||||||
return getContractFileService().findAll(params, Pageable.ofSize(10)).getContent();
|
return getContractFileService().findAll(params, Pageable.ofSize(10)).getContent();
|
||||||
});
|
});
|
||||||
UITools.autoCompletion(textField, viewModel.getQuotationSheet(), stringConverter::suggest, stringConverter);
|
UITools.autoCompletion(textField, viewModel.getQuotationSheetFileId(), getContractFileService());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeCompanyFieldAutoCompletion(TextField textField) {
|
private void initializeCompanyFieldAutoCompletion(TextField textField) {
|
||||||
CompanyStringConverter converter = SpringApp.getBean(CompanyStringConverter.class);
|
UITools.autoCompletion(textField, viewModel.getCompanyId(), getCompanyService());
|
||||||
UITools.autoCompletion(textField, viewModel.getCompany(), converter::suggest, converter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompanyService getCompanyService() {
|
public CompanyService getCompanyService() {
|
||||||
if (companyService == null) {
|
return getCachedBean(CompanyService.class);
|
||||||
companyService = SpringApp.getBean(CompanyService.class);
|
|
||||||
}
|
}
|
||||||
return companyService;
|
|
||||||
|
public ContractService getContractService() {
|
||||||
|
return getCachedBean(ContractService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContractFileService getContractFileService() {
|
public ContractFileService getContractFileService() {
|
||||||
if (companyContactService == null) {
|
return getCachedBean(ContractFileService.class);
|
||||||
companyContactService = SpringApp.getBean(ContractFileService.class);
|
|
||||||
}
|
|
||||||
return companyContactService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -157,7 +161,7 @@ public class VendorBidTabSkinBase
|
|||||||
super.save();
|
super.save();
|
||||||
|
|
||||||
if (quotationSheetViewModel.isChanged()) {
|
if (quotationSheetViewModel.isChanged()) {
|
||||||
ContractFile contractFile = getContractFileService().findById(quotationSheetViewModel.getId().get());
|
ContractFileVo contractFile = getContractFileService().findById(quotationSheetViewModel.getId().get());
|
||||||
if (quotationSheetViewModel.copyTo(contractFile)) {
|
if (quotationSheetViewModel.copyTo(contractFile)) {
|
||||||
contractFile = getContractFileService().save(contractFile);
|
contractFile = getContractFileService().save(contractFile);
|
||||||
BaseViewModel.updateInFxApplicationThread(contractFile, quotationSheetViewModel);
|
BaseViewModel.updateInFxApplicationThread(contractFile, quotationSheetViewModel);
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ public class AsyncUpdateTableCell<V, T extends IdentityEntity> extends javafx.sc
|
|||||||
// 检查单元格是否仍然显示相同的项目
|
// 检查单元格是否仍然显示相同的项目
|
||||||
// 如果单元格已被重用或当前项目已改变,则不更新
|
// 如果单元格已被重用或当前项目已改变,则不更新
|
||||||
if (isEmpty() || getItem() == null) {
|
if (isEmpty() || getItem() == null) {
|
||||||
logger.debug("Skipping async update - cell reused ");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,24 @@ import static com.ecep.contract.SpringApp.getBean;
|
|||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
|
||||||
|
import javafx.util.Callback;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公司单元格
|
* 公司单元格
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class CompanyTableCell<V> extends AsyncUpdateTableCell<V, CompanyVo> {
|
public class CompanyTableCell<V> extends AsyncUpdateTableCell<V, CompanyVo> {
|
||||||
|
/**
|
||||||
|
* 创建单元格工厂
|
||||||
|
*
|
||||||
|
* @param companyService 公司服务
|
||||||
|
* @return 单元格工厂
|
||||||
|
*/
|
||||||
|
public static <V> Callback<javafx.scene.control.TableColumn<V, Integer>, javafx.scene.control.TableCell<V, Integer>> forTableColumn(
|
||||||
|
CompanyService companyService) {
|
||||||
|
return param -> new CompanyTableCell<V>(companyService);
|
||||||
|
}
|
||||||
|
|
||||||
public CompanyTableCell(CompanyService companyService) {
|
public CompanyTableCell(CompanyService companyService) {
|
||||||
setService(companyService);
|
setService(companyService);
|
||||||
@@ -20,4 +32,5 @@ public class CompanyTableCell<V> extends AsyncUpdateTableCell<V, CompanyVo> {
|
|||||||
protected CompanyService getServiceBean() {
|
protected CompanyService getServiceBean() {
|
||||||
return getBean(CompanyService.class);
|
return getBean(CompanyService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.ecep.contract.controller.table.cell;
|
||||||
|
|
||||||
|
import static com.ecep.contract.SpringApp.getBean;
|
||||||
|
|
||||||
|
import com.ecep.contract.service.ContractService;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
|
import javafx.scene.control.TableCell;
|
||||||
|
import javafx.scene.control.TableColumn;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ContractFileTableCell<V> extends AsyncUpdateTableCell<V, ContractVo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个ContractFileTableCell的TableCell工厂,自动获取ContractService实例
|
||||||
|
*
|
||||||
|
* @param <S> 表格行类型
|
||||||
|
* @return TableCell工厂回调
|
||||||
|
*/
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
||||||
|
return forTableColumn(getBean(ContractService.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建一个ContractFileTableCell的TableCell工厂,使用提供的ContractService实例
|
||||||
|
*
|
||||||
|
* @param <S> 表格行类型
|
||||||
|
* @param service ContractService实例
|
||||||
|
* @return TableCell工厂回调
|
||||||
|
*/
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn(ContractService service) {
|
||||||
|
return param -> new ContractFileTableCell<S>(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用指定的ContractService创建ContractFileTableCell实例
|
||||||
|
*
|
||||||
|
* @param contractService ContractService实例
|
||||||
|
*/
|
||||||
|
public ContractFileTableCell(ContractService contractService) {
|
||||||
|
setService(contractService);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取ContractService实例
|
||||||
|
*
|
||||||
|
* @return ContractService实例
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected ContractService getServiceBean() {
|
||||||
|
return getBean(ContractService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化ContractVo对象为显示文本
|
||||||
|
*
|
||||||
|
* @param entity ContractVo对象
|
||||||
|
* @return 格式化后的文本
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String format(ContractVo entity) {
|
||||||
|
return entity.getCode() + " " + entity.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ecep.contract.controller.table.cell;
|
||||||
|
|
||||||
|
import static com.ecep.contract.SpringApp.getBean;
|
||||||
|
|
||||||
|
import com.ecep.contract.SpringApp;
|
||||||
|
import com.ecep.contract.service.CustomerCatalogService;
|
||||||
|
import com.ecep.contract.vo.CustomerCatalogVo;
|
||||||
|
|
||||||
|
import javafx.scene.control.TableCell;
|
||||||
|
import javafx.scene.control.TableColumn;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CustomerCatalogTableCell<T> extends AsyncUpdateTableCell<T, CustomerCatalogVo> {
|
||||||
|
public CustomerCatalogTableCell(CustomerCatalogService service) {
|
||||||
|
setService(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CustomerCatalogService getServiceBean() {
|
||||||
|
return SpringApp.getBean(CustomerCatalogService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
||||||
|
return forTableColumn(getBean(CustomerCatalogService.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn(CustomerCatalogService service) {
|
||||||
|
return param -> new CustomerCatalogTableCell<S>(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,13 +13,6 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
public class EmployeeTableCell<V> extends AsyncUpdateTableCell<V, EmployeeVo> {
|
public class EmployeeTableCell<V> extends AsyncUpdateTableCell<V, EmployeeVo> {
|
||||||
|
|
||||||
public EmployeeTableCell() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public EmployeeTableCell(EmployeeService employeeService) {
|
|
||||||
setService(employeeService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
||||||
return forTableColumn(getBean(EmployeeService.class));
|
return forTableColumn(getBean(EmployeeService.class));
|
||||||
}
|
}
|
||||||
@@ -28,6 +21,13 @@ public class EmployeeTableCell<V> extends AsyncUpdateTableCell<V, EmployeeVo> {
|
|||||||
return param -> new EmployeeTableCell<S>(service);
|
return param -> new EmployeeTableCell<S>(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EmployeeTableCell() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmployeeTableCell(EmployeeService employeeService) {
|
||||||
|
setService(employeeService);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected EmployeeService getServiceBean() {
|
protected EmployeeService getServiceBean() {
|
||||||
return getBean(EmployeeService.class);
|
return getBean(EmployeeService.class);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class EvaluationFileTableCell<V> extends AsyncUpdateTableCell<V, CompanyC
|
|||||||
@Override
|
@Override
|
||||||
protected CompanyCustomerEvaluationFormFileVo initialize() {
|
protected CompanyCustomerEvaluationFormFileVo initialize() {
|
||||||
// 直接返回Vo对象
|
// 直接返回Vo对象
|
||||||
return getEvaluationFormFileService().findCustomerEvaluationFormFileById(getItem());
|
return getEvaluationFormFileService().findById(getItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,17 +1,26 @@
|
|||||||
package com.ecep.contract.controller.table.cell;
|
package com.ecep.contract.controller.table.cell;
|
||||||
|
|
||||||
import com.ecep.contract.util.ProxyUtils;
|
|
||||||
|
|
||||||
import com.ecep.contract.SpringApp;
|
import com.ecep.contract.SpringApp;
|
||||||
import com.ecep.contract.service.InventoryCatalogService;
|
import com.ecep.contract.service.InventoryCatalogService;
|
||||||
import com.ecep.contract.service.InventoryService;
|
import com.ecep.contract.service.InventoryService;
|
||||||
import com.ecep.contract.vo.InventoryCatalogVo;
|
import com.ecep.contract.vo.InventoryCatalogVo;
|
||||||
import com.ecep.contract.vo.InventoryVo;
|
import com.ecep.contract.vo.InventoryVo;
|
||||||
|
|
||||||
|
import javafx.util.Callback;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class InventoryTableCell<V> extends AsyncUpdateTableCell<V, InventoryVo> {
|
public class InventoryTableCell<V> extends AsyncUpdateTableCell<V, InventoryVo> {
|
||||||
|
/**
|
||||||
|
* 创建单元格工厂
|
||||||
|
*
|
||||||
|
* @param inventoryService 库存服务
|
||||||
|
* @return 单元格工厂
|
||||||
|
*/
|
||||||
|
public static <V> Callback<javafx.scene.control.TableColumn<V, Integer>, javafx.scene.control.TableCell<V, Integer>> forTableColumn(
|
||||||
|
InventoryService inventoryService) {
|
||||||
|
return param -> new InventoryTableCell<>(inventoryService);
|
||||||
|
}
|
||||||
|
|
||||||
private InventoryCatalogService inventoryCatalogService;
|
private InventoryCatalogService inventoryCatalogService;
|
||||||
|
|
||||||
@@ -32,4 +41,5 @@ public class InventoryTableCell<V> extends AsyncUpdateTableCell<V, InventoryVo>
|
|||||||
InventoryCatalogVo catalog = getInventoryCatalogService().findById(catalogId);
|
InventoryCatalogVo catalog = getInventoryCatalogService().findById(catalogId);
|
||||||
return (catalog != null ? (catalog.getName() + " ") : "") + entity.getName();
|
return (catalog != null ? (catalog.getName() + " ") : "") + entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,24 @@
|
|||||||
package com.ecep.contract.controller.table.cell;
|
package com.ecep.contract.controller.table.cell;
|
||||||
|
|
||||||
import com.ecep.contract.model.Project;
|
|
||||||
import com.ecep.contract.service.IEntityService;
|
|
||||||
import com.ecep.contract.service.ProjectService;
|
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
import static com.ecep.contract.SpringApp.getBean;
|
||||||
|
|
||||||
|
import com.ecep.contract.service.ProjectService;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
|
import javafx.scene.control.TableCell;
|
||||||
|
import javafx.scene.control.TableColumn;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ProjectTableCell<V> extends AsyncUpdateTableCell<V, ProjectVo> {
|
public class ProjectTableCell<V> extends AsyncUpdateTableCell<V, ProjectVo> {
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
||||||
|
return forTableColumn(getBean(ProjectService.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn(ProjectService service) {
|
||||||
|
return param -> new ProjectTableCell<S>(service);
|
||||||
|
}
|
||||||
|
|
||||||
public ProjectTableCell(ProjectService projectService) {
|
public ProjectTableCell(ProjectService projectService) {
|
||||||
setService(projectService);
|
setService(projectService);
|
||||||
@@ -20,7 +29,6 @@ public class ProjectTableCell<V> extends AsyncUpdateTableCell<V, ProjectVo> {
|
|||||||
return getBean(ProjectService.class);
|
return getBean(ProjectService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(ProjectVo entity) {
|
public String format(ProjectVo entity) {
|
||||||
return entity.getCode() + " " + entity.getName();
|
return entity.getCode() + " " + entity.getName();
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import java.util.List;
|
|||||||
import org.controlsfx.control.ListSelectionView;
|
import org.controlsfx.control.ListSelectionView;
|
||||||
|
|
||||||
import com.ecep.contract.ContractFileType;
|
import com.ecep.contract.ContractFileType;
|
||||||
import com.ecep.contract.SpringApp;
|
|
||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||||
import com.ecep.contract.model.VendorGroupRequireFileType;
|
import com.ecep.contract.model.VendorGroupRequireFileType;
|
||||||
import com.ecep.contract.service.ContractFileService;
|
import com.ecep.contract.service.ContractFileService;
|
||||||
import com.ecep.contract.service.ContractFileTypeService;
|
import com.ecep.contract.service.ContractFileTypeService;
|
||||||
import com.ecep.contract.service.VendorGroupRequireFileTypeService;
|
import com.ecep.contract.service.VendorGroupRequireFileTypeService;
|
||||||
|
import com.ecep.contract.vo.VendorGroupRequireFileTypeVo;
|
||||||
|
|
||||||
import impl.org.controlsfx.skin.ListSelectionViewSkin;
|
import impl.org.controlsfx.skin.ListSelectionViewSkin;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
@@ -58,8 +58,8 @@ public class VendorGroupRequireFilesTabSkin extends AbstVendorGroupBasedTabSkin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadSelectedRoles() {
|
private void loadSelectedRoles() {
|
||||||
List<VendorGroupRequireFileType> list = getRequireFileTypeService().findByGroupId(viewModel.getId().get());
|
List<VendorGroupRequireFileTypeVo> list = getRequireFileTypeService().findByGroupId(viewModel.getId().get());
|
||||||
List<ContractFileType> types = list.stream().map(VendorGroupRequireFileType::getFileType).toList();
|
List<ContractFileType> types = list.stream().map(VendorGroupRequireFileTypeVo::getFileType).toList();
|
||||||
fileTypesField.getTargetItems().setAll(types);
|
fileTypesField.getTargetItems().setAll(types);
|
||||||
changed.set(false);
|
changed.set(false);
|
||||||
}
|
}
|
||||||
@@ -124,15 +124,15 @@ public class VendorGroupRequireFilesTabSkin extends AbstVendorGroupBasedTabSkin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveRequireFileTypes(ActionEvent event) {
|
private void saveRequireFileTypes(ActionEvent event) {
|
||||||
List<VendorGroupRequireFileType> list = getRequireFileTypeService().findByGroupId(viewModel.getId().get());
|
List<VendorGroupRequireFileTypeVo> list = getRequireFileTypeService().findByGroupId(viewModel.getId().get());
|
||||||
ObservableList<ContractFileType> types = fileTypesField.getTargetItems();
|
ObservableList<ContractFileType> types = fileTypesField.getTargetItems();
|
||||||
// 保存 types ,list 中是已经存储的,如果types 中没有则删除,如果 types 中有则新增保存
|
// 保存 types ,list 中是已经存储的,如果types 中没有则删除,如果 types 中有则新增保存
|
||||||
for (ContractFileType type : types) {
|
for (ContractFileType type : types) {
|
||||||
VendorGroupRequireFileType entity = list.stream().filter(v -> v.getFileType() == type).findFirst()
|
VendorGroupRequireFileTypeVo entity = list.stream().filter(v -> v.getFileType() == type).findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
entity = new VendorGroupRequireFileType();
|
entity = new VendorGroupRequireFileTypeVo();
|
||||||
entity.setGroup(getEntity());
|
entity.setGroupId(viewModel.getId().get());
|
||||||
entity.setFileType(type);
|
entity.setFileType(type);
|
||||||
getRequireFileTypeService().save(entity);
|
getRequireFileTypeService().save(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
|||||||
}, 1, TimeUnit.MINUTES);
|
}, 1, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudRkVo updateCloudRk(Integer companyId, MessageHolder holder) {
|
public CloudRkVo updateCloudRk(CompanyVo company, MessageHolder holder) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'updateCloudRk'");
|
throw new UnsupportedOperationException("Unimplemented method 'updateCloudRk'");
|
||||||
}
|
}
|
||||||
@@ -63,6 +63,8 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
|||||||
cloudRk.setVendorGrade("");
|
cloudRk.setVendorGrade("");
|
||||||
cloudRk.setVendorScore(-1);
|
cloudRk.setVendorScore(-1);
|
||||||
cloudRk.setRank("");
|
cloudRk.setRank("");
|
||||||
|
cloudRk.setActive(false);
|
||||||
|
cloudRk.setVersion(1);
|
||||||
cloudRk = save(cloudRk);
|
cloudRk = save(cloudRk);
|
||||||
}
|
}
|
||||||
return cloudRk;
|
return cloudRk;
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ package com.ecep.contract.service;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.DesktopUtils;
|
import com.ecep.contract.DesktopUtils;
|
||||||
import com.ecep.contract.SpringApp;
|
import com.ecep.contract.SpringApp;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.util.UITools;
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vm.CloudTycInfoViewModel;
|
import com.ecep.contract.vm.CloudTycInfoViewModel;
|
||||||
import com.ecep.contract.vo.CloudTycVo;
|
import com.ecep.contract.vo.CloudTycVo;
|
||||||
@@ -57,6 +59,20 @@ public class CloudTycService extends QueryService<CloudTycVo, CloudTycInfoViewMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CloudTycVo getOrCreateCloudTyc(CompanyVo company) {
|
public CloudTycVo getOrCreateCloudTyc(CompanyVo company) {
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getOrCreateCloudTyc'");
|
CloudTycVo cloudTyc = findByCompany(company);
|
||||||
|
if (cloudTyc == null) {
|
||||||
|
cloudTyc = new CloudTycVo();
|
||||||
|
cloudTyc.setCompanyId(company.getId());
|
||||||
|
cloudTyc.setActive(false);
|
||||||
|
cloudTyc.setVersion(1);
|
||||||
|
cloudTyc = save(cloudTyc);
|
||||||
}
|
}
|
||||||
|
return cloudTyc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CloudTycVo findByCompany(CompanyVo company) {
|
||||||
|
return findAll(ParamUtils.builder().equals("company", company.getId()).build(), Pageable.ofSize(1)).stream()
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,12 @@ public class CompanyCustomerEvaluationFormFileService
|
|||||||
* 根据客户文件查找评估表文件
|
* 根据客户文件查找评估表文件
|
||||||
*/
|
*/
|
||||||
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(CompanyCustomerFileVo customerFile) {
|
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(CompanyCustomerFileVo customerFile) {
|
||||||
|
return findByCustomerFile(customerFile.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(Integer customerFileId) {
|
||||||
List<CompanyCustomerEvaluationFormFileVo> page = findAll(ParamUtils.builder()
|
List<CompanyCustomerEvaluationFormFileVo> page = findAll(ParamUtils.builder()
|
||||||
.equals("customerFile", customerFile.getId())
|
.equals("customerFile", customerFileId)
|
||||||
.build(), Pageable.ofSize(1))
|
.build(), Pageable.ofSize(1))
|
||||||
.getContent();
|
.getContent();
|
||||||
if (page.isEmpty()) {
|
if (page.isEmpty()) {
|
||||||
@@ -42,10 +46,4 @@ public class CompanyCustomerEvaluationFormFileService
|
|||||||
return super.save(formFile);
|
return super.save(formFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据ID查找评估表文件
|
|
||||||
*/
|
|
||||||
public CompanyCustomerEvaluationFormFileVo findCustomerEvaluationFormFileById(int id) {
|
|
||||||
return findById(id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.ecep.contract.vm.ContractKindViewModel;
|
import com.ecep.contract.vm.ContractKindViewModel;
|
||||||
import com.ecep.contract.vo.ContractKindVo;
|
import com.ecep.contract.vo.ContractKindVo;
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "contract-kind")
|
@CacheConfig(cacheNames = "contract-kind")
|
||||||
public class ContractKindService extends QueryService<ContractKindVo, ContractKindViewModel> {
|
public class ContractKindService extends QueryService<ContractKindVo, ContractKindViewModel> {
|
||||||
@@ -68,4 +70,19 @@ public class ContractKindService extends QueryService<ContractKindVo, ContractKi
|
|||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringConverter<ContractKindVo> getStringConverter() {
|
||||||
|
return new StringConverter<ContractKindVo>() {
|
||||||
|
@Override
|
||||||
|
public String toString(ContractKindVo object) {
|
||||||
|
return object.getCode() + " " + object.getName() + " " + object.getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractKindVo fromString(String string) {
|
||||||
|
return findByCode(string);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,18 +2,28 @@ package com.ecep.contract.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.model.Contract;
|
import com.ecep.contract.model.Contract;
|
||||||
import com.ecep.contract.model.ContractPayPlan;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
||||||
|
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ContractPayPlanService extends QueryService<ContractPayPlan, ContractPayPlanViewModel> {
|
public class ContractPayPlanService extends QueryService<ContractPayPlanVo, ContractPayPlanViewModel> {
|
||||||
|
|
||||||
public List<ContractPayPlan> findAllByContract(Contract contract) {
|
public List<ContractPayPlanVo> findAllByContract(Contract contract) {
|
||||||
// TODO Auto-generated method stub
|
return findAll(ParamUtils.builder()
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'findAllByContract'");
|
.equals("contract", contract.getId())
|
||||||
|
.build(), Pageable.unpaged()).getContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ContractPayPlanVo> findAllByContract(ContractVo contract) {
|
||||||
|
return findAll(ParamUtils.builder()
|
||||||
|
.equals("contract", contract.getId())
|
||||||
|
.build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import com.ecep.contract.model.ContractFile;
|
|||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ContractViewModel;
|
import com.ecep.contract.vm.ContractViewModel;
|
||||||
import com.ecep.contract.vo.CompanyVendorVo;
|
import com.ecep.contract.vo.CompanyVendorVo;
|
||||||
|
import com.ecep.contract.vo.ContractFileVo;
|
||||||
import com.ecep.contract.vo.ContractVo;
|
import com.ecep.contract.vo.ContractVo;
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
@@ -165,7 +166,7 @@ public class ContractService extends QueryService<ContractVo, ContractViewModel>
|
|||||||
return findAll(ParamUtils.equal("project", project.getId()), Pageable.unpaged()).getContent();
|
return findAll(ParamUtils.equal("project", project.getId()), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void syncContractFile(ContractFile contractFile, File outputFile, MessageHolder holder) {
|
public void syncContractFile(ContractFileVo contractFile, File outputFile, MessageHolder holder) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'syncContractFile'");
|
throw new UnsupportedOperationException("Unimplemented method 'syncContractFile'");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.ecep.contract.vm.ContractTypeViewModel;
|
import com.ecep.contract.vm.ContractTypeViewModel;
|
||||||
import com.ecep.contract.vo.ContractTypeVo;
|
import com.ecep.contract.vo.ContractTypeVo;
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "contract-type")
|
@CacheConfig(cacheNames = "contract-type")
|
||||||
public class ContractTypeService extends QueryService<ContractTypeVo, ContractTypeViewModel> {
|
public class ContractTypeService extends QueryService<ContractTypeVo, ContractTypeViewModel> {
|
||||||
@@ -66,4 +68,21 @@ public class ContractTypeService extends QueryService<ContractTypeVo, ContractTy
|
|||||||
public ContractTypeVo save(ContractTypeVo entity) {
|
public ContractTypeVo save(ContractTypeVo entity) {
|
||||||
return super.save(entity);
|
return super.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringConverter<ContractTypeVo> getStringConverter() {
|
||||||
|
return new StringConverter<ContractTypeVo>() {
|
||||||
|
@Override
|
||||||
|
public String toString(ContractTypeVo object) {
|
||||||
|
return object.getCode() + " " + object.getCatalog() + " " + object.getName() + " " + object.getTitle()
|
||||||
|
+ "("
|
||||||
|
+ object.getDirection() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractTypeVo fromString(String string) {
|
||||||
|
return findByCode(string);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package com.ecep.contract.service;
|
|||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.model.CustomerCatalog;
|
|
||||||
import com.ecep.contract.vm.CustomerCatalogViewModel;
|
import com.ecep.contract.vm.CustomerCatalogViewModel;
|
||||||
|
import com.ecep.contract.vo.CustomerCatalogVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "customer-catalog")
|
@CacheConfig(cacheNames = "customer-catalog")
|
||||||
public class CustomerCatalogService extends QueryService<CustomerCatalog, CustomerCatalogViewModel>{
|
public class CustomerCatalogService extends QueryService<CustomerCatalogVo, CustomerCatalogViewModel> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,32 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.DeliverySignMethodViewModel;
|
import com.ecep.contract.vm.DeliverySignMethodViewModel;
|
||||||
import com.ecep.contract.vo.DeliverySignMethodVo;
|
import com.ecep.contract.vo.DeliverySignMethodVo;
|
||||||
|
import com.ecep.contract.vo.ProjectSaleTypeVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "delivery-sign-method")
|
@CacheConfig(cacheNames = "delivery-sign-method")
|
||||||
public class DeliverySignMethodService extends QueryService<DeliverySignMethodVo, DeliverySignMethodViewModel> {
|
public class DeliverySignMethodService extends QueryService<DeliverySignMethodVo, DeliverySignMethodViewModel> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据销售类型和编码查询发货方式
|
||||||
|
*
|
||||||
|
* @param saleType
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public DeliverySignMethodVo findBySaleTypeAndCode(ProjectSaleTypeVo saleType, String code) {
|
||||||
|
Page<DeliverySignMethodVo> page = findAll(ParamUtils.builder()
|
||||||
|
.equals("saleType", saleType.getId()).build(), Pageable.unpaged());
|
||||||
|
if (page.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.stream().filter(v -> v.getCode().equals(code)).findFirst().orElse(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
import com.ecep.contract.model.EmployeeRole;
|
||||||
import com.ecep.contract.vm.EmployeeViewModel;
|
import com.ecep.contract.vm.EmployeeViewModel;
|
||||||
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
import com.ecep.contract.vo.EmployeeVo;
|
import com.ecep.contract.vo.EmployeeVo;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
|
||||||
@@ -52,14 +53,17 @@ public class EmployeeService extends QueryService<EmployeeVo, EmployeeViewModel>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EmployeeRole> getRolesByEmployeeId(Integer id) {
|
public List<EmployeeRoleVo> getRolesByEmployeeId(Integer employeeId) {
|
||||||
try {
|
try {
|
||||||
return async("getRolesByEmployeeId", List.of(id), List.of(Integer.class)).handle((response, ex) -> {
|
return async("getRolesByEmployeeId", List.of(employeeId), List.of(Integer.class)).handle((response, ex) -> {
|
||||||
|
if (ex != null) {
|
||||||
|
throw new RuntimeException("远程方法+getRolesByEmployeeId+调用失败", ex);
|
||||||
|
}
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
try {
|
try {
|
||||||
List<EmployeeRole> content = new ArrayList<>();
|
List<EmployeeRoleVo> content = new ArrayList<>();
|
||||||
for (JsonNode node : response) {
|
for (JsonNode node : response) {
|
||||||
EmployeeRole newEntity = new EmployeeRole();
|
EmployeeRoleVo newEntity = new EmployeeRoleVo();
|
||||||
objectMapper.updateValue(newEntity, node);
|
objectMapper.updateValue(newEntity, node);
|
||||||
content.add(newEntity);
|
content.add(newEntity);
|
||||||
}
|
}
|
||||||
@@ -90,4 +94,9 @@ public class EmployeeService extends QueryService<EmployeeVo, EmployeeViewModel>
|
|||||||
public void delete(EmployeeVo entity) {
|
public void delete(EmployeeVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getUpdateEmployeeRoles(int employeeId, List<EmployeeRoleVo> roles) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'getUpdateEmployeeRoles'");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,41 @@ package com.ecep.contract.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.cache.annotation.Caching;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.model.Permission;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.PermissionViewModel;
|
import com.ecep.contract.vm.PermissionViewModel;
|
||||||
|
import com.ecep.contract.vo.PermissionVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PermissionService extends QueryService<Permission, PermissionViewModel> {
|
@CacheConfig(cacheNames = "permission")
|
||||||
|
public class PermissionService extends QueryService<PermissionVo, PermissionViewModel> {
|
||||||
|
|
||||||
public List<Permission> findByFunctionId(int i) {
|
@Cacheable(key = "#p0")
|
||||||
// TODO Auto-generated method stub
|
@Override
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'findByFunctionId'");
|
public PermissionVo findById(Integer id) {
|
||||||
|
return super.findById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Caching(evict = { @CacheEvict(key = "#p0.id") })
|
||||||
|
@Override
|
||||||
|
public PermissionVo save(PermissionVo entity) {
|
||||||
|
return super.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Caching(evict = { @CacheEvict(key = "#p0.id") })
|
||||||
|
@Override
|
||||||
|
public void delete(PermissionVo entity) {
|
||||||
|
super.delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PermissionVo> findByFunctionId(int functionId) {
|
||||||
|
return findAll(ParamUtils.builder().equals("null", functionId).build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.springframework.data.domain.Page;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ecep.contract.model.ProductType;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ProductTypeViewModel;
|
import com.ecep.contract.vm.ProductTypeViewModel;
|
||||||
import com.ecep.contract.vo.ProductTypeVo;
|
import com.ecep.contract.vo.ProductTypeVo;
|
||||||
@@ -52,4 +53,13 @@ public class ProductTypeService extends QueryService<ProductTypeVo, ProductTypeV
|
|||||||
public void delete(ProductTypeVo entity) {
|
public void delete(ProductTypeVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProductTypeVo findByCode(String code) {
|
||||||
|
Page<ProductTypeVo> page = findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1));
|
||||||
|
if (page.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.getContent().getFirst();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package com.ecep.contract.service;
|
|||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ProductUsageViewModel;
|
import com.ecep.contract.vm.ProductUsageViewModel;
|
||||||
import com.ecep.contract.vo.ProductUsageVo;
|
import com.ecep.contract.vo.ProductUsageVo;
|
||||||
|
|
||||||
@@ -36,4 +39,12 @@ public class ProductUsageService extends QueryService<ProductUsageVo, ProductUsa
|
|||||||
super.delete(usage);
|
super.delete(usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProductUsageVo findByCode(String code) {
|
||||||
|
Page<ProductUsageVo> page = findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1));
|
||||||
|
if (page.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.getContent().getFirst();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ProjectCostItemViewModel;
|
import com.ecep.contract.vm.ProjectCostItemViewModel;
|
||||||
import com.ecep.contract.vo.ProjectCostItemVo;
|
import com.ecep.contract.vo.ProjectCostItemVo;
|
||||||
import com.ecep.contract.vo.ProjectCostVo;
|
import com.ecep.contract.vo.ProjectCostVo;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ProjectCostItemService extends QueryService<ProjectCostItemVo, ProjectCostItemViewModel> {
|
public class ProjectCostItemService extends QueryService<ProjectCostItemVo, ProjectCostItemViewModel> {
|
||||||
|
|
||||||
public List<ProjectCostItemVo> findByCost(ProjectCostVo cost) {
|
public List<ProjectCostItemVo> findByCost(ProjectCostVo cost) {
|
||||||
// TODO Auto-generated method stub
|
return findAll(ParamUtils.builder().equals("cost", cost).build(), Pageable.unpaged()).getContent();
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'findByCost'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -8,10 +9,15 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ProjectFundPlanViewModel;
|
import com.ecep.contract.vm.ProjectFundPlanViewModel;
|
||||||
import com.ecep.contract.vo.ProjectFundPlanVo;
|
import com.ecep.contract.vo.ProjectFundPlanVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ProjectFundPlanService extends QueryService<ProjectFundPlanVo, ProjectFundPlanViewModel> {
|
public class ProjectFundPlanService extends QueryService<ProjectFundPlanVo, ProjectFundPlanViewModel> {
|
||||||
|
|
||||||
|
public List<ProjectFundPlanVo> findAllByProject(ProjectVo project) {
|
||||||
|
return findAllByProject(project.getId());
|
||||||
|
}
|
||||||
|
|
||||||
public List<ProjectFundPlanVo> findAllByProject(Integer projectId) {
|
public List<ProjectFundPlanVo> findAllByProject(Integer projectId) {
|
||||||
return findAll(ParamUtils.builder()
|
return findAll(ParamUtils.builder()
|
||||||
.equals("project", projectId)
|
.equals("project", projectId)
|
||||||
@@ -24,4 +30,16 @@ public class ProjectFundPlanService extends QueryService<ProjectFundPlanVo, Proj
|
|||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectFundPlanVo newInstanceByProject(ProjectVo project) {
|
||||||
|
ProjectFundPlanVo vo = new ProjectFundPlanVo();
|
||||||
|
vo.setProjectId(project.getId());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectFundPlanViewModel createNewViewModel() {
|
||||||
|
ProjectFundPlanViewModel model = new ProjectFundPlanViewModel();
|
||||||
|
model.getUpdateDate().set(LocalDateTime.now());
|
||||||
|
return model;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import com.ecep.contract.vm.ProjectIndustryViewModel;
|
import java.util.List;
|
||||||
import com.ecep.contract.vo.ProjectIndustryVo;
|
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.cache.annotation.Caching;
|
import org.springframework.cache.annotation.Caching;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
|
import com.ecep.contract.vm.ProjectIndustryViewModel;
|
||||||
|
import com.ecep.contract.vo.ProjectIndustryVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "project-industry")
|
@CacheConfig(cacheNames = "project-industry")
|
||||||
@@ -25,15 +29,23 @@ public class ProjectIndustryService extends QueryService<ProjectIndustryVo, Proj
|
|||||||
return super.findAll();
|
return super.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(evict = {@CacheEvict(key = "#p0.id"), @CacheEvict(key = "'all'")})
|
@Caching(evict = { @CacheEvict(key = "#p0.id"), @CacheEvict(key = "'all'") })
|
||||||
@Override
|
@Override
|
||||||
public ProjectIndustryVo save(ProjectIndustryVo entity) {
|
public ProjectIndustryVo save(ProjectIndustryVo entity) {
|
||||||
return super.save(entity);
|
return super.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(evict = {@CacheEvict(key = "#p0.id"), @CacheEvict(key = "'all'")})
|
@Caching(evict = { @CacheEvict(key = "#p0.id"), @CacheEvict(key = "'all'") })
|
||||||
@Override
|
@Override
|
||||||
public void delete(ProjectIndustryVo entity) {
|
public void delete(ProjectIndustryVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectIndustryVo findByCode(String code) {
|
||||||
|
Page<ProjectIndustryVo> page = findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1));
|
||||||
|
if (page.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.getContent().getFirst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.ecep.contract.service;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
@@ -16,7 +18,12 @@ import com.ecep.contract.SpringApp;
|
|||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ProjectViewModel;
|
import com.ecep.contract.vm.ProjectViewModel;
|
||||||
import com.ecep.contract.vo.ContractVo;
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.DeliverySignMethodVo;
|
||||||
|
import com.ecep.contract.vo.ProductTypeVo;
|
||||||
|
import com.ecep.contract.vo.ProductUsageVo;
|
||||||
|
import com.ecep.contract.vo.ProjectIndustryVo;
|
||||||
import com.ecep.contract.vo.ProjectSaleTypeVo;
|
import com.ecep.contract.vo.ProjectSaleTypeVo;
|
||||||
|
import com.ecep.contract.vo.ProjectTypeVo;
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -43,7 +50,75 @@ public class ProjectService extends QueryService<ProjectVo, ProjectViewModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void applyCode(ProjectVo project, String code) {
|
public void applyCode(ProjectVo project, String code) {
|
||||||
throw new UnsupportedOperationException();
|
project.setCode(code);
|
||||||
|
|
||||||
|
String saleTypeCode = null;
|
||||||
|
String seqCode = null;
|
||||||
|
String extCode = null;
|
||||||
|
// 第二个字符是数字时,快速处理
|
||||||
|
if (Character.isDigit(code.charAt(1))) {
|
||||||
|
// 只有一个字母表示合同类型
|
||||||
|
saleTypeCode = String.valueOf(code.charAt(0));
|
||||||
|
seqCode = code.substring(1, 6);
|
||||||
|
extCode = code.substring(6);
|
||||||
|
} else {
|
||||||
|
// 使用正则找出 A-Z 1~4字母引导 合同类型
|
||||||
|
String regex = "^([A-Z]{1,4})(\\d{4,5})([A-Z]{0,5})";
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(code);
|
||||||
|
if (matcher.find()) {
|
||||||
|
saleTypeCode = matcher.group(1);
|
||||||
|
seqCode = matcher.group(2);
|
||||||
|
extCode = matcher.group(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectSaleTypeVo saleType = SpringApp.getBean(ProjectSaleTypeService.class).findByCode(saleTypeCode);
|
||||||
|
if (saleType != null) {
|
||||||
|
project.setSaleTypeId(saleType.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (seqCode != null) {
|
||||||
|
project.setCodeYear(Integer.parseInt(seqCode.substring(0, 2)));
|
||||||
|
project.setCodeSequenceNumber(Integer.parseInt(seqCode.substring(2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extCode != null) {
|
||||||
|
// 4个后缀编码
|
||||||
|
if (extCode.length() > 3) {
|
||||||
|
DeliverySignMethodVo signMethod = SpringApp.getBean(DeliverySignMethodService.class)
|
||||||
|
.findBySaleTypeAndCode(saleType,
|
||||||
|
String.valueOf(extCode.charAt(0)));
|
||||||
|
if (signMethod != null) {
|
||||||
|
project.setDeliverySignMethodId(signMethod.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
ProductTypeVo productType = SpringApp.getBean(ProductTypeService.class)
|
||||||
|
.findByCode(extCode.substring(1, 2));
|
||||||
|
if (productType != null) {
|
||||||
|
project.setProductTypeId(productType.getId());
|
||||||
|
}
|
||||||
|
ProjectTypeVo projectType = SpringApp.getBean(ProjectTypeService.class)
|
||||||
|
.findByCode(extCode.substring(2, 3));
|
||||||
|
if (projectType != null) {
|
||||||
|
project.setProjectTypeId(projectType.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectIndustryVo industry = SpringApp.getBean(ProjectIndustryService.class)
|
||||||
|
.findByCode(extCode.substring(3, 4));
|
||||||
|
if (industry != null) {
|
||||||
|
project.setIndustryId(industry.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 扩展至 5个后缀编码
|
||||||
|
if (extCode.length() > 4) {
|
||||||
|
ProductUsageVo productUsage = SpringApp.getBean(ProductUsageService.class)
|
||||||
|
.findByCode(extCode.substring(4, 5));
|
||||||
|
if (productUsage != null) {
|
||||||
|
project.setProductUsageId(productUsage.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectVo newInstanceByContract(ContractVo contract) {
|
public ProjectVo newInstanceByContract(ContractVo contract) {
|
||||||
|
|||||||
@@ -21,4 +21,12 @@ public class ProjectTypeService extends QueryService<ProjectTypeVo, ProjectTypeV
|
|||||||
return page.getContent().getFirst();
|
return page.getContent().getFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProjectTypeVo findByCode(String code) {
|
||||||
|
Page<ProjectTypeVo> page = findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1));
|
||||||
|
if (page.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.getContent().getFirst();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,16 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StringConverter<T> getStringConverter() {
|
public StringConverter<T> getStringConverter() {
|
||||||
throw new UnsupportedOperationException("Not implemented");
|
return new StringConverter<>() {
|
||||||
|
@Override
|
||||||
|
public String toString(T object) {
|
||||||
|
return object.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T fromString(String string) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.model.VendorGroupRequireFileType;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.VendorGroupRequireFileTypeViewModel;
|
import com.ecep.contract.vm.VendorGroupRequireFileTypeViewModel;
|
||||||
|
import com.ecep.contract.vo.VendorGroupRequireFileTypeVo;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class VendorGroupRequireFileTypeService
|
public class VendorGroupRequireFileTypeService
|
||||||
extends QueryService<VendorGroupRequireFileType, VendorGroupRequireFileTypeViewModel> {
|
extends QueryService<VendorGroupRequireFileTypeVo, VendorGroupRequireFileTypeViewModel> {
|
||||||
|
|
||||||
public List<VendorGroupRequireFileType> findByGroupId(Integer id) {
|
public List<VendorGroupRequireFileTypeVo> findByGroupId(Integer id) {
|
||||||
return findAll(Map.of("group", id), Pageable.unpaged()).getContent();
|
return findAll(ParamUtils.builder().equals("group", id).build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.controlsfx.control.TaskProgressView;
|
import org.controlsfx.control.TaskProgressView;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.Desktop;
|
import com.ecep.contract.Desktop;
|
||||||
import com.ecep.contract.model.CloudYu;
|
|
||||||
import com.ecep.contract.model.Company;
|
|
||||||
import com.ecep.contract.task.ContractSyncTask;
|
import com.ecep.contract.task.ContractSyncTask;
|
||||||
import com.ecep.contract.task.CustomerSyncTask;
|
import com.ecep.contract.task.CustomerSyncTask;
|
||||||
import com.ecep.contract.task.MonitoredTask;
|
import com.ecep.contract.task.MonitoredTask;
|
||||||
import com.ecep.contract.task.VendorSyncTask;
|
import com.ecep.contract.task.VendorSyncTask;
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.CloudYuInfoViewModel;
|
import com.ecep.contract.vm.CloudYuInfoViewModel;
|
||||||
import com.ecep.contract.vo.CloudYuVo;
|
import com.ecep.contract.vo.CloudYuVo;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
|
|
||||||
@@ -50,9 +52,30 @@ public class YongYouU8Service extends QueryService<CloudYuVo, CloudYuInfoViewMod
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudYu getOrCreateCloudYu(Company company) {
|
@Override
|
||||||
// TODO Auto-generated method stub
|
public CloudYuVo createNewEntity() {
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getOrCreateCloudYu'");
|
CloudYuVo cloudYu = new CloudYuVo();
|
||||||
|
cloudYu.setLatestUpdate(LocalDateTime.now());
|
||||||
|
cloudYu.setActive(false);
|
||||||
|
cloudYu.setVersion(1);
|
||||||
|
return cloudYu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CloudYuVo getOrCreateCloudYu(CompanyVo company) {
|
||||||
|
CloudYuVo cloudYu = findByCompany(company);
|
||||||
|
if (cloudYu == null) {
|
||||||
|
cloudYu = createNewEntity();
|
||||||
|
cloudYu.setCompanyId(company.getId());
|
||||||
|
cloudYu.setActive(false);
|
||||||
|
cloudYu.setVersion(1);
|
||||||
|
save(cloudYu);
|
||||||
|
}
|
||||||
|
return cloudYu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CloudYuVo findByCompany(CompanyVo company) {
|
||||||
|
return findAll(ParamUtils.builder().equals("company", company.getId()).build(), Pageable.ofSize(1)).stream()
|
||||||
|
.findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -444,9 +444,9 @@ public class ContractVerifyComm {
|
|||||||
boolean loseFile = false;
|
boolean loseFile = false;
|
||||||
ContractFileService fileService = getContractFileService();
|
ContractFileService fileService = getContractFileService();
|
||||||
List<ContractFileVo> files = fileService.findAllByContract(contract);
|
List<ContractFileVo> files = fileService.findAllByContract(contract);
|
||||||
List<VendorGroupRequireFileType> list = getVendorGroupRequireFileTypeService().findByGroupId(group.getId());
|
List<VendorGroupRequireFileTypeVo> list = getVendorGroupRequireFileTypeService().findByGroupId(group.getId());
|
||||||
if (list != null && !list.isEmpty()) {
|
if (list != null && !list.isEmpty()) {
|
||||||
for (VendorGroupRequireFileType item : list) {
|
for (VendorGroupRequireFileTypeVo item : list) {
|
||||||
ContractFileType fileType = item.getFileType();
|
ContractFileType fileType = item.getFileType();
|
||||||
if (fileType == null) {
|
if (fileType == null) {
|
||||||
continue;
|
continue;
|
||||||
@@ -469,17 +469,18 @@ public class ContractVerifyComm {
|
|||||||
holder.debug("指定供应商, 跳过供应商比价");
|
holder.debug("指定供应商, 跳过供应商比价");
|
||||||
} else {
|
} else {
|
||||||
boolean requireQuotation = group.isRequireQuotationSheetForBid();
|
boolean requireQuotation = group.isRequireQuotationSheetForBid();
|
||||||
List<ContractBidVendor> bidVendors = getContractBidVendorService().findByContract(contract);
|
List<ContractBidVendorVo> bidVendors = getContractBidVendorService().findByContract(contract);
|
||||||
if (bidVendors == null || bidVendors.isEmpty()) {
|
if (bidVendors == null || bidVendors.isEmpty()) {
|
||||||
holder.error("未上报供应商比价");
|
holder.error("未上报供应商比价");
|
||||||
} else {
|
} else {
|
||||||
for (ContractBidVendor bidVendor : bidVendors) {
|
for (ContractBidVendorVo bidVendor : bidVendors) {
|
||||||
ContractFileVo contractFile = fileService.findById(bidVendor.getQuotationSheet().getId());
|
ContractFileVo contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
||||||
if (contractFile == null) {
|
if (contractFile == null) {
|
||||||
if (requireQuotation && bidVendor.getCompany().getId().equals(contract.getCompanyId())) {
|
if (requireQuotation && bidVendor.getCompanyId().equals(contract.getCompanyId())) {
|
||||||
holder.debug("供应商类型启用了允许选中供应商不必须要有报价表");
|
holder.debug("供应商类型启用了允许选中供应商不必须要有报价表");
|
||||||
} else {
|
} else {
|
||||||
holder.error("供应商比价:" + bidVendor.getCompany().getName() + " 未上传/关联报价表");
|
CompanyVo company = getCompanyService().findById(bidVendor.getCompanyId());
|
||||||
|
holder.error("供应商比价:" + company.getName() + " 未上传/关联报价表");
|
||||||
loseFile = true;
|
loseFile = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -251,12 +251,13 @@ public class UITools {
|
|||||||
public static <T extends IdentityEntity, TV extends IdentityViewModel<T>> AutoCompletionBinding<T> autoCompletion(
|
public static <T extends IdentityEntity, TV extends IdentityViewModel<T>> AutoCompletionBinding<T> autoCompletion(
|
||||||
TextField textField, ObjectProperty<Integer> idProperty, QueryService<T, TV> queryService) {
|
TextField textField, ObjectProperty<Integer> idProperty, QueryService<T, TV> queryService) {
|
||||||
Integer id = idProperty.get();
|
Integer id = idProperty.get();
|
||||||
T entity = queryService.findById(id);
|
|
||||||
|
|
||||||
StringConverter<T> converter = queryService.getStringConverter();
|
StringConverter<T> converter = queryService.getStringConverter();
|
||||||
|
if (id != null) {
|
||||||
|
T entity = queryService.findById(id);
|
||||||
// 先赋值
|
// 先赋值
|
||||||
textField.textProperty().set(converter.toString(entity));
|
textField.textProperty().set(converter.toString(entity));
|
||||||
|
}
|
||||||
|
|
||||||
// 监听 property 变化
|
// 监听 property 变化
|
||||||
idProperty.addListener((observable, oldValue, newValue) -> {
|
idProperty.addListener((observable, oldValue, newValue) -> {
|
||||||
T newEntity = queryService.findById(newValue);
|
T newEntity = queryService.findById(newValue);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
|||||||
import com.ecep.contract.vo.ContractBidVendorVo;
|
import com.ecep.contract.vo.ContractBidVendorVo;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,8 +14,11 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class ContractBidVendorViewModel extends IdentityViewModel<ContractBidVendorVo> {
|
public class ContractBidVendorViewModel extends IdentityViewModel<ContractBidVendorVo> {
|
||||||
private SimpleIntegerProperty contractId = new SimpleIntegerProperty();
|
private SimpleIntegerProperty contractId = new SimpleIntegerProperty();
|
||||||
private SimpleIntegerProperty companyId = new SimpleIntegerProperty();
|
private SimpleObjectProperty<Integer> companyId = new SimpleObjectProperty<>();
|
||||||
private SimpleIntegerProperty quotationSheetFileId = new SimpleIntegerProperty();
|
/**
|
||||||
|
* 报价单文件ID, ContractFile
|
||||||
|
*/
|
||||||
|
private SimpleObjectProperty<Integer> quotationSheetFileId = new SimpleObjectProperty<>();
|
||||||
private SimpleStringProperty quotationSheetFileName = new SimpleStringProperty();
|
private SimpleStringProperty quotationSheetFileName = new SimpleStringProperty();
|
||||||
|
|
||||||
public static ContractBidVendorViewModel from(ContractBidVendorVo v) {
|
public static ContractBidVendorViewModel from(ContractBidVendorVo v) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
import com.ecep.contract.model.Contract;
|
import com.ecep.contract.model.Contract;
|
||||||
import com.ecep.contract.model.ContractPayPlan;
|
import com.ecep.contract.model.ContractPayPlan;
|
||||||
|
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleDoubleProperty;
|
import javafx.beans.property.SimpleDoubleProperty;
|
||||||
import javafx.beans.property.SimpleFloatProperty;
|
import javafx.beans.property.SimpleFloatProperty;
|
||||||
@@ -16,11 +17,11 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class ContractPayPlanViewModel extends IdentityViewModel<ContractPayPlan> {
|
public class ContractPayPlanViewModel extends IdentityViewModel<ContractPayPlanVo> {
|
||||||
/**
|
/**
|
||||||
* 关联的合同对象
|
* 关联的合同对象, Contract
|
||||||
*/
|
*/
|
||||||
SimpleObjectProperty<Contract> contract = new SimpleObjectProperty<>();
|
SimpleObjectProperty<Integer> contract = new SimpleObjectProperty<>();
|
||||||
/**
|
/**
|
||||||
* 关联的用友系统中的数据ID
|
* 关联的用友系统中的数据ID
|
||||||
*/
|
*/
|
||||||
@@ -34,9 +35,9 @@ public class ContractPayPlanViewModel extends IdentityViewModel<ContractPayPlan>
|
|||||||
SimpleObjectProperty<LocalDateTime> updateDate = new SimpleObjectProperty<>();
|
SimpleObjectProperty<LocalDateTime> updateDate = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateFrom(ContractPayPlan v) {
|
protected void updateFrom(ContractPayPlanVo v) {
|
||||||
super.updateFrom(v);
|
super.updateFrom(v);
|
||||||
getContract().set(v.getContract());
|
getContract().set(v.getContractId());
|
||||||
getRefId().set(v.getRefId());
|
getRefId().set(v.getRefId());
|
||||||
getPayDate().set(v.getPayDate());
|
getPayDate().set(v.getPayDate());
|
||||||
getPayRatio().set(v.getPayRatio());
|
getPayRatio().set(v.getPayRatio());
|
||||||
@@ -46,10 +47,10 @@ public class ContractPayPlanViewModel extends IdentityViewModel<ContractPayPlan>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyTo(ContractPayPlan v) {
|
public boolean copyTo(ContractPayPlanVo v) {
|
||||||
boolean modified = super.copyTo(v);
|
boolean modified = super.copyTo(v);
|
||||||
if (!Objects.equals(contract.get(), v.getContract())) {
|
if (!Objects.equals(contract.get(), v.getContractId())) {
|
||||||
v.setContract(contract.get());
|
v.setContractId(contract.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(refId.get(), v.getRefId())) {
|
if (!Objects.equals(refId.get(), v.getRefId())) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.ecep.contract.SpringApp;
|
|||||||
import com.ecep.contract.controller.CurrentEmployeeInitialedEvent;
|
import com.ecep.contract.controller.CurrentEmployeeInitialedEvent;
|
||||||
import com.ecep.contract.model.EmployeeRole;
|
import com.ecep.contract.model.EmployeeRole;
|
||||||
import com.ecep.contract.service.EmployeeService;
|
import com.ecep.contract.service.EmployeeService;
|
||||||
|
import com.ecep.contract.vo.EmployeeRoleVo;
|
||||||
import com.ecep.contract.vo.EmployeeVo;
|
import com.ecep.contract.vo.EmployeeVo;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.property.SimpleListProperty;
|
import javafx.beans.property.SimpleListProperty;
|
||||||
@@ -40,7 +41,7 @@ public class CurrentEmployee extends EmployeeViewModel {
|
|||||||
/**
|
/**
|
||||||
* 角色
|
* 角色
|
||||||
*/
|
*/
|
||||||
private SimpleListProperty<EmployeeRole> roles = new SimpleListProperty<>(FXCollections.observableArrayList());
|
private SimpleListProperty<EmployeeRoleVo> roles = new SimpleListProperty<>(FXCollections.observableArrayList());
|
||||||
|
|
||||||
private DateTimeFormatter dateFormatter = DateTimeFormatter
|
private DateTimeFormatter dateFormatter = DateTimeFormatter
|
||||||
.ofPattern(MyDateTimeUtils.DEFAULT_DATE_FORMAT_PATTERN);
|
.ofPattern(MyDateTimeUtils.DEFAULT_DATE_FORMAT_PATTERN);
|
||||||
@@ -61,7 +62,7 @@ public class CurrentEmployee extends EmployeeViewModel {
|
|||||||
* 是否系统管理员
|
* 是否系统管理员
|
||||||
*/
|
*/
|
||||||
public boolean isSystemAdministrator() {
|
public boolean isSystemAdministrator() {
|
||||||
return roles.stream().anyMatch(EmployeeRole::isSystemAdministrator);
|
return roles.stream().anyMatch(EmployeeRoleVo::isSystemAdministrator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +75,7 @@ public class CurrentEmployee extends EmployeeViewModel {
|
|||||||
/**
|
/**
|
||||||
* 角色属性
|
* 角色属性
|
||||||
*/
|
*/
|
||||||
public SimpleListProperty<EmployeeRole> rolesProperty() {
|
public SimpleListProperty<EmployeeRoleVo> rolesProperty() {
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +142,7 @@ public class CurrentEmployee extends EmployeeViewModel {
|
|||||||
// issue #1 sss 2020-07-05
|
// issue #1 sss 2020-07-05
|
||||||
EmployeeService employeeService = SpringApp.getBean(EmployeeService.class);
|
EmployeeService employeeService = SpringApp.getBean(EmployeeService.class);
|
||||||
EmployeeVo employee = employeeService.findById(getId().get());
|
EmployeeVo employee = employeeService.findById(getId().get());
|
||||||
List<EmployeeRole> roles = employeeService.getRolesByEmployeeId(getId().get());
|
List<EmployeeRoleVo> roles = employeeService.getRolesByEmployeeId(getId().get());
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
update(employee);
|
update(employee);
|
||||||
rolesProperty().setAll(roles);
|
rolesProperty().setAll(roles);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.ecep.contract.vm;
|
package com.ecep.contract.vm;
|
||||||
|
|
||||||
import com.ecep.contract.model.CustomerCatalog;
|
import com.ecep.contract.vo.CustomerCatalogVo;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -9,13 +9,24 @@ import java.util.Objects;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CustomerCatalogViewModel extends IdentityViewModel<CustomerCatalog> {
|
public class CustomerCatalogViewModel extends IdentityViewModel<CustomerCatalogVo> {
|
||||||
private SimpleStringProperty code = new SimpleStringProperty();
|
private SimpleStringProperty code = new SimpleStringProperty();
|
||||||
private SimpleStringProperty name = new SimpleStringProperty();
|
private SimpleStringProperty name = new SimpleStringProperty();
|
||||||
private SimpleStringProperty description = new SimpleStringProperty();
|
private SimpleStringProperty description = new SimpleStringProperty();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建CustomerCatalogViewModel实例
|
||||||
|
* @param v CustomerCatalogVo对象
|
||||||
|
* @return CustomerCatalogViewModel实例
|
||||||
|
*/
|
||||||
|
public static CustomerCatalogViewModel from(CustomerCatalogVo v) {
|
||||||
|
CustomerCatalogViewModel vm = new CustomerCatalogViewModel();
|
||||||
|
vm.update(v);
|
||||||
|
return vm;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateFrom(CustomerCatalog v) {
|
protected void updateFrom(CustomerCatalogVo v) {
|
||||||
super.updateFrom(v);
|
super.updateFrom(v);
|
||||||
code.set(v.getCode());
|
code.set(v.getCode());
|
||||||
name.set(v.getName());
|
name.set(v.getName());
|
||||||
@@ -23,7 +34,7 @@ public class CustomerCatalogViewModel extends IdentityViewModel<CustomerCatalog>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyTo(CustomerCatalog v) {
|
public boolean copyTo(CustomerCatalogVo v) {
|
||||||
boolean ret = super.copyTo(v);
|
boolean ret = super.copyTo(v);
|
||||||
if (!Objects.equals(code.get(), v.getCode())) {
|
if (!Objects.equals(code.get(), v.getCode())) {
|
||||||
v.setCode(code.get());
|
v.setCode(code.get());
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.ecep.contract.vm;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.ecep.contract.model.Company;
|
|
||||||
import com.ecep.contract.vo.InvoiceVo;
|
import com.ecep.contract.vo.InvoiceVo;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ package com.ecep.contract.vm;
|
|||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.ecep.contract.model.Function;
|
import com.ecep.contract.vo.PermissionVo;
|
||||||
import com.ecep.contract.model.Permission;
|
|
||||||
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
@@ -12,34 +11,34 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class PermissionViewModel extends IdentityViewModel<Permission> {
|
public class PermissionViewModel extends IdentityViewModel<PermissionVo> {
|
||||||
private SimpleStringProperty name = new SimpleStringProperty();
|
private SimpleStringProperty name = new SimpleStringProperty();
|
||||||
private SimpleObjectProperty<Function> function = new SimpleObjectProperty<>();
|
|
||||||
private SimpleStringProperty key = new SimpleStringProperty();
|
private SimpleStringProperty key = new SimpleStringProperty();
|
||||||
|
private SimpleObjectProperty<Integer> function = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
public static PermissionViewModel from(Permission v) {
|
public static PermissionViewModel from(PermissionVo v) {
|
||||||
PermissionViewModel model = new PermissionViewModel();
|
PermissionViewModel model = new PermissionViewModel();
|
||||||
model.update(v);
|
model.update(v);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateFrom(Permission v) {
|
protected void updateFrom(PermissionVo v) {
|
||||||
super.updateFrom(v);
|
super.updateFrom(v);
|
||||||
getName().set(v.getName());
|
getName().set(v.getName());
|
||||||
getFunction().set(v.getFunction());
|
getFunction().set(v.getFunctionId());
|
||||||
getKey().set(v.getKey());
|
getKey().set(v.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyTo(Permission v) {
|
public boolean copyTo(PermissionVo v) {
|
||||||
boolean modified = super.copyTo(v);
|
boolean modified = super.copyTo(v);
|
||||||
if (!Objects.equals(name.get(), v.getName())) {
|
if (!Objects.equals(name.get(), v.getName())) {
|
||||||
v.setName(name.get());
|
v.setName(name.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(function.get(), v.getFunction())) {
|
if (!Objects.equals(function.get(), v.getFunctionId())) {
|
||||||
v.setFunction(function.get());
|
v.setFunctionId(function.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(key.get(), v.getKey())) {
|
if (!Objects.equals(key.get(), v.getKey())) {
|
||||||
|
|||||||
@@ -3,41 +3,57 @@ package com.ecep.contract.vm;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.ecep.contract.ContractFileType;
|
import com.ecep.contract.ContractFileType;
|
||||||
import com.ecep.contract.model.VendorGroup;
|
import com.ecep.contract.vo.VendorGroupRequireFileTypeVo;
|
||||||
import com.ecep.contract.model.VendorGroupRequireFileType;
|
|
||||||
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 供应商组要求的文件类型视图模型
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class VendorGroupRequireFileTypeViewModel extends IdentityViewModel<VendorGroupRequireFileType> {
|
public class VendorGroupRequireFileTypeViewModel extends IdentityViewModel<VendorGroupRequireFileTypeVo> {
|
||||||
|
private SimpleObjectProperty<Integer> groupId = new SimpleObjectProperty<>();
|
||||||
private SimpleObjectProperty<VendorGroup> group = new SimpleObjectProperty<>();
|
|
||||||
private SimpleObjectProperty<ContractFileType> fileType = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<ContractFileType> fileType = new SimpleObjectProperty<>();
|
||||||
|
private SimpleObjectProperty<ContractFileType.Frequency> frequency = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
protected void updateFrom(VendorGroupRequireFileType v) {
|
* 创建VendorGroupRequireFileTypeViewModel实例
|
||||||
super.updateFrom(v);
|
*
|
||||||
getGroup().set(v.getGroup());
|
* @param v VendorGroupRequireFileTypeVo对象
|
||||||
getFileType().set(v.getFileType());
|
* @return VendorGroupRequireFileTypeViewModel实例
|
||||||
|
*/
|
||||||
|
public static VendorGroupRequireFileTypeViewModel from(VendorGroupRequireFileTypeVo v) {
|
||||||
|
VendorGroupRequireFileTypeViewModel vm = new VendorGroupRequireFileTypeViewModel();
|
||||||
|
vm.update(v);
|
||||||
|
return vm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyTo(VendorGroupRequireFileType v) {
|
protected void updateFrom(VendorGroupRequireFileTypeVo v) {
|
||||||
|
super.updateFrom(v);
|
||||||
|
getGroupId().set(v.getGroupId());
|
||||||
|
getFileType().set(v.getFileType());
|
||||||
|
getFrequency().set(v.getFrequency());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean copyTo(VendorGroupRequireFileTypeVo v) {
|
||||||
boolean modified = super.copyTo(v);
|
boolean modified = super.copyTo(v);
|
||||||
if (!Objects.equals(getGroup().get(), v.getGroup())) {
|
if (!Objects.equals(getGroupId().get(), v.getGroupId())) {
|
||||||
v.setGroup(getGroup().get());
|
v.setGroupId(getGroupId().get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(getFileType().get(), v.getFileType())) {
|
if (!Objects.equals(getFileType().get(), v.getFileType())) {
|
||||||
v.setFileType(getFileType().get());
|
v.setFileType(getFileType().get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(getFrequency().get(), v.getFrequency())) {
|
||||||
|
v.setFrequency(getFrequency().get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ public class Company implements IdentityEntity, NamedEntity, BasedEntity, Serial
|
|||||||
vo.setName(name);
|
vo.setName(name);
|
||||||
vo.setUniscid(getUniscid());
|
vo.setUniscid(getUniscid());
|
||||||
vo.setShortName(getShortName());
|
vo.setShortName(getShortName());
|
||||||
vo.setPathExist(getPathExist());
|
vo.setPathExist(getPathExist() != null && getPathExist());
|
||||||
vo.setPath(getPath());
|
vo.setPath(getPath());
|
||||||
vo.setCreated(getCreated());
|
vo.setCreated(getCreated());
|
||||||
vo.setEntStatus(getEntStatus());
|
vo.setEntStatus(getEntStatus());
|
||||||
|
|||||||
@@ -10,8 +10,14 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ContractPayPlanVo implements IdentityEntity, ContractBasedVo {
|
public class ContractPayPlanVo implements IdentityEntity, ContractBasedVo {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 关联的合同对象, Contract
|
||||||
|
*/
|
||||||
private Integer contractId;
|
private Integer contractId;
|
||||||
|
|
||||||
|
|
||||||
private Integer refId;
|
private Integer refId;
|
||||||
|
private float payRatio;
|
||||||
private Double payCurrency;
|
private Double payCurrency;
|
||||||
private LocalDate payDate;
|
private LocalDate payDate;
|
||||||
private LocalDateTime updateDate;
|
private LocalDateTime updateDate;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public class DeliverySignMethodVo implements IdentityEntity, NamedEntity {
|
|||||||
private String name;
|
private String name;
|
||||||
private String code;
|
private String code;
|
||||||
private Integer saleTypeId;
|
private Integer saleTypeId;
|
||||||
private String saleTypeName;
|
|
||||||
private String description;
|
private String description;
|
||||||
private boolean active = false;
|
private boolean active = false;
|
||||||
private LocalDate created;
|
private LocalDate created;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class PermissionVo implements IdentityEntity {
|
|||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer functionId;
|
private Integer functionId;
|
||||||
private String name;
|
private String name;
|
||||||
private String code;
|
private String key;
|
||||||
private String description;
|
private String description;
|
||||||
private Boolean active;
|
private Boolean active;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ecep.contract.vo;
|
||||||
|
|
||||||
|
import com.ecep.contract.ContractFileType;
|
||||||
|
import com.ecep.contract.model.IdentityEntity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VendorGroupRequireFileTypeVo implements IdentityEntity {
|
||||||
|
private Integer id;
|
||||||
|
private Integer groupId;
|
||||||
|
private ContractFileType fileType;
|
||||||
|
private ContractFileType.Frequency frequency;
|
||||||
|
}
|
||||||
@@ -281,3 +281,4 @@ CompanyBankAccount: CompanyBankAccountVo (已检查)
|
|||||||
ExtendVendorInfo: ExtendVendorInfoVo (已创建)
|
ExtendVendorInfo: ExtendVendorInfoVo (已创建)
|
||||||
ProjectCost: ProjectCostVo (已更新)
|
ProjectCost: ProjectCostVo (已更新)
|
||||||
VendorGroup: VendorGroupVo (已创建)
|
VendorGroup: VendorGroupVo (已创建)
|
||||||
|
VendorGroupRequireFileType: VendorGroupRequireFileTypeVo (已创建)
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ecep.contract.cloud;
|
package com.ecep.contract.cloud;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -57,7 +58,7 @@ public class CloudInfo {
|
|||||||
* 本地更新时间戳,控制更新频率和重复更新
|
* 本地更新时间戳,控制更新频率和重复更新
|
||||||
*/
|
*/
|
||||||
@Column(name = "LATEST_UPDATE")
|
@Column(name = "LATEST_UPDATE")
|
||||||
private Instant latestUpdate;
|
private LocalDateTime latestUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的公司
|
* 关联的公司
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.cloud.u8;
|
|||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -110,7 +111,7 @@ public class CustomerSyncTask extends AbstContractRepairTasker {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cloudYu.setCustomerUpdateDate(LocalDate.now());
|
cloudYu.setCustomerUpdateDate(LocalDate.now());
|
||||||
cloudYu.setCloudLatest(Instant.now());
|
cloudYu.setCloudLatest(LocalDateTime.now());
|
||||||
cloudYu.setExceptionMessage("");
|
cloudYu.setExceptionMessage("");
|
||||||
yongYouU8Service.save(cloudYu);
|
yongYouU8Service.save(cloudYu);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.cloud.u8;
|
|||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@@ -124,7 +125,7 @@ public class VendorSyncTask extends AbstContractRepairTasker {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cloudYu.setVendorUpdateDate(LocalDate.now());
|
cloudYu.setVendorUpdateDate(LocalDate.now());
|
||||||
cloudYu.setCloudLatest(Instant.now());
|
cloudYu.setCloudLatest(LocalDateTime.now());
|
||||||
cloudYu.setExceptionMessage("");
|
cloudYu.setExceptionMessage("");
|
||||||
yongYouU8Service.save(cloudYu);
|
yongYouU8Service.save(cloudYu);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class CompanyCompositeUpdateTasker extends Tasker<Object> {
|
|||||||
yongYouU8Service.initialize(contractCtx);
|
yongYouU8Service.initialize(contractCtx);
|
||||||
contractCtx.syncContract(company, holder);
|
contractCtx.syncContract(company, holder);
|
||||||
|
|
||||||
cloudYu.setCloudLatest(Instant.now());
|
cloudYu.setCloudLatest(LocalDateTime.now());
|
||||||
cloudYu.setExceptionMessage("");
|
cloudYu.setExceptionMessage("");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
@@ -132,7 +132,7 @@ public class CompanyCompositeUpdateTasker extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
cloudYu.setExceptionMessage(message);
|
cloudYu.setExceptionMessage(message);
|
||||||
} finally {
|
} finally {
|
||||||
cloudYu.setLatestUpdate(Instant.now());
|
cloudYu.setLatestUpdate(LocalDateTime.now());
|
||||||
yongYouU8Service.save(cloudYu);
|
yongYouU8Service.save(cloudYu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.contract.tasker;
|
|||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|
||||||
@@ -58,12 +59,12 @@ public class ContractRepairByCompanyTask extends AbstContractRepairTasker {
|
|||||||
repaired = true;
|
repaired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cloudYu.setCloudLatest(Instant.now());
|
cloudYu.setCloudLatest(LocalDateTime.now());
|
||||||
cloudYu.setExceptionMessage("");
|
cloudYu.setExceptionMessage("");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
cloudYu.setExceptionMessage(e.getMessage());
|
cloudYu.setExceptionMessage(e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
cloudYu.setLatestUpdate(Instant.now());
|
cloudYu.setLatestUpdate(LocalDateTime.now());
|
||||||
yongYouU8Service.save(cloudYu);
|
yongYouU8Service.save(cloudYu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user