feat: 添加日志配置和Logback依赖

refactor: 重构实体类equals和hashCode方法

fix: 修复WebSocketService消息发送逻辑

style: 格式化代码和优化导入

docs: 更新JacksonConfig日期序列化格式

test: 添加CompanyFilePathTableCell测试类

chore: 清理无用代码和注释
This commit is contained in:
2025-09-11 19:44:28 +08:00
parent 375de610ef
commit a1b87de7c0
149 changed files with 2246 additions and 1413 deletions

View File

@@ -73,6 +73,13 @@
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
<!-- Logback 日志实现 -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.14</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -20,6 +20,7 @@ import com.ecep.contract.controller.BaseController;
import com.ecep.contract.controller.HomeWindowController;
import com.ecep.contract.controller.OkHttpLoginController;
import com.ecep.contract.task.TaskMonitorCenter;
import com.ecep.contract.util.HibernateProxyUtils;
import com.ecep.contract.util.TextMessageHolder;
import com.ecep.contract.util.UITools;
import com.ecep.contract.vm.CurrentEmployee;
@@ -37,12 +38,10 @@ import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import lombok.Getter;
import lombok.Setter;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.WebSocket;
/**
* JavaFx 应用程序
@@ -187,6 +186,7 @@ public class Desktop extends Application {
} else {
logger.warn("配置文件{}不存在", configFile.getAbsolutePath());
}
HibernateProxyUtils.useProxy(false);
runAsync(() -> {
SpringApp.launch(properties, holder);
@@ -204,12 +204,11 @@ public class Desktop extends Application {
controller.setHolder(holder);
controller.setPrimaryStage(primaryStage);
controller.setProperties(properties);
// while (true) {
controller.tryLogin().whenComplete((v, e) -> {
if (e != null) {
holder.error("登录失败:" + e.getMessage());
} else {
while (true) {
try {
controller.tryLogin().get();
holder.info("登录成功");
try {
while (!SpringApp.isRunning()) {
System.out.println("等待启动");
@@ -221,13 +220,13 @@ public class Desktop extends Application {
// 必须要等待启动成功后才能关闭主场景,否则进程结束程序退出
HomeWindowController.show().thenRun(() -> Platform.runLater(primaryStage::close));
}
});
// if (getActiveEmployeeId() > 0) {
// break;
// }
// }
break;
} catch (Exception ex) {
holder.error(ex.getMessage());
Thread.sleep(3000);
}
}
} catch (Exception e) {
holder.error("登录失败:" + e.getMessage());
logger.error(e.getMessage(), e);

View File

@@ -237,14 +237,18 @@ public class SpringApp {
public ObjectMapper objectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
JavaTimeModule javaTimeModule = new JavaTimeModule();
// LocalDate
javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ISO_LOCAL_DATE));
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(
DateTimeFormatter.ofPattern(MyDateTimeUtils.DEFAULT_DATETIME_FORMAT_PATTERN)));
javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern("HH:mm:ss")));
javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ISO_LOCAL_DATE));
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(
DateTimeFormatter.ofPattern(MyDateTimeUtils.DEFAULT_DATETIME_FORMAT_PATTERN)));
// LocalTime
javaTimeModule.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ISO_LOCAL_TIME));
javaTimeModule.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ISO_LOCAL_TIME));
// LocalDateTime
javaTimeModule.addSerializer(LocalDateTime.class,
new LocalDateTimeSerializer(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
javaTimeModule.addDeserializer(LocalDateTime.class,
new LocalDateTimeDeserializer(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
objectMapper.registerModule(javaTimeModule);
return objectMapper;
}

View File

@@ -85,7 +85,7 @@ public class WebSocketService {
if (node.has("success")) {
if (!node.get("success").asBoolean()) {
future.completeExceptionally(
new RuntimeException("请求失败:" + node.get("message").asText()));
new RuntimeException("请求失败:来自服务器的消息=" + node.get("message").asText()));
return;
}
}
@@ -153,9 +153,9 @@ public class WebSocketService {
}
String json = objectMapper.writeValueAsString(msg);
callbacks.put(msg.getMessageId(), future);
if (webSocket.send(json)) {
logger.debug("send message success:{}", json);
callbacks.put(msg.getMessageId(), future);
} else {
future.completeExceptionally(new RuntimeException("Failed to send WebSocket message"));
}

View File

@@ -10,6 +10,7 @@ import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
import com.ecep.contract.controller.tab.RefreshableSkin;
import com.ecep.contract.controller.tab.TabSkin;
import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.service.QueryService;
import com.ecep.contract.service.ViewModelService;
import com.ecep.contract.util.UITools;
import com.ecep.contract.vm.BaseViewModel;
@@ -46,15 +47,28 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
@Override
public void onShown(WindowEvent windowEvent) {
Class<?> aClass = getClass();
super.onShown(windowEvent);
loadedFuture = CompletableFuture.supplyAsync(() -> {
T entity = loadEntity();
if (entity == null) {
ViewModelService<T, TV> service = getViewModelService();
if (service instanceof QueryService<T, TV> queryService) {
setStatus("读取...");
loadedFuture = queryService.asyncFindById(viewModel.getId().get());
loadedFuture.thenAccept(entity -> {
// fixed, bind change if new view model create
if (viewModel != null) {
viewModel.bindListener();
}
setStatus();
// BaseViewModel.updateInFxApplicationThread(entity, viewModel);
});
loadedFuture.exceptionally(ex -> {
handleException("载入失败,#" + viewModel.getId().get(), ex);
return null;
});
} else {
loadedFuture = CompletableFuture.supplyAsync(() -> {
T entity = getViewModelService().findById(viewModel.getId().get());
if (entity == null) {
return null;
}
Platform.runLater(() -> {
@@ -64,6 +78,7 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
viewModel.bindListener();
return entity;
});
}
registerTabSkins();
if (saveBtn != null) {
@@ -74,10 +89,6 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
installTabSkins();
}
protected T loadEntity() {
return getViewModelService().findById(viewModel.getId().get());
}
public T getEntity() {
return getLoadedFuture().join();
}
@@ -193,10 +204,20 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
public CompletableFuture<Void> refresh() {
CompletableFuture<Void> future = new CompletableFuture<>();
T entity = loadEntity();
Platform.runLater(() -> {
ViewModelService<T, TV> service = getViewModelService();
if (service instanceof QueryService<T, TV> queryService) {
loadedFuture = queryService.asyncFindById(viewModel.getId().get());
loadedFuture.whenComplete((entity, ex) -> {
if (ex != null) {
future.completeExceptionally(ex);
return;
}
BaseViewModel.updateInFxApplicationThread(entity, viewModel);
});
} else {
T entity = service.findById(viewModel.getId().get());
setEntity(entity);
}
List<RefreshableSkin> list = tabSkins.stream()
.filter(v -> v instanceof RefreshableSkin)
@@ -204,10 +225,10 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
if (list.isEmpty()) {
future.complete(null);
return;
return future;
}
CompletableFuture.allOf(list
return CompletableFuture.allOf(list
.stream()
.map(RefreshableSkin::refresh)
.filter(Objects::nonNull)
@@ -219,9 +240,6 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
future.complete(null);
}
});
});
return future;
}
public abstract ViewModelService<T, TV> getViewModelService();

View File

@@ -104,26 +104,17 @@ public class OkHttpLoginController implements MessageHolder {
String userName = getUserName();
String password = getPassword();
CompletableFuture<Void> loginFuture = new CompletableFuture<>();
if (StringUtils.hasText(userName) && StringUtils.hasText(password)) {
login(userName, password).whenComplete((v, e) -> {
if (e != null) {
loginFuture.completeExceptionally(e);
} else {
loginFuture.complete(v);
}
});
return login(userName, password);
} else {
CompletableFuture<Void> loginFuture = new CompletableFuture<>();
Platform.runLater(() -> {
showLoginDialog();
if (!loginFuture.isDone()) {
loginFuture.complete(null);
}
});
}
return loginFuture;
}
}
private String getUserName() {
return properties.getProperty("user.name", "");

View File

@@ -12,14 +12,10 @@ import com.ecep.contract.vm.CompanyBasedViewModel;
import com.ecep.contract.vm.CompanyViewModel;
import com.ecep.contract.vm.IdentityViewModel;
import lombok.Setter;
public abstract class AbstCompanyTableTabSkin<T extends IdentityEntity, TV extends IdentityViewModel<T>>
extends AbstEntityTableTabSkin<CompanyWindowController, Company, CompanyViewModel, T, TV>
implements TabSkin, TableOfTabSkin<Company, T, TV> {
@Setter
private CompanyService companyService;
public AbstCompanyTableTabSkin(CompanyWindowController controller) {
super(controller);
@@ -40,10 +36,7 @@ public abstract class AbstCompanyTableTabSkin<T extends IdentityEntity, TV exten
}
protected CompanyService getParentService() {
if (companyService == null) {
companyService = getBean(CompanyService.class);
}
return companyService;
return controller.getViewModelService();
}
@Override

View File

@@ -156,16 +156,6 @@ public class CompanyWindowController
getTitle().set("[" + viewModel.getId().get() + "] " + viewModel.getName().getValue() + " 公司详情");
}
@Override
protected Company loadEntity() {
return companyService.findById(viewModel.getId().get());
}
@Override
protected Company saveEntity(Company entity) {
return companyService.save(entity);
}
@Override
protected void registerTabSkins() {
registerTabSkin(baseInfoTab, tab1 -> new CompanyTabSkinBase(this));

View File

@@ -72,16 +72,6 @@ public class CompanyOldNameWindowController extends AbstEntityController<Company
getTitle().set("[" + viewModel.getId().get() + "] " + viewModel.getName().getValue() + " 曾用名详情");
}
@Override
protected CompanyOldName loadEntity() {
return getViewModelService().findById(viewModel.getId().get());
}
@Override
protected CompanyOldName saveEntity(CompanyOldName entity) {
return getViewModelService().save(entity);
}
@Override
protected void registerTabSkins() {
registerTabSkin(baseInfoTab, this::createBaseTabSkin);

View File

@@ -2,7 +2,6 @@ package com.ecep.contract.controller.contract;
import java.io.File;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@@ -23,7 +22,6 @@ import com.ecep.contract.model.Company;
import com.ecep.contract.model.Contract;
import com.ecep.contract.service.CompanyService;
import com.ecep.contract.service.ContractService;
import com.ecep.contract.service.ProjectService;
import com.ecep.contract.task.ContractRepairTask;
import com.ecep.contract.task.ContractVerifyTasker;
import com.ecep.contract.util.FxmlPath;

View File

@@ -103,9 +103,6 @@ public class InventoryWindowController extends AbstEntityController<Inventory, I
@FXML
public TextField packagedVolumeField;
@Autowired
private InventoryService service;
@Override
public void onShown(WindowEvent windowEvent) {
super.onShown(windowEvent);
@@ -116,16 +113,6 @@ public class InventoryWindowController extends AbstEntityController<Inventory, I
root.getScene().getStylesheets().add("/ui/inventory/inventory.css");
}
@Override
protected Inventory loadEntity() {
return service.findById(viewModel.getId().get());
}
@Override
protected Inventory saveEntity(Inventory entity) {
return service.save(entity);
}
@Override
protected void registerTabSkins() {
registerTabSkin(baseInfoTab, tab -> new InventoryTabSkinBase(this));
@@ -135,6 +122,6 @@ public class InventoryWindowController extends AbstEntityController<Inventory, I
@Override
public InventoryService getViewModelService() {
return service;
return getCachedBean(InventoryService.class);
}
}

View File

@@ -71,17 +71,6 @@ public class EmployeeRoleWindowController extends AbstEntityController<EmployeeR
@Autowired
EmployeeRoleService employeeRoleService;
@Override
protected EmployeeRole loadEntity() {
return employeeRoleService.findById(viewModel.getId().get());
}
@Override
protected EmployeeRole saveEntity(EmployeeRole role) {
return employeeRoleService.save(role);
}
@Override
public void onShown(WindowEvent windowEvent) {
super.onShown(windowEvent);

View File

@@ -151,16 +151,6 @@ public class ProjectWindowController extends AbstEntityController<Project, Proje
getTitle().bind(Bindings.createStringBinding(() -> "[" + viewModel.getId().get() + "] " + viewModel.getCode().get() + " " + viewModel.getName().getValue() + " 项目详情", viewModel.getCode(), viewModel.getName()));
}
@Override
protected Project loadEntity() {
return projectService.findById(viewModel.getId().get());
}
@Override
protected Project saveEntity(Project entity) {
return projectService.save(entity);
}
@Override
protected void registerTabSkins() {
registerTabSkin(baseInfoTab, this::createBaseTabSkin);

View File

@@ -20,6 +20,10 @@ public abstract class AbstGenericTabSkin<C extends BaseController> implements Ta
this.controller = controller;
}
public <T> T getBean(Class<T> requiredType) throws BeansException {
return controller.getCachedBean(requiredType);
}
public <T> T getCachedBean(Class<T> requiredType) throws BeansException {
return controller.getCachedBean(requiredType);
}

View File

@@ -7,7 +7,6 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.concurrent.CompletableFuture;
import org.springframework.beans.BeansException;
import org.springframework.util.StringUtils;
import com.ecep.contract.DesktopUtils;
@@ -21,7 +20,6 @@ import com.ecep.contract.controller.table.cell.ContractTypeTableCell;
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
import com.ecep.contract.converter.ContractGroupStringConverter;
import com.ecep.contract.converter.EmployeeStringConverter;
import com.ecep.contract.model.Company;
import com.ecep.contract.model.Contract;
import com.ecep.contract.model.ContractGroup;
@@ -32,7 +30,6 @@ import com.ecep.contract.service.ContractGroupService;
import com.ecep.contract.service.ContractKindService;
import com.ecep.contract.service.ContractService;
import com.ecep.contract.service.ContractTypeService;
import com.ecep.contract.service.YongYouU8Service;
import com.ecep.contract.task.ContractRepairByCompanyTask;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.util.UITools;
@@ -117,7 +114,7 @@ public class CompanyTabSkinContract
ObservableList<ContractGroup> contractGroups = FXCollections.observableArrayList();
contractGroups.add(null);
contractGroups.addAll(getViewModelService().findAllGroups());
contractGroups.addAll(getContractGroupService().findAll());
contractGroupSelector.setItems(contractGroups);
contractGroupSelector.setConverter(new ContractGroupStringConverter(contractGroups));
contractSearchKeyField.setOnKeyReleased(event -> {

View File

@@ -17,6 +17,7 @@ import com.ecep.contract.constant.CloudServiceConstant;
import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
import com.ecep.contract.controller.company.CompanyWindowController;
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
import com.ecep.contract.controller.table.cell.CompanyFilePathTableCell;
import com.ecep.contract.model.Company;
import com.ecep.contract.model.CompanyFile;
import com.ecep.contract.model.CompanyFileTypeLocal;
@@ -36,9 +37,7 @@ import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Tab;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import lombok.Setter;
/**
*
@@ -61,8 +60,6 @@ public class CompanyTabSkinFile
public MenuItem fileTable_menu_del;
public MenuItem fileTable_menu_copy_as_matched_by_contract;
@Setter
private CompanyFileService companyFileService;
private final ObservableMap<CompanyFileType, CompanyFileTypeLocal> fileTypeLocalMap = FXCollections
.observableHashMap();
@@ -72,11 +69,12 @@ public class CompanyTabSkinFile
setDragAndDropFileHandler(this::moveFileToCompany);
}
CompanyFileService getCompanyFileService() {
if (companyFileService == null) {
companyFileService = getBean(CompanyFileService.class);
protected CompanyFileService getViewModelService() {
return getCompanyFileService();
}
return companyFileService;
CompanyFileService getCompanyFileService() {
return getBean(CompanyFileService.class);
}
@Override
@@ -96,7 +94,7 @@ public class CompanyTabSkinFile
typeColumn.setCellValueFactory(param -> Bindings.valueAt(fileTypeLocalMap, param.getValue().getType())
.map(CompanyFileTypeLocal::getValue));
filePathColumn.setCellValueFactory(param -> param.getValue().getFilePath());
filePathColumn.setCellFactory(param -> new FileTableFilePathTableCell());
filePathColumn.setCellFactory(param -> new CompanyFilePathTableCell<>(viewModel.getPath()));
applyDateColumn.setCellValueFactory(param -> param.getValue().getApplyDate());
expiringDateColumn.setCellValueFactory(param -> param.getValue().getExpiringDate());
@@ -151,7 +149,7 @@ public class CompanyTabSkinFile
* 把文件从 老系统中移到 \\10.84.209.8\项目信息\相关方信息 目录中
*/
private void onTableMoveFileAction(ActionEvent event) {
CompanyFileService companyFileService = getViewModelService();
CompanyFileService companyFileService = getCompanyFileService();
Company company = getParent();
List<CompanyFile> list = companyFileService.findByCompany(company);
if (list.isEmpty()) {
@@ -354,26 +352,4 @@ public class CompanyTabSkinFile
DesktopUtils.showInExplorer(file);
}
}
class FileTableFilePathTableCell extends TableCell<CompanyFileViewModel, String> {
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null) {
setText("");
return;
}
String path = viewModel.getPath().get();
if (StringUtils.hasText(path)) {
if (item.startsWith(path)) {
item = "~" + item.substring(path.length());
}
}
setText(item);
}
}
protected CompanyFileService getViewModelService() {
return getCompanyFileService();
}
}

