From 6977fb42d5067f6c938ef3de559a6ad19b542a0b Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期五, 14 六月 2024 11:29:09 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java | 17
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java | 17
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/service/DamageService.java | 16
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java | 23
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/xml/EngineeringMapper.xml | 5
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java | 33
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/entity/Damage.java | 44
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java | 96 +
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCage.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java | 14
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/LoadGlassModuleApplication.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java | 19
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/TemperingGlassModuleApplication.java | 2
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-prod.yml | 6
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java | 2
UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue | 61
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java | 14
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java | 214 ++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java | 2
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/UpWorkstationMapper.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/EdgGlassTaskInfoService.java | 19
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/AppRunnerConfig.java | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/EngineeringMapper.java | 17
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java | 6
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java | 1
UI-Project/src/views/Identify/identify.vue | 47
UI-Project/src/views/Caching/cachingbefore.vue | 143 +
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageFeedTask.java | 52
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java | 8
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml | 6
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java | 7
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 8
hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java | 90
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-cz.yml | 9
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java | 8
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/UpPattenUsageService.java | 7
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-cz.yml | 8
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java | 24
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java | 241 +++
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml | 7
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-dev.yml | 5
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java | 77 +
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java | 100 +
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java | 57
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java | 20
UI-Project/src/views/Slicecage/slicecage.vue | 471 +++---
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageService.java | 11
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java | 32
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java | 2
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/UpWorkstation.java | 1
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java | 23
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java | 76 +
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue | 220 +-
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java | 22
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageOutTaskServiceImpl.java | 41
UI-Project/src/views/Returns/returns.vue | 108
hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java | 44
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageOutTaskMapper.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageOutTaskService.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java | 26
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageOutTaskController.java | 10
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/controller/DamageController.java | 21
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/controller/EdgGlassTaskInfoController.java | 20
hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java | 11
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java | 3
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java | 89 +
hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcBitObject.java | 5
UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue | 59
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java | 432 ++++-
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml | 3
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml | 2
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java | 2
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java | 8
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java | 9
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageMapper.java | 3
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java | 37
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java | 22
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/impl/TaskCacheServiceImpl.java | 28
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownCacheGlassTask.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageFeedTaskController.java | 10
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json | 10
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-cz.yml | 8
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue | 100
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java | 18
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-cz.yml | 13
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java | 3
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/mapper/TaskCacheMapper.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml | 18
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java | 36
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java | 30
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java | 84 +
UI-Project/src/views/Caching/cachingun.vue | 162 +-
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java | 10
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageOutTask.java | 34
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java | 29
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-cz.yml | 6
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/mapper/EdgGlassTaskInfoMapper.java | 18
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java | 3
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/mapper/DamageMapper.java | 16
UI-Project/src/views/StockBasicData/stockBasicData.vue | 60
UI-Project/src/views/UnLoadGlass/Landingindication.vue | 55
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java | 38
UI-Project/src/utils/constants.js | 4
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/TaskCacheService.java | 1
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java | 59
/dev/null | 25
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java | 4
hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java | 12
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-dev.yml | 21
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java | 4
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/controller/TaskCacheController.java | 2
116 files changed, 3,127 insertions(+), 1,185 deletions(-)
diff --git a/UI-Project/src/utils/constants.js b/UI-Project/src/utils/constants.js
index 8a665eb..67d36d2 100644
--- a/UI-Project/src/utils/constants.js
+++ b/UI-Project/src/utils/constants.js
@@ -1 +1,3 @@
-export const WebSocketHost = "localhost";
\ No newline at end of file
+// export const WebSocketHost = "192.168.1.199";
+export const WebSocketHost = "10.153.19.150";
+export const host = "88";
\ No newline at end of file
diff --git a/UI-Project/src/views/Caching/cachingbefore.vue b/UI-Project/src/views/Caching/cachingbefore.vue
index 5b9d2a2..0fa7fac 100644
--- a/UI-Project/src/views/Caching/cachingbefore.vue
+++ b/UI-Project/src/views/Caching/cachingbefore.vue
@@ -4,29 +4,49 @@
import {useRouter} from "vue-router"
const router = useRouter()
const adda = ref(false)
+import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
-import { ref, onMounted } from "vue";
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
// import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// import LanguageMixin from './lang/LanguageMixin'
const tableData = ref([])
const slot = ref('')
-
-
-request.post("/cacheGlass/edgStorageCage/selectEdgStorageCage").then((res) => {
- if (res.code == 200) {
-
- console.log(res.data);
- tableData.value = res.data
- console.log(res.data[0].slot);
- } else {
- ElMessage.warning(res.msg)
-
- }
- });
-
+const adjustedRects = ref([]);
+onMounted(async () => {
+ try {
+ const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (response.code === 200) {
+ const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
+ tableData.value = response.data
+ console.log(response.data);
+ adjustedRects.value = rawRects.map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5 ,
+ id: rect.id * 10,
+ }));
+ console.log(adjustedRects.value);
+ } else {
+ ElMessage.warning(res.msg)
+ }
+ } catch (error) {
+ // console.error('Error fetching rects :', error);
+ }
+});
+const toggleEnableState = async (row) => {
+ const newState = row.enable_state === 1 ? 0 : 1;
+ // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵�侊紙杩欓噷鐪佺暐浜嗗疄闄呯殑璇锋眰閫昏緫锛�
+ const response = await request.post('/cacheGlass/edgStorageCage/updateEdgStorageCage', { id: row.id, enablestate: newState });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+ row.enable_state = newState;
+};
const open = async(row) => {
try {
const confirmResult = await ElMessageBox.confirm(
@@ -57,46 +77,31 @@
// 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑
console.error('鍙戠敓閿欒:', error);
}
-};
+};
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.value = data.EdgStorageCageinfos[0]
+ // adjustedRects.value = data.EdgStorageCageinfos[0]
+ adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5 ,
+ id: rect.id * 10,
+ }));
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- 'id': '1',
- 'long': '5',
- 'wide': '1005',
- 'thick': '183.6',
- }
- ]
-
-})
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
@@ -116,9 +121,17 @@
min-width="80"
prop="enable_state"
>
- <template #default="scope">
+ <template #default="scope">
+ <el-tag
+ :type="scope.row.enable_state === 1 ? 'success' : 'danger'"
+ @click="toggleEnableState(scope.row)"
+ >
+ {{ scope.row.enable_state === 1 ? '鍚敤' : '绂佺敤' }}
+ </el-tag>
+ </template>
+ <!-- <template #default="scope">
<el-tag type="success" >{{ scope.row.enable_state==1?"鍚敤":"鏈惎鐢�" }}</el-tag>
- </template>
+ </template> -->
</el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" align="center" width="200">
<template #default="scope">
@@ -131,10 +144,21 @@
</el-card>
</div>
<div id="awatch">
- <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;">
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div>
+ <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;">
+ <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="rect"
+ :style="{ position: 'absolute',
+ top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`,
+ backgroundColor: '#409EFF'
+ }"
+ >
+ </div>
+ </div>
+<!-- <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div>
<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div>
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div>
+<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> -->
</div>
</template>
@@ -157,6 +181,7 @@
}
#awatch{
height: 460px;
+ width: 1500px;
/* margin-top: -60px; */
}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Caching/cachingun.vue b/UI-Project/src/views/Caching/cachingun.vue
index ba1686f..d454956 100644
--- a/UI-Project/src/views/Caching/cachingun.vue
+++ b/UI-Project/src/views/Caching/cachingun.vue
@@ -4,29 +4,39 @@
import {useRouter} from "vue-router"
const router = useRouter()
const adda = ref(false)
-
+import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
-import { ref, onMounted } from "vue";
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
// import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// import LanguageMixin from './lang/LanguageMixin'
-
+
const tableData = ref([])
const slot = ref('')
+const adjustedRects = ref([]);
-
-request.get("/unLoadGlass/downStorage/selectStorageCage").then((res) => {
- if (res.code == 200) {
-
- console.log(res.data);
- tableData.value = res.data
- console.log(res.data[0].slot);
- } else {
- ElMessage.warning(res.msg)
-
- }
- });
-
+onMounted(async () => {
+ try {
+ const response = await request.get('/unLoadGlass/downStorage/selectStorageCage'); // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (response.code === 200) {
+ const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
+ tableData.value = response.data
+ console.log(response.data);
+ adjustedRects.value = rawRects.map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5 ,
+ id: rect.id * 10,
+ }));
+ console.log(adjustedRects.value);
+ } else {
+ ElMessage.warning(res.msg)
+ }
+ } catch (error) {
+ // console.error('Error fetching rects :', error);
+ }
+});
+
const open = async(row) => {
try {
const confirmResult = await ElMessageBox.confirm(
@@ -58,49 +68,44 @@
console.error('鍙戠敓閿欒:', error);
}
};
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- 'id': '1',
- 'long': '5',
- 'wide': '1005',
- 'thick': '183.6',
- }
- ]
-
-})
+const toggleEnableState = async (row) => {
+ const newState = row.enable_state === 1 ? 0 : 1;
+ // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵�侊紙杩欓噷鐪佺暐浜嗗疄闄呯殑璇锋眰閫昏緫锛�
+ const response = await request.post('/unLoadGlass/downStorage/updateDownStorageCage', { id: row.id, enablestate: newState });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+ row.enable_state = newState;
+};
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.splice(0, tableData.length, ...data.params[0]);
+ // tableData.value = data.params[0]
+ // adjustedRects.value = data.EdgStorageCageinfos[0]
+ adjustedRects.value = data.params[0].map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5 ,
+ id: rect.id * 10,
+ }));
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
-
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
-
+
<template>
<div>
<el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
@@ -113,14 +118,22 @@
<el-table-column prop="width" align="center" label="瀹�" min-width="120" />
<el-table-column prop="height" align="center" label="楂�" min-width="120" />
<el-table-column
- align="center"
+ align="center"
label="鍚敤鐘舵��"
min-width="80"
prop="enable_state"
>
- <template #default="scope">
+ <template #default="scope">
+ <el-tag
+ :type="scope.row.enable_state === 1 ? 'success' : 'danger'"
+ @click="toggleEnableState(scope.row)"
+ >
+ {{ scope.row.enable_state === 1 ? '鍚敤' : '绂佺敤' }}
+ </el-tag>
+ </template>
+ <!-- <template #default="scope">
<el-tag type="success" >{{ scope.row.enable_state==1?"鍚敤":"鏈惎鐢�" }}</el-tag>
- </template>
+ </template> -->
</el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" align="center" width="200">
<template #default="scope">
@@ -131,27 +144,25 @@
</el-table>
</div>
</el-card>
- <!-- <el-dialog v-model="adda" top="30vh" width="25%" title="鏄惁鍒犻櫎璇ユ潯淇℃伅?" >
- <template #footer>
- <div id="dialog-footer">
- <el-button type="primary" @click="handleConfirma">
- 纭
- </el-button>
- <el-button @click="adda = false">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog> -->
</div>
<div id="awatch">
- <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;">
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div>
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div>
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div>
+ <img src="../../assets/woshihuancun.png" alt="" style="width: 60%;height: 90%;margin-left: 260px;margin-top: 20px;position: relative;">
+ <div style="position: absolute; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="rect"
+ :style="{ position: 'absolute',
+ top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`,
+ backgroundColor: '#409EFF'
+ }"
+ >
+ </div>
+ </div>
</div>
</template>
-
+
<style scoped>
-
+
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
#dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
#dialog-footer{
@@ -169,6 +180,7 @@
}
#awatch{
height: 460px;
+ width: 1500px;
/* margin-top: -60px; */
}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index 2d500f6..9316fc9 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -38,12 +38,13 @@
</el-scrollbar>
</el-card>
</template>
-
<script setup lang="ts">
import { Delete, Upload } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
-import { ref, onMounted } from 'vue';
+import { ref, onMounted, onBeforeUnmount } from 'vue';
import request from "@/utils/request"
+import { WebSocketHost ,host} from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
const blind = ref(false)
const olWidth = ref();
const olHeight = ref();
@@ -75,16 +76,16 @@
adjustedRects.value = rawRects.map(rect => ({
...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- x_axis: (rect.x_axis*100) * 0.005, // 灏唜鍊奸櫎浠�3
- y_axis: (rect.y_axis*100) * 0.005,
- width: (rect.width*100) * 0.004 ,
+ x_axis: (rect.x_axis*100) * 0.004, // 灏唜鍊奸櫎浠�3
+ y_axis: (rect.y_axis*100) * 0.004,
+ width: (rect.width*100) * 0.002 ,
widtha: rect.width ,
heighta: rect.height ,
- height:( rect.height*100) * 0.004 ,
+ height:( rect.height*100) * 0.002 ,
glass_state: rect.glass_state
}));
+ console.log(adjustedRects.value);
- console.log(rect);
// console.log( (rect.width*100) / 300 );
} else {
@@ -174,6 +175,38 @@
}
});
}
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+
+ // adjustedRects.value = data.currentCutTerritory[0]
+ adjustedRects.value = data.currentCutTerritory[0].map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ x_axis: (rect.x_axis*100) * 0.004, // 灏唜鍊奸櫎浠�3
+ y_axis: (rect.y_axis*100) * 0.004,
+ width: (rect.width*100) * 0.002 ,
+ widtha: rect.width ,
+ heighta: rect.height ,
+ height:( rect.height*100) * 0.002 ,
+ glass_state: rect.glass_state
+ }));
+ // console.log("鏇存柊鍚庢暟鎹�", tableData);
+
+};
+
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<style scoped>
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index b389719..da044de 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -3,10 +3,10 @@
import {reactive} from "vue";
import {useRouter} from "vue-router"
import request from "@/utils/request"
-
-import { ref, onMounted } from 'vue';
// import { ref } from 'vue'
-
+import { ref, onMounted, onBeforeUnmount } from 'vue';
+import { WebSocketHost ,host} from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
const dialogFormVisible = ref(true)
const dialogFormVisiblea = ref(false)
const dialogFormVisibleb = ref(false)
@@ -16,143 +16,66 @@
const adjustedRectsa = ref([]);
const adjustedRectsb = ref([]);
// 杩涚倝涓�
-onMounted(async () => {
- try {
- const response = await request.get('/temperingGlass/temperingGlassInfo/SelectIntoGlass');
- if (response.code === 200) {
- const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
- console.log(response.data);
- const { height: newheight,width: newwidth } = response.data; // 鑾峰彇灏哄
- height.value = newheight;
- width.value = newwidth;
- adjustedRects.value = rawRects.map(rect => ({
+const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ adjustedRects.value = data.intoGlass[0].map(rect => ({
...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3
- ycoordinate: rect.ycoordinate,
- width: rect.width ,
- height: rect.height ,
- }));
- console.log(rect);
-
- // console.log( (rect.width*100) / 300 );
- } else {
- // console.error('Failed to fetch rectangles from API.');
- console.error('Failed to fetch rects from API.');
- }
- } catch (error) {
- // console.error('Error fetching rectangles :', error);
- console.error('Error fetching rects :', error);
- }
-});
-// 杩涚倝鍓�
-const handleConfirm = async () => {
- try {
- const response = await request.post('/temperingGlass/temperingGlassInfo/SelectWaitingGlass');
- if (response.code === 200) {
- const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
- console.log(response.data);
- const { height: newheight,width: newwidth } = response.data; // 鑾峰彇灏哄
- height.value = newheight;
- width.value = newwidth;
-
- adjustedRectsa.value = rawRects.map(rect => ({
+ xcoordinate: rect.xCoordinate * 0.5, // 灏唜鍊奸櫎浠�3
+ ycoordinate: rect.ycoordinate * 0.5,
+ width: rect.width * 0.4,
+ height: rect.height * 0.4,
+ widtha: rect.width,
+ heighta: rect.height,
+ }));
+ console.log(data.intoGlass[0]);
+ adjustedRectsa.value = data.waitingGlass[0].map(rect => ({
...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3
- ycoordinate: rect.ycoordinate,
- width: rect.width ,
- height: rect.height ,
+ xcoordinate: rect.xCoordinate * 0.5, // 灏唜鍊奸櫎浠�3
+ ycoordinate: rect.ycoordinate * 0.5,
+ width: rect.width * 0.4,
+ height: rect.height * 0.4,
+ widtha: rect.width,
+ heighta: rect.height,
+ state: rect.state
}));
- console.log(rect);
-
- // console.log( (rect.width*100) / 300 );
- } else {
- // console.error('Failed to fetch rectangles from API.');
- console.error('Failed to fetch rects from API.');
- }
- } catch (error) {
- // console.error('Error fetching rectangles :', error);
- console.error('Error fetching rects :', error);
- }
-};
-
-// 宸插嚭鐐�
-const handleConfirma = async () => {
- try {
- const response = await request.get('/temperingGlass/temperingGlassInfo/SelectOutGlass');
- if (response.code === 200) {
- const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
- console.log(response.data);
- const { height: newheight,width: newwidth } = response.data; // 鑾峰彇灏哄
- height.value = newheight;
- width.value = newwidth;
-
- adjustedRectsb.value = rawRects.map(rect => ({
+
+ adjustedRectsb.value = data.outGlass[0].map(rect => ({
...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
- xcoordinate: rect.xcoordinate, // 灏唜鍊奸櫎浠�3
- ycoordinate: rect.ycoordinate,
- width: rect.width ,
- height: rect.height ,
+ xcoordinate: rect.xCoordinate * 0.5, // 灏唜鍊奸櫎浠�3
+ ycoordinate: rect.ycoordinate * 0.5,
+ width: rect.width * 0.4,
+ height: rect.height * 0.4,
+ widtha: rect.width,
+ heighta: rect.height,
+ state: rect.state
}));
- console.log(rect);
+};
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
- // console.log( (rect.width*100) / 300 );
- } else {
- // console.error('Failed to fetch rectangles from API.');
- console.error('Failed to fetch rects from API.');
- }
- } catch (error) {
- // console.error('Error fetching rectangles :', error);
- console.error('Error fetching rects :', error);
- }
-};
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- }
- ],
-})
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
<div style="margin-top: 10px;">
<el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true;dialogFormVisiblea = false;dialogFormVisibleb = false;">杩涚倝涓�</el-button>
- <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="handleConfirm();dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >杩涚倝鍓�</el-button>
- <el-button id="searchButton" type="success" @click="handleConfirma();dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">宸插嚭鐐夌幓鐠�</el-button>
+ <el-button style="margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true;dialogFormVisible = false;dialogFormVisibleb = false;" >杩涚倝鍓�</el-button>
+ <el-button id="searchButton" type="success" @click="dialogFormVisibleb = true;dialogFormVisible = false;dialogFormVisiblea = false">宸插嚭鐐夌幓鐠�</el-button>
<div v-if="dialogFormVisible" >
- <!-- <div style="display: flex;margin-bottom: 20px;">
- <div style="margin-left: 450px;font-size: 20px;">宸ョ▼鍙凤細P20240305001 </div>
- <div style="margin-left: 150px;font-size: 20px;">鐗堝浘缂栧彿锛�1</div>
- </div> -->
- <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
- <el-scrollbar height="630px">
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 700px;" v-loading="loading">
+<div style="width: 49%;float: left;background-color: #f4f4f5;height: 650px;">
+ <el-scrollbar height="630px">
+ <div v-for="(group, groupId) in groupedRects" :key="groupId" style="position: relative;">
<div style="position: relative;width: 1400px;">
<div
v-for="(rect, index) in adjustedRects"
@@ -161,11 +84,32 @@
:style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
>
<div class="centered-text">
- <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>
+ <div >{{ rect.flowcardId }}</div>
+ <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-scrollbar>
+ </div>
+<div style="width: 49%;float: right;background-color: #f4f4f5;height: 650px;">
+ <el-scrollbar height="630px">
+ <div style="position: relative;width: 1400px;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="index"
+ class="rect"
+ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
+ >
+ <div class="centered-text">
+ <div >{{ rect.flowcardId }}</div>
+ <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
</div>
</div>
</div>
</el-scrollbar>
+</div>
+
</el-card>
</div>
<div v-if="dialogFormVisiblea">
@@ -173,13 +117,15 @@
<el-scrollbar height="630px">
<div style="position: relative;width: 1400px;">
<div
- v-for="(rect, index) in adjustedRects"
+ v-for="(rect, index) in adjustedRectsa"
:key="index"
class="rect"
- :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
- >
+ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`,
+ width: `${rect.width}px`, height: `${rect.height}px`,
+ backgroundColor: rect.state === 0 ? '#dedfe0' : '#d1edc4' }">
<div class="centered-text">
- <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>
+ <div >{{ rect.flowcardId }}</div>
+ <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
</div>
</div>
</div>
@@ -191,13 +137,15 @@
<el-scrollbar height="630px">
<div style="position: relative;width: 1400px;">
<div
- v-for="(rect, index) in adjustedRects"
+ v-for="(rect, index) in adjustedRectsb"
:key="index"
class="rect"
- :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
- >
+ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`,
+ width: `${rect.width}px`, height: `${rect.height}px`,
+ backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }">
<div class="centered-text">
- <div style="margin-top: 50px;margin-left: -85px;">{{ rect.width }}*{{ rect.height }}</div>
+ <div >{{ rect.flowcardId }}</div>
+ <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
</div>
</div>
</div>
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
index 11f2545..2a98019 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -3,7 +3,10 @@
import {reactive} from "vue";
import {useRouter} from "vue-router"
-import { ref } from 'vue'
+import { ref, onMounted, onBeforeUnmount } from 'vue';
+import { WebSocketHost ,host} from '@/utils/constants'
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
+const adjustedRects = ref([]);
const dialogFormVisible = ref(true)
const dialogFormVisiblea = ref(false)
@@ -22,55 +25,53 @@
}
}
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- }
- ],
-})
+const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ adjustedRects.value = data.overGlass[0].map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ xcoordinate: rect.xCoordinate * 0.5, // 灏唜鍊奸櫎浠�3
+ ycoordinate: rect.ycoordinate * 0.5,
+ width: rect.width * 0.4,
+ height: rect.height * 0.4,
+ widtha: rect.width,
+ heighta: rect.height,
+ }));
+ console.log(data.intoGlass[0]);
+};
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
<div style="margin-top: 10px;">
<div>
<el-card style="margin-left: 10px;margin-top: 10px;margin-right: 10px;" v-loading="loading">
- <div style="display: flex;margin-top: 20px;">
- <div style="margin-left: 400px;font-size: 20px;">宸ョ▼鍙凤細P20240305001 </div>
- <div style="margin-left: 150px;font-size: 20px;">鐗堝浘缂栧彿锛�1</div>
- </div>
- <div>
- <div id="boxa" style="width: 700px;height: 220px;margin-left: 260px;">
- <div style="margin-top: 85px;"> NG202405060798A01-1</div>
- <div> 500脳1500</div>
- </div>
- </div>
+ <el-scrollbar height="630px">
+ <div style="position: relative;width: 1400px;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="index"
+ class="rect"
+ :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`,
+ width: `${rect.width}px`, height: `${rect.height}px`,
+ backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }">
+ <div class="centered-text">
+ <div >{{ rect.flowcardId }}</div>
+ <div style="margin-top: 50px;margin-left: -50px;">{{ rect.widtha }}*{{ rect.heighta }}</div>
+ </div>
+ </div>
+ </div>
+ </el-scrollbar>
</el-card>
</div>
</div>
@@ -87,4 +88,15 @@
margin-top: 70px;
margin-bottom: 50px;
}
+.rect {
+ border: 1px solid black; /* 璁剧疆鐭╁舰鐨勮竟妗� */
+ background-color: lightblue; /* 璁剧疆鐭╁舰鐨勮儗鏅壊 */
+}
+.centered-text {
+ /* 璁剧疆鏂囧瓧灞呬腑鏍峰紡 */
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */
+}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index 3d857fb..84df863 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -13,7 +13,7 @@
const adda = ref(false)
const flake = ref(false)
const flakea = ref(false)
-import { WebSocketHost } from '@/utils/constants'
+import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
const ida = ref(null);
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -25,9 +25,9 @@
const selectedValuea = ref('');
const selectedValueb = ref('');
const selectedValuec = ref('');
-const upstatus = ref(''); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��
+const upstatus = ref('涓婄墖鏈烘墜鍔ㄧ姸鎬侊細'); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��
const cuttingMachine = ref(''); // 鍋囪杩欎釜鐢ㄤ簬瀛樺偍鍚庣杩斿洖鐨勭姸鎬佸�硷紙0鎴�1锛�
-const cuttingMachineStatusColor = ref(''); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊
+const cuttingMachineStatusColor = ref('#911005'); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊
const inKageWord = ref(0); // 鐢ㄤ簬瀛樺偍瑕佷紶閫掔粰鎺ュ彛鐨刬nKageWord鍊�
const options = ref<any[]>([]); // 涓嬫媺閫夐」鍒楄〃
const selectOptions = ref<Array<any>>([]); // 涓嬫媺閫夐�夐」鏁扮粍
@@ -44,7 +44,7 @@
// 鏇存柊琛ㄦ牸鏁版嵁
console.log('鎴愬姛鑾峰彇琛ㄦ牸鏁版嵁:', response.data);
tableData.splice(0, tableData.length, ...response.data);
- window.localStorage.setItem('engineeringId', response.data[0].engineeringId)
+ // window.localStorage.setItem('engineeringId', response.data[0].engineeringId)
// 鑾峰彇鍞竴鍊�
const uniqueWidths = new Set(response.data.map(item => item.width));
const uniqueHeights = new Set(response.data.map(item => item.height));
@@ -68,7 +68,7 @@
label: thickness,
}));
} else {
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
} catch (error) {
// 澶勭悊璇锋眰澶辫触鐨勬儏鍐�
@@ -91,7 +91,7 @@
flakea.value = true
}
} else {
- ElMessage.warning(res.msg)
+ ElMessage.warning(res.message)
// router.push("/login")
}
});
@@ -102,7 +102,7 @@
const titleSelectJsona = ref({
processTypea: [],
})
-const socketUrl = `ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
@@ -210,7 +210,7 @@
}
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
} catch (error) {
// 澶勭悊璇锋眰閿欒
@@ -249,7 +249,7 @@
}
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
} catch (error) {
// 澶勭悊璇锋眰閿欒
@@ -291,7 +291,7 @@
}
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
} catch (error) {
// 澶勭悊閿欒
@@ -304,6 +304,7 @@
const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
engineerId: selectedProjectNo.value,
})
+ window.localStorage.setItem('engineeringId', selectedProjectNo.value)
if (response.code == 200) {
// 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
ElMessage.success(response.message);
@@ -336,7 +337,8 @@
}));
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
+ // ElMessage.error(response.msg);
}
}
catch (error) {
@@ -361,10 +363,10 @@
ElMessage.success(response.message);
// window.location.reload()
blind.value = false;
- selectedProjectNoa.value = ''
+ selectedProjectNoa.value = '';
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
}
catch (error) {
@@ -389,10 +391,10 @@
if (response.code == 200) {
ElMessage.success(response.message);
blinda.value = false;
- tableData.splice([]);
+ // tableData.splice([]);
} else {
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
}
else {
@@ -425,7 +427,7 @@
tableData.splice([]);
// 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
+ ElMessage.error(response.message);
}
}
else {
@@ -493,10 +495,31 @@
const confirmCuttingMachine = () => {
cuttingMachineStatus.value = 'green';
};
+const toggleEnableState = async (row: any) => {
+ // 妫�鏌� id 鏄惁涓虹┖
+ if (!row.id) {
+ ElMessage.error('璇ュ伐绋嬫湭淇濆瓨鍒颁笂鐗囪〃锛�');
+ return; // 濡傛灉 id 涓虹┖锛屽垯涓嶆墽琛屽悗缁搷浣�
+ }
+
+ const newState = row.state === 100 ? 0 : 100;
+
+ try {
+ // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵��
+ const response = await request.post('/loadGlass/up-patten-usage/updateGlassState', { id: row.id, state: newState });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+ } catch (error) {
+ // 澶勭悊璇锋眰閿欒
+ console.error('鏇存柊鐜荤拑鐘舵�佽姹傚け璐�:', error);
+ ElMessage.error('鏇存柊鐜荤拑鐘舵�佹椂鍙戠敓閿欒');
+ }
+};
-
-
-const wsUrl = 'ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass';
+const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
const ws = new WebSocket(wsUrl);
ws.onopen = () => {
console.log('WebSocket杩炴帴宸叉墦寮�');
@@ -518,16 +541,14 @@
// 鐩戝惉WebSocket鐨勬秷鎭簨浠�
ws.onmessage = (event) => {
- // 鍋囪鏈嶅姟鍣ㄥ彂閫佺殑鏄疛SON鏍煎紡鐨勫瓧绗︿覆
try {
const data = JSON.parse(event.data); // 瑙f瀽娑堟伅涓篔SON
- // 鍋囪鏈嶅姟鍣ㄥ彂閫佺殑鏁版嵁缁撴瀯鏄� { InkageStatus: ["1"] }
if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) {
const status = data.InkageStatus[0];
cuttingMachine.value = status;
upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
- cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';
+ cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
inKageWord.value = status === '1' ? 0 : 1;
} else {
// 澶勭悊閿欒鎯呭喌鎴栨棤鏁堟暟鎹�
@@ -545,7 +566,7 @@
if (response.code == 200) {
const status = response.data.status;
upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
- cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';
+ cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';
// 鏄剧ず鎴愬姛娑堟伅
ElMessage.success(response.message);
} else {
@@ -557,25 +578,6 @@
ElMessage.error('璇锋眰鏃跺彂鐢熼敊璇�');
}
};
-// const confirmCutting = async () => {
-// try {
-// const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', {
-// inKageWord: inKageWord.value
-// })
-// if (response.code == 200) {
-// inKageWord == '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
-// inKageWord.value == '1' ? '#911005' : 'green';
-// ElMessage.success(response.message);
-// } else {
-// // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
-// ElMessage.error(response.msg);
-// }
-// }
-// catch (error) {
-// // 澶勭悊閿欒
-// console.error(error);
-// }
-// }
</script>
<template>
@@ -589,13 +591,13 @@
<el-button @click="confirmCuttingMachine" style="margin-left: 30px;margin-top: -3px;" >纭</el-button>
<div style="margin-left: 70px;">{{ upstatus }} </div>
<i :style="{ marginTop: '2px', backgroundColor: cuttingMachineStatusColor, width: '18px', height: '18px', borderRadius: '50%', display: 'block' }"></i>
- <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >纭</el-button>
+ <el-button @click="confirmCutting" style="margin-left: 30px;margin-top: -3px;" >鍒囨崲</el-button>
</div>
<el-button style="margin-top: 5px;margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true">閫夋嫨宸ョ▼</el-button>
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary" @click="handleBind">寮�濮嬩笂鐗�</el-button>
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" @click="handleBinda">鏆傚仠</el-button>
- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button>
+ <!-- <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button> -->
<el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
@@ -611,7 +613,7 @@
<el-table-column prop="filmsId" label="鑶滅郴" align="center"/>
<el-table-column prop="layoutSequence" label="鏁伴噺" align="center"/>
<el-table-column prop="thickness" label="鍘氬害" align="center"/>
- <el-table-column
+ <!-- <el-table-column
align="center"
label="鐘舵��"
min-width="80"
@@ -621,7 +623,21 @@
<el-tag :type="getStatusType(scope.row.state)">
{{ getStatusText(scope.row.state) }}
</el-tag>
- </template>
+ </template> -->
+ <el-table-column
+ align="center"
+ label="鍚敤鐘舵��"
+ min-width="80"
+ prop="state"
+ >
+ <template #default="scope">
+ <el-tag
+ :type="scope.row.state === 100 ? 'success' : 'warning'"
+ @click="toggleEnableState(scope.row)"
+ >
+ {{ scope.row.state === 100 ? '閫氳繃' : '绛夊緟涓�' }}
+ </el-tag>
+ </template>
</el-table-column>
</el-table>
</div>
diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 22d0adc..068a4da 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -3,13 +3,21 @@
import {reactive} from "vue";
import {useRouter} from "vue-router"
const router = useRouter()
-
-import { ref } from 'vue'
+import { WebSocketHost ,host} from '@/utils/constants'
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
import { ElMessage, ElMessageBox } from 'element-plus'
import { tr } from "element-plus/es/locale";
const dialogFormVisible = ref(false)
const dialogFormVisiblea = ref(false)
const dialogFormVisibleb = ref(false)
+const tableData = ref([])
+const tableDatab = ref([])
+const tableDatac = ref([])
+const tableDatad = ref([])
+const tableDatae = ref([])
+const adjustedRects = ref([]);
+const height = ref([]);
const carposition1 = ref(60);
const carposition2 = ref(220);
@@ -19,7 +27,6 @@
const timers2 =ref(true);
const timers3 =ref(true);
const timers4 =ref(true);
-const cellshow=ref(false);
const cellshow5=ref(false);
const c1=ref(false);
const c2=ref(false);
@@ -31,33 +38,18 @@
const million1=ref(0);
const million3=ref(0);
const million4=ref(0);
+const cell1=ref(true);
+const cell2=ref(true);
+const cell3=ref(true);
+const cell4=ref(true);
+const cell5=ref(true);
+const cell6=ref(true);
+const cell7=ref(true);
+const cell8=ref(true);
const currentPage4 = ref(4)
const pageSize4 = ref(100)
-const tableData = [
- {
- id: '1',
- a: '1',
- b: '1',
- c: '123456789',
- d: '1568251',
- e: '1',
- f: '100*100',
- g: '',
- },
-]
-const tableDatab = [
- {
- id: '2',
- a: '2',
- b: '2',
- c: '123456789',
- d: '1568251',
- e: '1',
- f: '100*100',
- g: '',
- }
-]
+
const dialogForm = () => {
ElMessageBox.confirm(
'纭畾瑕佹�ュ仠鍚�?',
@@ -83,7 +75,7 @@
}
var timer=setInterval(() => {
- console.log(million.value,million1.value);
+ // console.log(million.value,million1.value);
million.value+=1;
if(million.value-million1.value!==12){
@@ -115,13 +107,7 @@
}
}else{
million1.value=million.value;
- if(cellshow.value==true){
- cellshow.value=false;
-
- }else{
- cellshow.value=true;
-
- }
+
if(cellshow1.value==true){
cellshow1.value=false;
}else{
@@ -137,7 +123,7 @@
}, 1000);
var timer=setInterval(() => {
- console.log(million3.value,million4.value);
+ // console.log(million3.value,million4.value);
million3.value+=1;
if(million3.value-million4.value!==12){
@@ -204,69 +190,120 @@
}
}
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- 'id': '1',
- 'long': '5',
- 'wide': '1005',
- 'thick': '183.6',
- }
- ],
-})
+
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableDatac.value = data.bigStorageCageDetailsOutTask[0]
+ tableDatad.value = data.bigStorageCageDetailsFeedTask[0]
+ tableData.value = data.bigStorageCageInfo[0]
+ tableDatab.value = data.temperingGlassInfoList[0]
+ tableDatae.value = data.bigStorageCageUsage[0]
+ adjustedRects.value = data.bigStorageCageInfo1[0]
+ // adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({
+ // ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ // height: rect.length *0.5,
+
+ // }));
+ window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length)
+ let length = window.localStorage.getItem('length')
+ console.log(length);
+
+};
+// function getRectHeight(length: number) {
+// return length > 0 ? 29 / length : 29;
+// }
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+function getStatusType(enableState: number) {
+ switch (enableState) {
+ case 0:
+ return 'warning';
+ case 1:
+ return 'success';
+ }
+}
+function getStatusText(enableState: number) {
+ switch (enableState) {
+ case 0:
+ return '绂佺敤';
+ case 1:
+ return '鍚敤';
+ }
+}
+function getStatusTypea(ishorizontal: number) {
+ switch (ishorizontal) {
+ case 0:
+ return 'warning';
+ case 1:
+ return 'success';
+ }
+}
+function getStatusTexta(ishorizontal: number) {
+ switch (ishorizontal) {
+ case 0:
+ return '涓嶆帴鍙�';
+ case 1:
+ return '鎺ュ彈';
+ }
+}
+function getStatusTypeb(state: number) {
+ switch (state) {
+ case 0:
+ return 'success';
+ case 1:
+ return 'primary';
+ }
+}
+function getStatusTextb(state: number) {
+ switch (state) {
+ case 0:
+ return '鍑虹墖瀹屾垚';
+ case 1:
+ return '绛夊緟涓�';
+ case 2:
+ return '绛夊緟涓�';
+ }
+}
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
<div style="height: 700px;">
<!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisible = true">鎵嬪姩杩涚墖</el-button> -->
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">璁㈠崟淇℃伅</el-button>
+ <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">鐞嗙墖绗间俊鎭�</el-button>
<el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">鍑虹墖闃熷垪</el-button>
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">缁堟杩涚墖</el-button>
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">缁堟鍑虹墖</el-button>
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">杞�ュ仠</el-button>
+ <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">缁堟杩涚墖</el-button> -->
+ <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger">缁堟鍑虹墖</el-button> -->
+ <!-- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="danger" @click="dialogForm">杞�ュ仠</el-button> -->
<el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
<el-table height="100%" ref="table"
- @selection-change="handleSelectionChange"
- :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="id" align="center" label="鍑虹墖鐜荤拑ID" min-width="80" />
- <el-table-column prop="a" align="center" label="绗煎瓙" min-width="120" />
- <el-table-column prop="b" align="center" label="鏍煎瓙" min-width="120" />
- <el-table-column prop="c" align="center" label="宸ョ▼鍙�" min-width="120" />
- <el-table-column prop="d" align="center" label="娴佺▼鍗″彿" min-width="120" />
- <el-table-column prop="e" align="center" label="閽㈠寲鐗堝浘鍙�" min-width="157" />
- <el-table-column prop="f" align="center" label="灏哄" min-width="120" />
- <el-table-column prop="g" align="center" label="缁撴潫浠诲姟" min-width="120">
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="text">瀹屾垚浠诲姟</el-button>
-</el-table-column>
+ :data="tableDatac" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+ <el-table-column prop="bigStorageCageOutTask.glassId" align="center" label="鍑虹墖鐜荤拑ID" min-width="80" />
+ <el-table-column prop="bigStorageCageOutTask.startSlot" align="center" label="璧峰浣嶇疆" min-width="120" />
+ <el-table-column prop="bigStorageCageOutTask.endSlot" align="center" label="鐩爣浣嶇疆" min-width="120" />
+ <el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" label="杞︽" min-width="120" />
+ <el-table-column prop="bigStorageCageOutTask.serialNumber" align="center" label="搴忓彿" min-width="120" />
+ <el-table-column prop="bigStorageCageOutTask.taskState" align="center" label="浠诲姟鐘舵��" min-width="157">
+ <template #default="scope">
+ <el-tag type="success" >{{ scope.row.bigStorageCageOutTask.taskState==0?"绛夊緟杩涚墖":"杩涜涓�" }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="缁撴潫浠诲姟" align="center" width="150">
+ <template #default="scope">
+ <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">瀹屾垚浠诲姟</el-button>
+ </template>
+ </el-table-column>
</el-table>
</div>
</el-card>
@@ -274,111 +311,35 @@
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
<el-table height="100%" ref="table"
@selection-change="handleSelectionChange"
- :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="id" align="center" label="杩涚墖鐜荤拑ID" min-width="80" />
- <el-table-column prop="a" align="center" label="绗煎瓙" min-width="120" />
- <el-table-column prop="b" align="center" label="鏍煎瓙" min-width="120" />
- <el-table-column prop="c" align="center" label="宸ョ▼鍙�" min-width="120" />
- <el-table-column prop="d" align="center" label="娴佺▼鍗″彿" min-width="120" />
- <el-table-column prop="e" align="center" label="閽㈠寲鐗堝浘鍙�" min-width="157" />
- <el-table-column prop="f" align="center" label="灏哄" min-width="120" />
- <el-table-column prop="g" align="center" label="缁撴潫浠诲姟" min-width="120">
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="text">瀹屾垚浠诲姟</el-button>
-</el-table-column>
+ :data="tableDatad" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+ <el-table-column prop="bigStorageCageFeedTask.glassId" align="center" label="杩涚墖鐜荤拑ID" min-width="80" />
+ <el-table-column prop="bigStorageCageFeedTask.tragetSlot" align="center" label="鐩爣浣嶇疆" min-width="120" />
+ <!-- <el-table-column prop="task_type" align="center" label="浠诲姟绫诲瀷" min-width="120" />娌℃湁杩斿洖瀛楁 -->
+ <el-table-column prop="bigStorageCageFeedTask.taskState" align="center" label="浠诲姟鐘舵��" min-width="120">
+ <template #default="scope">
+ <el-tag type="success" >{{ scope.row.bigStorageCageFeedTask.taskState==0?"绛夊緟杩涚墖":"杩涜涓�" }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="bigStorageCageFeedTask.line" align="center" label="绾胯矾" min-width="120" />
+ <el-table-column fixed="right" label="缁撴潫浠诲姟" align="center" width="150">
+ <template #default="scope">
+ <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">瀹屾垚浠诲姟</el-button>
+ </template>
+ </el-table-column>
</el-table>
</div>
</el-card>
<div style="padding: 10px;display: flex;height:110px;">
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#1</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#2</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#3</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#4</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#5</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#6</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#7</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <div id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#8</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div>
- <!-- <div v-for="n in 8" :key="n" id="occupy">
- <el-col style="text-align:left;font-weight: bold;">#1</el-col>
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
- </el-col>
- <hr style="width:80%;margin: 0 auto;" />
- <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
- <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
- </el-col>
- </div> -->
+ <div v-for="(item, index) in tableDatae" :key="index" id="occupy">
+ <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col>
+ <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
+ <span>浣跨敤鐜�</span><span>{{ item.percentage }}</span>
+ </el-col>
+ <hr style="width:80%;margin: 0 auto;" />
+ <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
+ <span>绌洪棽锛堟牸瀛愭暟锛�</span><span>{{ item.count }}</span>
+ </el-col>
+ </div>
</div>
<!-- <div id="awatch">
<img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;">
@@ -393,15 +354,49 @@
</div>
<div v-show="c2" class="img-car3" :style="'z-index:999;left:247px;top:' + carposition3 + 'px;position:absolute;'">
- <div v-show="cellshow3" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
+ <div v-show="cellshow3" style="margin-top:10px;width:220px;height:5px;background-color:#409EFF;"></div>
</div>
<div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'">
<div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
</div>
- <div v-show="cellshow" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;">
+ <div v-show="cell1" style="width: 227px;height: 29px;position: absolute;top:55px;left: 465px;">
+ <div
+ v-for="(item, index) in adjustedRects"
+ :key="index"
+ :style="{
+ top: `1px`, width: `227px`,
+ backgroundColor: '#409EFF',
+ height: `height`+ `px`
+ }"
+ >
</div>
- <div v-show="cellshow5" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;">
+ <!-- <div
+ v-for="(item, index) in adjustedRects"
+ height: `${rect.height}px`,
+ :key="index"
+ :style="{
+ width: '227px',
+ height: '1px',
+ backgroundColor: '#409EFF',
+ top: '1px'
+ }"
+ >
+ </div> -->
</div>
+ <!-- <div v-show="cell2" style="width: 227px;height: 29px;position: absolute;top:86px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;background-color: #409EFF;">
+ </div>
+ <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;">
+ </div> -->
</div>
</div>
@@ -527,17 +522,28 @@
</div>
</template>
</el-dialog>
-<el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="璁㈠崟淇℃伅" >
- <el-input placeholder="璇疯緭鍏ュ伐绋嬪彿" style="width: 180px;size: mini;"></el-input>
- <el-button style="margin-left: 10px;size: mini;" type="primary">鏌ヨ</el-button>
+<el-dialog v-model="dialogFormVisiblea" top="10vh" width="85%" title="鐞嗙墖绗间俊鎭�" >
+ <!-- <el-input placeholder="璇疯緭鍏ュ伐绋嬪彿" style="width: 180px;size: mini;"></el-input> -->
+ <!-- <el-button style="margin-left: 10px;size: mini;" type="primary">鏌ヨ</el-button> -->
<el-table ref="table" style="margin-top: 20px;height: 500px;"
@selection-change="handleSelectionChange"
- :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="ida" align="center" label="鐜荤拑id" min-width="80" />
- <el-table-column prop="typea" align="center" label="宸ョ▼鍙�" min-width="120" />
- <el-table-column prop="typea" align="center" label="闀�" min-width="120" />
- <el-table-column prop="typea" align="center" label="瀹�" min-width="120" />
- <el-table-column prop="typea" align="center" label="鍘�" min-width="120" />
+ :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+ <el-table-column prop="id" align="center" label="澶х悊鐗囩琛↖D" min-width="80" />
+ <el-table-column prop="deviceId" align="center" label="鐞嗙墖绗煎彿" min-width="120" />
+ <el-table-column prop="slot" align="center" label="鏍呮牸鍙�" min-width="120" />
+ <el-table-column
+ align="center"
+ label="鍚敤鐘舵��"
+ min-width="80"
+ prop="enableState"
+ >
+ <template #default="scope">
+ <el-tag :type="getStatusType(scope.row.enableState)">
+ {{ getStatusText(scope.row.enableState) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="remainWidth" align="center" label="鍓╀綑瀹藉害" min-width="120" />
</el-table>
<div id="demo-pagination-block">
<el-pagination
@@ -557,25 +563,58 @@
</el-dialog>
<el-dialog v-model="dialogFormVisibleb" top="10vh" width="85%" title="鍑虹墖闃熷垪" >
<div style="display: flex;">
- <p style="margin-top: 4px;">闃熷垪鐘舵�侊細</p>
- <p style="margin-top: 4px;">寮�濮�</p>
+ <p style="margin-top: 3px;">闃熷垪鐘舵�侊細</p>
+ <p style="margin-top: 3px;">寮�濮�</p>
<el-button style="margin-left: 10px;size: mini;" type="danger">鍋滄</el-button>
<el-button style="margin-left: 10px;size: mini;" type="primary">娣诲姞</el-button>
</div>
<el-table ref="table" style="margin-top: 20px;height: 500px;"
- @selection-change="handleSelectionChange"
:data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="id" align="center" label="閾濇id" min-width="80" />
- <el-table-column prop="type" align="center" label="鐜荤拑id" min-width="120" />
- <el-table-column prop="type" align="center" label="璁㈠崟缂栧彿" min-width="120" />
- <el-table-column prop="type" align="center" label="鍒楄〃缂栧彿" min-width="120" />
- <el-table-column prop="type" align="center" label="绠卞瓙缂栧彿" min-width="120" />
- <el-table-column prop="type" align="center" label="闀�" min-width="120" />
- <el-table-column prop="type" align="center" label="瀹�" min-width="120" />
- <el-table-column prop="type" align="center" label="鐜荤拑鐘舵��" min-width="120" />
- <el-table-column prop="type" align="center" label="椤哄簭" min-width="120" />
- <el-table-column prop="type" align="center" label="瀹屾垚" min-width="120" />
- <el-table-column prop="type" align="center" label="鎿嶄綔" min-width="120" />
+ <el-table-column prop="id" fixed align="center" label="閽㈠寲灏忕墖淇℃伅琛╥d" min-width="150"/>
+ <!-- <el-table-column prop="glass_id" align="center" label="鐜荤拑id" min-width="120" /> -->
+ <el-table-column prop="flowcardId" fixed align="center" label="娴佺▼鍗�" min-width="120" />
+ <el-table-column prop="glassType" align="center" label="娴佺▼鍗$幓鐠冪被鍨�" min-width="150" />
+ <el-table-column prop="width" align="center" label="瀹�" min-width="80" />
+ <el-table-column prop="height" align="center" label="楂�" min-width="80" />
+ <el-table-column prop="thickness" align="center" label="鍘氬害" min-width="80" />
+ <el-table-column prop="filmsid" align="center" label="鑶滅郴" min-width="80" />
+ <!-- <el-table-column prop="ishorizontal" align="center" label="閽㈠寲鏄惁鎺ュ彈妯斁" min-width="150" /> -->
+ <el-table-column
+ align="center"
+ label="閽㈠寲鏄惁鎺ュ彈妯斁"
+ min-width="150"
+ prop="ishorizontal"
+ >
+ <template #default="scope">
+ <el-tag :type="getStatusTypea(scope.row.ishorizontal)">
+ {{ getStatusTexta(scope.row.ishorizontal) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="temperingLayoutId" align="center" label="閽㈠寲鐗堝浘id" min-width="120" />
+ <el-table-column prop="temperingFeedSequence" align="center" label="閽㈠寲鐗堝浘鐗囧簭" min-width="120" />
+ <el-table-column prop="xCoordinate" align="center" label="x鍧愭爣" min-width="80" />
+ <el-table-column prop="yCoordinate" align="center" label="y鍧愭爣" min-width="80" />
+ <el-table-column prop="angle" align="center" label="鏃嬭浆瑙掑害锛堥�嗘椂閽堬級" min-width="150" />
+ <!-- <el-table-column prop="state" align="center" label="鐘舵��" min-width="80" /> -->
+ <el-table-column
+ align="center"
+ label="鐘舵��"
+ min-width="80"
+ prop="state"
+ >
+ <template #default="scope">
+ <el-tag :type="getStatusTypeb(scope.row.state)">
+ {{ getStatusTextb(scope.row.state) }}
+ </el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" align="center" width="150">
+ <template #default="scope">
+ <el-button size="mini" type="text" plain @click="handleBindRack(scope.row)">娣诲姞</el-button>
+ <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
</el-table>
</el-dialog>
diff --git a/UI-Project/src/views/StockBasicData/stockBasicData.vue b/UI-Project/src/views/StockBasicData/stockBasicData.vue
index cdeb549..01b0ddb 100644
--- a/UI-Project/src/views/StockBasicData/stockBasicData.vue
+++ b/UI-Project/src/views/StockBasicData/stockBasicData.vue
@@ -4,9 +4,10 @@
import {useRouter} from "vue-router"
const router = useRouter()
const adda = ref(false)
-
+import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
-import { ref, onMounted } from "vue";
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
// import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// import LanguageMixin from './lang/LanguageMixin'
@@ -93,44 +94,23 @@
}
};
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- 'id': '1',
- 'long': '5',
- 'wide': '1005',
- 'thick': '183.6',
- }
- ]
-
-})
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.value = data.EdgTasks1[0]
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
diff --git a/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
index da758c0..6d4df18 100644
--- a/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
+++ b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
@@ -4,9 +4,10 @@
import {useRouter} from "vue-router"
const router = useRouter()
const adda = ref(false)
-
+import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
-import { ref, onMounted } from "vue";
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
// import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// import LanguageMixin from './lang/LanguageMixin'
@@ -93,44 +94,24 @@
}
};
-const gridOptions = reactive({
- border: "full",//琛ㄦ牸鍔犺竟妗�
- keepSource: true,//淇濇寔婧愭暟鎹�
- align: 'center',//鏂囧瓧灞呬腑
- stripe:true,//鏂戦┈绾�
- rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
- id: 'OrderList',
- showFooter: true,//鏄剧ず鑴�
- printConfig: {},
- importConfig: {},
- exportConfig: {},
- scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
- showOverflow:true,
- columnConfig: {
- resizable: true,
- useKey: true
- },
- filterConfig: { //绛涢�夐厤缃」
- remote: true
- },
- customConfig: {
- storage: true
- },
- editConfig: {
- trigger: 'click',
- mode: 'row',
- showStatus: true
- },
- data: [
- {
- 'id': '1',
- 'long': '5',
- 'wide': '1005',
- 'thick': '183.6',
- }
- ]
-
-})
+
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.value = data.EdgTasks2[0]
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ // fetchFlowCardId();
+ // fetchTableData(); // 鑾峰彇鏁版嵁
+ initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
</script>
<template>
diff --git a/UI-Project/src/views/UnLoadGlass/Landingindication.vue b/UI-Project/src/views/UnLoadGlass/Landingindication.vue
index a55acb0..2424c68 100644
--- a/UI-Project/src/views/UnLoadGlass/Landingindication.vue
+++ b/UI-Project/src/views/UnLoadGlass/Landingindication.vue
@@ -39,11 +39,11 @@
import { initializeWebSocket } from '@/utils/WebSocketService';
import { WebSocketHost } from '@/utils/constants';
const racks = ref([
- { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
+ { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456',downGlassInfoList:"" } },
- { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } },
+ { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678',downGlassInfoList:"" } },
- { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
+ { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' ,downGlassInfoList:""} }
]);
@@ -87,7 +87,8 @@
content: itemData.item.content,
fillColor: itemData.item.fillColor,
width: itemData.item.width === 0 ? "" : 10,
- height: itemData.item.height === 0 ? "" : 90
+ height: itemData.item.height === 0 ? "" : 90,
+ downGlassInfoList:itemData.item.downGlassInfoList
};
if (index === 2 && itemData.item.width > 0) {
@@ -112,8 +113,8 @@
console.error(error);
}
};
-
const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass2`;
+//const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass2`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
@@ -126,7 +127,8 @@
content: itemData.item.content,
fillColor: itemData.item.fillColor,
width: itemData.item.width === 0 ? "" : 10,
- height: itemData.item.height === 0 ? "" : 90
+ height: itemData.item.height === 0 ? "" : 90,
+ downGlassInfoList:itemData.item.downGlassInfoList
};
if (index === 2 && itemData.item.width > 0) {
@@ -135,6 +137,7 @@
}
rack.item = newItem;
+
// console.log("鏄剧ず鍥�1",racks.value); // 鎵撳嵃鏇存柊鍚庣殑 racks 鍊�
}
@@ -147,29 +150,45 @@
fetchFlowCardId(); // 鑾峰彇鏁版嵁
initializeWebSocket(socketUrl, handleMessage);
});
+const showCustomAlert = (downGlassInfoList) => {
+ let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">';
+ tableContent += '<tr><th style="background-color: #f2f2f2;">鐜荤拑ID</th><th style="background-color: #f2f2f2;">鑶滅郴</th><th style="background-color: #f2f2f2;">鍘氬害</th><th style="background-color: #f2f2f2;">瀹藉害</th><th style="background-color: #f2f2f2;">楂樺害</th></tr>';
+ downGlassInfoList.forEach(info => {
+ tableContent += `<tr>
+ <td>${info.glassId}</td>
+ <td>${info.Filmsid}</td>
+ <td>${info.thickness}</td>
+ <td>${info.width}</td>
+ <td>${info.height}</td>
+ </tr>`;
+ });
-const showCustomAlert = (content) => {
- var str="鏋跺彿 : 111\n" +
- "闀� : 111\n" +
- "瀹� : 111\n" +
- "鍘� : 111\n"+
- "鐜荤拑ID : 111\n"+
- "鑶滅郴 : 111\n";
+ tableContent += '</table>';
Swal.fire({
title: '鐜荤拑淇℃伅',
- html: '<pre>' + str + '</pre>',
+ html: tableContent,
customClass: {
popup: 'format-pre'
}
});
};
-const showRectInfo = (rectInfo) => {
- const content = rectInfo.item.content;
- showCustomAlert(content);
-};
+
+ const showRectInfo = (rack) => {
+ const content = rack.item.content;
+ console.log(rack.item.downGlassInfoList[0].flowCardId)
+ console.log(content)
+ if(content==rack.item.downGlassInfoList[0].flowCardId){
+ const downGlassInfoList = rack.item.downGlassInfoList;
+ console.log(downGlassInfoList)
+ showCustomAlert(downGlassInfoList);
+
+ }
+
+ };
+
</script>
diff --git a/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue b/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
index cf75a2e..4e16fae 100644
--- a/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
+++ b/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
@@ -37,7 +37,7 @@
import Swal from 'sweetalert2'
import request from "@/utils/request";
import { initializeWebSocket } from '@/utils/WebSocketService';
- import { WebSocketHost } from '@/utils/constants';
+import { WebSocketHost ,host} from '@/utils/constants'
const racks = ref([
{ x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
@@ -112,7 +112,7 @@
}
};
-const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass3`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass3`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
@@ -125,7 +125,8 @@
content: itemData.item.content,
fillColor: itemData.item.fillColor,
width: itemData.item.width === 0 ? "" : 10,
- height: itemData.item.height === 0 ? "" : 90
+ height: itemData.item.height === 0 ? "" : 90,
+ downGlassInfoList:itemData.item.downGlassInfoList
};
if (index === 2 && itemData.item.width > 0) {
@@ -146,30 +147,44 @@
fetchFlowCardId(); // 鑾峰彇鏁版嵁
initializeWebSocket(socketUrl, handleMessage);
});
+const showCustomAlert = (downGlassInfoList) => {
+ let tableContent = '<table border="1" style="border-collapse: collapse; width: 100%;">';
+ tableContent += '<tr><th style="background-color: #f2f2f2;">鐜荤拑ID</th><th style="background-color: #f2f2f2;">鑶滅郴</th><th style="background-color: #f2f2f2;">鍘氬害</th><th style="background-color: #f2f2f2;">瀹藉害</th><th style="background-color: #f2f2f2;">楂樺害</th></tr>';
+ downGlassInfoList.forEach(info => {
+ tableContent += `<tr>
+ <td>${info.glassId}</td>
+ <td>${info.Filmsid}</td>
+ <td>${info.thickness}</td>
+ <td>${info.width}</td>
+ <td>${info.height}</td>
+ </tr>`;
+ });
-// const showCustomAlert = (content) => {
-// var str="鏋跺彿 : 111\n" +
-// "闀� : 111\n" +
-// "瀹� : 111\n" +
-// "鍘� : 111\n"+
-// "鐜荤拑ID : 111\n"+
-// "鑶滅郴 : 111\n";
+ tableContent += '</table>';
-// Swal.fire({
-// title: '鐜荤拑淇℃伅',
-// html: '<pre>' + str + '</pre>',
-// customClass: {
-// popup: 'format-pre'
-// }
-// });
-// };
-
-const showRectInfo = (rectInfo) => {
- const content = rectInfo.item.content;
- showCustomAlert(content);
+ Swal.fire({
+ title: '鐜荤拑淇℃伅',
+ html: tableContent,
+ customClass: {
+ popup: 'format-pre'
+ }
+ });
};
+
+ const showRectInfo = (rack) => {
+ const content = rack.item.content;
+ console.log(rack.item.downGlassInfoList[0].flowCardId)
+ console.log(content)
+ if(content==rack.item.downGlassInfoList[0].flowCardId){
+ const downGlassInfoList = rack.item.downGlassInfoList;
+ console.log(downGlassInfoList)
+ showCustomAlert(downGlassInfoList);
+
+ }
+
+ };
</script>
<style scoped>
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index d53fe3c..83f2eb6 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -11,9 +11,7 @@
import Landingindicationtwo from "./Landingindicationtwo.vue";
import request from "@/utils/request";
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
- import { WebSocketHost } from '@/utils/constants';
-
-
+import { WebSocketHost ,host} from '@/utils/constants'
const dialogFormVisiblea = ref(false)
const dialogFormVisiblea2 = ref(false)
@@ -148,14 +146,14 @@
};
-const socketUrl = `ws://${WebSocketHost}:8085/api/talk/unloadglass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
tableData.splice(0, tableData.length, ...data.params[0]);
- // console.log("鏇存柊鍚庢暟鎹�", tableData);
+// console.log("鏇存柊鍚庢暟鎹�", data.params[0]);
};
diff --git a/hangzhoumesParent.zip b/hangzhoumesParent.zip
deleted file mode 100644
index c049891..0000000
--- a/hangzhoumesParent.zip
+++ /dev/null
Binary files differ
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
index 7b756d8..73763d9 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -34,7 +34,7 @@
public static final Integer GLASS_STATE_IN = 100;
public static final Integer GLASS_STATE_OUT = 101;
public static final Integer GLASS_STATE_TAKE = 200;
- public static final Integer A10_OUT_TARGET_DAMAGE = 201;
+ public static final Integer GLASS_STATE_DAMAGE = 201;
/**
* 鍗у紡鐞嗙墖绗艰鎯呰〃鐜荤拑鐘舵��
@@ -56,4 +56,78 @@
public static final Integer EDG_GLASS_START = 1;
public static final Integer EDG_GLASS_SUCCESS = 2;
+ /**
+ * 纾ㄨ竟浠诲姟鐜荤拑鐘舵��
+ * 1鍗曟満鑷姩鐘舵��
+ * 2鑱旀満鑷姩鐘舵��
+ * 3鎵嬪姩鐘舵��
+ */
+ public static final Integer BIG_STORAGE_STAND_ALONE = 1;
+ public static final Integer BIG_STORAGE_ONLINE = 2;
+ public static final Integer BIG_STORAGE_MT = 3;
+
+ /**
+ * 澶х悊鐗囩璇锋眰
+ * 0 澶х悊鐗囩鏃犺姹�
+ * 1 澶х悊鐗囩杩涚墖璇锋眰
+ */
+ public static final Integer BIG_STORAGE_REQUEST = 0;
+ public static final Integer BIG_STORAGE_REQUEST_IN = 1;
+
+ /**
+ * 鍗ц浆绔嬭繘鐗囪姹�
+ * 1 浠诲姟鐢熸垚
+ * 2 鍗ц浆绔嬭繘鐗囧畬鎴�
+ * 3 澶ц溅杩涚墖瀹屾垚
+ * 4 澶х悊鐗囩杩涚墖瀹屾垚
+ */
+ public static final Integer BIG_STORAGE_IN_NEW = 1;
+ public static final Integer BIG_STORAGE_IN_UP = 2;
+ public static final Integer BIG_STORAGE_IN_CAR = 3;
+ public static final Integer BIG_STORAGE_IN_SLOT = 4;
+ /**
+ * 鍗ц浆绔嬪嚭鐗囪姹�
+ * 1 浠诲姟鐢熸垚
+ * 2 鐜荤拑杩涘ぇ杞﹀畬鎴�
+ * 3 澶ц溅鍑虹墖瀹屾垚
+ */
+ public static final Integer BIG_STORAGE_OUT_NEW = 1;
+ public static final Integer BIG_STORAGE_OUT_CAR = 2;
+ public static final Integer BIG_STORAGE_OUT_SUCCESS = 3;
+
+ /**
+ * 鍗ц浆绔嬪嚭鐗囪姹�
+ * 1 涓婅溅绛夊緟
+ * 2 涓婅溅鍚姩
+ */
+ public static final Integer BIG_STORAGE_IN_WAIT = 1;
+ public static final Integer BIG_STORAGE_IN_RUN = 2;
+
+ /**
+ * 澶х悊鐗囩瀹藉害 鍙� 鐜荤拑闂磋窛
+ */
+ public static final Integer BIG_STORAGE_WIDTH = 5000;
+ public static final Integer BIG_STORAGE_GAP = 20;
+
+ /**
+ * 閽㈠寲灏忕墖琛�
+ * -1 鐢熸垚浠诲姟
+ * 0 鍑虹墖瀹屾垚
+ * 1 鎽嗙墖瀹屾垚
+ * 2 杩涚倝瀹屾垚
+ * 3 閽㈠寲瀹屾垚
+ * 4 鍑虹墖瀹屾垚
+ * 5 鐮存崯
+ * 6 鎷胯蛋
+ */
+
+ public static final Integer TEMPERING_NEW =-1;
+ public static final Integer TEMPERING_OUT =0;
+ public static final Integer TEMPERING_DROP =1;
+ public static final Integer TEMPERING_START =2;
+ public static final Integer TEMPERING_SUCCESS =3;
+ public static final Integer TEMPERING_END =4;
+ public static final Integer TEMPERING_DAMAGE =5;
+ public static final Integer TEMPERING_TAKE =6;
+
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcBitObject.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcBitObject.java
index f427416..9f7cd3f 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcBitObject.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/device/PlcBitObject.java
@@ -97,8 +97,9 @@
* @param param 鍙傛暟瀹炰緥
*/
public void addPlcBit(PlcBitInfo param) {
- if (plcBitMap != null)
- plcBitMap.put(param.getCodeId(),param);
+ if (plcBitMap != null) {
+ plcBitMap.put(param.getCodeId(), param);
+ }
else {
plcBitMap = new LinkedHashMap<String,PlcBitInfo>();
plcBitMap.put(param.getCodeId(),param);
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java
index 7a3bfe9..66b5c07 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/CodeGet.java
@@ -22,7 +22,7 @@
// 2銆佸叏灞�閰嶇疆
// 鍏ㄥ眬閰嶇疆
GlobalConfig gc = new GlobalConfig();
- gc.setOutputDir("D:\\Documents\\hangzhoumesParent3\\");
+ gc.setOutputDir("D:\\Documents\\hangzhoumesParent4\\");
gc.setServiceName("%sService"); //鍘绘帀Service鎺ュ彛鐨勯瀛楁瘝I
gc.setAuthor("wu");
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
index c6e8a18..17b7195 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java
@@ -490,7 +490,7 @@
public EdgStorageCageDetails queryChangeGlassInfo(int endcell, String glassId) {
//鑾峰彇绗煎瓙鍐呮暟閲忓墠浜岀殑鐜荤拑鏁伴噺
MPJQueryWrapper<EdgStorageCageDetails> wrapper = new MPJQueryWrapper<>();
- wrapper.select("count(t.glass_id), t.width, t.height")
+ wrapper.select("count(t.glass_id) as count, t.width, t.height")
.eq("t.state", Const.GLASS_STATE_IN)
.groupBy("t.width, t.height");
if (endcell == Const.A09_OUT_TARGET_POSITION) {
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-cz.yml
similarity index 64%
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-cz.yml
index 2454814..0ab1e56 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-cz.yml
@@ -5,12 +5,17 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
+ driver-class-name: com.mysql.cj.jdbc.Driver
+ pp:
+ url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8
+ username: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
salve_hangzhoumes:
- url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes
username: sa
password: beibo.123/
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
@@ -18,6 +23,8 @@
nacos:
discovery:
server-addr: 127.0.0.1:8848
+ application:
+ name: cacheGlass
redis:
database: 0
host: 127.0.0.1
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-dev.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-dev.yml
index 13f6aaa..3a964d1 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-dev.yml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-dev.yml
@@ -4,33 +4,18 @@
primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
-# hangzhoumes:
-# url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8
-# username: root
-# password: beibo.123/
-# driver-class-name: com.mysql.cj.jdbc.Driver
-# pp:
-# url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8
-# username: root
-# password: beibo.123/
-# driver-class-name: com.mysql.cj.jdbc.Driver
-# salve_hangzhoumes:
-# url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
-# username: sa
-# password: beibo.123/
-# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
hangzhoumes:
- url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
pp:
- url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8
+ url: jdbc:mysql://127.0.0.1:3306/pp?serverTimezone=GMT%2b8
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
salve_hangzhoumes:
- url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes
+ url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
username: sa
password: beibo.123/
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-loc.yml
deleted file mode 100644
index 477e2cb..0000000
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application-loc.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-spring:
- datasource:
- dynamic:
- primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
- strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
- datasource:
- hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
- username: root
- password: root
- driver-class-name: com.mysql.cj.jdbc.Driver
- pp:
- url: jdbc:mysql://192.168.56.10:3306/pp?serverTimezone=GMT%2b8
- username: root
- password: root
- driver-class-name: com.mysql.cj.jdbc.Driver
- cloud:
- nacos:
- discovery:
- server-addr: 127.0.0.1:8848
- application:
- name: cacheGlass
- redis:
- database: 0
- host: 127.0.0.1
- port: 6379
- password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
index 9be3f0b..39fd32a 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@
spring:
profiles:
- active: dev
+ active: cz
application:
name: cacheGlass
mybatis-plus:
@@ -17,3 +17,4 @@
secondLength: 2500
sequence:
order: false
+
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
index 855eddd..0f57394 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/test/java/com/mes/CacheGlassModuleApplicationTest.java
@@ -1,16 +1,15 @@
package com.mes;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.github.yulichang.query.MPJLambdaQueryWrapper;
-import com.github.yulichang.query.MPJQueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
+import com.mes.common.config.Const;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
import com.mes.edgstoragecage.service.EdgStorageCageService;
-import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
+import com.mes.job.CacheGlassTask;
import com.mes.pp.entity.OptimizeDetail;
import com.mes.pp.entity.OptimizeLayout;
import com.mes.pp.mapper.OptimizeDetailMapper;
@@ -24,6 +23,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
+import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -35,15 +35,14 @@
*/
@Slf4j
@RunWith(SpringRunner.class)
-@SpringBootTest(classes = CacheGlassModuleApplication.class)
+@SpringBootTest(classes = CacheGlassModuleApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CacheGlassModuleApplicationTest {
@Autowired
EdgStorageCageService edgStorageCageService;
@Autowired
EdgStorageCageDetailsService edgStorageCageDetailsService;
-
- @Autowired
+ @Resource
TaskCacheMapper taskCacheMapper;
@Autowired
@@ -52,17 +51,57 @@
OptimizeDetailMapper optimizeDetailMapper;
@Autowired
GlassInfoService glassInfoService;
+ @Autowired
+ CacheGlassTask cacheGlassTask;
@Test
public void testFindPath() {
- String url=getClass().getResource("").getPath();
+ String url = getClass().getResource("").getPath();
log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
}
@Test
+ public void queryChangeGlassInfo() {
+ cacheGlassTask.queryChangeGlassInfo(Const.A10_OUT_TARGET_POSITION, "");
+ }
+
+ @Test
+ public void testChangeCellSize() {
+// String url=getClass().getResource("").getPath();
+// log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
+ cacheGlassTask.queryChangeGlassInfo(Const.A09_OUT_TARGET_POSITION, "");
+ }
+
+ @Test
+ public void testCellSize() {
+// String url=getClass().getResource("").getPath();
+// log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
+ cacheGlassTask.outTo(0, 0, "", "NG24051802A001|1|1|1|1", 0);
+ }
+
+ @Test
+ public void testinTo() {
+// String url=getClass().getResource("").getPath();
+// log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
+// NG24051802A001|1|4|1|4
+// cacheGlassTask.inTo("NG24051802A001|1|1|1|1", "1", "1");
+// cacheGlassTask.inTo("NG24051802A001|1|4|1|4", "1", "1");
+ cacheGlassTask.inTo("NG24051802A001|1|1|2|1", "1", "1");
+ }
+
+ @Test
+ public void testChangeGlassInfo() {
+// String url=getClass().getResource("").getPath();
+// log.info("瀹屾暣璺緞锛歿}", Arrays.asList(url));
+// NG24051802A001|1|4|1|4
+ cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|1|1|1");
+// cacheGlassTask.queryAndChangeGlass("NG24051802A001|1|4|1|4");
+ }
+
+ @Test
public void testSqlServer() {
- List<TaskCache> list=taskCacheMapper.selectList(null);
- log.info("鏁版嵁{}",list);
+ List<TaskCache> list = taskCacheMapper.selectList(null);
+ log.info("鏁版嵁{}", list);
log.info("Sql鏁版嵁锛歿}", Arrays.asList(list));
}
@@ -75,53 +114,56 @@
@Test
public void testglassinfo() {
- List<GlassInfo> glassInfos=glassInfoService.selectId("7");
+ List<GlassInfo> glassInfos = glassInfoService.selectId("7");
log.info("鐜荤拑鏁版嵁鏁版嵁锛歿}", Arrays.asList(glassInfos));
}
@Test
public void testCacheGlass() {
- List<Map<String, Object>> map= edgStorageCageService.selectEdgStorageCages();
+ List<Map<String, Object>> map = edgStorageCageService.selectEdgStorageCages();
log.info("绗煎唴淇℃伅锛歿}", Arrays.asList(map));
}
+
@Test
public void testSelectCacheEmpty() {
- List<EdgStorageCage> map= edgStorageCageService.selectCacheEmpty();
+ List<EdgStorageCage> map = edgStorageCageService.selectCacheEmpty();
log.info("绗煎唴绌烘牸锛歿}", Arrays.asList(map));
}
+
@Test
public void testScan() {
- List<Map<String, Object>> map= edgStorageCageDetailsService.selectCutTerritory();
+ List<Map<String, Object>> map = edgStorageCageDetailsService.selectCutTerritory();
log.info("鍒囧壊褰撳墠鐗堝浘淇℃伅锛歿}", Arrays.asList(map));
}
@Test
public void testPpOptimizeDetail() {
- List<OptimizeDetail> optimizeDetail=optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>()
+ List<OptimizeDetail> optimizeDetail = optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>()
.eq("project_no", "P24032204")
- .eq("stock_id",5)
+ .eq("stock_id", 5)
);
log.info("鍒囧壊褰撳墠鐗堝浘淇℃伅锛歿}", Arrays.asList(optimizeDetail));
}
+
@Test
public void testOptimizeDetail() {
- List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
+ List<Map<String, Object>> map2 = optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
.selectAll(OptimizeDetail.class)
- .selectAs(OptimizeLayout::getWidth,"olWidth")
- .selectAs(OptimizeLayout::getWidth,"olHeight")
- .select(OptimizeLayout::getWidth,OptimizeLayout::getHeight)
- .leftJoin(OptimizeLayout.class,on-> on.eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo)
- .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId))
- .eq(OptimizeDetail::getProjectNo,"P24032204" )
- .eq(OptimizeDetail::getStockId,5)
+ .selectAs(OptimizeLayout::getWidth, "olWidth")
+ .selectAs(OptimizeLayout::getWidth, "olHeight")
+ .select(OptimizeLayout::getWidth, OptimizeLayout::getHeight)
+ .leftJoin(OptimizeLayout.class, on -> on.eq(OptimizeLayout::getProjectNo, OptimizeDetail::getProjectNo)
+ .eq(OptimizeLayout::getStockId, OptimizeDetail::getStockId))
+ .eq(OptimizeDetail::getProjectNo, "P24032204")
+ .eq(OptimizeDetail::getStockId, 5)
);
log.info("鍒囧壊褰撳墠鐗堝浘淇℃伅1锛歿}", Arrays.asList(map2));
}
@Test
public void testOutTask() {
- EdgStorageCageDetails edgStorageCageDetails=edgStorageCageDetailsService.selectConformGlass("1",3);
+ EdgStorageCageDetails edgStorageCageDetails = edgStorageCageDetailsService.selectConformGlass("1", 3);
log.info("鍑虹墖浠诲姟锛歿}", Arrays.asList(edgStorageCageDetails));
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java
index a81873e..a868ca4 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageController.java
@@ -1,5 +1,6 @@
package com.mes.bigstorage.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.utils.Result;
@@ -28,10 +29,11 @@
@Autowired
private BigStorageCageService bigStorageCageService;
- @ApiOperation("鏌ヨ鐞嗙墖绗间俊鎭�")
- @GetMapping("/bigStorageCage")
- public Result querybigStorageCageDetail() {
- return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageService.querybigStorageCageDetail());
+ @ApiOperation("鐞嗙墖绗煎惎鐢ㄧ鐢�")
+ @GetMapping("/updateStorageCageDisabled")
+ public Result updateStorageCageDisabled(int slot,int enableState) {
+ bigStorageCageService.updateStorageCageDisabled(slot,enableState);
+ return Result.build(200,"鍚敤/绂佺敤鎴愬姛",1);
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
index 5d3bc0b..a9b6525 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java
@@ -1,6 +1,4 @@
package com.mes.bigstorage.controller;
-
-
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.utils.Result;
@@ -29,26 +27,47 @@
@Autowired
private BigStorageCageDetailsService bigStorageCageDetailsService;
- @ApiOperation("鐞嗙墖绗艰鎯�")
- @PostMapping("/queryBigStorageCageDetails")
- public Result queryBigStorageCageDetails() {
- return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetailsService.list());
+
+ @ApiOperation("鐜荤拑璇︽儏鏌ヨ")
+ @PostMapping("/selectBigStorageCageDetails")
+ public Result selectBigStorageCageDetails(String glassId) {
+ BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(glassId);
+ return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetails);
}
@ApiOperation("鐞嗙墖绗艰鎯呮坊鍔�")
@PostMapping("/insertBigStorageCageDetails")
public Result insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
- bigStorageCageDetailsService.save(bigStorageCageDetails);
+ bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails);
return Result.build(200,"娣诲姞鎴愬姛",1);
-
}
@ApiOperation("鐞嗙墖绗艰鎯呭垹闄�")
@PostMapping("/deleteBigStorageCageDetails")
public Result deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
- bigStorageCageDetailsService.removeById(bigStorageCageDetails.getId());
+ bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails);
return Result.build(200,"鍒犻櫎鎴愬姛",1);
+ }
+ @ApiOperation("鐞嗙墖绗间换鍔$牬鎹�")
+ @PostMapping("/damageBigStorageCageDetails")
+ public Result damageBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ bigStorageCageDetailsService.damageBigStorageCageDetails(bigStorageCageDetails.getGlassId());
+ return Result.build(200,"鐮存崯鎴愬姛",1);
+ }
+
+ @ApiOperation("鐞嗙墖绗间换鍔″畬鎴�")
+ @PostMapping("/finishBigStorageCageDetails")
+ public Result finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ bigStorageCageDetailsService.finishBigStorageCageDetails(bigStorageCageDetails);
+ return Result.build(200,"鐮存崯鎴愬姛",1);
+ }
+
+ @ApiOperation("鐞嗙墖绗间换鍔″嚭鐗�")
+ @PostMapping("/outBigStorageCageDetails")
+ public Result outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails);
+ return Result.build(200,"鐮存崯鎴愬姛",1);
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCage.java
index 5c89cc9..2c7de7c 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCage.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCage.java
@@ -49,7 +49,7 @@
* 鍚敤鐘舵��
*/
@ApiModelProperty(value = "鍚敤鐘舵��", position = 5)
- private String enableState;
+ private Integer enableState;
/**
* 鍓╀綑瀹藉害
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
index 4788f9b..0acc5f2 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
@@ -1,13 +1,18 @@
package com.mes.bigstorage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
+import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
+import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
+import java.util.List;
/**
* <p>
@@ -17,6 +22,7 @@
* @author zhoush
* @since 2024-03-27
*/
+@ApiModel(description = "<p> </p>")
@Api(description = "澶х悊鐗囩璇︽儏")
@Data
@EqualsAndHashCode(callSuper = false)
@@ -109,5 +115,18 @@
@ApiModelProperty(value = "鐜荤拑闂撮殭", position = 15)
private Integer gap;
+ /**
+ * 杩涚墖浠诲姟
+ */
+ @ApiModelProperty(value = "杩涚墖浠诲姟", position = 16)
+ @TableField(exist = false)
+ private BigStorageCageFeedTask bigStorageCageFeedTask;
+
+ /**
+ * 鍑虹墖浠诲姟
+ */
+ @ApiModelProperty(value = "鍑虹墖浠诲姟", position = 17)
+ @TableField(exist = false)
+ private BigStorageCageOutTask bigStorageCageOutTask;
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java
new file mode 100644
index 0000000..24ab69c
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageDTO.java
@@ -0,0 +1,14 @@
+package com.mes.bigstorage.entity;
+
+import lombok.Data;
+
+/**
+ * @Author : zhoush
+ * @Date: 2024/6/11 16:45
+ * @Description:
+ */
+@Data
+public class BigStorageDTO {
+ private Integer slot;
+ private Integer width;
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
index d5e380f..3b9bb40 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
@@ -1,6 +1,7 @@
package com.mes.bigstorage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import feign.Param;
@@ -13,6 +14,6 @@
* @author zhoush
* @since 2024-03-27
*/
-public interface BigStorageCageDetailsMapper extends BaseMapper<BigStorageCageDetails> {
+public interface BigStorageCageDetailsMapper extends MPJBaseMapper<BigStorageCageDetails> {
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageMapper.java
index 67f4cad..0752d30 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageMapper.java
@@ -1,6 +1,7 @@
package com.mes.bigstorage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.glassinfo.entity.GlassInfo;
@@ -16,6 +17,6 @@
* @author zhoush
* @since 2024-03-27
*/
-public interface BigStorageCageMapper extends BaseMapper<BigStorageCage> {
+public interface BigStorageCageMapper extends MPJBaseMapper<BigStorageCage> {
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
index ef46c59..64b7ecb 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
@@ -2,6 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.BigStorageDTO;
+import com.mes.glassinfo.entity.GlassInfo;
+
+import java.util.List;
/**
* <p>
@@ -13,4 +17,26 @@
*/
public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> {
+ List<BigStorageCageDetails> selectTask(int taskType);
+
+ double selectGetBoard(String plcFeedReqLine);
+
+ void deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails);
+
+ void damageBigStorageCageDetails(String glassId);
+
+ BigStorageCageDetails selectBigStorageCageDetails(String glassId);
+
+ void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails);
+
+ void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails);
+
+ void outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails);
+
+ /**
+ * 鎸夌収鐗堝浘淇℃伅鑾峰彇杩涚墖绗煎瓙淇℃伅
+ *
+ * @param glassInfo
+ */
+ BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageService.java
index 60ba4df..3d204b7 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageService.java
@@ -1,12 +1,12 @@
package com.mes.bigstorage.service;
-import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.glassinfo.entity.GlassInfo;
-import com.mes.glassinfo.entity.GlassInfo;
import java.util.List;
+import java.util.Map;
/**
* <p>
@@ -16,7 +16,7 @@
* @author zhoush
* @since 2024-03-27
*/
-public interface BigStorageCageService extends IService<BigStorageCage> {
+public interface BigStorageCageService extends MPJBaseService<BigStorageCage> {
void updateRemainWidth(int slot);
@@ -24,6 +24,9 @@
boolean outGlass();
- List<BigStorageCage> querybigStorageCageDetail();
+ List<BigStorageCage> querybigStorageCageDetail(int deviceId);
+ List<Map<String, Object>> selectBigStorageCageUsage();
+
+ void updateStorageCageDisabled(int slot,int enableState);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
index 298761d..ebaec10 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -1,15 +1,31 @@
package com.mes.bigstorage.service.impl;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.BigStorageDTO;
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
-import com.mes.bigstorage.mapper.BigStorageCageMapper;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
+import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
+import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
+import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper;
+import com.mes.common.config.Const;
+import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.mapper.GlassInfoMapper;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
+import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
/**
* <p>
@@ -20,8 +36,221 @@
* @since 2024-03-27
*/
@Service
-public class BigStorageCageDetailsServiceImpl extends ServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService {
- @Resource
- private BigStorageCageMapper bigStorageCageMapper;
+public class BigStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService {
+ @Resource
+ private BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper;
+ @Resource
+ private BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper;
+ @Resource
+ private TemperingGlassInfoMapper temperingGlassInfoMapper;
+ @Resource
+ private BigStorageCageService bigStorageCageService;
+ @Resource
+ private GlassInfoMapper glassInfoMapper;
+
+ /**
+ * 鏌ヨ杩�/鍑虹墖浠诲姟
+ */
+ @Override
+ public List<BigStorageCageDetails> selectTask(int taskType) {
+ if (taskType == 1) {
+ //杩涚墖浠诲姟鏁版嵁
+ LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>();
+ feedWrapper.eq(BigStorageCageDetails::getState, 1)
+ .or()
+ .eq(BigStorageCageDetails::getState, 2);
+ List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper);
+ List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(null);
+
+ Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream()
+ .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task));
+
+ for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) {
+ BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId());
+ bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask);
+ }
+ return bigStorageCageDetailsList;
+ } else {
+ //鍑虹墖浠诲姟鏁版嵁
+ LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>();
+ outWrapper.eq(BigStorageCageDetails::getState, 3)
+ .or()
+ .eq(BigStorageCageDetails::getState, 4);
+ List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper);
+ List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(null);
+
+ Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream()
+ .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task));
+ for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) {
+ BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId());
+ bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask);
+ }
+ return bigStorageCageDetailsList;
+ }
+
+ }
+
+ /**
+ * 鍒ゆ柇褰撳墠鐜荤拑鏄惁鑳戒笂杞�
+ */
+ @Override
+ public double selectGetBoard(String plcFeedReqLine) {
+ double carWidth = 5000;
+ LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>();
+ feedWrapper.eq(BigStorageCageDetails::getState, plcFeedReqLine);
+ List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper);
+
+ LambdaQueryWrapper<BigStorageCageFeedTask> bigStorageCageFeedTaskWrapper = new LambdaQueryWrapper<>();
+ bigStorageCageFeedTaskWrapper
+ .eq(BigStorageCageFeedTask::getTaskState, plcFeedReqLine)
+ .eq(BigStorageCageFeedTask::getLine, plcFeedReqLine);
+
+ List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(bigStorageCageFeedTaskWrapper);
+ Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream()
+ .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task));
+ for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) {
+ BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId());
+ bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask);
+ }
+ for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList
+ ) {
+ if (bigStorageCageDetails.getBigStorageCageFeedTask().getTaskState() == 0) {
+ carWidth -= Integer.parseInt(bigStorageCageDetails.getWidth().toString()) + bigStorageCageDetails.getGap();
+ }
+ }
+ return carWidth;
+
+ }
+
+
+ //鏍撻櫎鍑虹墖浠诲姟.鏇存柊鏍煎瓙瀹藉害
+ @Override
+ public void deleteBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ baseMapper.deleteById(bigStorageCageDetails.getId());
+ bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot());
+ }
+
+ //鐞嗙墖绗艰鎯呯牬鎹�
+ @Override
+ public void damageBigStorageCageDetails(String glassId) {
+ LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>();
+ temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId, glassId);
+ TemperingGlassInfo temperingGlassInfo = temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper);
+
+ LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper<>();
+ bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId, glassId);
+ BigStorageCageDetails bigStorageCageDetails = baseMapper.selectOne(bigStorageCageDetailsWrapper);
+
+ if (temperingGlassInfo.getState() == -2) {
+ temperingGlassInfoMapper.deleteById(temperingGlassInfo);
+ } else {
+ temperingGlassInfo.setState(5);
+ temperingGlassInfoMapper.updateById(temperingGlassInfo);
+ }
+ baseMapper.deleteById(bigStorageCageDetails.getId());
+ bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot());
+ //todo:鎻掑叆鐮存崯鏁版嵁
+
+ }
+
+ //鏌ヨ鐜荤拑淇℃伅
+ @Override
+ public BigStorageCageDetails selectBigStorageCageDetails(String glassId) {
+ LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>();
+ glassInfoWrapper.eq(GlassInfo::getGlassId, glassId);
+ GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper);
+ BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails();
+ BeanUtils.copyProperties(glassInfo, bigStorageCageDetails);
+ bigStorageCageDetails.setState(0);
+ bigStorageCageDetails.setGap(20);
+ return bigStorageCageDetails;
+ }
+
+ //鐞嗙墖绗艰鎯呮坊鍔�
+ @Override
+ public void insertBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ baseMapper.insert(bigStorageCageDetails);
+ bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot());
+ }
+
+ //鐞嗙墖绗艰鎯呭畬鎴�
+ @Override
+ public void finishBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ if (bigStorageCageDetails.getState() == 1 || bigStorageCageDetails.getState() == 2) {
+ bigStorageCageDetails.setState(0);
+ baseMapper.updateById(bigStorageCageDetails);
+ bigStorageCageFeedTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageFeedTask().getId());
+ } else {
+ baseMapper.deleteById(bigStorageCageDetails.getId());
+ bigStorageCageOutTaskMapper.deleteById(bigStorageCageDetails.getBigStorageCageOutTask().getId());
+ }
+
+ }
+
+ //鎵嬪姩鍑虹墖
+ @Override
+ public void outBigStorageCageDetails(BigStorageCageDetails bigStorageCageDetails) {
+ LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>();
+ temperingGlassInfoWrapper
+ .eq(TemperingGlassInfo::getGlassId, bigStorageCageDetails.getGlassId());
+ TemperingGlassInfo temperingGlassInfo = temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper);
+ if (temperingGlassInfo.getGlassId() == null) {
+ LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>();
+ glassInfoWrapper
+ .eq(GlassInfo::getGlassId, bigStorageCageDetails.getGlassId());
+ GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoWrapper);
+ TemperingGlassInfo temperingGlassInfo1 = new TemperingGlassInfo();
+ BeanUtils.copyProperties(glassInfo, temperingGlassInfo1);
+
+ if (temperingGlassInfo.getTemperingLayoutId() != null) {
+ temperingGlassInfo1.setState(-1);
+ } else {
+ temperingGlassInfo1.setState(-2);
+ }
+ temperingGlassInfoMapper.insert(temperingGlassInfo1);
+ }
+ }
+
+ @Override
+ public BigStorageDTO queryTargetSlotByTempering(GlassInfo glassInfo) {
+// MPJLambdaWrapper<BigStorageDTO> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class)
+// .selectAll(BigStorageDTO.class)
+// .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot)
+// .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
+// .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1)
+// .last("limit 1");
+ BigStorageDTO bigStorageDTO = null;
+ MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(BigStorageCage.class)
+ .selectAsClass(BigStorageCage.class, BigStorageDTO.class)
+ .leftJoin(BigStorageCageDetails.class, BigStorageCageDetails::getSlot, BigStorageCage::getSlot)
+ .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
+ .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1)
+ .last("limit 1");
+ bigStorageDTO = bigStorageCageService.selectJoinOne(BigStorageDTO.class, wrapper);
+ if (null != bigStorageDTO) {
+ return bigStorageDTO;
+ }
+ BigStorageCage bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH)
+ .inSql(BigStorageCage::getDeviceId,
+ "select distinct device_id from big_storage_cage_details where tempering_layout_id = " + glassInfo.getTemperingLayoutId())
+ .last("limit 1"));
+ if (null != bigStorageCage) {
+ bigStorageDTO = new BigStorageDTO();
+ bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
+ bigStorageDTO.setSlot(bigStorageCage.getSlot());
+ return bigStorageDTO;
+ }
+ bigStorageCage = bigStorageCageService.getOne(new LambdaQueryWrapper<BigStorageCage>()
+ .eq(BigStorageCage::getRemainWidth, Const.BIG_STORAGE_WIDTH)
+ .last("limit 1"));
+ Assert.isTrue(null != bigStorageCage, "娌℃湁绌轰綑鐨勭瀛愬瓨鏀剧幓鐠�");
+ bigStorageDTO = new BigStorageDTO();
+ bigStorageDTO.setWidth(bigStorageCage.getRemainWidth());
+ bigStorageDTO.setSlot(bigStorageCage.getSlot());
+ return bigStorageDTO;
+
+
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
index 51d5f49..a9bfa0c 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageServiceImpl.java
@@ -3,13 +3,17 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mes.bigstorage.entity.BigStorageCage;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
import com.mes.bigstorage.mapper.BigStorageCageMapper;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.glassinfo.entity.GlassInfo;
+import com.mes.glassinfo.service.GlassInfoService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import lombok.extern.slf4j.Slf4j;
@@ -18,6 +22,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -34,7 +39,7 @@
*/
@Service
@Slf4j
-public class BigStorageCageServiceImpl extends ServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService {
+public class BigStorageCageServiceImpl extends MPJBaseServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService {
@Resource
private BigStorageCageMapper bigStorageCageMapper;
@@ -44,54 +49,99 @@
@Resource
private TemperingGlassInfoService temperingGlassInfoService;
+ @Resource
+ private GlassInfoService glassInfoService;
+
+ //杩涚墖閫昏緫
@Override
public BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) {
-
- log.info("1銆佹煡璇㈢悊鐗囩鍐呯墖搴�+1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠�");
- LambdaQueryWrapper<BigStorageCageDetails> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
- .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1);
- BigStorageCageDetails layoutSlotInfo;
- layoutSlotInfo= bigStorageCageDetailsMapper.selectOne(wrapper);
-
BeanUtils.copyProperties(glassInfo, bigStorageCageDetails);
+ //鐜荤拑涓嶉挗鍖栨椂
+ if(glassInfo.getTemperingLayoutId()==null){
- log.info("2銆佹煡璇㈢悊鐗囩鍐呯墖搴�+1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠冪殑缁撴灉涓嶄负绌烘椂");
- if (layoutSlotInfo.getSlot() != null) {
- bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot());
- } else {
- log.info("3銆佹煡璇㈢悊鐗囩鍐呯墖搴�+1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠冪殑缁撴灉涓虹┖鏃惰幏鍙栧綋鍓嶇幓鐠冪増鍥緄d鏄惁瀛樺湪鐞嗙墖绗煎唴");
- LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>();
- bigStorageCageDetailslambdaQueryWrapper
- .select(BigStorageCageDetails::getTemperingLayoutId);
- layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailslambdaQueryWrapper);
+ BigStorageCage bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>()
+ .selectAll(BigStorageCage.class)
+ .leftJoin(BigStorageCageDetails.class, on -> on
+ .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId)
+ .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot))
+ .isNull(BigStorageCageDetails::getTemperingLayoutId)
+ .gt(BigStorageCage::getRemainWidth, 2000)
+ .orderByAsc(BigStorageCage::getDeviceId, BigStorageCage::getSlot)
+ .last("limit 1")
+ );
- if(layoutSlotInfo != null){
- log.info("4銆佽幏鍙栫瀛愬唴閫傚悎鐨勬牸瀛�");
- BigStorageCage bigStorageCage=bigStorageCageSlot(layoutSlotInfo.getDeviceId());
+ if(bigStorageCage.getSlot()!=null){
bigStorageCageDetails.setSlot(bigStorageCage.getSlot());
- }else{
- log.info("5銆佽幏鍙栨瘡涓瀛愮増鍥緄d鐨勪釜鏁�");
- QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>();
- queryWrapper.select("a.device_id", "COUNT(DISTINCT b.tempering_layout_id) AS layoutCount")
- .groupBy("a.device_id")
- .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot")
- .orderByAsc("layoutCount")
- .orderByAsc("a.device_id");
- List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper);
+ bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId());
+ }
+ }else{
+ //鐜荤拑閽㈠寲鏃�
+ BigStorageCage bigStorageCage=new BigStorageCage();
- log.info("5銆佹煡璇㈢瀛愬唴鏄惁鏈夊悎閫傜殑鏍煎瓙");
- for (Map<String, Object> map : bigStorageCageDetailsCount) {
- for (Map.Entry<String, Object> entry : map.entrySet()) {
- int deviceId = Integer.parseInt(entry.getKey());
- BigStorageCage bigStorageCage=bigStorageCageSlot(deviceId);
- if(bigStorageCage!=null){
- bigStorageCageDetails.setSlot(bigStorageCage.getSlot());
+ bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>()
+ .selectAll(BigStorageCage.class)
+ .leftJoin(BigStorageCageDetails.class, on -> on
+ .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId)
+ .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot))
+ .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
+ .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() - 1)
+ .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth())
+ );
+ log.info("1銆佹煡璇㈢悊鐗囩鍐呯墖搴�-1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠�"+bigStorageCage);
+
+ log.info("2銆佹煡璇㈢悊鐗囩鍐呯墖搴�-1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠冪殑缁撴灉涓嶄负绌烘椂"+bigStorageCage.getSlot());
+ if (bigStorageCage.getSlot() != null) {
+ bigStorageCageDetails.setSlot(bigStorageCage.getSlot());
+ bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId());
+ } else {
+ log.info("3銆佹煡璇㈢悊鐗囩鍐呯墖搴�-1绛変簬褰撳墠鐜荤拑鐗囧簭鐨勭幓鐠冪殑缁撴灉涓虹┖鏃惰幏鍙栧綋鍓嶇幓鐠冪増鍥緄d鏄惁瀛樺湪鐞嗙墖绗煎唴");
+
+ bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>()
+ .selectAll(BigStorageCage.class)
+ .leftJoin(BigStorageCageDetails.class, on -> on
+ .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId)
+ .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot))
+ .eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId())
+ .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth())
+ );
+
+ if(bigStorageCage != null){
+ log.info("4銆佽幏鍙栫瀛愬唴閫傚悎鐨勬牸瀛�");
+ BigStorageCage bigStorageCages=bigStorageCageSlot(bigStorageCage.getDeviceId());
+ bigStorageCageDetails.setSlot(bigStorageCages.getSlot());
+ bigStorageCageDetails.setDeviceId(bigStorageCages.getDeviceId());
+ }else{
+ log.info("5銆佽幏鍙栨瘡涓瀛愮増鍥緄d鐨勪釜鏁�");
+ QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>();
+ queryWrapper.select("a.device_id", "COUNT(DISTINCT b.tempering_layout_id) AS layoutCount")
+ .groupBy("a.device_id")
+ .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot")
+ .orderByAsc("layoutCount")
+ .orderByAsc("a.device_id");
+ List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper);
+
+ log.info("5銆佹煡璇㈢瀛愬唴鏄惁鏈夊悎閫傜殑鏍煎瓙");
+ boolean found=false;
+ for (Map<String, Object> map : bigStorageCageDetailsCount) {
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
+ int deviceId = Integer.parseInt(entry.getKey());
+ BigStorageCage bigStorageCages=bigStorageCageSlot(deviceId);
+ if(bigStorageCage!=null){
+ bigStorageCageDetails.setSlot(bigStorageCages.getSlot());
+ bigStorageCageDetails.setDeviceId(deviceId);
+ found=true;
+ break;
+ }
+ }
+ if(found){
+ break;
}
}
}
}
}
+
+
if (bigStorageCageDetails.getSlot() != null) {
log.info("6銆佸綋鎵惧埌鍚堥�傜殑鏍煎瓙鏃舵坊鍔犵幓鐠冨埌绗煎瓙琛�");
@@ -114,29 +164,47 @@
return bigStorageCageMapper.selectOne(bigStorageCageWrapper);
}
-
+ //鍑虹墖閫昏緫
@Override
public boolean outGlass() {
- List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list();
+ LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper=new LambdaQueryWrapper<>();
+ temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState,-1);
+ List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(temperingGlassInfoWrapper);
log.info("1銆佹煡璇㈤挗鍖栧皬鐗囦换鍔¤〃鏄惁鏈夊緟鍑虹幓鐠�"+temperingGlassInfoList.size());
-
- if(temperingGlassInfoList!=null){
+ if(temperingGlassInfoList.size()>0){
temperingGlassInfoService.addOutTask(temperingGlassInfoList);
log.info("2銆佹坊鍔犱换鍔″埌浠诲姟琛�");
return true;
}else{
log.info("3銆佹病鏈夊彲鍑虹殑鐜荤拑鏃惰幏鍙栨槸鍚︽湁灏忕墖鍒伴綈鐨勭増鍥�");
- LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>();
- bigStorageCageDetailslambdaQueryWrapper
- .select(BigStorageCageDetails::getTemperingLayoutId)
- .groupBy(BigStorageCageDetails::getTemperingLayoutId);
- List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(bigStorageCageDetailslambdaQueryWrapper);
- for (Map<String, Object> map : temperingLayoutIdList) {
- for (Map.Entry<String, Object> entry : map.entrySet()) {
- String layoutId = entry.getKey().substring(0, entry.getKey().indexOf('-'));
- String layoutNum = entry.getKey().substring(entry.getKey().indexOf('-') + 1);
- if (layoutNum.equals(entry.getValue())) {
- //4銆佹坊鍔犳閽㈠寲鐗堝浘id鎵�鏈夊皬鐗囧皬鐗囧埌閽㈠寲灏忕墖琛�
+
+ QueryWrapper<BigStorageCageDetails> wrapper = Wrappers.query();
+ wrapper.select("tempering_layout_id", "count(tempering_layout_id)")
+ .groupBy("tempering_layout_id");
+ List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(wrapper);
+
+ boolean key=false;
+ for (Map<String, Object> row : temperingLayoutIdList) {
+ for (Map.Entry<String, Object> entry : row.entrySet()) {
+ String temperingId = entry.getKey();
+ Object temperingNo = entry.getValue();
+
+ LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>();
+ glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId,temperingId)
+ .orderByDesc(GlassInfo::getTemperingFeedSequence);
+ List<GlassInfo> glassInfoList= glassInfoService.list(glassInfoWrapper);
+ if(glassInfoList.size()==Integer.parseInt(temperingNo.toString())){
+ for (GlassInfo glassInfo:glassInfoList
+ ) {
+
+ TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo();
+ BeanUtils.copyProperties(glassInfo, temperingGlassInfo);
+ temperingGlassInfoService.save(temperingGlassInfo);
+
+ }
+ key=true;
+ }
+ if(key){
return false;
}
}
@@ -163,16 +231,21 @@
bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper);
}
-
-
-
+ //鏌ヨ澶х悊鐗囦俊鎭紝鍓嶇灞曠ず鐢�
@Override
- public List<BigStorageCage> querybigStorageCageDetail() {
- //1銆佽幏鍙栧ぇ鐞嗙墖绗间俊鎭�
- List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(null);
+ public List<BigStorageCage> querybigStorageCageDetail(int deviceId) {
+ LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>();
+ LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>();
+ if(deviceId!=0){
+ bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId);
+ bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId);
+ }
+
+ List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(bigStorageCageWrapper);
log.info("1銆佽幏鍙栧ぇ鐞嗙墖绗间俊鎭畬鎴愶紝鑾峰彇鍒扮殑鏁版嵁{}", bigStorageCages.size());
- //2鑾峰彇鐞嗙墖绗兼墍鏈変俊鎭�
- List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(null);
+
+ List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper);
+
Map<Integer, List<BigStorageCageDetails>> listMap = bigStorageCageDetailsList.stream().collect(Collectors.groupingBy(BigStorageCageDetails::getSlot));
for (BigStorageCage bigStorageCage : bigStorageCages) {
List<BigStorageCageDetails> bigStorageCageDetails = listMap.get(bigStorageCage.getSlot());
@@ -181,4 +254,25 @@
return bigStorageCages;
}
+ //绗煎瓙浣跨敤鎯呭喌锛岀晫闈㈠睍绀虹敤
+ @Override
+ public List<Map<String, Object>> selectBigStorageCageUsage() {
+ QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>();
+ wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,COUNT(device_id) - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count")
+
+ .groupBy("device_id");
+ List<Map<String, Object>> bigStorageCageUsages=baseMapper.selectMaps(wrapper);
+
+ return bigStorageCageUsages;
+ }
+
+ //绗煎瓙鐨勫惎鐢�/绂佺敤
+ @Override
+ public void updateStorageCageDisabled(int slot,int enableState){
+ BigStorageCage bigStorageCage=new BigStorageCage();
+ bigStorageCage.setEnableState(enableState);
+ LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>();
+ bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot);
+ baseMapper.update(bigStorageCage,bigStorageCageWrapper);
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageFeedTaskController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageFeedTaskController.java
index 332c237..dab2e01 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageFeedTaskController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageFeedTaskController.java
@@ -27,10 +27,10 @@
@Autowired
private BigStorageCageFeedTaskService bigStorageCageFeedTaskService;
- @ApiOperation("杩涚墖浠诲姟淇℃伅")
- @GetMapping("/querybigStorageCageTask")
- public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) {
- return bigStorageCageFeedTaskService.querybigStorageCageFeedTask(taskState);
- }
+// @ApiOperation("杩涚墖浠诲姟淇℃伅")
+// @GetMapping("/querybigStorageCageFeedTask")
+// public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) {
+// return bigStorageCageFeedTaskService.querybigStorageCageFeedTask(taskState);
+// }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageOutTaskController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageOutTaskController.java
index dbdc794..cd4e8db 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageOutTaskController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/controller/BigStorageCageOutTaskController.java
@@ -27,11 +27,11 @@
@Autowired
private BigStorageCageOutTaskService bigStorageCageOutTaskService;
- @ApiOperation("杩涚墖浠诲姟淇℃伅")
- @GetMapping("/querybigStorageCageTask")
- public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) {
- return bigStorageCageOutTaskService.querybigStorageCageOutTask(taskState);
- }
+// @ApiOperation("鍑虹墖浠诲姟淇℃伅")
+// @GetMapping("/querybigStorageCageOutTask")
+// public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) {
+// return bigStorageCageOutTaskService.querybigStorageCageOutTask(taskState);
+// }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageFeedTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageFeedTask.java
index a9f3743..c8e0a81 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageFeedTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageFeedTask.java
@@ -2,9 +2,13 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
/**
* <p>
@@ -14,22 +18,64 @@
* @author zhoush
* @since 2024-04-16
*/
+@ApiModel(description = "<p> 鐞嗙墖杩涚浠诲姟 </p>")
@Data
@EqualsAndHashCode(callSuper = false)
public class BigStorageCageFeedTask implements Serializable {
private static final long serialVersionUID = 1L;
- @TableId(value = "id", type = IdType.AUTO)
+ /**
+ * 涓婚敭id
+ */
+ @ApiModelProperty(value = "涓婚敭id", position = 2)
+ @TableId(value = "id", type = IdType.AUTO)
private Long id;
- private Integer tragetSlot;
+ /**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id", position = 3)
+ private String glassId;
+ /**
+ * 鐩爣浣嶇疆
+ */
+ @ApiModelProperty(value = "鐩爣浣嶇疆", position = 4)
+ private Integer targetSlot;
+
+ /**
+ * 鐜荤拑绫诲瀷
+ */
+ @ApiModelProperty(value = "鐜荤拑绫诲瀷", position = 5)
private Integer taskType;
+ /**
+ * 浠诲姟绫诲瀷
+ */
+ @ApiModelProperty(value = "浠诲姟绫诲瀷", position = 6)
private Integer taskState;
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "绾胯矾", position = 7)
private Integer line;
+ /**
+ * 瀹藉害
+ */
+ @ApiModelProperty(value = "瀹藉害", position = 8)
+ private Integer width;
+ /**
+ * 楂樺害
+ */
+ @ApiModelProperty(value = "楂樺害", position = 8)
+ private Integer height;
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿", position = 8)
+ private Date createTime;
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageOutTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageOutTask.java
index ffbb1d7..a9959d5 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageOutTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/entity/BigStorageCageOutTask.java
@@ -3,6 +3,9 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -14,23 +17,54 @@
* @author zhoush
* @since 2024-04-16
*/
+@ApiModel(description = "<p> 鐞嗙墖鍑虹浠诲姟 </p>")
@Data
@EqualsAndHashCode(callSuper = false)
public class BigStorageCageOutTask implements Serializable {
private static final long serialVersionUID = 1L;
+ /**
+ * 涓婚敭id
+ */
+ @ApiModelProperty(value = "涓婚敭id", position = 2)
@TableId(value = "id", type = IdType.AUTO)
private Long id;
+ /**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id", position = 3)
+ private String glassId;
+
+ /**
+ * 寮�濮嬩綅缃�
+ */
+ @ApiModelProperty(value = "寮�濮嬩綅缃�", position = 4)
private Integer startSlot;
+ /**
+ * 鐩爣浣嶇疆
+ */
+ @ApiModelProperty(value = "鐩爣浣嶇疆", position = 5)
private Integer endSlot;
+ /**
+ * 杞︽
+ */
+ @ApiModelProperty(value = "杞︽", position = 6)
private Integer trainNumber;
+ /**
+ * 搴忓彿
+ */
+ @ApiModelProperty(value = "搴忓彿", position = 7)
private Integer serialNumber;
+ /**
+ * 浠诲姟鐘舵��
+ */
+ @ApiModelProperty(value = "浠诲姟鐘舵��", position = 8)
private Integer taskState;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
index 3765470..3e0794e 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageFeedTaskMapper.java
@@ -1,7 +1,10 @@
package com.mes.bigstoragetask.mapper;
-import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
+
+import java.util.List;
/**
* <p>
@@ -11,6 +14,8 @@
* @author zhoush
* @since 2024-04-16
*/
+@DS("salve_hangzhoumes")
public interface BigStorageCageFeedTaskMapper extends BaseMapper<BigStorageCageFeedTask> {
+ List<String> querySitToUpGlass();
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageOutTaskMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageOutTaskMapper.java
index 4c29af4..4140cfa 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageOutTaskMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/mapper/BigStorageCageOutTaskMapper.java
@@ -1,5 +1,6 @@
package com.mes.bigstoragetask.mapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -11,6 +12,7 @@
* @author zhoush
* @since 2024-04-16
*/
+@DS("salve_hangzhoumes")
public interface BigStorageCageOutTaskMapper extends BaseMapper<BigStorageCageOutTask> {
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
index f9a3cf8..669023d 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageFeedTaskService.java
@@ -1,9 +1,8 @@
package com.mes.bigstoragetask.service;
+import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import java.util.List;
@@ -20,4 +19,9 @@
void addFeedTask(BigStorageCageDetails slotInfo, Integer plcFeedReqLine, int taskType);
List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState);
+
+ /**
+ * 鏌ヨ鍗ц浆绔嬬幓鐠冩槸鍚﹁繘鐗囧畬鎴�
+ */
+ List<String> querySitToUpGlass();
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageOutTaskService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageOutTaskService.java
index 2e10a4d..2c9a9e2 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageOutTaskService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/BigStorageCageOutTaskService.java
@@ -19,5 +19,5 @@
void updateOutTask();
- void deleteOutTask(Long taskId);
+ void deleteOutTask(String glassId);
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
index 5a4b62b..716c92a 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageFeedTaskServiceImpl.java
@@ -1,16 +1,13 @@
package com.mes.bigstoragetask.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
-import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper;
import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import net.bytebuddy.matcher.FilterableList;
import org.springframework.stereotype.Service;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -30,15 +27,19 @@
bigStorageCageFeedTask.setId(slotInfo.getId());
bigStorageCageFeedTask.setTaskState(0);
bigStorageCageFeedTask.setLine(plcFeedReqLine);
- bigStorageCageFeedTask.setTragetSlot(slotInfo.getSlot());
bigStorageCageFeedTask.setTaskType(taskType);
baseMapper.insert(bigStorageCageFeedTask);
}
@Override
- public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState){
- LambdaQueryWrapper<BigStorageCageFeedTask> getFeedTaskWrapper=new LambdaQueryWrapper<>();
- getFeedTaskWrapper.eq(BigStorageCageFeedTask::getTaskState,taskState);
+ public List<BigStorageCageFeedTask> querybigStorageCageFeedTask(int taskState) {
+ LambdaQueryWrapper<BigStorageCageFeedTask> getFeedTaskWrapper = new LambdaQueryWrapper<>();
+ getFeedTaskWrapper.eq(BigStorageCageFeedTask::getTaskState, taskState);
return baseMapper.selectList(getFeedTaskWrapper);
}
+
+ @Override
+ public List<String> querySitToUpGlass() {
+ return baseMapper.querySitToUpGlass();
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageOutTaskServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageOutTaskServiceImpl.java
index c06a427..32938c2 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageOutTaskServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstoragetask/service/impl/BigStorageCageOutTaskServiceImpl.java
@@ -1,12 +1,14 @@
package com.mes.bigstoragetask.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mes.bigstorage.entity.BigStorageCageDetails;
import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper;
import com.mes.bigstoragetask.service.BigStorageCageOutTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -32,6 +34,10 @@
BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper;
@Resource
BigStorageCageDetailsMapper bigStorageCageDetailsMapper;
+
+ /**
+ * 鏌ヨ浠诲姟淇℃伅
+ */
@Override
public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState){
log.info("鏍规嵁浼犲叆鐨勪换鍔$姸鎬佹煡璇换鍔′俊鎭細"+taskState);
@@ -40,21 +46,46 @@
return baseMapper.selectList(getOutTaskWrapper);
}
+ /**
+ * 妫�娴婸LC鏄惁瀹屾垚浠诲姟
+ */
@Override
public void updateOutTask(){
List<BigStorageCageOutTask> bigStorageCageOutTaskList=querybigStorageCageOutTask(1);
log.info("鏌ヨ浠诲姟琛ㄦ槸鍚︽湁宸插畬鎴愮殑鍑虹墖浠诲姟"+bigStorageCageOutTaskList.size());
for (BigStorageCageOutTask bigStorageCageOutTask:bigStorageCageOutTaskList
) {
- deleteOutTask(bigStorageCageOutTask.getId());
+ deleteOutTask(bigStorageCageOutTask.getGlassId());
}
}
+ /**
+ * 瀹屾垚鍑虹墖浠诲姟
+ */
@Override
- public void deleteOutTask(Long taskId){
+ public void deleteOutTask(String glassId){
log.info("鏍规嵁浠诲姟id淇敼閽㈠寲灏忕墖琛ㄧ姸鎬侊紝鍒犻櫎宸插畬鎴愮殑鍑虹墖浠诲姟,鍒犻櫎绗煎瓙琛ㄧ幓鐠�");
- temperingGlassInfoMapper.deleteById(taskId);
- bigStorageCageOutTaskMapper.deleteById(taskId);
- bigStorageCageDetailsMapper.deleteById(taskId);
+
+ LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper =new LambdaQueryWrapper<>();
+ temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId,glassId);
+ TemperingGlassInfo temperingGlassInfo=temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper);
+ //鍒ゆ柇鏄惁鎵嬪姩浠诲姟锛屼笉閽㈠寲浠诲姟瀹屾垚鍚庡垹鎺夛紝閽㈠寲浠诲姟瀹屾垚鍚庢敼鐘舵�佷负0
+ if(temperingGlassInfo.getState()==-2){
+ temperingGlassInfoMapper.deleteById(temperingGlassInfo.getId());
+ }else{
+ temperingGlassInfo.setState(0);
+ temperingGlassInfoMapper.updateById(temperingGlassInfo);
+ }
+
+ LambdaQueryWrapper<BigStorageCageOutTask> bigStorageCageOutTaskWrapper =new LambdaQueryWrapper<>();
+ bigStorageCageOutTaskWrapper.eq(BigStorageCageOutTask::getGlassId,glassId);
+ BigStorageCageOutTask bigStorageCageOutTask=bigStorageCageOutTaskMapper.selectOne(bigStorageCageOutTaskWrapper);
+ bigStorageCageOutTaskMapper.deleteById(bigStorageCageOutTask.getId());
+
+ LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>();
+ bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId,glassId);
+ BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailsWrapper);
+ bigStorageCageDetailsMapper.deleteById(bigStorageCageOutTask.getId());
+
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java
index ac57db3..304846e 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/common/S7object.java
@@ -24,7 +24,9 @@
private S7object() {
if (plccontrol == null) {
plccontrol = new S7control(plcType, ip, port, 0, 0);
- String PlcLoadGlass = System.getProperty("user.dir") + "/JsonFile/PlcCacheVerticalGlass.json";
+
+ String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcCacheVerticalGlass.json").getPath();
+ //log.info(PLCAutoMes.class.getResource("").getPath());
PlcMesObject = InitUtil.initword(PlcLoadGlass);
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/controller/DamageController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/controller/DamageController.java
new file mode 100644
index 0000000..29a1038
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/controller/DamageController.java
@@ -0,0 +1,21 @@
+package com.mes.damage.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-06-13
+ */
+@RestController
+@RequestMapping("/glassinfo/damage")
+public class DamageController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/entity/Damage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/entity/Damage.java
new file mode 100644
index 0000000..0467855
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/entity/Damage.java
@@ -0,0 +1,44 @@
+package com.mes.damage.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-06-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Damage implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ private String glassId;
+
+ private Integer deviceId;
+
+ private String engineerId;
+
+ private Integer temperingLayoutId;
+
+ private LocalDateTime damageTime;
+
+ private String remark;
+
+ private Integer type;
+
+ private Integer status;
+
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/mapper/DamageMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/mapper/DamageMapper.java
new file mode 100644
index 0000000..2b2bc54
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/mapper/DamageMapper.java
@@ -0,0 +1,16 @@
+package com.mes.damage.mapper;
+
+import com.mes.damage.entity.Damage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-06-13
+ */
+public interface DamageMapper extends BaseMapper<Damage> {
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/service/DamageService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/service/DamageService.java
new file mode 100644
index 0000000..ae90667
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/damage/service/DamageService.java
@@ -0,0 +1,16 @@
+package com.mes.damage.service;
+
+import com.mes.damage.entity.Damage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-06-13
+ */
+public interface DamageService extends IService<Damage> {
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/controller/EdgGlassTaskInfoController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/controller/EdgGlassTaskInfoController.java
new file mode 100644
index 0000000..b8b8a9d
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/controller/EdgGlassTaskInfoController.java
@@ -0,0 +1,20 @@
+package com.mes.edgglasstask.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-05-11
+ */
+@RestController
+@RequestMapping("/edgGlassTaskInfo")
+public class EdgGlassTaskInfoController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
new file mode 100644
index 0000000..c007100
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/entity/EdgGlassTaskInfo.java
@@ -0,0 +1,77 @@
+package com.mes.edgglasstask.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-05-11
+ */
+@ApiModel(description = "<p> </p>")
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class EdgGlassTaskInfo implements Serializable {
+
+ /**
+ * 纾ㄨ竟浠诲姟id
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id", position = 2)
+ private String glassId;
+
+ /**
+ * 瀹�
+ */
+ @ApiModelProperty(value = "瀹�", position = 3)
+ private Integer width;
+
+ /**
+ * 楂�
+ */
+ @ApiModelProperty(value = "楂�", position = 4)
+ private Integer height;
+
+ /**
+ * 鍘氬害
+ */
+ @ApiModelProperty(value = "鍘氬害", position = 5)
+ private Integer thickness;
+
+ /**
+ * 鐜荤拑绫诲瀷
+ */
+ @ApiModelProperty(value = "鐜荤拑绫诲瀷", position = 6)
+ private Integer glassType;
+
+ /**
+ * 鐘舵��
+ */
+ @ApiModelProperty(value = "鐘舵��", position = 7)
+ private Integer status;
+
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "绾胯矾", position = 8)
+ private Integer line;
+
+ /**
+ * 绾胯矾
+ */
+ @ApiModelProperty(value = "鏃堕棿", position = 9)
+ private Date time;
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/mapper/EdgGlassTaskInfoMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/mapper/EdgGlassTaskInfoMapper.java
new file mode 100644
index 0000000..2f6a5be
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/mapper/EdgGlassTaskInfoMapper.java
@@ -0,0 +1,18 @@
+package com.mes.edgglasstask.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-05-11
+ */
+@DS("salve_hangzhoumes")
+public interface EdgGlassTaskInfoMapper extends BaseMapper<EdgGlassTaskInfo> {
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/EdgGlassTaskInfoService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/EdgGlassTaskInfoService.java
new file mode 100644
index 0000000..8436faf
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/EdgGlassTaskInfoService.java
@@ -0,0 +1,19 @@
+package com.mes.edgglasstask.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-05-11
+ */
+public interface EdgGlassTaskInfoService extends IService<EdgGlassTaskInfo> {
+
+ int judgeTasktype(String plcFeedReqLine);
+
+ int startTask();
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
new file mode 100644
index 0000000..899f474
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgglasstask/service/impl/EdgGlassTaskInfoServiceImpl.java
@@ -0,0 +1,84 @@
+package com.mes.edgglasstask.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+import com.mes.edgglasstask.mapper.EdgGlassTaskInfoMapper;
+import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-05-11
+ */
+@Service
+public class EdgGlassTaskInfoServiceImpl extends ServiceImpl<EdgGlassTaskInfoMapper, EdgGlassTaskInfo> implements EdgGlassTaskInfoService {
+
+ @Resource
+ BigStorageCageDetailsService bigStorageCageDetailsService;
+ @Override
+ public int judgeTasktype(String plcFeedReqLine){
+ LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>();
+ edgGlassTaskInfoWrapper
+ .eq(EdgGlassTaskInfo::getLine,plcFeedReqLine)
+ .orderByDesc(EdgGlassTaskInfo::getTime);
+ EdgGlassTaskInfo edgGlassTaskInfo=baseMapper.selectOne(edgGlassTaskInfoWrapper);
+ double width=bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine);
+ if(edgGlassTaskInfo.getWidth()<width){
+ return 0;
+ }else{
+ return 1;
+ }
+ }
+
+ @Override
+ public int startTask(){
+
+ double line1Width=bigStorageCageDetailsService.selectGetBoard("1");
+ double line2Width=bigStorageCageDetailsService.selectGetBoard("2");
+
+ LambdaQueryWrapper<EdgGlassTaskInfo> edgGlassTaskInfoWrapper=new LambdaQueryWrapper<>();
+ edgGlassTaskInfoWrapper
+ .eq(EdgGlassTaskInfo::getLine,1)
+ .orderByDesc(EdgGlassTaskInfo::getTime);
+ List<EdgGlassTaskInfo> edgGlassTaskInfoList1=baseMapper.selectList(edgGlassTaskInfoWrapper);
+ int i=0;
+ for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList1
+ ) {
+ if(edgGlassTaskInfo.getWidth()<line1Width){
+ i+=1;
+ line1Width-=edgGlassTaskInfo.getWidth()+20;
+ }
+ }
+ if(i==2){
+ return 2;
+ }
+
+ edgGlassTaskInfoWrapper
+ .eq(EdgGlassTaskInfo::getLine,2)
+ .orderByDesc(EdgGlassTaskInfo::getTime);
+ List<EdgGlassTaskInfo> edgGlassTaskInfoList2=baseMapper.selectList(edgGlassTaskInfoWrapper);
+ i=0;
+ for (EdgGlassTaskInfo edgGlassTaskInfo:edgGlassTaskInfoList2
+ ) {
+ if(edgGlassTaskInfo.getWidth()<line2Width){
+ i+=1;
+ line2Width-=edgGlassTaskInfo.getWidth()+20;
+ }
+ }
+ if(i==2) {
+ return 1;
+ }else{
+ return 2;
+ }
+ }
+}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/controller/TaskCacheController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/controller/TaskCacheController.java
index a11c8d2..23b286a 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/controller/TaskCacheController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/controller/TaskCacheController.java
@@ -1,4 +1,4 @@
-package com.mes.userinfo.controller;
+package com.mes.edgstoragetask.controller;
import org.springframework.web.bind.annotation.RequestMapping;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/mapper/TaskCacheMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/mapper/TaskCacheMapper.java
index 0f9d676..dee45f9 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/mapper/TaskCacheMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/mapper/TaskCacheMapper.java
@@ -1,5 +1,6 @@
package com.mes.edgstoragetask.mapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.mes.edgstoragetask.entity.TaskCache;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -11,6 +12,7 @@
* @author zhoush
* @since 2024-04-16
*/
+@DS("salve_hangzhoumes")
public interface TaskCacheMapper extends BaseMapper<TaskCache> {
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/TaskCacheService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/TaskCacheService.java
index 9b066de..337dbb0 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/TaskCacheService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/TaskCacheService.java
@@ -13,5 +13,4 @@
*/
public interface TaskCacheService extends IService<TaskCache> {
- int judgeTasktype();
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/impl/TaskCacheServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/impl/TaskCacheServiceImpl.java
index 1d82f99..8253eeb 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/impl/TaskCacheServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/edgstoragetask/service/impl/TaskCacheServiceImpl.java
@@ -24,30 +24,6 @@
@Qualifier("")
@Service
public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService {
- @Resource
- private BigStorageCageFeedTaskMapper bigStorageCageFeedTaskMapper;
- @Override
- public int judgeTasktype(){
- //鍒ゆ柇鏍规嵁褰撳墠鍗ц浆绔嬩换鍔′笌纾ㄨ竟绾夸换鍔″垽鏂槸鍚﹀惎鍔ㄥ崸杞珛
-// for (int i=1;i<=2;i++){
-// //鏌ヨ鍗ц浆绔嬪綋鍓嶄换鍔�
-// int width=5000;
-// int num=0;
-// List<BigStorageCageFeedTask> bgStorageCageFeedTask =bigStorageCageFeedTaskMapper.();
-// //鏌ヨ纾ㄨ竟绾垮綋鍓嶄换鍔�
-// LambdaQueryWrapper<TaskCache> taskCacheWrapper=new LambdaQueryWrapper<>();
-// taskCacheWrapper.eq(TaskCache::getTaskStauts,"0");
-// List<TaskCache> taskCacheList=taskCacheService.list(taskCacheWrapper);
-// //鍒ゆ柇褰撳墠绾胯矾杩橀渶瑕佸啀涓婂嚑鐗囨墠鑳芥弧瓒冲皬杞﹀搴�
-// for (TaskCache taskCache:taskCacheList
-// ) {
-// if(taskCache.getId().equals("1")){
-// //杩涚墖杞﹀搴﹀噺鍘诲皬鐗囧搴�
-// }
-// }
-// //鐗囨暟灏忎簬绛変簬2鏃跺彟涓�鏉$嚎鍗ц浆绔嬪惎鍔�
-// log.info("鍙戦�佸崸杞珛鍚姩淇″彿");
-// }
- return 0;
- }
+
+
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
new file mode 100644
index 0000000..bc3d222
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -0,0 +1,96 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.common.S7object;
+import com.mes.device.PlcParameterObject;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
+import com.mes.tools.WebSocketServer;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author SNG-015
+ */
+@Component
+@Slf4j
+public class PlcSlicecage {
+
+ @Resource
+ private BigStorageCageService bigStorageCageService;
+ @Resource
+ private BigStorageCageDetailsService bigStorageCageDetailsService;
+ @Resource
+ private TemperingGlassInfoService temperingGlassInfoService;
+
+ /**
+ * fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
+ * fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
+ */
+ @Scheduled(fixedDelay = 5000)
+ public void plcStorageCageTask() throws InterruptedException {
+ JSONObject jsonObject = new JSONObject();
+ try {
+ //鐣岄潰灞曠ず绗煎瓙淇℃伅
+ jsonObject.append("bigStorageCageInfo1", bigStorageCageService.querybigStorageCageDetail(1));
+ jsonObject.append("bigStorageCageInfo2", bigStorageCageService.querybigStorageCageDetail(2));
+ jsonObject.append("bigStorageCageInfo3", bigStorageCageService.querybigStorageCageDetail(3));
+ jsonObject.append("bigStorageCageInfo4", bigStorageCageService.querybigStorageCageDetail(4));
+ jsonObject.append("bigStorageCageInfo5", bigStorageCageService.querybigStorageCageDetail(5));
+ jsonObject.append("bigStorageCageInfo6", bigStorageCageService.querybigStorageCageDetail(6));
+ jsonObject.append("bigStorageCageInfo7", bigStorageCageService.querybigStorageCageDetail(7));
+ jsonObject.append("bigStorageCageInfo8", bigStorageCageService.querybigStorageCageDetail(8));
+
+ //杩涚墖浠诲姟鏁版嵁
+ List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1);
+ jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask);
+
+ //鍑虹墖浠诲姟鏁版嵁
+ List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2);
+ jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask);
+
+ //鐞嗙墖绗间娇鐢ㄦ儏鍐�
+ List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage();
+ jsonObject.append("bigStorageCageUsage", bigStorageCageUsage);
+
+ //鍑虹墖闃熷垪
+ List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list();
+ jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
+
+ //鎶ヨ淇℃伅
+ jsonObject.append("bigStorageCageFullAlarm", PlcStorageCageTask.bigStorageCageFullAlarm);
+
+ //鐞嗙墖绗艰〃鏍间俊鎭�
+ jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetail(0));
+
+
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
+ 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");
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
index f34d1a3..02228b4 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java
@@ -1,28 +1,43 @@
package com.mes.job;
-import cn.hutool.json.JSONObject;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.entity.BigStorageDTO;
import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
-import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService;
import com.mes.bigstoragetask.service.BigStorageCageOutTaskService;
import com.mes.common.S7object;
+import com.mes.common.config.Const;
import com.mes.device.PlcParameterObject;
-import com.mes.edgstoragetask.service.TaskCacheService;
+import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
+import com.mes.edgglasstask.service.EdgGlassTaskInfoService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
-import com.mes.menu.service.SysMenuService;
-import com.mes.tools.WebSocketServer;
+import com.mes.temperingglass.service.TemperingGlassInfoService;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+/**
+ * @author SNG-015
+ */
@Component
@Slf4j
public class PlcStorageCageTask {
@@ -38,94 +53,339 @@
@Resource
private BigStorageCageOutTaskService bigStorageCageOutTaskService;
@Resource
- private TaskCacheService taskCacheService;
-
+ private EdgGlassTaskInfoService edgGlassTaskInfoService;
@Resource
- private SysMenuService sysMenuService;
+ private TemperingGlassInfoService temperingGlassInfoService;
- PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
+ @Value("${mes.sequence.order}")
+ private boolean sequenceOrder;
+
+ public static boolean bigStorageCageFullAlarm = false;
+
+ private int line1Time = 0;
+ private int line2Time = 0;
+
/**
* fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
* fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
*/
- @Scheduled(fixedDelay = 300)
- public void plcStorageCageTask() throws InterruptedException {
- JSONObject jsonObject = new JSONObject();
- try {
- // 鐖嗙鎶ヨ
- boolean bigStorageCageFullAlarm = false;
-
- String plcFeedGlassid = "";
- String plcFeedReqLine = "0";
- if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) {
- plcFeedReqLine = "1";
- plcFeedGlassid=plcParameterObject.getPlcParameter("D01ID1").getValue();
- }
- if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) {
- plcFeedReqLine = "2";
- plcFeedGlassid=plcParameterObject.getPlcParameter("D04ID1").getValue();
- }
-
- if (!("0".equals(plcFeedReqLine))) {
- log.info("1銆丳lc杩涚墖璇锋眰鏃�");
- BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails();
- GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid);
- log.info("2銆佹牴鎹幓鐠僫d鑾峰彇鐜荤拑淇℃伅" + glassInfo);
- BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails);
- if (slotInfo != null) {
- int taskType = taskCacheService.judgeTasktype();
- log.info("3銆佹煡璇换鍔¤〃鍒ゆ柇褰撳墠浠诲姟绫诲瀷涓轰笂杞︾瓑鍒拌繕鏄笂杞﹀惎鍔�" + taskType);
- bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType);
- log.info("4銆佹坊鍔犱换鍔″埌浠诲姟琛�");
- bigStorageCageFullAlarm = false;
- } else {
- bigStorageCageFullAlarm = true;
- }
- } else {
- List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1);
- log.info("5銆佹煡璇换鍔¤〃鏄惁鏈夊凡缁忓畬鎴愮殑杩涚墖浠诲姟" + bigStorageCageFeedTaskList.size());
- for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList
- ) {
- BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails();
- bigStorageCageDetails.setId(bigStorageCageFeedTask.getId());
- bigStorageCageDetails.setState(1);
- bigStorageCageDetailsService.updateById(bigStorageCageDetails);
- log.info("6銆佷慨鏀圭悊鐗囩璇︽儏鐜荤拑鐘舵��");
- bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask);
- log.info("7銆佸垹闄ゅ凡缁忓畬鎴愮殑杩涚墖浠诲姟");
- }
- }
-
- //鏌ヨ鍑虹墖琛ㄦ槸鍚︽湁浠诲姟鏈畬鎴愮殑浠诲姟
- List<BigStorageCageOutTask> bigStorageCageOutTask=bigStorageCageOutTaskService.querybigStorageCageOutTask(0);
- if(bigStorageCageOutTask.size()==0){
- bigStorageCageService.outGlass();
- log.info("8銆佹病鏈夋湭瀹屾垚浠诲姟鏃惰皟鐢ㄥ嚭鐗囨帴鍙�");
- }
- bigStorageCageOutTaskService.updateOutTask();
- log.info("9銆佹牴鎹换鍔¤〃鐘舵�佷慨鏀归挗鍖栧皬鐗囪〃浠诲姟鐘舵��");
-
- //鎶ヨ淇℃伅
- jsonObject.append("bigStorageCageFullAlarm", bigStorageCageFullAlarm);
-
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home");
- 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");
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
+// @Scheduled(fixedDelay = 5000)
+// public void plcStorageCageTask() throws InterruptedException {
+//
+// PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
+// try {
+//
+// String plcFeedGlassid = "";
+// String plcFeedReqLine = "0";
+// if ("1".equals(plcParameterObject.getPlcParameter("D01Request").getValue())) {
+// plcFeedReqLine = "1";
+// plcFeedGlassid = plcParameterObject.getPlcParameter("D01ID1").getValue();
+// }
+// if ("1".equals(plcParameterObject.getPlcParameter("D04Request").getValue())) {
+// plcFeedReqLine = "2";
+// plcFeedGlassid = plcParameterObject.getPlcParameter("D04ID1").getValue();
+// }
+// line1Time += 1;
+// line2Time += 1;
+//
+// if (!("0".equals(plcFeedReqLine))) {
+// log.info("1銆丳lc杩涚墖璇锋眰鏃�");
+// BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails();
+// GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid);
+// log.info("2銆佹牴鎹幓鐠僫d鑾峰彇鐜荤拑淇℃伅" + glassInfo);
+// if (bigStorageCageDetailsService.selectGetBoard(plcFeedReqLine) >= 0) {
+// BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails);
+// if (slotInfo != null) {
+// int taskType = edgGlassTaskInfoService.judgeTasktype(plcFeedReqLine);
+// log.info("3銆佹煡璇换鍔¤〃鍒ゆ柇褰撳墠浠诲姟绫诲瀷涓轰笂杞︾瓑鍒拌繕鏄笂杞﹀惎鍔�" + taskType);
+// bigStorageCageFeedTaskService.addFeedTask(slotInfo, Integer.parseInt(plcFeedReqLine), taskType);
+// log.info("4銆佹坊鍔犱换鍔″埌浠诲姟琛�");
+// bigStorageCageFullAlarm = false;
+// } else {
+// bigStorageCageFullAlarm = true;
+// }
+// } else {
+// log.info("褰撳墠鐜荤拑瀹藉害涓嶅涓婅溅" + glassInfo);
+// if (!("1".equals(plcFeedReqLine))) {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1);
+// } else {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1);
+// }
+// }
+// } else {
+// List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1);
+// log.info("5銆佹煡璇换鍔¤〃鏄惁鏈夊凡缁忓畬鎴愮殑杩涚墖浠诲姟" + bigStorageCageFeedTaskList.size());
+// for (BigStorageCageFeedTask bigStorageCageFeedTask : bigStorageCageFeedTaskList
+// ) {
+// BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails();
+// bigStorageCageDetails.setId(bigStorageCageFeedTask.getId());
+// bigStorageCageDetails.setState(1);
+// bigStorageCageDetailsService.updateById(bigStorageCageDetails);
+// log.info("6銆佷慨鏀圭悊鐗囩璇︽儏鐜荤拑鐘舵��");
+// bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask);
+// log.info("7銆佸垹闄ゅ凡缁忓畬鎴愮殑杩涚墖浠诲姟");
+// }
+// //鍚姩闃堝��
+// if (line1Time >= 300) {
+// if ("0".equals(plcParameterObject.getPlcParameter("D05Go").getValue())) {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1);
+// }
+// }
+// if (line2Time >= 300) {
+// if ("0".equals(plcParameterObject.getPlcParameter("D02Go").getValue())) {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1);
+// }
+// }
+// }
+//
+// //鏌ヨ鍑虹墖琛ㄦ槸鍚︽湁浠诲姟鏈畬鎴愮殑浠诲姟
+// List<BigStorageCageOutTask> bigStorageCageOutTask = bigStorageCageOutTaskService.querybigStorageCageOutTask(0);
+// if (bigStorageCageOutTask.size() == 0) {
+// boolean result = bigStorageCageService.outGlass();
+// log.info("8銆佹病鏈夋湭瀹屾垚浠诲姟鏃惰皟鐢ㄥ嚭鐗囨帴鍙�");
+// if (result == false) {
+// temperingGlassInfoService.schedulingTask();
+// }
+// }
+// bigStorageCageOutTaskService.updateOutTask();
+// log.info("9銆佹牴鎹换鍔¤〃鐘舵�佷慨鏀归挗鍖栧皬鐗囪〃浠诲姟鐘舵��");
+//
+// //鏉ヤ笉鍙婇�佹椂鐩存帴璧�
+// String line = Integer.toString(edgGlassTaskInfoService.startTask());
+//
+// if (!(line.equals(plcFeedReqLine))) {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D02Go").getAddress(), 1);
+// } else {
+// S7object.getinstance().plccontrol.writetime(plcParameterObject.getPlcParameter("D05Go").getAddress(), 1);
+// }
+//
+//
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// }
+ @Scheduled(fixedDelay = 5000)
+ public void plcToHomeEdgScan() {
+ PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
+ String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue();
+ String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue();
+ String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue();
+ String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue();
+ log.info("1銆佽幏鍙栧埌鐨勮姹傚瓧d01涓猴細{}锛岃幏鍙栧埌鐨勬壂鎻廔D涓猴細{};鑾峰彇鍒扮殑璇锋眰瀛梔04涓猴細{}锛岃幏鍙栧埌鐨勬壂鎻廔D涓猴細{};",
+ d01Request, d01ID1, d04Request, d04ID1);
+ if (!"1".equals(d01Request) && !"1".equals(d04Request)) {
+ log.info("涓ゆ潯绾挎湭鏀跺埌杩涚墖浠诲姟锛岀粨鏉熸湰娆℃壂鎻忚繘鍗ц浆绔嬩换鍔�");
+ return;
+ }
+ // 0锛氫笉骞查 锛� 1锛氭潯浠舵弧瓒虫儏鍐典笅绔嬪嵆鍙戣溅
+ String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress();
+ // 0锛氫笉骞查 锛� 1锛氭潯浠舵弧瓒虫儏鍐典笅绔嬪嵆鍙戣溅
+ String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress();
+ Boolean flag01 = Boolean.FALSE;
+ Boolean flag04 = Boolean.FALSE;
+ //鎸夌収绾胯矾鍙婄幓鐠僫d鑾峰彇鐩搁偦涓ゅ潡鐜荤拑 鍗ц浆绔嬩笂鐨勭幓鐠�
+ if ("1".equals(d01Request)) {
+ flag01 = judgeGlassTypeStatus(d01ID1, Const.A09_OUT_TARGET_POSITION);
+ }
+ if ("1".equals(d04Request)) {
+ flag04 = judgeGlassTypeStatus(d04ID1, Const.A10_OUT_TARGET_POSITION);
+ }
+ if (flag01 && flag04) {
+ //姣旇緝鏈�鏃╀竴鐗囦换鍔$殑鐗堝浘id鍙婄増搴� 姹傚嚭鍗ц浆绔嬬殑绾胯矾
+ Integer startLine = getStartLine();
+ //璁$畻鐩爣鏍煎瓙锛屽彂閫佸惎鍔ㄤ换鍔�
+ computeTargetByLine(startLine, d02GoAdress, d05GoAdress);
+ } else if (flag01 || flag04) {
+ Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION;
+ //璁$畻鐩爣鏍煎瓙锛屽彂閫佸惎鍔ㄤ换鍔�
+ computeTargetByLine(startLine, d02GoAdress, d05GoAdress);
+ } else {
+ log.info("涓ゆ潯绾挎湭鏀跺埌杩涚墖浠诲姟锛岀粨鏉熸湰娆℃壂鎻忚繘鍗ц浆绔嬩换鍔�");
}
}
+ @Scheduled(fixedDelay = 5000)
+ public void plcToHomeEdgFreeCarTask() {
+ PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
+ String freeCar = plcParameterObject.getPlcParameter("freeCar").getValue();
+ if ("1".equals(freeCar)) {
+ log.info("澶ц溅闈炵┖闂�");
+ return;
+ }
+ String d01Request = plcParameterObject.getPlcParameter("D01Request").getValue();
+ String d01ID1 = plcParameterObject.getPlcParameter("D01ID1").getValue();
+ String d04Request = plcParameterObject.getPlcParameter("D04Request").getValue();
+ String d04ID1 = plcParameterObject.getPlcParameter("D04ID1").getValue();
+ log.info("1銆佽幏鍙栧埌鐨勮姹傚瓧d01涓猴細{}锛岃幏鍙栧埌鐨勬壂鎻廔D涓猴細{};鑾峰彇鍒扮殑璇锋眰瀛梔04涓猴細{}锛岃幏鍙栧埌鐨勬壂鎻廔D涓猴細{};",
+ d01Request, d01ID1, d04Request, d04ID1);
+ //涓ゆ潯绾块兘鏈夎繘鍗ц浆绔嬩换鍔★紝鐩存帴缁撴潫
+ if (Const.BIG_STORAGE_REQUEST_IN.equals(d01Request)
+ && Const.BIG_STORAGE_REQUEST_IN.equals(d04Request)
+ && StringUtils.isNotBlank(d01ID1)
+ && StringUtils.isNotBlank(d04ID1)) {
+ log.info("涓ゆ潯绾块兘瀛樺湪杩涚墖浠诲姟锛岀粨鏉熶换鍔�");
+ return;
+ }
+ //鑾峰彇涓ゆ潯绾垮崸杞珛鏄惁鏈夌幓鐠冿紝涓斾换鍔$姸鎬侀兘涓�2
+ List<String> lineList = bigStorageCageFeedTaskService.querySitToUpGlass();
+ if (CollectionUtils.isEmpty(lineList)) {
+ log.info("涓ゆ潯绾垮崸杞珛涓虹┖鎴栬�呮湁杩涚墖浠诲姟鏈畬鎴愶紝缁撴潫浠诲姟");
+ return;
+ }
+// 0锛氫笉骞查 锛� 1锛氭潯浠舵弧瓒虫儏鍐典笅绔嬪嵆鍙戣溅
+ String d02GoAdress = plcParameterObject.getPlcParameter("D02Go").getAddress();
+ // 0锛氫笉骞查 锛� 1锛氭潯浠舵弧瓒虫儏鍐典笅绔嬪嵆鍙戣溅
+ String d05GoAdress = plcParameterObject.getPlcParameter("D05Go").getAddress();
+ String line1 = lineList.get(0);
+ String flagLine = line1.equals(Const.A09_OUT_TARGET_POSITION) ? d01ID1 : d04ID1;
+ if (lineList.size() == 1) {
+ //鍙戦��
+ if (StringUtils.isNotBlank(flagLine)) {
+ return;
+ }
+ //璁$畻浠诲姟琛ㄨ繘鐗囨牸瀛� 鍙戦�佽繘鐗囦换鍔�
+ computeTargetByLine(Integer.parseInt(flagLine), d02GoAdress, d05GoAdress);
+ }
+ if (StringUtils.isBlank(d01ID1) && StringUtils.isBlank(d04ID1)) {
+ //姣旇緝鏈�鏃╀竴鐗囦换鍔$殑鐗堝浘id鍙婄増搴� 姹傚嚭鍗ц浆绔嬬殑绾胯矾
+ Integer line = getStartLine();
+ //璁$畻浠诲姟琛ㄨ繘鐗囨牸瀛� 鍙戦�佽繘鐗囦换鍔�
+ computeTargetByLine(line, d02GoAdress, d05GoAdress);
+ return;
+ }
+ int outLine = StringUtils.isBlank(d01ID1) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION;
+ //璁$畻浠诲姟琛ㄨ繘鐗囨牸瀛� 鍙戦�佽繘鐗囦换鍔�
+ computeTargetByLine(outLine, d02GoAdress, d05GoAdress);
+ }
+
+ @Scheduled(fixedDelay = 5000)
+ public void plcToHomeEdgOutTask() {
+
+ }
+
+
+ /**
+ * 鎸夌収鐜荤拑id鍒ゆ柇鐜荤拑鐘舵�佸強鍗ц浆绔嬫槸鍚﹀彲鐩存帴鍚姩
+ */
+ public Boolean judgeGlassTypeStatus(String glassId, Integer line) {
+ //1銆佽幏鍙栦换鍔¤〃涓浉閭荤幓鐠�
+ List<EdgGlassTaskInfo> edgGlassTaskInfoList = edgGlassTaskInfoService.list(new LambdaQueryWrapper<EdgGlassTaskInfo>()
+ .eq(EdgGlassTaskInfo::getLine, line)
+ .apply("time >= (select time from edg_glass_task_info where glass_id = '" + glassId + "')")
+ .orderByAsc(EdgGlassTaskInfo::getTime));
+ Assert.isFalse(CollectionUtils.isEmpty(edgGlassTaskInfoList), "璇嗗埆鐜荤拑淇℃伅鏈嚭鐜板湪灏哄琛ㄤ腑,鑾峰彇鐩搁偦涓ゅ潡鐜荤拑澶辫触");
+ //2銆佽幏鍙栧崸杞珛鍓╀綑瀹藉害
+ Map<String, Object> map = bigStorageCageFeedTaskService.getMap(new QueryWrapper<BigStorageCageFeedTask>()
+ .select("cast(5000 - sum(width + 20) as INT)as remainWidth")
+ .eq("line", line).eq("task_state", Const.BIG_STORAGE_IN_UP));
+ Integer remainWidth = null == map ? 5000 : Integer.parseInt(map.get("remainWidth") + "");
+ //2銆佽幏鍙栧崸杞珛
+ Integer widthFirst = edgGlassTaskInfoList.get(0).getWidth();
+ if (edgGlassTaskInfoList.size() == 1) {
+ if (remainWidth >= widthFirst) {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst);
+ return Boolean.FALSE;
+ } else {
+ //璁板綍鏃犳硶鏀句笅鐜荤拑锛屽悗缁垽鏂惎鍔�
+ return Boolean.TRUE;
+ }
+ }
+ Integer widthSecond = edgGlassTaskInfoList.get(1).getWidth();
+ if (remainWidth >= widthFirst) {
+ if (remainWidth - widthFirst - Const.BIG_STORAGE_GAP >= widthSecond) {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthSecond);
+ } else {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthSecond);
+ }
+ return Boolean.FALSE;
+
+ } else {
+ return Boolean.TRUE;
+ }
+ }
+
+ /**
+ * 娣诲姞浠诲姟淇℃伅
+ */
+ private Boolean addFeedTask(String glassId, Integer line, Integer taskType, Integer width) {
+ BigStorageCageFeedTask bigStorageCageFeedTask = new BigStorageCageFeedTask();
+ bigStorageCageFeedTask.setGlassId(glassId);
+ bigStorageCageFeedTask.setTaskState(Const.BIG_STORAGE_REQUEST_IN);
+ bigStorageCageFeedTask.setLine(line);
+ bigStorageCageFeedTask.setTaskType(taskType);
+ bigStorageCageFeedTask.setWidth(width);
+ bigStorageCageFeedTask.setCreateTime(new Date());
+ return bigStorageCageFeedTaskService.save(bigStorageCageFeedTask);
+ }
+
+ /**
+ * 鑾峰彇闇�瑕佸惎鍔ㄧ殑绾胯矾锛氫袱鏉$嚎閮藉彲鍚姩 鑾峰彇绗竴鐗囩幓鐠冪増鍥緄d鏈�灏� 鐗堝簭鏈�澶х殑绾胯矾
+ *
+ * @return
+ */
+ public Integer getStartLine() {
+ List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>()
+ .inSql(BigStorageCageFeedTask::getId, "select min(id) from big_storage_cage_feed_task where task_state = 2 group by line"));
+ Assert.isFalse(CollectionUtils.isEmpty(taskList), "鍗ц浆绔嬩袱鏉$嚎閮芥病鏈夌幓鐠冭繘鐗囦换鍔�");
+ Map<String, Integer> taskMap = taskList.stream().collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId,
+ BigStorageCageFeedTask::getLine));
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
+ .in(GlassInfo::getGlassId, taskMap.keySet())
+ .orderByAsc(GlassInfo::getTemperingLayoutId)
+ .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)
+ .last("limit 1"));
+ return taskMap.get(glassInfo.getGlassId());
+ }
+
+ /**
+ * 璁$畻浠诲姟琛ㄨ繘鐗囩嚎璺殑鐩爣鏍煎瓙锛屽苟鍚姩浠诲姟
+ */
+ public boolean computeTargetByLine(Integer line, String d02GoAdress, String d05GoAdress) {
+ //1銆佽幏鍙栦换鍔¤〃涓殑鎵�鏈夌幓鐠冿紙鎸囧畾绾胯矾涓斿凡缁忚繘鍗ц浆绔嬪畬鎴愶級
+ List<BigStorageCageFeedTask> taskList = bigStorageCageFeedTaskService.list(new LambdaQueryWrapper<BigStorageCageFeedTask>()
+ .eq(BigStorageCageFeedTask::getLine, line)
+ .eq(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_UP)
+ .orderByAsc(BigStorageCageFeedTask::getId));
+ //2銆佸幓绗煎瓙鍐呮煡鎵炬槸鍚﹀彲浠ョ户缁瓨鏀剧殑绗煎瓙
+ List<String> glassIds = taskList.stream().map(BigStorageCageFeedTask::getGlassId).collect(Collectors.toList());
+ List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIds));
+ AtomicReference<Integer> temperingLayoutIdTemp = new AtomicReference<>(0);
+ AtomicReference<Integer> temperingFeedSequenceTemp = new AtomicReference<>(0);
+ AtomicReference<BigStorageDTO> bigStorageDTO = new AtomicReference<>(new BigStorageDTO());
+ Map<String, GlassInfo> glassInfoMap = glassInfos.stream().collect(Collectors.toMap(GlassInfo::getGlassId, p -> p));
+ List<BigStorageCageDetails> bigStorageCageDetailsList = new ArrayList<>();
+ AtomicBoolean taskFlag = new AtomicBoolean(Boolean.TRUE);
+ taskList.stream().forEach(e -> {
+ BigStorageCageDetails cageDetails = new BigStorageCageDetails();
+ //鎸夌収鐗堝浘淇℃伅鑾峰彇杩涚墖绗煎瓙鏍煎瓙鍙�
+ GlassInfo info = glassInfoMap.get(e.getGlassId());
+ BeanUtils.copyProperties(info, cageDetails);
+ if (temperingLayoutIdTemp.equals(info.getTemperingLayoutId())
+ && temperingFeedSequenceTemp.equals(info.getTemperingFeedSequence() + 1)
+ && info.getWidth() <= bigStorageDTO.get().getWidth()) {
+ bigStorageDTO.get().setWidth(bigStorageDTO.get().getWidth() - info.getWidth().intValue() - Const.BIG_STORAGE_GAP);
+ } else {
+ bigStorageDTO.set(bigStorageCageDetailsService.queryTargetSlotByTempering(info));
+ }
+ e.setTargetSlot(bigStorageDTO.get().getSlot());
+ cageDetails.setSlot(bigStorageDTO.get().getSlot());
+ cageDetails.setState(Const.GLASS_STATE_IN);
+ temperingLayoutIdTemp.set(info.getTemperingLayoutId());
+ temperingFeedSequenceTemp.set(info.getTemperingFeedSequence());
+ bigStorageCageDetailsList.add(cageDetails);
+ taskFlag.set(bigStorageCageFeedTaskService.updateById(e));
+ if (!taskFlag.get()) {
+ return;
+ }
+ });
+ //3銆佹洿鏂拌繘鐗囦换鍔¤〃 閬囧埌闂锛氭棤娉曟壒閲忔洿鏂帮紝鎵归噺鏇存柊鏃犳硶璧版寚瀹氫粠搴�
+
+ //4銆佸湪璇︽儏琛ㄤ腑鍔犲叆杩涚墖鐜荤拑淇℃伅
+ bigStorageCageDetailsService.saveBatch(bigStorageCageDetailsList);
+ if (taskFlag.get()) {
+ String lineAddress = line.equals(Const.A09_OUT_TARGET_POSITION) ? d02GoAdress : d05GoAdress;
+// S7object.getinstance().plccontrol.writeWord(lineAddress, (short) 1);
+ }
+ return taskFlag.get();
+ }
}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
index 5418041..ad8b70f 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
@@ -2,6 +2,7 @@
import com.mes.bigstorage.entity.BigStorageCage;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.bigstorage.service.BigStorageCageService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
@@ -32,18 +33,21 @@
@Autowired
private TemperingGlassInfoService temperingGlassInfoService;
+ @Autowired
+ private BigStorageCageDetailsService bigStorageCageDetailsService;
- @ApiOperation("閽㈠寲灏忕墖淇℃伅")
- @GetMapping("/queryTemperingGlassInfo")
- public Result queryTemperingGlassInfo() {
- return Result.build(200,"鏌ヨ鎴愬姛",temperingGlassInfoService.list());
+ @ApiOperation("鍑虹墖浠诲姟鍒犻櫎")
+ @PostMapping("/deleteTemperingGlassInfo")
+ public Result deleteTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) {
+ temperingGlassInfoService.removeById(temperingGlassInfo);
+ return Result.build(200,"鍒犻櫎鎴愬姛",1);
}
- @ApiOperation("鎵嬪姩娣诲姞鍑虹墖浠诲姟")
- @PostMapping("/insertTemperingGlassInfo")
- public Result insertBigStorageCageDetail(TemperingGlassInfo temperingGlassInfo) {
- temperingGlassInfoService.save(temperingGlassInfo);
- return Result.build(200,"娣诲姞鎴愬姛",1);
+ @ApiOperation("鍑虹墖浠诲姟鐮存崯")
+ @PostMapping("/damageTemperingGlassInfo")
+ public Result damageTemperingGlassInfo(TemperingGlassInfo temperingGlassInfo) {
+ bigStorageCageDetailsService.damageBigStorageCageDetails(temperingGlassInfo.getGlassId());
+ return Result.build(200,"鐮存崯鎴愬姛",1);
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
index 3f6b0c9..40878b5 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
@@ -3,6 +3,9 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -14,6 +17,7 @@
* @author zhoush
* @since 2024-03-27
*/
+@ApiModel(description = "<p> 閽㈠寲灏忕墖淇℃伅琛� </p>")
@Data
@EqualsAndHashCode(callSuper = false)
public class TemperingGlassInfo implements Serializable {
@@ -23,72 +27,92 @@
/**
* 閽㈠寲灏忕墖淇℃伅琛╥d
*/
+ @ApiModelProperty(value = "閽㈠寲灏忕墖淇℃伅琛╥d", position = 2)
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
+ * 鐜荤拑id
+ */
+ @ApiModelProperty(value = "鐜荤拑id", position = 3)
+ private String glassId;
+
+ /**
* 娴佺▼鍗�
*/
+ @ApiModelProperty(value = "娴佺▼鍗�", position = 4)
private String flowcardId;
/**
* 娴佺▼鍗$幓鐠冪被鍨�
*/
+ @ApiModelProperty(value = "娴佺▼鍗$幓鐠冪被鍨�", position = 5)
private Integer glassType;
/**
* 瀹�
*/
+ @ApiModelProperty(value = "瀹�", position = 6)
private Double width;
/**
* 楂�
*/
+ @ApiModelProperty(value = "楂�", position = 7)
private Double height;
/**
* 鍘氬害
*/
+ @ApiModelProperty(value = "鍘氬害", position = 8)
private Double thickness;
/**
* 鑶滅郴
*/
+ @ApiModelProperty(value = "鑶滅郴", position = 9)
private Integer filmsid;
/**
* 閽㈠寲鏄惁鎺ュ彈妯斁
*/
+ @ApiModelProperty(value = "閽㈠寲鏄惁鎺ュ彈妯斁", position = 10)
private Integer ishorizontal;
/**
* 閽㈠寲鐗堝浘id
*/
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 11)
private Integer temperingLayoutId;
/**
* 閽㈠寲鐗堝浘鐗囧簭
*/
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 12)
private Integer temperingFeedSequence;
/**
* x鍧愭爣
*/
+ @ApiModelProperty(value = "x鍧愭爣", position = 13)
private Integer xCoordinate;
/**
* y鍧愭爣
*/
+ @ApiModelProperty(value = "y鍧愭爣", position = 14)
private Integer yCoordinate;
/**
* 鏃嬭浆瑙掑害锛堥�嗘椂閽堬級
*/
+ @ApiModelProperty(value = "鏃嬭浆瑙掑害锛堥�嗘椂閽堬級", position = 15)
private Integer angle;
/**
* 鐘舵��
*/
+ @ApiModelProperty(value = "鐘舵��", position = 16)
private Integer state;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
index ccf5a4b..bb591f5 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
@@ -1,5 +1,6 @@
package com.mes.temperingglass.mapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
@@ -11,6 +12,7 @@
* @author zhoush
* @since 2024-03-27
*/
+@DS("salve_hangzhoumes")
public interface TemperingGlassInfoMapper extends BaseMapper<TemperingGlassInfo> {
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java
index 3280efb..5f1a325 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/TemperingGlassInfoService.java
@@ -17,4 +17,5 @@
public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList);
+ void schedulingTask();
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
index 4e4b1c8..5f802b5 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingGlassInfoServiceImpl.java
@@ -1,14 +1,26 @@
package com.mes.temperingglass.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.bigstorage.entity.BigStorageCage;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
+import com.mes.bigstorage.mapper.BigStorageCageMapper;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
+import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
import java.util.List;
+import java.util.Map;
/**
* <p>
@@ -22,6 +34,11 @@
@Service
public class TemperingGlassInfoServiceImpl extends ServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService {
+ @Resource
+ private BigStorageCageDetailsMapper bigStorageCageDetailsMapper;
+ @Resource
+ private BigStorageCageMapper bigStorageCageMapper;
+
@Override
public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList) {
double carWidth=5000;
@@ -31,11 +48,11 @@
) {
log.info("1銆佸綋鍑虹墖杞﹀搴﹀ぇ浜庣幓鐠冨搴︽椂");
if((carWidth-temperingGlassInfo.getWidth())>0){
- carWidth-=temperingGlassInfo.getWidth()-gap;
- log.info("2銆佹坊鍔犲垰灏忕墖琛ㄤ俊鎭埌浠诲姟琛�");
- temperingGlassInfo.setState(1);
+ carWidth-=temperingGlassInfo.getWidth()+gap;
+ log.info("2銆佹坊鍔犻挗鍖栧皬鐗囪〃淇℃伅鍒颁换鍔¤〃");
+ temperingGlassInfo.setState(-1);
baseMapper.updateById(temperingGlassInfo);
- log.info("3銆佹坊鍔犲垰灏忕墖琛ㄤ俊鎭埌浠诲姟琛�");
+ log.info("3銆佷慨鏀归挗鍖栧皬鐗囪〃浠诲姟鐘舵��");
BigStorageCageOutTask bigStorageCageOutTask =new BigStorageCageOutTask();
bigStorageCageOutTask.setId(temperingGlassInfo.getId());
}else{
@@ -44,4 +61,68 @@
}
}
+ //璋冨害
+ @Override
+ public void schedulingTask(){
+ QueryWrapper<BigStorageCageDetails> detailsWrapper1 = Wrappers.query();
+ detailsWrapper1.select("tempering_layout_id", "count(distinct slot)")
+ .groupBy("tempering_layout_id");
+ List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(detailsWrapper1);
+
+ boolean key=false;
+ for (Map<String, Object> row : temperingLayoutIdList) {
+ for (Map.Entry<String, Object> entry : row.entrySet()) {
+ String temperingId = entry.getKey();
+ int temperingNo = Integer.parseInt(entry.getValue().toString());
+ if(temperingNo>8){
+ QueryWrapper<BigStorageCageDetails> detailsWrapper2 = Wrappers.query();
+ detailsWrapper2.select("tempering_layout_id", "slot")
+ .select("max(tempering_feed_sequence) as max_sequence", "min(tempering_feed_sequence) as min_sequence")
+ .groupBy("tempering_layout_id", "slot")
+ .orderByAsc("tempering_layout_id")
+ .orderByDesc("min_sequence");
+
+ List<Map<String, Object>> result = bigStorageCageDetailsMapper.selectMaps(detailsWrapper2);
+ for (Map<String, Object> rows : result) {
+ // 鑾峰彇姣忚鐨勫��
+ Object temperingLayoutId = rows.get("tempering_layout_id");
+ int slot = Integer.parseInt(rows.get("slot").toString());
+ int maxSequence = Integer.parseInt(rows.get("max_sequence").toString());
+ int minSequence = Integer.parseInt(rows.get("min_sequence").toString());
+
+ LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper=new LambdaQueryWrapper<>();
+ bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot);
+ BigStorageCage bigStorageCage=bigStorageCageMapper.selectOne(bigStorageCageWrapper);
+ Integer remainWidth=5000-bigStorageCage.getRemainWidth();
+
+ BigStorageCage bigStorageCages=bigStorageCageMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>()
+ .selectAll(BigStorageCage.class)
+ .leftJoin(BigStorageCageDetails.class, on -> on
+ .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId)
+ .eq(BigStorageCage::getSlot, BigStorageCageDetails::getSlot))
+ .gt(BigStorageCage::getRemainWidth,remainWidth)
+ .eq(BigStorageCageDetails::getTemperingLayoutId,temperingLayoutId)
+ .eq(BigStorageCageDetails::getTemperingFeedSequence,minSequence-1)
+ );
+
+ if(bigStorageCages.getSlot()!=null){
+ LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper=new LambdaQueryWrapper<>();
+ bigStorageCageDetailsWrapper
+ .eq(BigStorageCageDetails::getSlot,slot)
+ .orderByDesc(BigStorageCageDetails::getTemperingFeedSequence);
+ List<BigStorageCageDetails> bigStorageCageDetailsList=bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper);
+ for (BigStorageCageDetails bigStorageCageDetails:bigStorageCageDetailsList
+ ) {
+ BigStorageCageOutTask bigStorageCageOutTask=new BigStorageCageOutTask();
+ bigStorageCageOutTask.setTaskState(-3);
+ bigStorageCageOutTask.setStartSlot(slot);
+ bigStorageCageOutTask.setEndSlot(bigStorageCages.getSlot());
+ }
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-cz.yml
similarity index 80%
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-cz.yml
index 2454814..6dc9dfd 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-cz.yml
@@ -5,12 +5,12 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
salve_hangzhoumes:
- url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes
username: sa
password: beibo.123/
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
index 8f86c1c..7209b1f 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -3,10 +3,13 @@
spring:
profiles:
- active: prod
+ active: dev
application:
name: cacheVerticalGlass
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
configuration:
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+mes:
+ sequence:
+ order: false
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
new file mode 100644
index 0000000..1ef2f3f
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/mapper/BigStorageCageFeedTaskMapper.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper">
+
+ <select id="querySitToUpGlass" resultType="java.lang.String">
+ select t.line
+ from (
+ select line,
+ COUNT(glass_id) as total_count,
+ SUM(case task_state when 2 then 1 else 0 end) as real_count
+ from big_storage_cage_feed_task
+ where task_state in (1, 2)
+ group by line
+ ) t
+ where t.total_count = t.real_count
+ </select>
+
+</mapper>
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
index 4d64154..ae11d30 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/test/java/com/mes/CacheVerticalGlassModuleApplicationTest.java
@@ -1,14 +1,16 @@
package com.mes;
+import com.mes.bigstorage.service.BigStorageCageService;
+import com.mes.common.config.Const;
+import com.mes.job.PlcStorageCageTask;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
/**
* @Author : zhoush
@@ -17,12 +19,42 @@
*/
@Slf4j
@RunWith(SpringRunner.class)
-@SpringBootTest(classes = CacheVerticalClassModuleApplication.class)
+@SpringBootTest(classes = CacheVerticalClassModuleApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CacheVerticalGlassModuleApplicationTest {
+
+ @Autowired
+ BigStorageCageService bigStorageCageService;
+ @Autowired
+ PlcStorageCageTask plcStorageCageTask;
@Test
public void testFindPath() {
log.info("瀹屾暣璺緞锛歿}", Arrays.asList("123"));
}
+ @Test
+ public void computeTargetByLine() {
+// log.info("鑾峰彇澶х悊鐗囩淇℃伅锛歿}",bigStorageCageService.querybigStorageCageDetail());
+ plcStorageCageTask.computeTargetByLine(2001, "", "");
+ }
+
+ @Test
+ public void judgeGlassTypeStatus() {
+// log.info("鑾峰彇澶х悊鐗囩淇℃伅锛歿}",bigStorageCageService.querybigStorageCageDetail());
+ plcStorageCageTask.judgeGlassTypeStatus("P24060403|6|7", Const.A09_OUT_TARGET_POSITION);
+ }
+
+ @Test
+ public void getStartLine() {
+// log.info("鑾峰彇澶х悊鐗囩淇℃伅锛歿}",bigStorageCageService.querybigStorageCageDetail());
+ Integer startLine = plcStorageCageTask.getStartLine();
+ log.info("---------{}", startLine);
+ }
+
+ @Test
+ public void selectBigStorageCageUsage() {
+// bigStorageCageService.querybigStorageCageDetail(1);
+ log.info("鑾峰彇澶х悊鐗囩淇℃伅锛歿}", bigStorageCageService.selectBigStorageCageUsage());
+ }
+
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/LoadGlassModuleApplication.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/LoadGlassModuleApplication.java
index 2634690..593308c 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/LoadGlassModuleApplication.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/LoadGlassModuleApplication.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.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
@@ -16,6 +17,7 @@
@SpringBootApplication
@EnableSwagger2
@EnableDiscoveryClient
+@EnableScheduling
@MapperScan(basePackages = "com.mes.*.mapper")
public class LoadGlassModuleApplication {
public static void main(String[] args) {
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
index 66aef59..e62c4cb 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
@@ -37,13 +37,29 @@
@Autowired
private OptimizeProjectService optimizeProjectService;
@ApiOperation("寮�濮�/鏆傚仠浠诲姟/浼犻�掑伐绋嬪彿鍜岀姸鎬�,寮�濮嬫槸1 鏆傚仠鏄�0")
- @PostMapping("/pauseTask") //璋冪敤涓婄墖浠诲姟
+ @PostMapping("/pauseTask") //鏆傚仠涓婄墖浠诲姟
@ResponseBody
public Result <List<UpPattenUsage>> pauseTask(@RequestBody Engineering engineering) {
boolean work=engineeringService.changeTask(engineering.getEngineerId(),engineering.getState());
List<UpPattenUsage> glass = upPattenUsageService.prioritylist();
- log.info("StartorStop:{},{}", work,engineering);
- return Result.build(200, engineering.getEngineerId(),glass);
+ if(work){
+ return Result.build(200,"鎴愬姛",glass);
+ }else {
+ return Result.build(100,"澶辫触",glass);
+ }
+ }
+
+ @ApiOperation("鏆傚仠")
+ @PostMapping("/pause") //鏆傚仠涓婄墖浠诲姟
+ @ResponseBody
+ public Result <List<UpPattenUsage>> pause(@RequestBody Engineering engineering) {
+ boolean work=engineeringService.pauseTask(engineering.getEngineerId(),engineering.getState());
+ List<UpPattenUsage> glass = upPattenUsageService.prioritylist();String message;
+ if(work){
+ return Result.build(200,"鎴愬姛",glass);
+ }else {
+ return Result.build(100,"鎴愬姛",glass);
+ }
}
@ApiOperation("寮�濮嬩笂鐗�")
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
index 586a7b3..94df6c1 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
@@ -2,10 +2,11 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
-import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import java.io.Serializable;
+
/**
* <p>
*
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
index 806503a..23b8d67 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
@@ -40,4 +40,6 @@
* @return Engineering
*/
List<Engineering> selectTask();
+
+ boolean pauseTask(String engineerId, Integer state);
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
index 8c62698..d3c02f3 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
@@ -40,12 +40,13 @@
LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper());
pauseWrapper.set(Engineering::getState,0);
pauseWrapper.eq(Engineering::getState,1);
- pauseWrapper.update();
+ boolean pause = pauseWrapper.update();
//浣跨敤projectId浣滀负鏉′欢寮�濮嬪伐绋�
LambdaUpdateChainWrapper<Engineering> wrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper());
wrapper.set(Engineering::getState,state);
wrapper.eq(Engineering::getEngineerId,projectId);
- return wrapper.update();
+ wrapper.update();
+ return pause;
}
@Override
@@ -109,4 +110,13 @@
return engineeringMapper.selectList(wrapper);
}
+ @Override
+ public boolean pauseTask(String engineerId, Integer state) {
+ //鏆傚仠姝e湪杩涜宸ョ▼
+ LambdaUpdateChainWrapper<Engineering> pauseWrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper());
+ pauseWrapper.set(Engineering::getState,0);
+ pauseWrapper.eq(Engineering::getState,1);
+ return pauseWrapper.update();
+ }
+
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
index 3f979db..06ffda6 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -5,7 +5,6 @@
import com.mes.device.PlcParameterObject;
import com.mes.engineering.entity.Engineering;
import com.mes.engineering.service.EngineeringService;
-import com.mes.pp.entity.OptimizeProject;
import com.mes.pp.service.OptimizeProjectService;
import com.mes.tools.WebSocketServer;
import com.mes.uppattenusage.entity.UpPattenUsage;
@@ -88,7 +87,7 @@
}
}
- @Scheduled(fixedDelay = 30000000)
+ @Scheduled(fixedDelay = 3000000)
public void plcLoadGlassReport(){
//鑾峰彇鏄惁鏈夋眹鎶�
String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue();
@@ -130,11 +129,11 @@
for (WebSocketServer webserver : sendwServer) {
if (webserver != null) {
webserver.sendMessage(jsonObject.toString());
- List<String> messages = webserver.getMessages();
- if (!messages.isEmpty()) {
- // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
- webserver.clearMessages();
- }
+// List<String> messages = webserver.getMessages();
+// if (!messages.isEmpty()) {
+// // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+// webserver.clearMessages();
+// }
} else {
log.info("Home is closed");
}
@@ -153,11 +152,6 @@
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/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
index 5851554..3d98ea2 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/controller/UpPattenUsageController.java
@@ -36,7 +36,7 @@
private EngineeringService engineeringService;
@Autowired
private OptimizeProjectService optimizeProjectService;
- @ApiOperation("鏄剧ず姝e湪鍑虹墖鐨勫伐绋嬩俊鎭�")
+ @ApiOperation("鏄剧ず閫夋嫨鐨勫伐绋嬩俊鎭�")
@GetMapping("/prioritylist") //鏌ヨ鐜板湪涓婄墖鏈虹殑鐜荤拑淇℃伅
@ResponseBody
public Result<List<UpPattenUsage>> prioritylist() {
@@ -49,10 +49,34 @@
@PostMapping("/selectUpPattenUsage") //鏌ヨ鐜板湪涓婄墖鏈虹殑鐜荤拑淇℃伅
@ResponseBody
public Result<List<UpPattenUsage>> selectUpPattenUsage(@RequestBody Engineering engineering) {
- List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId());
- return Result.build(200, "", upPattenUsages);
+ List<UpPattenUsage> upPattenUsages=null;
+ UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId());
+ if(upPattenUsage == null){
+ upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId());
+ }else {
+ upPattenUsages= upPattenUsageService.selectUpPattenUsage(upPattenUsage);
}
+ if (!upPattenUsages.isEmpty()) {
+ return Result.build(200, "鎴愬姛", upPattenUsages);
+ }else {
+ return Result.build(100, "澶辫触", upPattenUsages);
+ }
+
+ }
+
+ @ApiOperation("鍒囨崲鍘熺墖涓婄墖鐘舵��")
+ @PostMapping("/updateGlassState") //鏌ヨ鐜板湪涓婄墖鏈虹殑鐜荤拑淇℃伅
+ @ResponseBody
+ public Result<Boolean> updateGlassState(@RequestBody UpPattenUsage upPattenUsage) {
+ Boolean whether = upPattenUsageService.updateGlassState(upPattenUsage);
+ if (whether){
+ return Result.build(200, "鎴愬姛", whether);
+ }else {
+ return Result.build(100, "澶辫触", whether);
+ }
+
+ }
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/UpPattenUsageService.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/UpPattenUsageService.java
index 69c8aa0..f020aa3 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/UpPattenUsageService.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/UpPattenUsageService.java
@@ -19,6 +19,11 @@
*/
List<UpPattenUsage> prioritylist();
/**
+ * 鏌ヨ涓婄墖琛ㄧ殑宸ョ▼淇℃伅
+ * @return List<UpPattenUsage>
+ */
+ List<UpPattenUsage> selectUpPattenUsage(UpPattenUsage upPattenUsage);
+ /**
* 鏌ヨ涓婄墖椤哄簭淇℃伅
* @return List<UpPattenUsage>
*/
@@ -47,5 +52,7 @@
*/
UpPattenUsage selectSequence(UpPattenUsage upPattenUsage);
+
+ Boolean updateGlassState(UpPattenUsage upPattenUsage);
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
index 322ebc0..ada2a7b 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/uppattenusage/service/impl/UpPattenUsageServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.engineering.entity.Engineering;
@@ -18,6 +19,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -49,6 +51,13 @@
return null;
}
+ }
+
+ @Override
+ public List<UpPattenUsage> selectUpPattenUsage(UpPattenUsage upPattenUsage) {
+ LambdaQueryWrapper<UpPattenUsage> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(UpPattenUsage::getEngineeringId,upPattenUsage.getEngineeringId());
+ return this.list(wrapper);
}
@Override
@@ -127,5 +136,13 @@
return this.getOne(wrapper);
}
+ @Override
+ public Boolean updateGlassState(UpPattenUsage upPattenUsage) {
+ UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>();
+ updateWrapper.eq("id",upPattenUsage.getId())
+ .set("state",upPattenUsage.getState());
+ return this.update(updateWrapper);
+ }
+
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java
index 257bc80..de9796e 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/controller/UpWorkstationController.java
@@ -40,9 +40,14 @@
@PostMapping("/updateGlassMessage")
@ResponseBody
public Result<List<UpWorkstation>> updateGlassMessage(@RequestBody UpWorkstation upwork) {
- upWorkstationService.updateGlassMessage(upwork);
+ Boolean info= upWorkstationService.updateGlassMessage(upwork);
List<UpWorkstation> glass = upWorkstationService.list();
- return Result.build(200, "", glass);
+ if(info){
+ return Result.build(200, "鎴愬姛", glass);
+ }else{
+ return Result.build(100, "澶辫触", glass);
+ }
+
}
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/UpWorkstation.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/UpWorkstation.java
index b5265de..ed0bc83 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/UpWorkstation.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/entity/UpWorkstation.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
-import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/UpWorkstationMapper.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/UpWorkstationMapper.java
index 6c44a7d..d25be0d 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/UpWorkstationMapper.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/mapper/UpWorkstationMapper.java
@@ -5,8 +5,6 @@
import com.mes.workstation.entity.UpWorkstation;
import org.apache.ibatis.annotations.Param;
-import java.util.List;
-
/**
* <p>
* Mapper 鎺ュ彛
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java
index bd2a6c8..9a7be55 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/UpWorkstationService.java
@@ -34,7 +34,7 @@
* 澧炲姞浜哄伐杈撳叆鐨勫伐浣嶇幓鐠冧俊鎭�
* @param upwork
*/
- void updateGlassMessage(UpWorkstation upwork);
+ Boolean updateGlassMessage(UpWorkstation upwork);
String updateMesInkageLoad(short inKageWord);
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java
index b7d08c2..ec327ab 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/workstation/service/impl/UpWorkstationServiceImpl.java
@@ -74,17 +74,19 @@
* 澧炲姞浜哄伐杈撳叆鐨勫伐浣嶇幓鐠冧俊鎭�/鍒犻櫎浜哄伐鎼蛋鐨勭幓鐠冧俊鎭�
*/
@Override
- public void updateGlassMessage(UpWorkstation upwork) {
+ public Boolean updateGlassMessage(UpWorkstation upwork) {
+ int update = 0;
UpdateWrapper<UpWorkstation> updateWrapper = new UpdateWrapper<>();
if (upwork.getWorkstationId() == 1 || upwork.getWorkstationId() == 3) {
updateWrapper.eq("workstation_id", upwork.getWorkstationId());
- int update = this.baseMapper.update(upwork, updateWrapper);
+ update = this.baseMapper.update(upwork, updateWrapper);
} else {
if (upwork.getPatternHeight() > 2700 || upwork.getPatternHeight() == 0) {
updateWrapper.eq("workstation_id", upwork.getWorkstationId());
- int update = this.baseMapper.update(upwork, updateWrapper);
+ update = this.baseMapper.update(upwork, updateWrapper);
}
}
+ return update>0;
}
@Override
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json
index d85b3d8..9b0432b 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/JsonFile/PlcLoadGlass.json
@@ -25,11 +25,11 @@
"unit":""
},
{
- "codeId": "InkageStatus",
- "addressIndex":"22",
- "addressLenght":"2",
- "ratio":"1",
- "unit":""
+ "codeId": "InkageStatus",
+ "addressIndex":"22",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":""
},
{
"codeId": "WorkId",
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-cz.yml
similarity index 77%
rename from hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-loc.yml
rename to hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-cz.yml
index cc53ca6..9918e23 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-loc.yml
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application-cz.yml
@@ -5,14 +5,14 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
pp:
- url: jdbc:mysql://192.168.56.10:3306/pp?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/pp?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
cloud:
nacos:
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
index 2128453..3920d3c 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
@@ -2,10 +2,10 @@
port: 8083
spring:
profiles:
- active: prod
+ active: cz
application:
name: loadGlass
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
-# configuration:
-# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
index ab63b5f..d052648 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
@@ -2,7 +2,6 @@
import com.mes.engineering.entity.Engineering;
import com.mes.engineering.service.EngineeringService;
-import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.pp.entity.OptimizeProject;
import com.mes.pp.entity.request.OptimizeRequest;
@@ -70,6 +69,7 @@
@Test
public void textengineering(){
+ Engineering engineering=new Engineering();
List<Engineering> glass= engineeringService.selectEngineering("P24032204");
engineeringService.saveEngineering(glass);
log.info("glassinfo锛歿}", Arrays.asList(glass));
@@ -100,5 +100,14 @@
List<OptimizeProject> engineerings=optimizeProjectService.listByState(optimizeRequest);
log.info("涓婄墖琛ㄤ换鍔′腑鐨勬暟鎹畕}",engineerings);
}
+ @Test
+ public void textengineering6(){
+ //涓婄墖琛ㄦ渶鍚庝竴鐗�
+ UpPattenUsage upPattenUsage=new UpPattenUsage();
+ upPattenUsage.setState(100);
+ upPattenUsage.setId(2248L);
+ boolean isOver= upPattenUsageService.updateGlassState(upPattenUsage);
+ log.info("鏇存敼鏄惁鎴愬姛{}",isOver);
+ }
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/TemperingGlassModuleApplication.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/TemperingGlassModuleApplication.java
index 489df44..8fb3948 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/TemperingGlassModuleApplication.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/TemperingGlassModuleApplication.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.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
@@ -16,6 +17,7 @@
@SpringBootApplication
@EnableSwagger2
@EnableDiscoveryClient
+@EnableScheduling
@MapperScan(basePackages = "com.mes.*.mapper")
public class TemperingGlassModuleApplication {
public static void main(String[] args) {
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
new file mode 100644
index 0000000..3b05bc6
--- /dev/null
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -0,0 +1,57 @@
+package com.mes.job;
+
+import cn.hutool.json.JSONObject;
+import com.mes.temperingglass.entity.TemperingGlassInfo;
+import com.mes.temperingglass.service.TemperingAgoService;
+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 PlcTemperingGlassTask {
+
+ @Autowired
+ private TemperingAgoService temperingAgoService;
+ /**
+ * fixedRate : 涓婁竴涓皟鐢ㄥ紑濮嬪悗鍐嶆璋冪敤鐨勫欢鏃讹紙涓嶇敤绛夊緟涓婁竴娆¤皟鐢ㄥ畬鎴愶級
+ * fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
+ */
+
+ @Scheduled(fixedDelay = 1000)
+ public void loadGlassHome(){
+ JSONObject jsonObject = new JSONObject();
+ //姝e湪绛夊緟杩涚墖鐨勭幓鐠�
+ List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlass();
+ jsonObject.append("waitingGlass", waitingGlass);
+ //杩涚倝涓殑鐜荤拑
+ List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass();
+ jsonObject.append("intoGlass", intoGlass);
+ //鍑虹倝鍚庣殑鐜荤拑
+ List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass();
+ jsonObject.append("outGlass", outGlass);
+ //杩囨棆杞彴閽㈠寲鍚庣殑鐜荤拑
+ List<TemperingGlassInfo> overGlass = temperingAgoService.selectOverGlass();
+ jsonObject.append("overGlass", overGlass);
+
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("temperingGlass");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ } else {
+ log.info("Home is closed");
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
index 2fbfdcc..feb079a 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java
@@ -2,8 +2,6 @@
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingAgoService;
-import com.mes.temperingglass.service.TemperingOverService;
-import com.mes.temperingglass.service.TemperingService;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -22,10 +20,6 @@
// TidyUpGlassModule 閽㈠寲妯″潡
public class TemperingGlassInfoController {
- @Autowired
- TemperingService temperingService;
- @Autowired
- private TemperingOverService temperingOverService;
@Autowired
private TemperingAgoService temperingAgoService;
@@ -46,7 +40,7 @@
@ApiOperation("//閽㈠寲鍚庢樉绀哄嚭鐐夌殑鐗堝浘淇℃伅銆�")
@GetMapping("/selectOutGlass") //閽㈠寲鍚庢樉绀哄嚭鐐夌殑鐗堝浘淇℃伅
public Result <List<TemperingGlassInfo>> selectOutGlass() {
- List<TemperingGlassInfo> glass = temperingAgoService.SelectOutGlass();
+ List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass();
log.info("閽㈠寲鍑虹倝鍚庣殑鐜荤拑淇℃伅{}",glass);
return Result.build(200, "", glass);
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
index 16bb9f2..76f6375 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingGlassInfoMapper.java
@@ -1,5 +1,6 @@
package com.mes.temperingglass.mapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
@@ -12,6 +13,7 @@
* @author zhoush
* @since 2024-04-07
*/
+@DS("salve_hangzhoumes")
public interface TemperingGlassInfoMapper extends BaseMapper<TemperingGlassInfo>, MPJBaseMapper<TemperingGlassInfo> {
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java
index 3b66b46..2b0a3a7 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/mapper/TemperingMapper.java
@@ -1,5 +1,6 @@
package com.mes.temperingglass.mapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import org.apache.ibatis.annotations.Mapper;
@@ -8,27 +9,7 @@
import java.util.List;
@Mapper
+@DS("salve_hangzhoumes")
public interface TemperingMapper extends BaseMapper<TemperingGlassInfo> {
-
-
- //鏌ヨ璇ョ幓鐠冪殑灏哄鍜屽潗鏍�
-//@Select("select *from glass_info where id=#{glassid};")
-//GlassInfo SelectGlass(String glassid);
-//鏄惁鍙互鍙戦�佽繘鐐変俊鍙�
- @Select("select count(*) from glass_info where id=#{glassid};")
- int SelectTempering(String glassid);
-
- //鏌ヨ绛夊緟涓殑閽㈠寲鐗堝浘鐜荤拑淇℃伅
- @Select("select*from tempering_glass_info a left join (select flowcard_id,count(state)state from tempering_glass_info GROUP BY flowcard_id,state)b on a.flowcard_id=b.flowcard_id where b.state=2")
- List<TemperingGlassInfo> SelectWaitingGlass();
-
- //鏌ヨ杩涚倝涓殑閽㈠寲鐗堝浘鐜荤拑淇℃伅
- @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=1)b on a.flowcard_id=b.flowcard_id where b.state1=1")
- List<TemperingGlassInfo> SelectInGlass();
-
- //鏌ヨ閽㈠寲鍚庣殑閽㈠寲鐗堝浘淇℃伅
- @Select("select*from tempering_glass_info a left join (select flowcard_id,min(state)state1 from tempering_glass_info GROUP BY flowcard_id having state1=2)b on a.flowcard_id=b.flowcard_id where b.state1=2")
- List<TemperingGlassInfo> SelectOutGlass();
-
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java
index af0cfbb..feefa31 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingAgoService.java
@@ -1,6 +1,4 @@
package com.mes.temperingglass.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.github.yulichang.base.MPJBaseService;
import java.util.List;
@@ -19,5 +17,7 @@
List<TemperingGlassInfo> selectIntoGlass();
- List<TemperingGlassInfo> SelectOutGlass();
+ List<TemperingGlassInfo> selectOutGlass();
+
+ List<TemperingGlassInfo> selectOverGlass();
}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingOverService.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingOverService.java
deleted file mode 100644
index 387d325..0000000
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingOverService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.mes.temperingglass.service;
-
-import com.mes.temperingglass.entity.TemperingGlassInfo;
-import com.mes.temperingglass.mapper.TemperingMapper;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class TemperingOverService {
- private final TemperingMapper temperingMapper;
-
- //PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
- public TemperingOverService(TemperingMapper temperingMapper) {
- this.temperingMapper = temperingMapper;
- }
-
- //鎺ユ敹鍑虹倝淇″彿鍜岀倝鍙�
- public String SelectOutSignal() {
-
- //S7control.getinstance().WriteWord("鍑虹倝淇″彿", (short)1);
- return "GlassInfo";
- }
-
- //鍙戦�佺‘璁ゆ敹鍒颁俊鍙�
- public void OverSignal() {
- //S7control.getinstance().WriteWord("纭瀛�", (short)1);
- }
-
- //鏄剧ず閽㈠寲鍑虹倝鍚庣殑鐗堝浘淇℃伅
- public List<TemperingGlassInfo> SelectOutGlass() {
- return temperingMapper.SelectOutGlass();
- }
-
-
-}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingService.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingService.java
deleted file mode 100644
index bd7cb05..0000000
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/TemperingService.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.mes.temperingglass.service;
-//import com.mes.temperingglass.entity.GlassInfo;
-
-import com.mes.temperingglass.entity.TemperingGlassInfo;
-import com.mes.temperingglass.mapper.TemperingMapper;
-import com.mes.tools.S7control;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class TemperingService {
-
- private final TemperingMapper temperingMapper;
- private S7control s7control;
-
- public TemperingService(TemperingMapper temperingMapper) {
- this.temperingMapper = temperingMapper;
- }
-
- // //鎺ユ敹id杩斿洖鍧愭爣鍜屾暟鎹�
-// public GlassInfo SelectOutGlass (String glassid) {
-// GlassInfo GlassInfo = temperingMapper.SelectGlass(glassid);
-// return GlassInfo;
-// }
- //鍙戦�佸潗鏍囦俊鎭�
- public void SendCoordinate(short glassX, short glassY) {
- s7control.writeWord("DB100.10", glassX);
- s7control.writeWord("DB100.10", glassY);
- }
-
- //鍒ゆ柇鏄惁鍙互鍙戦�佽繘鐐変俊鍙�
- public int SelectTempering(String glassid) {
- int tempering = temperingMapper.SelectTempering(glassid);
- if (tempering == 1) {
- return 1;
- } else {
- return 0;
- }
- }
-
- //鍙戦�佽繘鐐変俊鍙�
- public void SendIntoGlass(short start) {
- s7control.writeWord("DB100.10", start);
- }
-
- //鎺ュ彈瀹屾垚瀛楀洖澶嶇‘璁ゅ瓧
- public void SendIntoGlass() {
- s7control.writeWord("DB100.10", (short) 1);
- }
-
- //鏄剧ず绛夊緟涓殑鐗堝浘
- public List<TemperingGlassInfo> SelectWaitingGlass() {
- List<TemperingGlassInfo> WaitingGlass = temperingMapper.SelectWaitingGlass();
- return WaitingGlass;
- }
-
- //鏄剧ず姝e湪杩涚倝鐨勭増鍥�
- public List<TemperingGlassInfo> SelectIntoGlass() {
- List<TemperingGlassInfo> IntoGlass = temperingMapper.SelectInGlass();
- return IntoGlass;
- }
-}
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java
index 4e00b7f..0e8c654 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/service/impl/TemperingAgoServiceImpl.java
@@ -1,9 +1,7 @@
package com.mes.temperingglass.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.yulichang.query.MPJQueryWrapper;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.mapper.TemperingGlassInfoMapper;
import com.mes.temperingglass.mapper.TemperingMapper;
@@ -11,8 +9,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.yulichang.base.MPJBaseServiceImpl;
-
-import java.util.Collections;
import java.util.List;
/**
@@ -24,6 +20,7 @@
* @since 2024-04-07
*/
@Service
+@DS("salve_hangzhoumes")
public class TemperingAgoServiceImpl extends MPJBaseServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingAgoService {
@Autowired
TemperingMapper temperingMapper;
@@ -32,7 +29,8 @@
public List<TemperingGlassInfo> selectWaitingGlass() {
//鑾峰彇绛夊緟杩涚倝涓殑鐜荤拑淇℃伅
QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>();
- wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info GROUP BY flowcard_id,state having count(state) = 2");
+ //wrapper.eq("state",1);
+ wrapper.in("state",1,0);
return temperingMapper.selectList(wrapper);
}
@@ -40,16 +38,30 @@
public List<TemperingGlassInfo> selectIntoGlass() {
//鑾峰彇杩涚倝涓殑鐜荤拑淇℃伅
QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>();
- wrapper.inSql("flowcard_id", "select flowcard_id from tempering_glass_info where state=1 GROUP BY flowcard_id,state having count(state) = 1");
-
+ wrapper.eq("state",2)
+ .orderByAsc("tempering_layout_id","tempering_feed_sequence");
return temperingMapper.selectList(wrapper);
}
@Override
- public List<TemperingGlassInfo> SelectOutGlass() {
+ public List<TemperingGlassInfo> selectOutGlass() {
//鑾峰彇鍑虹倝涓殑鐜荤拑淇℃伅
QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>();
- wapper.eq("state", 3);
+ wapper.eq("state", 3)
+ .orderByAsc("tempering_layout_id","tempering_feed_sequence");
return temperingMapper.selectList(wapper);
}
+
+ @Override
+ public List<TemperingGlassInfo> selectOverGlass() {
+ //鑾峰彇杩囨棆杞彴鏈�澶х殑閽㈠寲鐗堝浘id
+ QueryWrapper<TemperingGlassInfo> wapper = new QueryWrapper<>();
+ wapper.select("top 1 *").eq("state", 4)
+ .orderByDesc("tempering_layout_id");
+ //鏍规嵁鏈�澶х殑鐗堝浘id鏄剧ず閽㈠寲鍚庣殑鐗堝浘淇℃伅
+ TemperingGlassInfo glassinfo= temperingMapper.selectOne(wapper);
+ QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>();
+ wrapper.eq("tempering_layout_id",glassinfo.getTemperingLayoutId());
+ return temperingMapper.selectList(wrapper);
+ }
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-cz.yml
similarity index 77%
copy from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
copy to hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-cz.yml
index 2454814..0b433b2 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-cz.yml
@@ -5,12 +5,13 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
+
salve_hangzhoumes:
- url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes
username: sa
password: beibo.123/
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
@@ -18,6 +19,8 @@
nacos:
discovery:
server-addr: 127.0.0.1:8848
+ application:
+ name: temperingGlass
redis:
database: 0
host: 127.0.0.1
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-dev.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-dev.yml
index f02ebee..a5bc31d 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-dev.yml
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-dev.yml
@@ -9,6 +9,11 @@
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
cloud:
nacos:
discovery:
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-loc.yml
deleted file mode 100644
index 1e4042f..0000000
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-loc.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-spring:
- datasource:
- dynamic:
- primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
- strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
- datasource:
- hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
- username: root
- password: root
- driver-class-name: com.mysql.cj.jdbc.Driver
- cloud:
- nacos:
- discovery:
- server-addr: 127.0.0.1:8848
- application:
- name: temperingGlass
- redis:
- database: 0
- host: 127.0.0.1
- port: 6379
- password: 123456
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-prod.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-prod.yml
index 9fb2c6f..7aab87f 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-prod.yml
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application-prod.yml
@@ -9,6 +9,12 @@
username: root
password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
+
+ salve_hangzhoumes:
+ url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes
+ username: sa
+ password: beibo.123/
+ driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
cloud:
nacos:
discovery:
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
index e9fcc1e..0a70a4a 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
@@ -2,7 +2,7 @@
port: 8084
spring:
profiles:
- active: prod
+ active: cz
application:
name: temperingGlass
mybatis-plus:
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
index 11fb3d2..422b941 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/test/java/com/mes/TemperingApplicationTest.java
@@ -10,7 +10,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
-
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
@@ -25,12 +24,8 @@
@SpringBootTest(classes = TemperingGlassModuleApplication.class)
public class TemperingApplicationTest {
- @Resource
- private OptimizeProjectMapper optimizeProjectMapper;
@Autowired
private TemperingAgoService temperingAgoService;
- @Autowired
- private GlassInfoService glassInfoService;
@Test
@@ -40,7 +35,7 @@
}
@Test
public void testFindPa2() {
- List<TemperingGlassInfo> glass = temperingAgoService.SelectOutGlass();
+ List<TemperingGlassInfo> glass = temperingAgoService.selectOutGlass();
log.info("宸插嚭涓殑鐜荤拑锛歿}", Arrays.asList(glass));
}
@@ -49,4 +44,9 @@
List<TemperingGlassInfo> glass = temperingAgoService.selectWaitingGlass();
log.info("绛夊緟涓殑鐜荤拑锛歿}", Arrays.asList(glass));
}
+ @Test
+ public void testFindPa4() {
+ List<TemperingGlassInfo> glass = temperingAgoService.selectOverGlass();
+ log.info("绛夊緟涓殑鐜荤拑锛歿}", Arrays.asList(glass));
+ }
}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/AppRunnerConfig.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/AppRunnerConfig.java
index 252ad6f..0f18b76 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/AppRunnerConfig.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/AppRunnerConfig.java
@@ -1,6 +1,6 @@
package com.mes;
-import com.mes.common.S7object;
+//import com.mes.common.S7object;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java
index 5737bd6..2f56341 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/controller/DownStorageCageDetailsController.java
@@ -21,7 +21,7 @@
private DownStorageCageDetailsService downStorageCageDetailsService;
@Autowired
private DownStorageCageService downStorageCageService;
-
+ @ApiOperation("娣诲姞鐜荤拑")
@PostMapping("/add")
public String addDownStorageCageDetails(@RequestBody DownStorageCageDetails details) {
downStorageCageDetailsService.addDownStorageCageDetails(details);
@@ -56,7 +56,7 @@
@ResponseBody
public Result updateDownStorageCage(@RequestBody DownStorageCage downStorageCage) {
boolean isSucess=downStorageCageService.updateDownStorageCage(downStorageCage);
- return Result.build(200,"鏇存崲鎴愬姛",1);
+ return Result.build(200,"鏇存崲鎴愬姛",isSucess);
}
@ApiOperation("鍒犻櫎缂撳瓨鐞嗙墖绗间俊鎭� 鍔熻兘锛氬绗煎唴鏍呮牸鐜荤拑杩涜銆愭竻闄ゃ��")
@PostMapping("/deleteDownStorageCage")
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
index ba78936..38e5f48 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/DownStorageCageDetailsService.java
@@ -46,7 +46,7 @@
* @param end
* @return log.info(" 鍗曠墖鎯呭喌鏍规嵁浼犲叆鐨勫伐浣嶆煡璇㈢鍚堟寜鐓уぇ灏忓嚭鐗�, 骞朵笖浼樺厛鍑烘弧鏋剁殑灏忕墖 ");
*/
- List<DownStorageCageDetails> CacheOut(int start, int end);
+
/**
* @return 鍑虹墖
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
index 225e002..0696121 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageDetailsServiceImpl.java
@@ -56,24 +56,24 @@
}
- @Override
- public List<DownStorageCageDetails> CacheOut(int start, int end) {
- log.info("鍗曠墖鎯呭喌鏍规嵁浼犲叆鐨勫伐浣嶆煡璇㈢鍚堟寜鐓уぇ灏忓嚭鐗�,骞朵笖浼樺厛鍑烘弧鏋剁殑灏忕墖");
- return downStorageCageDetailsMapper.selectJoinList(
- DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
- .select("t.*")
- .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 "
- + "JOIN (SELECT flow_card_id, MAX(width*height) AS max_width FROM glass_info GROUP BY flow_card_id) t "
- + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width*t1.height = t.max_width) t3"
- + " ON t.glass_id = t3.glass_id")
- .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id")
- .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info")
- .between("t4.workstation_id", start, end)
- // 鏍规嵁 racks_number 鎺掑簭
- .orderByDesc("t4.racks_number")
-
- );
- }
+// @Override
+// public List<DownStorageCageDetails> CacheOut(int start, int end) {
+// log.info("鍗曠墖鎯呭喌鏍规嵁浼犲叆鐨勫伐浣嶆煡璇㈢鍚堟寜鐓уぇ灏忓嚭鐗�,骞朵笖浼樺厛鍑烘弧鏋剁殑灏忕墖");
+// return downStorageCageDetailsMapper.selectJoinList(
+// DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>()
+// .select("t.*")
+// .leftJoin("(SELECT t1.* FROM down_storage_cage_details t1 "
+// + "JOIN (SELECT flow_card_id, MAX(width*height) AS max_width FROM glass_info GROUP BY flow_card_id) t "
+// + "ON t1.flow_card_id = t.flow_card_id WHERE t1.width*t1.height = t.max_width) t3"
+// + " ON t.glass_id = t3.glass_id")
+// .leftJoin("down_workstation t4 ON t3.flow_card_id = t4.flow_card_id")
+// .isNull(Boolean.parseBoolean("t.glass_id"), "SELECT glass_id FROM down_glass_info")
+// .between("t4.workstation_id", start, end)
+// // 鏍规嵁 racks_number 鎺掑簭
+// .orderByDesc("t4.racks_number")
+//
+// );
+// }
// @Override
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java
index e580072..53d6be3 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/service/impl/DownStorageCageServiceImpl.java
@@ -5,7 +5,7 @@
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.mes.device.PlcParameterObject;
+//import com.mes.device.PlcParameterObject;
import com.mes.downglassinfo.entity.DownGlassTask;
import com.mes.downglassinfo.service.DownGlassTaskService;
import com.mes.downstorage.entity.DownStorageCage;
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
new file mode 100644
index 0000000..66f6dee
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/controller/EngineeringController.java
@@ -0,0 +1,29 @@
+package com.mes.engineering.controller;
+
+
+import com.mes.engineering.entity.Engineering;
+import com.mes.engineering.service.EngineeringService;
+
+import com.mes.utils.Result;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 鍓嶇鎺у埗鍣�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-22
+ */
+@RestController
+@Slf4j
+@RequestMapping("/engineering/engineering")
+public class EngineeringController {
+
+}
+
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
new file mode 100644
index 0000000..586a7b3
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/entity/Engineering.java
@@ -0,0 +1,100 @@
+package com.mes.engineering.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Engineering implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 宸ョ▼琛╥d
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ private String engineerId;
+
+ /**
+ * 宸ョ▼鍚嶇О
+ */
+ private String engineerName;
+
+ /**
+ * 骞冲潎鍒╃敤鐜�
+ */
+ private Double avgAvailability;
+
+ /**
+ * 鏈夋晥鍒╃敤鐜�
+ */
+ private Double validAvailability;
+
+ /**
+ * 灏剧墖鍒╃敤鐜�
+ */
+ private Double lastAvailability;
+
+ /**
+ * 鐘舵��
+ */
+ private Integer state;
+
+ /**
+ * 灏忕墖鎬绘暟
+ */
+ private Integer glassTotal;
+
+ /**
+ * 灏忕墖鎬婚潰绉�
+ */
+ private Double glassTotalArea;
+
+ /**
+ * 璁″垝鍘熺墖鎬绘暟
+ */
+ private Integer planPatternTotal;
+
+ /**
+ * 璁″垝鍘熺墖鎬婚潰绉�
+ */
+ private Double planPatternTotalArea;
+
+ /**
+ * 瀹為檯鍘熺墖鎬绘暟
+ */
+ private Integer realityPatternTotal;
+
+ /**
+ * 瀹為檯鍘熺墖鎬婚潰绉�
+ */
+ private Double realityPatternTotalArea;
+
+ /**
+ * 鑶滅郴id
+ */
+ private String filmsId;
+
+ /**
+ * 澶囨敞
+ */
+ private String notes;
+
+
+}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/EngineeringMapper.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/EngineeringMapper.java
new file mode 100644
index 0000000..d92eae7
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/EngineeringMapper.java
@@ -0,0 +1,17 @@
+package com.mes.engineering.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.mes.engineering.entity.Engineering;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-22
+ */
+public interface EngineeringMapper extends MPJBaseMapper<Engineering> {
+
+}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/xml/EngineeringMapper.xml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/xml/EngineeringMapper.xml
new file mode 100644
index 0000000..bff1839
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/mapper/xml/EngineeringMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mes.engineering.mapper.EngineeringMapper">
+
+</mapper>
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
new file mode 100644
index 0000000..f453b11
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/EngineeringService.java
@@ -0,0 +1,20 @@
+package com.mes.engineering.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.engineering.entity.Engineering;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-22
+ */
+public interface EngineeringService extends IService<Engineering> {
+
+
+
+}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
new file mode 100644
index 0000000..1feaa37
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/engineering/service/impl/EngineeringServiceImpl.java
@@ -0,0 +1,33 @@
+package com.mes.engineering.service.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.engineering.entity.Engineering;
+import com.mes.engineering.mapper.EngineeringMapper;
+import com.mes.engineering.service.EngineeringService;
+import com.mes.pp.entity.OptimizeProject;
+import com.mes.pp.mapper.OptimizeProjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-04-22
+ */
+@Service
+@Slf4j
+public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engineering> implements EngineeringService {
+
+
+
+}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
index 27d9263..7bfe24e 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/mapper/GlassInfoMapper.java
@@ -1,6 +1,7 @@
package com.mes.glassinfo.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
import com.mes.glassinfo.entity.GlassInfo;
import org.mapstruct.Mapper;
@@ -13,7 +14,7 @@
* @since 2024-03-27
*/
@Mapper
-public interface GlassInfoMapper extends BaseMapper<GlassInfo> {
+public interface GlassInfoMapper extends MPJBaseMapper<GlassInfo> {
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
index 58bb4b0..cd2bc4d 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -1,7 +1,13 @@
package com.mes.glassinfo.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.toolkit.JoinWrappers;
+import com.mes.downstorage.entity.DownStorageCage;
+import com.mes.downstorage.entity.DownStorageCageDetails;
+import com.mes.engineering.entity.Engineering;
+import com.mes.engineering.mapper.EngineeringMapper;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.glassinfo.service.GlassInfoService;
@@ -22,11 +28,13 @@
@Service
public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService {
+ private EngineeringMapper engineeringMapper;
private GlassInfoMapper glassInfoMapper;
@Autowired(required=false)
- public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper) {
+ public GlassInfoServiceImpl(GlassInfoMapper glassInfoMapper, EngineeringMapper engineeringMapper) {
this.glassInfoMapper = glassInfoMapper;
+ this.engineeringMapper = engineeringMapper;
}
@Override
@@ -36,15 +44,26 @@
}
+
@Override
public List<Map<String, Object>> getFlowCardId() {
- return baseMapper.selectMaps(new QueryWrapper<GlassInfo>().lambda().select(GlassInfo::getFlowCardId).groupBy(GlassInfo::getFlowCardId));
+ return baseMapper.selectJoinMaps(JoinWrappers.lambda(GlassInfo.class)
+ .select(GlassInfo::getFlowCardId)
+ .leftJoin(Engineering.class, on -> on
+ .eq(Engineering::getEngineerId, GlassInfo::getEngineerId)
+ .eq(Engineering::getState, 0)
+ )
+ .groupBy(GlassInfo::getFlowCardId)
+ );
}
+
+
+
@Override
public GlassInfo selectGlassId(String id) {
return baseMapper.selectOne(new QueryWrapper<GlassInfo>().lambda()
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownCacheGlassTask.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownCacheGlassTask.java
index 8be3a8d..e858451 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownCacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownCacheGlassTask.java
@@ -146,8 +146,6 @@
}else{
log.info("4銆佸鏋滀笉灞炰簬鐗堝浘id鍜岀墖搴忕殑椤哄簭鎵ц杩涚墖浠诲姟");
-
-
//娣诲姞杩涚墖浠诲姟 鏌ユ壘绌烘牸
List<DownStorageCageDetails> list = downStorageCageService.selectCacheEmpty();
if(list.size()>0){
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
index 308599c..0b65991 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -1,6 +1,7 @@
package com.mes.job;
import cn.hutool.json.JSONObject;
+import com.mes.downstorage.service.DownStorageCageService;
import com.mes.downworkstation.entity.DownWorkstation;
import com.mes.downworkstation.service.DownWorkstationService;
import com.mes.tools.WebSocketServer;
@@ -17,52 +18,78 @@
@Component
public class Downpush {
-
@Autowired
private DownWorkstationService downWorkstationService;
- @Scheduled(fixedDelay = 1000)
- public void Downpush() {
+ @Autowired
+ private DownStorageCageService downStorageCageService;
-
+ @Scheduled(fixedDelay = 2000)
+ public void sendDownWorkstations() {
+ log.info("鍙戦�佸伐浣嶇幓鐠冧俊鎭�");
JSONObject jsonObject = new JSONObject();
- JSONObject jsonObject2 = new JSONObject();
- JSONObject jsonObject3 = new JSONObject();
List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1,6);
- List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
- List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
jsonObject.append("params",data);
- jsonObject2.append("glassinfo",glassinfodata);
- jsonObject3.append("glassinfo2",glassinfodata2);
log.info(jsonObject.toString());
ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
- ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
- ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
- // log.info(sendwServer.toString());
if (sendwServer != null) {
for (WebSocketServer webserver : sendwServer) {
-
if (webserver != null&&webserver.session.isOpen()) {
+ log.info("宸插彂閫�");
webserver.sendMessage(jsonObject.toString());
}
}
}
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void sendGlassInfoData() {
+ log.info("鍙戦�佸伐浣嶆樉绀哄浘淇℃伅1");
+ JSONObject jsonObject2 = new JSONObject();
+ List<Map<String, Object>> glassinfodata = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
+ jsonObject2.append("glassinfo",glassinfodata);
+ log.info(jsonObject2.toString());
+ ArrayList<WebSocketServer> sendwServer2 = WebSocketServer.sessionMap.get("unloadglass2");
if (sendwServer2 != null) {
for (WebSocketServer webserver : sendwServer2) {
-
if (webserver != null&&webserver.session.isOpen()) {
webserver.sendMessage(jsonObject2.toString());
}
}
}
+ }
+
+ @Scheduled(fixedDelay = 1000)
+ public void sendGlassInfoData2() {
+ log.info("鍙戦�佸伐浣嶆樉绀哄浘淇℃伅2");
+ JSONObject jsonObject3 = new JSONObject();
+ List<Map<String, Object>> glassinfodata2 = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
+ jsonObject3.append("glassinfo2",glassinfodata2);
+ log.info(jsonObject3.toString());
+ ArrayList<WebSocketServer> sendwServer3 = WebSocketServer.sessionMap.get("unloadglass3");
if (sendwServer3 != null) {
for (WebSocketServer webserver : sendwServer3) {
-
if (webserver != null&&webserver.session.isOpen()) {
webserver.sendMessage(jsonObject3.toString());
}
}
}
+ }
+ @Scheduled(fixedDelay = 2000)
+ public void sendDownStorageCages() {
+ log.info("鍙戦�佺紦瀛樼幓鐠冧俊鎭�");
+ JSONObject jsonObject4 = new JSONObject();
+ List<Map<String, Object>> list=downStorageCageService.selectDownStorageCages();
+ jsonObject4.append("params2",list);
+ log.info(jsonObject4.toString());
+ ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("downcache");
+ if (sendwServer4 != null) {
+ for (WebSocketServer webserver : sendwServer4) {
+ if (webserver != null&&webserver.session.isOpen()) {
+ webserver.sendMessage(jsonObject4.toString());
+ }
+ }
+ }
}
}
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-cz.yml
similarity index 80%
rename from hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
rename to hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-cz.yml
index 2454814..c4c456e 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application-loc.yml
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-cz.yml
@@ -5,12 +5,12 @@
strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
datasource:
hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
+ url: jdbc:mysql://192.168.1.199:3306/hangzhoumes?serverTimezone=GMT%2b8
username: root
- password: root
+ password: beibo.123/
driver-class-name: com.mysql.cj.jdbc.Driver
salve_hangzhoumes:
- url: jdbc:sqlserver://127.0.0.1:1433;databasename=hangzhoumes
+ url: jdbc:sqlserver://192.168.10.2:1433;databasename=hangzhoumes
username: sa
password: beibo.123/
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
@@ -22,4 +22,4 @@
database: 0
host: 127.0.0.1
port: 6379
- password: 123456
\ No newline at end of file
+ password: 123456
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-loc.yml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-loc.yml
deleted file mode 100644
index fadf3bf..0000000
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-loc.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-spring:
- datasource:
- dynamic:
- primary: hangzhoumes #璁剧疆榛樿鐨勬暟鎹簮鎴栬�呮暟鎹簮缁�,榛樿鍊煎嵆涓簃aster
- strict: false #璁剧疆涓ユ牸妯″紡,榛樿false涓嶅惎鍔�. 鍚姩鍚庡湪鏈尮閰嶅埌鎸囧畾鏁版嵁婧愭椂鍊欏洖鎶涘嚭寮傚父,涓嶅惎鍔ㄤ細浣跨敤榛樿鏁版嵁婧�.
- datasource:
- hangzhoumes:
- url: jdbc:mysql://192.168.56.10:3306/hangzhoumes?serverTimezone=GMT%2b8
- username: root
- password: root
- driver-class-name: com.mysql.cj.jdbc.Driver
- salve_hangzhoumes:
- url: jdbc:sqlserver://192.168.56.10:1433;databasename=hangzhoumes
- username: sa
- password: beibo.123/
- driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
- cloud:
- nacos:
- discovery:
- server-addr: 127.0.0.1:8848
- redis:
- database: 0
- host: 127.0.0.1
- port: 6379
- password: 123456
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
index 5d44c2f..46db88a 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -3,7 +3,7 @@
spring:
profiles:
- active: prod
+ active: cz
application:
name: unLoadGlass
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
index 09de05d..e363838 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
@@ -3,20 +3,27 @@
import com.mes.UnLoadGlassApplication;
import com.mes.downglassinfo.service.impl.DownGlassInfoServiceImpl;
import com.mes.downglassinfo.service.impl.DownGlassTaskServiceImpl;
+import com.mes.downstorage.entity.DownStorageCage;
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.downstorage.service.DownStorageCageDetailsService;
+import com.mes.downstorage.service.DownStorageCageService;
import com.mes.downstorage.service.impl.DownStorageCageDetailsServiceImpl;
import com.mes.downstorage.service.impl.DownStorageCageServiceImpl;
import com.mes.downworkstation.service.DownWorkstationService;
import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl;
import com.mes.glassinfo.service.impl.GlassInfoServiceImpl;
+import com.mes.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Arrays;
import java.util.List;
@@ -30,6 +37,7 @@
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = UnLoadGlassApplication.class)
+
public class UnloadGlassModuleApplicationTest {
@Autowired
@@ -48,6 +56,11 @@
GlassInfoServiceImpl glassInfoServiceImpl;
@Autowired
DownWorkstationService downWorkstationService;
+ @Autowired
+ DownStorageCageService downStorageCageService;
+
+
+
@Test
public void testFindPath() {
@@ -106,12 +119,15 @@
}
- @Test
- public void CacheEmpty() {
- log.info("娴嬭瘯鍑虹墖");
- downStorageCageDetailsService.CacheOut(1,2);
+// @Test
+// public void CacheEmpty() {
+// log.info("娴嬭瘯鍑虹墖");
+// downStorageCageDetailsService.CacheOut(1,2);
+//
+// }
- }
+
+
@Test
public void CacheEmpty1() {
log.info("娴嬭瘯鍑虹墖");
@@ -152,5 +168,23 @@
downStorageCageServiceImpl.selectCacheEmpty();
}
+ @Test
+ public void getFlowCardId() {
+
+
+ glassInfoServiceImpl.getFlowCardId();
+ }
+
+ @Test
+ public void updateDownStorageCage() {
+
+
+ DownStorageCage downStorageCage= new DownStorageCage();
+ downStorageCage.setEnableState("0");
+ downStorageCage.setId(1);
+ downStorageCageService.updateDownStorageCage(downStorageCage);
+
+ }
+
}
\ No newline at end of file
--
Gitblit v1.8.0