feat: 添加供应商管理相关功能及数据库表结构

新增供应商名录管理功能,包括合格供应商名录、供应商文件、供应商关联实体等模块。主要变更包括:

1. 添加COMPANY_VENDOR_ENTITY表的CREATOR_ID、MODIFIER_ID和MODIFY_DATE字段
2. 实现供应商同步任务类(VendorClassSyncTask等)
3. 新增供应商相关VO类(VendorApprovedVo、VendorFileVo等)
4. 添加供应商相关Repository接口(VendorRepository、VendorFileRepository等)
5. 实现供应商相关服务类(VendorApprovedService、VendorFileService等)
6. 添加供应商管理界面控制器及皮肤类
7. 新增供应商文件类型枚举和本地化配置
This commit is contained in:
2025-09-23 23:37:04 +08:00
parent 71d3ecab52
commit 9c3306eea3
69 changed files with 349 additions and 366 deletions

View File

@@ -1,19 +1,17 @@
package com.ecep.contract.controller.vendor;
import java.util.Map;
import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vm.IdentityViewModel;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
public abstract class AbstCompanyVendorTableTabSkin<T extends IdentityEntity, TV extends IdentityViewModel<T>>
extends AbstEntityTableTabSkin<CompanyVendorWindowController, CompanyVendorVo, CompanyVendorViewModel, T, TV>
extends AbstEntityTableTabSkin<CompanyVendorWindowController, VendorVo, CompanyVendorViewModel, T, TV>
implements TabSkin {
public AbstCompanyVendorTableTabSkin(CompanyVendorWindowController controller) {
super(controller);
@@ -23,12 +21,12 @@ public abstract class AbstCompanyVendorTableTabSkin<T extends IdentityEntity, TV
return controller.getCompanyService();
}
public CompanyVendorService getCompanyVendorService() {
return getCachedBean(CompanyVendorService.class);
public VendorService getCompanyVendorService() {
return getCachedBean(VendorService.class);
}
@Override
public ParamUtils.Builder getSpecification(CompanyVendorVo parent) {
public ParamUtils.Builder getSpecification(VendorVo parent) {
ParamUtils.Builder params = getSpecification();
params.equals("vendor", parent.getId());
return params;

View File

@@ -7,22 +7,22 @@ import com.ecep.contract.controller.table.cell.CompanyTableCell;
import com.ecep.contract.controller.table.cell.VendorCatalogTableCell;
import com.ecep.contract.controller.table.cell.VendorTypeTableCell;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.service.VendorCatalogService;
import com.ecep.contract.service.VendorTypeService;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
import javafx.application.Platform;
import lombok.Setter;
public class CompanyVendorManagerSkin
extends
AbstEntityManagerSkin<CompanyVendorVo, CompanyVendorViewModel, CompanyVendorManagerSkin, CompanyVendorManagerWindowController> {
AbstEntityManagerSkin<VendorVo, CompanyVendorViewModel, CompanyVendorManagerSkin, VendorManagerWindowController> {
@Setter
private CompanyService companyService;
public CompanyVendorManagerSkin(CompanyVendorManagerWindowController controller) {
public CompanyVendorManagerSkin(VendorManagerWindowController controller) {
super(controller);
}
@@ -33,7 +33,7 @@ public class CompanyVendorManagerSkin
return companyService;
}
public CompanyVendorService getCompanyVendorService() {
public VendorService getCompanyVendorService() {
return controller.getViewModelService();
}

View File

@@ -3,6 +3,7 @@ package com.ecep.contract.controller.vendor;
import java.time.LocalDate;
import java.util.concurrent.CompletableFuture;
import com.ecep.contract.service.VendorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
@@ -17,12 +18,11 @@ import com.ecep.contract.controller.AbstManagerWindowController;
import com.ecep.contract.controller.vendor.approved_list.CompanyVendorApprovedListManagerWindowController;
import com.ecep.contract.controller.vendor.group.VendorGroupManagerWindowController;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.task.VendorVerifyAllTasker;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.util.UITools;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.VendorTypeLocalVo;
import javafx.event.ActionEvent;
@@ -35,7 +35,7 @@ import javafx.stage.Stage;
@Component
@FxmlPath("/ui/company/vendor/vendor_manager.fxml")
public class CompanyVendorManagerWindowController
extends AbstManagerWindowController<CompanyVendorVo, CompanyVendorViewModel, CompanyVendorManagerSkin> {
extends AbstManagerWindowController<VendorVo, CompanyVendorViewModel, CompanyVendorManagerSkin> {
// columns
public TableColumn<CompanyVendorViewModel, Number> idColumn;
@@ -53,7 +53,7 @@ public class CompanyVendorManagerWindowController
@Autowired
private CompanyService companyService;
@Autowired
private CompanyVendorService companyVendorService;
private VendorService vendorService;
@Override
public void show(Stage stage) {
@@ -62,8 +62,8 @@ public class CompanyVendorManagerWindowController
}
@Override
public CompanyVendorService getViewModelService() {
return companyVendorService;
public VendorService getViewModelService() {
return vendorService;
}
public void onFileReBuildingAction(ActionEvent event) {
@@ -75,11 +75,11 @@ public class CompanyVendorManagerWindowController
};
while (true) {
Page<CompanyVendorVo> page = companyVendorService.findAll(null, pageRequest);
for (CompanyVendorVo companyVendor : page) {
Page<VendorVo> page = vendorService.findAll(null, pageRequest);
for (VendorVo companyVendor : page) {
MessageHolder sub = messageHolder
.sub(page.getNumber() + "/" + page.getTotalPages() + " #" + companyVendor.getId() + ">");
companyVendorService.reBuildingFiles(companyVendor, sub);
vendorService.reBuildingFiles(companyVendor, sub);
}
if (!page.hasNext()) {
break;

View File

@@ -1,7 +1,6 @@
package com.ecep.contract.controller.vendor;
import java.time.format.DateTimeFormatter;
import java.util.List;
import com.ecep.contract.MyDateTimeUtils;
import com.ecep.contract.SpringApp;
@@ -9,18 +8,16 @@ import com.ecep.contract.VendorType;
import com.ecep.contract.controller.ComboBoxUtils;
import com.ecep.contract.controller.company.CompanyWindowController;
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
import com.ecep.contract.model.VendorTypeLocal;
import com.ecep.contract.service.CompanyContactService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.service.VendorCatalogService;
import com.ecep.contract.service.VendorTypeService;
import com.ecep.contract.util.UITools;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vm.CompanyViewModel;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.CompanyVo;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
@@ -30,7 +27,7 @@ import javafx.util.converter.LocalDateStringConverter;
import javafx.util.converter.LocalDateTimeStringConverter;
public class CompanyVendorTabSkinBase
extends AbstEntityBasedTabSkin<CompanyVendorWindowController, CompanyVendorVo, CompanyVendorViewModel> {
extends AbstEntityBasedTabSkin<CompanyVendorWindowController, VendorVo, CompanyVendorViewModel> {
public CompanyVendorTabSkinBase(CompanyVendorWindowController controller) {
super(controller);
}
@@ -101,7 +98,7 @@ public class CompanyVendorTabSkinBase
}
public void onCreatePathAction(ActionEvent event) {
CompanyVendorVo companyVendor = getEntity();
VendorVo companyVendor = getEntity();
if (getCompanyVendorService().makePathAbsent(companyVendor)) {
save(companyVendor);
} else {
@@ -117,7 +114,7 @@ public class CompanyVendorTabSkinBase
setStatus("未实现");
}
public CompanyVendorService getCompanyVendorService() {
public VendorService getCompanyVendorService() {
return controller.getViewModelService();
}
}

View File

@@ -5,11 +5,11 @@ import java.time.LocalDate;
import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
import com.ecep.contract.controller.table.cell.VendorCatalogTableCell;
import com.ecep.contract.service.CompanyVendorEntityService;
import com.ecep.contract.service.VendorEntityService;
import com.ecep.contract.service.VendorCatalogService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.CompanyVendorEntityViewModel;
import com.ecep.contract.vo.CompanyVendorEntityVo;
import com.ecep.contract.vo.VendorEntityVo;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Tab;
@@ -17,7 +17,7 @@ import javafx.scene.control.TableColumn;
@FxmlPath("/ui/company/vendor/vendor-tab-entity.fxml")
public class CompanyVendorTabSkinEntity
extends AbstCompanyVendorTableTabSkin<CompanyVendorEntityVo, CompanyVendorEntityViewModel>
extends AbstCompanyVendorTableTabSkin<VendorEntityVo, CompanyVendorEntityViewModel>
implements TabSkin {
// 关联项 tab
@@ -39,12 +39,12 @@ public class CompanyVendorTabSkinEntity
super(controller);
}
CompanyVendorEntityService getVendorEntityService() {
return getCachedBean(CompanyVendorEntityService.class);
VendorEntityService getVendorEntityService() {
return getCachedBean(VendorEntityService.class);
}
@Override
protected CompanyVendorEntityService getViewModelService() {
protected VendorEntityService getViewModelService() {
return getVendorEntityService();
}

View File

@@ -14,7 +14,7 @@ import org.springframework.util.StringUtils;
import com.ecep.contract.DesktopUtils;
import com.ecep.contract.controller.AbstEntityController;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.CompanyVendorViewModel;
@@ -31,20 +31,20 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.stage.Window;
import javafx.stage.WindowEvent;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.CompanyVo;
@Lazy
@Scope("prototype")
@Component
@FxmlPath("/ui/company/vendor/vendor.fxml")
public class CompanyVendorWindowController extends AbstEntityController<CompanyVendorVo, CompanyVendorViewModel> {
public class CompanyVendorWindowController extends AbstEntityController<VendorVo, CompanyVendorViewModel> {
private static final Logger logger = LoggerFactory.getLogger(CompanyVendorWindowController.class);
/**
* 显示界面
*/
public static void show(CompanyVendorVo companyVendor, Window window) {
public static void show(VendorVo companyVendor, Window window) {
show(CompanyVendorWindowController.class, CompanyVendorViewModel.from(companyVendor), window);
}
@@ -91,8 +91,8 @@ public class CompanyVendorWindowController extends AbstEntityController<CompanyV
}
@Override
public CompanyVendorService getViewModelService() {
return getCachedBean(CompanyVendorService.class);
public VendorService getViewModelService() {
return getCachedBean(VendorService.class);
}
public CompanyService getCompanyService() {

View File

@@ -1,8 +1,8 @@
package com.ecep.contract.controller.vendor.approved_list;
import com.ecep.contract.controller.AbstEntityManagerSkin;
import com.ecep.contract.service.CompanyVendorApprovedListService;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.service.VendorApprovedService;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
import javafx.event.ActionEvent;
@@ -10,15 +10,15 @@ import javafx.scene.control.SelectionMode;
import lombok.Setter;
public class CompanyVendorApprovedListManagerSkin
extends AbstEntityManagerSkin<CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedListManagerSkin, CompanyVendorApprovedListManagerWindowController> {
extends AbstEntityManagerSkin<VendorApprovedVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedListManagerSkin, CompanyVendorApprovedListManagerWindowController> {
@Setter
private CompanyVendorApprovedListService service;
private VendorApprovedService service;
public CompanyVendorApprovedListManagerSkin(CompanyVendorApprovedListManagerWindowController controller) {
super(controller);
}
public CompanyVendorApprovedListService getService() {
public VendorApprovedService getService() {
return service;
}
@@ -40,7 +40,7 @@ public class CompanyVendorApprovedListManagerSkin
@Override
protected void onTableCreateNewAction(ActionEvent event) {
CompanyVendorApprovedListVo list = new CompanyVendorApprovedListVo();
VendorApprovedVo list = new VendorApprovedVo();
CompanyVendorApprovedListViewModel viewModel = CompanyVendorApprovedListViewModel.from(list);
dataSet.add(viewModel);

View File

@@ -8,9 +8,9 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.ecep.contract.controller.AbstManagerWindowController;
import com.ecep.contract.service.CompanyVendorApprovedListService;
import com.ecep.contract.service.VendorApprovedService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
import javafx.event.ActionEvent;
@@ -25,7 +25,7 @@ import javafx.stage.WindowEvent;
@Component
@FxmlPath("/ui/company/vendor/vendor_approved_list_manager.fxml")
public class CompanyVendorApprovedListManagerWindowController
extends AbstManagerWindowController<CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedListManagerSkin> {
extends AbstManagerWindowController<VendorApprovedVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedListManagerSkin> {
public TableColumn<CompanyVendorApprovedListViewModel, Number> idColumn;
public TableColumn<CompanyVendorApprovedListViewModel, String> titleColumn;
@@ -33,7 +33,7 @@ public class CompanyVendorApprovedListManagerWindowController
public TableColumn<CompanyVendorApprovedListViewModel, String> descriptionColumn;
@Autowired
private CompanyVendorApprovedListService service;
private VendorApprovedService service;
@Override
protected CompanyVendorApprovedListManagerSkin createDefaultSkin() {
@@ -49,7 +49,7 @@ public class CompanyVendorApprovedListManagerWindowController
}
@Override
public CompanyVendorApprovedListService getViewModelService() {
public VendorApprovedService getViewModelService() {
return service;
}

View File

@@ -4,7 +4,7 @@ import java.time.format.DateTimeFormatter;
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
import javafx.scene.control.Tab;
@@ -12,7 +12,7 @@ import javafx.util.converter.LocalDateStringConverter;
public class CompanyVendorApprovedListTabSkinBase
extends
AbstEntityBasedTabSkin<CompanyVendorApprovedListWindowController, CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel>
AbstEntityBasedTabSkin<CompanyVendorApprovedListWindowController, VendorApprovedVo, CompanyVendorApprovedListViewModel>
implements TabSkin {
public CompanyVendorApprovedListTabSkinBase(CompanyVendorApprovedListWindowController controller) {
super(controller);

View File

@@ -2,7 +2,6 @@ package com.ecep.contract.controller.vendor.approved_list;
import java.io.File;
import java.time.LocalDate;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.springframework.util.StringUtils;
@@ -10,13 +9,12 @@ import org.springframework.util.StringUtils;
import com.ecep.contract.DesktopUtils;
import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
import com.ecep.contract.model.CompanyVendorApprovedFile;
import com.ecep.contract.service.CompanyVendorApprovedFileService;
import com.ecep.contract.service.VendorApprovedFileService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.util.ParamUtils.Builder;
import com.ecep.contract.vo.CompanyVendorApprovedFileVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedFileVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vm.CompanyVendorApprovedFileViewModel;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
@@ -28,10 +26,10 @@ import javafx.scene.control.TableColumn;
@FxmlPath("/ui/company/vendor/vendor_approved_list-tab-file.fxml")
public class CompanyVendorApprovedListTabSkinFiles
extends
AbstEntityTableTabSkin<CompanyVendorApprovedListWindowController, CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedFileVo, CompanyVendorApprovedFileViewModel>
AbstEntityTableTabSkin<CompanyVendorApprovedListWindowController, VendorApprovedVo, CompanyVendorApprovedListViewModel, VendorApprovedFileVo, CompanyVendorApprovedFileViewModel>
implements TabSkin {
private CompanyVendorApprovedFileService fileService;
private VendorApprovedFileService fileService;
public TableColumn<CompanyVendorApprovedFileViewModel, Number> fileTable_idColumn;
public TableColumn<CompanyVendorApprovedFileViewModel, String> fileTable_filePathColumn;
@@ -42,20 +40,20 @@ public class CompanyVendorApprovedListTabSkinFiles
super(controller);
}
CompanyVendorApprovedFileService getFileService() {
VendorApprovedFileService getFileService() {
if (fileService == null) {
fileService = getBean(CompanyVendorApprovedFileService.class);
fileService = getBean(VendorApprovedFileService.class);
}
return fileService;
}
@Override
protected CompanyVendorApprovedFileService getViewModelService() {
protected VendorApprovedFileService getViewModelService() {
return getFileService();
}
@Override
public Builder getSpecification(CompanyVendorApprovedListVo parent) {
public Builder getSpecification(VendorApprovedVo parent) {
return ParamUtils.builder().equals("list", parent.getId());
}
@@ -77,7 +75,7 @@ public class CompanyVendorApprovedListTabSkinFiles
public void onFileReBuildingAction(ActionEvent event) {
CompletableFuture.runAsync(() -> {
int id = viewModel.getId().get();
CompanyVendorApprovedListVo list = new CompanyVendorApprovedListVo();
VendorApprovedVo list = new VendorApprovedVo();
viewModel.copyTo(list);
try {
// 在实际应用中这里需要调整为通过service调用处理VO对象

View File

@@ -38,12 +38,12 @@ import lombok.Setter;
@FxmlPath("/ui/company/vendor/vendor_approved_list-tab-vendor.fxml")
public class CompanyVendorApprovedListTabSkinVendors
extends
AbstEntityTableTabSkin<CompanyVendorApprovedListWindowController, CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel, CompanyVendorApprovedItemVo, CompanyVendorApprovedItemViewModel>
AbstEntityTableTabSkin<CompanyVendorApprovedListWindowController, VendorApprovedVo, CompanyVendorApprovedListViewModel, VendorApprovedItemVo, CompanyVendorApprovedItemViewModel>
implements TabSkin {
@Setter
private CompanyVendorApprovedItemService itemService;
private VendorApprovedItemService itemService;
private CompanyService companyService;
private CompanyVendorService companyVendorService;
private VendorService vendorService;
private CompanyOldNameService companyOldNameService;
public ComboBox<VendorTypeLocalVo> typeSelector;
@@ -78,26 +78,26 @@ public class CompanyVendorApprovedListTabSkinVendors
return companyOldNameService;
}
public CompanyVendorService getCompanyVendorService() {
if (companyVendorService == null) {
companyVendorService = getBean(CompanyVendorService.class);
public VendorService getVendorService() {
if (vendorService == null) {
vendorService = getBean(VendorService.class);
}
return companyVendorService;
return vendorService;
}
public SysConfService getConfService() {
return controller.getConfService();
}
CompanyVendorApprovedItemService getItemService() {
VendorApprovedItemService getItemService() {
if (itemService == null) {
itemService = getBean(CompanyVendorApprovedItemService.class);
itemService = getBean(VendorApprovedItemService.class);
}
return itemService;
}
@Override
protected CompanyVendorApprovedItemService getViewModelService() {
protected VendorApprovedItemService getViewModelService() {
return getItemService();
}
@@ -112,7 +112,7 @@ public class CompanyVendorApprovedListTabSkinVendors
}
@Override
public ParamUtils.Builder getSpecification(CompanyVendorApprovedListVo parent) {
public ParamUtils.Builder getSpecification(VendorApprovedVo parent) {
Builder params = getSpecification();
params.equals("list", parent.getId());
return params;
@@ -131,7 +131,7 @@ public class CompanyVendorApprovedListTabSkinVendors
idColumn.setCellValueFactory(param -> param.getValue().getId());
// 厂商, vendor
vendorColumn.setCellValueFactory(param -> param.getValue().getVendor());
vendorColumn.setCellFactory(CompanyVendorTableCell.forTableColumn(getCompanyVendorService()));
vendorColumn.setCellFactory(CompanyVendorTableCell.forTableColumn(getVendorService()));
// 类型, type
typeColumn.setCellValueFactory(param -> param.getValue().getType());
typeColumn.setCellFactory(VendorTypeTableCell.forTableColumn(getCachedBean(VendorTypeService.class)));
@@ -187,10 +187,10 @@ public class CompanyVendorApprovedListTabSkinVendors
selectedItem.getType().set(value.getType());
int id = selectedItem.getId().get();
CompanyVendorApprovedItemService itemService = getItemService();
CompanyVendorApprovedItemVo item = itemService.findById(id);
VendorApprovedItemService itemService = getItemService();
VendorApprovedItemVo item = itemService.findById(id);
if (selectedItem.copyTo(item)) {
CompanyVendorApprovedItemVo saved = itemService.save(item);
VendorApprovedItemVo saved = itemService.save(item);
selectedItem.update(saved);
}
}
@@ -202,7 +202,7 @@ public class CompanyVendorApprovedListTabSkinVendors
}
public void onVendorTableImportAction(ActionEvent event) {
CompanyVendorApprovedListVo approvedList = getParent();
VendorApprovedVo approvedList = getParent();
CompanyVendorApprovedListVendorImportTask task = new CompanyVendorApprovedListVendorImportTask(approvedList);
task.setLogUnqualifiedVendor(logUnqualifiedVendorChecker.isSelected());
@@ -220,7 +220,7 @@ public class CompanyVendorApprovedListTabSkinVendors
}
public void onVendorTableUpdateAction(ActionEvent event) {
CompanyVendorService vendorService = getCompanyVendorService();
VendorService vendorService = getVendorService();
CompanyService companyService = getCompanyService();
CompanyOldNameService companyOldNameService = getCompanyOldNameService();
@@ -231,7 +231,7 @@ public class CompanyVendorApprovedListTabSkinVendors
CompanyVendorApprovedItemViewModel first = list.removeFirst();
Integer vendorId = first.getVendor().get();
;
CompanyVendorVo companyVendor = vendorService.findById(vendorId);
VendorVo companyVendor = vendorService.findById(vendorId);
CompanyVo company = companyService.findById(companyVendor.getCompanyId());
CompanyOldNameVo oldName = companyOldNameService.findMatchByDate(company,
viewModel.getPublishDate().get());
@@ -243,7 +243,7 @@ public class CompanyVendorApprovedListTabSkinVendors
public void onVendorTableShowVendorAction(ActionEvent event) {
CompanyVendorApprovedItemViewModel selectedItem = getTableView().getSelectionModel().getSelectedItem();
CompanyVendorVo companyVendor = getCompanyVendorService().findById(selectedItem.getVendor().get());
VendorVo companyVendor = getVendorService().findById(selectedItem.getVendor().get());
CompanyVendorWindowController.show(companyVendor, null);
}

View File

@@ -19,6 +19,7 @@ import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import com.ecep.contract.service.*;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
@@ -41,21 +42,16 @@ import org.springframework.util.StringUtils;
import com.ecep.contract.MessageHolder;
import com.ecep.contract.MyDateTimeUtils;
import com.ecep.contract.VendorType;
import com.ecep.contract.service.CompanyContactService;
import com.ecep.contract.service.CompanyVendorApprovedFileService;
import com.ecep.contract.service.CompanyVendorApprovedItemService;
import com.ecep.contract.service.CompanyVendorApprovedListService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.ContractService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.task.Tasker;
import com.ecep.contract.util.ExcelUtils;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.util.ProxyUtils;
import com.ecep.contract.vo.CompanyContactVo;
import com.ecep.contract.vo.CompanyVendorApprovedFileVo;
import com.ecep.contract.vo.CompanyVendorApprovedItemVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorApprovedFileVo;
import com.ecep.contract.vo.VendorApprovedItemVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.CompanyVo;
import com.ecep.contract.vo.ContractVo;
@@ -69,34 +65,34 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
public static final String STR_CHANGE_VENDOR_TYPE_SHEET = "变更供应商类型";
@Setter
private CompanyVendorApprovedListVo approvedList;
private VendorApprovedVo approvedList;
private CompanyVendorApprovedListService service;
private CompanyVendorApprovedFileService fileService;
private CompanyVendorApprovedItemService itemService;
private VendorApprovedService service;
private VendorApprovedFileService fileService;
private VendorApprovedItemService itemService;
private ContractService contractService;
private CompanyVendorService companyVendorService;
private VendorService vendorService;
private CompanyContactService companyContactService;
private static final String FILE_NAME = "供方名录-%s.xlsx";
private CompanyVendorApprovedListService getService() {
private VendorApprovedService getService() {
if (service == null) {
service = getBean(CompanyVendorApprovedListService.class);
service = getBean(VendorApprovedService.class);
}
return service;
}
private CompanyVendorApprovedFileService getFileService() {
private VendorApprovedFileService getFileService() {
if (fileService == null) {
fileService = getBean(CompanyVendorApprovedFileService.class);
fileService = getBean(VendorApprovedFileService.class);
}
return fileService;
}
private CompanyVendorApprovedItemService getItemService() {
private VendorApprovedItemService getItemService() {
if (itemService == null) {
itemService = getBean(CompanyVendorApprovedItemService.class);
itemService = getBean(VendorApprovedItemService.class);
}
return itemService;
}
@@ -115,15 +111,15 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
return companyContactService;
}
private CompanyVendorService getCompanyVendorService() {
if (companyVendorService == null) {
companyVendorService = getBean(CompanyVendorService.class);
private VendorService getVendorService() {
if (vendorService == null) {
vendorService = getBean(VendorService.class);
}
return companyVendorService;
return vendorService;
}
private File getVendorApprovedListTemplate() {
return getCompanyVendorService().getVendorApprovedListTemplate();
return getVendorService().getVendorApprovedListTemplate();
}
@Override
@@ -192,10 +188,10 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
}
}
CompanyVendorApprovedFileVo approvedFile = getFileService()
VendorApprovedFileVo approvedFile = getFileService()
.findByName(approvedList, destFile.getName());
if (approvedFile == null) {
approvedFile = new CompanyVendorApprovedFileVo();
approvedFile = new VendorApprovedFileVo();
}
approvedFile.setListId(approvedList.getId());
approvedFile.setFileName(destFile.getName());
@@ -341,7 +337,7 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
private void updateTypicallySheet(Workbook wb, Sheet sheet, MessageHolder holder) {
updateTitle("更新一般供方 Sheet");
List<CompanyVendorApprovedItemVo> items = getItemService()
List<VendorApprovedItemVo> items = getItemService()
.findAll(ParamUtils.builder().equals("type", VendorType.TYPICALLY)
.equals("list", approvedList.getId()).build(), Pageable.unpaged(Sort.by("vendor")))
.getContent();
@@ -356,13 +352,13 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
borderStyle.setBorderLeft(BorderStyle.THIN); // 左边框
borderStyle.setBorderRight(BorderStyle.THIN); // 右边框
List<CompanyVendorApprovedItemVo> meetQualified = new ArrayList<>();
List<VendorApprovedItemVo> meetQualified = new ArrayList<>();
for (int i = 0; i < items.size(); i++) {
CompanyVendorApprovedItemVo item = items.get(i);
VendorApprovedItemVo item = items.get(i);
updateProgress(i, items.size());
CompanyVendorVo vendor = getCompanyVendorService().findById(item.getVendorId());
VendorVo vendor = getVendorService().findById(item.getVendorId());
CompanyVo company = getCompanyService().findById(vendor.getCompanyId());
setCellValue(sheet, "A" + (prefixRow + i), "" + vendor.getId()).setCellStyle(borderStyle);
@@ -420,14 +416,14 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
changeSheet.setColumnWidth(6, 13 * 256);
holder.debug("创建 " + STR_CHANGE_VENDOR_TYPE_SHEET + " Sheet");
for (CompanyVendorApprovedItemVo item : meetQualified) {
for (VendorApprovedItemVo item : meetQualified) {
outputMeetQualified(changeSheet, item, holder);
}
}
}
private void outputMeetQualified(Sheet sheet, CompanyVendorApprovedItemVo item, MessageHolder holder) {
CompanyVendorVo vendor = getCompanyVendorService().findById(item.getVendorId());
private void outputMeetQualified(Sheet sheet, VendorApprovedItemVo item, MessageHolder holder) {
VendorVo vendor = getVendorService().findById(item.getVendorId());
CompanyVo company = getCompanyService().findById(vendor.getCompanyId());
String vendorName = item.getVendorName();
if (!StringUtils.hasText(vendorName)) {
@@ -438,8 +434,8 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
holder.info("详情输出到 " + sheet.getSheetName() + " Sheet 中,请查看");
}
private void outputMeetQualified(Sheet sheet, CompanyVendorVo vendor, String vendorName,
CompanyVendorApprovedItemVo item) {
private void outputMeetQualified(Sheet sheet, VendorVo vendor, String vendorName,
VendorApprovedItemVo item) {
AtomicInteger row = meetRow;
setCellValue(sheet, row.get(), 1, "供方:" + vendorName).setCellStyle(venodrNameCellStyle);
sheet.getRow(row.get()).setHeight((short) (30 * 20));
@@ -512,7 +508,7 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
private void updateQualifiedSheet(Sheet sheet, MessageHolder holder) {
updateTitle("更新合格供方 Sheet");
List<CompanyVendorApprovedItemVo> items = getItemService().findAll(
List<VendorApprovedItemVo> items = getItemService().findAll(
ParamUtils.builder().equals("type", VendorType.QUALIFIED).equals("list", approvedList.getId()).build(),
Pageable.unpaged(Sort.by("vendor.name"))).getContent();
holder.debug("载入合共供方:" + items.size() + "");
@@ -583,10 +579,10 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
}
for (int i = 0; i < items.size(); i++) {
CompanyVendorApprovedItemVo item = items.get(i);
VendorApprovedItemVo item = items.get(i);
updateProgress(i, items.size());
CompanyVendorVo vendor = getCompanyVendorService().findById(item.getVendorId());
VendorVo vendor = getVendorService().findById(item.getVendorId());
CompanyVo company = getCompanyService().findById(vendor.getCompanyId());
setCellValue(sheet, "A" + (prefixRow), "" + vendor.getId()).setCellStyle(beginCellStyles[0]);
@@ -641,7 +637,7 @@ public class CompanyVendorApprovedListVendorExportTask extends Tasker<Object> {
}
private void save(CompanyVendorApprovedFileVo approvedFile) {
private void save(VendorApprovedFileVo approvedFile) {
getFileService().save(approvedFile);
}
}

View File

@@ -10,6 +10,7 @@ import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ecep.contract.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
@@ -20,19 +21,14 @@ import com.ecep.contract.MessageHolder;
import com.ecep.contract.VendorFileType;
import com.ecep.contract.VendorType;
import com.ecep.contract.model.Vendor;
import com.ecep.contract.service.CompanyOldNameService;
import com.ecep.contract.service.CompanyVendorApprovedItemService;
import com.ecep.contract.service.CompanyVendorApprovedListService;
import com.ecep.contract.service.CompanyVendorFileService;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.service.ContractService;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.task.Tasker;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vo.CompanyOldNameVo;
import com.ecep.contract.vo.CompanyVendorApprovedItemVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.CompanyVendorFileVo;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorApprovedItemVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vo.VendorFileVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.CompanyVo;
import com.ecep.contract.vo.ContractVo;
@@ -48,33 +44,33 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
public static final String STR_MEET_TYPICALLY = "符合一般供方标准";
public static final String STR_MEET_UNQUALIFIED = "符合不合格供方标准";
private final CompanyVendorApprovedListVo approvedList;
private final VendorApprovedVo approvedList;
private CompanyVendorApprovedListService service;
private CompanyVendorApprovedItemService itemService;
private CompanyVendorFileService companyVendorFileService;
private VendorApprovedService service;
private VendorApprovedItemService itemService;
private VendorFileService vendorFileService;
private CompanyOldNameService companyOldNameService;
private ContractService contractService;
private final AtomicInteger counter = new AtomicInteger(0);
public CompanyVendorApprovedListVendorImportTask(CompanyVendorApprovedListVo approvedList) {
public CompanyVendorApprovedListVendorImportTask(VendorApprovedVo approvedList) {
this.approvedList = approvedList;
updateTitle("供方名录-供方导入");
}
private CompanyVendorApprovedItemService getItemService() {
private VendorApprovedItemService getItemService() {
if (itemService == null) {
itemService = getBean(CompanyVendorApprovedItemService.class);
itemService = getBean(VendorApprovedItemService.class);
}
return itemService;
}
private CompanyVendorFileService getCompanyVendorFileService() {
if (companyVendorFileService == null) {
companyVendorFileService = getBean(CompanyVendorFileService.class);
private VendorFileService getVendorFileService() {
if (vendorFileService == null) {
vendorFileService = getBean(VendorFileService.class);
}
return companyVendorFileService;
return vendorFileService;
}
private CompanyOldNameService getCompanyOldNameService() {
@@ -99,16 +95,16 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
return null;
}
service = getBean(CompanyVendorApprovedListService.class);
CompanyVendorService vendorService = getBean(CompanyVendorService.class);
Page<CompanyVendorVo> page = vendorService.findAll(
service = getBean(VendorApprovedService.class);
VendorService vendorService = getBean(VendorService.class);
Page<VendorVo> page = vendorService.findAll(
ParamUtils.builder()
.isNotNull("created")
.lessThan("developDate", endDate)
.build(),
Pageable.unpaged());
holder.debug("读取到" + page.getTotalElements());
try (Stream<CompanyVendorVo> stream = page.stream()) {
try (Stream<VendorVo> stream = page.stream()) {
stream.forEach(v -> {
if (isCancelled()) {
holder.debug("Cancelled");
@@ -137,7 +133,7 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
@Setter
private boolean logTypicallyVendorNoThreeYearContract = true;
private void sync(CompanyVendorVo vendor, MessageHolder holder) {
private void sync(VendorVo vendor, MessageHolder holder) {
// 明确 company 实例
CompanyVo company = initializedVendorCompany(vendor);
if (company == null) {
@@ -162,10 +158,10 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
}
// 确认供方是否在供方名录中,可能有多个所以返回 list默认取第一个
List<CompanyVendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
List<VendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
if (items == null || items.isEmpty()) {
// 供方不在供方名录中时新建一个
CompanyVendorApprovedItemVo item = new CompanyVendorApprovedItemVo();
VendorApprovedItemVo item = new VendorApprovedItemVo();
item.setListId(approvedList.getId());
item.setVendorId(vendor.getId());
@@ -260,7 +256,7 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
}
if (items.size() == 1) {
CompanyVendorApprovedItemVo first = items.getFirst();
VendorApprovedItemVo first = items.getFirst();
if (!StringUtils.hasText(first.getVendorName())) {
updateVendorNameWithOldName(vendor, first);
}
@@ -269,13 +265,13 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
}
for (int i = 1; i < items.size(); i++) {
CompanyVendorApprovedItemVo item = items.get(i);
VendorApprovedItemVo item = items.get(i);
getItemService().delete(item);
subHolder.debug("删除重复的供方名录项:#" + item.getId());
}
}
private void updateVendorNameWithOldName(CompanyVendorVo vendor, CompanyVendorApprovedItemVo item) {
private void updateVendorNameWithOldName(VendorVo vendor, VendorApprovedItemVo item) {
CompanyVo company = initializedVendorCompany(vendor);
if (company == null) {
return;
@@ -294,10 +290,10 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
private boolean logUnqualifiedVendorRemove = true;
private void updateItem(
CompanyVendorVo vendor, CompanyVendorApprovedItemVo item, MessageHolder holder) {
VendorVo vendor, VendorApprovedItemVo item, MessageHolder holder) {
VendorType t1 = item.getType();
VendorType vendorType = vendor.getType();
CompanyVendorApprovedItemService itemService = getItemService();
VendorApprovedItemService itemService = getItemService();
if (t1 != vendorType) {
holder.warn("注意分类不一致, " + t1 + ", " + vendorType + ".");
}
@@ -415,13 +411,13 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
* @see #findAllEvaluationFormFiles(Vendor, LocalDate)
*/
private boolean checkAsQualifiedVendorByEvaluationFormFiles(
CompanyVendorVo vendor, CompanyVendorApprovedItemVo item, MessageHolder holder) {
List<CompanyVendorFileVo> files = findAllEvaluationFormFiles(vendor, approvedList.getPublishDate());
VendorVo vendor, VendorApprovedItemVo item, MessageHolder holder) {
List<VendorFileVo> files = findAllEvaluationFormFiles(vendor, approvedList.getPublishDate());
if (files.isEmpty()) {
return false;
}
CompanyVendorFileVo first = files.getFirst();
VendorFileVo first = files.getFirst();
item.setType(VendorType.TYPICALLY);
File file = new File(first.getFilePath());
holder.info("供方是不合格供方, 但在发布期一年内有有效评价表 " + file.getName() + ", 调整为一般供应商");
@@ -485,7 +481,7 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
}
private boolean checkAsTypicallyVendorByContracts(
CompanyVendorVo vendor, CompanyVendorApprovedItemVo item, Consumer<String> consumer) {
VendorVo vendor, VendorApprovedItemVo item, Consumer<String> consumer) {
// 查看供方的合同看近3年期间是否有合同
List<ContractVo> contracts = findAllVendorContracts(vendor, approvedList.getPublishDate());
if (contracts.isEmpty()) {
@@ -539,7 +535,7 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
* @param date 日期
* @return 3年内的合同列表
*/
private List<ContractVo> findAllVendorContracts(CompanyVendorVo vendor, LocalDate date) {
private List<ContractVo> findAllVendorContracts(VendorVo vendor, LocalDate date) {
ContractService contractService = getContractService();
int beginYear = date.getYear() - (vendorContractMinusYear - 1);
@@ -548,7 +544,7 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
return contractService.findAllByCompanyVendor(vendor, miniDate, date);
}
private CompanyVo initializedVendorCompany(CompanyVendorVo vendor) {
private CompanyVo initializedVendorCompany(VendorVo vendor) {
CompanyVo company = getCompanyService().findById(vendor.getCompanyId());
return company;
}
@@ -563,8 +559,8 @@ public class CompanyVendorApprovedListVendorImportTask extends Tasker<Object> {
* @param publishDate
* @return
*/
private List<CompanyVendorFileVo> findAllEvaluationFormFiles(CompanyVendorVo vendor, LocalDate publishDate) {
CompanyVendorFileService fileService = getCompanyVendorFileService();
private List<VendorFileVo> findAllEvaluationFormFiles(VendorVo vendor, LocalDate publishDate) {
VendorFileService fileService = getVendorFileService();
LocalDate miniDate = publishDate.minusYears(vendorFileMinusYear);
return fileService.findAll(ParamUtils.builder()
.equals("vendor", vendor.getId())

View File

@@ -12,11 +12,11 @@ import org.springframework.util.StringUtils;
import com.ecep.contract.DesktopUtils;
import com.ecep.contract.controller.AbstEntityController;
import com.ecep.contract.service.CompanyVendorApprovedListService;
import com.ecep.contract.service.VendorApprovedService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.util.UITools;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedVo;
import javafx.event.ActionEvent;
import javafx.scene.control.Button;
@@ -35,16 +35,16 @@ import javafx.stage.WindowEvent;
@Component
@FxmlPath("/ui/company/vendor/vendor_approved_list.fxml")
public class CompanyVendorApprovedListWindowController
extends AbstEntityController<CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel> {
extends AbstEntityController<VendorApprovedVo, CompanyVendorApprovedListViewModel> {
private static final Logger logger = LoggerFactory.getLogger(CompanyVendorApprovedListWindowController.class);
public static void show(CompanyVendorApprovedListVo list, Window window) {
public static void show(VendorApprovedVo list, Window window) {
CompanyVendorApprovedListViewModel model = CompanyVendorApprovedListViewModel.from(list);
show(CompanyVendorApprovedListWindowController.class, model, window);
}
@Autowired
private CompanyVendorApprovedListService service;
private VendorApprovedService service;
public BorderPane root;
public TabPane tabPane;
@@ -79,7 +79,7 @@ public class CompanyVendorApprovedListWindowController
}
@Override
public CompanyVendorApprovedListService getViewModelService() {
public VendorApprovedService getViewModelService() {
return service;
}
@@ -105,10 +105,10 @@ public class CompanyVendorApprovedListWindowController
public void onApprovedListCreatePathAction(ActionEvent event) {
int id = viewModel.getId().get();
CompanyVendorApprovedListVo list = service.findById(id);
VendorApprovedVo list = service.findById(id);
if (service.makePathAbsent(list)) {
CompanyVendorApprovedListVo saved = service.save(list);
VendorApprovedVo saved = service.save(list);
viewModel.update(saved);
} else {
setStatus("目录存在或创建失败");

View File

@@ -4,17 +4,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import com.ecep.contract.service.CompanyVendorService;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.service.VendorService;
import com.ecep.contract.vo.VendorVo;
import jakarta.annotation.PostConstruct;
@Lazy
@Component
public class CompanyVendorStringConverter extends EntityStringConverter<CompanyVendorVo> {
public class CompanyVendorStringConverter extends EntityStringConverter<VendorVo> {
@Lazy
@Autowired
private CompanyVendorService service;
private VendorService service;
public CompanyVendorStringConverter() {

View File

@@ -4,19 +4,19 @@ import org.springframework.stereotype.Service;
import com.ecep.contract.MessageHolder;
import com.ecep.contract.vm.CompanyVendorApprovedFileViewModel;
import com.ecep.contract.vo.CompanyVendorApprovedFileVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedFileVo;
import com.ecep.contract.vo.VendorApprovedVo;
@Service
public class CompanyVendorApprovedFileService
extends QueryService<CompanyVendorApprovedFileVo, CompanyVendorApprovedFileViewModel> {
extends QueryService<VendorApprovedFileVo, CompanyVendorApprovedFileViewModel> {
public CompanyVendorApprovedFileVo findByName(CompanyVendorApprovedListVo approvedList, String name) {
public VendorApprovedFileVo findByName(VendorApprovedVo approvedList, String name) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
}
public boolean reBuildingFiles(CompanyVendorApprovedListVo list, MessageHolder holder) {
public boolean reBuildingFiles(VendorApprovedVo list, MessageHolder holder) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
}

View File

@@ -7,16 +7,16 @@ import org.springframework.stereotype.Service;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorApprovedItemViewModel;
import com.ecep.contract.vo.CompanyVendorApprovedItemVo;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorApprovedItemVo;
import com.ecep.contract.vo.VendorApprovedVo;
import com.ecep.contract.vo.VendorVo;
@Service
public class CompanyVendorApprovedItemService
extends QueryService<CompanyVendorApprovedItemVo, CompanyVendorApprovedItemViewModel> {
extends QueryService<VendorApprovedItemVo, CompanyVendorApprovedItemViewModel> {
public List<CompanyVendorApprovedItemVo> findAllByListAndVendor(CompanyVendorApprovedListVo approvedList,
CompanyVendorVo vendor) {
public List<VendorApprovedItemVo> findAllByListAndVendor(VendorApprovedVo approvedList,
VendorVo vendor) {
return findAll(ParamUtils.builder()
.equals("list", approvedList.getId())
.equals("vendor", vendor.getId())

View File

@@ -3,25 +3,24 @@ package com.ecep.contract.service;
import org.springframework.stereotype.Service;
import com.ecep.contract.MessageHolder;
import com.ecep.contract.model.CompanyVendorApprovedList;
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
import com.ecep.contract.vo.CompanyVendorApprovedListVo;
import com.ecep.contract.vo.VendorApprovedVo;
@Service
public class CompanyVendorApprovedListService
extends QueryService<CompanyVendorApprovedListVo, CompanyVendorApprovedListViewModel> {
extends QueryService<VendorApprovedVo, CompanyVendorApprovedListViewModel> {
public boolean makePathAbsent(CompanyVendorApprovedListVo list) {
public boolean makePathAbsent(VendorApprovedVo list) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'makePathAbsent'");
}
public boolean reBuildingFiles(CompanyVendorApprovedListVo list, MessageHolder holder) {
public boolean reBuildingFiles(VendorApprovedVo list, MessageHolder holder) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
}
public boolean existPath(CompanyVendorApprovedListVo entity) {
public boolean existPath(VendorApprovedVo entity) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'existPath'");
}

View File

@@ -6,18 +6,17 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vo.CompanyVendorEntityVo;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorEntityVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vm.CompanyVendorEntityViewModel;
import com.ecep.contract.model.CompanyVendorEntity;
@Service
public class CompanyVendorEntityService extends QueryService<CompanyVendorEntityVo, CompanyVendorEntityViewModel> {
public class CompanyVendorEntityService extends QueryService<VendorEntityVo, CompanyVendorEntityViewModel> {
/**
* 根据供应商ID查询关联实体列表
*/
public List<CompanyVendorEntityVo> findByVendorId(Integer vendorId) {
public List<VendorEntityVo> findByVendorId(Integer vendorId) {
return findAll(ParamUtils.builder().equals("vendorId", vendorId).build(), Pageable.unpaged())
.getContent();
}
@@ -25,15 +24,15 @@ public class CompanyVendorEntityService extends QueryService<CompanyVendorEntity
/**
* 根据CompanyVendor对象查询关联的CompanyVendorEntity列表
*/
public List<CompanyVendorEntityVo> findByVendor(CompanyVendorVo vendor) {
public List<VendorEntityVo> findByVendor(VendorVo vendor) {
return findByVendorId(vendor.getId());
}
/**
* 根据供应商ID创建新的CompanyVendorEntity实例
*/
public CompanyVendorEntityVo newInstanceByVendor(CompanyVendorVo vendor) {
CompanyVendorEntityVo entity = createNewEntity();
public VendorEntityVo newInstanceByVendor(VendorVo vendor) {
VendorEntityVo entity = createNewEntity();
// 设置供应商ID
try {
// 通过反射设置vendor属性因为实体类中可能没有直接的setVendorId方法

View File

@@ -17,13 +17,13 @@ import com.ecep.contract.model.Vendor;
import com.ecep.contract.model.VendorFileTypeLocal;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorFileViewModel;
import com.ecep.contract.vo.CompanyVendorFileVo;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorFileVo;
import com.ecep.contract.vo.VendorVo;
@Service
public class CompanyVendorFileService extends QueryService<CompanyVendorFileVo, CompanyVendorFileViewModel> {
public class CompanyVendorFileService extends QueryService<VendorFileVo, CompanyVendorFileViewModel> {
public LocalDate getNextSignDate(CompanyVendorVo companyVendor, Consumer<String> state) {
public LocalDate getNextSignDate(VendorVo companyVendor, Consumer<String> state) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'getNextSignDate'");
}
@@ -37,9 +37,9 @@ public class CompanyVendorFileService extends QueryService<CompanyVendorFileVo,
throw new UnsupportedOperationException("Unimplemented method 'getFileTypeLocalMap'");
}
public void verify(CompanyVendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
public void verify(VendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
// 查询所有评价表
List<CompanyVendorFileVo> files = findAllByVendorAndType(companyVendor, VendorFileType.EvaluationForm);
List<VendorFileVo> files = findAllByVendorAndType(companyVendor, VendorFileType.EvaluationForm);
if (files == null || files.isEmpty()) {
holder.error("未见供应商评价");
return;
@@ -47,15 +47,15 @@ public class CompanyVendorFileService extends QueryService<CompanyVendorFileVo,
// 检索 验证日期最近一年内的有效评价表日期宽限7天
LocalDate begin = verifyDate.plusYears(-1);
CompanyVendorFileVo vendorFile = files.stream()
VendorFileVo vendorFile = files.stream()
.filter(v -> v.getSignDate() != null && v.isValid())
.filter(v -> MyDateTimeUtils.dateValidFilter(v.getSignDate(), begin, verifyDate, 7))
.findFirst().orElse(null);
if (vendorFile == null) {
// 检索最后一个有效评价表
CompanyVendorFileVo latestFile = files.stream()
VendorFileVo latestFile = files.stream()
.filter(v -> v.getSignDate() != null && v.isValid())
.max(Comparator.comparing(CompanyVendorFileVo::getSignDate))
.max(Comparator.comparing(VendorFileVo::getSignDate))
.orElse(null);
if (latestFile == null) {
@@ -67,7 +67,7 @@ public class CompanyVendorFileService extends QueryService<CompanyVendorFileVo,
}
}
public List<CompanyVendorFileVo> findAllByVendorAndType(CompanyVendorVo vendor, VendorFileType type) {
public List<VendorFileVo> findAllByVendorAndType(VendorVo vendor, VendorFileType type) {
return findAll(ParamUtils.builder()
.equals("vendor", vendor.getId())
.equals("type", type.name())

View File

@@ -20,12 +20,12 @@ import com.ecep.contract.util.FileUtils;
import com.ecep.contract.util.MyStringUtils;
import com.ecep.contract.util.ParamUtils;
import com.ecep.contract.vm.CompanyVendorViewModel;
import com.ecep.contract.vo.CompanyVendorVo;
import com.ecep.contract.vo.VendorVo;
import com.ecep.contract.vo.CompanyVo;
import com.ecep.contract.vo.ContractVo;
@Service
public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyVendorViewModel> {
public class CompanyVendorService extends QueryService<VendorVo, CompanyVendorViewModel> {
@Autowired
private CompanyService companyService;
@Autowired
@@ -52,15 +52,15 @@ public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyV
throw new UnsupportedOperationException("Unimplemented method 'findCatalogById'");
}
public CompanyVendorVo findByCompany(CompanyVo company) {
Page<CompanyVendorVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
public VendorVo findByCompany(CompanyVo company) {
Page<VendorVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
if (page.isEmpty()) {
return null;
}
return page.getContent().getFirst();
}
public boolean reBuildingFiles(CompanyVendorVo companyVendor, MessageHolder messageHolder) {
public boolean reBuildingFiles(VendorVo companyVendor, MessageHolder messageHolder) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
}
@@ -76,7 +76,7 @@ public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyV
holder.error("合同未关联公司");
return;
}
CompanyVendorVo companyVendor = findByCompany(company);
VendorVo companyVendor = findByCompany(company);
if (companyVendor == null) {
holder.error("合同未关联供应商");
return;
@@ -105,7 +105,7 @@ public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyV
companyVendorFileService.verify(companyVendor, contract.getSetupDate(), holder);
}
private boolean verifyAsTypicallyVendor(CompanyVendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
private boolean verifyAsTypicallyVendor(VendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
boolean valid = false;
CompanyVo company = companyService.findById(companyVendor.getCompanyId());
// 检查营业状态
@@ -135,7 +135,7 @@ public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyV
return valid;
}
public boolean makePathAbsent(CompanyVendorVo companyVendor) {
public boolean makePathAbsent(VendorVo companyVendor) {
String path = companyVendor.getPath();
if (StringUtils.hasText(path)) {
File file = new File(path);
@@ -155,7 +155,7 @@ public class CompanyVendorService extends QueryService<CompanyVendorVo, CompanyV
return true;
}
public File makePath(CompanyVendorVo companyVendor) {
public File makePath(VendorVo companyVendor) {
File basePath = getBasePath();
CompanyVo company = companyService.findById(companyVendor.getCompanyId());
String companyName = company.getName();