From 53005e9863a6981678e5eadfe8153d5fe7a0d133 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 08:48:48 +0100 Subject: [PATCH 01/13] add : applcation.proprerties --- src/main/resources/application.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4adf3787..e28535fb 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,9 +8,10 @@ # ~~~~~ db.default.driver = org.postgresql.Driver db.default.ddl = update -db.default.url = jdbc:postgresql://localhost:5432/bdd_live2 +# db.default.url = jdbc:postgresql://localhost:5432/bdd_sophal202410212159 +db.default.url = jdbc:postgresql://localhost:5432/bdd_sophal202411030959 db.default.user = postgres -db.default.password = Ijlv=bB^hSG@PV$,9jkhHzO*74 +db.default.password = root # Application Information # ~~~~~ From 010dbd0b938e99b5d12ee713aad508fccdd785c7 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 08:49:45 +0100 Subject: [PATCH 02/13] add : MachineLocation.xml view and domain --- .../resources/domains/MachineLocation.xml | 17 +++++++++ .../main/resources/views/MachineLocation.xml | 36 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/MachineLocation.xml create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/views/MachineLocation.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/MachineLocation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/MachineLocation.xml new file mode 100644 index 00000000..4f59f033 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/MachineLocation.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/MachineLocation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/MachineLocation.xml new file mode 100644 index 00000000..f2c4a048 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/MachineLocation.xml @@ -0,0 +1,36 @@ + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + +
From f1d1684f41a1f7b0bbd2a0685a8028478d9f1a4e Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 08:54:23 +0100 Subject: [PATCH 03/13] add : OperationType.xml view and domain --- .../main/resources/domains/OperationType.xml | 17 ++++++++++ .../main/resources/views/OperationType.xml | 33 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/views/OperationType.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml new file mode 100644 index 00000000..17da07c0 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/OperationType.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/OperationType.xml new file mode 100644 index 00000000..0743e9c8 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/OperationType.xml @@ -0,0 +1,33 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
From 29c2e8ed133e233172a8fa4b3504ba5b9924ee9a Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 09:03:27 +0100 Subject: [PATCH 04/13] add : Machine.xml view and domain --- .../src/main/resources/domains/Machine.xml | 17 ++++++ .../src/main/resources/views/Machine.xml | 59 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Machine.xml create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Machine.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Machine.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Machine.xml new file mode 100644 index 00000000..cc9e2034 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Machine.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Machine.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Machine.xml new file mode 100644 index 00000000..50ca8252 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Machine.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + self.typeSelect = 1 or self.typeSelect = 2 + + + + + + + + + + + +
From 2fe62251fc3711bb2b617581b76528ed3fd64fdc Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 10:10:11 +0100 Subject: [PATCH 05/13] add : Selects.xml --- .../src/main/resources/views/Selects.xml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml new file mode 100644 index 00000000..36d2802f --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Selects.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 10ae69e34a20ade400dbd76321464711da1658f2 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 10:11:18 +0100 Subject: [PATCH 06/13] add : Sequence.xml --- .../src/main/resources/domains/Sequence.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Sequence.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Sequence.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Sequence.xml new file mode 100644 index 00000000..fb566721 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Sequence.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + \ No newline at end of file From 7b6d04818e941041e055177993e0c0f9baa7aa19 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 13:50:12 +0100 Subject: [PATCH 07/13] add : build.gradle --- .../axelor-open-suite/axelor-qvm/build.gradle | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/build.gradle diff --git a/modules/axelor-open-suite/axelor-qvm/build.gradle b/modules/axelor-open-suite/axelor-qvm/build.gradle new file mode 100644 index 00000000..de806117 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/build.gradle @@ -0,0 +1,19 @@ +apply plugin: "com.axelor.app-module" + +apply from: "../version.gradle" + +apply { + version = openSuiteVersion +} + +axelor { + title "Axelor QVM" + description "Axelor QVM" +} + +dependencies { + compile project(":modules:axelor-production") + compile project(":modules:axelor-base") +} + + From dd203b7937b8bc5f74ef52bdc2b727964cae6772 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 13:50:29 +0100 Subject: [PATCH 08/13] add : QvmModule.java --- .../com.axelor/apps.qvm/module/QvmModule.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/module/QvmModule.java diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/module/QvmModule.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/module/QvmModule.java new file mode 100644 index 00000000..eebdf0b9 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/module/QvmModule.java @@ -0,0 +1,30 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2019 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.qvm.module; + +import com.axelor.app.AxelorModule; +import com.axelor.apps.qvm.service.OperationService; +import com.axelor.apps.qvm.service.OperationServiceImpl; + +public class QvmModule extends AxelorModule { + + @Override + protected void configure() { + bind(OperationService.class).to(OperationServiceImpl.class); + } +} From 500926bd3767014e0f6597459b7dbded1e91451d Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 13:51:11 +0100 Subject: [PATCH 09/13] add : OperationService.java --- .../apps.qvm/service/OperationService.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationService.java diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationService.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationService.java new file mode 100644 index 00000000..e3e85259 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationService.java @@ -0,0 +1,38 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2019 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.qvm.service; + +import com.axelor.apps.base.db.Company; +import com.axelor.apps.qvm.db.Operation; +import com.axelor.exception.AxelorException; +import com.google.inject.persist.Transactional; + +public interface OperationService { + + @Transactional + public Operation createCalibrationSeq(Company company) throws AxelorException; + + @Transactional + public Operation createQualificationSeq(Company company) throws AxelorException; + + @Transactional + public Operation createOperationSeq(Company company) throws AxelorException; + + @Transactional + public Operation setMachine(Operation operation) throws AxelorException; +} From bd80c2132a42ab5a5acb4fc1fe1f54255d9a5637 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 13:51:46 +0100 Subject: [PATCH 10/13] add : OperationServiceImpljava --- .../service/OperationServiceImpl.java | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationServiceImpl.java diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationServiceImpl.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationServiceImpl.java new file mode 100644 index 00000000..0541d6fe --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/service/OperationServiceImpl.java @@ -0,0 +1,107 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2019 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.qvm.service; + +import com.axelor.apps.base.db.Company; +import com.axelor.apps.base.db.repo.SequenceRepository; +import com.axelor.apps.base.service.administration.SequenceService; +import com.axelor.apps.qvm.db.Operation; +import com.axelor.exception.AxelorException; +import com.axelor.exception.db.repo.TraceBackRepository; +import com.axelor.i18n.I18n; +import com.google.inject.Inject; +import com.google.inject.persist.Transactional; + +public class OperationServiceImpl implements OperationService { + + @Inject + protected SequenceService sequenceService; + + @Transactional + public Operation createCalibrationSeq(Company company) throws AxelorException { + + Operation calibration = new Operation(); + calibration.setSerialNumber(this.getCalibrationSequence(company)); + + return calibration; + } + + @Transactional + public Operation createQualificationSeq(Company company) throws AxelorException { + + Operation qualification = new Operation(); + qualification.setSerialNumber(this.getQualificationSequence(company)); + + return qualification; + } + + @Transactional + public Operation createOperationSeq(Company company) throws AxelorException { + + Operation operation = new Operation(); + operation.setSerialNumber(this.getOperationSequence(company)); + + return operation; + } + + public String getCalibrationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.CALIB_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("IExceptionMessage.PURCHASE_ORDER_1"), + company.getName()); + } + System.out.println("seq before : " + seq); + return seq; + } + + public String getQualificationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.QUAL_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("IExceptionMessage.PURCHASE_ORDER_1"), + company.getName()); + } + System.out.println("seq before : " + seq); + return seq; + } + + public String getOperationSequence(Company company) throws AxelorException { + String seq = sequenceService.getSequenceNumber(SequenceRepository.OP_SEQ, company); + if (seq == null) { + throw new AxelorException( + company, + TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, + I18n.get("IExceptionMessage.PURCHASE_ORDER_1"), + company.getName()); + } + System.out.println("seq before : " + seq); + return seq; + } + + public Operation setMachine(Operation calibration) throws AxelorException { + if (calibration.getMachineName() != null) { + System.out.println("calibration.getMachineName : " + calibration.getMachineName()); + } + return calibration; + } +} From 25dea452f177add2a3aed7553e0d9bbfd4e65692 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 13:53:22 +0100 Subject: [PATCH 11/13] add : QvmOperationController.java --- .../apps.qvm/web/QvmOperationController.java | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java new file mode 100644 index 00000000..dd75f2c5 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/java/com.axelor/apps.qvm/web/QvmOperationController.java @@ -0,0 +1,103 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2019 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package com.axelor.apps.qvm.web; + +import com.axelor.apps.qvm.db.Operation; +import com.axelor.apps.qvm.service.OperationService; +import com.axelor.apps.qvm.service.OperationServiceImpl; +import com.axelor.exception.AxelorException; +import com.axelor.exception.service.TraceBackService; +import com.axelor.inject.Beans; +import com.axelor.rpc.ActionRequest; +import com.axelor.rpc.ActionResponse; +import com.google.inject.Singleton; +import java.lang.invoke.MethodHandles; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class QvmOperationController { + + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + public void setSequenceOperation(ActionRequest request, ActionResponse response) { + try { + Operation calibration = request.getContext().asType(Operation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(OperationService.class) + .createOperationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setSequenceCalibration(ActionRequest request, ActionResponse response) { + try { + Operation calibration = request.getContext().asType(Operation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(OperationService.class) + .createCalibrationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setSequenceQualification(ActionRequest request, ActionResponse response) { + try { + Operation calibration = request.getContext().asType(Operation.class); + + if (calibration != null && calibration.getCompany() != null) { + response.setValue( + "serialNumber", + Beans.get(OperationService.class) + .createQualificationSeq(calibration.getCompany()) + .getSerialNumber()); + } else { + System.out.println("Operation or company est null"); + System.out.println("Operation : " + calibration); + System.out.println("Company : " + calibration.getCompany()); + } + } catch (Exception e) { + TraceBackService.trace(response, e); + } + } + + public void setMachineInfo(ActionRequest request, ActionResponse response) + throws AxelorException { + Operation calibration = request.getContext().asType(Operation.class); + Operation newOperation = Beans.get(OperationService.class).setMachine(calibration); + // response.setValue(calibration,newOperation); + } +} From dfd72bbc21a6ea1c03177a5bfcfe019a30308592 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 16:27:51 +0100 Subject: [PATCH 12/13] update : OperationType.xml --- .../src/main/resources/domains/OperationType.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml index 17da07c0..dbfd1530 100644 --- a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/OperationType.xml @@ -6,7 +6,13 @@ - + + + + From e879429c8700d777dd15a0401baf717ab1777d35 Mon Sep 17 00:00:00 2001 From: "zakaria.hachem" Date: Tue, 5 Nov 2024 16:28:13 +0100 Subject: [PATCH 13/13] add : operation.xml --- .../src/main/resources/domains/Operation.xml | 65 ++++ .../src/main/resources/views/Operation.xml | 354 ++++++++++++++++++ 2 files changed, 419 insertions(+) create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Operation.xml create mode 100644 modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Operation.xml diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Operation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Operation.xml new file mode 100644 index 00000000..91d2433d --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/domains/Operation.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Operation.xml b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Operation.xml new file mode 100644 index 00000000..ac598546 --- /dev/null +++ b/modules/axelor-open-suite/axelor-qvm/src/main/resources/views/Operation.xml @@ -0,0 +1,354 @@ + + + +
+ +