View File

@@ -49,35 +49,18 @@ public class ContractManagerSkin
public ContractService getContractService() {
return controller.getViewModelService();
}
public CompanyService getCompanyService() {
if (companyService == null) {
companyService = getBean(CompanyService.class);
return getBean(CompanyService.class);
}
return companyService;
}
private ContractTypeService getContractTypeService() {
if (contractTypeService == null) {
contractTypeService = getBean(ContractTypeService.class);
return getBean(ContractTypeService.class);
}
return contractTypeService;
}
private ContractKindService getContractKindService() {
if (contractKindService == null) {
contractKindService = getBean(ContractKindService.class);
return getBean(ContractKindService.class);
}
return contractKindService;
}
private ContractGroupService getContractGroupService() {
if (contractGroupService == null) {
contractGroupService = getBean(ContractGroupService.class);
return getBean(ContractGroupService.class);
}
return contractGroupService;
}
public Map<String, Object> getSpecification() {
Map<String, Object> params = super.getSpecification();
if (controller.composeViewBtn.isSelected()) {
@@ -108,7 +91,7 @@ public class ContractManagerSkin
@SuppressWarnings("unchecked")
@Override
public void initializeTable() {
ComboBoxUtils.initialComboBox(controller.groupSelector, getContractService().findAllGroups(), true);
ComboBoxUtils.initialComboBox(controller.groupSelector, getContractGroupService().findAll(), true);
controller.groupSelector.valueProperty().addListener((observable, oldValue, newValue) -> {
loadTableDataSet(false);
});

View File

@@ -109,7 +109,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
initializeBaseTabCompanyFieldAutoCompletion(controller.companyField);
controller.groupField.textProperty().bind(viewModel.getGroup().map(group -> {
ContractGroupService groupService = controller.getCachedBean(ContractGroupService.class);
ContractGroupService groupService = getContractGroupService();
if (!ProxyUtils.isInitialized(group)) {
group = groupService.findById(group.getId());
}
@@ -506,22 +506,26 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
}
public CompanyCustomerService getCompanyCustomerService() {
return controller.getCachedBean(CompanyCustomerService.class);
return getCachedBean(CompanyCustomerService.class);
}
public ProjectService getProjectService() {
return controller.getCachedBean(ProjectService.class);
return getCachedBean(ProjectService.class);
}
public ProjectSaleTypeService getSaleTypeService() {
return controller.getCachedBean(ProjectSaleTypeService.class);
return getCachedBean(ProjectSaleTypeService.class);
}
public ExtendVendorInfoService getExtendVendorInfoService() {
return controller.getCachedBean(ExtendVendorInfoService.class);
return getCachedBean(ExtendVendorInfoService.class);
}
public ContractGroupService getContractGroupService() {
return getCachedBean(ContractGroupService.class);
}
public VendorGroupService getVendorGroupService() {
return controller.getCachedBean(VendorGroupService.class);
return getCachedBean(VendorGroupService.class);
}
}

View File

@@ -0,0 +1,36 @@
package com.ecep.contract.controller.table.cell;
import org.springframework.util.StringUtils;
import javafx.beans.property.SimpleStringProperty;
import javafx.scene.control.TableCell;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
@NoArgsConstructor
@AllArgsConstructor
public class CompanyFilePathTableCell<T> extends TableCell<T, String> {
private SimpleStringProperty companyPathProperty;
public void setCompanyPathProperty(SimpleStringProperty property) {
this.companyPathProperty = property;
}
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null) {
setText("");
return;
}
if (companyPathProperty != null) {
String path = companyPathProperty.get();
if (StringUtils.hasText(path)) {
if (item.startsWith(path)) {
item = "~" + item.substring(path.length());
}
}
}
setText(item);
}
}

View File

@@ -29,17 +29,6 @@ public class PurchaseBillVoucherWindowController
@Autowired
private PurchaseBillVoucherService service;
@Override
protected PurchaseBillVoucher loadEntity() {
return service.findById(viewModel.getId().get());
}
@Override
protected PurchaseBillVoucher saveEntity(PurchaseBillVoucher entity) {
return service.save(entity);
}
@Override
public void show(Stage stage) {
super.show(stage);

View File

@@ -6,7 +6,6 @@ import com.ecep.contract.model.CompanyBlackReason;
import com.ecep.contract.vm.CompanyBlackReasonViewModel;
@Service
public class CompanyBlackReasonService
extends QueryService<CompanyBlackReason, CompanyBlackReasonViewModel> {
public class CompanyBlackReasonService extends QueryService<CompanyBlackReason, CompanyBlackReasonViewModel> {
}

View File

@@ -1,10 +1,7 @@
package com.ecep.contract.service;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.ecep.contract.model.ContractItem;
@@ -14,31 +11,6 @@ import com.ecep.contract.vm.ContractItemViewModel;
@Service
public class ContractItemService extends QueryService<ContractItem, ContractItemViewModel> {
@Override
public ContractItem findById(Integer id) {
throw new UnsupportedOperationException("Unimplemented method 'findById'");
}
@Override
public ContractItem save(ContractItem entity) {
throw new UnsupportedOperationException("Unimplemented method 'save'");
}
@Override
public void delete(ContractItem entity) {
throw new UnsupportedOperationException("Unimplemented method 'delete'");
}
@Override
public List<ContractItem> findAll() {
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
}
@Override
public Page<ContractItem> findAll(Map<String, Object> params, Pageable pageable) {
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
}
public List<ContractItem> findAllByInventory(Inventory parent) {
throw new UnsupportedOperationException("Unimplemented method 'findAllByInventory'");
}

View File

@@ -10,7 +10,6 @@ import com.ecep.contract.MessageHolder;
import com.ecep.contract.model.CompanyVendor;
import com.ecep.contract.model.Contract;
import com.ecep.contract.model.ContractFile;
import com.ecep.contract.model.ContractGroup;
import com.ecep.contract.model.Project;
import com.ecep.contract.vm.ContractViewModel;
@@ -22,10 +21,6 @@ public class ContractService extends QueryService<Contract, ContractViewModel> {
throw new UnsupportedOperationException("Unimplemented method 'updateParentCode'");
}
public List<ContractGroup> findAllGroups() {
throw new UnsupportedOperationException("Unimplemented method 'findAllGroups'");
}
public Contract findByCode(String string) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'findByCode'");

View File

@@ -4,6 +4,7 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,10 +13,12 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import com.ecep.contract.PageArgument;
import com.ecep.contract.WebSocketService;
import com.ecep.contract.model.IdentityEntity;
import com.ecep.contract.msg.SimpleMessage;
import com.ecep.contract.vm.IdentityViewModel;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -31,8 +34,6 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
public TV createNewViewModel() {
try {
Type genericSuperclass = getClass().getGenericSuperclass();
System.out.println("genericSuperclass = " + genericSuperclass.getClass());
String typeName = genericSuperclass.getTypeName();
// System.out.println("typeName = " + typeName);
String clz = typeName.split("<")[1].split(">")[0].split(",")[1].trim();
@@ -92,31 +93,49 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
}
}
@Override
public T findById(Integer id) {
public CompletableFuture<T> asyncFindById(Integer id) {
SimpleMessage msg = new SimpleMessage();
msg.setService(getBeanName());
msg.setMethod("findById");
msg.setArguments(id);
try {
JsonNode response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
if (response != null) {
T newEntity = createNewEntity();
objectMapper.updateValue(newEntity, response);
return newEntity;
return webSocketService.send(msg).orTimeout(readTimeout, TimeUnit.MILLISECONDS).handle((response, ex) -> {
if (ex != null) {
return null;
}
if (response == null) {
return null;
}
T newEntity = createNewEntity();
try {
objectMapper.updateValue(newEntity, response);
} catch (JsonMappingException e) {
throw new RuntimeException(response.toString(), e);
}
return newEntity;
});
}
@Override
public T findById(Integer id) {
try {
return asyncFindById(id).get();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public List<T> findAll() {
return findAll(null, Pageable.unpaged()).getContent();
}
@Override
public Page<T> findAll(Map<String, Object> params, Pageable pageable) {
SimpleMessage msg = new SimpleMessage();
msg.setService(getBeanName());
msg.setMethod("findAll");
msg.setArguments(params, pageable);
msg.setArguments(params, PageArgument.of(pageable));
try {
JsonNode response = webSocketService.send(msg).get(readTimeout, TimeUnit.MILLISECONDS);
if (response != null) {
@@ -147,7 +166,6 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
return null;
}
public List<T> search(String searchText) {
Map<String, Object> params = getSpecification(searchText);
List<T> list = findAll(params, Pageable.ofSize(10)).getContent();

View File

@@ -20,8 +20,10 @@ public class IdentityViewModel<T extends IdentityEntity> extends BaseViewModel<T
@Override
protected void updateFrom(T v) {
super.updateFrom(v);
if (v.getId() != null) {
id.set(v.getId());
}
}
@Override
public boolean copyTo(T v) {

View File

@@ -0,0 +1,22 @@
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- 设置 com.ecep.contract 包下的日志级别为 DEBUG -->
<logger name="com.ecep.contract" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
</logger>
<!-- 特别设置 WebSocketService 类的日志级别为 DEBUG -->
<logger name="com.ecep.contract.WebSocketService" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
</logger>
<!-- 根日志配置 -->
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</configuration>

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinVendorBid">
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinVendorBid">
<children>
<HBox spacing="3.0">
<children>

View File

@@ -4,7 +4,7 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinFiles">
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinFiles">
<children>
<HBox spacing="3.0">
<children>

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinItemsV2">
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinItemsV2">
<children>
<HBox spacing="3.0">
<children>

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinItems">
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinItems">
<children>
<HBox spacing="3.0">
<children>

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinPayPlan">
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinPayPlan">
<children>
<HBox spacing="3.0">
<children>

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="400.0" prefWidth="600.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinPurchaseOrders"
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinPurchaseOrders"
>
<children>
<HBox spacing="3.0">

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinSaleOrders"
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinSaleOrders"
>
<children>
<HBox spacing="3.0">

View File

@@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.ecep.contract.controller.contract.ContractTabSkinSubContract"
fx:controller="com.ecep.contract.controller.tab.ContractTabSkinSubContract"
>
<children>
<HBox spacing="3.0">

View File

@@ -0,0 +1,76 @@
package com.ecep.contract;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.NullHandling;
import org.springframework.data.domain.Sort.Order;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
public class PageArgument {
private boolean paged = false;
private int pageNumber = 0;
private int pageSize = 0;
private long offset = 0;
private List<OrderArgument> orders;
public static PageArgument of(Pageable pageable) {
PageArgument page = new PageArgument();
page.setPaged(pageable.isPaged());
if (page.isPaged()) {
page.setPageNumber(pageable.getPageNumber());
page.setPageSize(pageable.getPageSize());
page.setOffset(pageable.getOffset());
}
Sort sort = pageable.getSort();
if (sort != null && sort.isSorted()) {
page.setOrders(sort.stream().map(OrderArgument::of).collect(Collectors.toList()));
}
return page;
}
public Pageable toPageable() {
Sort sort = null;
if (orders != null && !orders.isEmpty()) {
sort = Sort.by(orders.stream().map(order -> new Order(order.getDirection(), order.getProperty(),
order.isIgnoreCase(), order.getNullHandling()))
.collect(Collectors.toList()));
} else {
sort = Sort.unsorted();
}
if (isPaged()) {
return PageRequest.of(pageNumber, pageSize, sort);
}
return Pageable.unpaged(sort);
}
public boolean isUnpaged() {
return !isPaged();
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class OrderArgument {
private Direction direction;
private String property;
private boolean ignoreCase;
private NullHandling nullHandling;
public static OrderArgument of(Order order) {
return new OrderArgument(order.getDirection(), order.getProperty(), order.isIgnoreCase(),
order.getNullHandling());
}
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -40,15 +40,7 @@ public class Bank implements BasedEntity, IdentityEntity, Serializable {
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Bank bank = (Bank) object;
return getId() != null && Objects.equals(getId(), bank.getId());
@@ -56,8 +48,6 @@ public class Bank implements BasedEntity, IdentityEntity, Serializable {
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -15,7 +15,7 @@ import lombok.ToString;
@Setter
@MappedSuperclass
@ToString
public class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
public abstract class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -33,4 +33,5 @@ public class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
@Column(name = "VALUE")
private String value;
}

View File

@@ -1,11 +1,13 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -133,4 +135,22 @@ public class CloudRk implements IdentityEntity, Serializable {
*/
@Column(name = "VERSION", nullable = false)
private Integer version = 0;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CloudRk cloudRk = (CloudRk) object;
return getId() != null && Objects.equals(getId(), cloudRk.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.Instant;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -71,28 +72,21 @@ public class CloudTyc implements IdentityEntity, Serializable {
private int version;
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object)
return true;
if (o == null)
if (object == null)
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
CloudTyc cloudInfo = (CloudTyc) o;
}
CloudTyc cloudInfo = (CloudTyc) object;
return getId() != null && Objects.equals(getId(), cloudInfo.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,12 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -69,4 +72,22 @@ public class CloudYu implements IdentityEntity, Serializable {
*/
@Column(name = "CLOUD_LATEST")
private Instant cloudLatest;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CloudYu cloudYu = (CloudYu) object;
return getId() != null && Objects.equals(getId(), cloudYu.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -185,15 +186,7 @@ public class Company implements IdentityEntity, NamedEntity, BasedEntity, Serial
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Company company = (Company) object;
return getId() != null && Objects.equals(getId(), company.getId());
@@ -201,9 +194,7 @@ public class Company implements IdentityEntity, NamedEntity, BasedEntity, Serial
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
@@ -49,9 +53,23 @@ public class CompanyBankAccount implements IdentityEntity, BasedEntity, Company
@Column(name = "DESCRIPTION")
private String description;
@Override
public String toPrettyString() {
return account;
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyBankAccount that = (CompanyBankAccount) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,11 +2,13 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import com.ecep.contract.BlackReasonType;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.Column;
@@ -71,4 +73,21 @@ public class CompanyBlackReason implements IdentityEntity, CompanyBasedEntity,
@Column(name = "`KEY`")
private String key;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyBlackReason that = (CompanyBlackReason) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -85,15 +86,7 @@ public class CompanyContact implements IdentityEntity, NamedEntity, BasedEntity,
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyContact that = (CompanyContact) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -101,9 +94,7 @@ public class CompanyContact implements IdentityEntity, NamedEntity, BasedEntity,
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Map;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -27,7 +30,7 @@ import lombok.ToString;
}, uniqueConstraints = {
})
@ToString(exclude = {"company", "contract"})
@ToString(exclude = { "company", "contract" })
public class CompanyContract implements IdentityEntity, CompanyBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@@ -54,4 +57,22 @@ public class CompanyContract implements IdentityEntity, CompanyBasedEntity, Seri
contact.getPhone() +
contact.getEmail();
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyContract that = (CompanyContract) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -6,7 +6,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -79,15 +80,7 @@ public class CompanyCustomer implements IdentityEntity, CompanyBasedEntity, Seri
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomer that = (CompanyCustomer) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -95,8 +88,6 @@ public class CompanyCustomer implements IdentityEntity, CompanyBasedEntity, Seri
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -102,22 +102,15 @@ public class CompanyCustomerEntity implements IdentityEntity, Serializable {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyCustomerEntity that = (CompanyCustomerEntity) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,9 +66,23 @@ public class CompanyCustomerEvaluationFormFile implements IdentityEntity, BasedE
@Column(name = "SCORE_TEMPLATE_VER")
private Integer scoreTemplateVersion = 1;
@Override
public String toPrettyString() {
return getCatalog() + ", level=" + getCreditLevel();
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomerEvaluationFormFile that = (CompanyCustomerEvaluationFormFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyCustomerFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -61,4 +63,19 @@ public class CompanyCustomerFile implements CompanyBasicFile<CompanyCustomerFile
@Column(name = "VALID")
private boolean valid = false;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomerFile that = (CompanyCustomerFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,8 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.CompanyCustomerFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -18,4 +20,21 @@ import lombok.ToString;
public class CompanyCustomerFileTypeLocal extends BaseEnumEntity<CompanyCustomerFileType> implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyCustomerFileTypeLocal that = (CompanyCustomerFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,8 @@ import java.io.Serializable;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -49,20 +50,18 @@ public class CompanyExtendInfo implements IdentityEntity, Serializable {
@ToString.Exclude
private int version;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyExtendInfo that = (CompanyExtendInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -61,4 +63,22 @@ public class CompanyFile implements IdentityEntity, CompanyBasedEntity, Seriali
*/
@Column(name = "FILE_PATH")
private String filePath;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyFile that = (CompanyFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,8 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.CompanyFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -17,4 +19,22 @@ import lombok.ToString;
@ToString
public class CompanyFileTypeLocal extends BaseEnumEntity<CompanyFileType> implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyFileTypeLocal that = (CompanyFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -63,18 +63,20 @@ public class CompanyInvoiceInfo implements IdentityEntity, NamedEntity, BasedEnt
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
CompanyInvoiceInfo that = (CompanyInvoiceInfo) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyInvoiceInfo that = (CompanyInvoiceInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,18 +63,20 @@ public class CompanyOldName implements IdentityEntity, NamedEntity, Serializable
private int version;
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
CompanyOldName that = (CompanyOldName) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyOldName that = (CompanyOldName) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -7,9 +7,9 @@ import java.util.List;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -46,7 +46,6 @@ public class CompanyVendor implements IdentityEntity, CompanyBasedEntity, Serial
@Column(name = "TYPE")
private VendorType type;
@ColumnDefault("false")
@Column(name = "PROTOCOL_PROVIDER", nullable = false)
private boolean protocolProvider = false;
@@ -107,17 +106,19 @@ public class CompanyVendor implements IdentityEntity, CompanyBasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendor that = (CompanyVendor) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -31,13 +34,11 @@ public class CompanyVendorApprovedFile implements IdentityEntity, Serializable {
@Column(name = "ID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "LIST_ID", nullable = false)
@ToString.Exclude
private CompanyVendorApprovedList list;
/**
* 文件名,不含目录,目录使用目录的目录
*/
@@ -56,4 +57,21 @@ public class CompanyVendorApprovedFile implements IdentityEntity, Serializable {
@Column(name = "DESCRIPTION")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedFile that = (CompanyVendorApprovedFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,8 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -66,17 +65,19 @@ public class CompanyVendorApprovedItem implements IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedItem that = (CompanyVendorApprovedItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,7 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -16,7 +16,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 合格供应商名录
* 每年一条记录
@@ -60,17 +59,19 @@ public class CompanyVendorApprovedList implements IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedList that = (CompanyVendorApprovedList) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -20,7 +20,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 供应商的关联详细项关联信息用于绑定U8系统中的供应商编号
*/
@@ -96,20 +95,18 @@ public class CompanyVendorEntity implements IdentityEntity, Serializable {
@Column(name = "FETCHED_TIME")
private LocalDateTime fetchedTime;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyVendorEntity that = (CompanyVendorEntity) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyVendorFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -64,4 +66,22 @@ public class CompanyVendorFile implements CompanyBasicFile<CompanyVendorFileType
@Column(name = "VALID")
private boolean valid = false;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorFile that = (CompanyVendorFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,9 @@
package com.ecep.contract.model;
import java.util.Objects;
import com.ecep.contract.CompanyVendorFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -17,5 +20,21 @@ import lombok.ToString;
@Table(name = "COMPANY_VENDOR_FILE_TYPE_LOCAL")
@ToString
public class CompanyVendorFileTypeLocal extends BaseEnumEntity<CompanyVendorFileType> {
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorFileTypeLocal that = (CompanyVendorFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -6,9 +6,9 @@ import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractPayWay;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -71,11 +71,26 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
* 合同状态U8 系统中的合同状态,目前含义未知
* <table>
* <caption>各个状态值的统计情况如下数据样本日期2025-02-08</caption>
* <tr><th>State</th><th>Count</th></tr>
* <tr><td>null</td><td>3891</td></tr>
* <tr><td>A</td><td>9</td></tr>
* <tr><td>B</td><td>6499</td></tr>
* <tr><td>C</td><td>79</td></tr>
* <tr>
* <th>State</th>
* <th>Count</th>
* </tr>
* <tr>
* <td>null</td>
* <td>3891</td>
* </tr>
* <tr>
* <td>A</td>
* <td>9</td>
* </tr>
* <tr>
* <td>B</td>
* <td>6499</td>
* </tr>
* <tr>
* <td>C</td>
* <td>79</td>
* </tr>
* </table>
*/
@Column(name = "STATE")
@@ -83,21 +98,21 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
/**
* 合同分组
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "GROUP_ID")
private ContractGroup group;
/**
* 分类
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE_ID")
private ContractType type;
/**
* 性质
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "KIND_ID")
private ContractKind kind;
@@ -267,7 +282,6 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
@Column(name = "EXEC_UNTAX_AMOUNT")
private double execUnTaxAmount;
@Override
public String toPrettyString() {
return getCode() + " " + getName();
@@ -275,17 +289,19 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Contract contract = (Contract) object;
return getId() != null && Objects.equals(getId(), contract.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,7 +1,9 @@
package com.ecep.contract.model;
import java.io.Serializable;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,22 +59,15 @@ public class ContractBidVendor implements IdentityEntity, ContractBasedEntity, S
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractBidVendor that = (ContractBidVendor) object;
return equals(that);
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -53,17 +53,19 @@ public class ContractCatalog implements IdentityEntity, NamedEntity, Serializabl
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractCatalog that = (ContractCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,9 +4,8 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -68,17 +67,19 @@ public class ContractFile implements IdentityEntity, ContractBasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractFile that = (ContractFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,9 @@
package com.ecep.contract.model;
import java.util.Objects;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -24,4 +27,21 @@ public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> {
@Column(name = "SUGGEST_FILE_NAME")
private String suggestFileName;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractFileTypeLocal that = (ContractFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -51,17 +51,19 @@ public class ContractGroup implements IdentityEntity, NamedEntity, Serializable
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractGroup that = (ContractGroup) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -76,7 +76,6 @@ public class ContractItem implements IdentityEntity, ContractBasedEntity, BasedE
@ToString.Exclude
private Inventory inventory;
/**
* 不含税单价
*/
@@ -148,17 +147,19 @@ public class ContractItem implements IdentityEntity, ContractBasedEntity, BasedE
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractItem that = (ContractItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -39,7 +39,6 @@ public class ContractKind implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "NAME")
private String name;
@Column(name = "TITLE")
private String title;
@@ -53,17 +52,19 @@ public class ContractKind implements IdentityEntity, NamedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractKind that = (ContractKind) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,6 +3,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -41,7 +44,6 @@ public class ContractPayPlan implements IdentityEntity, ContractBasedEntity, Ser
@Column(name = "REF_ID")
private Integer refId;
@Column(name = "PAY_DATE")
private LocalDate payDate;
@@ -66,4 +68,22 @@ public class ContractPayPlan implements IdentityEntity, ContractBasedEntity, Ser
*/
@Column(name = "UPDATE_TIME")
private LocalDateTime updateDate;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractPayPlan that = (ContractPayPlan) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -59,17 +59,19 @@ public class ContractType implements IdentityEntity, NamedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractType that = (ContractType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,12 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
/**
* U8系统的 客户分类
@@ -45,22 +51,15 @@ public class CustomerCatalog implements BasedEntity {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CustomerCatalog that = (CustomerCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -76,4 +79,22 @@ public class CustomerSatisfactionSurvey implements IdentityEntity, ProjectBasedE
*/
@Column(name = "DESCRIPTION")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CustomerSatisfactionSurvey that = (CustomerSatisfactionSurvey) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -51,17 +51,19 @@ public class DeliverySignMethod implements BasedEntity, IdentityEntity {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
DeliverySignMethod that = (DeliverySignMethod) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
@@ -31,7 +31,6 @@ public class Department implements BasedEntity, IdentityEntity, Serializable {
@Column(name = "CODE")
private String code;
@Column(name = "NAME")
private String name;
@@ -50,17 +49,16 @@ public class Department implements BasedEntity, IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Department that = (Department) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,8 +4,7 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -118,15 +117,7 @@ public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Seria
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Employee employee = (Employee) object;
return getId() != null && Objects.equals(getId(), employee.getId());
@@ -134,8 +125,6 @@ public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Seria
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,14 +1,22 @@
package com.ecep.contract.model;
import java.io.Serializable;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.time.LocalDateTime;
import java.util.Objects;
@Getter
@Setter
@@ -50,7 +58,6 @@ public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Serializab
@Column(name = "DESCRIPTION")
private String description;
@Override
public String toPrettyString() {
return ip + " " + mac;
@@ -58,17 +65,19 @@ public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Serializab
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeAuthBind bank = (EmployeeAuthBind) object;
return getId() != null && Objects.equals(getId(), bank.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,19 +1,27 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.proxy.HibernateProxy;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@jakarta.persistence.Entity
@Table(name = "EMPLOYEE_LOGIN_HISTORY", schema = "supplier_ms")
public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serializable {
public class EmployeeLoginHistory implements BasedEntity, IdentityEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@@ -37,7 +45,6 @@ public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serial
@Column(name = "LATEST_ACTIVE")
private LocalDateTime activeTime;
@Override
public String toPrettyString() {
return ip + " " + mac;
@@ -45,17 +52,19 @@ public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
EmployeeLoginHistory bank = (EmployeeLoginHistory) object;
return getId() != null && Objects.equals(getId(), bank.getId());
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeLoginHistory that = (EmployeeLoginHistory) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,13 +1,24 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Getter
@Setter
@jakarta.persistence.Entity
@@ -53,4 +64,22 @@ public class EmployeeRole implements IdentityEntity, NamedEntity, Serializable {
@JoinTable(name = "EMPLOYEE_ROLES", joinColumns = @JoinColumn(name = "ROLE_ID"), inverseJoinColumns = @JoinColumn(name = "EMPLOYEE_ID"))
@JsonIgnore
private java.util.List<Employee> employees = new java.util.ArrayList<>();
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeRole that = (EmployeeRole) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,22 +62,15 @@ public class ExtendVendorInfo implements IdentityEntity {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ExtendVendorInfo that = (ExtendVendorInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,11 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
@jakarta.persistence.Entity
@@ -35,4 +42,22 @@ public class Function implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "DESCRIPTION", columnDefinition = "VARCHAR(255)")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Function that = (Function) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,5 +1,13 @@
package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@@ -7,10 +15,6 @@ import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import java.time.LocalDate;
@Getter
@Setter
@@ -26,4 +30,21 @@ public class HolidayTable {
@Column(name = "IS_HOLIDAY", nullable = false)
private boolean holiday;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
HolidayTable that = (HolidayTable) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.AttributeOverride;
import jakarta.persistence.AttributeOverrides;
@@ -23,7 +23,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 存货物品清单
*/
@@ -101,17 +100,17 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
* 重量单位
*/
@Column(name = "WEIGHT_UNIT")
private String weightUnit="kg";
private String weightUnit = "kg";
/**
* 体积单位
*/
@Column(name = "VOLUME_UNIT")
private String volumeUnit="";
private String volumeUnit = "";
/**
* 尺寸单位
*/
@Column(name = "VOLUME_SIZE_UNIT")
private String sizeUnit="mm";
private String sizeUnit = "mm";
/**
* 体积尺寸(不含包装)
@@ -136,7 +135,6 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
})
private VolumeSize packagedVolumeSize = new VolumeSize();
/**
* 创建人
*/
@@ -169,17 +167,19 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Inventory that = (Inventory) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,11 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
/**
* 存货分类
@@ -14,7 +21,8 @@ import java.util.Objects;
@Setter
@Entity
@Table(name = "INVENTORY_CATALOG", schema = "supplier_ms")
public class InventoryCatalog implements IdentityEntity, BasedEntity {
public class InventoryCatalog implements IdentityEntity, BasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -32,18 +40,17 @@ public class InventoryCatalog implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
InventoryCatalog that = (InventoryCatalog) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
InventoryCatalog that = (InventoryCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,15 +1,26 @@
package com.ecep.contract.model;
import jakarta.persistence.Entity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.time.Year;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.AttributeOverride;
import jakarta.persistence.AttributeOverrides;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@@ -92,18 +103,20 @@ public class InventoryHistoryPrice implements IdentityEntity {
private HistoryPrice maxSalePrice = new HistoryPrice();
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
InventoryHistoryPrice that = (InventoryHistoryPrice) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
InventoryHistoryPrice that = (InventoryHistoryPrice) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,9 +4,10 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import org.springframework.util.StringUtils;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -71,27 +72,20 @@ public class Invoice implements IdentityEntity, BasedEntity, Serializable {
}
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object)
return true;
if (o == null)
if (object == null)
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
Invoice invoice = (Invoice) o;
return getId() != null && Objects.equals(getId(), invoice.getId());
}
Invoice that = (Invoice) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,7 +1,18 @@
package com.ecep.contract.model;
import java.io.Serializable;
import jakarta.persistence.*;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@@ -27,4 +38,22 @@ public class Permission implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "PERMISSION_KEY")
private String key;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Permission that = (Permission) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -48,22 +48,15 @@ public class ProductType implements BasedEntity, IdentityEntity, Serializable {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProductType that = (ProductType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -44,17 +44,16 @@ public class ProductUsage implements BasedEntity, IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProductUsage that = (ProductUsage) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -45,7 +46,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private Company customer;
/**
* 项目名称
*/
@@ -53,7 +53,9 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
private String name;
/**
* 项目代码,{@link #saleType saleType.Code}+{@link #codeYear}+{@link #codeSequenceNumber codeSequenceNumber} 组成
* 项目代码,{@link #saleType
* saleType.Code}+{@link #codeYear}+{@link #codeSequenceNumber
* codeSequenceNumber} 组成
*/
@Column(name = "CODE")
private String code;
@@ -109,7 +111,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProjectIndustry industry;
/**
* 销售类型
*/
@@ -126,7 +127,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProjectType projectType;
/**
* 产品类型
*/
@@ -135,7 +135,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProductType productType;
/**
* 交货签收方式
* Delivery signature method
@@ -229,7 +228,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private int version;
@Override
public String toPrettyString() {
return code + " " + name;
@@ -237,17 +235,16 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Project project = (Project) object;
return getId() != null && Objects.equals(getId(), project.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,9 +1,13 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -27,7 +31,8 @@ import lombok.ToString;
@Entity
@Table(name = "PROJECT_BID")
@ToString
public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
public class ProjectBid implements IdentityEntity, ProjectBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -91,7 +96,6 @@ public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
@Column(name = "NO_STANDARD_CONTRACT_TEXT")
private String noStandardContractText;
/**
* 审核文件
*/
@@ -129,12 +133,24 @@ public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
@Column(name = "AUTHORIZER_DATE")
private LocalDateTime authorizationTime;
/**
* 说明
*/
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectBid projectBid = (ProjectBid) object;
return getId() != null && Objects.equals(getId(), projectBid.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,10 +1,12 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -24,7 +26,8 @@ import lombok.ToString;
@Entity
@Table(name = "PROJECT_COST")
@ToString
public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
public class ProjectCost implements IdentityEntity, ProjectBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -46,7 +49,6 @@ public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
@Column(name = "VER")
private int version;
/**
* 是否标准付款方式
*/
@@ -201,23 +203,21 @@ public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
private String description;
@Column(name = "IMPORT_LOCK")
private boolean importLock;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
ProjectCost that = (ProjectCost) object;
return getId() != null && Objects.equals(getId(), that.getId());
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectCost projectCost = (ProjectCost) object;
return getId() != null && Objects.equals(getId(), projectCost.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,7 @@ import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -138,17 +138,21 @@ public class ProjectCostItem implements IdentityEntity, BasedEntity, Serializabl
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectCostItem that = (ProjectCostItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,8 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ProjectFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,15 +56,7 @@ public class ProjectFile implements IdentityEntity, ProjectBasedEntity, Serializ
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectFile that = (ProjectFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -73,8 +64,6 @@ public class ProjectFile implements IdentityEntity, ProjectBasedEntity, Serializ
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,9 +2,8 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ProjectFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -20,17 +19,21 @@ import lombok.ToString;
public class ProjectFileTypeLocal extends BaseEnumEntity<ProjectFileType> {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectFileTypeLocal that = (ProjectFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.ContractPayWay;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -66,7 +68,6 @@ public class ProjectFundPlan implements IdentityEntity, ProjectBasedEntity {
@Column(name = "PAY_TERM")
private String payTerm;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONTRACT_PAY_PLAN_ID")
private ContractPayPlan contractPayPlan;
@@ -76,4 +77,24 @@ public class ProjectFundPlan implements IdentityEntity, ProjectBasedEntity {
*/
@Column(name = "UPDATE_TIME")
private LocalDateTime updateDate;
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectFundPlan that = (ProjectFundPlan) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -48,17 +48,21 @@ public class ProjectIndustry implements BasedEntity, IdentityEntity, NamedEntity
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectIndustry that = (ProjectIndustry) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,9 +1,12 @@
package com.ecep.contract.model;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -108,4 +111,24 @@ public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity {
@ToString.Exclude
private CompanyCustomerEvaluationFormFile evaluationFile;
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectQuotation that = (ProjectQuotation) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -63,17 +63,21 @@ public class ProjectSaleType implements IdentityEntity, NamedEntity, BasedEntity
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectSaleType that = (ProjectSaleType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

Some files were not shown because too many files have changed in this diff Show More