From def1eb8623e1444164ae4bce9179d011a89b8c5e Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期二, 03 十二月 2024 09:15:27 +0800
Subject: [PATCH] 现场对接批量更新
---
JiuMuMesParent/JsonFile/PlcFlipSlice.json | 148 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/CommunicationProtocol.java | 8
JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java | 38
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/PrimitiveTaskService.java | 21
JiuMuMesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterObject.java | 44
JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original | 0
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCRotate.java | 155 +
JiuMuMesParent/common/servicebase/pom.xml | 5
JiuMuMesParent/gateway/target/classes/application.yml | 2
JiuMuMesParent/moduleService/DeviceInteractionModule/pom.xml | 5
UI-Project/src/views/MechanicalArm/mechanicalArm2.vue | 321 ++
UI-Project/src/views/SilkScreen/SilkScreen.vue | 19
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/LineConfigurationServiceImpl.java | 14
JiuMuMesParent/JsonFile/PlcMarking.json | 318 ++
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml | 16
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectCleaning.java | 74
JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java | 53
JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java | 19
UI-Project/package.json | 6
UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue | 31
JiuMuMesParent/JsonFile/PlcEdging.json | 190 +
UI-Project/src/views/Marking/marking.vue | 27
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java | 164 +
JiuMuMesParent/JsonFile/PlcLoad.json | 134
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/tcpIp.java | 81
UI-Project/src/views/Rotate/rotate.vue | 427 ++
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7object.java | 7
JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml | 16
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/PrimitiveTask.java | 87
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/ProjectServiceImpl.java | 80
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/KBBTJPDrawingBP.java | 165 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java | 214 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java | 31
JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java | 200 +
JiuMuMesParent/JsonFile/PlcRotate.json | 169 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/mapper/KBBTJPDrawingBPMapper.java | 19
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java | 78
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java | 164 +
JiuMuMesParent/common/springsecurity/src/main/resources/application-prod.yml | 6
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java | 211 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java | 21
JiuMuMesParent/JsonFile/PlcSilkScreen.json | 183 +
JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original | 0
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingServiceImpl.java | 397 ++
JiuMuMesParent/JsonFile/PlcCleaning.json | 22
UI-Project/src/router/index.js | 87
JiuMuMesParent/common/springsecurity/src/main/resources/application-dev.yml | 6
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/AddTask.java | 61
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/KBBTJPDrawingBPServiceImpl.java | 154 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/LineConfiguration.java | 5
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java | 84
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/TaskingService.java | 72
UI-Project/src/views/ManualReporting/manualReporting.vue | 408 ++
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java | 159 +
UI-Project/src/assets/自动丝印机.png | 0
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java | 71
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java | 313 ++
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/DeviceInteractionModuleApplication.java | 4
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java | 144 +
UI-Project/src/views/FlipSlice/flipSlice.vue | 245 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/LineConfigurationService.java | 3
JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java | 24
UI-Project/src/utils/headerTB.vue | 7
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/KBBTJPDrawingBPService.java | 58
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst | 1
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst | 39
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/ProjectService.java | 14
JiuMuMesParent/common/springsecurity/src/main/resources/application-loc.yml | 2
UI-Project/config.js | 8
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java | 139
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Machine.java | 10
UI-Project/src/lang/zh.js | 10
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst | 123
UI-Project/src/utils/constants.js | 4
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst | 1
UI-Project/src/views/MechanicalArm/mechanicalArm.vue | 533 ++-
UI-Project/src/views/Edging/edging.vue | 451 +-
/dev/null | 84
UI-Project/src/assets/翻片台.png | 0
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCLoad.java | 198 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/SilkScreenTask.java | 246 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java | 75
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Tasking.java | 43
JiuMuMesParent/gateway/src/main/resources/application.yml | 2
JiuMuMesParent/common/servicebase/src/main/java/com/mes/utils/HexUtil.java | 53
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java | 143 +
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/PrimitiveTaskServiceImpl.java | 94
UI-Project/src/assets/磨边机.png | 0
88 files changed, 7,575 insertions(+), 993 deletions(-)
diff --git a/JiuMuMesParent/JsonFile/PlcCacheGlass.json b/JiuMuMesParent/JsonFile/PlcCacheGlass.json
deleted file mode 100644
index 01969b7..0000000
--- a/JiuMuMesParent/JsonFile/PlcCacheGlass.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "plcAddressBegin":"DB11.0",
- "plcAddressLenght":"80",
- "dataType":"word",
- "parameteInfor":[
- {
- "codeId": "A06_request_word",
- "addressIndex":"0",
- "addressLenght":"2",
- "ratio":"1",
- "unit":"m/min"
- },
- {
- "codeId": "A05_scanning_ID",
- "addressIndex":"2",
- "addressLenght":"30",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "Current_slot",
- "addressIndex":"36",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "MES_confirmation_word",
- "addressIndex":"38",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "A08_glass_status",
- "addressIndex":"68",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "A10_glass_status",
- "addressIndex":"70",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "A09_prohibit_film_production",
- "addressIndex":"72",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- }
- ,
- {
- "codeId": "A10_prohibit_film_production",
- "addressIndex":"74",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- }
- ]
-}
diff --git a/JiuMuMesParent/JsonFile/PlcCacheVerticalGlass.json b/JiuMuMesParent/JsonFile/PlcCacheVerticalGlass.json
deleted file mode 100644
index 10e8e33..0000000
--- a/JiuMuMesParent/JsonFile/PlcCacheVerticalGlass.json
+++ /dev/null
@@ -1,377 +0,0 @@
-{
- "plcAddressBegin": "DB14.0",
- "plcAddressLenght": "938",
- "dataType": "word",
- "parameteInfor": [{
- "codeId": "D01ID",
- "addressIndex": "0",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D02ID",
- "addressIndex": "32",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID1",
- "addressIndex": "64",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID2",
- "addressIndex": "96",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID3",
- "addressIndex": "128",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID4",
- "addressIndex": "160",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID5",
- "addressIndex": "192",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ID6",
- "addressIndex": "224",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D04ID",
- "addressIndex": "256",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID1",
- "addressIndex": "288",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID2",
- "addressIndex": "328",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID3",
- "addressIndex": "352",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID4",
- "addressIndex": "384",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID5",
- "addressIndex": "416",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ID6",
- "addressIndex": "448",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID1",
- "addressIndex": "480",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID2",
- "addressIndex": "512",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID3",
- "addressIndex": "544",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID4",
- "addressIndex": "576",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID5",
- "addressIndex": "608",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01ID6",
- "addressIndex": "640",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID1",
- "addressIndex": "672",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID2",
- "addressIndex": "704",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID3",
- "addressIndex": "736",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID4",
- "addressIndex": "768",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID5",
- "addressIndex": "800",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02ID6",
- "addressIndex": "832",
- "addressLenght": "32",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03ToMES",
- "addressIndex": "874",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05ToMES",
- "addressIndex": "876",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D01ToMES",
- "addressIndex": "878",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D04ToMES",
- "addressIndex": "880",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "MESToD03",
- "addressIndex": "888",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "MESToD05",
- "addressIndex": "890",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "MESToPLC",
- "addressIndex": "892",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport1",
- "addressIndex": "914",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport2",
- "addressIndex": "916",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport3",
- "addressIndex": "918",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport4",
- "addressIndex": "920",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport5",
- "addressIndex": "922",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "StartAddToImport6",
- "addressIndex": "924",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport1",
- "addressIndex": "926",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport2",
- "addressIndex": "928",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport3",
- "addressIndex": "930",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport4",
- "addressIndex": "932",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport5",
- "addressIndex": "934",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "TargetAddToImport6",
- "addressIndex": "936",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "deviceState",
- "addressIndex": "864",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E01State",
- "addressIndex": "866",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "E02State",
- "addressIndex": "868",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D03State",
- "addressIndex": "870",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "D05State",
- "addressIndex": "872",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "MESToD01",
- "addressIndex": "894",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- },
- {
- "codeId": "MESToD04",
- "addressIndex": "896",
- "addressLenght": "2",
- "ratio": "1",
- "unit": ""
- }
- ]
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/JsonFile/PlcCleaning.json b/JiuMuMesParent/JsonFile/PlcCleaning.json
new file mode 100644
index 0000000..da2a580
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcCleaning.json
@@ -0,0 +1,22 @@
+{
+ "plcAddressBegin":"DB1.8000",
+ "plcAddressLenght":"84",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "edgSpeed",
+ "addressIndex": "48",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "thinness",
+ "addressIndex": "50",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ }
+
+ ]
+}
diff --git a/JiuMuMesParent/JsonFile/PlcEdging.json b/JiuMuMesParent/JsonFile/PlcEdging.json
new file mode 100644
index 0000000..41bf3e5
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcEdging.json
@@ -0,0 +1,190 @@
+{
+ "plcAddressBegin":"0000",
+ "plcAddressLength":"50",
+ "requestHead":"000100000006010300000032",
+ "parameterInfo":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "0",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "2",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "10",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "12",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport2",
+ "addressIndex": "16",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID2",
+ "addressIndex": "18",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "20",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendID",
+ "addressIndex": "22",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "length",
+ "addressIndex": "24",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "width",
+ "addressIndex": "26",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "thickness",
+ "addressIndex": "28",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm",
+ "addressIndex": "38",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirmID",
+ "addressIndex": "40",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm2",
+ "addressIndex": "46",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirmID2",
+ "addressIndex": "48",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmStatus",
+ "addressIndex": "58",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord1",
+ "addressIndex": "60",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord2",
+ "addressIndex": "62",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord3",
+ "addressIndex": "64",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "machineStatusWord",
+ "addressIndex": "68",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut2",
+ "addressIndex": "70",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut3",
+ "addressIndex": "72",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut4",
+ "addressIndex": "74",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut5",
+ "addressIndex": "76",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut6",
+ "addressIndex": "78",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut7",
+ "addressIndex": "80",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ }
+ ]
+
+}
diff --git a/JiuMuMesParent/JsonFile/PlcFlipSlice.json b/JiuMuMesParent/JsonFile/PlcFlipSlice.json
new file mode 100644
index 0000000..036eb1f
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcFlipSlice.json
@@ -0,0 +1,148 @@
+{
+ "plcAddressBegin":"DB100.0",
+ "plcAddressLenght":"568",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "0",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "2",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestType",
+ "addressIndex": "258",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby20",
+ "addressIndex": "260",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby21",
+ "addressIndex": "262",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "264",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "266",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby25",
+ "addressIndex": "268",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby26",
+ "addressIndex": "270",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby27",
+ "addressIndex": "272",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "274",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendID",
+ "addressIndex": "276",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "length",
+ "addressIndex": "532",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "width",
+ "addressIndex": "534",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "thickness",
+ "addressIndex": "536",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby28",
+ "addressIndex": "538",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendType",
+ "addressIndex": "540",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby30",
+ "addressIndex": "542",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby31",
+ "addressIndex": "544",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby32",
+ "addressIndex": "546",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ }
+
+ ]
+}
diff --git a/JiuMuMesParent/JsonFile/PlcLoad.json b/JiuMuMesParent/JsonFile/PlcLoad.json
new file mode 100644
index 0000000..9b7feb1
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcLoad.json
@@ -0,0 +1,134 @@
+{
+ "plcAddressBegin":"0000",
+ "plcAddressLength":"50",
+ "requestHead":"000100000006010300000032",
+ "parameterInfo":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "2",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "4",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "10",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "12",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "20",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendCount",
+ "addressIndex": "22",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm",
+ "addressIndex": "40",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmStatus",
+ "addressIndex": "62",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord1",
+ "addressIndex": "64",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord2",
+ "addressIndex": "66",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord3",
+ "addressIndex": "68",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "machineStatusWord",
+ "addressIndex": "70",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut2",
+ "addressIndex": "72",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut3",
+ "addressIndex": "74",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut4",
+ "addressIndex": "76",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut5",
+ "addressIndex": "78",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut6",
+ "addressIndex": "80",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut7",
+ "addressIndex": "82",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ }
+ ]
+
+}
diff --git a/JiuMuMesParent/JsonFile/PlcLoadGlass.json b/JiuMuMesParent/JsonFile/PlcLoadGlass.json
deleted file mode 100644
index 9b0432b..0000000
--- a/JiuMuMesParent/JsonFile/PlcLoadGlass.json
+++ /dev/null
@@ -1,78 +0,0 @@
-{
- "plcAddressBegin":"DB1.2000",
- "plcAddressLenght":"100",
- "dataType":"word",
- "parameteInfor":[
- {
- "codeId": "loadRequest",
- "addressIndex":"0",
- "addressLenght":"2",
- "ratio":"1",
- "unit":"m/min"
- },
- {
- "codeId": "PlcStatus",
- "addressIndex":"10",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "MesToPlc",
- "addressIndex":"20",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "InkageStatus",
- "addressIndex":"22",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "WorkId",
- "addressIndex":"24",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "GlassWidth",
- "addressIndex":"26",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "GlassHeight",
- "addressIndex":"28",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- }
- ,
- {
- "codeId": "MesToPlcStatus",
- "addressIndex":"40",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "MesToPlcStatusId",
- "addressIndex":"42",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- },
- {
- "codeId": "MesTaskStatus",
- "addressIndex":"56",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
- }
- ]
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/JsonFile/PlcMarking.json b/JiuMuMesParent/JsonFile/PlcMarking.json
new file mode 100644
index 0000000..1645ce4
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcMarking.json
@@ -0,0 +1,318 @@
+{
+ "plcAddressBegin":"DB14.0",
+ "plcAddressLenght":"1096",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "0",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "2",
+ "addressLenght": "4",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby19",
+ "addressIndex": "6",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby20",
+ "addressIndex": "8",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby21",
+ "addressIndex": "10",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "12",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "14",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby25",
+ "addressIndex": "18",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby26",
+ "addressIndex": "20",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "22",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "24",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+
+ {
+ "codeId": "mesSendID",
+ "addressIndex": "26",
+ "addressLenght": "4",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "drawingMark",
+ "addressIndex": "30",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "drawingMark2",
+ "addressIndex": "258",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "drawingMark3",
+ "addressIndex": "542",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "drawingMark4",
+ "addressIndex": "798",
+ "addressLenght": "236",
+ "ratio": "1",
+ "unit": ""
+ },
+
+ {
+ "codeId": "isMark",
+ "addressIndex": "1034",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "width(OutOfService)",
+ "addressIndex": "1036",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "length(OutOfService)",
+ "addressIndex": "1038",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "thickness(OutOfService)",
+ "addressIndex": "1040",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "sumCount(OutOfService)",
+ "addressIndex": "1042",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby34",
+ "addressIndex": "1044",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "markingMode",
+ "addressIndex": "1046",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby36",
+ "addressIndex": "1048",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm",
+ "addressIndex": "1050",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirmID",
+ "addressIndex": "1052",
+ "addressLenght": "4",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby39",
+ "addressIndex": "1056",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby40",
+ "addressIndex": "1058",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby41",
+ "addressIndex": "1060",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby42",
+ "addressIndex": "1062",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby43",
+ "addressIndex": "1064",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby44",
+ "addressIndex": "1066",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "MesTaskStatus",
+ "addressIndex": "1068",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby46",
+ "addressIndex": "1070",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmStatus",
+ "addressIndex": "1072",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord1",
+ "addressIndex": "1074",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord2",
+ "addressIndex": "1076",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord3",
+ "addressIndex": "1078",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord4",
+ "addressIndex": "1080",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "machineStatusWord",
+ "addressIndex": "1082",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut2",
+ "addressIndex": "1084",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut3",
+ "addressIndex": "1086",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut4",
+ "addressIndex": "1088",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut5",
+ "addressIndex": "1090",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ }
+
+ ]
+}
diff --git a/JiuMuMesParent/JsonFile/PlcRotate.json b/JiuMuMesParent/JsonFile/PlcRotate.json
new file mode 100644
index 0000000..19d1be1
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcRotate.json
@@ -0,0 +1,169 @@
+{
+ "plcAddressBegin":"DB100.0",
+ "plcAddressLenght":"554",
+ "dataType":"word",
+ "parameteInfor":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "0",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "2",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestType",
+ "addressIndex": "258",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby20",
+ "addressIndex": "260",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby21",
+ "addressIndex": "262",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "264",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "266",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby25",
+ "addressIndex": "268",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby26",
+ "addressIndex": "270",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby27",
+ "addressIndex": "272",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "274",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendID",
+ "addressIndex": "276",
+ "addressLenght": "256",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "length",
+ "addressIndex": "532",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "width",
+ "addressIndex": "534",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "thickness",
+ "addressIndex": "536",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "rotateType",
+ "addressIndex": "538",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendType",
+ "addressIndex": "540",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby30",
+ "addressIndex": "542",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby31",
+ "addressIndex": "544",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby32",
+ "addressIndex": "546",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm",
+ "addressIndex": "548",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirmID",
+ "addressIndex": "550",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ },
+ {
+ "codeId": "standby35",
+ "addressIndex": "552",
+ "addressLenght": "2",
+ "ratio": "1",
+ "unit": ""
+ }
+
+ ]
+}
diff --git a/JiuMuMesParent/JsonFile/PlcSilkScreen.json b/JiuMuMesParent/JsonFile/PlcSilkScreen.json
new file mode 100644
index 0000000..8c0bd10
--- /dev/null
+++ b/JiuMuMesParent/JsonFile/PlcSilkScreen.json
@@ -0,0 +1,183 @@
+{
+ "plcAddressBegin":"0000",
+ "plcAddressLength":"40",
+ "requestHead":"000100000006010300000028",
+ "parameterInfo":[
+ {
+ "codeId": "plcRequest",
+ "addressIndex": "0",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcRequestID",
+ "addressIndex": "2",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReport",
+ "addressIndex": "10",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "plcReportID",
+ "addressIndex": "12",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSend",
+ "addressIndex": "20",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesSendID",
+ "addressIndex": "22",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "length",
+ "addressIndex": "24",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "width",
+ "addressIndex": "26",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "thickness",
+ "addressIndex": "28",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "X",
+ "addressIndex": "30",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "Y",
+ "addressIndex": "32",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "isSilkScreen",
+ "addressIndex": "34",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirm",
+ "addressIndex": "40",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "mesConfirmID",
+ "addressIndex": "42",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmStatus",
+ "addressIndex": "60",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord1",
+ "addressIndex": "62",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord2",
+ "addressIndex": "64",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "alarmWord3",
+ "addressIndex": "66",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "machineStatusWord",
+ "addressIndex": "68",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut2",
+ "addressIndex": "70",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut3",
+ "addressIndex": "72",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut4",
+ "addressIndex": "74",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut5",
+ "addressIndex": "76",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut6",
+ "addressIndex": "78",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ },
+ {
+ "codeId": "inputOrOut7",
+ "addressIndex": "80",
+ "addressLength": "2",
+ "type": "word",
+ "unit": ""
+ }
+ ]
+
+}
diff --git a/JiuMuMesParent/JsonFile/PlcdownGlass.json b/JiuMuMesParent/JsonFile/PlcdownGlass.json
deleted file mode 100644
index 979dc66..0000000
--- a/JiuMuMesParent/JsonFile/PlcdownGlass.json
+++ /dev/null
@@ -1,144 +0,0 @@
-{
- "plcAddressBegin": "DB11.0",
- "plcAddressLenght": "100",
- "dataType": "word",
- "parameteInfor": [
-
- {
- "codeId": "requestWord",
- "addressIndex": "0",
- "addressLenght": "2"
- },
- {
- "codeId": "requestID",
- "addressIndex": "2",
- "addressLenght": "30"
- },
- {
- "codeId": "currentCell",
- "addressIndex": "32",
- "addressLenght": "2"
- },
- {
- "codeId": "glassStatus08",
- "addressIndex": "36",
- "addressLenght": "2"
- },
- {
- "codeId": "G06_glass_status",
- "addressIndex": "40",
- "addressLenght": "2"
- },
- {
- "codeId": "G11_glass_status",
- "addressIndex": "42",
- "addressLenght": "2"
- },
- {
- "codeId": "G13_glass_status",
- "addressIndex": "44",
- "addressLenght": "2"
- },
- {
- "codeId": "G04_error_status",
- "addressIndex": "48",
- "addressLenght": "2"
- },
- {
- "codeId": "G05_error_status",
- "addressIndex": "50",
- "addressLenght": "2"
- },
- {
- "codeId": "G06_error_status",
- "addressIndex": "52",
- "addressLenght": "2"
- },
- {
- "codeId": "robot_error_status",
- "addressIndex": "54",
- "addressLenght": "2"
- },
- {
- "codeId": "G08_error_status",
- "addressIndex": "56",
- "addressLenght": "2"
- },
- {
- "codeId": "G09_error_status",
- "addressIndex": "58",
- "addressLenght": "2"
- },
- {
- "codeId": "G10_error_status",
- "addressIndex": "60",
- "addressLenght": "2"
- },
- {
- "codeId": "G11_error_status",
- "addressIndex": "62",
- "addressLenght": "2"
- },
- {
- "codeId": "robot_error_status",
- "addressIndex": "64",
- "addressLenght": "2"
- },
- {
- "codeId": "G13_error_status",
- "addressIndex": "66",
- "addressLenght": "2"
- },
- {
- "codeId": "confirmationWord",
- "addressIndex": "72",
- "addressLenght": "2"
- },
- {
- "codeId": "G06_prohibit_film_production",
- "addressIndex": "74",
- "addressLenght": "2"
- },
- {
- "codeId": "G11_prohibit_film_production",
- "addressIndex": "76",
- "addressLenght": "2"
- },
- {
- "codeId": "G13_prohibit_film_production",
- "addressIndex": "78",
- "addressLenght": "2"
- },
- {
- "codeId": "Glass_width",
- "addressIndex": "82",
- "addressLenght": "4"
- },
- {
- "codeId": "Glass_height",
- "addressIndex": "86",
- "addressLenght": "4"
- },
- {
- "codeId": "Glass_thickness",
- "addressIndex": "90",
- "addressLenght": "4"
- },
- {
- "codeId": "Start_cell",
- "addressIndex": "94",
- "addressLenght": "2"
- },
- {
- "codeId": "End_cell",
- "addressIndex": "96",
- "addressLenght": "2"
- },
- {
- "codeId": "task_type",
- "addressIndex": "98",
- "addressLenght": "2"
- }
-
- ]
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/common/servicebase/pom.xml b/JiuMuMesParent/common/servicebase/pom.xml
index 4f1f015..f82a579 100644
--- a/JiuMuMesParent/common/servicebase/pom.xml
+++ b/JiuMuMesParent/common/servicebase/pom.xml
@@ -22,6 +22,11 @@
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
</dependency>
+ <dependency>
+ <groupId>com.github.s7connector</groupId>
+ <artifactId>s7connector</artifactId>
+ <version>2.1</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterObject.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterObject.java
index e8bfd42..f3a78f2 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterObject.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/device/PlcParameterObject.java
@@ -1,20 +1,24 @@
package com.mes.device;
+import com.github.s7connector.impl.serializer.converter.StringConverter;
import com.github.xingshuangs.iot.utils.IntegerUtil;
import com.github.xingshuangs.iot.utils.ShortUtil;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import lombok.extern.slf4j.Slf4j;
import java.lang.reflect.Array;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.*;
+@Slf4j
public class PlcParameterObject {
// 璇ユā鍧楁暟鎹被鍨嬶紝鏁版嵁璧峰浣嶇疆
private String plcAddressBegin;
// 鏁版嵁鍦板潃闀垮害锛氱涓�鍙傛暟鍒版渶鍚庝竴涓弬鏁扮殑闀垮害
private int plcAddressLength;
- //private ArrayList<PlcParameterInfo> plcParameterList;
private LinkedHashMap<String,PlcParameterInfo> plcParameterMap;
@@ -61,7 +65,7 @@
*/
public PlcParameterInfo getPlcParameter(String codeid) {
if (plcParameterMap != null) {
- return plcParameterMap.get(codeid);
+ return plcParameterMap.get(codeid);
} else {
return null;
}
@@ -163,40 +167,16 @@
plcParameterInfo.setValue(String.valueOf(ShortUtil.toUInt16(valueList)));
} else if (plcParameterInfo.getAddressLength() == 4) {
plcParameterInfo.setValue(String.valueOf(IntegerUtil.toUInt32(valueList)));
- }
- else if (plcParameterInfo.getAddressLength() >10) {
- plcParameterInfo.setValue((byteToHexString(valueList)));
- } else {
+ }else if(plcParameterInfo.getAddressLength()==256){
+ StringConverter converter = new StringConverter();
+ String s="";
+ String extract1 = converter.extract(s.getClass(),valueList, 0, 0);
+ plcParameterInfo.setValue(extract1);
+ }else {
plcParameterInfo.setValue((byteToHexString(valueList)));
}
}
}
-/* if (plcParameterList != null) {
-
- for (PlcParameterInfo plcParameterInfo : plcParameterList) {
-
- byte[] valueList = new byte[plcParameterInfo.getAddressLength()];
-
-// System.out.println(plcParameterInfo.getAddressLength());
-
- for (int i = 0; i < plcParameterInfo.getAddressLength(); i++) {
- Array.setByte(valueList, i, plcValueArray[plcParameterInfo.getAddressIndex() + i]);
-
- }
-
- if (plcParameterInfo.getAddressLength() == 2) {
- plcParameterInfo.setValue(String.valueOf(byte2short(valueList)));
- } else if (plcParameterInfo.getAddressLength() == 4) {
- plcParameterInfo.setValue(String.valueOf(byte2int(valueList)));
- }
- else if (plcParameterInfo.getAddressLength() >10) {
- plcParameterInfo.setValue((byteToHexString(valueList)));
- } else {
- String valuestr = new String(valueList);
- plcParameterInfo.setValue(valuestr);
- }
- }
- }*/
}
/**
* 鎶婂啓鍏ュ�艰浆鍖栦负byte[]
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
index 36430e7..0d053ca 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/ModbusTcp.java
@@ -2,6 +2,7 @@
import com.mes.tools.HexConversion;
import com.mes.utils.HexUtil;
+import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -17,6 +18,8 @@
import java.util.LinkedHashMap;
import java.util.Map;
+import static com.mes.tools.HexConversion.*;
+
@Component
@Slf4j
public class ModbusTcp {
@@ -27,73 +30,173 @@
private int Port;
public Socket socket =null;//閫氳
- ModbusTcp(){}
- public ModbusTcp(String Ip,int Port){
+ public String fileName ="";
+ public ModbusTcp(){}
+ public ModbusTcp(String Ip,int Port,String fileName){
this.Ip=Ip;
this.Port=Port;
+ this.fileName=fileName;
try {
- socket=new Socket(Ip,Port);
- }catch (UnknownHostException e) {
- throw new RuntimeException(e);
- } catch (IOException e) {
- throw new RuntimeException(e);
+ plcAgreement.put(this.fileName,new PlcAgreement(this.fileName));
+ } catch (Exception e) {
+ log.info("file error锛�"+this.fileName+",{}",e.getMessage());
}
}
//杩炴帴
- //@Scheduled(fixedDelay = 1000)
- public void a()throws Exception{
- //read();
- log.info("123");
+ public void connect(){
+ try {
+ this.socket=new Socket(Ip,Port);
+ this.socket.setSoTimeout(2000);
+ }catch (Exception e) {
+ log.info("The IP address of the host cannot be determined:{}",e.getMessage());
+ }
+ }
+ //鍏抽棴杩炴帴
+ public void close(){
+ try {
+ this.socket.close();
+ }catch (Exception e) {
+ //log.info("杩炴帴鍏抽棴寮傚父:{}",e.getMessage());
+ }
+ }
+ //杩斿洖杩炴帴鐘舵��
+ public boolean isConnect(){
+ try {
+ this.socket.isConnected();
+ }catch (Exception e) {
+ log.info("Connection status exception:{}",this.socket);
+ }
+ return false;
}
//璇诲彇鏁版嵁
- public void read(PlcAgreement plcAgreement)throws Exception{
- int bufSizes = 0;
- byte[] msgs = new byte[2048];
- //鍐欏叆璇诲彇鍦板潃
- DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
- outToServer.write(HexConversion.stringToInt(plcAgreement.requestHead));
- outToServer.flush();
- //璇诲彇鍐呭
- DataInputStream in = new DataInputStream(socket.getInputStream());
- bufSizes = in.read(msgs);
- String message = HexConversion.byteToHexString(bufSizes, msgs);//鍗佽繘鍒跺瓧鑺傛暟缁勮浆鍗佸叚杩涘埗瀛楃涓�
- //鑾峰彇鍙傛暟鍊�
- Map<String, PlcParameter> plcParameters=plcAgreement.getPlcParameters();
- for (String key:plcParameters.keySet()){
- PlcParameter plcParameter=plcParameters.get(key);
- if("bit".equals(plcParameter.getType())){
- byte font=msgs[plcParameter.getAddressStart()];
- String[] fontBitString=String.format("%8s", Integer.toBinaryString((int)font)).replace(" ", "0").split("");
- byte[] bit=new byte[1];
- bit[0]=Byte.parseByte(fontBitString[plcParameter.getAddressLength()]);
- plcParameter.setReadByte(bit);
- }else{
- plcParameter.setReadByte(Arrays.copyOfRange(msgs,plcParameter.getAddressStart(),(plcParameter.getAddressStart()+plcParameter.getAddressLength())));
+ public boolean read(PlcAgreement plcAgreement){
+ try {
+ if (!this.socket.isConnected()){
+ // log.info("閫氳杩炴帴澶辫触:{}",this.socket.isConnected());
+ return false;
}
+ int bufSizes = 0;
+ byte[] msgs = new byte[2048];
+ byte[] content = new byte[2048];
+ //鍐欏叆璇诲彇鍦板潃
+ DataOutputStream outToServer = new DataOutputStream(this.socket.getOutputStream());
+ outToServer.write(HexConversion.stringToInt(plcAgreement.requestHead));
+ outToServer.flush();
+ //璇诲彇鍐呭
+ DataInputStream in = new DataInputStream(this.socket.getInputStream());
+ bufSizes = in.read(msgs);
+ if(bufSizes<plcAgreement.plcAddressLength+9){
+ log.info("Read byte length <1:{},content锛歿}",bufSizes,msgs);
+ return false;
+ }
+ content=Arrays.copyOfRange(msgs,9,2048);
+ //鑾峰彇鍙傛暟鍊�
+ Map<String, PlcParameter> plcParameters=plcAgreement.getPlcParameters();
+ for (String key:plcParameters.keySet()){
+ PlcParameter plcParameter=plcParameters.get(key);
+ if("bit".equals(plcParameter.getType())){
+ byte font=content[plcParameter.getAddressStart()];
+ String[] fontBitString=String.format("%8s", Integer.toBinaryString((int)font)).replace(" ", "0").split("");
+ byte[] bit=new byte[1];
+ bit[0]=Byte.parseByte(fontBitString[plcParameter.getAddressLength()]);
+ plcParameter.setReadByte(bit);
+ }else{
+ plcParameter.setReadByte(Arrays.copyOfRange(content,plcParameter.getAddressStart(),(plcParameter.getAddressStart()+plcParameter.getAddressLength())));
+ }
+ }
+ return true;
+ }catch (Exception e) {
+ //log.info("璇诲彇寮傚父:{}",plcAgreement);
}
+ return false;
}
//鍐欏叆鏁版嵁
public void write(PlcParameter plcParameter){
try {
if (plcParameter.getWriteValue() != null && !"".equals(plcParameter.getWriteValue())) {
- //鍐欏叆鍙戦�佹暟鎹�
- DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- out.write(HexConversion.stringToInt(plcParameter.getWriteValue().toString()));
+ //鍐欏叆鍙戦�佹暟鎹� 0000 0000 0009 0110 0024 0001 02 0006
+ byte []sendByte=new byte[13+plcParameter.getAddressLength()];
+ byte []sendLength=intToBytesDesc(7+plcParameter.getAddressLength(),2);
+ byte []sendAddress=intToBytesDesc(plcParameter.getAddressStart()/2,2);
+ byte []sendFontLength=intToBytesDesc(plcParameter.getAddressLength()/2,2);
+ byte []sendContent=plcParameter.getWriteByte();
+ //byte []sendContent=intToBytesDesc(Integer.parseInt(plcParameter.getWriteValue().toString()),plcParameter.getAddressLength());
+ sendByte[4]=sendLength[0];
+ sendByte[5]=sendLength[1];
+ sendByte[6]=(byte)1;
+ sendByte[7]=(byte)16;
+ sendByte[8]=sendAddress[0];
+ sendByte[9]=sendAddress[1];
+ sendByte[10]=sendFontLength[0];
+ sendByte[11]=sendFontLength[1];
+ sendByte[12]=(byte)plcParameter.getAddressLength();
+ for(int i=0;i<sendContent.length;i++){
+ sendByte[i+13]=sendContent[i];
+ }
+ log.info("sendByte:{}",sendByte);
+ DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());
+ out.write(sendByte);
out.flush();
+ //log.info("sendByte:{}",sendByte);
+
}
} catch (IOException e) {
- log.info("鍐欏叆鏁版嵁寮傚父");
+ log.info("鍐欏叆鏁版嵁寮傚父:{}",plcParameter);
throw new RuntimeException(e);
}
}
+ //鏁版嵁澶勭悊
+ public void handleData(PlcParameter plcParameter){
+ //鍐欏叆鍙戦�佹暟鎹� 0000 0000 0009 0110 0024 0001 02 0006
+ try {
+ int sendLength=plcParameter.getAddressLength()+7;//鍙戦�侀暱搴�
+ byte [] addressLength=intToBytesDesc(plcParameter.getAddressLength(),1);//瀛楄妭闀垮害
+ byte [] addressLengthFont=intToBytesDesc((plcParameter.getAddressLength()/2),2);//瀛楅暱搴�
+ byte start[]=intToBytesDesc(plcParameter.getAddressStart()/2,2);//璧峰鍦板潃
+ byte content[]=intToBytesDesc(Integer.valueOf(plcParameter.getWriteValue().toString()) ,2);//璧峰鍦板潃
+ if (sendLength>14&&
+ addressLength.length>0&&
+ addressLengthFont.length>1&&
+ start.length>1&&
+ content.length>1){
+ byte head[]=new byte[]{0,0,0,(byte)sendLength,1,16,start[0],start[1],addressLengthFont[0],addressLengthFont[1],addressLength[0],content[0],content[1]};
+ this.write(head);
+ }else{
+ log.info("鍙戦�佸唴瀹逛笉绗﹀悎锛� 瀛楄妭闀垮害 {},瀛楅暱搴︼細{},璧峰鍦板潃,{},鍐呭:{}",addressLength,addressLengthFont,start,content);
+ }
+ } catch (Exception e) {
+ log.info("鏁版嵁澶勭悊寮傚父锛� 鍐呭 {}",plcParameter);
+ }
+ }
//鍐欏叆鏁版嵁
- public void write(String key,String writeValue)throws Exception{
- if (writeValue != null && !"".equals(writeValue)) {
- //鍐欏叆鍙戦�佹暟鎹�
- DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- out.write(HexConversion.stringToInt(writeValue));
- out.flush();
+ public void write(byte []sendByte){
+ try {
+ if (sendByte != null) {
+ //鍐欏叆鍙戦�佹暟鎹�
+ DataOutputStream out = new DataOutputStream(this.socket.getOutputStream());
+ out.write(sendByte);
+ out.flush();
+ log.info("鍐欏叆鎴愬姛锛� 鍐呭 {}",sendByte);
+ }
+ } catch (Exception e) {
+ log.info("鍐欏叆澶辫触锛� 鍐呭 {}",sendByte);
+ }
+ }
+ //鍐欏叆鏁版嵁String
+ public void writeString(String sendString,String startAddress){
+ try {
+ String result=message(sendString,startAddress);
+ if (result != null && !"".equals(result)) {
+ //鍐欏叆鏁版嵁
+ DataOutputStream out = new DataOutputStream(socket.getOutputStream());
+ out.write(HexUtil.stringToInt(result));
+ out.flush();
+ log.info("鍐欏叆鎴愬姛锛氬湴鍧� {},鍐呭 {},瀛楄妭锛歿}",startAddress,sendString,HexUtil.stringToInt(result));
+ //this.close();
+ }
+ } catch (Exception e) {
+ log.info("鍐欏叆寮傚父锛氬湴鍧� {},鍐呭 {}",startAddress,sendString);
}
}
//鍐�
@@ -108,4 +211,13 @@
public PlcAgreement getPlcAgreement(String key){
return plcAgreement.get(key);
}
+
+ public void consoleLogInfo(PlcAgreement thisPlcAgreement){
+ String logInfo=this.fileName+" ";
+ Map<String,PlcParameter> plcParameterMap=thisPlcAgreement.getPlcParameters();
+ for (String key:plcParameterMap.keySet()) {
+ logInfo+=key+":"+plcParameterMap.get(key).getValueString()+",";
+ }
+ log.info(logInfo);
+ }
}
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
index 978d6d2..52ec63b 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcAgreement.java
@@ -24,7 +24,7 @@
/**
* 鍗忚鍙傛暟
*/
- private List<String> parameterKeys=null;
+ private List<String> parameterKeys=new ArrayList<>();
private Map<String,PlcParameter> parameters=null;
/**
* 鍗忚璺緞
@@ -40,11 +40,12 @@
public int plcAddressLength=0;
//绫讳技搴忓垪鍙凤紙4锛�+鍗忚鏍囧織锛�4锛�+闀垮害锛�4锛�+浠庣珯鍦板潃锛�2锛�+鍔熻兘浠g爜锛�2锛�+璧峰鍦板潃锛�4锛�+璇诲彇鏁伴噺锛�4锛� "000100000006010300000032"
public String requestHead=null;
-
- PlcAgreement(){
- jsonFilePath = System.getProperty("user.dir") + "../../JsonFile/PlcCacheGlass.json";
+ private PlcAgreement(){}
+ PlcAgreement(String fileName){
+ //jsonFilePath = "D:/mes/JsonFile/"+fileName+".json";
+ jsonFilePath = System.getProperty("user.dir") + "/JsonFile/"+fileName+".json";
boolean initSuccess=initword();
- log.info("鍒濆鍖朠lcCacheGlass锛�"+initSuccess);
+ //log.info("鍒濆鍖朠lcCacheGlass锛�"+initSuccess);
}
//鍒濆鍖杦ord
public boolean initword() {
@@ -63,20 +64,20 @@
fileReader.close();
JSONObject jsonFile = new JSONObject(content.toString());
-
+ //log.info("璇诲彇鍐呭锛歿}",jsonFile);
JSONArray jsonArray = jsonFile.getJSONArray("parameterInfo");
-
this.plcAddressBegin=jsonFile.getStr("plcAddressBegin");//璁剧疆璧峰浣嶅湴鍧�
this.plcAddressLength=Integer.valueOf(jsonFile.getStr("plcAddressLength"));//璁剧疆鍦板潃闀垮害
this.requestHead=jsonFile.getStr("requestHead");//璁剧疆璇锋眰澶撮儴
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject parameterObj = jsonArray.getJSONObject(i);
- String code = parameterObj.getStr("code");
+ String code = parameterObj.getStr("codeId");
PlcParameter plcParameter = new PlcParameter(
code,
Integer.valueOf(parameterObj.getStr("addressIndex")),
- Integer.valueOf(parameterObj.getStr("addressLength")),""); //鍙傛暟瀹炰緥
+ Integer.valueOf(parameterObj.getStr("addressLength")),
+ parameterObj.getStr("type")); //鍙傛暟瀹炰緥
parameterKeys.add(code);
parameters.put(code,plcParameter);
}
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
index 02f483a..7445a1c 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/service/PlcParameter.java
@@ -13,6 +13,8 @@
import java.util.HashMap;
import java.util.Map;
+import static com.mes.tools.HexConversion.*;
+
/**
* Plc鍙傛暟
*/
@@ -51,6 +53,11 @@
* 闇�瑕佸啓鍏ョ殑鍊�
*/
private Object writeValue=null;
+
+ /**
+ * 闇�瑕佸啓鍏ョ殑鍊�
+ */
+ private byte[] writeByte=null;
PlcParameter(){
@@ -95,7 +102,18 @@
}
public Object getReadValue() {
+
return readValue;
+ }
+ public String getValueString() {
+ return getValueInt()+"";
+ }
+ public int getValueInt() {
+ if(this.readByte==null||this.readByte.length<1){
+ //log.info("璇诲彇鍐呭涓簄ull: {} :{}",this.getCodeId(),this.readByte);
+ return 0;
+ }
+ return bytesToIntDesc(this.readByte,0);
}
public void setReadValue(Object readValue) {
@@ -114,7 +132,23 @@
return writeValue;
}
- public void setWriteValue(Object writeValue) {
- this.writeValue = writeValue;
+ public byte [] setWriteValue(Object writeValue) {
+ //浼犲叆鍊兼牴鎹弬鏁扮被鍨嬭繘琛岃浆鎹㈡垚瀛楃涓蹭繚瀛樿繘鍐欏叆 瀛楄妭鍐呭苟涓旇繑鍥�
+ byte []sendByte=new byte[13+this.addressLength];
+ if ("int".equals(this.type)){
+ this.writeByte=intToBytesDesc(Integer.parseInt(writeValue.toString()),this.addressLength);
+ return this.writeByte;
+ }else if ("word".equals(this.type)){
+ this.writeByte=intToBytesDesc(Integer.parseInt(writeValue.toString()),this.addressLength);
+ return this.writeByte;
+ }else if("string".equals(this.type)){
+
+ }else{
+
+ }
+ return null;
+ }
+ public byte [] getWriteByte() {
+ return this.writeByte;
}
}
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
index 4996e62..0979522 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/HexConversion.java
@@ -52,7 +52,35 @@
numberHex = String.format("%2s", numberHex).replace(' ', '0');
return numberHex;
}
-
+ /**
+ * 浠巄yte鏁扮粍涓彇int鏁板�硷紝鏈柟娉曢�傜敤浜�(浣庝綅鍦ㄥ墠锛岄珮浣嶅湪鍚�)鐨勯『搴忥紝鍜屽拰intToBytes()閰嶅浣跨敤
+ *
+ * @param src: byte鏁扮粍
+ * @param offset: 浠庢暟缁勭殑绗琽ffset浣嶅紑濮�
+ * @return int鏁板��
+ */
+ public static int bytesToIntDesc(byte[] src, int offset) {
+ int value=0;
+ int length = src.length;
+ for(int i=0;i<length;i++){
+ value+=(int)((src[offset+i]&0xFF)<<(length-i-1)*8);
+ }
+ return value;
+ }
+ /**
+ * 灏唅nt鏁板�艰浆鎹负鍗爏ize涓瓧鑺傜殑byte鏁扮粍锛屾湰鏂规硶閫傜敤浜�(浣庝綅鍦ㄥ墠锛岄珮浣嶅湪鍚�)鐨勯『搴忋�� 鍜宐ytesToInt锛堬級閰嶅浣跨敤
+ * @param value
+ * 瑕佽浆鎹㈢殑int鍊�
+ * @return byte鏁扮粍
+ */
+ public static byte[] intToBytesDesc( int value,int size )
+ {
+ byte[] src = new byte[size];
+ for(int i=0;i<size;i++){
+ src[i] = (byte) ((value>>(size-i-1)*8) & 0xFF);
+ }
+ return src;
+ }
/**
* 浠巄yte鏁扮粍涓彇int鏁板�硷紝鏈柟娉曢�傜敤浜�(浣庝綅鍦ㄥ墠锛岄珮浣嶅湪鍚�)鐨勯『搴忥紝鍜屽拰intToBytes()閰嶅浣跨敤
*
@@ -61,11 +89,24 @@
* @return int鏁板��
*/
public static int bytesToInt(byte[] src, int offset) {
- int value;
- value = (int) ((src[offset] & 0xFF)
- | ((src[offset+1] & 0xFF)<<8)
- | ((src[offset+2] & 0xFF)<<16)
- | ((src[offset+3] & 0xFF)<<24));
+ int value=0;
+ for(int i=0;i<src.length;i++){
+ value+=(int)((src[offset+i]&0xFF)<<i*8);
+ }
return value;
}
+ /**
+ * 灏唅nt鏁板�艰浆鎹负鍗爏ize涓瓧鑺傜殑byte鏁扮粍锛屾湰鏂规硶閫傜敤浜�(浣庝綅鍦ㄥ墠锛岄珮浣嶅湪鍚�)鐨勯『搴忋�� 鍜宐ytesToInt锛堬級閰嶅浣跨敤
+ * @param value
+ * 瑕佽浆鎹㈢殑int鍊�
+ * @return byte鏁扮粍
+ */
+ public static byte[] intToBytes( int value,int size )
+ {
+ byte[] src = new byte[size];
+ for(int i=0;i<src.length;i++){
+ src[i] = (byte) ((value>>i*8) & 0xFF);
+ }
+ return src;
+ }
}
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java
index 45bf01e..8385a74 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java
@@ -1,9 +1,11 @@
package com.mes.tools;
+import com.github.s7connector.api.DaveArea;
import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
import com.github.xingshuangs.iot.protocol.s7.service.MultiAddressWrite;
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
+import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
@@ -462,4 +464,26 @@
}
return addresslist;
}
+
+ public void writeString(String addr,String data) {
+ s7PLC.writeString(addr,data);
+ }
+
+ public void writeUInt16(String addr,int data) {
+ s7PLC.writeUInt16(addr,data);
+ }
+
+ public void writeUInt32(String addr,int data) {
+ s7PLC.writeUInt32(addr,data);
+ }
+
+ public void writeStringy(String addr,String value) {
+ byte[] bytes = value.getBytes();
+ s7PLC.writeByte(addr,bytes);
+ }
+
+ public String readStrings(String addr) {
+ return s7PLC.readString(addr);
+ }
+
}
diff --git a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/utils/HexUtil.java b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/utils/HexUtil.java
index 861aaa7..d6854c9 100644
--- a/JiuMuMesParent/common/servicebase/src/main/java/com/mes/utils/HexUtil.java
+++ b/JiuMuMesParent/common/servicebase/src/main/java/com/mes/utils/HexUtil.java
@@ -262,59 +262,6 @@
return String.format("%4s", HexString).replace(' ', '0');
}
- public static void main(String[] args) {
-// System.out.println(HexUtil.hexToAscii("3c5354413e48656c6c6f20576f726c64217c5468697320697320746865206669727374207369676e616c2066726f6d20646576696365213c454f463e"));
-// System.out.println(HexUtil.asciiToHex("<STA>Hello World!|This is the first signal from device!<EOF>"));
-//
-// System.out.println(String.format("%4S", HexUtil.intToHex(55)).replace(' ', '0'));
-// System.out.println(HexUtil.hexToInt("00d2"));
-//
-// System.out.println(HexUtil.formatHex("3c5354413e"));
- String message = "Hello World!|This is the first signal from device!";
- int length = message.length() * 2 + 10; // 闀垮害鍖呮嫭缁撳熬鐨�<EOF>锛屼竴涓瓧绗﹀湪淇″彿涓敱涓や釜瀛楄妭琛ㄧず銆�
-
- String command = HexUtil.asciiToHex("<STA>"); // 娣诲姞寮�濮嬫爣璇�
-
- command += (String.format("%4s", HexUtil.intToHex(length)).replace(' ', '0')); // 娣诲姞闀垮害鏍囪瘑
- command += "01"; // 娣诲姞璁惧绫诲瀷 0x01琛ㄧず鍒囧壊鏈猴紝0x02琛ㄧず閽㈠寲鐐�
- command += "0001"; // 娣诲姞璁惧鍨嬪彿锛�0x0001琛ㄧず鍩烘湰娆撅紝0x0002琛ㄧず涓骇娆�
- command += "0000"; // 鍔熻兘鍙凤紝0x0000鏄笅浣嶆満涓诲姩鍙戠粰涓婁綅鏈猴紱0x0001鏄笂浣嶆満淇敼涓嬩綅鏈篟TC
- command += "00"; // 鍔犲瘑鏂瑰紡锛�0x00琛ㄧず涓嶅姞瀵�
-
- Calendar c = Calendar.getInstance();
-
- // 娣诲姞鏃堕棿锛屽苟灏嗘椂闂磋浆鎹负16杩涘埗琛ㄧず
- command += (String.format("%4s", HexUtil.intToHex(c.get(Calendar.YEAR))).replace(' ', '0'));
- command += (String.format("%2s", HexUtil.intToHex(c.get(Calendar.MONTH) + 1)).replace(' ', '0'));
- command += (String.format("%2s", HexUtil.intToHex(c.get(Calendar.DAY_OF_MONTH))).replace(' ', '0'));
- command += (String.format("%2s", HexUtil.intToHex(c.get(Calendar.HOUR_OF_DAY))).replace(' ', '0'));
- command += (String.format("%2s", HexUtil.intToHex(c.get(Calendar.MINUTE))).replace(' ', '0'));
- command += (String.format("%2s", HexUtil.intToHex(c.get(Calendar.SECOND))).replace(' ', '0'));
-
- command += ("00000001"); // 鍞竴鏍囪瘑锛屼娇鐢ㄥ簭鍒楀彿
-
- command += (HexUtil.asciiToHex(message)); // 娣诲姞涓昏淇℃伅鍐呭
-
- command += (HexUtil.asciiToHex("<EOF>")); // 娣诲姞缁撳熬鏍囪瘑
-
- System.out.println(command);
-
- System.out.println(String.format("%4s", "1"));
-
- Date time = new Date();
- System.out.println(new SimpleDateFormat("yyyy-MM-dd-hh-mm-ss").format(time));
-
- String timeHex = timeToHex(time);
- System.out.println(timeHex);
- System.out.println(hexToTime(timeHex));
-
- System.out.println("3c5354413e001a00000000000000000000000000010007e0021500152800000000000000005041001d017c017c01017c3c454f463e".length());
-
- System.out.println(hexToBinary("0c0a"));
-
- System.out.println(Integer.MAX_VALUE);
- }
-
public static String hexTo2Binary(String hexString) {
String binaryString = Integer.toBinaryString(hexToInt(hexString));
return String.format("%8s", binaryString).replace(' ', '0');
diff --git a/JiuMuMesParent/common/springsecurity/src/main/resources/application-dev.yml b/JiuMuMesParent/common/springsecurity/src/main/resources/application-dev.yml
index a0983dc..475e8ef 100644
--- a/JiuMuMesParent/common/springsecurity/src/main/resources/application-dev.yml
+++ b/JiuMuMesParent/common/springsecurity/src/main/resources/application-dev.yml
@@ -1,15 +1,15 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://10.153.19.150:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
+ url: jdbc:mysql://localhost:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
username: root
password: beibo.123/
cloud:
nacos:
discovery:
- server-addr: 10.153.19.29:8848
+ server-addr: localhost:8848
redis:
database: 0
- host: 10.153.19.150
+ host: localhost
port: 6379
password: 123456
\ No newline at end of file
diff --git a/JiuMuMesParent/common/springsecurity/src/main/resources/application-loc.yml b/JiuMuMesParent/common/springsecurity/src/main/resources/application-loc.yml
index c11587a..618e1eb 100644
--- a/JiuMuMesParent/common/springsecurity/src/main/resources/application-loc.yml
+++ b/JiuMuMesParent/common/springsecurity/src/main/resources/application-loc.yml
@@ -1,7 +1,7 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://192.168.56.10:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
+ url: jdbc:mysql://localhost:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
username: root
password: root
cloud:
diff --git a/JiuMuMesParent/common/springsecurity/src/main/resources/application-prod.yml b/JiuMuMesParent/common/springsecurity/src/main/resources/application-prod.yml
index a0983dc..475e8ef 100644
--- a/JiuMuMesParent/common/springsecurity/src/main/resources/application-prod.yml
+++ b/JiuMuMesParent/common/springsecurity/src/main/resources/application-prod.yml
@@ -1,15 +1,15 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
- url: jdbc:mysql://10.153.19.150:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
+ url: jdbc:mysql://localhost:3306/jiumumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false
username: root
password: beibo.123/
cloud:
nacos:
discovery:
- server-addr: 10.153.19.29:8848
+ server-addr: localhost:8848
redis:
database: 0
- host: 10.153.19.150
+ host: localhost
port: 6379
password: 123456
\ No newline at end of file
diff --git a/JiuMuMesParent/gateway/src/main/resources/application.yml b/JiuMuMesParent/gateway/src/main/resources/application.yml
index 91aaa47..a266061 100644
--- a/JiuMuMesParent/gateway/src/main/resources/application.yml
+++ b/JiuMuMesParent/gateway/src/main/resources/application.yml
@@ -6,7 +6,7 @@
cloud:
nacos:
discovery:
- server-addr: 10.153.19.44:8848
+ server-addr: localhost:8848
gateway:
discovery:
locator:
diff --git a/JiuMuMesParent/gateway/target/classes/application.yml b/JiuMuMesParent/gateway/target/classes/application.yml
index 91aaa47..a266061 100644
--- a/JiuMuMesParent/gateway/target/classes/application.yml
+++ b/JiuMuMesParent/gateway/target/classes/application.yml
@@ -6,7 +6,7 @@
cloud:
nacos:
discovery:
- server-addr: 10.153.19.44:8848
+ server-addr: localhost:8848
gateway:
discovery:
locator:
diff --git a/JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original b/JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original
index 20e5ec2..e8c6184 100644
--- a/JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original
+++ b/JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original
Binary files differ
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/pom.xml b/JiuMuMesParent/moduleService/DeviceInteractionModule/pom.xml
index 0b7faee..9490883 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/pom.xml
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/pom.xml
@@ -23,6 +23,11 @@
<artifactId>jcifs</artifactId>
<version>1.2.19</version>
</dependency>
+ <dependency>
+ <groupId>com.github.s7connector</groupId>
+ <artifactId>s7connector</artifactId>
+ <version>2.1</version>
+ </dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.yulichang</groupId>-->
<!-- <artifactId>mybatis-plus-join-boot-starter</artifactId>-->
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java
index cf13a3b..daddad3 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java
@@ -1,23 +1,44 @@
package com.mes;
-import com.mes.common.S7object;
+import com.mes.common.*;
+import com.mes.job.PLCLoad;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.LineConfigurationService;
+import com.mes.md.service.PrimitiveTaskService;
+import com.mes.md.service.TaskingService;
+import com.mes.plcTaskThread.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
+
@Slf4j
@Component
@Order(1)
public class AppRunnerConfig implements ApplicationRunner {
-
+ @Resource
+ TaskingMapper taskingMapper;
+ @Resource
+ MachineMapper machineMapper;
+ @Resource
+ TaskingService taskingService;
+ @Resource
+ PrimitiveTaskService primitiveTaskService;
+ @Resource
+ LineConfigurationService lineConfigurationService;
@Override
public void run(ApplicationArguments args) throws Exception {
// TODO Auto-generated method stub
- log.info("鍚姩瀹屾垚");
- S7object.getinstance().start();
-
+// new MachineLoad(taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
+// new MachineEdging(taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
+// new MachineFlipSlice(machineMapper,taskingService).start();
+// new MachineMarking(machineMapper,taskingService).start();
+// new MachineSilkScreen(machineMapper,taskingService).start();
+// new MachineRotate(machineMapper,taskingService).start();
}
}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/DeviceInteractionModuleApplication.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/DeviceInteractionModuleApplication.java
index fd11c13..a8d8cf3 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/DeviceInteractionModuleApplication.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/DeviceInteractionModuleApplication.java
@@ -5,6 +5,7 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@@ -15,12 +16,13 @@
*/
@Slf4j
@SpringBootApplication
+
@MapperScan("com.mes.*.mapper")
@EnableDiscoveryClient
@EnableSwagger2
@EnableScheduling
+@EnableAsync
public class DeviceInteractionModuleApplication {
-
public static void main(String[] args) {
try {
SpringApplication.run(DeviceInteractionModuleApplication.class, args);
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/CommunicationProtocol.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/CommunicationProtocol.java
new file mode 100644
index 0000000..922d261
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/CommunicationProtocol.java
@@ -0,0 +1,8 @@
+package com.mes.common;
+
+import com.mes.service.ModbusTcp;
+
+public enum CommunicationProtocol {
+ S7control(),
+ ModbusTcp,
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7object.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7object.java
index ee8c2e7..19752c4 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7object.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7object.java
@@ -13,8 +13,8 @@
*/
public class S7object extends Thread {
public S7control plccontrol; // PLC閫氳绫诲疄渚�
- private EPlcType plcType = EPlcType.S1200; // 瑗块棬瀛怭LC绫诲瀷
- private String ip = "192.168.10.11"; // plc ip鍦板潃
+ private EPlcType plcType = EPlcType.S1500; // 瑗块棬瀛怭LC绫诲瀷
+ private String ip = "172.17.125.130"; // plc ip鍦板潃
private int port = 102; // plc 绔彛鍙�
@@ -26,7 +26,6 @@
plccontrol = new S7control(plcType, ip, port, 0, 0);
String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheGlass.json";
// String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
- System.out.println("Load Glass File: " + PlcLoadGlass);
PlcMesObject = InitUtil.initword(PlcLoadGlass);
}
}
@@ -48,11 +47,9 @@
while (this != null) {
try {
Thread.sleep(100);
-
} catch (InterruptedException e) {
e.printStackTrace();
}
-
byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength());
if (getplcvlues != null) {
PlcMesObject.setPlcParameterList(getplcvlues);
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectCleaning.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectCleaning.java
new file mode 100644
index 0000000..cfb5ba2
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectCleaning.java
@@ -0,0 +1,74 @@
+package com.mes.common;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.device.PlcParameterObject;
+import com.mes.tools.InitUtil;
+import com.mes.tools.S7control;
+
+
+/**
+ * @Author : yanzhixin
+ * @Date: 2024/4/9 15:13
+ * @Description:
+ */
+public class S7objectCleaning extends Thread {
+ public S7control plccontrol; // PLC閫氳绫诲疄渚�
+ private EPlcType plcType = EPlcType.S200_SMART; // 瑗块棬瀛怭LC绫诲瀷
+ private String ip = "200.200.200.193"; // plc ip鍦板潃
+ private int port = 102; // plc 绔彛鍙�
+
+
+ public PlcParameterObject PlcMesObject;
+ private static volatile S7objectCleaning instance = null;
+
+ private S7objectCleaning() {
+ if (plccontrol == null) {
+ plccontrol = new S7control(plcType, ip, port, 0, 0);
+ String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCleaning.json";
+// String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
+ System.out.println("Load Glass File: " + PlcLoadGlass);
+ PlcMesObject = InitUtil.initword(PlcLoadGlass);
+ }
+ }
+
+ // 鍗曚緥妯″紡 鑾峰彇绫荤殑鍞竴瀹炰緥
+ public static S7objectCleaning getinstance() {
+ if (instance == null) {
+ synchronized (S7objectCleaning.class) {
+ if (instance == null) {
+ instance = new S7objectCleaning();
+ }
+ }
+ }
+ return instance;
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ byte[] resultValues=new byte[PlcMesObject.getPlcAddressLength()];
+ int maxRead=1092;
+ int size=PlcMesObject.getPlcAddressLength()%maxRead==0?
+ (PlcMesObject.getPlcAddressLength()/maxRead):
+ (PlcMesObject.getPlcAddressLength()/maxRead+1);
+ for (int i = 0; i <size ; i++) {
+ int begin=i*maxRead;
+ int length=(i==size-1?PlcMesObject.getPlcAddressLength()-begin:maxRead);
+ //String s=PlcMesObject.getPlcAddressBegin().substring(PlcMesObject.getPlcAddressBegin().indexOf(".")+1);
+ int defaultStart=Integer.valueOf(PlcMesObject.getPlcAddressBegin().substring(PlcMesObject.getPlcAddressBegin().indexOf(".")+1));
+
+ String beginAddress=PlcMesObject.getPlcAddressBegin().substring(0, PlcMesObject.getPlcAddressBegin().indexOf("."))+"."+(begin+defaultStart);
+ byte[] getplcvlues = plccontrol.readByte(beginAddress, length);
+ System.arraycopy(getplcvlues,0,resultValues,begin,length);
+ }
+ if (resultValues != null) {
+ PlcMesObject.setPlcParameterList(resultValues);
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java
new file mode 100644
index 0000000..4333aa8
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java
@@ -0,0 +1,75 @@
+package com.mes.common;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.device.PlcParameterObject;
+import com.mes.tools.InitUtil;
+import com.mes.tools.S7control;
+
+
+/**
+ * @Author : yanzhixin
+ * @Date: 2024/4/9 15:13
+ * @Description:
+ */
+public class S7objectFlipSlice extends Thread {
+ public S7control plccontrol; // PLC閫氳绫诲疄渚�
+ private EPlcType plcType = EPlcType.S1200; // 瑗块棬瀛怭LC绫诲瀷
+ private String ip = "10.36.164.120"; // plc ip鍦板潃
+ private int port = 102; // plc 绔彛鍙�
+
+
+ public PlcParameterObject PlcMesObject;
+ private static volatile S7objectFlipSlice instance = null;
+
+ private S7objectFlipSlice() {
+ if (plccontrol == null) {
+ plccontrol = new S7control(plcType, ip, port, 0, 0);
+ String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcFlipSlice.json";
+// String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
+ System.out.println("Load Glass File: " + PlcLoadGlass);
+ PlcMesObject = InitUtil.initword(PlcLoadGlass);
+ }
+ }
+
+ // 鍗曚緥妯″紡 鑾峰彇绫荤殑鍞竴瀹炰緥
+ public static S7objectFlipSlice getinstance() {
+ if (instance == null) {
+ synchronized (S7objectFlipSlice.class) {
+ if (instance == null) {
+ instance = new S7objectFlipSlice();
+ }
+ }
+ }
+ return instance;
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ byte[] resultValues=new byte[PlcMesObject.getPlcAddressLength()];
+ int maxRead=1092;
+ int size=PlcMesObject.getPlcAddressLength()%maxRead==0?
+ (PlcMesObject.getPlcAddressLength()/maxRead):
+ (PlcMesObject.getPlcAddressLength()/maxRead+1);
+ for (int i = 0; i <size ; i++) {
+ int begin=i*maxRead;
+ int length=(i==size-1?PlcMesObject.getPlcAddressLength()-begin:maxRead);
+ String beginAddress=PlcMesObject.getPlcAddressBegin().substring(0, PlcMesObject.getPlcAddressBegin().indexOf("."))+"."+begin;
+ byte[] getplcvlues = plccontrol.readByte(beginAddress, length);
+ System.arraycopy(getplcvlues,0,resultValues,begin,length);
+ }
+ if (resultValues != null) {
+ PlcMesObject.setPlcParameterList(resultValues);
+ }
+// byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength());
+// if (getplcvlues != null) {
+// PlcMesObject.setPlcParameterList(getplcvlues);
+// }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java
new file mode 100644
index 0000000..139d6f6
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java
@@ -0,0 +1,84 @@
+package com.mes.common;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.service.ModbusTcp;
+import com.mes.tools.InitUtil;
+import com.mes.tools.S7control;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.LinkedHashMap;
+
+
+/**
+ * @Author : yanzhixin
+ * @Date: 2024/4/9 15:13
+ * @Description:
+ */
+@Slf4j
+public class S7objectMachine extends Thread {
+ public S7control plccontrol; // PLC閫氳绫诲疄渚�
+ private EPlcType plcType = EPlcType.S1200; // 瑗块棬瀛怭LC绫诲瀷
+ private String ip = ""; // plc ip鍦板潃
+ private int port = 102; // plc 绔彛鍙�
+ private String plcFileName=""; // json鍚嶇О
+ public PlcParameterObject PlcMesObject;
+ public S7objectMachine(String ip,int port,String plcFileName,EPlcType plcType) {
+ initialize(ip,port,plcFileName,plcType);
+ if (plccontrol == null) {
+ plccontrol = new S7control(this.plcType, this.ip, this.port, 0, 0);
+ //String plcFileUrl = System.getProperty("user.dir") + "D:/HangZhouMes/JsonFile/"+this.plcFileName+".json";
+ String plcFileUrl = "D:/mes/JsonFile/"+this.plcFileName+".json";
+ PlcMesObject = InitUtil.initword(plcFileUrl);
+ }
+ }
+ public void initialize(String ip,int port,String plcFileName,EPlcType plcType){
+ this.ip = ip;
+ this.port = port;
+ this.plcFileName = plcFileName;
+ this.plcType= plcType;
+ }
+
+ /**
+ * 鎵撳嵃鍙傛暟鍊�
+ */
+ public void consoleLogInfo(){
+ String logInfo=this.plcFileName+" ";
+ LinkedHashMap<String, PlcParameterInfo> thisPlcParameterInfo=PlcMesObject.getPlcParameterMap();
+ for (String key:thisPlcParameterInfo.keySet()) {
+ logInfo+=key+":"+thisPlcParameterInfo.get(key).getValue()+",";
+ }
+ log.info(logInfo);
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ try {
+ byte[] resultValues=new byte[PlcMesObject.getPlcAddressLength()];
+ int maxRead=1092;
+ int size=PlcMesObject.getPlcAddressLength()%maxRead==0?
+ (PlcMesObject.getPlcAddressLength()/maxRead):
+ (PlcMesObject.getPlcAddressLength()/maxRead+1);
+ for (int i = 0; i <size ; i++) {
+ int begin=i*maxRead;
+ int length=(i==size-1?PlcMesObject.getPlcAddressLength()-begin:maxRead);
+ String beginAddress=PlcMesObject.getPlcAddressBegin().substring(0, PlcMesObject.getPlcAddressBegin().indexOf("."))+"."+begin;
+ byte[] getplcvlues = plccontrol.readByte(beginAddress, length);
+ System.arraycopy(getplcvlues,0,resultValues,begin,length);
+ }
+ if (resultValues != null) {
+ PlcMesObject.setPlcParameterList(resultValues);
+ }
+ } catch (Exception e) {
+ //log.info("寮傚父:ip:{},port:{}",this.ip,this.port);
+ }
+
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java
new file mode 100644
index 0000000..47b6879
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java
@@ -0,0 +1,78 @@
+package com.mes.common;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.device.PlcParameterObject;
+import com.mes.tools.InitUtil;
+import com.mes.tools.S7control;
+
+import java.util.List;
+
+
+/**
+ * @Author : yanzhixin
+ * @Date: 2024/4/9 15:13
+ * @Description:
+ */
+public class S7objectMarking extends Thread {
+ public S7control plccontrol; // PLC閫氳绫诲疄渚�
+ private EPlcType plcType = EPlcType.S1500; // 瑗块棬瀛怭LC绫诲瀷
+ private String ip = "10.36.164.40"; // plc ip鍦板潃
+ private int port = 102; // plc 绔彛鍙�
+
+
+ public PlcParameterObject PlcMesObject;
+ private static volatile S7objectMarking instance = null;
+
+ private S7objectMarking() {
+ if (plccontrol == null) {
+ plccontrol = new S7control(plcType, ip, port, 0, 0);
+ String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcMarking.json";
+// String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheGlass.json").getPath();
+ System.out.println("Load Glass File: " + PlcLoadGlass);
+ PlcMesObject = InitUtil.initword(PlcLoadGlass);
+ }
+ }
+
+ // 鍗曚緥妯″紡 鑾峰彇绫荤殑鍞竴瀹炰緥
+ public static S7objectMarking getinstance() {
+ if (instance == null) {
+ synchronized (S7objectMarking.class) {
+ if (instance == null) {
+ instance = new S7objectMarking();
+ }
+ }
+ }
+ return instance;
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(100);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ byte[] resultValues=new byte[PlcMesObject.getPlcAddressLength()];
+ int maxRead=1092;
+ int size=PlcMesObject.getPlcAddressLength()%maxRead==0?
+ (PlcMesObject.getPlcAddressLength()/maxRead):
+ (PlcMesObject.getPlcAddressLength()/maxRead+1);
+ for (int i = 0; i <size ; i++) {
+ int begin=i*maxRead;
+ int length=(i==size-1?PlcMesObject.getPlcAddressLength()-begin:maxRead);
+ String beginAddress=PlcMesObject.getPlcAddressBegin().substring(0, PlcMesObject.getPlcAddressBegin().indexOf("."))+"."+begin;
+ byte[] getplcvlues = plccontrol.readByte(beginAddress, length);
+ System.arraycopy(getplcvlues,0,resultValues,begin,length);
+ }
+ if (resultValues != null) {
+ PlcMesObject.setPlcParameterList(resultValues);
+ }
+// byte[] getplcvlues = plccontrol.readByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength());
+// if (getplcvlues != null) {
+// PlcMesObject.setPlcParameterList(getplcvlues);
+// }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/tcpIp.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/tcpIp.java
new file mode 100644
index 0000000..01046c7
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/tcpIp.java
@@ -0,0 +1,81 @@
+package com.mes.common;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+/**
+ * @Author : yanzhxiin
+ * @Date: 2024/8/20 11:19
+ * @Description:
+ */
+@Component
+@Slf4j
+public class tcpIp {
+
+
+ //@Scheduled(fixedDelay = 1000)
+ public void serverTCPSocket() {
+ try {
+ // 鍒涘缓TCP鏈嶅姟鍣ㄥ苟缁戝畾鍒版寚瀹氱鍙�
+ int port = 8888;
+ ServerSocket serverSocket = new ServerSocket(port);
+ System.out.println("鏈嶅姟鍣ㄥ凡鍚姩锛岀瓑寰呭鎴风杩炴帴...");
+ while (true) {
+ // 绛夊緟瀹㈡埛绔繛鎺�
+ Socket clientSocket = serverSocket.accept();
+ System.out.println("瀹㈡埛绔繛鎺ユ垚鍔�");
+ // 鍒涘缓杈撳叆娴佸拰杈撳嚭娴�
+ InputStream inputStream = clientSocket.getInputStream();
+ OutputStream outputStream = clientSocket.getOutputStream();
+ // 璇诲彇瀹㈡埛绔彂閫佺殑鏁版嵁
+ byte[] buffer = new byte[1024];
+ int bytesRead = inputStream.read(buffer);
+ String receivedMessage = new String(buffer, 0, bytesRead);
+ System.out.println("鏀跺埌娑堟伅锛�" + receivedMessage);
+ // 鍙戦�佸搷搴旀暟鎹粰瀹㈡埛绔�
+ String responseMessage = "Hello, Client!";
+ outputStream.write(responseMessage.getBytes());
+ // 鍏抽棴杩炴帴
+ clientSocket.close();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+ //@Scheduled(fixedDelay = 1000)
+ public void clientTCPSocket() {
+ try {
+ // 鍒涘缓TCP瀹㈡埛绔苟杩炴帴鍒版湇鍔″櫒
+ String serverAddress = "192.168.1.8";
+ int serverPort = 2001;
+ Socket clientSocket = new Socket(serverAddress, serverPort);
+ // 鍒涘缓杈撳叆娴佸拰杈撳嚭娴�
+ InputStream inputStream = clientSocket.getInputStream();
+ OutputStream outputStream = clientSocket.getOutputStream();
+ // 鍙戦�佹暟鎹粰鏈嶅姟鍣�
+ String message = "start";
+ outputStream.write(message.getBytes());
+ // 璇诲彇鏈嶅姟鍣ㄥ搷搴旂殑鏁版嵁
+ byte[] buffer = new byte[1024];
+ int bytesRead = inputStream.read(buffer);
+ String receivedMessage = new String(buffer, 0, bytesRead);
+ System.out.println("鏀跺埌鏈嶅姟鍣ㄥ搷搴旓細" + receivedMessage);
+
+ String message2 = "stop";
+ outputStream.write(message2.getBytes());
+ // 鍏抽棴杩炴帴
+ clientSocket.close();
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/AddTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/AddTask.java
new file mode 100644
index 0000000..fefbd4e
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/AddTask.java
@@ -0,0 +1,61 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.mes.md.entity.*;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.*;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.tools.WebSocketServer;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author SNG-010
+ */
+@Component
+@Slf4j
+public class AddTask {
+
+ @Autowired
+ ProjectService projectService;
+
+ @Autowired
+ KBBTJPDrawingBPService kBBTJPDrawingBPService;
+
+ //@Scheduled(fixedDelay = 30000)
+ public void AddTasks() {
+ projectService.insertProjectStandard();
+
+ }
+ //@Scheduled(fixedDelay = 1000)
+ public void notReceive() {
+ JSONObject jsonObject = new JSONObject();
+ List<KBBTJPDrawingBP> list =kBBTJPDrawingBPService.notReceiveKBBTJPDrawingBP();
+ jsonObject.append("content", list);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("notReceiveTask");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java
new file mode 100644
index 0000000..05f160b
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java
@@ -0,0 +1,164 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.common.S7objectFlipSlice;
+import com.mes.common.S7objectMachine;
+import com.mes.common.S7objectMarking;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.GlassInfoMapper;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.TaskingService;
+import com.mes.tools.WebSocketServer;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 鑷姩鎵撴爣鏈�
+ * @Author : yanzhxiin
+ * @Date: 2024/8/20 11:19
+ * @Description:
+ */
+@Component
+@Slf4j
+public class MachineTask {
+
+ public static String engineerId = "";
+
+ @Autowired
+ TaskingMapper taskingMapper;
+ @Autowired
+ MachineMapper machineMapper;
+ @Autowired
+ TaskingService taskingService;
+ @Autowired
+ private GlassInfoMapper glassInfoMapper;
+ public int a =1;
+ public S7objectMachine s7objectMachine;
+
+ //@Scheduled(fixedDelay = 1000)
+ public void plcMachineTask() {
+ Long machineId=12L;
+ Machine machine=machineMapper.selectById(machineId);
+ if (s7objectMachine==null){
+ s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcMarking", EPlcType.S1500);
+ s7objectMachine.start();
+ }
+ PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
+ PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameterInfo isMark =plcParameterObject.getPlcParameter("isMark");//鍙戦�両D銆�0 涓嶆墦鏍囷紝1鏍囧噯妯″紡锛�2瀹氬埗妯″紡銆�
+ PlcParameterInfo drawingMark =plcParameterObject.getPlcParameter("drawingMark");//鎵撴爣鍥剧焊鍦板潃
+ PlcParameterInfo lengthOutOfService =plcParameterObject.getPlcParameter("length(OutOfService)");//闀�
+ PlcParameterInfo widthOutOfService =plcParameterObject.getPlcParameter("width(OutOfService)");//瀹�
+ PlcParameterInfo markingMode =plcParameterObject.getPlcParameter("markingMode");//
+
+ PlcParameterInfo plcReport =plcParameterObject.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameterInfo plcReportID =plcParameterObject.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameterInfo mesConfirm =plcParameterObject.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameterInfo mesConfirmID =plcParameterObject.getPlcParameter("mesConfirmID");//纭ID
+
+ String str=S7objectMarking.getinstance().plccontrol.readString("DB14.30");
+
+ //String width=S7objectMarking.getinstance().plccontrol.readWord(widthOutOfService.getAddress());
+ log.info("plcRequest:{},plcRequestID:{},mesSend:{},mesSendID:{},drawingMark:{}," +
+ "plcReport:{},plcReportID:{},mesConfirm:{},mesConfirmID:{}"
+ ,plcRequest.getValue(),plcRequestID.getValue(),mesSend.getValue(),isMark.getValue(),drawingMark.getValue(),
+ plcReport.getValue(),plcReportID.getValue(),mesConfirm.getValue(),mesConfirmID.getValue());
+ if ("0".equals(plcRequest.getValue())&&"1".equals(mesSend.getValue())) {
+ //鍙戦�佸瓧缃�0
+ log.info("1.鍙戦�佸瓧缃浂,娓呴櫎涓婃鍙戦�佺殑鏁版嵁{},{},{},{},{}"
+ ,markingMode.getValue()
+ ,isMark.getValue()
+ ,lengthOutOfService.getValue()
+ ,widthOutOfService.getValue()
+ ,mesSend.getValue());
+ //S7objectMarking.getinstance().plccontrol.writeString(drawingMark.getAddress(),"");
+ S7objectMarking.getinstance().plccontrol.writeWord(markingMode.getAddress(), 0);
+ S7objectMarking.getinstance().plccontrol.writeWord(lengthOutOfService.getAddress(), 0);
+ S7objectMarking.getinstance().plccontrol.writeWord(widthOutOfService.getAddress(), 0);
+ S7objectMarking.getinstance().plccontrol.writeWord(isMark.getAddress(), 0);
+ S7objectMarking.getinstance().plccontrol.writeWord(mesSend.getAddress(), 0);
+ return;
+ }
+ if ("0".equals(plcReport.getValue())&&"1".equals(mesConfirm.getValue())) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ S7objectMarking.getinstance().plccontrol.writeWord(mesConfirm.getAddress(), 0);
+ return;
+ }
+ if("1".equals(plcReport.getValue())&&"0".equals(mesConfirm.getValue())){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�");
+ if(finishCount>0){//鏈変换鍔�
+ S7objectMarking.getinstance().plccontrol.writeWord(mesConfirm.getAddress(), 1);
+ return;
+ }
+ }
+ if("1".equals(plcRequest.getValue())&&"0".equals(mesSend.getValue())&& !plcRequestID.getValue().isEmpty()&&"寮�宸�".equals(machine.getState())){
+ Tasking tasking;
+ if("0".equals(plcRequestID.getValue())){
+ //鏍囧噯妯″紡
+ tasking=taskingService.startMachineTask(machine);
+ }else{
+ //瀹氬埗妯″紡
+ tasking=taskingService.startMachineTask(machine,plcRequestID.getValue());
+ }
+ //log.info("4銆佸彂閫佷换鍔� 璁惧鐘舵��:{}, 鏁版嵁锛歿},",machine,tasking);
+ if(tasking!=null){
+ //妯″紡锛�1瀹氬埗 0 鎵归噺 鏄惁鎵撴爣锛�0涓嶆墦鏍� 1鎵撴爣
+ int isMark_=tasking.getDrawingMarking()==null?0:1;
+ int isMarkingMode_="瀹氬埗".equals(tasking.getTaskType()) ?1:0;
+ log.info("4銆佸彂閫佹暟鎹�:{},{},{},{},{},{}"
+ ,tasking.getProgramId()
+ ,tasking.getLength().intValue(),tasking.getWidth().intValue(),isMark_,isMarkingMode_,1);
+ if(isMark_==1){
+ S7objectMarking.getinstance().plccontrol.writeString(drawingMark.getAddress(), tasking.getProgramId());
+ }
+ //S7objectMarking.getinstance().plccontrol.writeUInt32 (mesSendID.getAddress(), 2);
+ S7objectMarking.getinstance().plccontrol.writeWord(lengthOutOfService.getAddress(), tasking.getLength().intValue());
+ S7objectMarking.getinstance().plccontrol.writeWord(widthOutOfService.getAddress(), tasking.getWidth().intValue());
+ S7objectMarking.getinstance().plccontrol.writeWord(isMark.getAddress(), isMark_);
+ S7objectMarking.getinstance().plccontrol.writeWord(markingMode.getAddress(), isMarkingMode_);
+ S7objectMarking.getinstance().plccontrol.writeWord(mesSend.getAddress(), 1);
+ return;
+ }
+ }
+ //log.info("鏃犲彲鎵ц鐨勬潯浠�");
+
+ }
+ //@Scheduled(fixedDelay = 1000)
+ public void markingTasks() {
+ JSONObject jsonObject = new JSONObject();
+ Machine machine=machineMapper.selectById(11L);
+ List<Tasking> taskingList=taskingService.findMachineTask(machine);
+ jsonObject.append("taskingList", taskingList);
+ jsonObject.append("machine", machine);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("marking");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java
deleted file mode 100644
index 9029a4b..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MarkingTask.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.GlassInfo;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.entity.WorkTaskDetail;
-import com.mes.md.mapper.GlassInfoMapper;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.mapper.TaskingMapper;
-import com.mes.md.mapper.WorkTaskDetailMapper;
-import com.mes.md.service.TaskingService;
-import com.mes.service.ModbusTcp;
-import com.mes.service.PlcAgreement;
-import com.mes.service.PlcParameter;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.net.Socket;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Author : yanzhxiin
- * @Date: 2024/8/20 11:19
- * @Description:
- */
-@Component
-@Slf4j
-public class MarkingTask {
-
- public static String engineerId = "";
- @Autowired
- TaskingMapper taskingMapper;
- @Autowired
- MachineMapper machineMapper;
- @Autowired
- TaskingService taskingService;
-
-// @Scheduled(fixedDelay = 1000)
- public void plcMarkingTask(Long machineId) {
- Machine machine=machineMapper.selectById(machineId);
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- ModbusTcp modbusTcp =new ModbusTcp(machine.getIp(),machine.getPort());
- PlcAgreement plcAgreement=modbusTcp.getPlcAgreement("DB14.0");
- PlcParameter plcRequest =plcAgreement.getPlcParameter(0);//璇锋眰瀛�
- PlcParameter plcRequestID =plcAgreement.getPlcParameter(1);//璇锋眰ID
- PlcParameter mesSend =plcAgreement.getPlcParameter(10);//鍙戦�佸瓧
- PlcParameter mesSendID =plcAgreement.getPlcParameter(11);//鍙戦�両D
-
- PlcParameter plcReport =plcAgreement.getPlcParameter(0);//姹囨姤瀛�
- PlcParameter plcReportID =plcAgreement.getPlcParameter(1);//姹囨姤ID
- PlcParameter mesConfirm =plcAgreement.getPlcParameter(10);//纭瀛�
- PlcParameter mesConfirmID =plcAgreement.getPlcParameter(11);//纭ID
- plcRequest.getReadValue();
- if ("0".equals(plcRequest.getReadValue())) {
- if ("0".equals(mesSend.getReadValue())) {
- log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓�0锛屼笖鍙戦�佸瓧涓�0锛屼笉鎵ц浠诲姟");
- return;
- }
- log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓�0锛屽皢鍙戦�佸瓧鏀逛负0");
- mesSend.setWriteValue("0");
- modbusTcp.write(mesSend);//鍚慞LC鍙戦��
- return;
- }
- if (!"0".equals(mesSend.getReadValue())) {
- log.info("2銆佽幏鍙栧埌鐨勮姹傚瓧涓嶄负0锛屽皢鍙戦�佸瓧涓嶄负0锛岀洿鎺ョ粨鏉�");
- return;
- }
- if ("1".equals(mesConfirm.getReadValue())&&"0".equals(mesConfirm.getReadValue())) {
- log.info("2銆佹眹鎶ヨ姹傦紝涓旂‘璁ゅ瓧涓�0锛屽畬鎴愭墦鏍囦换鍔�");
- plcReport(mesConfirm,machine);
- }else if ("1".equals(plcRequest.getReadValue())) {
- log.info("2銆佷换鍔¤姹傦紝鎵ц鍙戦�佷换鍔�");
- plcRequest(mesSend,machine);
- }
- }
- public void plcRequest(PlcParameter mesSend, Machine machine) {
- //鏌ユ壘鎵撴爣鏈轰换鍔�
- Tasking tasking=taskingService.startMachineTask(machine);
- if(tasking!=null&&"寮�宸�".equals(machine.getState())){//鏈変换鍔�
- log.info("鍙戦�佷换鍔★細{}",tasking);
- }else{
- log.info("涓嶆弧瓒冲彂閫佹潯浠讹細{}",tasking);
- }
-
- }
- public void plcReport(PlcParameter mesConfirm, Machine machine) {
- //鏌ユ壘鎵撴爣鏈哄伐浣滅殑浠诲姟
- //鏌ユ壘鎵撴爣鏈轰换鍔�
- int finishCount=taskingService.finishMachineTask(machine);
- if(finishCount>0){//鏁版嵁宸叉爣璁板畬鎴�
- log.info("姝e父姹囨姤锛�");
- }else{
- log.info("褰撳墠鏃犲叡宸ヤ綔鐨勪换鍔★紝鏃犳晥姹囨姤瀹屾垚锛�");
- }
- }
- @Scheduled(fixedDelay = 1000)
- public void markingTasks() {
- JSONObject jsonObject = new JSONObject();
- Machine machine=machineMapper.selectById(11L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("marking");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
- }
- }
-
-}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCCleaning.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCCleaning.java
deleted file mode 100644
index 6b141cc..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCCleaning.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCCleaning {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
- //@Scheduled(fixedDelay = 500)
- public void plcRinse() {
- //纾ㄨ竟绾块�熷害
- String edgingSpeed = plcParameterObject.getPlcParameter("edgingSpeed").getValue();
- if(!Objects.equals(edgingSpeed, "")){
- //缁欐竻娲楁満鍣ㄥ彂閫佺(杈规満閫熷害
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("rinseSpeed").getAddress(), Integer.parseInt(edgingSpeed));
- }
-
- }
- @Scheduled(fixedDelay = 1000)
- public void edgingWeb() {
- //鑾峰彇鎶ヨ鐘舵��
- JSONObject jsonObject = new JSONObject();
-// String warning = plcParameterObject.getPlcParameter("rinseWarning").getValue();
-// if (!Objects.equals(warning, "0")) {
-// //log.info("鎶ヨ淇℃伅锛�"+warning);
-// jsonObject.append("rinseWarning", warning);
-// }
- Machine machine=machineMapper.selectById(7L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cleaning");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCEdging.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCEdging.java
deleted file mode 100644
index 5c3f5a7..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCEdging.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCEdging {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
- //@Scheduled(fixedDelay = 500)
- public void PLCEdging() {
- //纾ㄨ竟杩涚墖璇锋眰淇″彿
- String edgingSign = plcParameterObject.getPlcParameter("edgingSign").getValue();
- if (!Objects.equals(edgingSign, "")){
- Tasking glass = new Tasking();
- glass.setWorkState("宸ヤ綔");
- //glass.setCurrentCraft("纾ㄨ竟");
- glass.setState("绾夸笂");
- Tasking tasking =new Tasking();
- //Tasking tasking =taskingService.selectTasking(glass);
- //鍙戦�侀暱瀹藉帤灏哄
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("length").getAddress(), Integer.parseInt(tasking.getLength().toString()));
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("width").getAddress(), Integer.parseInt(tasking.getWidth().toString()));
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("thickness").getAddress(), Integer.parseInt(tasking.getThickness().toString()));
-
- }
- //鎸佺画鑾峰彇閫熷害鍚屾缁欎笅涓�涓満鍣�
- String edgingSpeed = plcParameterObject.getPlcParameter("edgingSpeed").getValue();
- if(!Objects.equals(edgingSpeed, "")){
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("cleaningSpeed").getAddress(), Integer.parseInt(edgingSpeed));
- }
-
- }
- @Scheduled(fixedDelay = 1000)
- public void edgingWeb() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鑾峰彇鎶ヨ鐘舵��
- JSONObject jsonObject = new JSONObject();
-// String warning = plcParameterObject.getPlcParameter("warning").getValue();
-// if (!Objects.equals(warning, "0")) {
-// //log.info("鎶ヨ淇℃伅锛�"+warning);
-// jsonObject.append("warning", warning);
-// }
- Machine machine=machineMapper.selectById(5L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- Machine machineQr=machineMapper.selectById(3L);
- List<Tasking> taskingListQr=taskingService.findMachineTask(machineQr);
- jsonObject.append("taskingListQr",taskingListQr );
- jsonObject.append("machineQR",machineQr );
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("edging");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCFlipSlice.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCFlipSlice.java
deleted file mode 100644
index 9292cc6..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCFlipSlice.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCFlipSlice {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
- //@Scheduled(fixedDelay = 500)
- public void plcTurn() {
- //娓呮礂鏈洪�熷害
- String rinseSpeed = plcParameterObject.getPlcParameter("rinseSpeed").getValue();
- if(!Objects.equals(rinseSpeed, "")){
- //缁欑炕鐗囧彴鍙戦�佺(杈规満閫熷害
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("turnSpeed").getAddress(), Integer.parseInt(rinseSpeed));
- }
-
- }
- @Scheduled(fixedDelay = 1000)
- public void turnWeb() {
- //鑾峰彇鎶ヨ鐘舵��
- JSONObject jsonObject = new JSONObject();
-// String warning = plcParameterObject.getPlcParameter("turnWarning").getValue();
-//
-// if (!Objects.equals(warning, "0")) {
-// //log.info("鎶ヨ淇℃伅锛�"+warning);
-// jsonObject.append("turnWarning", warning);
-// }
- Machine machine=machineMapper.selectById(25L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("flipSlice");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCLoad.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCLoad.java
new file mode 100644
index 0000000..6f24b00
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCLoad.java
@@ -0,0 +1,198 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.mes.md.entity.*;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.PrimitiveTaskMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.*;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.tools.WebSocketServer;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author SNG-010
+ */
+@Component
+@Slf4j
+public class PLCLoad {
+
+ @Autowired
+ TaskingMapper taskingMapper;
+ @Autowired
+ MachineMapper machineMapper;
+ @Autowired
+ TaskingService taskingService;
+ @Autowired
+ ProjectService projectService;
+ @Autowired
+ PrimitiveTaskService primitiveTaskService;
+ @Autowired
+ KBBTJPDrawingBPService kBBTJPDrawingBPService;
+ @Autowired
+ LineConfigurationService lineConfigurationService;
+
+ public static Long machineId1 = 1L;
+ public static Long machineId2 = 2L;
+ public ModbusTcp modbusTcp2 = new ModbusTcp();
+ public List<Map> sendRecords = new ArrayList<>();
+ @Autowired
+ private PrimitiveTaskMapper primitiveTaskMapper;
+
+
+ //@Scheduled(fixedDelay = 1000)
+ public void plcLoad() {
+ Machine machine=machineMapper.selectById(machineId2);
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),"PlcLoad");
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement("PlcLoad");
+ try {
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameter mesSendCount =plcAgreement.getPlcParameter("mesSendCount");//鍙戦�佹暟閲�
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ //鍙戦�佸瓧缃�0
+ String send= HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("1.鍙戦�佸瓧缃浂 鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ //纭瀛楃疆闆�
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("2.纭瀛楃疆闆� 浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+ log.info("鏈烘鎵嬩换鍔″畬鎴� 鍘熷鏁伴噺锛歿} 鏈鏁伴噺:{}", primitiveTask.getReportCount(), plcReportID.getValueInt());
+ if (plcReportID.getValueInt()>0){
+ primitiveTask.setReportCount(primitiveTask.getReportCount()+ plcReportID.getValueInt());
+ primitiveTaskMapper.updateById(primitiveTask);
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/ 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ log.info("3銆佷换鍔″畬鎴�:"+plcReportID.getValueString());
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())){
+ int loadCount=0;
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+// //浠诲姟鏁�>宸蹭笂鏁伴噺
+// List<Tasking> taskingTopList=taskingMapper.selectList(new QueryWrapper<Tasking>().lambda()
+// .eq(Tasking::getScanId,primitiveTask.getScanId())
+// );
+ loadCount=primitiveTask.getTaskQuantity()-primitiveTask.getReportCount();
+ loadCount=(loadCount>0?loadCount:0);
+
+ break;
+ }
+ //loadCount=taskingCount.size();
+ }else{
+ //瀹氬埗妯″紡
+ loadCount=1;
+ }
+ if(loadCount>0){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",loadCount,machine);
+ String send=HexUtil.intTo2ByteHex(1)+ HexUtil.intTo2ByteHex(loadCount);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ modbusTcp1.close();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+"1 "+ loadCount;
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+ modbusTcp1.close();
+ //log.info("鏃犲彲鎵ц鐨勬潯浠�");
+ }
+ @Scheduled(fixedDelay = 1000)
+ public void loadTasks() {
+ JSONObject jsonObject = new JSONObject();
+ Machine machine=machineMapper.selectById(machineId2);
+
+
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ //姝ょ嚎璺凡棰嗗彇鐨勪换鍔�
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+ //姝ょ嚎璺湭棰嗗彇鐨勪换鍔� 鏈湴
+ //List<PrimitiveTask> findPrimitiveTask=primitiveTaskService.findPrimitiveTaskNotFinish();
+ //姝ょ嚎璺湭棰嗗彇鐨勪换鍔� 瀹㈡埛鏁版嵁搴�
+ List<KBBTJPDrawingBP> list =kBBTJPDrawingBPService.notReceiveKBBTJPDrawingBP();
+ jsonObject.append("findPrimitiveTask", list);
+ jsonObject.append("findPrimitiveTasking", findPrimitiveTasking);
+ //jsonObject.append("findPrimitiveTask", findPrimitiveTask);
+ jsonObject.append("machine", machine);
+ jsonObject.append("sendRecords", sendRecords);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadTask");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCManualReporting.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCManualReporting.java
deleted file mode 100644
index e83d7c1..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCManualReporting.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.PrimitiveTask;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.PrimitiveTaskService;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCManualReporting {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
- @Autowired
- PrimitiveTaskService primitiveTaskService;
-
- //@Scheduled(fixedDelay = 500)
- @Scheduled(fixedDelay = 1000)
- public void manualReporting() {
-
- JSONObject jsonObject = new JSONObject();
- List<PrimitiveTask> taskingList = primitiveTaskService.selectPrimitiveTask(new PrimitiveTask());
- jsonObject.append("taskingList", taskingList);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("manualReporting");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCMechanicalArm.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCMechanicalArm.java
deleted file mode 100644
index 947e4cd..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCMechanicalArm.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCMechanicalArm {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
-// @Scheduled(fixedDelay = 500)
- public void plcEdging() {
- //鏈烘鑷傝姹備俊鍙�
- String request = plcParameterObject.getPlcParameter("request").getValue();
- if (!Objects.equals(request, "")){
- //褰撴満姊拌噦璇锋眰淇″彿涓�1鐨勬椂鍊�,//鍒ゆ柇褰撳墠浠诲姟鏄畾鍒惰繕鏄爣鍑�
- String status = plcParameterObject.getPlcParameter("Status").getValue();
- boolean tasking = taskingService.insertTasking(status);
- if(tasking){
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("overGlass").getAddress(), Integer.parseInt("1"));
- //鍙戦�佷笂鐗囧畬姣�
- }
- }
-
-
- }
- @Scheduled(fixedDelay = 1000)
- public void mechanicalAmWeb() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鑾峰彇鎶ヨ鐘舵��
- JSONObject jsonObject = new JSONObject();
-// String warning = plcParameterObject.getPlcParameter("warning").getValue();
-// if (!Objects.equals(warning, "0")) {
-// //log.info("鎶ヨ淇℃伅锛�"+warning);
-// jsonObject.append("warning", warning);
-// }
- Machine machine=machineMapper.selectById(1L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("mechanicalArm");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCRotate.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCRotate.java
new file mode 100644
index 0000000..5d379c2
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCRotate.java
@@ -0,0 +1,155 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.common.S7objectMachine;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.ProjectService;
+import com.mes.md.service.TaskingService;
+import com.mes.tools.WebSocketServer;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author SNG-010
+ */
+@Component
+@Slf4j
+public class PLCRotate {
+
+ PlcParameterObject plcParameterObject =null;
+ @Autowired
+ TaskingService taskingService;
+ @Autowired
+ MachineMapper machineMapper;
+
+ public S7objectMachine s7objectMachine;
+
+ @Autowired
+ ProjectService projectService;
+
+ public List<Map> sendRecords = new ArrayList<>();
+
+ //@Scheduled(fixedDelay = 1000)
+ public void plcRotate() {
+ //鏃嬭浆鍙�
+ Long machineId=20L;
+ Machine machine=machineMapper.selectById(machineId);
+
+ if (s7objectMachine==null){
+ s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcRotate", EPlcType.S1200);
+ s7objectMachine.start();
+ }
+ PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
+ PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameterInfo mesSendId =plcParameterObject.getPlcParameter("mesSendID");//鍙戦�両D
+ PlcParameterInfo length =plcParameterObject.getPlcParameter("length");//闀�
+ PlcParameterInfo width =plcParameterObject.getPlcParameter("width");//瀹�
+ PlcParameterInfo rotateType =plcParameterObject.getPlcParameter("rotateType");//鏃嬭浆绫诲瀷
+ String scan_id="";
+ if (machine.getIsLog()>0){
+ s7objectMachine.consoleLogInfo();
+ }
+ if ("0".equals(plcRequest.getValue())&&!"0".equals(mesSend.getValue())) {
+ //鍙戦�佸瓧缃�0
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("1.鍙戦�佸瓧缃浂,娓呴櫎涓婃鍙戦�佺殑鏁版嵁{},{},{},{},{}"
+ ,finishCount
+ ,length.getValue()
+ ,width.getValue()
+ ,mesSendId.getValue()
+ ,mesSend.getValue());
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSendId.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(rotateType.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 0);
+ return;
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if("1".equals(plcRequest.getValue())&&"0".equals(mesSend.getValue())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Tasking tasking;
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡
+ tasking=taskingService.startMachineTask(machine);
+ }else{
+ //瀹氬埗妯″紡
+ String PlcRequestID_=plcRequestID.getValue();
+ scan_id= PlcRequestID_.substring(PlcRequestID_.lastIndexOf(",")+1);
+ //鏍囪褰撳墠宸ュ簭 浠ュ墠鐨勭幓鐠� 鐩存帴鍒板綋鍓嶅伐搴�
+ tasking=taskingService.startScanIdMachineTask(machine,scan_id);//涓嶇椤哄簭锛岀洿鎺ユ壘浠庣炕鐗囧彴鎵爜鍚庡埌鏃嬭浆鍙扮殑鏁版嵁
+ }
+ if(tasking!=null){
+ log.info("4銆佸彂閫佹暟鎹�:{},{},{},{},{}"
+ ,tasking.getGlassId(),tasking.getProgramId()
+ ,tasking.getLength().intValue(),tasking.getWidth().intValue(),1);
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), tasking.getLength().intValue());
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), tasking.getWidth().intValue());
+ s7objectMachine.plccontrol.writeString(mesSendId.getAddress(), tasking.getGlassId().toString());
+ s7objectMachine.plccontrol.writeWord(rotateType.getAddress(), 1);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 1);
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getWidth();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ nullMachine(machine);
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ }else if(!scan_id.isEmpty()){
+ taskingService.scanMachineAdd(machine,scan_id);
+ }
+ }
+
+ }
+ public void nullMachine(Machine machine) {
+ if (!"".equals(machine.getRemark())){
+ machine.setRemark("");
+ machineMapper.updateById(machine);
+ }
+ }
+ @Scheduled(fixedDelay = 1000)
+ public void rotateTask() {
+ //鑾峰彇鎶ヨ鐘舵��
+ JSONObject jsonObject = new JSONObject();
+ Machine machine=machineMapper.selectById(20L);
+ List<Tasking> taskingList=taskingService.findMachineTask(machine);
+ jsonObject.append("taskingList", taskingList);
+ jsonObject.append("machine", machine);
+ jsonObject.append("sendRecords", sendRecords);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rotate");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRVerify.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRVerify.java
deleted file mode 100644
index 873e859..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRVerify.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Tasking;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCScanQRVerify {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- //@Scheduled(fixedDelay = 500)
- public void plcScanQrVerify() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鎵爜纭绾跨▼
- String scanId = plcParameterObject.getPlcParameter("scanId").getValue();
- Tasking tasking =new Tasking();
- tasking.setScanId(scanId);
- if(!Objects.equals(scanId, "")){
- //鏇存柊浠诲姟琛ㄧ姸鎬�
- boolean result = taskingService.updateTaskingState(tasking);
- if (result){
- //娣诲姞鎴愬姛鏃跺彂閫佽繃鐗囦俊鍙�
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("scan").getAddress(), Integer.parseInt("1"));
- }
- }else {
- //鎵爜澶辫触鏃跺彂閫佽鍛婏紝浜岀淮鐮佹秷澶�
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("deficiency").getAddress(), Integer.parseInt("1"));
- log.info("鏍囧噯妯″紡鎵弿浜岀淮鐮侊細鏃�");
- }
-
- }
- //@Scheduled(fixedDelay = 1000)
- public void scanQrCode() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鑾峰彇鎶ヨ鐘舵��
- String warning = plcParameterObject.getPlcParameter("warning").getValue();
- JSONObject jsonObject = new JSONObject();
- if (!Objects.equals(warning, "0")) {
- //log.info("鎶ヨ淇℃伅锛�"+warning);
- jsonObject.append("warning", warning);
- }
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("ScanQrVerify");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRWorks.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRWorks.java
deleted file mode 100644
index 517a13d..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQRWorks.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.mes.job;
-
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.Tasking;
-import com.mes.md.service.PrimitiveTaskService;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCScanQRWorks {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- PrimitiveTaskService primitiveTaskService;
- //@Scheduled(fixedDelay = 500)
- public void plcScanQrVerify() {
- //鏍规嵁鎵弿鍒扮殑瀹氬埗浜岀淮鐮佸皢鐘舵�佹洿鏂板埌鏁版嵁搴撲腑
- //鎵爜鎶ュ伐绾跨▼
- String scanId = plcParameterObject.getPlcParameter("scanId").getValue();
- Tasking tasking =new Tasking();
- if(!Objects.equals(scanId, "")){
- //鏇存柊浠诲姟琛ㄧ姸鎬�
- boolean result = primitiveTaskService.updateReportCount(scanId);
- if (result){
- //娣诲姞鎴愬姛鏃跺彂閫佽繃鐗囦俊鍙�
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("scan").getAddress(), Integer.parseInt("1"));
- }
- }else {
- //鎵爜澶辫触鏃跺彂閫佽鍛婏紝浜岀淮鐮佹秷澶�
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("deficiency").getAddress(), Integer.parseInt("1"));
- log.info("鏍囧噯妯″紡鎵弿浜岀淮鐮侊細鏃�");
- }
-
- }
- //@Scheduled(fixedDelay = 1000)
- public void scanQrCode() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鑾峰彇鎶ヨ鐘舵��
- String warning = plcParameterObject.getPlcParameter("warning").getValue();
- JSONObject jsonObject = new JSONObject();
- if (!Objects.equals(warning, "0")) {
- //log.info("鎶ヨ淇℃伅锛�"+warning);
- jsonObject.append("warning", warning);
- }
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("ScanQrVerify");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQrCodesReport.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQrCodesReport.java
deleted file mode 100644
index 8977be5..0000000
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCScanQrCodesReport.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.mes.job;
-import cn.hutool.json.JSONObject;
-import com.mes.common.S7object;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.MachineMapper;
-import com.mes.md.service.PrimitiveTaskService;
-import com.mes.md.service.TaskingService;
-import com.mes.tools.WebSocketServer;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-import com.mes.device.PlcParameterObject;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * @author SNG-010
- */
-@Component
-@Slf4j
-public class PLCScanQrCodesReport {
-
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
- @Autowired
- TaskingService taskingService;
- @Autowired
- MachineMapper machineMapper;
- @Autowired
- PrimitiveTaskService primitiveTaskService;
- //@Scheduled(fixedDelay = 500)
- public void pLCScanQR() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- //鎵爜绾跨▼
- String scanId = plcParameterObject.getPlcParameter("scanId").getValue();
- if(!Objects.equals(scanId, "")){
- boolean result = primitiveTaskService.updateReportCount(scanId);
- if (result){
- //娣诲姞鎴愬姛鏃跺彂閫佽繃鐗囦俊鍙�
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("scan").getAddress(), Integer.parseInt("1"));
- }
- log.info("鎵弿瀹氬埗浜岀淮鐮侊細"+scanId);
- }else {
- log.info("鏍囧噯妯″紡鎵弿浜岀淮鐮侊細鏃�");
- }
-
- }
- @Scheduled(fixedDelay = 1000)
- public void scanQrCode() {
- //鑾峰彇褰撳墠浠诲姟琛ㄦ渶鏂扮殑涓�鍧椾换鍔$姸鎬�
- JSONObject jsonObject = new JSONObject();
- //鑾峰彇鎶ヨ鐘舵��
-// String warning = plcParameterObject.getPlcParameter("warning").getValue();
-
-// if (!Objects.equals(warning, "0")) {
-// //log.info("鎶ヨ淇℃伅锛�"+warning);
-// jsonObject.append("warning", warning);
-// }
- Machine machine=machineMapper.selectById(23L);
- List<Tasking> taskingList=taskingService.findMachineTask(machine);
- jsonObject.append("taskingList", taskingList);
- jsonObject.append("machine", machine);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanQrCodesReport");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
- } else {
- log.info("Home is closed");
- }
- }
-
- }
- }
-
-}
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/SilkScreenTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/SilkScreenTask.java
new file mode 100644
index 0000000..bcd92b5
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/SilkScreenTask.java
@@ -0,0 +1,246 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.mes.common.S7object;
+import com.mes.common.S7objectMarking;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.TaskingService;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.tools.WebSocketServer;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static cn.hutool.core.io.FileUtil.writeString;
+
+/**
+ * 鑷姩涓濆嵃鏈�
+ * @Author :
+ * @Date: 2024/8/20 11:19
+ * @Description:
+ */
+@Component
+@Slf4j
+public class SilkScreenTask {
+
+ @Autowired
+ TaskingMapper taskingMapper;
+ @Autowired
+ MachineMapper machineMapper;
+ @Autowired
+ TaskingService taskingService;
+ public static Long machineId1 = 13L;
+ public static Long machineId2 = 14L;
+ //public ModbusTcp modbusTcp1 = null;
+ public ModbusTcp modbusTcp2 = new ModbusTcp();
+ public List<Map> sendRecords = new ArrayList<>();
+ //@Scheduled(fixedDelay = 1000)
+ public void plcSilkScreenTask() {
+ Machine machine=machineMapper.selectById(machineId2);
+ String fileName="PlcSilkScreen";
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),fileName);
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement(fileName);
+ try {
+ //while(true){
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter plcRequestID =plcAgreement.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameter mesSendID =plcAgreement.getPlcParameter("mesSendID");//鍙戦�両D
+ PlcParameter length =plcAgreement.getPlcParameter("length");//闀�
+ PlcParameter width =plcAgreement.getPlcParameter("width");//瀹�
+ PlcParameter thickness =plcAgreement.getPlcParameter("thickness");//鍘�
+ PlcParameter X =plcAgreement.getPlcParameter("X");//X
+ PlcParameter Y =plcAgreement.getPlcParameter("Y");//Y
+ //PlcParameter isSilkScreen =plcAgreement.getPlcParameter("isSilkScreen");//鏄惁涓濆嵃
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ PlcParameter machineStatusWord =plcAgreement.getPlcParameter("machineStatusWord");
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ log.info("1.鍙戦�佸瓧缃浂");
+ //鍙戦�佸瓧缃�0
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�");
+ if(finishCount>0) {//鏈変换鍔�
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(4==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.glassDownLineOne(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("4銆佷汉宸ユ嬁璧�");
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋寮傚父 鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(2==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.loseMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("2銆侀噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ log.info("2銆佸紓甯搁噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("寮傚父閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ }
+
+ if(3==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("3銆佽澶囦笂浜哄伐鐐圭牬鎹�");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鐐圭牬鎹熷彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ //鏄惁鑷姩娓呴櫎鐮存崯
+ log.info("3銆佹棤鏁堢牬鎹� 锛堟病鏈夋壘鍒版ID鐨勭幓鐠冿級");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ //modbusTcp1.close();
+ return;
+ }
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Tasking tasking=taskingService.startMachineTask(machine);
+ if(tasking!=null){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",machine,tasking);
+ String send=
+ HexUtil.intTo2ByteHex(1)+
+ HexUtil.intTo2ByteHex(tasking.getTaskSequence().intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getWidth()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getLength()*10)).intValue())+
+ HexUtil.intTo2ByteHex(tasking.getThickness().intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getSilkScreenX()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getSilkScreenY()*10)).intValue())+
+ HexUtil.intTo2ByteHex(tasking.getIsSilkScreen());//鏄惁涓濆嵃锛� 0涓濆嵃 1涓嶄笣鍗�
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getWidth()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getThickness()+"-"+
+ tasking.getSilkScreenX()+"-"+
+ tasking.getSilkScreenX()+"-"+
+ tasking.getSilkScreenY()+"-"+
+ tasking.getIsSilkScreen();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ //}
+
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+
+ modbusTcp1.close();
+ //log.info("鏃犲彲鎵ц鐨勬潯浠�");
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void SilkScreenTasks() {
+ JSONObject jsonObject = new JSONObject();
+ Machine machine=machineMapper.selectById(14L);
+ List<Tasking> taskingList=taskingService.findMachineTask(machine);
+ jsonObject.append("taskingList", taskingList);
+ jsonObject.append("machine", machine);
+ jsonObject.append("sendRecords", sendRecords);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("silkScreenTask");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ List<String> messages = webserver.getMessages();
+ if (!messages.isEmpty()) {
+ // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+ webserver.clearMessages();
+ }
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java
index ca0f4f2..59b363a 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java
@@ -1,9 +1,11 @@
package com.mes.md.controller;
+import com.mes.md.entity.KBBTJPDrawingBP;
import com.mes.md.entity.Machine;
import com.mes.md.entity.PrimitiveTask;
import com.mes.md.entity.Tasking;
+import com.mes.md.service.KBBTJPDrawingBPService;
import com.mes.md.service.PrimitiveTaskService;
import com.mes.md.service.TaskingService;
import com.mes.utils.Result;
@@ -24,8 +26,12 @@
@RestController
@RequestMapping("/primitiveTask")
public class PrimitiveTaskController {
+
@Autowired
private PrimitiveTaskService primitiveTaskService;
+ @Autowired
+ private KBBTJPDrawingBPService kBBTJPDrawingBPService;
+
@ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟")
@PostMapping("/selectPrimitiveTask")
@ResponseBody
@@ -34,6 +40,21 @@
return Result.build(200,"鎴愬姛",list);
}
+ @ApiOperation("鏌ヨ褰撳墠 鏍囧噯锛屽彲棰嗗彇鐨勪换鍔★紙瀹㈡埛琛級")
+ @PostMapping("/findKBBTJPDrawingBP")
+ @ResponseBody
+ public Result findKBBTJPDrawingBP() {
+ List<KBBTJPDrawingBP> list =kBBTJPDrawingBPService.notReceiveKBBTJPDrawingBP();
+ return Result.build(200,"鎴愬姛",list);
+ }
+
+ @ApiOperation("棰嗗彇鎴栫粨鏉� ")
+ @PostMapping("/startOrStopPrimitiveTasking")
+ @ResponseBody
+ public Result startOrStopPrimitiveTasking(@RequestBody PrimitiveTask primitiveTask) {
+ int list =primitiveTaskService.startOrStopPrimitiveTasking(primitiveTask);
+ return Result.build(200,"鎴愬姛",list);
+ }
@ApiOperation("鏍规嵁鎵规鍙疯繘琛屾墜鍔ㄦ姤宸�")
@PostMapping("/updatePrimitiveTask")
@ResponseBody
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
index b11911c..c7281d2 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/TaskingController.java
@@ -3,6 +3,8 @@
import com.mes.md.entity.Machine;
import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.ProjectService;
import com.mes.md.service.TaskingService;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
@@ -24,51 +26,10 @@
public class TaskingController {
@Autowired
private TaskingService taskingService;
-
-// @ApiOperation("鍒囨崲妯″紡")
-// @PostMapping("/updateLoadState") //鍒囨崲妯″紡"
-// @ResponseBody
-// public Result<Boolean> updateStatus(@RequestBody Integer state) {
-// if(state == 1){
-// boolean result =taskingService.updateStatus(state);
-// return Result.build(1,"瀹氬埗妯″紡",result);
-// }else {
-// boolean result =taskingService.updateStatus(state);
-// return Result.build(0,"鏍囧噯妯″紡",result);
-// }
-// }
-// @ApiOperation("鐐瑰嚮鏆傚仠璁惧")
-// @PostMapping("/updateLoadStatus") //鐐瑰嚮鏆傚仠璁惧
-// @ResponseBody
-// public Result<Boolean> updateLoadStatus(@RequestBody Integer state) {
-// if(state == 1){
-// boolean result =taskingService.updateLoadState(state);
-// return Result.build(1,"鎴愬姛",result);
-// }else {
-// boolean result =taskingService.updateLoadState(state);
-// return Result.build(0,"鎴愬姛",result);
-// }
-// }
-// @ApiOperation("鐐瑰嚮鐮存崯")
-// @PostMapping("/updateDamage") //鏆傚仠涓婄墖浠诲姟
-// @ResponseBody
-// public Result<Tasking> updateDamage(@RequestBody Tasking tasking) {
-//
-// boolean result =taskingService.updateDamage(tasking);
-// return Result.build(1,"瀹氬埗妯″紡",null);
-//
-//
-// }
-// @ApiOperation("鏌ヨ褰撳墠妯″紡杩囧幓鐨勭幓鐠�")
-// @PostMapping("/selectTasking") //鏆傚仠涓婄墖浠诲姟
-// @ResponseBody
-// public Result<List<Tasking>> selectTasking() {
-//
-// List<Tasking> tasking =taskingService.selectTasking();
-// return Result.build(1,"瀹氬埗妯″紡",tasking);
-// }
-
-
+ @Autowired
+ private ProjectService projectService;
+ @Autowired
+ private MachineMapper machineMapper;
@ApiOperation("鏌ヨ褰撳墠璁惧锛屾湭瀹屽伐鐘舵�佺殑绾夸笂浠诲姟")
@PostMapping("/findMachineTask")
@@ -116,10 +77,18 @@
}
@ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
+ @PostMapping("/glassTopLineList")
+ @ResponseBody
+ public Result glassTopLineList(@RequestBody List<Tasking> taskingList) {
+ int count =taskingService.glassTopLine(taskingList);
+ return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+ }
+
+ @ApiOperation("淇敼褰撳墠璁惧 銆愪笂绾裤��")
@PostMapping("/glassTopLine")
@ResponseBody
- public Result glassTopLine(@RequestBody List<Tasking> taskingList) {
- int count =taskingService.glassTopLine(taskingList);
+ public Result glassTopLine(@RequestBody Tasking tasking) {
+ int count =taskingService.glassTopLine(tasking);
return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
}
@@ -130,7 +99,13 @@
int count =taskingService.glassDownLine(tasking);
return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
}
-
+ @ApiOperation("鐜荤拑 銆愪笅绾裤��")
+ @PostMapping("/glassAgainTopLine")
+ @ResponseBody
+ public Result glassAgainTopLine(@RequestBody Tasking tasking) {
+ int count =taskingService.stopTasking(tasking);
+ return Result.build(200,"淇敼鎴愬姛锛�"+count,count);
+ }
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/KBBTJPDrawingBP.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/KBBTJPDrawingBP.java
new file mode 100644
index 0000000..62b3ca7
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/KBBTJPDrawingBP.java
@@ -0,0 +1,165 @@
+package com.mes.md.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.models.auth.In;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 鍘熷浠诲姟琛�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-08-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName(value = "KBB_T_JPDrawing_BP")
+public class KBBTJPDrawingBP implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 鍘熷浠诲姟琛ㄤ富閿�(瀹㈡埛鎻愪緵鏍锋湰)
+ */
+ @TableId(value = "ID", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 鎵规鍙�
+ */
+ private String batchNumber;
+
+ /**
+ * 鎵爜ID (鍞竴)銆愭澘浠禝D銆�
+ */
+ private String scanId;
+
+ /**
+ * 绋嬪簭ID
+ */
+ private String programId;
+
+ /**
+ * 浠诲姟绫诲瀷銆愬畾鍒�/鏍囧噯銆�
+ */
+ private String taskType;
+
+ /**
+ * 浠诲姟椤哄簭
+ */
+ private Integer taskSequence;
+
+ /**
+ * 浠诲姟鏁伴噺
+ */
+ private Integer taskQuantity;
+
+ /**
+ * 闀�
+ */
+ private Double length;
+
+ /**
+ * 瀹�
+ */
+ private Double width;
+
+ /**
+ * 鍘�
+ */
+ private Double thickness;
+
+// /**
+// * 鐐硅兌鍥剧焊
+// */
+// private String drawingGlue;
+
+ /**
+ * 鎵撴爣鍥剧焊
+ */
+ private String drawingMarking;
+
+ /**
+ * 涓濆嵃X
+ */
+ private Double silkScreenX;
+
+ /**
+ * 涓濆嵃Y
+ */
+ private Double silkScreenY;
+
+// /**
+// * 鏄惁鎵撴爣
+// */
+// private Integer isMarking;
+//
+// /**
+// * 鏄惁涓濆嵃
+// */
+// private Integer isSilkScreen;
+
+ /**
+ * 鎶ュ伐鏁伴噺
+ */
+ private Integer reportCount;
+
+ /**
+ * R瑙�1-1(鍙充笅瑙�)
+ */
+ private Double r_1_1;
+
+ /**
+ * R瑙�1-2(鍙充笅瑙�)
+ */
+ private Double r_1_2;
+
+ /**
+ * R瑙�2-1(鍙充笂瑙�)
+ */
+ private Double r_2_1;
+
+ /**
+ * R瑙�2-2(鍙充笂瑙�)
+ */
+ private Double r_2_2;
+
+ /**
+ * R瑙�3-1(宸︿笂瑙�)
+ */
+ private Double r_3_1;
+
+ /**
+ * R瑙�3-2(宸︿笂瑙�)
+ */
+ private Double r_3_2;
+
+ /**
+ * R瑙�4-1(宸︿笅瑙�)
+ */
+ private Double r_4_1;
+
+ /**
+ * R瑙�4-2(宸︿笅瑙�)
+ */
+ private Double r_4_2;
+
+ /**
+ * 鏄惁棰嗗彇
+ */
+ private Integer isWorking;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ @TableField(value = "CreateDate")
+ private Date createDate;
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/LineConfiguration.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/LineConfiguration.java
index 6ec3c4e..c5d57af 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/LineConfiguration.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/LineConfiguration.java
@@ -49,6 +49,9 @@
* 澶囨敞
*/
private String remark;
-
+ /**
+ * 鏄惁鍚敤
+ */
+ private int isStart;
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Machine.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Machine.java
index de26267..c3f20d2 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Machine.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Machine.java
@@ -61,6 +61,16 @@
* 澶囨敞
*/
private String remark;
+ /**
+ * 鏄惁杈撳嚭鍙傛暟鏃ュ織
+ */
+ private int isLog;
+
+ /**
+ * 浠婃棩宸ヤ綔娆℃暟
+ */
+ private Integer todayCount;
+
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/PrimitiveTask.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/PrimitiveTask.java
index c474131..4d1d432 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/PrimitiveTask.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/PrimitiveTask.java
@@ -1,8 +1,11 @@
package com.mes.md.entity;
import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
+import java.util.Date;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -105,4 +108,88 @@
* 鎶ュ伐鏁伴噺
*/
private Integer reportCount;
+
+ /**
+ * R瑙�1-1(鍙充笅瑙�)
+ */
+ private Double r_1_1;
+
+ /**
+ * R瑙�1-2(鍙充笅瑙�)
+ */
+ private Double r_1_2;
+
+ /**
+ * R瑙�2-1(鍙充笂瑙�)
+ */
+ private Double r_2_1;
+
+ /**
+ * R瑙�2-2(鍙充笂瑙�)
+ */
+ private Double r_2_2;
+
+ /**
+ * R瑙�3-1(宸︿笂瑙�)
+ */
+ private Double r_3_1;
+
+ /**
+ * R瑙�3-2(宸︿笂瑙�)
+ */
+ private Double r_3_2;
+
+ /**
+ * R瑙�4-1(宸︿笅瑙�)
+ */
+ private Double r_4_1;
+
+ /**
+ * R瑙�4-2(宸︿笅瑙�)
+ */
+ private Double r_4_2;
+
+ /**
+ * 鏄惁宸ヤ綔
+ */
+ private Integer isWorking;
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ private Date createTime;
+
+ /**
+ * 棰嗗彇鏃堕棿
+ */
+ private Date beginTime;
+ /**
+ * 缁撴潫鏃堕棿
+ */
+ private Date endTime;
+
+ /**
+ * 缁撴潫鏃� 浠诲姟鎵ц鐘舵�併�愮瓑寰�/宸ヤ綔/瀹屾垚銆�
+ */
+ private String workState;
+
+ /**
+ * 缁撴潫鏃� 鎵�鍦ㄥ伐鑹� id (绾胯矾ID)
+ */
+ private Long lineConfigurationId;
+
+ /**
+ * 缁撴潫鏃� 鐢熶骇鐘舵�併�愮嚎涓�/绾夸笅銆�
+ */
+ private String state;
+
+ /**
+ * 缁撴潫鏃� 鐜荤拑鐘舵�併�愭甯�/鐮存崯銆�
+ */
+ private String glassState;
+
+ /**
+ * 棰嗗彇绾胯矾
+ */
+ private Integer getLine;
+
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Tasking.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Tasking.java
index 13b918e..8a09a87 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Tasking.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/entity/Tasking.java
@@ -126,5 +126,48 @@
*/
private String glassState;
+ /**
+ * R瑙�1-1(鍙充笅瑙�)
+ */
+ private Double r_1_1;
+ /**
+ * R瑙�1-2(鍙充笅瑙�)
+ */
+ private Double r_1_2;
+
+ /**
+ * R瑙�2-1(鍙充笂瑙�)
+ */
+ private Double r_2_1;
+
+ /**
+ * R瑙�2-2(鍙充笂瑙�)
+ */
+ private Double r_2_2;
+
+ /**
+ * R瑙�3-1(宸︿笂瑙�)
+ */
+ private Double r_3_1;
+
+ /**
+ * R瑙�3-2(宸︿笂瑙�)
+ */
+ private Double r_3_2;
+
+ /**
+ * R瑙�4-1(宸︿笅瑙�)
+ */
+ private Double r_4_1;
+
+ /**
+ * R瑙�4-2(宸︿笅瑙�)
+ */
+ private Double r_4_2;
+
+ /**
+ * 鎬昏〃ID
+ */
+ private Long primitiveTaskId;
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/mapper/KBBTJPDrawingBPMapper.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/mapper/KBBTJPDrawingBPMapper.java
new file mode 100644
index 0000000..458be83
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/mapper/KBBTJPDrawingBPMapper.java
@@ -0,0 +1,19 @@
+package com.mes.md.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.mes.md.entity.KBBTJPDrawingBP;
+import com.mes.md.entity.PrimitiveTask;
+
+/**
+ * <p>
+ * 鍘熷浠诲姟琛� Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-08-28
+ */
+@DS("salve_JomooKBB")
+public interface KBBTJPDrawingBPMapper extends MPJBaseMapper<KBBTJPDrawingBP> {
+
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/KBBTJPDrawingBPService.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/KBBTJPDrawingBPService.java
new file mode 100644
index 0000000..648eba2
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/KBBTJPDrawingBPService.java
@@ -0,0 +1,58 @@
+package com.mes.md.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.mes.md.entity.EdgeGrindingLog;
+import com.mes.md.entity.KBBTJPDrawingBP;
+import com.mes.md.entity.PrimitiveTask;
+import com.mes.md.entity.Tasking;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 纾ㄨ竟鏈鸿澶囦氦浜掕褰曡〃 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-08-28
+ */
+public interface KBBTJPDrawingBPService extends MPJBaseService<KBBTJPDrawingBP> {
+
+
+ /**
+ * @param scanId 瀹㈡埛鏁版嵁涓� 鏌ヨ鎵爜ID
+ * @return
+ */
+ List<KBBTJPDrawingBP> findScanIdKBBTJPDrawingBP(String scanId);
+
+ /**
+ * @param id
+ * @param getLine
+ * @return
+ */
+ int receiveKBBTJPDrawingBP(Long id,Integer getLine);
+
+
+ /**
+ * 瀹㈡埛琛ㄦ湭棰嗗彇鐨勩�愭爣鍑嗐�戜换鍔�
+ * @return
+ */
+ List<KBBTJPDrawingBP> notReceiveKBBTJPDrawingBP();
+
+
+
+
+ /**
+ * @param kBBTJPDrawingBP
+ * @return
+ */
+ PrimitiveTask convertListPrimitiveTask(KBBTJPDrawingBP kBBTJPDrawingBP);
+
+ /**
+ * @param kBBTJPDrawingBP
+ * @param LineConfigurationId
+ * @return
+ */
+ Tasking convertListTasking(KBBTJPDrawingBP kBBTJPDrawingBP,Long LineConfigurationId);
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/LineConfigurationService.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/LineConfigurationService.java
index 3d02797..77c3f2d 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/LineConfigurationService.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/LineConfigurationService.java
@@ -3,6 +3,7 @@
import com.github.yulichang.base.MPJBaseService;
import com.mes.md.entity.Line;
import com.mes.md.entity.LineConfiguration;
+import com.mes.md.entity.Machine;
/**
* <p>
@@ -13,5 +14,5 @@
* @since 2024-08-28
*/
public interface LineConfigurationService extends MPJBaseService<LineConfiguration> {
-
+ LineConfiguration machineLineConfiguration(Machine machine);
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/PrimitiveTaskService.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/PrimitiveTaskService.java
index 6b3cb37..8c465f7 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/PrimitiveTaskService.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/PrimitiveTaskService.java
@@ -1,8 +1,10 @@
package com.mes.md.service;
import com.github.yulichang.base.MPJBaseService;
+import com.mes.md.entity.Machine;
import com.mes.md.entity.PrimitiveTask;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.md.entity.Tasking;
import java.util.List;
@@ -15,6 +17,25 @@
* @since 2024-08-28
*/
public interface PrimitiveTaskService extends MPJBaseService<PrimitiveTask> {
+
+ Tasking convertListTasking(PrimitiveTask primitiveTask, Long LineConfigurationId);
+ /**
+ *鏌ヨ鏍囧噯鏈畬鎴愮殑浠诲姟
+ * @return
+ */
+ List<PrimitiveTask> findPrimitiveTaskNotFinish();
+
+ /**
+ *鏌ヨ鏍囧噯姝ょ嚎璺凡棰嗗彇鐨勪换鍔�
+ * @return
+ */
+ List<PrimitiveTask> findPrimitiveTasking(Machine machine,Long line);
+ /**
+ * 鏍囧噯锛氶鍙栦换鍔� /缁撴潫浠诲姟
+ * @return
+ */
+ int startOrStopPrimitiveTasking(PrimitiveTask primitiveTask);
+
/**
*鎵爜鏇存柊瀹氬埗鐜荤拑鐨勬姤宸ユ暟閲�
* @return
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/ProjectService.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/ProjectService.java
index ad73e79..72caecf 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/ProjectService.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/ProjectService.java
@@ -1,8 +1,17 @@
package com.mes.md.service;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.base.MPJBaseService;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.md.entity.KBBTJPDrawingBP;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.PrimitiveTask;
import com.mes.md.entity.Project;
import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.md.mapper.KBBTJPDrawingBPMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
/**
* <p>
@@ -14,4 +23,9 @@
*/
public interface ProjectService extends MPJBaseService<Project> {
+ //瀵煎叆宸ョ▼
+ boolean insertProjectStandard();
+
+ //瀵煎叆宸ョ▼-鎵爜ID
+ int insertProjectCustomization(String scan_id);
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/TaskingService.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/TaskingService.java
index 7052df9..dc38ab8 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/TaskingService.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/TaskingService.java
@@ -15,31 +15,7 @@
* @since 2024-08-28
*/
public interface TaskingService extends MPJBaseService<Tasking> {
-// /**
-// * 鏇存敼涓婄墖妯″紡
-// * @return boolean
-// */
-// boolean updateStatus(Integer state);
-// /**
-// *鏇存敼鑱旀満鐘舵��
-// * @return boolean
-// */
-// boolean updateLoadState(Integer state);
-// /**
-// * 鐐瑰嚮鐮存崯
-// * @return boolean
-// */
-// boolean updateDamage(Tasking tasking);
-// /**
-// * 鏌ヨ褰撳墠妯″紡杩囧幓鐨勭幓鐠�
-// * @return List<Tasking>
-// */
-// List<Tasking> selectTasking();
-// /**
-// * 鏍规嵁涓嶅悓宸ヨ壓鏌ヨ鍗冲皢涓婄墖鐨勬暟鎹�
-// * @return List<Tasking>
-// */
-// Tasking selectTasking(Tasking tasking);
+
/**
* 瀹氬埗妯″紡涓嬪皢鎵爜鍑烘潵id鑾峰彇鎴愮幓鐠冩暟鎹祴鍊肩粰褰撳墠鏈�鏂扮殑glassId
* @return List<Tasking>
@@ -63,6 +39,13 @@
boolean updateTaskingState(Tasking tasking);
+ /**
+ * @param machine
+ * 鎵爜璁惧娣诲姞浠诲姟
+ * @return
+ */
+ int scanMachineAdd(Machine machine, String scanId);
+
/**
* @param machine
@@ -76,18 +59,36 @@
* @return
*/
List<Tasking> findMachineWorkStateTask(Machine machine, String workState);
+
+ /**
+ *
+ * 鏌ヨ绾夸笅鐨勭幓鐠�
+ * @return
+ */
+ List<Tasking> findDownLineTask();
/**
* @param machine
* 褰撳墠璁惧鏍囪姝e湪宸ヤ綔锛氱嚎涓婄瓑寰呯殑浠诲姟绗竴鏉� (绾夸笂/姝e父)
* @return
*/
Tasking startMachineTask(Machine machine);
+
+ Tasking startMachineTask(Machine machine, String glassId);
+
+ /**
+ * @param machine
+ * 褰撳墠璁惧 鐨勫墠鍏ㄩ儴宸ュ簭 鍒版湰宸ュ簭鐨� scan_id 浠诲姟鐘舵�佷负姝e湪宸ヤ綔
+ * @return
+ */
+ Tasking startScanIdMachineTask(Machine machine, String scan_id);
/**
* @param machine
* 褰撳墠璁惧鏍囪瀹屾垚锛氭鍦ㄥ伐浣滅殑绗竴涓换鍔� (绾夸笂/姝e父) 杩斿洖瀹屾垚鏁伴噺
* @return
*/
int finishMachineTask(Machine machine);
+
+ int finishMachineTask(Machine machine,Integer taskSequence);
/**
* @param machine
* 褰撳墠璁惧鏍囪澶辫触锛屾鍦ㄥ伐浣滅殑鏈�鍚庝竴涓换鍔� (绾夸笂/姝e父) 杩斿洖澶辫触鏁伴噺
@@ -101,6 +102,12 @@
*/
int damagedTask(Tasking tasking);
/**
+ * @param machine
+ * 淇敼鐘舵�� 銆愪笅绾裤��
+ * @return
+ */
+ int glassDownLineOne(Machine machine);
+ /**
* @param tasking
* 淇敼鐘舵�� 銆愪笅绾裤��
* @return
@@ -112,4 +119,19 @@
* @return
*/
int glassTopLine(List<Tasking> taskingList);
+
+ /**
+ * @param tasking
+ * 鎵归噺淇敼鐘舵�� 銆愪笂绾裤��
+ * @return
+ */
+ int glassTopLine(Tasking tasking);
+
+ List<Tasking> findMachineTaskID(Machine machine,String scan_id);
+ /**
+ * @param tasking
+ * 浠诲姟缁撴潫
+ * @return
+ */
+ int stopTasking(Tasking tasking);
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/KBBTJPDrawingBPServiceImpl.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/KBBTJPDrawingBPServiceImpl.java
new file mode 100644
index 0000000..47a9aba
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/KBBTJPDrawingBPServiceImpl.java
@@ -0,0 +1,154 @@
+package com.mes.md.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.md.entity.EdgeGrindingLog;
+import com.mes.md.entity.KBBTJPDrawingBP;
+import com.mes.md.entity.PrimitiveTask;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.EdgeGrindingLogMapper;
+import com.mes.md.mapper.KBBTJPDrawingBPMapper;
+import com.mes.md.mapper.PrimitiveTaskMapper;
+import com.mes.md.service.EdgeGrindingLogService;
+import com.mes.md.service.KBBTJPDrawingBPService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 纾ㄨ竟鏈鸿澶囦氦浜掕褰曡〃 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-08-28
+ */
+@Service
+public class KBBTJPDrawingBPServiceImpl extends MPJBaseServiceImpl<KBBTJPDrawingBPMapper, KBBTJPDrawingBP> implements KBBTJPDrawingBPService {
+
+ @Autowired
+ KBBTJPDrawingBPService kBBTJPDrawingBPService;
+ @Autowired
+ PrimitiveTaskMapper primitiveTaskMapper;
+
+ /**
+ * @param scanId 瀹㈡埛鏁版嵁涓� 鏌ヨ鎵爜ID
+ * @return
+ */
+ @Override
+ public List<KBBTJPDrawingBP> findScanIdKBBTJPDrawingBP(String scanId){
+ List<KBBTJPDrawingBP> kBBTJPDrawingBP=baseMapper.selectJoinList(KBBTJPDrawingBP.class,new MPJLambdaWrapper<KBBTJPDrawingBP>()
+ .selectAll(KBBTJPDrawingBP.class)
+ .eq(KBBTJPDrawingBP::getScanId,scanId)
+ .orderByDesc(KBBTJPDrawingBP::getCreateDate)
+ .orderByAsc(KBBTJPDrawingBP::getTaskSequence));
+ return kBBTJPDrawingBP;
+ }
+
+ /**
+ * @param id
+ * @param getLine
+ * @return
+ */
+ @Override
+ public int receiveKBBTJPDrawingBP(Long id,Integer getLine){
+ KBBTJPDrawingBP addKBBTJPDrawingBP=baseMapper.selectById(id);
+ addKBBTJPDrawingBP.setIsWorking(1);
+ PrimitiveTask primitiveTask= kBBTJPDrawingBPService.convertListPrimitiveTask(addKBBTJPDrawingBP);
+ primitiveTask.setIsWorking(addKBBTJPDrawingBP.getIsWorking());
+ primitiveTask.setGetLine(getLine);
+ if(primitiveTaskMapper.insert(primitiveTask)>0){
+ return baseMapper.updateById(addKBBTJPDrawingBP);
+ }
+ return 0;
+ }
+
+ /**
+ * 瀹㈡埛琛ㄦ湭棰嗗彇鐨勩�愭爣鍑嗐�戜换鍔�
+ * @return
+ */
+ @Override
+ public List<KBBTJPDrawingBP> notReceiveKBBTJPDrawingBP(){
+ List<KBBTJPDrawingBP> kBBTJPDrawingBP=baseMapper.selectJoinList(KBBTJPDrawingBP.class,new MPJLambdaWrapper<KBBTJPDrawingBP>()
+ .selectAll(KBBTJPDrawingBP.class)
+ .eq(KBBTJPDrawingBP::getTaskType,"鏍囧噯")
+ .orderByDesc(KBBTJPDrawingBP::getCreateDate)
+ .orderByAsc(KBBTJPDrawingBP::getTaskSequence));
+ return kBBTJPDrawingBP;
+ }
+
+ //瀹㈡埛琛ㄦ牸杞� 鎴戜滑鐨勬暟鎹�
+ @Override
+ public PrimitiveTask convertListPrimitiveTask(KBBTJPDrawingBP kBBTJPDrawingBP) {
+ try {
+ PrimitiveTask primitiveTask=new PrimitiveTask();
+ primitiveTask.setScanId(kBBTJPDrawingBP.getScanId());
+ primitiveTask.setProgramId(kBBTJPDrawingBP.getProgramId());
+ primitiveTask.setBatchNumber(kBBTJPDrawingBP.getBatchNumber()==null?"":kBBTJPDrawingBP.getBatchNumber());
+ primitiveTask.setTaskType(kBBTJPDrawingBP.getTaskType());
+ primitiveTask.setLength(kBBTJPDrawingBP.getLength());
+ primitiveTask.setWidth(kBBTJPDrawingBP.getWidth());
+ primitiveTask.setThickness(kBBTJPDrawingBP.getThickness());
+ primitiveTask.setDrawingMarking(kBBTJPDrawingBP.getDrawingMarking());
+ primitiveTask.setIsMarking((kBBTJPDrawingBP.getDrawingMarking()==null||kBBTJPDrawingBP.getDrawingMarking().isEmpty())?0:1);//鏄惁鎵撴爣锛�0涓嶆墦鏍� 1鎵撴爣
+ primitiveTask.setIsSilkScreen(((kBBTJPDrawingBP.getSilkScreenX()==null||kBBTJPDrawingBP.getSilkScreenY()==null||kBBTJPDrawingBP.getSilkScreenX()==0||kBBTJPDrawingBP.getSilkScreenY()==0)?1:0));
+ primitiveTask.setSilkScreenX(kBBTJPDrawingBP.getSilkScreenX()==null?0:kBBTJPDrawingBP.getSilkScreenX());
+ primitiveTask.setSilkScreenY(kBBTJPDrawingBP.getSilkScreenY()==null?0:kBBTJPDrawingBP.getSilkScreenY());
+ primitiveTask.setTaskSequence(kBBTJPDrawingBP.getTaskSequence());
+ primitiveTask.setTaskQuantity(kBBTJPDrawingBP.getTaskQuantity());
+ primitiveTask.setR_1_1(kBBTJPDrawingBP.getR_1_1()==null?0:kBBTJPDrawingBP.getR_1_1());
+ primitiveTask.setR_1_2(kBBTJPDrawingBP.getR_1_2()==null?0:kBBTJPDrawingBP.getR_1_2());
+ primitiveTask.setR_2_1(kBBTJPDrawingBP.getR_2_1()==null?0:kBBTJPDrawingBP.getR_2_1());
+ primitiveTask.setR_2_2(kBBTJPDrawingBP.getR_2_2()==null?0:kBBTJPDrawingBP.getR_2_2());
+ primitiveTask.setR_3_1(kBBTJPDrawingBP.getR_3_1()==null?0:kBBTJPDrawingBP.getR_3_1());
+ primitiveTask.setR_3_2(kBBTJPDrawingBP.getR_3_2()==null?0:kBBTJPDrawingBP.getR_3_2());
+ primitiveTask.setR_4_1(kBBTJPDrawingBP.getR_4_1()==null?0:kBBTJPDrawingBP.getR_4_1());
+ primitiveTask.setR_4_2(kBBTJPDrawingBP.getR_4_2()==null?0:kBBTJPDrawingBP.getR_4_2());
+ primitiveTask.setCreateTime(new Date());
+ return primitiveTask;
+ }catch (Exception e) {
+ return null;
+ }
+ }
+
+ //瀹㈡埛琛ㄦ牸杞� 鎴戜滑鐨勪换鍔¤〃
+ @Override
+ public Tasking convertListTasking(KBBTJPDrawingBP kBBTJPDrawingBP,Long LineConfigurationId) {
+
+ try {
+ Tasking tasking=new Tasking();
+ tasking.setLineConfigurationId(LineConfigurationId);
+ tasking.setState("绾夸笂");
+ tasking.setWorkState("绛夊緟");
+ tasking.setGlassState("姝e父");
+ tasking.setScanId(kBBTJPDrawingBP.getScanId());
+ tasking.setProgramId(kBBTJPDrawingBP.getProgramId());
+ tasking.setBatchNumber(kBBTJPDrawingBP.getBatchNumber()==null?"":kBBTJPDrawingBP.getBatchNumber());
+ tasking.setTaskType(kBBTJPDrawingBP.getTaskType());
+ tasking.setLength(kBBTJPDrawingBP.getLength());
+ tasking.setWidth(kBBTJPDrawingBP.getWidth());
+ tasking.setThickness(kBBTJPDrawingBP.getThickness());
+ tasking.setIsMarking((kBBTJPDrawingBP.getDrawingMarking()==null||kBBTJPDrawingBP.getDrawingMarking().isEmpty())?0:1);//鏄惁鎵撴爣锛�0涓嶆墦鏍� 1鎵撴爣
+ tasking.setDrawingMarking(kBBTJPDrawingBP.getDrawingMarking());
+ tasking.setIsSilkScreen(((kBBTJPDrawingBP.getSilkScreenX()==null||kBBTJPDrawingBP.getSilkScreenY()==null||kBBTJPDrawingBP.getSilkScreenX()==0||kBBTJPDrawingBP.getSilkScreenY()==0)?1:0));//鏄惁鎵撴爣锛�1涓濆嵃 0涓嶄笣鍗�
+ tasking.setSilkScreenX(kBBTJPDrawingBP.getSilkScreenX()==null?0:kBBTJPDrawingBP.getSilkScreenX());
+ tasking.setSilkScreenY(kBBTJPDrawingBP.getSilkScreenY()==null?0:kBBTJPDrawingBP.getSilkScreenY());
+ tasking.setTaskSequence(kBBTJPDrawingBP.getTaskSequence());
+ tasking.setTaskQuantity(kBBTJPDrawingBP.getTaskQuantity());
+ tasking.setR_1_1(kBBTJPDrawingBP.getR_1_1()==null?0:kBBTJPDrawingBP.getR_1_1());
+ tasking.setR_1_2(kBBTJPDrawingBP.getR_1_2()==null?0:kBBTJPDrawingBP.getR_1_2());
+ tasking.setR_2_1(kBBTJPDrawingBP.getR_2_1()==null?0:kBBTJPDrawingBP.getR_2_1());
+ tasking.setR_2_2(kBBTJPDrawingBP.getR_2_2()==null?0:kBBTJPDrawingBP.getR_2_2());
+ tasking.setR_3_1(kBBTJPDrawingBP.getR_3_1()==null?0:kBBTJPDrawingBP.getR_3_1());
+ tasking.setR_3_2(kBBTJPDrawingBP.getR_3_2()==null?0:kBBTJPDrawingBP.getR_3_2());
+ tasking.setR_4_1(kBBTJPDrawingBP.getR_4_1()==null?0:kBBTJPDrawingBP.getR_4_1());
+ tasking.setR_4_2(kBBTJPDrawingBP.getR_4_2()==null?0:kBBTJPDrawingBP.getR_4_2());
+ return tasking;
+ }catch (Exception e) {
+ return null;
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/LineConfigurationServiceImpl.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/LineConfigurationServiceImpl.java
index 96efcb2..731749e 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/LineConfigurationServiceImpl.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/LineConfigurationServiceImpl.java
@@ -1,13 +1,17 @@
package com.mes.md.service.impl;
import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.md.entity.Line;
import com.mes.md.entity.LineConfiguration;
+import com.mes.md.entity.Machine;
import com.mes.md.mapper.LineConfigurationMapper;
import com.mes.md.mapper.LineMapper;
import com.mes.md.service.LineConfigurationService;
import com.mes.md.service.LineService;
import org.springframework.stereotype.Service;
+
+import java.util.List;
/**
* <p>
@@ -20,4 +24,14 @@
@Service
public class LineConfigurationServiceImpl extends MPJBaseServiceImpl<LineConfigurationMapper, LineConfiguration> implements LineConfigurationService {
+ @Override
+ public LineConfiguration machineLineConfiguration(Machine machine){
+ List<LineConfiguration> machineLineConfiguration=baseMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machine.getId()));
+ if(machineLineConfiguration.isEmpty()){
+ return null;
+ }
+ return machineLineConfiguration.get(0);
+ }
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/PrimitiveTaskServiceImpl.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/PrimitiveTaskServiceImpl.java
index 9190452..1245f78 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/PrimitiveTaskServiceImpl.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/PrimitiveTaskServiceImpl.java
@@ -3,12 +3,17 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
-import com.mes.md.entity.PrimitiveTask;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.md.entity.*;
import com.mes.md.mapper.PrimitiveTaskMapper;
+import com.mes.md.service.KBBTJPDrawingBPService;
+import com.mes.md.service.LineConfigurationService;
import com.mes.md.service.PrimitiveTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Date;
import java.util.List;
/**
@@ -21,6 +26,55 @@
*/
@Service
public class PrimitiveTaskServiceImpl extends MPJBaseServiceImpl<PrimitiveTaskMapper, PrimitiveTask> implements PrimitiveTaskService {
+
+ @Autowired
+ LineConfigurationService lineConfigurationService;
+
+ @Autowired
+ KBBTJPDrawingBPService kBBTJPDrawingBPService;
+
+ /**
+ *鏌ヨ鏍囧噯鏈鍙栫殑浠诲姟
+ * @return
+ */
+ @Override
+ public List<PrimitiveTask> findPrimitiveTaskNotFinish(){
+ return baseMapper.selectList(new QueryWrapper<PrimitiveTask>().lambda()
+ .eq(PrimitiveTask::getIsWorking,0)
+ .eq(PrimitiveTask::getTaskType,"鏍囧噯")
+ .orderByAsc(PrimitiveTask::getCreateTime)
+ .orderByAsc(PrimitiveTask::getTaskSequence));
+ }
+
+ /**
+ *鏌ヨ鏍囧噯姝ょ嚎璺凡棰嗗彇鐨勪换鍔�
+ * @return
+ */
+ @Override
+ public List<PrimitiveTask> findPrimitiveTasking(Machine machine,Long line){
+ return baseMapper.selectList(new MPJLambdaWrapper<PrimitiveTask>()
+ .eq(PrimitiveTask::getIsWorking,1)
+ .eq(PrimitiveTask::getGetLine,line)
+ .eq(PrimitiveTask::getTaskType,"鏍囧噯")
+ .orderByAsc(PrimitiveTask::getBeginTime));
+ }
+
+ /**
+ * 鏍囧噯锛氶鍙栦换鍔� /缁撴潫浠诲姟
+ * @return
+ */
+ @Override
+ public int startOrStopPrimitiveTasking(PrimitiveTask primitiveTask){
+ if (primitiveTask.getIsWorking()==1){//棰嗗彇
+ return kBBTJPDrawingBPService.receiveKBBTJPDrawingBP(primitiveTask.getId(),primitiveTask.getGetLine());
+ }else if (primitiveTask.getIsWorking()==2){//瀹屽伐
+ PrimitiveTask thisPrimitiveTask=baseMapper.selectById(primitiveTask);
+ thisPrimitiveTask.setIsWorking(primitiveTask.getIsWorking());
+ thisPrimitiveTask.setEndTime(new Date());
+ return baseMapper.updateById(thisPrimitiveTask);
+ }
+ return 0;
+ }
@Override
public boolean updateReportCount(String scanId) {
@@ -45,4 +99,42 @@
//鏌ヨ鎶ュ伐鏁版嵁
return list(new QueryWrapper<>(task)) ;
}
+
+
+ //瀹㈡埛琛ㄦ牸杞� 鎴戜滑鐨勪换鍔¤〃
+ @Override
+ public Tasking convertListTasking(PrimitiveTask primitiveTask, Long LineConfigurationId) {
+ try {
+ Tasking tasking=new Tasking();
+ tasking.setLineConfigurationId(LineConfigurationId);
+ tasking.setState("绾夸笂");
+ tasking.setWorkState("绛夊緟");
+ tasking.setGlassState("姝e父");
+ tasking.setScanId(primitiveTask.getScanId());
+ tasking.setProgramId(primitiveTask.getProgramId());
+ tasking.setBatchNumber(primitiveTask.getBatchNumber()==null?"":primitiveTask.getBatchNumber());
+ tasking.setTaskType(primitiveTask.getTaskType());
+ tasking.setLength(primitiveTask.getLength());
+ tasking.setWidth(primitiveTask.getWidth());
+ tasking.setThickness(primitiveTask.getThickness());
+ tasking.setIsMarking((primitiveTask.getDrawingMarking()==null||primitiveTask.getDrawingMarking().isEmpty())?0:1);
+ tasking.setDrawingMarking(primitiveTask.getDrawingMarking());
+ tasking.setIsSilkScreen(((primitiveTask.getSilkScreenX()==null||primitiveTask.getSilkScreenY()==null||primitiveTask.getSilkScreenX()==0||primitiveTask.getSilkScreenY()==0)?1:0));
+ tasking.setSilkScreenX(primitiveTask.getSilkScreenX()==null?0:primitiveTask.getSilkScreenX());
+ tasking.setSilkScreenY(primitiveTask.getSilkScreenY()==null?0:primitiveTask.getSilkScreenY());
+ tasking.setTaskSequence(primitiveTask.getTaskSequence());
+ tasking.setTaskQuantity(primitiveTask.getTaskQuantity());
+ tasking.setR_1_1(primitiveTask.getR_1_1()==null?0:primitiveTask.getR_1_1());
+ tasking.setR_1_2(primitiveTask.getR_1_2()==null?0:primitiveTask.getR_1_2());
+ tasking.setR_2_1(primitiveTask.getR_2_1()==null?0:primitiveTask.getR_2_1());
+ tasking.setR_2_2(primitiveTask.getR_2_2()==null?0:primitiveTask.getR_2_2());
+ tasking.setR_3_1(primitiveTask.getR_3_1()==null?0:primitiveTask.getR_3_1());
+ tasking.setR_3_2(primitiveTask.getR_3_2()==null?0:primitiveTask.getR_3_2());
+ tasking.setR_4_1(primitiveTask.getR_4_1()==null?0:primitiveTask.getR_4_1());
+ tasking.setR_4_2(primitiveTask.getR_4_2()==null?0:primitiveTask.getR_4_2());
+ return tasking;
+ }catch (Exception e) {
+ return null;
+ }
+ }
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/ProjectServiceImpl.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/ProjectServiceImpl.java
index b23b380..8458e56 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/ProjectServiceImpl.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/ProjectServiceImpl.java
@@ -1,11 +1,17 @@
package com.mes.md.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
-import com.mes.md.entity.Project;
-import com.mes.md.mapper.ProjectMapper;
-import com.mes.md.service.ProjectService;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.md.entity.*;
+import com.mes.md.mapper.*;
+import com.mes.md.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
/**
* <p>
@@ -18,4 +24,72 @@
@Service
public class ProjectServiceImpl extends MPJBaseServiceImpl<ProjectMapper, Project> implements ProjectService {
+ @Autowired
+ KBBTJPDrawingBPMapper kBBTJPDrawingBPMapper;
+
+ @Autowired
+ PrimitiveTaskService primitiveTaskService;
+ @Autowired
+ TaskingService taskingService;
+
+ @Autowired
+ PrimitiveTaskMapper primitiveTaskMapper;
+ @Autowired
+ TaskingMapper taskingMapper;
+
+ @Autowired
+ KBBTJPDrawingBPService kBBTJPDrawingBPService;
+
+ @Autowired
+ LineConfigurationService lineConfigurationService;
+
+ //鏍囧噯瀵煎叆宸ョ▼ 鏁版嵁
+ @Override
+ public boolean insertProjectStandard() {
+ //
+ try {
+ //鑾峰彇鏈�鏂版湰鍦版湭娣诲姞鐨勬暟鎹�
+ List<KBBTJPDrawingBP> kBBTJPDrawingBP=kBBTJPDrawingBPMapper.selectJoinList(KBBTJPDrawingBP.class,new MPJLambdaWrapper<KBBTJPDrawingBP>()
+ .selectAll(KBBTJPDrawingBP.class)
+ .eq(KBBTJPDrawingBP::getIsWorking,0)
+ .eq(KBBTJPDrawingBP::getTaskType,"鏍囧噯")
+ .orderByAsc(KBBTJPDrawingBP::getCreateDate)
+ .orderByAsc(KBBTJPDrawingBP::getTaskSequence));
+ List<PrimitiveTask> list=new ArrayList();
+ for (KBBTJPDrawingBP item:kBBTJPDrawingBP){
+ PrimitiveTask primitiveTask= kBBTJPDrawingBPService.convertListPrimitiveTask(item);
+ if(primitiveTask!=null){
+ //primitiveTaskMapper.insert(primitiveTask);
+ list.add(primitiveTask);
+ }
+ }
+ if(list.size()>0){
+ primitiveTaskService.saveBatch(list);
+ }
+
+ }catch (Exception e){
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * 鎵爜鐨勭幓鐠冩坊鍔犲埌鏁版嵁鍒版湰鍦�
+ * @param scan_id
+ * @return
+ */
+ @Override
+ public int insertProjectCustomization(String scan_id) {
+ //鏌ヨ鎵爜鏁版嵁 娣诲姞鍒板師鏁版嵁
+ try {
+ List<KBBTJPDrawingBP> kBBTJPDrawingBP=kBBTJPDrawingBPService.findScanIdKBBTJPDrawingBP(scan_id);
+ for (KBBTJPDrawingBP item:kBBTJPDrawingBP){
+ PrimitiveTask primitiveTask= kBBTJPDrawingBPService.convertListPrimitiveTask(item);
+ return primitiveTaskMapper.insert(primitiveTask);
+ }
+ }catch (Exception e){
+ return 0;
+ }
+ return 0;
+ }
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingServiceImpl.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingServiceImpl.java
index f35a9ac..c07ef4a 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingServiceImpl.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/service/impl/TaskingServiceImpl.java
@@ -4,20 +4,15 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.mes.common.S7object;
-import com.mes.device.PlcParameterObject;
-import com.mes.md.entity.GlassInfo;
-import com.mes.md.entity.LineConfiguration;
-import com.mes.md.entity.Machine;
-import com.mes.md.entity.Tasking;
-import com.mes.md.mapper.GlassInfoMapper;
-import com.mes.md.mapper.TaskingMapper;
-import com.mes.md.service.GlassInfoService;
-import com.mes.md.service.TaskingService;
+import com.mes.md.entity.*;
+import com.mes.md.mapper.*;
+import com.mes.md.service.*;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -29,12 +24,27 @@
* @author wu
* @since 2024-08-28
*/
+@Slf4j
@Service
public class TaskingServiceImpl extends MPJBaseServiceImpl<TaskingMapper, Tasking> implements TaskingService {
@Resource
GlassInfoMapper glassInfoMapper;
+ @Resource
+ LineConfigurationMapper lineConfigurationMapper;
@Autowired
GlassInfoService glassInfoService;
+ @Autowired
+ private PrimitiveTaskService primitiveTaskService;
+
+ @Autowired
+ private ProjectService projectService;
+ @Autowired
+ private PrimitiveTaskMapper primitiveTaskMapper;
+
+ @Autowired
+ private MachineMapper machineMapper;
+ @Autowired
+ private LineConfigurationService lineConfigurationService;
/**
* @param machine
@@ -56,9 +66,70 @@
}
/**
+ * @param machine
+ * 鏌ヨ姝ょ嚎绾夸笂鏈畬宸ョ殑浠诲姟 (绾夸笂/姝e父) 鐨勬寜鎵爜ID鏌ヨ
+ * @return
+ */
+ @Override
+ public List<Tasking> findMachineTaskID(Machine machine,String scan_id) {
+ List<LineConfiguration> machineLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machine.getId()));
+ if(!machineLineConfiguration.isEmpty()){
+ //姝よ澶囩嚎璺湭瀹屽伐鐨� 鐨勪换鍔�
+ List<Tasking> list=baseMapper.selectJoinList(Tasking.class,new MPJLambdaWrapper<Tasking>()
+ .selectAll(Tasking.class)
+ .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId)
+ .eq(LineConfiguration::getLineId,machineLineConfiguration.get(0).getLineId())
+ .eq(Tasking::getScanId,scan_id)
+ .eq(Tasking::getGlassState,"姝e父")
+ .eq(Tasking::getState,"绾夸笂")
+ .ne(Tasking::getWorkState,"瀹屽伐")
+ .orderByAsc(Tasking::getTaskSequence));
+ return list;
+ }else{
+ log.info("姝や换鍔D瀛樺湪浣嗘潯浠朵笉婊¤冻锛歿}",scan_id);
+ }
+ return null;
+ }
+ /**
+ * @param tasking
+ * 浠诲姟缁撴潫
+ * @return
+ */
+ @Override
+ public int stopTasking(Tasking tasking){
+ //1.鏍囪鎬昏〃浠诲姟缁撴潫 2.鍒犻櫎tasking 琛�
+ tasking.setWorkState("瀹屽伐");
+ baseMapper.updateById(tasking);
+ //瀹屽伐 /鐮存崯/鎷胯蛋鐨勭幓鐠�
+ List<Tasking> taskingList=baseMapper.selectList(new QueryWrapper<Tasking>().lambda()
+ .eq(Tasking::getScanId,tasking.getScanId())
+ .and(wrapper->wrapper
+ .eq(Tasking::getWorkState,"瀹屽伐")
+ .ne(Tasking::getState,"绾夸笅")
+ .ne(Tasking::getGlassState,"鐮存崯"))
+
+ );
+ if(!taskingList.isEmpty()){
+ List<PrimitiveTask> primitiveTask=primitiveTaskMapper.selectList(new QueryWrapper<PrimitiveTask>().lambda()
+ .eq(PrimitiveTask::getScanId,tasking.getScanId())
+ .orderByDesc(PrimitiveTask::getId));
+ for(PrimitiveTask task:primitiveTask){
+ if (taskingList.size()==task.getTaskQuantity()){
+ task.setReportCount(taskingList.size());
+ task.setEndTime(new Date());
+ primitiveTaskMapper.updateById(task);
+ return baseMapper.delete(new QueryWrapper<Tasking>().lambda().eq(Tasking::getScanId,tasking.getScanId()));
+ }
+ }
+ }
+ return 0;
+ }
+ /**
* @param machine锛寃orkState
* 鏌ヨ褰撳墠璁惧锛岀嚎涓娿�愮瓑寰�/宸ヤ綔/瀹屽伐銆戠殑浠诲姟 鍗囧簭 (绾夸笂/姝e父)
- * @return
+ * @return List<Tasking>
*/
@Override
public List<Tasking> findMachineWorkStateTask(Machine machine, String workState) {
@@ -73,7 +144,20 @@
.orderByAsc(Tasking::getTaskSequence));
return list;
}
-
+ /**
+ *
+ * 鏌ヨ绾夸笅姝e父鐨勭幓鐠�
+ * @return List<Tasking> findDownLineTask();
+ */
+ @Override
+ public List<Tasking> findDownLineTask() {
+ List<Tasking> list=baseMapper.selectJoinList(Tasking.class,new MPJLambdaWrapper<Tasking>()
+ .selectAll(Tasking.class)
+ .eq(Tasking::getGlassState,"姝e父")
+ .eq(Tasking::getState,"绾夸笅")
+ .orderByAsc(Tasking::getTaskSequence));
+ return list;
+ }
/**
* @param machine
@@ -92,6 +176,114 @@
}
return null;
}
+ /**
+ * @param machine
+ * 褰撳墠璁惧鏍囪姝e湪宸ヤ綔锛氶獙璇佺姝D鏄惁鏄� 绾夸笂绛夊緟鐨勪换鍔$涓�鏉�
+ * @return
+ */
+ @Override
+ public Tasking startMachineTask(Machine machine, String scan_id) {
+ List<Tasking> list=this.findMachineWorkStateTask(machine,"绛夊緟");
+ if(!list.isEmpty()){
+ Tasking tasking=list.get(0);
+ if(scan_id.equals(tasking.getScanId())){
+ tasking.setWorkState("姝e湪宸ヤ綔");
+ if(baseMapper.updateById(tasking)>0){
+ return tasking;
+ };
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param machine
+ * 褰撳墠 鎵爜ID 鏄惁鍦ㄥ綋鍓嶈澶囦互鍓嶅瓨鍦� 瀛樺湪鍒欑洿鎺ヨ烦鍒板綋鍓嶈澶� 骞朵笖鏍囪宸ヤ綔
+ * @return
+ */
+ @Override
+ public Tasking startScanIdMachineTask(Machine machine, String scan_id) {
+ //鎵惧綋鍓嶈澶囩嚎璺�
+ List<LineConfiguration> machineLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machine.getId()));
+ if(!machineLineConfiguration.isEmpty()){
+ //姝よ澶囩嚎璺湭瀹屽伐鐨� 鐨勪换鍔�
+ List<Tasking> list=baseMapper.selectJoinList(Tasking.class,new MPJLambdaWrapper<Tasking>()
+ .selectAll(Tasking.class)
+ .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId)
+ .eq(LineConfiguration::getLineId,machineLineConfiguration.get(0).getLineId())
+ .eq(Tasking::getScanId,scan_id)
+ .eq(Tasking::getGlassState,"姝e父")
+ .eq(Tasking::getState,"绾夸笂")
+ .le(LineConfiguration::getProcessSequence,machineLineConfiguration.get(0).getProcessSequence())
+ .orderByAsc(Tasking::getTaskSequence));
+ if(!list.isEmpty()){
+ Tasking tasking=list.get(0);
+ Integer taskSequence=1;
+ if (machine.getTodayCount()>0&&machine.getTodayCount()<5000){
+ taskSequence=machine.getTodayCount()+1;
+ }else{
+ taskSequence=1;
+ }
+ machine.setTodayCount(taskSequence);
+ machineMapper.updateById(machine);
+ tasking.setTaskSequence(taskSequence);
+ tasking.setWorkState("姝e湪宸ヤ綔");
+ tasking.setLineConfigurationId(machineLineConfiguration.get(0).getId());
+ if(baseMapper.updateById(tasking)>0){
+ finishMachineTask(machine);
+ return tasking;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @param machine
+ * 褰撳墠璁惧鏍囪瀹屾垚锛氭鍦ㄥ伐浣滅殑绗竴涓换鍔� (绾夸笂/姝e父) 杩斿洖瀹屾垚鏁伴噺
+ * @return
+ */
+ @Override
+ public int finishMachineTask(Machine machine,Integer taskSequence) {
+ List<Tasking> list=baseMapper.selectJoinList(Tasking.class,new MPJLambdaWrapper<Tasking>()
+ .selectAll(Tasking.class)
+ .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId)
+ .innerJoin(Machine.class,Machine::getId,LineConfiguration::getMachineId)
+ .eq(LineConfiguration::getMachineId,machine.getId())
+ .eq(Tasking::getGlassState,"姝e父")
+ .eq(Tasking::getState,"绾夸笂")
+ .eq(Tasking::getTaskSequence,taskSequence)
+ .eq(Tasking::getWorkState,"姝e湪宸ヤ綔")
+ .orderByAsc(Tasking::getTaskSequence));
+ //褰撳墠璁惧鐨勭嚎璺厤缃�
+ List<LineConfiguration> machineLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machine.getId()));
+ if(!machineLineConfiguration.isEmpty()){
+ List<LineConfiguration> listLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getLineId,machineLineConfiguration.get(0).getLineId())
+ .eq(LineConfiguration::getIsStart,1)
+ .gt(LineConfiguration::getProcessSequence,machineLineConfiguration.get(0).getProcessSequence())
+ .orderByAsc(LineConfiguration::getProcessSequence)
+ .orderByAsc(LineConfiguration::getPrioritySequence)
+ );
+ if(!list.isEmpty()){
+ Tasking tasking=list.get(0);
+ if (!listLineConfiguration.isEmpty()){
+ tasking.setLineConfigurationId(listLineConfiguration.get(0).getId());
+ tasking.setWorkState("绛夊緟");
+ return baseMapper.updateById(tasking);
+ }else{
+ return this.stopTasking(tasking);
+ }
+
+ }
+ }
+ return 0;
+ }
/**
* @param machine
@@ -101,10 +293,30 @@
@Override
public int finishMachineTask(Machine machine) {
List<Tasking> list=this.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
- if(!list.isEmpty()){
- Tasking tasking=list.get(0);
- tasking.setWorkState("瀹屽伐");
- return baseMapper.updateById(tasking);
+ //褰撳墠璁惧鐨勭嚎璺厤缃�
+ List<LineConfiguration> machineLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machine.getId()));
+ if(!machineLineConfiguration.isEmpty()){
+ List<LineConfiguration> listLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getLineId,machineLineConfiguration.get(0).getLineId())
+ .eq(LineConfiguration::getIsStart,1)
+ .gt(LineConfiguration::getProcessSequence,machineLineConfiguration.get(0).getProcessSequence())
+ .orderByAsc(LineConfiguration::getProcessSequence)
+ .orderByAsc(LineConfiguration::getPrioritySequence)
+ );
+ if(!list.isEmpty()){
+ Tasking tasking=list.get(0);
+ if (!listLineConfiguration.isEmpty()){
+ tasking.setLineConfigurationId(listLineConfiguration.get(0).getId());
+ tasking.setWorkState("绛夊緟");
+ return baseMapper.updateById(tasking);
+ }else{
+ return this.stopTasking(tasking);
+ }
+
+ }
}
return 0;
}
@@ -131,7 +343,24 @@
}
return 0;
}
-
+ @Override
+ public int glassDownLineOne(Machine machine){
+ List<Tasking> list=baseMapper.selectJoinList(Tasking.class,new MPJLambdaWrapper<Tasking>()
+ .selectAll(Tasking.class)
+ .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId)
+ .innerJoin(Machine.class,Machine::getId,LineConfiguration::getMachineId)
+ .eq(LineConfiguration::getMachineId,machine.getId())
+ .eq(Tasking::getGlassState,"姝e父")
+ .eq(Tasking::getState,"绾夸笂")
+ .eq(Tasking::getWorkState,"姝e湪宸ヤ綔")
+ .orderByDesc(Tasking::getTaskSequence));
+ if(!list.isEmpty()){
+ Tasking tasking=list.get(0);
+ tasking.setState("绾夸笅");
+ return baseMapper.updateById(tasking);
+ }
+ return 0;
+ }
/**
* @param tasking
* 鐮存崯鐜荤拑锛� (绾夸笂/姝e父) 杩斿洖鐮存崯鏁伴噺
@@ -155,7 +384,7 @@
public int glassDownLine(Tasking tasking) {
Tasking oldTasking=baseMapper.selectById(tasking);
if (!Objects.isNull(oldTasking)){
- oldTasking.setState(tasking.getState());
+ oldTasking.setState("绾夸笅");
return baseMapper.updateById(oldTasking);
}
return 0;
@@ -179,62 +408,85 @@
return resultCount;
}
- public int test(List<Tasking> taskingList) {
- int resultCount=0;
- //
- return resultCount;
+ /**
+ * @param taskingList
+ * 鎵归噺淇敼鐘舵�� 銆愪笂绾裤��
+ * @return
+ */
+ @Override
+ public int glassTopLine(Tasking taskingList) {
+ //褰撳墠璁惧鐨勭嚎璺厤缃�
+ Long machineId=taskingList.getLineConfigurationId();
+ List<LineConfiguration> machineLineConfiguration=lineConfigurationMapper.selectJoinList(LineConfiguration.class,new MPJLambdaWrapper<LineConfiguration>()
+ .selectAll(LineConfiguration.class)
+ .eq(LineConfiguration::getMachineId,machineId));
+ if(!machineLineConfiguration.isEmpty()){
+ Tasking oldTasking=baseMapper.selectById(taskingList);
+ if (!Objects.isNull(oldTasking)){
+ oldTasking.setLineConfigurationId(machineLineConfiguration.get(0).getId());
+ oldTasking.setState("绾夸笂");
+ oldTasking.setWorkState("绛夊緟");
+ oldTasking.setGlassState("姝e父");
+ return baseMapper.updateById(oldTasking);
+ }
+ }
+ return 0;
}
-//
-// @Override
-// public boolean updateStatus(Integer state) {
-// //鏇存敼涓婄墖妯″紡
-// //鍚戣澶囧彂閫侀�夋嫨鐨勭姸鎬�
-// S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("Status").getAddress(), state);
-// //鍙戦�佸悗閲嶆柊璇诲彇鍒ゆ柇鏄惁鏇存敼鎴愬姛
-// String loadStatus = plcParameterObject.getPlcParameter("Status").getValue();
-// return state == Integer.parseInt(loadStatus);
-//
-// }
-//
-// /**
-// * @param state
-// * @return
-// */
-// @Override
-// public boolean updateLoadState(Integer state) {
-// //鏇存敼鑱旀満鐘舵��
-// //鍚戣澶囧彂閫侀�夋嫨鐨勭姸鎬�
-// S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("loadState").getAddress(), state);
-// //鍙戦�佸悗閲嶆柊璇诲彇鍒ゆ柇鏄惁鏇存敼鎴愬姛
-// String loadState = plcParameterObject.getPlcParameter("loadState").getValue();
-// return state == Integer.parseInt(loadState);
-//
-// }
-//
-// @Override
-// public boolean updateDamage(Tasking tasking) {
-// UpdateWrapper<Tasking> queryWrapper = new UpdateWrapper<>();
-// queryWrapper.eq("glass_id",tasking.getGlassId())
-// .set("work_state",tasking.getWorkState());
-// return this.update(queryWrapper);
-// }
-//
-// @Override
-// public List<Tasking> selectTasking() {
-// QueryWrapper<Tasking> queryWrapper = new QueryWrapper<>();
-// queryWrapper.orderByDesc("task_sequence");
-// return list(queryWrapper);
-// }
-// @Override
-// public Tasking selectTasking(Tasking tasking) {
-// QueryWrapper<Tasking> queryWrapper = new QueryWrapper<>();
-// queryWrapper.eq("line_configuration_id",tasking.getLineConfigurationId())
-// .eq("state",tasking.getState())
-// .eq("work_state",tasking.getWorkState())
-// .orderByAsc("glass_id");
-// return getOne(queryWrapper);
-// }
+
+ /**
+ * @param machine
+ * 鎵爜璁惧 娣诲姞浠诲姟
+ * 鏌ョ湅PrimitiveTask琛ㄦ槸鍚﹀瓨鍦ㄦ鎵爜鏁版嵁
+ * 瀛樺湪鍒欐牴鎹� 鍐呭 鍒涘缓 tasking浠诲姟 骞舵帓搴�
+ * 涓嶅瓨鍦ㄥ垯 鏌ヨ涔濈墽鏁版嵁搴撴坊鍔� PrimitiveTask琛�
+ *
+ * @return
+ */
+ @Override
+ public int scanMachineAdd(Machine machine, String scanId){
+ String errorStr="";
+ if(!Objects.isNull(scanId)){
+ List<PrimitiveTask> primitiveTaskList=primitiveTaskMapper.selectList(new QueryWrapper<PrimitiveTask>().lambda()
+ .eq(PrimitiveTask::getScanId,scanId));
+ if(!primitiveTaskList.isEmpty()){
+ PrimitiveTask primitiveTask=primitiveTaskList.get(0);
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<Tasking> listTasking=baseMapper.selectList(new QueryWrapper<Tasking>().lambda()
+ .eq(Tasking::getScanId,scanId)
+ .ne(Tasking::getState,"绾夸笅")
+ .ne(Tasking::getGlassState,"鐮存崯"));
+ if(listTasking.size()<primitiveTaskList.get(0).getTaskQuantity()){
+ Tasking tasking=primitiveTaskService.convertListTasking(primitiveTask,lineConfiguration.getId());
+ Integer taskSequence=1;
+ if (machine.getTodayCount()>0&&machine.getTodayCount()<5000){
+ taskSequence=machine.getTodayCount()+1;
+ }else{
+ taskSequence=1;
+ }
+ machine.setTodayCount(taskSequence);
+ tasking.setTaskSequence(taskSequence);
+ machineMapper.updateById(machine);
+ return baseMapper.insert(tasking);
+ }
+ errorStr="鎵爜ID锛�"+scanId+" 绾夸笂鐜荤拑宸茶揪鍒颁笅鍙戜笂绾� 涓嬪彂浠诲姟鏁帮細"+primitiveTaskList.get(0).getTaskQuantity()+" 浜х嚎浠诲姟鏁�:"+listTasking.size();
+ if (!errorStr.equals(machine.getRemark())){
+ machine.setRemark(errorStr);
+ machineMapper.updateById(machine);
+ }
+ }else{
+ int insertCount=projectService.insertProjectCustomization(scanId);
+ errorStr="鎵爜ID锛�"+scanId+" 涔濈墽IT鏁版嵁搴撴湭涓嬪彂";
+ if (insertCount<1&&!errorStr.equals(machine.getRemark())){
+ machine.setRemark(errorStr);
+ machineMapper.updateById(machine);
+ }
+ }
+
+ }
+ return 0;
+ }
+
@Override
public Boolean insertTasking(String status) {
Tasking tasking = new Tasking();
@@ -271,6 +523,7 @@
return save(tasking);
}
+
@Override
public boolean updateTasking(String scanId) {
Tasking glass=new Tasking();
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java
new file mode 100644
index 0000000..e7762c5
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java
@@ -0,0 +1,313 @@
+package com.mes.plcTaskThread;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.mes.md.entity.LineConfiguration;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.PrimitiveTask;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.LineConfigurationService;
+import com.mes.md.service.PrimitiveTaskService;
+import com.mes.md.service.TaskingService;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineEdging extends Thread{
+
+ TaskingMapper taskingMapper;
+
+ MachineMapper machineMapper;
+
+ TaskingService taskingService;
+
+ PrimitiveTaskService primitiveTaskService;
+
+ LineConfigurationService lineConfigurationService;
+ public static int thinness = 40;
+ public static int edgSpeed = 40;
+ public static Long machineId = 6L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public MachineEdging(TaskingMapper taskingMapper, MachineMapper machineMapper, TaskingService taskingService, PrimitiveTaskService primitiveTaskService, LineConfigurationService lineConfigurationService){
+ this.taskingMapper = taskingMapper;
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ this.primitiveTaskService = primitiveTaskService;
+ this.lineConfigurationService = lineConfigurationService;
+ }
+
+ public void plcStart() {
+ Machine machine=machineMapper.selectById(machineId);
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),"PlcEdging");
+ try {
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement("PlcEdging");
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter inputOrOut2 =plcAgreement.getPlcParameter("inputOrOut2");
+ edgSpeed=inputOrOut2.getValueInt();
+
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter plcReport2 =plcAgreement.getPlcParameter("plcReport2");//鎵嬪姩姹囨姤瀛�
+ PlcParameter plcReportID2 =plcAgreement.getPlcParameter("plcReportID2");//鎵嬪姩姹囨姤ID
+
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ PlcParameter mesConfirm2 =plcAgreement.getPlcParameter("mesConfirm2");//鎵嬪姩纭瀛�
+ PlcParameter mesConfirmID2 =plcAgreement.getPlcParameter("mesConfirmID2");//鎵嬪姩纭ID
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ log.info("1.鍙戦�佸瓧缃浂");
+ //鍙戦�佸瓧缃�0
+ String send= HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport2.getValueInt()&&0!=mesConfirm2.getValueInt()) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�");
+ if(finishCount>0) {//鏈変换鍔�
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(4==plcReport2.getValueInt()&&0==mesConfirm2.getValueInt()){
+ int finishCount=taskingService.glassDownLineOne(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("4銆佷汉宸ユ嬁璧�");
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋寮傚父 鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(2==plcReport2.getValueInt()&&0==mesConfirm2.getValueInt()){
+ int finishCount=taskingService.loseMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("2銆侀噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ log.info("2銆佸紓甯搁噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("寮傚父閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ }
+
+ if(3==plcReport2.getValueInt()&&0==mesConfirm2.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("3銆佽澶囦笂浜哄伐鐐圭牬鎹�");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("浜哄伐鐐圭牬鎹熷彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ //鏄惁鑷姩娓呴櫎鐮存崯
+ log.info("3銆佹棤鏁堢牬鎹� 锛堟病鏈夋壘鍒版ID鐨勭幓鐠冿級");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()/2));
+ log.info("鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm2.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Machine loadMachine=machineMapper.selectById(2L);
+ Tasking tasking;
+ String scan_id="";
+ if(loadMachine.getMode()==1){
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+ //娣诲姞鏁版嵁:
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+ List<Tasking> taskingTopList=taskingMapper.selectList(new QueryWrapper<Tasking>().lambda()
+ .eq(Tasking::getScanId,primitiveTask.getScanId())
+ );
+ //浠诲姟鏁�>宸蹭笂鏁伴噺
+ if(taskingTopList.size()<primitiveTask.getTaskQuantity()){
+ Tasking taskingAdd=primitiveTaskService.convertListTasking(primitiveTask,lineConfiguration.getId());
+ Integer taskSequence=1;
+ if (machine.getTodayCount()>0&&machine.getTodayCount()<5000){
+ taskSequence=machine.getTodayCount()+1;
+ }else{
+ taskSequence=1;
+ }
+ machine.setTodayCount(taskSequence);
+ taskingAdd.setTaskSequence(taskSequence);
+ machineMapper.updateById(machine);
+ taskingMapper.insert(taskingAdd);
+ }
+ break;
+ }
+ tasking=taskingService.startMachineTask(machine);
+ }else{
+ //瀹氬埗妯″紡
+ String PlcRequestID_=clientTCPSocket();
+ //String PlcRequestID_=",,46607221";
+ if (PlcRequestID_==null||PlcRequestID_.lastIndexOf(",")<0){
+ modbusTcp1.close();
+ errorMachine(machine,("鎵笉鍒扮爜:"+PlcRequestID_));
+ return;
+ }
+ scan_id= PlcRequestID_.substring(PlcRequestID_.lastIndexOf(",")+1);
+ tasking=taskingService.startMachineTask(machine,scan_id);
+ }
+ if(tasking!=null){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",machine,tasking);
+ String send=
+ HexUtil.intTo2ByteHex(1)+
+ HexUtil.intTo2ByteHex(tasking.getGlassId().intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getLength()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getWidth()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getThickness()*10)).intValue());
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ errorMachine(machine,"");
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getWidth()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getThickness();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }else if(!scan_id.isEmpty()){
+ taskingService.scanMachineAdd(machine,scan_id);
+ modbusTcp1.close();
+ return;
+ }
+ }
+ //}
+
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+
+ modbusTcp1.close();
+ //log.info("鏃犲彲鎵ц鐨勬潯浠�");
+ }
+
+
+ public void errorMachine(Machine machine,String error) {
+ if (!error.equals(machine.getRemark())){
+ machine.setRemark(error);
+ machineMapper.updateById(machine);
+ }
+ }
+ public String clientTCPSocket() {
+ try {
+ Machine machine=machineMapper.selectById(4L);
+ Socket clientSocket = new Socket(machine.getIp(), machine.getPort());
+ try {
+ clientSocket.setSoTimeout(1000);
+ // 鍒涘缓杈撳叆娴佸拰杈撳嚭娴�
+ InputStream inputStream = clientSocket.getInputStream();
+ OutputStream outputStream = clientSocket.getOutputStream();
+ // 鍙戦�佸惎鍔ㄥ懡浠�
+ String message = "start";
+ outputStream.write(message.getBytes());
+ // 璇诲彇鏈嶅姟鍣ㄥ搷搴旂殑鏁版嵁
+ byte[] buffer = new byte[1024];
+ int bytesRead = inputStream.read(buffer);
+ String receivedMessage = new String(buffer, 0, bytesRead);
+ System.out.println("鏀跺埌鎵爜鏋繑鍥炲唴瀹癸細" + receivedMessage);
+ // 鍏抽棴杩炴帴
+ String message2 = "stop";
+ outputStream.write(message2.getBytes());
+ clientSocket.close();
+ return receivedMessage;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ clientSocket.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return "";
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java
new file mode 100644
index 0000000..c22fdef
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java
@@ -0,0 +1,144 @@
+package com.mes.plcTaskThread;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.common.S7objectMachine;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.TaskingService;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineFlipSlice extends Thread{
+
+
+ private MachineMapper machineMapper;
+ private TaskingService taskingService;
+ private S7objectMachine s7objectMachine;
+ public static int thinness = 40;
+ public static int edgSpeed = 40;
+ public static Long machineId = 6L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public MachineFlipSlice(MachineMapper machineMapper, TaskingService taskingService){
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ }
+
+ public void plcStart() {
+ Long machineId=26L;
+ Machine machine=machineMapper.selectById(machineId);
+ if (s7objectMachine==null){
+ s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcFlipSlice", EPlcType.S1200);
+ s7objectMachine.start();
+ }
+ PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
+ PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameterInfo plcRequestType =plcParameterObject.getPlcParameter("plcRequestType");//PLC璇锋眰
+
+ PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameterInfo mesSendId =plcParameterObject.getPlcParameter("mesSendID");//鍙戦�両D
+ PlcParameterInfo length =plcParameterObject.getPlcParameter("length");//闀�
+ PlcParameterInfo width =plcParameterObject.getPlcParameter("width");//瀹�
+ PlcParameterInfo mesSendType =plcParameterObject.getPlcParameter("mesSendType");// 鎵爜1 涓嶆壂鐮�2
+
+ String scan_id="";
+ if (machine.getIsLog()>0){
+ s7objectMachine.consoleLogInfo();
+ }
+ if ("0".equals(plcRequestType.getValue())&&!"0".equals(mesSendType.getValue())) {
+ //鍙戦�佸瓧缃�0
+ log.info("1.鍙戦�佺被鍨嬪瓧缃浂,娓呴櫎涓婃鍙戦�佺殑绫诲瀷鏁版嵁{}->0",mesSendType.getValue());
+ s7objectMachine.plccontrol.writeWord(mesSendType.getAddress(), 0);
+ return;
+ }
+ if ("0".equals(plcRequest.getValue())&&!"0".equals(mesSend.getValue())) {
+ //鍙戦�佸瓧缃�0
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("2.鍙戦�佸瓧缃浂,娓呴櫎涓婃鍙戦�佺殑鏁版嵁{},{},{},{},{}"
+ ,finishCount
+ ,length.getValue()
+ ,width.getValue()
+ ,mesSendId.getValue()
+ ,mesSend.getValue());
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSendId.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 0);
+ return;
+ }
+ if ("1".equals(plcRequestType.getValue())&&"0".equals(mesSendType.getValue())) {
+ //鍙戦�佺被鍨� 1鎵爜 2涓嶆壂鐮�
+ int type=machine.getMode()==1?2:1;
+ log.info("3.鍙戦�佺被鍨嬫暟鎹�0->{}",mesSendType.getValue());
+ s7objectMachine.plccontrol.writeWord(mesSendType.getAddress(), type);
+ return;
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if(("1".equals(plcRequest.getValue())&&"0".equals(mesSend.getValue())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount())){
+ Tasking tasking;
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡
+ tasking=taskingService.startMachineTask(machine);
+ }else{
+ //瀹氬埗妯″紡
+ String PlcRequestID_=plcRequestID.getValue();
+ //String PlcRequestID_=",,46403118";
+ scan_id= PlcRequestID_.substring(PlcRequestID_.lastIndexOf(",")+1);
+ tasking=taskingService.startScanIdMachineTask(machine,scan_id);//涓嶇椤哄簭锛岀洿鎺ユ壘浠庣(杈规満鎵爜鍚庡埌缈荤墖鍙扮殑鏁版嵁
+ }
+ if(tasking!=null){
+ log.info("4銆佸彂閫佹暟鎹�:{},{},{},{},{}"
+ ,tasking.getGlassId(),tasking.getProgramId()
+ ,tasking.getLength().intValue(),tasking.getWidth().intValue(),1);
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), tasking.getLength().intValue());
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), tasking.getWidth().intValue());
+ s7objectMachine.plccontrol.writeString(mesSendId.getAddress(), tasking.getGlassId().toString());
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 1);
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getWidth();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ nullMachine(machine);
+ return;
+ }else if(!scan_id.isEmpty()){
+ taskingService.scanMachineAdd(machine,scan_id);
+ }
+ }
+
+ }
+
+
+ public void nullMachine(Machine machine) {
+ if (!"".equals(machine.getRemark())){
+ machine.setRemark("");
+ machineMapper.updateById(machine);
+ }
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java
new file mode 100644
index 0000000..bc23ffb
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java
@@ -0,0 +1,164 @@
+package com.mes.plcTaskThread;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.mes.md.entity.LineConfiguration;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.PrimitiveTask;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.PrimitiveTaskMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.LineConfigurationService;
+import com.mes.md.service.PrimitiveTaskService;
+import com.mes.md.service.TaskingService;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineLoad extends Thread{
+
+ TaskingMapper taskingMapper;
+
+ MachineMapper machineMapper;
+
+ TaskingService taskingService;
+
+ PrimitiveTaskService primitiveTaskService;
+
+ PrimitiveTaskMapper primitiveTaskMapper;
+
+ LineConfigurationService lineConfigurationService;
+
+ public Long machineId = 2L;
+ public List<Map> sendRecords = new ArrayList<>();
+ public MachineLoad(TaskingMapper taskingMapper, MachineMapper machineMapper, TaskingService taskingService, PrimitiveTaskService primitiveTaskService, LineConfigurationService lineConfigurationService){
+ this.taskingMapper = taskingMapper;
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ this.primitiveTaskService = primitiveTaskService;
+ this.lineConfigurationService = lineConfigurationService;
+ }
+ public void plcStart() {
+ Machine machine=machineMapper.selectById(machineId);
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),"PlcLoad");
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement("PlcLoad");
+ try {
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameter mesSendCount =plcAgreement.getPlcParameter("mesSendCount");//鍙戦�佹暟閲�
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ //鍙戦�佸瓧缃�0
+ String send= HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("1.鍙戦�佸瓧缃浂 鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ //纭瀛楃疆闆�
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("2.纭瀛楃疆闆� 浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=plcReportID.getValueInt();
+ if(finishCount>0) {//鏈変换鍔�
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+ primitiveTask.setReportCount(primitiveTask.getReportCount()+plcReportID.getValueInt());
+ primitiveTaskMapper.updateById(primitiveTask);
+ break;
+ }
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/ 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())){
+ int loadCount=0;
+ if(machine.getMode()==1){
+
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+ //浠诲姟鏁�>宸蹭笂鏁伴噺
+ List<Tasking> taskingTopList=taskingMapper.selectList(new QueryWrapper<Tasking>().lambda()
+ .eq(Tasking::getScanId,primitiveTask.getScanId())
+ );
+ loadCount=primitiveTask.getTaskQuantity()-taskingTopList.size();
+ loadCount=(loadCount>0?loadCount:0);
+ break;
+ }
+ }else{
+ //瀹氬埗妯″紡
+ loadCount=1;
+ }
+ if(loadCount>0){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",loadCount,machine);
+ String send=HexUtil.intTo2ByteHex(1)+ HexUtil.intTo2ByteHex(loadCount);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ modbusTcp1.close();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+"1 "+ loadCount;
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+ modbusTcp1.close();
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java
new file mode 100644
index 0000000..d3924bf
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java
@@ -0,0 +1,139 @@
+package com.mes.plcTaskThread;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.common.S7objectMachine;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.TaskingService;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineMarking extends Thread{
+
+
+ private MachineMapper machineMapper;
+ private TaskingService taskingService;
+ private S7objectMachine s7objectMachine;
+ public static int thinness = 40;
+ public static int edgSpeed = 40;
+ public static Long machineId = 6L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public MachineMarking(MachineMapper machineMapper, TaskingService taskingService){
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ }
+
+ public void plcStart() {
+ Long machineId=12L;
+ Machine machine=machineMapper.selectById(machineId);
+ if (s7objectMachine==null){
+ s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcMarking", EPlcType.S1500);
+ s7objectMachine.start();
+ }
+ PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
+ PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameterInfo isMark =plcParameterObject.getPlcParameter("isMark");//鍙戦�両D銆�0 涓嶆墦鏍囷紝1鏍囧噯妯″紡锛�2瀹氬埗妯″紡銆�
+ PlcParameterInfo drawingMark =plcParameterObject.getPlcParameter("drawingMark");//鎵撴爣鍥剧焊鍦板潃
+ PlcParameterInfo lengthOutOfService =plcParameterObject.getPlcParameter("length(OutOfService)");//闀�
+ PlcParameterInfo widthOutOfService =plcParameterObject.getPlcParameter("width(OutOfService)");//瀹�
+ PlcParameterInfo markingMode =plcParameterObject.getPlcParameter("markingMode");//
+
+ PlcParameterInfo plcReport =plcParameterObject.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameterInfo plcReportID =plcParameterObject.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameterInfo mesConfirm =plcParameterObject.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameterInfo mesConfirmID =plcParameterObject.getPlcParameter("mesConfirmID");//纭ID
+ if (machine.getIsLog()>0){
+ s7objectMachine.consoleLogInfo();
+ }
+ if ("0".equals(plcRequest.getValue())&&"1".equals(mesSend.getValue())) {
+ //鍙戦�佸瓧缃�0
+ log.info("1.鍙戦�佸瓧缃浂,娓呴櫎涓婃鍙戦�佺殑鏁版嵁{},{},{},{},{}"
+ ,markingMode.getValue()
+ ,isMark.getValue()
+ ,lengthOutOfService.getValue()
+ ,widthOutOfService.getValue()
+ ,mesSend.getValue());
+ //S7objectMarking.getinstance().plccontrol.writeString(drawingMark.getAddress(),"");
+ s7objectMachine.plccontrol.writeWord(markingMode.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(lengthOutOfService.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(widthOutOfService.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(isMark.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 0);
+ return;
+ }
+ if ("0".equals(plcReport.getValue())&&"1".equals(mesConfirm.getValue())) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ s7objectMachine.plccontrol.writeWord(mesConfirm.getAddress(), 0);
+ return;
+ }
+ if("1".equals(plcReport.getValue())&&"0".equals(mesConfirm.getValue())){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�");
+ if(finishCount>0){//鏈変换鍔�
+ s7objectMachine.plccontrol.writeWord(mesConfirm.getAddress(), 1);
+ return;
+ }
+ return;
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if("1".equals(plcRequest.getValue())&&"0".equals(mesSend.getValue())&& !plcRequestID.getValue().isEmpty()
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Tasking tasking=taskingService.startMachineTask(machine);
+ if(tasking!=null){
+ //妯″紡锛�1瀹氬埗 0 鎵归噺 鏄惁鎵撴爣锛�0涓嶆墦鏍� 1鎵撴爣
+ int isMark_=(tasking.getDrawingMarking()==null||tasking.getDrawingMarking().isEmpty())?0:1;
+ int isMarkingMode_="瀹氬埗".equals(tasking.getTaskType()) ?1:0;
+ log.info("4銆佸彂閫佹暟鎹�:{},{},{},{},{},{}"
+ ,tasking.getProgramId()
+ ,tasking.getLength().intValue(),tasking.getWidth().intValue(),isMark_,isMarkingMode_,1);
+ if(isMark_==1){
+ s7objectMachine.plccontrol.writeString(drawingMark.getAddress(), tasking.getProgramId());
+ }
+ s7objectMachine.plccontrol.writeWord(lengthOutOfService.getAddress(), tasking.getLength().intValue());
+ s7objectMachine.plccontrol.writeWord(widthOutOfService.getAddress(), tasking.getWidth().intValue());
+ s7objectMachine.plccontrol.writeWord(isMark.getAddress(), isMark_);
+ s7objectMachine.plccontrol.writeWord(markingMode.getAddress(), isMarkingMode_);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 1);
+
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getScanId()+"-"+
+ tasking.getProgramId()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getWidth()+"-"+
+ isMark_+"-"+
+ isMarkingMode_;
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java
new file mode 100644
index 0000000..3fcff53
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java
@@ -0,0 +1,143 @@
+package com.mes.plcTaskThread;
+
+import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
+import com.mes.common.S7objectMachine;
+import com.mes.device.PlcParameterInfo;
+import com.mes.device.PlcParameterObject;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.TaskingService;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineRotate extends Thread{
+
+
+ private MachineMapper machineMapper;
+ private TaskingService taskingService;
+ private S7objectMachine s7objectMachine;
+ public static Long machineId = 6L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public MachineRotate(MachineMapper machineMapper, TaskingService taskingService){
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ }
+ public void plcStart() {
+ //鏃嬭浆鍙�
+ Long machineId=20L;
+ Machine machine=machineMapper.selectById(machineId);
+ if (s7objectMachine==null){
+ s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcRotate", EPlcType.S1200);
+ s7objectMachine.start();
+ }
+ PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
+ PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameterInfo plcRequestType =plcParameterObject.getPlcParameter("plcRequestType");//PLC璇锋眰
+
+ PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameterInfo mesSendId =plcParameterObject.getPlcParameter("mesSendID");//鍙戦�両D
+ PlcParameterInfo length =plcParameterObject.getPlcParameter("length");//闀�
+ PlcParameterInfo width =plcParameterObject.getPlcParameter("width");//瀹�
+ PlcParameterInfo rotateType =plcParameterObject.getPlcParameter("rotateType");//鏃嬭浆绫诲瀷
+
+ PlcParameterInfo mesSendType =plcParameterObject.getPlcParameter("mesSendType");// 鎵爜1 涓嶆壂鐮�2
+ String scan_id="";
+ if (machine.getIsLog()>0){
+ s7objectMachine.consoleLogInfo();
+ }
+ if ("0".equals(plcRequestType.getValue())&&!"0".equals(mesSendType.getValue())) {
+ //鍙戦�佸瓧缃�0
+ log.info("1.鍙戦�佺被鍨嬪瓧缃浂,娓呴櫎涓婃鍙戦�佺殑绫诲瀷鏁版嵁{}->0",mesSendType.getValue());
+ s7objectMachine.plccontrol.writeWord(mesSendType.getAddress(), 0);
+ return;
+ }
+ if ("0".equals(plcRequest.getValue())&&!"0".equals(mesSend.getValue())) {
+ //鍙戦�佸瓧缃�0
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("1.鍙戦�佸瓧缃浂,娓呴櫎涓婃鍙戦�佺殑鏁版嵁{},{},{},{},{}"
+ ,finishCount
+ ,length.getValue()
+ ,width.getValue()
+ ,mesSendId.getValue()
+ ,mesSend.getValue());
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSendId.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(rotateType.getAddress(), 0);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 0);
+ return;
+ }
+ if ("1".equals(plcRequestType.getValue())&&"0".equals(mesSendType.getValue())) {
+ //鍙戦�佺被鍨� 1鎵爜 2涓嶆壂鐮�
+ int type=machine.getMode()==1?2:1;
+ log.info("3.鍙戦�佺被鍨嬫暟鎹�0->{}",mesSendType.getValue());
+ s7objectMachine.plccontrol.writeWord(mesSendType.getAddress(), type);
+ return;
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if("1".equals(plcRequest.getValue())&&"0".equals(mesSend.getValue())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Tasking tasking;
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡
+ tasking=taskingService.startMachineTask(machine);
+ }else{
+ //瀹氬埗妯″紡
+ String PlcRequestID_=plcRequestID.getValue();
+ scan_id= PlcRequestID_.substring(PlcRequestID_.lastIndexOf(",")+1);
+ //鏍囪褰撳墠宸ュ簭 浠ュ墠鐨勭幓鐠� 鐩存帴鍒板綋鍓嶅伐搴�
+ tasking=taskingService.startScanIdMachineTask(machine,scan_id);//涓嶇椤哄簭锛岀洿鎺ユ壘浠庣炕鐗囧彴鎵爜鍚庡埌鏃嬭浆鍙扮殑鏁版嵁
+ }
+ if(tasking!=null){
+ log.info("4銆佸彂閫佹暟鎹�:{},{},{},{},{}"
+ ,tasking.getGlassId(),tasking.getProgramId()
+ ,tasking.getLength().intValue(),tasking.getWidth().intValue(),1);
+ s7objectMachine.plccontrol.writeWord(length.getAddress(), tasking.getLength().intValue());
+ s7objectMachine.plccontrol.writeWord(width.getAddress(), tasking.getWidth().intValue());
+ s7objectMachine.plccontrol.writeString(mesSendId.getAddress(), tasking.getGlassId().toString());
+ s7objectMachine.plccontrol.writeWord(rotateType.getAddress(), 1);
+ s7objectMachine.plccontrol.writeWord(mesSend.getAddress(), 1);
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getWidth();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ nullMachine(machine);
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ }else if(!scan_id.isEmpty()){
+ taskingService.scanMachineAdd(machine,scan_id);
+ }
+ }
+
+ }
+ public void nullMachine(Machine machine) {
+ if (!"".equals(machine.getRemark())){
+ machine.setRemark("");
+ machineMapper.updateById(machine);
+ }
+ }
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java
new file mode 100644
index 0000000..a3f152a
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java
@@ -0,0 +1,211 @@
+package com.mes.plcTaskThread;
+
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.service.TaskingService;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineSilkScreen extends Thread{
+
+
+ private MachineMapper machineMapper;
+ private TaskingService taskingService;
+ public static Long machineId = 14L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public MachineSilkScreen(MachineMapper machineMapper, TaskingService taskingService){
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ }
+
+ public void plcStart() {
+ Machine machine=machineMapper.selectById(machineId);
+ String fileName="PlcSilkScreen";
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),fileName);
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement(fileName);
+ try {
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter plcRequestID =plcAgreement.getPlcParameter("plcRequestID");//璇锋眰ID
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameter mesSendID =plcAgreement.getPlcParameter("mesSendID");//鍙戦�両D
+ PlcParameter length =plcAgreement.getPlcParameter("length");//闀�
+ PlcParameter width =plcAgreement.getPlcParameter("width");//瀹�
+ PlcParameter thickness =plcAgreement.getPlcParameter("thickness");//鍘�
+ PlcParameter X =plcAgreement.getPlcParameter("X");//X
+ PlcParameter Y =plcAgreement.getPlcParameter("Y");//Y
+ //PlcParameter isSilkScreen =plcAgreement.getPlcParameter("isSilkScreen");//鏄惁涓濆嵃
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ PlcParameter machineStatusWord =plcAgreement.getPlcParameter("machineStatusWord");
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ log.info("1.鍙戦�佸瓧缃浂");
+ //鍙戦�佸瓧缃�0
+ String send= HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ log.info("2.纭瀛楃疆闆�");
+ //鍙戦�佸瓧缃�0
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�");
+ if(finishCount>0) {//鏈変换鍔�
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(4==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.glassDownLineOne(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("4銆佷汉宸ユ嬁璧�");
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send=HexUtil.intTo2ByteHex(4);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鎷胯蛋寮傚父 鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(2==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.loseMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("2銆侀噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ log.info("2銆佸紓甯搁噸鍙�");
+ String send=HexUtil.intTo2ByteHex(2);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("寮傚父閲嶅彂鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ }
+
+ if(3==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ if(finishCount>0){//鏈変换鍔�
+ log.info("3銆佽澶囦笂浜哄伐鐐圭牬鎹�");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("浜哄伐鐐圭牬鎹熷彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }else{
+ //鏄惁鑷姩娓呴櫎鐮存崯
+ log.info("3銆佹棤鏁堢牬鎹� 锛堟病鏈夋壘鍒版ID鐨勭幓鐠冿級");
+ String send=HexUtil.intTo2ByteHex(3);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("鍙戦�佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ //modbusTcp1.close();
+ return;
+ }
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())
+ &&taskingCount.size()<machine.getMaxTaskCount()){
+ Tasking tasking=taskingService.startMachineTask(machine);
+ if(tasking!=null){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",machine,tasking);
+ String send=
+ HexUtil.intTo2ByteHex(1)+
+ HexUtil.intTo2ByteHex(tasking.getTaskSequence().intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getWidth()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getLength()*10)).intValue())+
+ HexUtil.intTo2ByteHex(tasking.getThickness().intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getSilkScreenX()*10)).intValue())+
+ HexUtil.intTo2ByteHex(((Double)(tasking.getSilkScreenY()*10)).intValue())+
+ HexUtil.intTo2ByteHex(tasking.getIsSilkScreen());//鏄惁涓濆嵃锛� 0涓濆嵃 1涓嶄笣鍗�
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+
+ tasking.getGlassId()+"-"+
+ tasking.getWidth()+"-"+
+ tasking.getLength()+"-"+
+ tasking.getThickness()+"-"+
+ tasking.getSilkScreenX()+"-"+
+ tasking.getSilkScreenX()+"-"+
+ tasking.getSilkScreenY()+"-"+
+ tasking.getIsSilkScreen();
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ //}
+
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+
+ modbusTcp1.close();
+ //log.info("鏃犲彲鎵ц鐨勬潯浠�");
+ }
+
+
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ plcStart();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java
new file mode 100644
index 0000000..c6a1041
--- /dev/null
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java
@@ -0,0 +1,159 @@
+package com.mes.plcTaskThread;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.mes.md.entity.LineConfiguration;
+import com.mes.md.entity.Machine;
+import com.mes.md.entity.PrimitiveTask;
+import com.mes.md.entity.Tasking;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.TaskingMapper;
+import com.mes.md.service.*;
+import com.mes.service.ModbusTcp;
+import com.mes.service.PlcAgreement;
+import com.mes.service.PlcParameter;
+import com.mes.utils.HexUtil;
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@Slf4j
+public class MachineThread extends Thread{
+
+ TaskingMapper taskingMapper;
+
+ MachineMapper machineMapper;
+
+ TaskingService taskingService;
+
+ PrimitiveTaskService primitiveTaskService;
+
+ LineConfigurationService lineConfigurationService;
+
+ public MachineThread(TaskingMapper taskingMapper, MachineMapper machineMapper, TaskingService taskingService, PrimitiveTaskService primitiveTaskService, LineConfigurationService lineConfigurationService){
+ this.taskingMapper = taskingMapper;
+ this.machineMapper = machineMapper;
+ this.taskingService = taskingService;
+ this.primitiveTaskService = primitiveTaskService;
+ this.lineConfigurationService = lineConfigurationService;
+ }
+
+
+ public Long machineId = 2L;
+ public List<Map> sendRecords = new ArrayList<>();
+
+ public void plcStart() {
+ Machine machine=machineMapper.selectById(machineId);
+ ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),"PlcLoad");
+ modbusTcp1.connect();
+ PlcAgreement plcAgreement=modbusTcp1.getPlcAgreement("PlcLoad");
+ try {
+ if(!modbusTcp1.read(plcAgreement)){
+ log.info("閫氳璇诲彇鏂版暟鎹け璐�");
+ modbusTcp1.close();
+ return;
+ }
+ PlcParameter plcRequest =plcAgreement.getPlcParameter("plcRequest");//璇锋眰瀛�
+ PlcParameter mesSend =plcAgreement.getPlcParameter("mesSend");//鍙戦�佸瓧
+ PlcParameter mesSendCount =plcAgreement.getPlcParameter("mesSendCount");//鍙戦�佹暟閲�
+
+ PlcParameter plcReport =plcAgreement.getPlcParameter("plcReport");//姹囨姤瀛�
+ PlcParameter plcReportID =plcAgreement.getPlcParameter("plcReportID");//姹囨姤ID
+ PlcParameter mesConfirm =plcAgreement.getPlcParameter("mesConfirm");//纭瀛�
+ PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//纭ID
+ if (machine.getIsLog()>0){
+ modbusTcp1.consoleLogInfo(plcAgreement);
+ }
+ if (0==plcRequest.getValueInt()&&1==mesSend.getValueInt()) {
+ //鍙戦�佸瓧缃�0
+ String send= HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("1.鍙戦�佸瓧缃浂 鍙戦�佸瓧 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if (0==plcReport.getValueInt()&&0!=mesConfirm.getValueInt()) {
+ //纭瀛楃疆闆�
+ String send=HexUtil.intTo2ByteHex(0);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/2));
+ log.info("2.纭瀛楃疆闆� 浠诲姟瀹屾垚 娓呯┖鎴愬姛锛涘唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){
+ int finishCount=taskingService.finishMachineTask(machine);
+ log.info("3銆佷换鍔″畬鎴�:"+plcReportID.getValueString());
+ if(finishCount>0) {//鏈変换鍔�
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()/ 2));
+ log.info("浠诲姟瀹屾垚 鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ String send = HexUtil.intTo2ByteHex(1);
+ modbusTcp1.writeString(send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart() / 2));
+ log.info("浠诲姟瀹屾垚 寮傚父鎴愬姛 鍐呭锛歿},鍙戦�佽捣濮嬪湴鍧�:{}", send, HexUtil.intTo2ByteHex(mesConfirm.getAddressStart()));
+ modbusTcp1.close();
+ return;
+ }
+ List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"姝e湪宸ヤ綔");
+ if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt())
+ &&"寮�宸�".equals(machine.getState())){
+ int loadCount=0;
+ if(machine.getMode()==1){
+ //鏍囧噯妯″紡 鎵惧凡棰嗗彇鏈畬鎴愮殑绗竴鏉′换鍔�
+ LineConfiguration lineConfiguration=lineConfigurationService.machineLineConfiguration(machine);
+ List<PrimitiveTask> findPrimitiveTasking=primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
+ for(PrimitiveTask primitiveTask:findPrimitiveTasking){
+ //浠诲姟鏁�>宸蹭笂鏁伴噺
+ List<Tasking> taskingTopList=taskingMapper.selectList(new QueryWrapper<Tasking>().lambda()
+ .eq(Tasking::getScanId,primitiveTask.getScanId())
+ );
+ loadCount=primitiveTask.getTaskQuantity()-taskingTopList.size();
+ loadCount=(loadCount>0?loadCount:0);
+ break;
+ }
+ //loadCount=taskingCount.size();
+ }else{
+ //瀹氬埗妯″紡
+ loadCount=1;
+ }
+ if(loadCount>0){
+ log.info("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, 璁惧鐘舵��:{}, ",loadCount,machine);
+ String send=HexUtil.intTo2ByteHex(1)+ HexUtil.intTo2ByteHex(loadCount);
+ modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ log.info("鍙戦�佷换鍔″彂閫佹姤鏂囧唴瀹癸細{},鍙戦�佽捣濮嬪湴鍧�:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2));
+ modbusTcp1.close();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ String sendRecord=df.format(new Date())+" "+"1 "+ loadCount;
+ if (sendRecords.size()>7){
+ sendRecords.remove(0);
+ }
+ Map sendContentMap=new HashMap();
+ sendContentMap.put("sendContent",sendRecord);
+ sendRecords.add(sendContentMap);
+ return;
+ }
+ }
+ } catch (Exception e) {
+ log.info("浜や簰閫昏緫閿欒");
+ }
+ modbusTcp1.close();
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+ log.info("111");
+ plcStart();
+ //plcStart();
+// if ("寮�宸�".equals(machine.getState()) ){
+//
+// }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml
index 3940de9..bbe1e48 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml
@@ -5,18 +5,28 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
jiumumes:
- url: jdbc:mysql://10.153.19.150:3306/jiumumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://localhost:3306/jiumumes?serverTimezone=GMT%2b8&rewriteBatchedStatements=true
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_JomooKBB:
+ url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+# salve_JomooKBB:
+# url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
+# username: thok
+# password: jomoo@123
+# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
cloud:
nacos:
discovery:
- server-addr: 10.153.19.44:8848
+ server-addr: localhost:8848
application:
name: deviceInteraction
redis:
database: 0
- host: 10.153.19.44
+ host: localhost
port: 6379
password: 123456
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
index e57dd51..bbffdb6 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/src/test/java/com/mes/DeviceInteractionModuleApplicationTest.java
@@ -1,15 +1,34 @@
package com.mes;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.md.entity.*;
import com.mes.md.mapper.AccountMapper;
+import com.mes.md.mapper.KBBTJPDrawingBPMapper;
+import com.mes.md.mapper.MachineMapper;
+import com.mes.md.mapper.PrimitiveTaskMapper;
import com.mes.md.service.AccountService;
+import com.mes.md.service.PrimitiveTaskService;
+import com.mes.md.service.ProjectService;
+import com.mes.md.service.TaskingService;
import com.mes.tools.HexConversion;
+import com.mes.utils.HexUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -31,6 +50,117 @@
@Autowired
AccountService accountService;
+ @Autowired
+ KBBTJPDrawingBPMapper kBBTJPDrawingBPMapper;
+
+ @Autowired
+ PrimitiveTaskMapper primitiveTaskMapper;
+
+ @Autowired
+ PrimitiveTaskService primitiveTaskService;
+
+ @Autowired
+ TaskingService taskingService;
+
+
+ @Autowired
+ ProjectService projectService;
+
+ @Autowired
+ MachineMapper machineMapper;
+
+ @Test
+ public void testStr() {
+ String str=new String("4銆佸彂閫佷换鍔� 浠诲姟鏁版嵁锛歿}, ".getBytes(),StandardCharsets.UTF_8);
+ int a=1;
+ log.info(str,1);
+ }
+
+ @Test
+ public void testSaoMa3() {
+ try {
+// 鍒涘缓TCP瀹㈡埛绔苟杩炴帴鍒版湇鍔″櫒
+ String serverAddress = "192.168.1.8";
+ int serverPort = 2001;
+ Socket clientSocket = new Socket(serverAddress, serverPort);
+ // 鍒涘缓杈撳叆娴佸拰杈撳嚭娴�
+ InputStream inputStream = clientSocket.getInputStream();
+ OutputStream outputStream = clientSocket.getOutputStream();
+ // 鍙戦�佹暟鎹粰鏈嶅姟鍣�
+ String message = "start";
+ outputStream.write(message.getBytes());
+ // 璇诲彇鏈嶅姟鍣ㄥ搷搴旂殑鏁版嵁
+ byte[] buffer = new byte[1024];
+ int bytesRead = inputStream.read(buffer);
+ String receivedMessage = new String(buffer, 0, bytesRead);
+ System.out.println("鏀跺埌鏈嶅姟鍣ㄥ搷搴旓細" + receivedMessage);
+ // 鍏抽棴杩炴帴
+ clientSocket.close();
+ }catch (Exception e){
+ log.info("鎵爜寮傚父");
+ }
+ }
+
+ @Test
+ public void testSaoMa() {
+ try {
+// 鍒涘缓TCP瀹㈡埛绔苟杩炴帴鍒版湇鍔″櫒
+ String serverAddress = "192.168.1.8";
+ int serverPort = 2001;
+ Socket clientSocket = new Socket(serverAddress, serverPort);
+ // 鍒涘缓杈撳叆娴佸拰杈撳嚭娴�
+ InputStream inputStream = clientSocket.getInputStream();
+ OutputStream outputStream = clientSocket.getOutputStream();
+ // 鍙戦�佹暟鎹粰鏈嶅姟鍣�
+ String message = "start";
+ outputStream.write(message.getBytes());
+ // 璇诲彇鏈嶅姟鍣ㄥ搷搴旂殑鏁版嵁
+ byte[] buffer = new byte[1024];
+ int bytesRead = inputStream.read(buffer);
+ String receivedMessage = new String(buffer, 0, bytesRead);
+ System.out.println("鏀跺埌鏈嶅姟鍣ㄥ搷搴旓細" + receivedMessage);
+ // 鍙戦�佹暟鎹粰鏈嶅姟鍣�
+ String message2 = "stop";
+ outputStream.write(message2.getBytes());
+
+ // 鍏抽棴杩炴帴
+ clientSocket.close();
+ }catch (Exception e){
+ log.info("鎵爜寮傚父");
+ }
+ }
+ @Test
+ public void conncet(){
+ try {
+ int bufSizes = 0;
+ byte[] msgs = new byte[2048];
+ //鍒涘缓杩炴帴 172.17.125.200 192.168.10.101
+ Socket socket = new Socket("10.36.164.100", 1099);
+ try {
+ socket.setSoTimeout(3000);
+ //鍐欏叆闇�瑕佹暟鎹�
+ DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
+ outToServer.write(HexUtil.stringToInt("000100000006010300000028"));
+ outToServer.flush();
+ //璇诲彇鏁版嵁
+ DataInputStream in = new DataInputStream(socket.getInputStream());
+ bufSizes = in.read(msgs);
+ String message = HexUtil.byteToHexString(bufSizes, msgs);
+ System.out.println(message);
+ } catch (Exception e) {
+ System.out.println("璇诲彇澶辫触");
+ try {
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//璁剧疆鏃ユ湡鏍煎紡
+ } catch (Exception e2) {
+ // TODO: handle exception
+
+ }
+ }
+ socket.close();
+ } catch (Exception e) {
+ System.out.println("寮傚父");
+ }
+ }
@Test
public void testFindPath() {
//String url = getClass().getResource("").getPath();
@@ -64,6 +194,90 @@
log.info("{}",Account);
}
+ //杩炴帴瀹㈡埛琛�
+ @Test
+ public void testInput() {
+ Machine machine=machineMapper.selectById(14);
+ taskingService.scanMachineAdd(machine, "46594135");
+ log.info("鍐呭{}",2);
+ }
+
+ //杩炴帴瀹㈡埛琛�
+ @Test
+ public void testSqlServerInput() {
+
+ boolean is=projectService.insertProjectStandard();
+
+
+ log.info("鍐呭{}",is);
+ }
+ //杩炴帴瀹㈡埛琛�
+ @Test
+ public void testMachineFinsh() {
+ Machine machine=machineMapper.selectById(14);
+ int a=taskingService.finishMachineTask(machine);
+ log.info("鍐呭{}",a);
+ }
+ //瀹氬埗鏌ユ壘浠诲姟
+ @Test
+ public void testSqlServer() {
+ Machine machine=machineMapper.selectById(26);
+ String scan_id="";
+ List<Tasking> taskingList=taskingService.findMachineTask(machine);
+ if(!taskingList.isEmpty()){
+ Tasking tasking=taskingList.get(0);
+ if (scan_id.equals(tasking.getScanId())){
+
+ }else{
+ List<Tasking> isExist=taskingService.findMachineTaskID(machine,scan_id);
+ if(isExist.isEmpty()){
+ //璇诲彇瀹㈡埛鏁版嵁搴�
+ projectService.insertProjectCustomization(scan_id);
+ }
+ }
+ }
+// insertProjectCustomization();
+ log.info("鍐呭{}",taskingList);
+ }
+
+ //瀹氬埗鏌ユ壘浠诲姟
+ @Test
+ public void testSqlServeraa() {
+ Machine machine=machineMapper.selectById(12);
+ String scan_id="46399819";
+ projectService.insertProjectCustomization(scan_id);
+ log.info("鍐呭{}",machine);
+ }
+ //淇敼瀹㈡埛琛�
+ @Test
+ public void testSqlServerUpdate() {
+ UpdateWrapper updateWrapper=new UpdateWrapper();
+ KBBTJPDrawingBP kBBTJPDrawingBPs=new KBBTJPDrawingBP();
+ kBBTJPDrawingBPMapper.update(kBBTJPDrawingBPs,updateWrapper);
+ List<KBBTJPDrawingBP> kBBTJPDrawingBP=kBBTJPDrawingBPMapper.selectJoinList(KBBTJPDrawingBP.class,new MPJLambdaWrapper<KBBTJPDrawingBP>()
+ .selectAll(KBBTJPDrawingBP.class)
+ .eq(KBBTJPDrawingBP::getScanId,"011045108661010000")
+ .orderByAsc(KBBTJPDrawingBP::getCreateDate)
+ .orderByAsc(KBBTJPDrawingBP::getTaskSequence));
+ kBBTJPDrawingBP.get(0).setIsWorking(1);
+ kBBTJPDrawingBPMapper.updateById(kBBTJPDrawingBP.get(0));
+ //kBBTJPDrawingBPMapper.update(kBBTJPDrawingBP,new QueryWrapper<>());
+// log.info("鍐呭{}",KBBTJPDrawingBP);
+ }
+
+ //淇敼瀹㈡埛琛�
+ @Test
+ public void testSqlServerUpdate2() {
+ UpdateWrapper<KBBTJPDrawingBP> updateWrapper=new UpdateWrapper<KBBTJPDrawingBP>();
+ updateWrapper.lambda().eq(KBBTJPDrawingBP::getScanId,"011045108661010000");
+
+ KBBTJPDrawingBP kBBTJPDrawingBPs=new KBBTJPDrawingBP();
+ kBBTJPDrawingBPs.setIsWorking(2);
+ kBBTJPDrawingBPMapper.update(kBBTJPDrawingBPs,updateWrapper);
+
+// log.info("鍐呭{}",KBBTJPDrawingBP);
+ }
+
}
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml
index 3940de9..bbe1e48 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml
@@ -5,18 +5,28 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
jiumumes:
- url: jdbc:mysql://10.153.19.150:3306/jiumumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://localhost:3306/jiumumes?serverTimezone=GMT%2b8&rewriteBatchedStatements=true
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_JomooKBB:
+ url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+# salve_JomooKBB:
+# url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
+# username: thok
+# password: jomoo@123
+# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
cloud:
nacos:
discovery:
- server-addr: 10.153.19.44:8848
+ server-addr: localhost:8848
application:
name: deviceInteraction
redis:
database: 0
- host: 10.153.19.44
+ host: localhost
port: 6379
password: 123456
\ No newline at end of file
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original
index f6782b4..48fc50c 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original
Binary files differ
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index 3146183..d251695 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,36 +1,45 @@
com\mes\md\mapper\TaskingMapper.class
+com\mes\md\entity\Machine.class
com\mes\md\mapper\RoleMapper.class
com\mes\md\service\impl\ProjectServiceImpl.class
-com\mes\job\PLCRinse.class
com\mes\md\service\impl\OrderOriginalPieceServiceImpl.class
com\mes\md\service\AccountService.class
com\mes\DeviceInteractionModuleApplication.class
com\mes\job\PLCScanQRVerify.class
com\mes\md\service\ProjectService.class
com\mes\md\service\WorkTaskDetailService.class
+com\mes\common\S7objectMachine.class
com\mes\md\service\impl\EquipmentLogServiceImpl.class
+com\mes\job\PLCRotate.class
com\mes\md\controller\WorkTaskDetailController.class
com\mes\md\controller\MenuController.class
com\mes\md\entity\OrderOriginalPiece.class
com\mes\md\service\MenuService.class
+com\mes\md\mapper\KBBTJPDrawingBPMapper.class
com\mes\md\controller\GlassInfoController.class
-com\mes\job\PLCTurn.class
com\mes\md\mapper\PageMapper.class
com\mes\md\service\ProjectLogService.class
com\mes\md\entity\Project.class
com\mes\md\mapper\PrimitiveTaskMapper.class
com\mes\md\service\impl\EdgeGrindingLogServiceImpl.class
+com\mes\job\AddTask.class
+com\mes\md\entity\LineConfiguration.class
com\mes\edgstoragecage\controller\EdgStorageCageController.class
com\mes\edgstoragecage\entity\EdgStorageCage.class
com\mes\md\mapper\RoleMenuMapper.class
com\mes\md\mapper\TaskLogMapper.class
com\mes\md\service\impl\AccountServiceImpl.class
com\mes\edgstoragecage\service\EdgStorageCageService.class
+com\mes\common\CommunicationProtocol.class
com\mes\md\entity\Line.class
+com\mes\plcTaskThread\MachineEdging.class
com\mes\md\entity\EdgeGrindingLog.class
com\mes\md\service\OrderOriginalPieceService.class
com\mes\md\service\impl\GlassInfoServiceImpl.class
+com\mes\plcTaskThread\MachineSilkScreen.class
com\mes\md\entity\EquipmentLog.class
+com\mes\md\service\KBBTJPDrawingBPService.class
+com\mes\plcTaskThread\MachineRotate.class
com\mes\md\controller\PrimitiveTaskController.class
com\mes\md\controller\RoleMenuController.class
com\mes\md\entity\WorkTaskDetail.class
@@ -40,12 +49,17 @@
com\mes\md\service\impl\WorkTaskDetailServiceImpl.class
com\mes\md\service\impl\TaskLogServiceImpl.class
com\mes\md\controller\EdgeGrindingLogController.class
+com\mes\md\service\LineConfigurationService.class
com\mes\md\entity\GlassInfo.class
com\mes\md\service\GlassInfoService.class
com\mes\md\entity\Page.class
+com\mes\job\PLCCleaning.class
com\mes\md\controller\RoleController.class
com\mes\job\MarkingTask.class
+com\mes\md\mapper\MachineMapper.class
com\mes\md\mapper\AccountMapper.class
+com\mes\common\S7objectCleaning.class
+com\mes\common\tcpIp.class
com\mes\md\service\EquipmentLogService.class
com\mes\md\service\impl\PrimitiveTaskServiceImpl.class
com\mes\md\controller\OrderOriginalPieceController.class
@@ -53,44 +67,63 @@
com\mes\md\entity\ProjectLog.class
com\mes\md\service\EdgeGrindingLogService.class
com\mes\AppRunnerConfig.class
+com\mes\job\PLCFlipSlice.class
+com\mes\plcTaskThread\MachineFlipSlice.class
com\mes\md\controller\TaskingController.class
com\mes\md\controller\AccountController.class
com\mes\md\service\TaskLogService.class
-com\mes\job\PLCScanQR.class
+com\mes\job\SilkScreenTask.class
com\mes\md\service\PrimitiveTaskService.class
+com\mes\plcTaskThread\MachineLoad.class
com\mes\md\entity\Account.class
+com\mes\job\PLCScanQRWorks.class
com\mes\md\service\impl\MenuServiceImpl.class
com\mes\md\controller\PageController.class
com\mes\md\entity\TaskLog.class
+com\mes\md\mapper\LineConfigurationMapper.class
com\mes\md\mapper\EquipmentLogMapper.class
com\mes\job\PLCMechanicalArm.class
com\mes\md\entity\RoleMenu.class
com\mes\md\controller\TaskLogController.class
com\mes\md\service\impl\TaskingServiceImpl.class
+com\mes\md\service\impl\KBBTJPDrawingBPServiceImpl.class
com\mes\md\mapper\ProjectMapper.class
+com\mes\job\PLCScanQrCodesReport.class
com\mes\md\controller\EquipmentLogController.class
com\mes\common\SmbTool.class
com\mes\md\mapper\ProjectLogMapper.class
+com\mes\job\PLCManualReporting.class
+com\mes\plcTaskThread\MachineMarking.class
com\mes\md\mapper\OrderOriginalPieceMapper.class
com\mes\edgstoragecage\entity\EdgStorageCageDetails.class
com\mes\md\service\impl\RoleServiceImpl.class
+com\mes\md\controller\MachineController.class
com\mes\md\entity\Role.class
+com\mes\md\entity\KBBTJPDrawingBP.class
com\mes\md\service\impl\LineServiceImpl.class
com\mes\md\mapper\LineMapper.class
com\mes\md\mapper\EdgeGrindingLogMapper.class
+com\mes\common\S7objectMarking.class
com\mes\md\entity\PrimitiveTask.class
+com\mes\job\MachineTask.class
com\mes\md\entity\Menu.class
+com\mes\md\service\impl\LineConfigurationServiceImpl.class
com\mes\common\S7object.class
com\mes\md\mapper\MenuMapper.class
com\mes\md\service\RoleMenuService.class
com\mes\edgstoragecage\service\impl\EdgStorageCageServiceImpl.class
+com\mes\common\S7objectFlipSlice.class
com\mes\edgstoragecage\mapper\EdgStorageCageMapper.class
com\mes\md\service\impl\ProjectLogServiceImpl.class
com\mes\md\service\impl\RoleMenuServiceImpl.class
com\mes\md\service\TaskingService.class
+com\mes\plcTaskThread\MachineThread.class
com\mes\md\service\RoleService.class
+com\mes\md\service\MachineService.class
com\mes\md\service\PageService.class
com\mes\md\controller\ProjectLogController.class
com\mes\job\PLCEdging.class
+com\mes\job\PLCLoad.class
com\mes\md\mapper\GlassInfoMapper.class
com\mes\md\entity\Tasking.class
+com\mes\md\service\impl\MachineServiceImpl.class
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 64dc5f8..831834b 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,9 +1,8 @@
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCMechanicalArm.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\LineConfiguration.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\mapper\EdgStorageCageMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\LineMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\CommunicationProtocol.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\DeviceInteractionModuleApplication.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCEdging.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\ProjectLog.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\MarkingTask.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Role.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Tasking.java
@@ -11,86 +10,120 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\PageMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\MenuController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\ProjectLogMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PageService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\GlassInfoServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\WorkTaskDetailController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\MachineTask.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineThread.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\WorkTaskDetailServiceImpl.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\TaskLog.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\GlassInfo.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\OrderOriginalPieceMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\AccountService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\RoleController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\WorkTaskDetailService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCScanQRWorks.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\KBBTJPDrawingBPMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\AccountServiceImpl.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\RoleService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\MenuServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\RoleMenuServiceImpl.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\entity\EdgStorageCage.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCTurn.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\LineConfigurationServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Project.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\PrimitiveTaskMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\PrimitiveTaskServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\service\EdgStorageCageService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCScanQR.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\EdgeGrindingLogController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\EdgeGrindingLog.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Account.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\TaskingController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\EdgeGrindingLogService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\TaskLogServiceImpl.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PrimitiveTaskService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\TaskingServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCLoad.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\LineConfigurationService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\AppRunnerConfig.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7object.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\AccountMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\EdgeGrindingLogServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\SilkScreenTask.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\ProjectMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\TaskingService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\PageController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\ProjectController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\GlassInfoMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\WorkTaskDetailMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\OrderOriginalPieceService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\RoleMenuMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Line.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\EquipmentLogMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\EquipmentLog.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\MachineMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\EdgeGrindingLogMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\LineServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\PrimitiveTaskController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\PageServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\controller\EdgStorageCageController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\MenuMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\KBBTJPDrawingBPService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\SmbTool.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\AccountController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\MenuService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Menu.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCRotate.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Page.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\LineService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\RoleMapper.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\EquipmentLogService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectFlipSlice.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineLoad.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCCleaning.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\ProjectLogService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\RoleMenuController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineSilkScreen.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCScanQRVerify.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\GlassInfoController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\OrderOriginalPieceServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\MachineController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\entity\EdgStorageCageDetails.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\ProjectService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectLogServiceImpl.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\TaskingMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineFlipSlice.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\ProjectLogController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\OrderOriginalPieceController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectMarking.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\WorkTaskDetail.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCRinse.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\TaskLogController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\TaskLogService.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\PrimitiveTask.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\EquipmentLogController.java
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\RoleServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\RoleMenu.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\GlassInfoService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\OrderOriginalPiece.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\TaskLogMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\EquipmentLogServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\RoleMenuService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\AddTask.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCMechanicalArm.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\LineMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\ProjectLog.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\KBBTJPDrawingBP.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PageService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineMarking.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\TaskLog.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\GlassInfo.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\OrderOriginalPieceMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\RoleController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\tcpIp.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\WorkTaskDetailService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\RoleService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\MachineServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\entity\EdgStorageCage.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\PrimitiveTaskMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\MachineService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\EdgeGrindingLogController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Account.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineRotate.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\EdgeGrindingLogService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PrimitiveTaskService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7object.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\EdgeGrindingLogServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\KBBTJPDrawingBPServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\PageController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\ProjectController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\OrderOriginalPieceService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\RoleMenuMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\EquipmentLogMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCFlipSlice.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\EquipmentLog.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\LineConfigurationMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\LineServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCScanQrCodesReport.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\AccountController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\MenuService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Menu.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\LineService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\RoleMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\EquipmentLogService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\RoleMenuController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectMachine.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Machine.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\GlassInfoController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\OrderOriginalPieceServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\ProjectService.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectLogServiceImpl.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\TaskingMapper.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\OrderOriginalPieceController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectCleaning.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCManualReporting.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineEdging.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\PrimitiveTask.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\EquipmentLogController.java
+D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\RoleServiceImpl.java
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
index 3b57a0c..0de62f3 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
@@ -1,2 +1 @@
com\mes\DeviceInteractionModuleApplicationTest.class
-com\mes\TaskingModuleApplicationTest.class
diff --git a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
index 6ee79cc..ba1d8de 100644
--- a/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
+++ b/JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
@@ -1,2 +1 @@
-D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\test\java\com\mes\TaskingModuleApplicationTest.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\test\java\com\mes\DeviceInteractionModuleApplicationTest.java
diff --git a/UI-Project/config.js b/UI-Project/config.js
index 271d8a2..2c3d6ab 100644
--- a/UI-Project/config.js
+++ b/UI-Project/config.js
@@ -1,11 +1,11 @@
export default {
// serverUrl: "10.153.19.29:88/api",
- serverUrl: "10.153.19.44:88/api",
-// serverUrl: "192.168.1.199:88/api",
+ //serverUrl: "10.36.164.201:88/api",
+ serverUrl: "localhost:88/api",
// serverUrl: "127.0.0.1:88/api",
// serverUrl2: "10.153.19.29:88"
- serverUrl2: "10.153.19.44:88"
- // serverUrl2: "192.168.1.199:88"
+ //serverUrl2: "10.36.164.201:88"
+ serverUrl2: "localhost:88"
// serverUrl2: "127.0.0.1:88"
//serverUrl:"res.abeim.cn"
diff --git a/UI-Project/package.json b/UI-Project/package.json
index 48041bb..6f20cb0 100644
--- a/UI-Project/package.json
+++ b/UI-Project/package.json
@@ -3,9 +3,9 @@
"version": "0.0.0",
"private": true,
"scripts": {
- "dev": "vite",
- "build": "vite build",
- "preview": "vite preview"
+ "dev": "vite --host 0.0.0.0",
+ "build": "vite build",
+ "serve": "vite preview --host 0.0.0.0"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
diff --git "a/UI-Project/src/assets/\347\243\250\350\276\271\346\234\272.png" "b/UI-Project/src/assets/\347\243\250\350\276\271\346\234\272.png"
new file mode 100644
index 0000000..4fe885b
--- /dev/null
+++ "b/UI-Project/src/assets/\347\243\250\350\276\271\346\234\272.png"
Binary files differ
diff --git "a/UI-Project/src/assets/\347\277\273\347\211\207\345\217\260.png" "b/UI-Project/src/assets/\347\277\273\347\211\207\345\217\260.png"
index a6e3048..c33c53d 100644
--- "a/UI-Project/src/assets/\347\277\273\347\211\207\345\217\260.png"
+++ "b/UI-Project/src/assets/\347\277\273\347\211\207\345\217\260.png"
Binary files differ
diff --git "a/UI-Project/src/assets/\350\207\252\345\212\250\344\270\235\345\215\260\346\234\272.png" "b/UI-Project/src/assets/\350\207\252\345\212\250\344\270\235\345\215\260\346\234\272.png"
new file mode 100644
index 0000000..b09e2dd
--- /dev/null
+++ "b/UI-Project/src/assets/\350\207\252\345\212\250\344\270\235\345\215\260\346\234\272.png"
Binary files differ
diff --git a/UI-Project/src/lang/zh.js b/UI-Project/src/lang/zh.js
index 1ba58f0..c551c66 100644
--- a/UI-Project/src/lang/zh.js
+++ b/UI-Project/src/lang/zh.js
@@ -139,14 +139,17 @@
silkScreenY: '涓濆嵃Y',
isMarking: '鏄惁鎵撴爣',
isSilkScreen: '鏄惁涓濆嵃',
+ isWorking: '棰嗗彇鐘舵��',
workState: '浠诲姟鐘舵��',
lineConfigurationId: '鎵�鍦ㄤ綅缃�',
state: '鐢熶骇鐘舵��',
glassState: '鐜荤拑鐘舵��',
reportCount: '鎶ュ伐鏁伴噺',
+ sendTime: '鍙戦�佹椂闂�',
+ sendContent: '鍙戦�佸唴瀹�',
},
machine: {
- upperSlice:'鑷姩涓婄墖鏈�',
+ mechanicalArm:'鑷姩涓婄墖鏈�',
scanQrCodesIdentify:'鎵爜璇嗗埆',
scanQredging:'鎵爜纾ㄨ竟',
edging:'纾ㄨ竟鏈�',
@@ -168,15 +171,20 @@
tips:'鏄惁纭锛�',
yes:'鏄�',
sure :'纭',
+ sureStart :'纭琛ュ崟',
cancel :'鍙栨秷',
canceled :'澶辫触',
anew :'閲嶅彂',
finish :'瀹屽伐',
+ stopTask :'缁撴潫浠诲姟',
lose :'鐮存崯',
downLine :'涓嬬嚎',
topLine :'涓婄嚎',
+ getTask :'棰嗗彇',
start :'寮�宸�',
stop :'鏆傚仠',
+ modeD :'瀹氬埗',
+ modeB :'鏍囧噯',
bound:'缁戝畾',
reporting:'鎶ュ伐',
reportingcount:'鎶ュ伐鏁伴噺',
diff --git a/UI-Project/src/router/index.js b/UI-Project/src/router/index.js
index a43459d..d43385c 100644
--- a/UI-Project/src/router/index.js
+++ b/UI-Project/src/router/index.js
@@ -114,32 +114,32 @@
// }
// ]
// },
- // {
- // /*----------- 鑷姩鎵撴爣鏈� ----------------*/
- // path: 'Marking',
- // name: 'marking',
- // component: () => import('../views/Marking/marking.vue'),
- // children: [
- // {
- // path: '/Marking/marking',
- // name: 'marking',
- // component: () => import('../views/Marking/marking.vue'),
- // }
- // ]
- // },
- // {
- // /*----------- 鑷姩涓濆嵃鏈� ----------------*/
- // path: 'SilkScreen',
- // name: 'silkScreen',
- // component: () => import('../views/SilkScreen/silkScreen.vue'),
- // children: [
- // {
- // path: '/SilkScreen/silkScreen',
- // name: 'silkScreen',
- // component: () => import('../views/SilkScreen/silkScreen.vue'),
- // }
- // ]
- // },
+ {
+ /*----------- 鑷姩鎵撴爣鏈� ----------------*/
+ path: 'Marking',
+ name: 'marking',
+ component: () => import('../views/Marking/marking.vue'),
+ children: [
+ {
+ path: '/Marking/marking',
+ name: 'marking',
+ component: () => import('../views/Marking/marking.vue'),
+ }
+ ]
+ },
+ {
+ /*----------- 鑷姩涓濆嵃鏈� ----------------*/
+ path: 'SilkScreen',
+ name: 'silkScreen',
+ component: () => import('../views/SilkScreen/silkScreen.vue'),
+ children: [
+ {
+ path: '/SilkScreen/silkScreen',
+ name: 'silkScree',
+ component: () => import('../views/SilkScreen/silkScreen.vue'),
+ }
+ ]
+ },
// {
// /*----------- 鑷姩鐐硅兌鏈� ----------------*/
// path: 'GlueDispenser',
@@ -166,19 +166,19 @@
// }
// ]
// },
- // {
- // /*----------- 鏃嬭浆鍙� ----------------*/
- // path: 'Rotate',
- // name: 'rotate',
- // component: () => import('../views/Rotate/rotate.vue'),
- // children: [
- // {
- // path: '/Rotate/rotate',
- // name: 'rotate',
- // component: () => import('../views/Rotate/rotate.vue'),
- // }
- // ]
- // },
+ {
+ /*----------- 鏃嬭浆鍙� ----------------*/
+ path: 'Rotate',
+ name: 'rotate',
+ component: () => import('../views/Rotate/rotate.vue'),
+ children: [
+ {
+ path: '/Rotate/rotate',
+ name: 'rotate',
+ component: () => import('../views/Rotate/rotate.vue'),
+ }
+ ]
+ },
// {
// /*----------- 鑷姩璐磋啘鏈� ----------------*/
// path: 'Lamination',
@@ -251,11 +251,14 @@
}
]
},
-
{
path: '',
- redirect: '/User/userlist'
- }
+ redirect: '/MechanicalArm/mechanicalArm'//鐧婚檰鎴愬姛鍚庨粯璁よ繘鍏ョ晫闈�
+ },
+ // {
+ // path: '',
+ // redirect: '/User/userlist'//鐧婚檰鎴愬姛鍚庨粯璁よ繘鍏ョ晫闈�
+ // }
]
},
{
diff --git a/UI-Project/src/utils/constants.js b/UI-Project/src/utils/constants.js
index a7909a8..ad729e4 100644
--- a/UI-Project/src/utils/constants.js
+++ b/UI-Project/src/utils/constants.js
@@ -1,5 +1,5 @@
-// export const WebSocketHost = "192.168.1.199";
-export const WebSocketHost = "10.153.19.44";
+ export const WebSocketHost = "localhost";
+//export const WebSocketHost = "10.36.164.201";
// export const WebSocketHost = "10.153.19.29";
// export const WebSocketHost = "127.0.0.1";
export const host = "88";
\ No newline at end of file
diff --git a/UI-Project/src/utils/headerTB.vue b/UI-Project/src/utils/headerTB.vue
new file mode 100644
index 0000000..fb83397
--- /dev/null
+++ b/UI-Project/src/utils/headerTB.vue
@@ -0,0 +1,7 @@
+<template>
+
+ <FancyButton>
+ Click me!
+ </FancyButton>
+</template>
+
diff --git a/UI-Project/src/views/Edging/edging.vue b/UI-Project/src/views/Edging/edging.vue
index e649d10..3c47ac8 100644
--- a/UI-Project/src/views/Edging/edging.vue
+++ b/UI-Project/src/views/Edging/edging.vue
@@ -1,10 +1,10 @@
-<!-- 鎵撴爣鏈� -->
+<!-- 纾ㄨ竟鏈� -->
<script setup>
import request from "@/utils/request";
import { ElMessage, ElMessageBox } from "element-plus";
-import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'
+import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue'
import { useI18n } from 'vue-i18n'
-import { WebSocketHost ,host} from '@/utils/constants'
+import { WebSocketHost, host } from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
let language = ref(localStorage.getItem('lang') || 'zh')
const { t } = useI18n()
@@ -12,21 +12,54 @@
account: '',
password: '',
});
+const blind = ref(false)
+const errorInfo = ref(true)
const loadData = ref([]);
const findMachine = ref([]);
-const machineId=5;//褰撳墠椤甸潰鐨勮澶嘔D
+const sendRecords = ref([]);
+const downLineTask = ref([]);
+
+const machineId = 6;//褰撳墠椤甸潰鐨勮澶嘔D
+var errorScanId;
+var errorOpen=false;
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`;
+let socketDownLineTask = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edgingTask`;
+const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
loadData.value = data.taskingList[0];
findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0].reverse();
+
+ if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
+ //鏈夋暟鎹氨寮圭獥
+ if(errorOpen){
+ ElMessageBox.close();
+ }
+ errorScanId=findMachine.value.remark.toString();
+ errorInfoFuntion(findMachine.value.remark.toString());
+ errorOpen=true;
+
+ }else if(findMachine.value.remark.toString()==""&&errorOpen){
+ ElMessageBox.close();
+ errorOpen=false;
+ }
+
+};
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage2 = (data) => {
+ downLineTask.value = data.downLineTask[0];
+ // console.log(data);
};
onUnmounted(() => {
if (socket) {
closeWebSocket(socket);
+ }
+ if (socketDownLineTask) {
+ closeWebSocket(socketDownLineTask);
}
});
onBeforeUnmount(() => {
@@ -37,230 +70,291 @@
onMounted(async () => {
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
-
- //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁
- //load();
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
});
-
-// //鑾峰彇鏁版嵁
-// const load = async() => {
-// //鑾峰彇璁惧浠诲姟鏁版嵁
-// try {
-// const response = await request.post('/deviceInteraction/tasking/findMachineTask',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// loadData.value.findTaskingData= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// //鑾峰彇璁惧鐘舵��
-// try {
-// const response = await request.post('/deviceInteraction/machine/findMachine',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// findMachine.value= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// }
+//鎶ヨ鎻愮ず
+const errorInfoFuntion = async (info) => {
+ let infoScancode=info;
+ ElMessageBox.confirm(
+ infoScancode,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
-const workStatus = async(row,state) => {
+const workStatus = async (row, state) => {
let url;
- if(state=="閲嶅彂"){
- url="/deviceInteraction/tasking/loseMachineTask";
- }else if(state=="姝e湪宸ヤ綔"){
- url="/deviceInteraction/tasking/startMachineTask";
- }else if(state=="瀹屽伐"){
- url="/deviceInteraction/tasking/finishMachineTask";
- }else{
+ if (state == "閲嶅彂") {
+ url = "/deviceInteraction/tasking/loseMachineTask";
+ } else if (state == "姝e湪宸ヤ綔") {
+ url = "/deviceInteraction/tasking/startMachineTask";
+ } else if (state == "瀹屽伐") {
+ url = "/deviceInteraction/tasking/finishMachineTask";
+ } else {
return;
}
ElMessageBox.confirm(
- t('marking.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //寮�濮嬩慨鏀�
+ request.post(url,
{
- confirmButtonText: t('marking.sure'),
- cancelButtonText: t('marking.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //寮�濮嬩慨鏀�
- request.post(url,
- {
- "id": machineId
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "id": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('marking.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
//寮�宸�/鏆傚仠
-const machineStatus = async(state) => {
+const machineStatus = async (state) => {
ElMessageBox.confirm(
- t('marking.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/updateMachineState",
{
- confirmButtonText: t('marking.sure'),
- cancelButtonText: t('marking.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/machine/updateMachineState",
- {
- "id": machineId,
- "state": state
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "id": machineId,
+ "state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('marking.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
//鐮存崯
-const damagedTask = async(row) => {
+const damagedTask = async (row) => {
ElMessageBox.confirm(
- t('marking.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/damagedTask",
{
- confirmButtonText: t('marking.sure'),
- cancelButtonText: t('marking.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/tasking/damagedTask",
- {
- "glassId": row.glassId
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "glassId": row.glassId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('marking.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
//涓嬬嚎(鎷胯蛋)
-const glassDownLine = async(row) => {
+const glassDownLine = async (row) => {
ElMessageBox.confirm(
- t('marking.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassDownLine",
{
- confirmButtonText: t('marking.sure'),
- cancelButtonText: t('marking.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/tasking/glassDownLine",
- {
- "glassId": row.glassId,
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "glassId": row.glassId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('marking.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const topLineShow = async () => {
+ blind.value = true;
}
//涓婄嚎
-const topLine = async() => {
-
+const topLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓婄嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassTopLine",
+ {
+ "glassId": row.glassId,
+ "lineConfigurationId": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {n
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
-
+const handleDialogClose = () => {
+
+}
</script>
<template>
<div ref="content" style="padding:0 20px;">
<div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
- {{$t('machine.edging')}}
+ {{ $t('machine.edging') }}
</div>
+ <el-dialog v-model="blind" top="30vh" style="text-align: center;" @close="handleDialogClose">
+ <!-- 绾夸笅鐜荤拑 -->
+ <el-table :data="downLineTask" stripe style="height:260px" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="70">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="topLine(scope.row)">{{
+ $t('functionState.topLine') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
<hr />
<br>
- <div id="search" >
+ <div id="search">
<!-- 鍔熻兘 -->
- <el-button type="primary" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
- <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button>
+ <el-button :type="(findMachine['state'] == '鏆傚仠' ? 'danger' : 'success')" id="ButtonMachineStatus"
+ @click="machineStatus((findMachine['state'] == '鏆傚仠' ? '寮�宸�' : '鏆傚仠'))">{{ findMachine['state'] == '寮�宸�' ?
+ $t('functionState.start') : $t('functionState.stop') }}</el-button>
+ <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.topLine') }}</el-button>
<!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
</div>
<div id="main-body" style="min-height:240px;">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="loadData" stripe style="height:260px"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
<el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
- <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
- <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
- <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/>
- <el-table-column prop="length" :label="$t('glassInfo.length')"/>
- <el-table-column prop="width" :label="$t('glassInfo.width')"/>
- <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
- <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
<el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')" >{{$t('functionState.anew')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{$t('functionState.finish')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')">{{
+ $t('functionState.anew') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
+ $t('functionState.finish') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
+ }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{
+ $t('functionState.downLine') }}</el-button>
</template>
</el-table-column>
</el-table>
</div>
- <div id="main-body"
- style="width: 50%; height: 460px; margin: auto;background-image: url(../../src/assets/鎵爜璇嗗埆.png) ;background-size: 100% 100%;">
- <!-- 鐢诲浘鍐呭 -->
- <div style="width: 150px; height: 100px; background-color: red; position: relative; top: 171px; left: 328px">
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <!-- <div style="width: 70%;min-width: 900px; height: 460px;float: left;">
+ <img src="../../assets/纾ㄨ竟鏈�.png">
+ </div> -->
+ <img style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../assets/纾ㄨ竟鏈�.png">
+ <!-- <img style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../src/assets/纾ㄨ竟鏈�.png" /> -->
+ <!-- <el-image style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../src/assets/纾ㄨ竟鏈�.png"></el-image> -->
+ <!-- <div style="width: 70%;min-width: 900px; height: 460px;background-image: url(../../src/assets/纾ㄨ竟鏈�.png) ;background-size: 100% 100%;float: left;">
+
+ </div> -->
+ <div style="width: 30%;min-width: 300px; height: 460px;float: left;padding: 20px;;">
+ <el-table :data="sendRecords" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center', height: '30px' }"
+ :cell-style="{ textAlign: 'center' }">
+ <el-table-column prop="sendContent" :label="$t('glassInfo.sendContent')" />
+ </el-table>
</div>
+ <div style="clear锛歜oth"></div>
</div>
</div>
</template>
@@ -295,4 +389,11 @@
border: none;
cursor: pointer;
}
+.dotClass {
+ width:10px;
+ height:10px;
+ border-radius: 50%;
+ display: block;
+ margin-left: 10px;
+}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/FlipSlice/flipSlice.vue b/UI-Project/src/views/FlipSlice/flipSlice.vue
index b9b67ea..c3d5b17 100644
--- a/UI-Project/src/views/FlipSlice/flipSlice.vue
+++ b/UI-Project/src/views/FlipSlice/flipSlice.vue
@@ -12,22 +12,52 @@
account: '',
password: '',
});
+const blind = ref(false)
+const errorInfo = ref(true)
const loadData = ref([]);
const findMachine = ref([]);
-const machineId = 25;//褰撳墠椤甸潰鐨勮澶嘔D
+const sendRecords = ref([]);
+const downLineTask = ref([]);
+
+const machineId = 26;//褰撳墠椤甸潰鐨勮澶嘔D
+var errorScanId;
+var errorOpen=false;
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
+let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/flipSlice`;
+const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
loadData.value = data.taskingList[0];
findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0].reverse();
+ if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
+ //鏈夋暟鎹氨寮圭獥
+ if(errorOpen){
+ ElMessageBox.close();
+ }
+ errorScanId=findMachine.value.remark.toString();
+ errorInfoFuntion(findMachine.value.remark.toString());
+ errorOpen=true;
+ }else if(findMachine.value.remark.toString()==""&&errorOpen){
+ ElMessageBox.close();
+ errorOpen=false;
+ }
+
+};
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage2 = (data) => {
+ downLineTask.value = data.downLineTask[0];
// console.log(data);
};
onUnmounted(() => {
if (socket) {
closeWebSocket(socket);
+ }
+ if (socketDownLineTask) {
+ closeWebSocket(socketDownLineTask);
}
});
onBeforeUnmount(() => {
@@ -38,43 +68,30 @@
onMounted(async () => {
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
-
-
- //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁
- //load();
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
});
-
-// //鑾峰彇鏁版嵁
-// const load = async() => {
-// //鑾峰彇璁惧浠诲姟鏁版嵁
-// try {
-// const response = await request.post('/deviceInteraction/tasking/findMachineTask',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// loadData.value.findTaskingData= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// //鑾峰彇璁惧鐘舵��
-// try {
-// const response = await request.post('/deviceInteraction/machine/findMachine',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// findMachine.value= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// }
+//鎶ヨ鎻愮ず
+const errorInfoFuntion = async (info) => {
+ let infoScancode=info;
+ ElMessageBox.confirm(
+ infoScancode,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sureStart'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
const workStatus = async (row, state) => {
let url;
@@ -135,6 +152,38 @@
{
"id": machineId,
"state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//瀹氬埗/鏍囧噯
+const machineMode = async (mode) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/toggleModeMachine",
+ {
+ "id": machineId,
+ "mode": mode
}).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
if (res.code === 200) {
ElMessage.success(res.message);
@@ -212,31 +261,90 @@
})
})
}
-//涓婄嚎
-const topLine = async () => {
-
+const topLineShow = async () => {
+ blind.value = true;
}
-
+//涓婄嚎
+const topLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓婄嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassTopLine",
+ {
+ "glassId": row.glassId,
+ "lineConfigurationId": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {n
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const handleDialogClose = () => {
+
+}
</script>
<template>
<div ref="content" style="padding:0 20px;">
<div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
{{ $t('machine.flipSlice') }}
</div>
+ <el-dialog v-model="blind" top="30vh" style="text-align: center;" @close="handleDialogClose">
+ <!-- 绾夸笅鐜荤拑 -->
+ <el-table :data="downLineTask" stripe :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="70">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="topLine(scope.row)">{{
+ $t('functionState.topLine') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
<hr />
<br>
<div id="search">
<!-- 鍔熻兘 -->
<el-button :type="(findMachine['state'] == '鏆傚仠' ? 'danger' : 'success')" id="ButtonMachineStatus"
- @click="machineStatus((findMachine['state'] == '鏆傚仠' ? '寮�宸�' : '鏆傚仠'))">{{ findMachine['state'] == '寮�宸�' ? $t('functionState.start') : $t('functionState.stop') }}</el-button>
- <el-button type="primary" id="ButtonTopLine" @click="topLine">{{ $t('functionState.topLine') }}</el-button>
+ @click="machineStatus((findMachine['state'] == '鏆傚仠' ? '寮�宸�' : '鏆傚仠'))">{{ findMachine['state'] == '寮�宸�' ?
+ $t('functionState.start') : $t('functionState.stop') }}</el-button>
+
+ <el-button :type="(findMachine['mode'] == '瀹氬埗' ? 'danger' : 'success')" id="ButtonMachineMode"
+ @click="machineMode((findMachine['mode'] == 0 ? 1 : 0))">{{ findMachine['mode'] == 0 ?
+ $t('functionState.modeD') : $t('functionState.modeB') }}</el-button>
+
+ <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.topLine') }}</el-button>
<!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
</div>
- <div id="main-body" style="min-height:240px;">
+ <div id="main-body">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="loadData" stripe style="height:260px"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
@@ -244,29 +352,41 @@
<el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
<el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
<el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
<el-table-column prop="length" :label="$t('glassInfo.length')" />
<el-table-column prop="width" :label="$t('glassInfo.width')" />
<el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
<el-table-column prop="workState" :label="$t('glassInfo.workState')" />
<el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" link type="primary" plain
- @click="workStatus(scope.row, '閲嶅彂')">{{ $t('functionState.anew') }}</el-button>
- <el-button size="mini" link type="primary" plain
- @click="workStatus(scope.row, '瀹屽伐')">{{ $t('functionState.finish') }}</el-button>
- <el-button size="mini" link type="primary" plain
- @click="damagedTask(scope.row)">{{ $t('functionState.lose') }}</el-button>
- <el-button size="mini" link type="primary" plain
- @click="glassDownLine(scope.row)">{{ $t('functionState.downLine') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')">{{
+ $t('functionState.anew') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
+ $t('functionState.finish') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
+ }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{
+ $t('functionState.downLine') }}</el-button>
</template>
</el-table-column>
</el-table>
</div>
- <div id="main-body"
- style="width: 70%; height: 400px;margin:20px auto;background-image: url(../../src/assets/缈荤墖鍙�.png) ;background-size: 100% 100%;">
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <el-image style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../src/assets/缈荤墖鍙�.png"></el-image>
+ <!-- <div style="width: 70%;min-width: 900px; height: 460px;background-image: url(../../src/assets/缈荤墖鍙�.png) ;background-size: 100% 100%;float: left;">
+
+ </div> -->
+ <div style="width: 30%;min-width: 300px; height: 460px;float: left;padding: 20px;;">
+ <el-table :data="sendRecords" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center', height: '30px' }"
+ :cell-style="{ textAlign: 'center' }">
+ <el-table-column prop="sendContent" :label="$t('glassInfo.sendContent')" />
+ </el-table>
+ </div>
+ <div style="clear锛歜oth"></div>
<!-- 鐢诲浘鍐呭 -->
- <div :style="{
+ <!-- <div :style="{
width: loadData.length > 0 ? loadData[0]['length'] + 'px' : '200px',
height: loadData.length > 0 ? loadData[0]['width'] + 'px' : '100px',
backgroundColor: 'red',
@@ -279,7 +399,7 @@
<p v-if="loadData.length > 0">
{{ loadData[0]['length'] }} * {{ loadData[0]['width'] }}
</p>
- <p v-else>鏆傛棤鏁版嵁</p> <!-- 鍙�夛細鏄剧ず榛樿娑堟伅 -->
+ <p v-else>鏆傛棤鏁版嵁</p>
</div>
<div :style="{
width: loadData.length > 0 ? loadData[1]['length'] + 'px' : '200px',
@@ -294,8 +414,8 @@
<p v-if="loadData.length > 0">
{{ loadData[1]['length'] }} * {{ loadData[1]['width'] }}
</p>
- <p v-else>鏆傛棤鏁版嵁</p> <!-- 鍙�夛細鏄剧ず榛樿娑堟伅 -->
- </div>
+ <p v-else>鏆傛棤鏁版嵁</p>
+ </div> -->
</div>
</div>
</template>
@@ -330,4 +450,11 @@
border: none;
cursor: pointer;
}
+.dotClass {
+ width:10px;
+ height:10px;
+ border-radius: 50%;
+ display: block;
+ margin-left: 10px;
+}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/ManualReporting/manualReporting.vue b/UI-Project/src/views/ManualReporting/manualReporting.vue
new file mode 100644
index 0000000..52b8c31
--- /dev/null
+++ b/UI-Project/src/views/ManualReporting/manualReporting.vue
@@ -0,0 +1,408 @@
+searcheh<!-- 涓婄墖鏈� -->
+<script setup>
+import request from "@/utils/request";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { WebSocketHost, host } from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
+let language = ref(localStorage.getItem('lang') || 'zh')
+const { t } = useI18n()
+const requestData = reactive({
+ account: '',
+ password: '',
+});
+const blind = ref(false)
+const errorInfo = ref(true)
+const loadData = ref([]);
+const findMachine = ref([]);
+const sendRecords = ref([]);
+const downLineTask = ref([]);
+const scanCode = ref([]);
+const scanCodeOld = ref([]);
+const searcheh = ref();
+
+const machineId = 2;//褰撳墠椤甸潰鐨勮澶嘔D
+var errorScanId;
+//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+let socket = null;
+let socketDownLineTask = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/manualReporting`;
+const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ loadData.value = data.taskingList[0];
+ findMachine.value = data.machine[0];
+ scanCode.value = data.scanCode[0];
+ sendRecords.value = data.sendRecords[0].reverse();
+
+ if(scanCode.value.length>0&&scanCode.value[0].scanId.toString()!=errorScanId){
+ //鏈夋暟鎹氨寮圭獥
+ errorScanId=scanCode.value[0].scanId.toString();
+ errorInfoFuntion(scanCode.value[0]);
+ }
+
+};
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage2 = (data) => {
+ downLineTask.value = data.downLineTask[0];
+ // console.log(data);
+};
+onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+ if (socketDownLineTask) {
+ closeWebSocket(socketDownLineTask);
+ }
+});
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
+
+onMounted(async () => {
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+});
+//鎶ヨ鎻愮ず
+const errorInfoFuntion = async (info) => {
+ let infoScancode='鎵爜ID锛�'+info.scanId+' '+info.scanCode;
+ ElMessageBox.confirm(
+ infoScancode,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sureStart'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //閲嶆柊琛ュ崟
+ request.post("/deviceInteraction/tasking/glassAgainTopLine",
+ {
+ "scanId": info.scanId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
+const workStatus = async (row, state) => {
+ let url;
+ if (state == "閲嶅彂") {
+ url = "/deviceInteraction/tasking/loseMachineTask";
+ } else if (state == "姝e湪宸ヤ綔") {
+ url = "/deviceInteraction/tasking/startMachineTask";
+ } else if (state == "瀹屽伐") {
+ url = "/deviceInteraction/tasking/finishMachineTask";
+ } else {
+ return;
+ }
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //寮�濮嬩慨鏀�
+ request.post(url,
+ {
+ "id": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+
+}
+
+//寮�宸�/鏆傚仠
+const machineStatus = async (state) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/updateMachineState",
+ {
+ "id": machineId,
+ "state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//鐮存崯
+const damagedTask = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/damagedTask",
+ {
+ "glassId": row.glassId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//涓嬬嚎(鎷胯蛋)
+const glassDownLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassDownLine",
+ {
+ "glassId": row.glassId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const topLineShow = async () => {
+ blind.value = true;
+}
+const fetchData = async () => {
+ //鎵爜鍥炶溅鎻愪氦
+ alert(searcheh.value);
+ searcheh.value="";
+}
+//涓婄嚎
+const topLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓婄嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassTopLine",
+ {
+ "glassId": row.glassId,
+ "lineConfigurationId": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {n
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const handleDialogClose = () => {
+
+}
+</script>
+<template>
+ <div ref="content" style="padding:0 20px;">
+ <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
+ {{ $t('machine.manualReporting') }}
+ </div>
+
+ <el-dialog v-model="blind" top="30vh" style="text-align: center;" @close="handleDialogClose">
+ <!-- 宸叉姤宸� -->
+
+ </el-dialog>
+
+ <hr />
+ <br>
+ <div id="search" style="height:35px;line-height: 35px;">
+ <!-- 鍔熻兘 -->
+ <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.reporting') }}</el-button>
+
+ <el-input v-model="searcheh" type="primary" id="ReportSubmission" @keyup.enter="fetchData"
+ style="width:1000px;height:35px;line-height: 35px;font-size: 35px;float: right;"></el-input>
+
+ </div>
+
+ <div id="main-body" style="min-height:240px;">
+ <!-- 琛ㄦ牸鍐呭 -->
+ <el-table :data="loadData" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
+ :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" >
+ <template #header>
+ <div>
+ <div>{{ $t('glassInfo.taskType') }}
+ <el-icon @click="fetchData"><CaretTop /></el-icon>
+ <el-icon @click="fetchData"><CaretBottom /></el-icon>
+ <el-icon color="#409efc"><Filter /></el-icon>
+ </div>
+
+
+ <!-- <el-input size="small" placeholder="Type to search" /> -->
+
+ </div>
+
+ </template>
+ </el-table-column>
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="taskQuantity" :label="$t('glassInfo.taskQuantity')" />
+ <el-table-column prop="reportCount" :label="$t('glassInfo.reportCount')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
+ $t('functionState.finish') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
+ }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <!-- 琛ㄦ牸鍐呭璇︽儏 -->
+ <el-table :data="loadData" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
+ :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
+ $t('functionState.finish') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
+ }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+</template>
+
+<style scoped>
+table {
+ text-align: center;
+ width: 100%;
+ height: 100%;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table td {
+ text-align: center;
+}
+
+#main-body {
+ width: 100%;
+ height: 100%;
+ border: 1px solid #ccc;
+ margin-top: 25px;
+}
+
+#searchButton {
+ width: 100px;
+ height: 40px;
+ font-size: 16px;
+ border-radius: 5px;
+ background-color: #409EFF;
+ color: #fff;
+ border: none;
+ cursor: pointer;
+}
+.dotClass {
+ width:10px;
+ height:10px;
+ border-radius: 50%;
+ display: block;
+ margin-left: 10px;
+}
+</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Marking/marking.vue b/UI-Project/src/views/Marking/marking.vue
index 8ebac0c..ff5e1ee 100644
--- a/UI-Project/src/views/Marking/marking.vue
+++ b/UI-Project/src/views/Marking/marking.vue
@@ -15,7 +15,8 @@
});
const loadData = ref([]);
const findMachine = ref([]);
-const machineId=11;//褰撳墠椤甸潰鐨勮澶嘔D
+const sendRecords = ref([]);
+const machineId=12;//褰撳墠椤甸潰鐨勮澶嘔D
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/marking`;
@@ -24,6 +25,7 @@
// 鏇存柊 tableData 鐨勬暟鎹�
loadData.value = data.taskingList[0];
findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0];
};
onUnmounted(() => {
if (socket) {
@@ -199,9 +201,9 @@
<el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
</div>
- <div id="main-body" style="min-height:240px;">
+ <div id="main-body">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="loadData" stripe style="height:260px"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
@@ -210,6 +212,7 @@
<el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
<el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
<el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/>
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
<el-table-column prop="length" :label="$t('glassInfo.length')"/>
<el-table-column prop="width" :label="$t('glassInfo.width')"/>
<el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
@@ -225,11 +228,21 @@
</el-table>
</div>
- <div id="main-body"
- style="width: 100%; height: 460px;background-image: url(../../src/assets/鑷姩鎵撴爣鏈�.png) ;background-size: 100% 100%;">
- <!-- 鐢诲浘鍐呭 -->
- <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px">
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <el-image style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../src/assets/鑷姩鎵撴爣鏈�.png"></el-image>
+ <!-- <div style="width: 70%;min-width: 900px; height: 460px;background-image: url('../../src/assets/鑷姩鎵撴爣鏈�.png') ;background-size: 100% 100%;float: left;">
+
+ </div> -->
+ <div style="width: 30%;min-width: 300px; height: 460px;float: left;padding: 20px;;">
+ <!-- <div style="text-align: center;height: 30px;line-height: 30px;font-size: 20px;padding: 20px;">鏁版嵁浜や簰璁板綍</div> -->
+ <el-table :data="sendRecords" stripe :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center',height:'30px'}" :cell-style="{ textAlign: 'center' }">
+ <el-table-column prop="sendContent" :label="$t('glassInfo.sendContent')"/>
+ </el-table>
</div>
+ <div style="clear锛歜oth"></div>
+ <!-- 鐢诲浘鍐呭
+ <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px">
+ </div>-->
</div>
</div>
</template>
diff --git a/UI-Project/src/views/MechanicalArm/mechanicalArm.vue b/UI-Project/src/views/MechanicalArm/mechanicalArm.vue
index 2a4aa5e..7515a9a 100644
--- a/UI-Project/src/views/MechanicalArm/mechanicalArm.vue
+++ b/UI-Project/src/views/MechanicalArm/mechanicalArm.vue
@@ -1,10 +1,10 @@
-<!-- 鎵撴爣鏈� -->
+<!-- 涓婄墖鏈� -->
<script setup>
import request from "@/utils/request";
import { ElMessage, ElMessageBox } from "element-plus";
-import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'
+import { computed,reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue'
import { useI18n } from 'vue-i18n'
-import { WebSocketHost ,host} from '@/utils/constants'
+import { WebSocketHost, host } from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
let language = ref(localStorage.getItem('lang') || 'zh')
const { t } = useI18n()
@@ -12,22 +12,41 @@
account: '',
password: '',
});
+const blind = ref(false)
+const errorInfo = ref(true)
const loadData = ref([]);
const findMachine = ref([]);
-const machineId=1;//褰撳墠椤甸潰鐨勮澶嘔D
+const sendRecords = ref([]);
+const downLineTask = ref([]);
+const findPrimitiveTask = ref([]);
+const scanCodeOld = ref([]);
+const searchs = ref();
+const machineId = 2;//褰撳墠椤甸潰鐨勮澶嘔D
+var errorScanId;
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/mechanicalArm`;
+let socketDownLineTask = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/loadTask`;
+const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
- loadData.value = data.taskingList[0];
+ loadData.value = data.findPrimitiveTasking[0];
+ findPrimitiveTask.value = data.findPrimitiveTask[0];
findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0].reverse();
+};
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage2 = (data) => {
+ downLineTask.value = data.downLineTask[0];
// console.log(data);
};
onUnmounted(() => {
if (socket) {
closeWebSocket(socket);
+ }
+ if (socketDownLineTask) {
+ closeWebSocket(socketDownLineTask);
}
});
onBeforeUnmount(() => {
@@ -38,257 +57,362 @@
onMounted(async () => {
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
-
-
- //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁
- //load();
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
});
-
-// //鑾峰彇鏁版嵁
-// const load = async() => {
-// //鑾峰彇璁惧浠诲姟鏁版嵁
-// try {
-// const response = await request.post('/deviceInteraction/tasking/findMachineTask',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// loadData.value.findTaskingData= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// //鑾峰彇璁惧鐘舵��
-// try {
-// const response = await request.post('/deviceInteraction/machine/findMachine',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// findMachine.value= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// }
+//鎶ヨ鎻愮ず
+const errorInfoFuntion = async (info) => {
+ let infoScancode='鎵爜ID锛�'+info.scanId+' '+info.scanCode;
+ ElMessageBox.confirm(
+ infoScancode,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sureStart'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //閲嶆柊琛ュ崟
+ request.post("/deviceInteraction/tasking/glassAgainTopLine",
+ {
+ "scanId": info.scanId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
-const workStatus = async(row,state) => {
+const workStatus = async (row, state) => {
let url;
- if(state=="閲嶅彂"){
- url="/deviceInteraction/tasking/loseMachineTask";
- }else if(state=="姝e湪宸ヤ綔"){
- url="/deviceInteraction/tasking/startMachineTask";
- }else if(state=="瀹屽伐"){
- url="/deviceInteraction/tasking/finishMachineTask";
- }else{
+ if (state == "閲嶅彂") {
+ url = "/deviceInteraction/tasking/loseMachineTask";
+ } else if (state == "姝e湪宸ヤ綔") {
+ url = "/deviceInteraction/tasking/startMachineTask";
+ } else if (state == "瀹屽伐") {
+ url = "/deviceInteraction/tasking/finishMachineTask";
+ } else {
return;
}
ElMessageBox.confirm(
- t('functionState.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //寮�濮嬩慨鏀�
+ request.post(url,
{
- confirmButtonText: t('functionState.sure'),
- cancelButtonText: t('functionState.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //寮�濮嬩慨鏀�
- request.post(url,
- {
- "id": machineId
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "id": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('functionState.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
-//寮�宸�/鏆傚仠
-const machineStatus = async(state) => {
+//瀹氬埗/鏍囧噯
+const machineMode = async (mode) => {
ElMessageBox.confirm(
- t('functionState.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/toggleModeMachine",
{
- confirmButtonText: t('functionState.sure'),
- cancelButtonText: t('functionState.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/machine/updateMachineState",
- {
- "id": machineId,
- "state": state
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "id": machineId,
+ "mode": mode
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('functionState.cancel'),
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//寮�宸�/鏆傚仠
+const machineStatus = async (state) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/updateMachineState",
+ {
+ "id": machineId,
+ "state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
//鐮存崯
-const damagedTask = async(row) => {
+const damagedTask = async (row) => {
ElMessageBox.confirm(
- t('functionState.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/damagedTask",
{
- confirmButtonText: t('functionState.sure'),
- cancelButtonText: t('functionState.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/tasking/damagedTask",
- {
- "glassId": row.glassId
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "glassId": row.glassId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('functionState.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
//涓嬬嚎(鎷胯蛋)
-const glassDownLine = async(row) => {
+const glassDownLine = async (row) => {
ElMessageBox.confirm(
- t('functionState.tips'),
- t('delivery.prompt'),
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassDownLine",
{
- confirmButtonText: t('functionState.sure'),
- cancelButtonText: t('functionState.cancel'),
- type: 'warning',
- }
- )
- .then(() => {
- //涓嬬嚎鎺ュ彛
- request.post("/deviceInteraction/tasking/glassDownLine",
- {
- "glassId": row.glassId,
- }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
- if (res.code === 200) {
- ElMessage.success(res.message);
- } else {
- ElMessage.warning(res.message)
- }
- })
+ "glassId": row.glassId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
})
- .catch(() => {
- ElMessage({
- type: 'info',
- message: t('functionState.cancel'),
- })
- })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
}
-//涓婄嚎
-const topLine = async() => {
-
+const topLineShow = async () => {
+ blind.value = true;
+}
+//棰嗗彇浠诲姟/缁撴潫浠诲姟
+const startOrStopTask = async (row,line,isWorking) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //棰嗗彇浠诲姟
+ request.post("/deviceInteraction/primitiveTask/startOrStopPrimitiveTasking",
+ {
+ "id": row.id,
+ "getLine": line,
+ "isWorking": isWorking
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {n
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const handleDialogClose = () => {
+
}
+
+const fetchData = async () => {
+ //鎵爜鍥炶溅鎻愪氦
+ alert(searchs.value);
+ searchs.value="";
+}
+const filterTableData = computed(() =>
+ loadData.value.filter(
+ (data) =>
+ !searchs.value ||data.scanId.toLowerCase().includes(searchs.value.toLowerCase())
+ )
+)
</script>
<template>
<div ref="content" style="padding:0 20px;">
<div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
- {{$t('machine.upperSlice')}}
+ {{ $t('machine.mechanicalArm') }}
</div>
+ <el-dialog v-model="blind" top="30vh" style="text-align: center;" @close="handleDialogClose">
+ <!-- 鏈鍙栫殑鏍囧噯浠诲姟 -->
+
+ <el-table :data="findPrimitiveTask" stripe style="height:260px" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="taskQuantity" :label="$t('glassInfo.taskQuantity')" />
+ <el-table-column prop="reportCount" :label="$t('glassInfo.reportCount')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="70">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="startOrStopTask(scope.row,2,1)">{{
+ $t('functionState.getTask') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
<hr />
<br>
- <div id="search" >
+ <div id="search">
<!-- 鍔熻兘 -->
- <el-button :type="(findMachine['state']=='鏆傚仠'?'danger':'success')" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
- <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button>
- <!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
- <el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
- <el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
+
+ <el-button :type="(findMachine['state'] == '鏆傚仠' ? 'danger' : 'success')" id="ButtonMachineStatus"
+ @click="machineStatus((findMachine['state'] == '鏆傚仠' ? '寮�宸�' : '鏆傚仠'))">{{ findMachine['state'] == '寮�宸�' ?
+ $t('functionState.start') : $t('functionState.stop') }}</el-button>
+ <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.getTask') }}</el-button>
+
+ <el-button :type="(findMachine['mode'] == '瀹氬埗' ? 'danger' : 'success')" id="ButtonMachineMode"
+ @click="machineMode((findMachine['mode'] == 0 ? 1 : 0))">{{ findMachine['mode'] == 0 ?
+ $t('functionState.modeD') : $t('functionState.modeB') }}</el-button>
</div>
+
<div id="main-body" style="min-height:240px;">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="filterTableData" stripe style="height:260px"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
+
<!-- <el-table-column type="selection" min-width="30" /> -->
<el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
- <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
- <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
- <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/>
- <el-table-column prop="length" :label="$t('glassInfo.length')"/>
- <el-table-column prop="width" :label="$t('glassInfo.width')"/>
- <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
- <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
+ <el-table-column prop="batchNumber" sortable :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" sortable :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="scanId" sortable :label="$t('glassInfo.scanId')" >
+ <template #header>
+ <div>
+ <div>{{ $t('glassInfo.taskType') }}
+ <el-icon @click="fetchData"><CaretTop /></el-icon>
+ <el-icon @click="fetchData"><CaretBottom /></el-icon>
+ <el-icon color="#409efc"><Filter /></el-icon>
+ </div>
+ <el-input v-model="searchs" type="primary" id="ReportSubmission" @keyup.enter="fetchData"></el-input>
+ <!-- <el-input size="small" placeholder="Type to search" /> -->
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column prop="length" sortable :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" sortable :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" sortable :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="taskQuantity" sortable :label="$t('glassInfo.taskQuantity')" />
+ <el-table-column prop="isWorking" sortable :label="$t('glassInfo.isWorking')" />
<el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')" >{{$t('functionState.anew')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{$t('functionState.finish')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button>
- <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button>
+ <el-button size="mini" link type="primary" plain @click="startOrStopTask(scope.row,2,2)">{{
+ $t('functionState.stopTask') }}</el-button>
</template>
</el-table-column>
</el-table>
</div>
- <div id="main-body"
- style="width: 45%; height: 400px;margin: 50px 0 0 50px;background-image: url(../../src/assets/涓婄墖鏈�.png) ;background-size: 100% 100%;">
- <!-- 鐢诲浘鍐呭 -->
- <div style="width: 200px; height: 100px; background-color: red; position: relative; top: 271px; left: 158px">
- <div style="width: 500px; height: 300px; position: relative; top: -250PX; left: 800px">
- <el-table :data="loadData" stripe class="custom-table"
- :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center',height: '80px'}"
- :cell-style="{ textAlign: 'center',height: '80px'}">
- <!-- <el-table-column type="selection" min-width="30" /> -->
- <el-table-column type="index" :label="$t('glassInfo.number')" min-width="55" />
- <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
- <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
- <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
- <el-table-column prop="length" :label="$t('glassInfo.length')" min-width="55"/>
- <el-table-column prop="width" :label="$t('glassInfo.width')" min-width="55"/>
- <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
- <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
- <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="100">
- <template #default="scope">
- <el-button size="mini" style="min-width: 100px;" link type="primary" plain @click="workStatus(scope.row, '缁戝畾')" >{{$t('functionState.bound')}}</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <el-image style="width: 70%;min-width: 900px; height: 460px;float: left;" src="../../src/assets/鎵爜璇嗗埆.png"></el-image>
+ <!-- <div style="width: 70%;min-width: 900px; height: 460px;background-image: url(../../src/assets/鎵爜璇嗗埆.png) ;background-size: 100% 100%;float: left;">
+
+ </div> -->
+ <div style="width: 30%;min-width: 300px; height: 460px;float: left;padding: 20px;;">
+ <el-table :data="sendRecords" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center', height: '30px' }"
+ :cell-style="{ textAlign: 'center' }">
+ <el-table-column prop="sendContent" :label="$t('glassInfo.sendContent')" />
+ </el-table>
</div>
+ <div style="clear锛歜oth"></div>
</div>
</div>
</template>
<style scoped>
-
table {
text-align: center;
width: 100%;
@@ -318,4 +442,11 @@
border: none;
cursor: pointer;
}
+.dotClass {
+ width:10px;
+ height:10px;
+ border-radius: 50%;
+ display: block;
+ margin-left: 10px;
+}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/MechanicalArm/mechanicalArm2.vue b/UI-Project/src/views/MechanicalArm/mechanicalArm2.vue
new file mode 100644
index 0000000..2a4aa5e
--- /dev/null
+++ b/UI-Project/src/views/MechanicalArm/mechanicalArm2.vue
@@ -0,0 +1,321 @@
+<!-- 鎵撴爣鏈� -->
+<script setup>
+import request from "@/utils/request";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { reactive, ref, onMounted, onBeforeUnmount,onUnmounted } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { WebSocketHost ,host} from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
+let language = ref(localStorage.getItem('lang') || 'zh')
+const { t } = useI18n()
+const requestData = reactive({
+ account: '',
+ password: '',
+});
+const loadData = ref([]);
+const findMachine = ref([]);
+const machineId=1;//褰撳墠椤甸潰鐨勮澶嘔D
+//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+let socket = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/mechanicalArm`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ loadData.value = data.taskingList[0];
+ findMachine.value = data.machine[0];
+ // console.log(data);
+};
+onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+});
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
+
+onMounted(async () => {
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+
+
+ //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁
+ //load();
+});
+
+// //鑾峰彇鏁版嵁
+// const load = async() => {
+// //鑾峰彇璁惧浠诲姟鏁版嵁
+// try {
+// const response = await request.post('/deviceInteraction/tasking/findMachineTask',
+// {
+// "id": 11
+// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
+// if (response.code === 200) {
+// loadData.value.findTaskingData= response.data;
+// } else {
+// ElMessage.warning(res.msg)
+// }
+// } catch (error) {
+// // console.error('Error fetching rects :', error);
+// }
+// //鑾峰彇璁惧鐘舵��
+// try {
+// const response = await request.post('/deviceInteraction/machine/findMachine',
+// {
+// "id": 11
+// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
+// if (response.code === 200) {
+// findMachine.value= response.data;
+// } else {
+// ElMessage.warning(res.msg)
+// }
+// } catch (error) {
+// // console.error('Error fetching rects :', error);
+// }
+// }
+//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
+const workStatus = async(row,state) => {
+ let url;
+ if(state=="閲嶅彂"){
+ url="/deviceInteraction/tasking/loseMachineTask";
+ }else if(state=="姝e湪宸ヤ綔"){
+ url="/deviceInteraction/tasking/startMachineTask";
+ }else if(state=="瀹屽伐"){
+ url="/deviceInteraction/tasking/finishMachineTask";
+ }else{
+ return;
+ }
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //寮�濮嬩慨鏀�
+ request.post(url,
+ {
+ "id": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+
+}
+
+//寮�宸�/鏆傚仠
+const machineStatus = async(state) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/updateMachineState",
+ {
+ "id": machineId,
+ "state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//鐮存崯
+const damagedTask = async(row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/damagedTask",
+ {
+ "glassId": row.glassId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//涓嬬嚎(鎷胯蛋)
+const glassDownLine = async(row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassDownLine",
+ {
+ "glassId": row.glassId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//涓婄嚎
+const topLine = async() => {
+
+}
+
+</script>
+<template>
+ <div ref="content" style="padding:0 20px;">
+ <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
+ {{$t('machine.upperSlice')}}
+ </div>
+ <hr />
+ <br>
+ <div id="search" >
+ <!-- 鍔熻兘 -->
+ <el-button :type="(findMachine['state']=='鏆傚仠'?'danger':'success')" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
+ <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button>
+ <!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
+ <el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
+ <el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
+ </div>
+ <div id="main-body" style="min-height:240px;">
+ <!-- 琛ㄦ牸鍐呭 -->
+ <el-table :data="loadData" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
+ :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
+ <el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/>
+ <el-table-column prop="length" :label="$t('glassInfo.length')"/>
+ <el-table-column prop="width" :label="$t('glassInfo.width')"/>
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')" >{{$t('functionState.anew')}}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{$t('functionState.finish')}}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button>
+ <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
+ <div id="main-body"
+ style="width: 45%; height: 400px;margin: 50px 0 0 50px;background-image: url(../../src/assets/涓婄墖鏈�.png) ;background-size: 100% 100%;">
+ <!-- 鐢诲浘鍐呭 -->
+ <div style="width: 200px; height: 100px; background-color: red; position: relative; top: 271px; left: 158px">
+ <div style="width: 500px; height: 300px; position: relative; top: -250PX; left: 800px">
+ <el-table :data="loadData" stripe class="custom-table"
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center',height: '80px'}"
+ :cell-style="{ textAlign: 'center',height: '80px'}">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="55" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
+ <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" min-width="55"/>
+ <el-table-column prop="width" :label="$t('glassInfo.width')" min-width="55"/>
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="100">
+ <template #default="scope">
+ <el-button size="mini" style="min-width: 100px;" link type="primary" plain @click="workStatus(scope.row, '缁戝畾')" >{{$t('functionState.bound')}}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<style scoped>
+
+table {
+ text-align: center;
+ width: 100%;
+ height: 100%;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table td {
+ text-align: center;
+}
+
+#main-body {
+ width: 100%;
+ height: 100%;
+ border: 1px solid #ccc;
+ margin-top: 25px;
+}
+
+#searchButton {
+ width: 100px;
+ height: 40px;
+ font-size: 16px;
+ border-radius: 5px;
+ background-color: #409EFF;
+ color: #fff;
+ border: none;
+ cursor: pointer;
+}
+</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Rotate/rotate.vue b/UI-Project/src/views/Rotate/rotate.vue
new file mode 100644
index 0000000..317f861
--- /dev/null
+++ b/UI-Project/src/views/Rotate/rotate.vue
@@ -0,0 +1,427 @@
+<!-- 鏃嬭浆鍙� -->
+<script setup>
+import request from "@/utils/request";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { reactive, ref, onMounted, onBeforeUnmount, onUnmounted } from 'vue'
+import { useI18n } from 'vue-i18n'
+import { WebSocketHost, host } from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
+let language = ref(localStorage.getItem('lang') || 'zh')
+const { t } = useI18n()
+const requestData = reactive({
+ account: '',
+ password: '',
+});
+const blind = ref(false)
+const loadData = ref([]);
+const findMachine = ref([]);
+const sendRecords = ref([]);
+const downLineTask = ref([]);
+
+const machineId = 20;//褰撳墠椤甸潰鐨勮澶嘔D
+var errorScanId;
+var errorOpen=false;
+//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+let socket = null;
+let socketDownLineTask = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/rotate`;
+const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ loadData.value = data.taskingList[0];
+ findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0].reverse();
+
+ if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
+ //鏈夋暟鎹氨寮圭獥
+ if(errorOpen){
+ ElMessageBox.close();
+ }
+ errorScanId=findMachine.value.remark.toString();
+ errorInfoFuntion(findMachine.value.remark.toString());
+ errorOpen=true;
+ }else if(findMachine.value.remark.toString()==""&&errorOpen){
+ ElMessageBox.close();
+ errorOpen=false;
+ }
+
+};
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage2 = (data) => {
+ downLineTask.value = data.downLineTask[0];
+ // console.log(data);
+};
+onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+ if (socketDownLineTask) {
+ closeWebSocket(socketDownLineTask);
+ }
+});
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
+
+onMounted(async () => {
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+ //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
+ socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+});
+//鎶ヨ鎻愮ず
+const errorInfoFuntion = async (info) => {
+ let infoScancode=info;
+ ElMessageBox.confirm(
+ infoScancode,
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sureStart'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
+const workStatus = async (row, state) => {
+ let url;
+ if (state == "閲嶅彂") {
+ url = "/deviceInteraction/tasking/loseMachineTask";
+ } else if (state == "姝e湪宸ヤ綔") {
+ url = "/deviceInteraction/tasking/startMachineTask";
+ } else if (state == "瀹屽伐") {
+ url = "/deviceInteraction/tasking/finishMachineTask";
+ } else {
+ return;
+ }
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //寮�濮嬩慨鏀�
+ request.post(url,
+ {
+ "id": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+
+}
+
+//寮�宸�/鏆傚仠
+const machineStatus = async (state) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/updateMachineState",
+ {
+ "id": machineId,
+ "state": state
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//瀹氬埗/鏍囧噯
+const machineMode = async (mode) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/toggleModeMachine",
+ {
+ "id": machineId,
+ "mode": mode
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//鐮存崯
+const damagedTask = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/damagedTask",
+ {
+ "glassId": row.glassId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+//涓嬬嚎(鎷胯蛋)
+const glassDownLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassDownLine",
+ {
+ "glassId": row.glassId,
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const topLineShow = async () => {
+ blind.value = true;
+}
+//涓婄嚎
+const topLine = async (row) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓婄嚎鎺ュ彛
+ request.post("/deviceInteraction/tasking/glassTopLine",
+ {
+ "glassId": row.glassId,
+ "lineConfigurationId": machineId
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {n
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
+const handleDialogClose = () => {
+
+}
+</script>
+<template>
+ <div ref="content" style="padding:0 20px;">
+ <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
+ {{ $t('machine.rotate') }}
+ </div>
+ <el-dialog v-model="blind" top="30vh" style="text-align: center;" @close="handleDialogClose">
+ <!-- 绾夸笅鐜荤拑 -->
+ <el-table :data="downLineTask" stripe style="height:260px" :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="70">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="topLine(scope.row)">{{
+ $t('functionState.topLine') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ <hr />
+ <br>
+ <div id="search">
+ <!-- 鍔熻兘 -->
+ <el-button :type="(findMachine['state'] == '鏆傚仠' ? 'danger' : 'success')" id="ButtonMachineStatus"
+ @click="machineStatus((findMachine['state'] == '鏆傚仠' ? '寮�宸�' : '鏆傚仠'))">{{ findMachine['state'] == '寮�宸�' ?
+ $t('functionState.start') : $t('functionState.stop') }}</el-button>
+
+ <el-button :type="(findMachine['mode'] == '瀹氬埗' ? 'danger' : 'success')" id="ButtonMachineMode"
+ @click="machineMode((findMachine['mode'] == 0 ? 1 : 0))">{{ findMachine['mode'] == 0 ?
+ $t('functionState.modeD') : $t('functionState.modeB') }}</el-button>
+ <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.topLine') }}</el-button>
+ <!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
+ <el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
+ <el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
+ </div>
+ <div id="main-body" style="min-height:240px;">
+ <!-- 琛ㄦ牸鍐呭 -->
+ <el-table :data="loadData" stripe style="height:680px"
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
+ :cell-style="{ textAlign: 'center' }">
+ <!-- <el-table-column type="selection" min-width="30" /> -->
+ <el-table-column type="index" :label="$t('glassInfo.number')" min-width="30" />
+ <el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')" />
+ <el-table-column prop="taskType" :label="$t('glassInfo.taskType')" />
+ <el-table-column prop="glassId" :label="$t('glassInfo.glassId')" />
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
+ <el-table-column prop="length" :label="$t('glassInfo.length')" />
+ <el-table-column prop="width" :label="$t('glassInfo.width')" />
+ <el-table-column prop="thickness" :label="$t('glassInfo.thickness')" />
+ <el-table-column prop="workState" :label="$t('glassInfo.workState')" />
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
+ <template #default="scope">
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')">{{
+ $t('functionState.anew') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{
+ $t('functionState.finish') }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
+ }}</el-button>
+ <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{
+ $t('functionState.downLine') }}</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+<!--
+ <div id="main-body" style="width: 100%; height: 460px;min-width: 1200px;">
+ <div style="width: 70%;min-width: 900px; height: 460px;background-size: 100% 100%;float: left;">
+
+ </div>
+ <div style="width: 30%;min-width: 300px; height: 460px;float: left;padding: 20px;;">
+ <el-table :data="sendRecords" stripe
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center', height: '30px' }"
+ :cell-style="{ textAlign: 'center' }">
+ <el-table-column prop="sendContent" :label="$t('glassInfo.sendContent')" />
+ </el-table>
+ </div>
+ <div style="clear锛歜oth"></div>
+ </div> -->
+ </div>
+</template>
+
+<style scoped>
+table {
+ text-align: center;
+ width: 100%;
+ height: 100%;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+table td {
+ text-align: center;
+}
+
+#main-body {
+ width: 100%;
+ height: 100%;
+ border: 1px solid #ccc;
+ margin-top: 25px;
+}
+
+#searchButton {
+ width: 100px;
+ height: 40px;
+ font-size: 16px;
+ border-radius: 5px;
+ background-color: #409EFF;
+ color: #fff;
+ border: none;
+ cursor: pointer;
+}
+.dotClass {
+ width:10px;
+ height:10px;
+ border-radius: 50%;
+ display: block;
+ margin-left: 10px;
+}
+</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
index f0ac399..2b575b0 100644
--- a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
+++ b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
@@ -44,37 +44,6 @@
//load();
});
-// //鑾峰彇鏁版嵁
-// const load = async() => {
-// //鑾峰彇璁惧浠诲姟鏁版嵁
-// try {
-// const response = await request.post('/deviceInteraction/tasking/findMachineTask',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// loadData.value.findTaskingData= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// //鑾峰彇璁惧鐘舵��
-// try {
-// const response = await request.post('/deviceInteraction/machine/findMachine',
-// {
-// "id": 11
-// }); // 鏇挎崲涓轰綘鐨凙PI绔偣
-// if (response.code === 200) {
-// findMachine.value= response.data;
-// } else {
-// ElMessage.warning(res.msg)
-// }
-// } catch (error) {
-// // console.error('Error fetching rects :', error);
-// }
-// }
//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
const workStatus = async(row,state) => {
let url;
diff --git a/UI-Project/src/views/SilkScreen/SilkScreen.vue b/UI-Project/src/views/SilkScreen/SilkScreen.vue
index 99c5adc..e86836f 100644
--- a/UI-Project/src/views/SilkScreen/SilkScreen.vue
+++ b/UI-Project/src/views/SilkScreen/SilkScreen.vue
@@ -15,15 +15,17 @@
});
const loadData = ref([]);
const findMachine = ref([]);
-const machineId=13;//褰撳墠椤甸潰鐨勮澶嘔D
+const sendRecords = ref([]);
+const machineId=14;//褰撳墠椤甸潰鐨勮澶嘔D
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/silkScreen`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/silkScreenTask`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
loadData.value = data.taskingList[0];
findMachine.value = data.machine[0];
+ sendRecords.value = data.sendRecords[0];
};
onUnmounted(() => {
if (socket) {
@@ -195,9 +197,9 @@
{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
<el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button>
</div>
- <div id="main-body" style="min-height:240px;">
+ <div id="main-body" style="height:240px; min-height:240px;">
<!-- 琛ㄦ牸鍐呭 -->
- <el-table :data="loadData" stripe
+ <el-table :data="loadData" stripe style="height:680px"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<!-- <el-table-column type="selection" min-width="30" /> -->
@@ -206,6 +208,7 @@
<el-table-column prop="batchNumber" :label="$t('glassInfo.batchNumber')"/>
<el-table-column prop="taskType" :label="$t('glassInfo.taskType')"/>
<el-table-column prop="glassId" :label="$t('glassInfo.glassId')"/>
+ <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
<el-table-column prop="length" :label="$t('glassInfo.length')"/>
<el-table-column prop="width" :label="$t('glassInfo.width')"/>
<el-table-column prop="silkScreenX" :label="$t('glassInfo.silkScreenX')"/>
@@ -221,13 +224,7 @@
</el-table-column>
</el-table>
</div>
-
- <div id="main-body"
- style="width: 100%; height: 460px;background-image: url(../../src/assets/a.png) ;background-size: 100% 100%;">
- <!-- 鐢诲浘鍐呭 -->
- <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px">
- </div>
- </div>
+
</div>
</template>
--
Gitblit v1.8.0