From 26229b3779579ca0d413fa75b69e32795a5cfb30 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期一, 09 九月 2024 11:23:03 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java | 4
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java | 5
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml | 8
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/BarcodeReadThread.java | 82 +++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictTypeMapper.java | 16
hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml | 2
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java | 108 +++-
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/EdgStorageCageDetailsService.java | 2
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java | 25 +
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 221 +++++----
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java | 21
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictData.java | 48 ++
hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java | 2
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcStorageCageTask.java | 27
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java | 160 ++++--
hangzhoumesParent/common/servicebase/pom.xml | 6
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java | 104 ++++
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml | 2
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictType.java | 43 +
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml | 9
UI-Project/config.js | 8
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/CacheGlassTask.java | 8
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictDataService.java | 16
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/AsyncTaskExecutorConfig.java | 51 ++
UI-Project/src/utils/constants.js | 4
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml | 2
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java | 119 +++-
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictDataServiceImpl.java | 20
hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application.yml | 2
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictTypeServiceImpl.java | 20
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java | 21
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java | 9
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictDataMapper.java | 16
hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictTypeService.java | 16
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/changelog.sql | 156 ++++++
35 files changed, 1,136 insertions(+), 227 deletions(-)
diff --git a/UI-Project/config.js b/UI-Project/config.js
index 9a4f798..8801d0c 100644
--- a/UI-Project/config.js
+++ b/UI-Project/config.js
@@ -1,10 +1,10 @@
export default {
- serverUrl: "10.153.19.150:88/api",
+// serverUrl: "10.153.19.150:88/api",
// serverUrl: "192.168.1.199:88/api",
-// serverUrl: "127.0.0.1:88/api",
- serverUrl2: "10.153.19.150:88"
+ serverUrl: "127.0.0.1:88/api",
+ // serverUrl2: "10.153.19.150:88"
// serverUrl2: "192.168.1.199:88"
- // serverUrl2: "127.0.0.1:88"
+ serverUrl2: "127.0.0.1:88"
//serverUrl:"res.abeim.cn"
}
\ No newline at end of file
diff --git a/UI-Project/src/utils/constants.js b/UI-Project/src/utils/constants.js
index b551cfb..69000bc 100644
--- a/UI-Project/src/utils/constants.js
+++ b/UI-Project/src/utils/constants.js
@@ -1,4 +1,4 @@
// export const WebSocketHost = "192.168.1.199";
-export const WebSocketHost = "10.153.19.150";
-// export const WebSocketHost = "127.0.0.1";
+// export const WebSocketHost = "10.153.19.150";
+export const WebSocketHost = "127.0.0.1";
export const host = "88";
\ No newline at end of file
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index 513c5a5..c2c5ddc 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -1,26 +1,30 @@
<script setup>
-import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue";
-import {useRouter} from "vue-router"
-import {useI18n} from 'vue-i18n'
-import {ElMessage} from 'element-plus'
+import { onBeforeUnmount, onMounted, onUnmounted, reactive, ref } from "vue";
+import { useRouter } from "vue-router"
+import { useI18n } from 'vue-i18n'
+import { ElMessage } from 'element-plus'
import request from "@/utils/request";
-import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
-import {host, WebSocketHost} from '@/utils/constants'
+import { closeWebSocket, initializeWebSocket } from '@/utils/WebSocketService';
+import { host, WebSocketHost } from '@/utils/constants'
import PrintFlow from "@/views/UnLoadGlass/PrintFlow.vue";
import Landingindication from "./Landingindication.vue";
import Landingindicationtwo from "./Landingindicationtwo.vue";
import PrintLabel from "@/views/UnLoadGlass/PrintCustomLabelSemi1.vue";
const router = useRouter()
-const {t} = useI18n()
+const { t } = useI18n()
let language = ref(localStorage.getItem('lang') || 'zh')
const printLoading = ref(true)
const fullFlowCard = ref('')
const autoPrint = ref(false)
+const takeGlass = ref([])
+const scanGlass = ref([])
+
const dialogFormVisiblea = ref(false)
const dialogFormVisiblea2 = ref(false)
const dialogFormVisibleaDownGlass = ref(false)
+const dialogFormVisibleaDownGlasss = ref(false)
// 鏁版嵁
const loading = ref(false);
// 寮规鏄剧ず鎺у埗
@@ -42,7 +46,7 @@
const printLayer = ref('')
const now = new Date();
const timeRange = ref([])
-const browser=ref(false)
+const browser = ref(false)
const handleChange = async () => {
console.log("瑙﹀彂寮�鍏�")
@@ -65,14 +69,14 @@
console.error(error);
}
}
-const confirmBrowser = () =>{
+const confirmBrowser = () => {
if (/chrome|chromium/i.test(navigator.userAgent) && !/edg/i.test(navigator.userAgent)) {
- browser.value=true
-} else if (/edg/i.test(navigator.userAgent)) {
- browser.value=false
-} else {
- browser.value=false
-}
+ browser.value = true
+ } else if (/edg/i.test(navigator.userAgent)) {
+ browser.value = false
+ } else {
+ browser.value = false
+ }
}
const handleInputChangea = (value, rowId) => {
@@ -98,7 +102,7 @@
if (response.code === 200) {
flowCardOptions.value = response.data.filter(item => item !== null)
- .map(item => ({flowcard_id: item.flow_card_id}));
+ .map(item => ({ flowcard_id: item.flow_card_id }));
console.log(flowCardOptions.value);
}
else {
@@ -143,7 +147,7 @@
const handleBindRack2 = (row) => {
workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕
dialogFormVisiblea2.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
- workFlowCard.value=row.flowCardId;
+ workFlowCard.value = row.flowCardId;
};
//娓呴櫎鍐呭
const handleclear = async () => {
@@ -158,8 +162,8 @@
console.log('娓呴櫎鎴愬姛');
ElMessage.success(response.message);
dialogFormVisiblea2.value = false;
- if(fullFlowCard.value==workFlowCard.value){
- fullFlowCard.value="";
+ if (fullFlowCard.value == workFlowCard.value) {
+ fullFlowCard.value = "";
}
} else if (response.code === 500) {
// 娓呴櫎澶辫触鐨勯�昏緫
@@ -209,9 +213,15 @@
if (data.autoPrint != null) {
autoPrint.value = data.autoPrint[0];
}
+ if (data.takeGlass != null) {
+ takeGlass.value = data.takeGlass[0];
+ }
+ if (data.scanGlass != null) {
+ scanGlass.value = data.scanGlass[0];
+ }
//鑷姩鎵撳嵃
- if (fullFlowCard.value == ""&&autoPrint.value==true&&browser.value==true) {
+ if (fullFlowCard.value == "" && autoPrint.value == true && browser.value == true) {
for (let i = 0; i < tableData.length; i++) {
if (tableData[i].totalQuantity != 0) {
if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) {
@@ -225,7 +235,7 @@
}
}
}
- if(data.params!=null){
+ if (data.params != null) {
tableData.splice(0, tableData.length, ...data.params[0]);
}
@@ -304,19 +314,19 @@
printLayer.value = row.layer
dialogTableVisible.value = true;
setTimeout(() => {
- printFlowCard();
+ printFlowCard();
dialogTableVisible.value = false;
}, 2000);
}
const open1 = async (row) => {
-printFlowCardId.value = row.flowCardId;
-printLayer.value = row.layer
-dialogTableVisible1.value = true;
-setTimeout(() => {
- printFlowCard1();
- //dialogTableVisible1.value = false;
-}, 1000);
+ printFlowCardId.value = row.flowCardId;
+ printLayer.value = row.layer
+ dialogTableVisible1.value = true;
+ setTimeout(() => {
+ printFlowCard1();
+ //dialogTableVisible1.value = false;
+ }, 1000);
}
const printFlowCard = () => {
@@ -334,22 +344,22 @@
// 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
let style = doc.createElement("style");
- console.log("style1:"+style.innerHTML)
+ console.log("style1:" + style.innerHTML)
style.innerHTML =
- "body>#" +
- printId +
- "{display:none;}@media print{" +
- "@page {" +
- " size: auto; " +
- " margin: 10mm 5mm 10mm 5mm; " +
- " }body>:not(#" +
- printId +
- "){display:none !important;}body>#" +
- printId +
- "{display:block;}#" +
- printId +
- "{display: block; padding: 0; margin: 0; width: 100%; position: absolute; top: 0; left: 0; height: 100vh; box-sizing: border-box;}} ";
-
+ "body>#" +
+ printId +
+ "{display:none;}@media print{" +
+ "@page {" +
+ " size: auto; " +
+ " margin: 10mm 5mm 10mm 5mm; " +
+ " }body>:not(#" +
+ printId +
+ "){display:none !important;}body>#" +
+ printId +
+ "{display:block;}#" +
+ printId +
+ "{display: block; padding: 0; margin: 0; width: 100%; position: absolute; top: 0; left: 0; height: 100vh; box-sizing: border-box;}} ";
+
content.innerHTML = el.outerHTML;
// // console.log("el.outerHTML", el.outerHTML);
body.appendChild(style);
@@ -378,17 +388,17 @@
// 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
let style = doc.createElement("style");
style.innerHTML =
- "body>#" +
- printId +
- "{display:none}@media print{" +
- "@page {" +
- " size: auto; " +
- " margin: 2mm 2mm 2mm 2mm; " +
- " }body>:not(#" +
- printId +
- "){display:none !important}body>#" +
- printId +
- "{display:block;padding-top:1px}}";
+ "body>#" +
+ printId +
+ "{display:none}@media print{" +
+ "@page {" +
+ " size: auto; " +
+ " margin: 2mm 2mm 2mm 2mm; " +
+ " }body>:not(#" +
+ printId +
+ "){display:none !important}body>#" +
+ printId +
+ "{display:block;padding-top:1px}}";
//
content.innerHTML = el.outerHTML;
// // console.log("el.outerHTML", el.outerHTML);
@@ -415,24 +425,27 @@
<template>
<div>
<el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
- @click="dialogFormVisibleaDownGlass = true">钀芥灦璇︽儏
+ @click="dialogFormVisibleaDownGlass = true">钀芥灦璇︽儏
</el-button>
- <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2" :inactive-text="$t('鑷姩鎵撳嵃')"
- @change="handleChange"/>
+ <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
+ @click="dialogFormVisibleaDownGlasss = true">浜哄伐涓嬬墖
+ </el-button>
+ <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2"
+ :inactive-text="$t('鑷姩鎵撳嵃')" @change="handleChange" />
<el-card style="flex: 1;" v-loading="loading">
<el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
<el-table height="350px" ref="table" @selection-change="handleSelectionChange" :data="tableData"
- :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
- <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80"/>
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
+ <el-table-column prop="workstationId" align="center" :label="$t('reportWork.lowerbit')" min-width="80" />
<el-table-column prop="workstationId" align="center" :label="$t('reportWork.shelfnumber')"
- min-width="120"/>
- <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150"/>
+ min-width="120" />
+ <el-table-column prop="flowCardId" align="center" :label="$t('reportWork.cardnumber')" min-width="150" />
<el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')"
- min-width="120"/>
- <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120"/>
- <el-table-column prop="layer" align="center" label="灞傛暟" min-width="120"/>
- <el-table-column prop="otherNumber" align="center" label="浜哄伐涓嬬墖鏁�" min-width="120"/>
+ min-width="120" />
+ <el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" />
+ <el-table-column prop="layer" align="center" label="灞傛暟" min-width="120" />
+ <el-table-column prop="otherNumber" align="center" label="浜哄伐涓嬬墖鏁�" min-width="120" />
<!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> -->
<el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" />
<el-table-column align="center" :label="$t('reportWork.startstatus')" min-width="80" prop="enableState">
@@ -445,7 +458,7 @@
<el-table-column fixed="right" :label="$t('reportWork.operate')" align="center" width="400">
<template #default="scope">
<el-button size="mini" type="text" plain v-show="scope.row.enableState !== '宸插惎鐢�'"
- @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}
+ @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}
</el-button>
<el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear')
}}</el-button>
@@ -457,8 +470,7 @@
</el-table>
</div>
- <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%"
- :title="$t('searchOrder.cageinformation')">
+ <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('钀芥灦淇℃伅')">
<el-select v-model="selectValuesa[0]" filterable :placeholder="$t('璇烽�夋嫨宸ヤ綅')" clearable>
<el-option label="鍏ㄩ儴" value="0"></el-option>
<el-option label="1" value="1"></el-option>
@@ -471,35 +483,57 @@
</el-select>
<el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable
- @input="handleInputChangea($event, row.id)">
- <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item"/>
+ @input="handleInputChangea($event, row.id)">
+ <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" />
</el-select>
<span class="demonstration">鏃堕棿娈�</span>
- <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" value-format = "YYYY-MM-DD hh:mm:ss"
- end-placeholder="缁撴潫鏃ユ湡">
+ <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+ value-format="YYYY-MM-DD hh:mm:ss" end-placeholder="缁撴潫鏃ユ湡">
</el-date-picker>
<el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{
- $t('reportmanage.inquire')
- }}
+ $t('reportmanage.inquire')
+ }}
</el-button>
<el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass"
- :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
- <el-table-column prop="workStationId" align="center" :label="$t('宸ヤ綅鍙�')" min-width="80"/>
- <el-table-column prop="engineerId" align="center" :label="$t('宸ョ▼鍙�')" min-width="80"/>
- <el-table-column prop="flowCardId" align="center" :label="$t('娴佺▼鍗″彿')" min-width="80"/>
- <el-table-column prop="layer" align="center" :label="$t('灞�')" min-width="120"/>
- <el-table-column prop="sequence" align="center" :label="$t('椤哄簭')" min-width="150"/>
- <el-table-column prop="width" align="center" :label="$t('瀹�')" min-width="120"/>
- <el-table-column prop="height" align="center" :label="$t('楂�')" min-width="120"/>
- <el-table-column prop="Filmsid" align="center" :label="$t('鑶滅郴')" min-width="120"/>
- <el-table-column prop="thickness" align="center" label="鍘氬害" min-width="120"/>
- <el-table-column prop="glassId" align="center" :label="$t('鐜荤拑id')" min-width="120"/>
-
+ :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
+ <el-table-column prop="workStationId" align="center" :label="$t('宸ヤ綅鍙�')" min-width="80" />
+ <el-table-column prop="engineerId" align="center" :label="$t('宸ョ▼鍙�')" min-width="80" />
+ <el-table-column prop="flowCardId" align="center" :label="$t('娴佺▼鍗″彿')" min-width="80" />
+ <el-table-column prop="layer" align="center" :label="$t('灞�')" min-width="120" />
+ <el-table-column prop="sequence" align="center" :label="$t('椤哄簭')" min-width="150" />
+ <el-table-column prop="width" align="center" :label="$t('瀹�')" min-width="120" />
+ <el-table-column prop="height" align="center" :label="$t('楂�')" min-width="120" />
+ <el-table-column prop="Filmsid" align="center" :label="$t('鑶滅郴')" min-width="120" />
+ <el-table-column prop="thickness" align="center" label="鍘氬害" min-width="120" />
+ <el-table-column prop="glassId" align="center" :label="$t('鐜荤拑id')" min-width="120" />
</el-table>
</el-dialog>
-
+ <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('浜哄伐涓嬬墖淇℃伅')">
+ <div style="display:flex;justify-content: space-around;">
+ <el-card style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;">
+ <div
+ :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }">
+ <div style="font-size: 50px; text-align: center;">
+ <div>{{ takeGlass.flowCardId }}</div>
+ <div>{{ takeGlass.width }}</div>
+ <div>{{ takeGlass.height }}</div>
+ </div>
+ </div>
+ </el-card>
+ <el-card style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;">
+ <div
+ :style="{ width: scanGlass.width + 'px', height: scanGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (scanGlass.width > scanGlass.height ? scanGlass.width : scanGlass.height) + ')' }">
+ <div style="font-size: 50px; text-align: center;">
+ <div>{{ scanGlass.flowCardId }}</div>
+ <div>{{ scanGlass.width }}</div>
+ <div>{{ scanGlass.height }}</div>
+ </div>
+ </div>
+ </el-card>
+ </div>
+ </el-dialog>
</el-card>
<!-- workstationId: '1',
workstationId: '1005',
@@ -529,7 +563,7 @@
<el-form-item :label="$t('reportWork.cardnumbera')" :required="true" style="width: 25vw;">
<el-select v-model="flowCardId" :placeholder="$t('reportWork.incardnumber')">
<el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id"
- :value="item.flowcard_id"/>
+ :value="item.flowcard_id" />
</el-select>
</el-form-item>
</el-form>
@@ -556,13 +590,12 @@
</template>
</el-dialog>
- <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close >
+ <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close>
<print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer"
- style="width: 100%;height: 100%"/>
+ style="width: 100%;height: 100%" />
</el-dialog>
- <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close >
- <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer"
- style=""/>
+ <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close>
+ <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" style="" />
</el-dialog>
</template>
diff --git a/hangzhoumesParent/common/servicebase/pom.xml b/hangzhoumesParent/common/servicebase/pom.xml
index 4f1f015..ba1f75e 100644
--- a/hangzhoumesParent/common/servicebase/pom.xml
+++ b/hangzhoumesParent/common/servicebase/pom.xml
@@ -22,6 +22,12 @@
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
</dependency>
+
+ <dependency>
+ <groupId>org.liquibase</groupId>
+ <artifactId>liquibase-core</artifactId>
+ <version>3.8.1</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/AsyncTaskExecutorConfig.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/AsyncTaskExecutorConfig.java
new file mode 100644
index 0000000..c36aa7c
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/AsyncTaskExecutorConfig.java
@@ -0,0 +1,51 @@
+package com.mes.common.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.task.TaskExecutor;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * <p> @Title AsyncTaskExecutorConfig
+ * <p> @Description 寮傛绾跨▼姹犻厤缃�
+ *
+ * @author ACGkaka
+ * @date 2023/4/24 19:48
+ */
+@EnableAsync
+@Configuration
+public class AsyncTaskExecutorConfig {
+
+ /**
+ * 鏍稿績绾跨▼鏁帮紙绾跨▼姹犵淮鎶ょ嚎绋嬬殑鏈�灏忔暟閲忥級
+ */
+ private int corePoolSize = 10;
+ /**
+ * 鏈�澶х嚎绋嬫暟锛堢嚎绋嬫睜缁存姢绾跨▼鐨勬渶澶ф暟閲忥級
+ */
+ private int maxPoolSize = 200;
+ /**
+ * 闃熷垪鏈�澶ч暱搴�
+ */
+ private int queueCapacity = 10;
+
+ @Bean
+ public TaskExecutor taskExecutor() {
+ ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+ executor.setCorePoolSize(corePoolSize);
+ executor.setMaxPoolSize(maxPoolSize);
+ executor.setQueueCapacity(queueCapacity);
+ executor.setThreadNamePrefix("MyExecutor-");
+ // for passing in request scope context 杞崲璇锋眰鑼冨洿鐨勪笂涓嬫枃
+// executor.setTaskDecorator(new ContextCopyingDecorator());
+ // rejection-policy锛氬綋pool宸茬粡杈惧埌max size鐨勬椂鍊欙紝濡備綍澶勭悊鏂颁换鍔�
+ // CALLER_RUNS锛氫笉鍦ㄦ柊绾跨▼涓墽琛屼换鍔★紝鑰屾槸鏈夎皟鐢ㄨ�呮墍鍦ㄧ殑绾跨▼鏉ユ墽琛�
+ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+ executor.setWaitForTasksToCompleteOnShutdown(true);
+ executor.initialize();
+ return executor;
+ }
+}
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 de75c86..011919a 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
@@ -171,4 +171,13 @@
public static final Integer SLOT_ON = 1;
public static final Integer SLOT_OFF = 0;
+ /**
+ * 涓嬬墖浠诲姟鐜荤拑鐘舵��
+ * 鐢熸垚浠诲姟0
+ * 鍑虹墖浠诲姟2
+ */
+ public static final Integer UNLOAD_GLASS_CREATE = 0;
+ public static final Integer UNLOAD_GLASS_OUT = 1;
+ public static final Integer UNLOAD_GLASS_DOWN = 2;
+
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
index 6ef464d..f7feafb 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/entity/GlassInfo.java
@@ -144,7 +144,7 @@
/**
* 鏄惁鍚堝苟
*/
- private Integer merge;
+ private Integer combine;
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
index dd2be16..b372378 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/glassinfo/service/impl/GlassInfoServiceImpl.java
@@ -43,7 +43,7 @@
.select("b.process_id,t.glass_type,b.o_width,b.o_height,t.glass_thickness,b.order_sort,b.p_width,b.p_height,b.layer, b.total_layer, b.stock_id,b.heat_layout_id,b.heat_layout_sort,c.x_axis,c.y_axis,b.project_no,b.glass_id,c.rotate_angle,d.merge")
.leftJoin("optimize_detail b on t.project_no=b.project_no")
.leftJoin("optimize_heat_detail c on c.project_no=t.project_no and b.heat_layout_id=c.layout_id and b.heat_layout_sort=c.sort")
- .leftJoin("flow_card d on d.process_id=b.process_id and d.layers_number=b.layer")
+ .leftJoin("flow_card d on d.process_id=b.process_id and d.technology_number=b.layer and d.order_number=b.order_sort ")
//.eq("t.state",100)
.eq("t.project_no", engineeringId));
}
@@ -73,7 +73,7 @@
glassInfo.setYCoordinate(map.getYAxis());
glassInfo.setAngle(map.getRotateAngle());
glassInfo.setGlassId(map.getGlassId());
- glassInfo.setMerge(map.getMerge());
+ glassInfo.setCombine(map.getMerge());
// 灏嗘槧灏勫悗鐨勫璞℃坊鍔犲埌缁撴灉鍒楄〃涓�
resultList.add(glassInfo);
}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictData.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictData.java
new file mode 100644
index 0000000..3820907
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictData.java
@@ -0,0 +1,48 @@
+package com.mes.sysdict.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SysDictData implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "dict_id", type = IdType.AUTO)
+ private Long dictId;
+
+ private Integer dictSort;
+
+ private String dictLabel;
+
+ private String dictValue;
+
+ private String dictType;
+
+ private String dictTypeValue;
+
+ private String state;
+
+ private String description;
+
+ private Date createTime;
+
+ @TableLogic
+ private String deleted;
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictType.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictType.java
new file mode 100644
index 0000000..43daa00
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/entity/SysDictType.java
@@ -0,0 +1,43 @@
+package com.mes.sysdict.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class SysDictType implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "dict_id", type = IdType.AUTO)
+ private Long dictId;
+
+ private String dictName;
+
+ private String dictType;
+
+ private String state;
+
+ private String description;
+
+ private LocalDateTime createTime;
+
+ @TableLogic
+ private String deleted;
+
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictDataMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictDataMapper.java
new file mode 100644
index 0000000..a011425
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictDataMapper.java
@@ -0,0 +1,16 @@
+package com.mes.sysdict.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.sysdict.entity.SysDictData;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+public interface SysDictDataMapper extends BaseMapper<SysDictData> {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictTypeMapper.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictTypeMapper.java
new file mode 100644
index 0000000..3511141
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/mapper/SysDictTypeMapper.java
@@ -0,0 +1,16 @@
+package com.mes.sysdict.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mes.sysdict.entity.SysDictType;
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+public interface SysDictTypeMapper extends BaseMapper<SysDictType> {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictDataService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictDataService.java
new file mode 100644
index 0000000..6666218
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictDataService.java
@@ -0,0 +1,16 @@
+package com.mes.sysdict.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.mes.sysdict.entity.SysDictData;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+public interface SysDictDataService extends MPJBaseService<SysDictData> {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictTypeService.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictTypeService.java
new file mode 100644
index 0000000..5280402
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/SysDictTypeService.java
@@ -0,0 +1,16 @@
+package com.mes.sysdict.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.sysdict.entity.SysDictType;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+public interface SysDictTypeService extends IService<SysDictType> {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictDataServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictDataServiceImpl.java
new file mode 100644
index 0000000..126574e
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictDataServiceImpl.java
@@ -0,0 +1,20 @@
+package com.mes.sysdict.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.sysdict.entity.SysDictData;
+import com.mes.sysdict.mapper.SysDictDataMapper;
+import com.mes.sysdict.service.SysDictDataService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+@Service
+public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDictData> implements SysDictDataService {
+
+}
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictTypeServiceImpl.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictTypeServiceImpl.java
new file mode 100644
index 0000000..519e1ad
--- /dev/null
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/sysdict/service/impl/SysDictTypeServiceImpl.java
@@ -0,0 +1,20 @@
+package com.mes.sysdict.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mes.sysdict.entity.SysDictType;
+import com.mes.sysdict.mapper.SysDictTypeMapper;
+import com.mes.sysdict.service.SysDictTypeService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author wu
+ * @since 2024-09-05
+ */
+@Service
+public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements SysDictTypeService {
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
new file mode 100644
index 0000000..60a62f6
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/entity/BigStorageCageDetails.java
@@ -0,0 +1,104 @@
+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.base.entity.BigStorageCageBaseInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-03-27
+ */
+@Api(description = "澶х悊鐗囩璇︽儏")
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BigStorageCageDetails extends BigStorageCageBaseInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 澶х悊鐗囩璇︽儏琛╥d
+ */
+ @ApiModelProperty(value = "澶х悊鐗囩璇︽儏琛╥d", position = 2)
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 璁惧id
+ */
+ @ApiModelProperty(value = "璁惧id", position = 3)
+ private Integer deviceId;
+
+
+ /**
+ * 灏忕墖鍦ㄦ牸鍐呯殑椤哄簭
+ */
+ @ApiModelProperty(value = "灏忕墖鍦ㄦ牸鍐呯殑椤哄簭", position = 6)
+ private Integer sequence;
+
+ /**
+ * 娴佺▼鍗″彿
+ */
+ @ApiModelProperty(value = "娴佺▼鍗″彿", position = 7)
+ private String flowCardId;
+
+ /**
+ * 鐜荤拑绫诲瀷
+ */
+ @ApiModelProperty(value = "鐜荤拑绫诲瀷", position = 8)
+ private Integer glassType;
+
+
+ /**
+ * 鍘氬害
+ */
+ @ApiModelProperty(value = "鍘氬害", position = 11)
+ private double thickness;
+
+ /**
+ * 閽㈠寲鐗堝浘id
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘id", position = 12)
+ private Integer temperingLayoutId;
+
+ /**
+ * 閽㈠寲鐗堝浘鐗囧簭
+ */
+ @ApiModelProperty(value = "閽㈠寲鐗堝浘鐗囧簭", position = 13)
+ private Integer temperingFeedSequence;
+
+ /**
+ * 鐘舵��
+ */
+ @ApiModelProperty(value = "鐘舵��", position = 14)
+ private Integer state;
+
+ /**
+ * 鐜荤拑闂撮殭
+ */
+ @ApiModelProperty(value = "鐜荤拑闂撮殭", position = 15)
+ private Integer gap;
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ @ApiModelProperty(value = "宸ョ▼鍙�", position = 16)
+ private String engineerId;
+
+ /**
+ * 宸ョ▼鍙�
+ */
+ @ApiModelProperty(value = "灞�", position = 17)
+ private int layer;
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
new file mode 100644
index 0000000..ba90beb
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/mapper/BigStorageCageDetailsMapper.java
@@ -0,0 +1,21 @@
+package com.mes.bigstorage.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+
+/**
+ * <p>
+ * Mapper 鎺ュ彛
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-03-27
+ */
+public interface BigStorageCageDetailsMapper extends MPJBaseMapper<BigStorageCageDetails> {
+
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
new file mode 100644
index 0000000..d5641b1
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/BigStorageCageDetailsService.java
@@ -0,0 +1,21 @@
+package com.mes.bigstorage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.glassinfo.entity.GlassInfo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 鏈嶅姟绫�
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-03-27
+ */
+public interface BigStorageCageDetailsService extends IService<BigStorageCageDetails> {
+
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
new file mode 100644
index 0000000..6d8f195
--- /dev/null
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -0,0 +1,25 @@
+package com.mes.bigstorage.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 鏈嶅姟瀹炵幇绫�
+ * </p>
+ *
+ * @author zhoush
+ * @since 2024-03-27
+ */
+@Slf4j
+@Service
+public class BigStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<BigStorageCageDetailsMapper, BigStorageCageDetails> implements BigStorageCageDetailsService {
+
+
+}
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/EdgStorageCageDetailsService.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/EdgStorageCageDetailsService.java
index 4e7ef5c..c1f69a7 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/EdgStorageCageDetailsService.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/EdgStorageCageDetailsService.java
@@ -17,6 +17,8 @@
*/
public interface EdgStorageCageDetailsService extends MPJBaseService<EdgStorageCageDetails> {
+// boolean identWorn(Map<String, Object> arguments);
+
/**
* 鑾峰彇 鍒囧壊褰撳墠鐗堝浘
* @return
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
index e214749..049e341 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/service/impl/EdgStorageCageDetailsServiceImpl.java
@@ -8,8 +8,11 @@
import com.github.yulichang.query.MPJLambdaQueryWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.mes.bigstorage.entity.BigStorageCageDetails;
+import com.mes.bigstorage.service.BigStorageCageDetailsService;
import com.mes.common.config.Const;
import com.mes.damage.entity.Damage;
+import com.mes.damage.mapper.DamageMapper;
import com.mes.damage.service.DamageService;
import com.mes.edgglasstask.entity.EdgGlassTaskInfo;
import com.mes.edgglasstask.entity.request.IdentWornRequest;
@@ -19,6 +22,8 @@
import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper;
import com.mes.edgstoragecage.mapper.EdgStorageCageMapper;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
+import com.mes.engineering.entity.Engineering;
+import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.mapper.GlassInfoMapper;
import com.mes.pp.entity.OptimizeDetail;
import com.mes.pp.entity.OptimizeLayout;
@@ -65,11 +70,51 @@
TaskCacheService taskCacheService;
@Autowired
+ DamageMapper damageMapper;
+
+ @Autowired
DamageService damageService;
@Autowired
EdgGlassTaskInfoService edgGlassTaskInfoService;
+ @Autowired
+ BigStorageCageDetailsService bigStorageCageDetailsService;
+//
+// @Override
+// public boolean identWorn(Map<String, Object> arguments) {
+// String glassId=arguments.get("glassId").toString();
+// int state=arguments.get("state").toString().isEmpty()?0:Integer.parseInt(arguments.get("state").toString());
+// int line=arguments.get("line").toString().isEmpty()?0:Integer.parseInt(arguments.get("line").toString());
+// String workingProcedure=arguments.get("workingProcedure").toString();
+// if(state==0||line==0||workingProcedure==null||glassId==null||glassId.isEmpty()){
+// log.info("鍓嶇浼犻�掓暟鎹笉鍏�:{}",arguments);
+// return false;
+// }
+// List<GlassInfo> GlassInfos = glassInfoMapper.selectList(new MPJLambdaQueryWrapper<GlassInfo>()
+// .selectAll(GlassInfo.class)
+// .eq(GlassInfo::getGlassId, glassId));
+// if (GlassInfos.size() == 1) {
+// Damage damage =new Damage();
+// damage.setGlassId(glassId);
+// damage.setLine(line);
+// damage.setWorkingProcedure(workingProcedure);
+// damage.setRemark("");
+// damage.setStatus(state);//8鐮存崯锛�9鎷胯蛋
+// damageService.insertDamage(damage);
+// }else{
+// return false;
+// }
+// List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>()
+// .selectAll(EdgStorageCageDetails.class)
+// .eq(EdgStorageCageDetails::getGlassId, glassId));
+// if (edgStorageCageDetails.size() == 1) {
+// EdgStorageCageDetails item = edgStorageCageDetails.get(0);
+// item.setState(state);
+// baseMapper.update(item, new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId, glassId));
+// }
+// return true;
+// }
/**
* 鑾峰彇 鍒囧壊褰撳墠鐗堝浘
*
@@ -77,13 +122,17 @@
*/
@Override
public List<Map<String, Object>> selectCutTerritory() {
- List<UpPattenUsage> upPattenUsage = upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>()
+ List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectJoinList(UpPattenUsage.class, new MPJLambdaWrapper<UpPattenUsage>()
.selectAll(UpPattenUsage.class)
+ .innerJoin(Engineering.class, on -> on
+ .eq(Engineering::getEngineerId, UpPattenUsage::getEngineeringId))
+ .eq(Engineering::getState,1)
.orderByDesc(UpPattenUsage::getState)
- .orderByDesc(UpPattenUsage::getId));
+ .orderByDesc(UpPattenUsage::getId)
+ );
if (!upPattenUsage.isEmpty()) {
UpPattenUsage upPattenUsage1 = upPattenUsage.get(0);
- List<Map<String, Object>> cutTerritorys = optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
+ List<Map<String, Object>> cutTerritorys=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
.selectAll(OptimizeDetail.class)
.selectAs(OptimizeLayout::getWidth, "olWidth")
.selectAs(OptimizeLayout::getHeight, "olHeight")
@@ -93,29 +142,34 @@
.eq(OptimizeDetail::getProjectNo, upPattenUsage1.getEngineeringId())
.eq(OptimizeDetail::getStockId, upPattenUsage1.getLayoutSequence())
);
- List<Map<String, Object>> ResultcutTerritorys = new ArrayList<>();
- for (Map<String, Object> cutTerritory : cutTerritorys) {
- EdgStorageCageDetails edgStorageCageDetails = baseMapper.selectOne(new MPJLambdaQueryWrapper<EdgStorageCageDetails>()
- .selectAll(EdgStorageCageDetails.class)
- .eq(EdgStorageCageDetails::getGlassId, cutTerritory.get("glass_id"))
- .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN));
-// log.info("鍐呭锛歿}-------{}",cutTerritory,edgStorageCageDetails);
- if (edgStorageCageDetails != null) {
- cutTerritory.put("glass_state", edgStorageCageDetails.getState());
- } else {
- cutTerritory.put("glass_state", 0);
- }
- ResultcutTerritorys.add(cutTerritory);
- }
- return ResultcutTerritorys;
+ Map<String, EdgStorageCageDetails> edgMaps=baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>()
+ .selectAll(EdgStorageCageDetails.class)
+ .eq(EdgStorageCageDetails::getEngineerId,upPattenUsage1.getEngineeringId())
+ .eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)
+ ).stream().collect(Collectors.toMap(EdgStorageCageDetails::getGlassId,EdgStorageCageDetails->EdgStorageCageDetails));
-// Sql鐗堟湰
-// return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class)
-// .select("ol.width as olwidth","ol.height as olheight")
-// .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id")
-// .eq("t.project_no", upPattenUsage1.getEngineeringId())
-// .eq("t.stock_id",upPattenUsage1.getLayoutSequence())
-// );
+ Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>()
+ .selectAll(Damage.class)
+ .eq(Damage::getEngineerId,upPattenUsage1.getEngineeringId())
+ ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2));
+
+ List<Map<String, Object>> resultCutTerritory=new ArrayList<>();
+ for (Map<String, Object> cutTerritory : cutTerritorys) {
+// log.info("鍐呭锛歿}-------{}",cutTerritory,edgStorageCageDetails);
+ if(cutTerritory.get("glass_id")==null||"".equals(cutTerritory.get("glass_id"))){
+ log.info("浼樺寲鏁版嵁涓璯lassId瀛樺湪绌哄��-----鍐呭锛歿}",cutTerritorys);
+ return new ArrayList<>();
+ }else if(edgMaps.get(cutTerritory.get("glass_id"))!=null){
+ cutTerritory.put("glass_state",edgMaps.get(cutTerritory.get("glass_id")).getState());
+ }else if(damageMaps.get(cutTerritory.get("glass_id"))!=null){
+ //log.info("鐜荤拑宸茬牬鎹�/鎷胯蛋-----鍐呭锛歿}",damageMaps.get(item.get("glass_id")));
+ cutTerritory.put("glass_state",damageMaps.get(cutTerritory.get("glass_id")).getStatus());
+ }else{
+ cutTerritory.put("glass_state",0);
+ }
+ resultCutTerritory.add(cutTerritory);
+ }
+ return resultCutTerritory;
}
return null;
}
@@ -128,10 +182,17 @@
*/
@Override
public List<List<Map<String, Object>>> selectCurrentCutTerritory(String current) {
+ //澶х悊鐗囩杩涜繃鐨勭幓鐠�
+ Map<String, BigStorageCageDetails> mapBigCage=bigStorageCageDetailsService.list(
+ new LambdaQueryWrapper<BigStorageCageDetails>()
+ .eq(BigStorageCageDetails::getEngineerId,current)
+ .gt(BigStorageCageDetails::getState,Const.GLASS_STATE_NEW)
+ ).stream().collect(Collectors.toMap(BigStorageCageDetails::getGlassId,BigStorageCageDetails->BigStorageCageDetails,(V1,V2)->V2));;
+
//缁撴灉
- List<Map<String, Object>> ResultcutTerritorys = new ArrayList<>();
+ List<Map<String, Object>> resultCutTerritory=new ArrayList<>();
//姝ゅ伐绋嬬殑鎵�鏈変紭鍖栨暟鎹�
- List<Map<String, Object>> cutTerritorys = optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
+ List<Map<String, Object>> cutTerritory=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class)
.selectAll(OptimizeDetail.class)
.selectAs(OptimizeLayout::getWidth, "olWidth")
.selectAs(OptimizeLayout::getHeight, "olHeight")
@@ -141,32 +202,39 @@
.eq(OptimizeDetail::getProjectNo, current)
);
- Map<String, EdgStorageCageDetails> edgMaps = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>()
+ Map<String, EdgStorageCageDetails> edgMaps=baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>()
.selectAll(EdgStorageCageDetails.class)
- .eq(EdgStorageCageDetails::getEngineerId, current)
+ .eq(EdgStorageCageDetails::getEngineerId,current)
.eq(EdgStorageCageDetails::getState, Const.GLASS_STATE_IN)
- ).stream().collect(Collectors.toMap(EdgStorageCageDetails::getGlassId, EdgStorageCageDetails -> EdgStorageCageDetails));
- for (Map<String, Object> cutTerritory : cutTerritorys) {
-// log.info("鍐呭锛歿}-------{}",cutTerritory,edgStorageCageDetails);
- if (cutTerritory.get("glass_id") == null || "".equals(cutTerritory.get("glass_id"))) {
- log.info("浼樺寲鏁版嵁涓璯lassId瀛樺湪绌哄��-----鍐呭锛歿}", cutTerritorys);
+ ).stream().collect(Collectors.toMap(EdgStorageCageDetails::getGlassId,EdgStorageCageDetails->EdgStorageCageDetails,(V1,V2)->V2));
+
+ Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>()
+ .selectAll(Damage.class)
+ .eq(Damage::getEngineerId,current)
+ ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2));
+
+ for (Map<String, Object> item : cutTerritory) {
+// log.info("鍐呭锛歿}-------{}",cutTerritory,edgStorageCageDetails);
+ if(item.get("glass_id")==null||"".equals(item.get("glass_id"))){
+ log.info("浼樺寲鏁版嵁涓璯lassId瀛樺湪绌哄��-----鍐呭锛歿}",cutTerritory);
return new ArrayList<>();
- } else if (edgMaps.get(cutTerritory.get("glass_id")) != null) {
- cutTerritory.put("glass_state", edgMaps.get(cutTerritory.get("glass_id")).getState());
- } else {
- cutTerritory.put("glass_state", 0);
}
- ResultcutTerritorys.add(cutTerritory);
+ if(damageMaps.get(item.get("glass_id"))!=null){
+ //log.info("鐜荤拑宸茬牬鎹�/鎷胯蛋-----鍐呭锛歿}",damageMaps.get(item.get("glass_id")));
+ item.put("glass_state",damageMaps.get(item.get("glass_id")).getStatus());
+ }else if(mapBigCage.get(item.get("glass_id"))!=null){
+ //杩涜繃澶х悊鐗囩
+ item.put("glass_state",98);
+ }else if(edgMaps.get(item.get("glass_id"))!=null){
+ item.put("glass_state",edgMaps.get(item.get("glass_id")).getState());
+ }else{
+ item.put("glass_state",0);
+ }
+ resultCutTerritory.add(item);
}
- Map<String, List<Map<String, Object>>> groupBy = ResultcutTerritorys.stream().collect(Collectors.groupingBy(item -> item.get("stock_id").toString()));
+ Map<String, List<Map<String, Object>>> groupBy=resultCutTerritory.stream().collect(Collectors.groupingBy(item->item.get("stock_id").toString()));
// List<List<Map<String, Object>>> Result=groupBy.values().stream().collect(Collectors.toList());
return new ArrayList<>(groupBy.values());
-//Sql鐗堟湰
-// return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class)
-// .select("ol.width as olwidth","ol.height as olheight")
-// .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id")
-// .eq("t.project_no",current)
-// );
}
/**
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 9d0c330..946882a 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
@@ -726,14 +726,6 @@
public void CacheGlassTasks() {
JSONObject jsonObject = new JSONObject();
List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory();
-// List<Map<String, Object>> currentCutTerritorys=new ArrayList<>();
-// if(engineerId==null||engineerId.isEmpty()){
-// //璇嗗埆鎽嗙墖 褰撳墠鐗堝浘鏁版嵁
-// currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory();
-// }else{
-// //璇嗗埆鎽嗙墖 姝ngineerId 宸ョ▼鐗堝浘鏁版嵁
-// currentCutTerritorys = edgStorageCageDetailsService.selectCurrentCutTerritory(engineerId);
-// }
jsonObject.append("currentCutTerritory", currentCutTerritorys);
//log.info("鏈璇嗗埆鐗堝浘{},++++{}",engineerId,currentCutTerritorys);
//纾ㄨ竟淇℃伅
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
index 8ab9ab1..46687a2 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -6,6 +6,8 @@
active: dev
application:
name: cacheGlass
+ liquibase:
+ enabled: false
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
configuration:
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 8a9f8a7..2e6b87a 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
@@ -4,7 +4,6 @@
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.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
@@ -155,9 +154,9 @@
PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject;
String mesD03Address = plcMesObject.getPlcParameter("MESToD03").getValue();
String mesD05Address = plcMesObject.getPlcParameter("MESToD05").getValue();
- log.info("MESToD03:{},MESToD05:{}",mesD03Address,mesD05Address);
- if("2".equals(mesD03Address)||"2".equals(mesD05Address)){
- log.info("鏈夊惎鍔ㄤ俊鍙凤紝MESToD03:{},MESToD05:{}",mesD03Address,mesD05Address);
+ log.info("MESToD03:{},MESToD05:{}", mesD03Address, mesD05Address);
+ if ("2".equals(mesD03Address) || "2".equals(mesD05Address)) {
+ log.info("鏈夊惎鍔ㄤ俊鍙凤紝MESToD03:{},MESToD05:{}", mesD03Address, mesD05Address);
}
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
String e01Status = plcParameterObject.getPlcParameter("E01State").getValue();
@@ -601,7 +600,11 @@
if (glassCount < inCarMaxSize) {
addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst);
} else {
- addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst);
+ if (glassCount < inCarMaxSize + 1) {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst);
+ } else {
+ return Boolean.FALSE;
+ }
}
} else {
flag = Boolean.FALSE;
@@ -612,12 +615,20 @@
if (remainWidth >= widthFirst) {
if (remainWidth - widthFirst - glassGap >= widthSecond) {
if (glassCount < inCarMaxSize) {
- addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightSecond);
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_WAIT, widthFirst, heightFirst);
} else {
- addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond);
+ if (glassCount < inCarMaxSize + 1) {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst);
+ } else {
+ return Boolean.FALSE;
+ }
}
} else {
- addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightSecond);
+ if (glassCount < inCarMaxSize + 1) {
+ addFeedTask(glassId, line, Const.BIG_STORAGE_IN_RUN, widthFirst, heightFirst);
+ } else {
+ return Boolean.FALSE;
+ }
}
} else {
flag = Boolean.FALSE;
diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
index dd5a317..a1a4fa4 100644
--- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/resources/application.yml
@@ -6,6 +6,8 @@
active: cz
application:
name: cacheVerticalGlass
+ liquibase:
+ enabled: false
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
configuration:
diff --git a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application.yml
index 6fc80c0a..3b841eb 100644
--- a/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/GlassStorageModule/src/main/resources/application.yml
@@ -6,6 +6,8 @@
active: dev
application:
name: glassStorage
+ liquibase:
+ enabled: false
mybatis-plus:
diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
index ee801d2..d61e1b4 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/resources/application.yml
@@ -5,6 +5,8 @@
active: dev
application:
name: loadGlass
+ liquibase:
+ enabled: false
mybatis-plus:
mapper-locations: classpath*:mapper/*.xml
configuration:
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
index ac92054..86343e1 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
@@ -8,15 +8,21 @@
import com.mes.damage.entity.Damage;
import com.mes.damage.service.DamageService;
import com.mes.device.PlcParameterObject;
+import com.mes.sysdict.entity.SysDictData;
+import com.mes.sysdict.service.SysDictDataService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.temperingrecord.entity.TemperingRecord;
import com.mes.temperingrecord.service.TemperingRecordService;
+import com.mes.tools.S7control;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
+import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -31,7 +37,7 @@
public class TemperingTask {
@Autowired
- private TemperingRecordService temporalRecordService;
+ private TemperingRecordService temperingRecordService;
@Autowired
private TemperingGlassInfoService temporaryGlassInfoService;
@@ -39,53 +45,105 @@
@Autowired
private DamageService damageService;
+ @Autowired
+ private SysDictDataService sysDictDataService;
+
private static final String ALONE_STATE = "0";
+ @Value("${mes.width}")
+ private Integer temperingWidth;
+ @Value("${mes.height}")
+ private Integer temperingHeight;
@Scheduled(fixedDelay = 1000)
public void temperingGlassBefore() {
Date startDate = new Date();
log.info("鏈浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
+ S7control plcControl = S7object.getinstance().plccontrol;
String state = plcParameterObject.getPlcParameter("state").getValue();
// 褰撳墠杩炵嚎鐘舵�佷负
if (ALONE_STATE.equals(state)) {
- log.info("褰撳墠閽㈠寲鐐夎繛绾挎ā寮忎负锛歿},涓嶆墽琛岃浠诲姟", state);
+ log.info("褰撳墠閽㈠寲鐐夎繛绾挎ā寮忎负锛歿}锛�(0锛氭墜鍔紱1锛氳繛绾�),涓嶆墽琛岃浠诲姟", state);
return;
}
//灏嗙‘璁ゅ瓧缃负0
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 0);
-
- //todo:鑾峰彇閽㈠寲鐗堝浘涓姸鎬佷负2鐨勶紙杩涚倝瀹屾垚鐨勭幓鐠冧俊鎭級 涓斾笉瀛樺湪閽㈠寲璁板綍琛ㄥ唴鐨�
- List<Object> temperRecordIdListObj = temporalRecordService.listObjs(new QueryWrapper<TemperingRecord>().select("distinct tempering_layout_id"));
-
- List<String> temperRecordIdList = temperRecordIdListObj.stream().map(String::valueOf).collect(Collectors.toList());
- if (CollectionUtils.isEmpty(temperRecordIdList)) {
+ plcControl.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 0);
+ //鍙兘鏈夊嚑鐐夌幓鐠冨悓鏃跺湪閽紝闇�瑕佽幏鍙栭挗鍖栧皬鐗囪〃涓殑鏁版嵁淇℃伅鐘舵�佷负2锛堟棆杞彴鐜荤拑宸查�佸嚭鏈挗鍖栵紝姝e湪閽㈠寲锛�
+ List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
+ .eq(TemperingGlassInfo::getState, Const.TEMPERING_START));
+ if (CollectionUtils.isEmpty(temperingGlassInfoList)) {
log.info("褰撳墠绯荤粺娌℃湁闇�瑕侀挗鍖栫殑鐜荤拑淇℃伅");
return;
}
- List<TemperingGlassInfo> list = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
- .eq(TemperingGlassInfo::getState, Const.TEMPERING_START).notIn(TemperingGlassInfo::getTemperingLayoutId, temperRecordIdList));
- if (CollectionUtils.isEmpty(list)) {
- log.info("褰撳墠绯荤粺娌℃湁闇�瑕侀挗鍖栫殑鐜荤拑淇℃伅");
- return;
- }
- List<Integer> temperingLayoutIdList = list.stream().map(TemperingGlassInfo::getTemperingLayoutId).distinct().collect(Collectors.toList());
- if (CollectionUtils.isNotEmpty(temperRecordIdList)) {
- temperingLayoutIdList.removeAll(temperRecordIdList);
- }
- if (CollectionUtils.isEmpty(temperingLayoutIdList)) {
- log.info("褰撳墠鐜荤拑鏈夋鍦ㄩ挗鍖栫殑浠诲姟");
- }
-// 鑾峰彇閽㈠寲涓嬬墖琛ㄧ姸鎬佷负2鐨勭幓鐠冧俊鎭�
+ TemperingGlassInfo maxGlassInfo = temperingGlassInfoList.stream().max(Comparator.comparingLong(TemperingGlassInfo::getId)).get();
+ //鎷垮埌宸ョ▼id鍙婄倝鍙�
+// List<EngineerTemperingDTO> engineerTemperingList = temperingGlassInfoList.stream().map(e -> {
+// EngineerTemperingDTO engineerTemperingDTO = new EngineerTemperingDTO();
+// BeanUtils.copyProperties(e, engineerTemperingDTO);
+// return engineerTemperingDTO;
+// }).distinct().collect(Collectors.toList());
+ //灏嗘鍦ㄩ挗鍖栫殑鐐夊彿杩囨护鎺夛紝浠呰幏鍙栧緟閽㈠寲鐨勭幓鐠�
+// List<TemperingRecord> temperingRecords = temperingRecordService.list(new LambdaQueryWrapper<TemperingRecord>().and(i -> i.isNull(TemperingRecord::getCoolEnergy).or().eq(TemperingRecord::getCoolEnergy, "")));
+// List<EngineerTemperingDTO> temperingList = new ArrayList<>();
+// if (CollectionUtils.isNotEmpty(temperingRecords)) {
+// temperingList = temperingRecords.stream().map(e -> {
+// EngineerTemperingDTO engineerTemperingDTO = new EngineerTemperingDTO();
+// BeanUtils.copyProperties(e, engineerTemperingDTO);
+// return engineerTemperingDTO;
+// }).collect(Collectors.toList());
+// }
+// engineerTemperingList.removeAll(temperingList);
+// if (CollectionUtils.isEmpty(engineerTemperingList)) {
+// log.info("娌℃湁寰呴挗鍖栫殑浠诲姟锛岀粨鏉�");
+// return;
+// }
+// if (engineerTemperingList.size() > 1) {
+// log.info("瀛樺湪澶氱倝寰呴挗鍖栫殑浠诲姟锛岃妫�鏌ョ幇鍦烘槸鍚︽湁寮傚父鏁版嵁鏈鐞�");
+// return;
+// }
+// EngineerTemperingDTO temperingDTO = engineerTemperingList.get(0);
+ //鑾峰彇寰呴挗鍖栫殑鎵�鏈夌幓鐠冧俊鎭�
+ List<TemperingGlassInfo> temperingGlassList = temperingGlassInfoList.stream()
+ .filter(e -> e.getEngineerId().equals(maxGlassInfo.getEngineerId())
+ && e.getTemperingLayoutId().equals(maxGlassInfo.getTemperingLayoutId()))
+ .sorted(Comparator.comparing(TemperingGlassInfo::getTemperingFeedSequence)).collect(Collectors.toList());
+ //鎸夌収鑶滅郴鑾峰彇鐜荤拑鏉愯川
+ SysDictData glassTypeSysDictData = sysDictDataService.getOne(new QueryWrapper<SysDictData>()
+ .eq(StringUtils.isNotBlank(temperingGlassList.get(0).getFilmsid()), "dict_label", temperingGlassList.get(0).getFilmsid()));
+ double sumArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).sum();
+ double maxArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).max().orElse(0.0);
+ double minArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).min().orElse(0.0);
+ double areaDifference = (10000 * (maxArea - minArea) / maxArea);
+ double loadingRate = (int) (10000 * sumArea / (temperingHeight * temperingWidth));
+ TemperingRecord temperingRecord = new TemperingRecord();
+ temperingRecord.setEngineerId(maxGlassInfo.getEngineerId());
+ temperingRecord.setTemperingLayoutId(maxGlassInfo.getTemperingLayoutId());
+ temperingRecord.setGlassType(Integer.parseInt(glassTypeSysDictData.getDictTypeValue()));
+ temperingRecord.setTemperingType(1);//鍏ㄩ挗
+ temperingRecord.setThickness(temperingGlassList.get(0).getThickness());
+ temperingRecord.setAreaDifference(areaDifference);
+ temperingRecord.setLoadingRate(loadingRate);
+ temperingRecord.setState(Const.GLASS_STATE_NEW);
+ //濡傛灉鍑虹幇鍚屼竴鐐夐噸璇昏澶勭悊锛屼富閿洿鎺ュ紓甯稿鐞嗭紝涓嶄細鍙戠粰plc閽㈠寲淇℃伅
+ temperingRecordService.save(temperingRecord);
+// 鍚憄lc鍙戦�侀挗鍖栦俊鎭�
+ plcControl.writeWord(plcParameterObject.getPlcParameter("temperingLayoutId").getAddress(), maxGlassInfo.getTemperingLayoutId());
+ plcControl.writeWord(plcParameterObject.getPlcParameter("filmsid").getAddress(), Integer.parseInt(glassTypeSysDictData.getDictTypeValue()));
+ plcControl.writeWord(plcParameterObject.getPlcParameter("temperingType").getAddress(), 1);
+ plcControl.writeWord(plcParameterObject.getPlcParameter("thickness").getAddress(), (int) (temperingGlassList.get(0).getThickness() * 10));
+ plcControl.writeWord(plcParameterObject.getPlcParameter("areaDifference").getAddress(), (int) areaDifference);
+ plcControl.writeWord(plcParameterObject.getPlcParameter("loadingRate").getAddress(), (int) loadingRate);
//瀹屾垚浠诲姟灏嗙‘璁ゅ瓧缃负1
- S7object.getinstance().plccontrol.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 1);
+ plcControl.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 1);
+ Date endDate = new Date();
+ log.info("鏈浠诲姟缁撴潫鏃堕棿锛歿}锛屽叡鑰楁椂锛歿}ms", endDate, endDate.getTime() - startDate.getTime());
}
@Scheduled(fixedDelay = 1000)
public void temperingGlassAfter() {
-
+ //鏆備笉澶勭悊
}
@Scheduled(fixedDelay = 1000)
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
index 12e113b..471cdae 100644
--- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/application.yml
@@ -5,7 +5,13 @@
active: dev
application:
name: temperingGlass
+ liquibase:
+ enabled: true
+ change-log: classpath:changelog/changelog.sql
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:
+ width: 2800
+ height: 5000
\ No newline at end of file
diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/changelog.sql b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/changelog.sql
new file mode 100644
index 0000000..68e1a70
--- /dev/null
+++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/resources/changelog/changelog.sql
@@ -0,0 +1,156 @@
+--liquibase formatted sql
+
+--changeset zsh:20240904001
+--preconditions onFail:CONTINUE onError:CONTINUE
+--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_type';
+CREATE TABLE sys_dict_type
+(
+ dict_id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ dict_name VARCHAR(32) NOT NULL,
+ dict_type VARCHAR(32) NOT NULL,
+ state CHAR(1) NOT NULL DEFAULT TRUE,
+ description VARCHAR(32),
+ create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ deleted char(1) DEFAULT 0
+);
+--rollback DROP TABLE sys_dict_type;
+
+--changeset zsh:20240904002
+--preconditions onFail:CONTINUE onError:CONTINUE
+--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_dict_data';
+CREATE TABLE sys_dict_data
+(
+ dict_id BIGINT AUTO_INCREMENT PRIMARY KEY,
+ dict_sort INT NOT NULL,
+ dict_label VARCHAR(32) NOT NULL,
+ dict_value VARCHAR(32) NOT NULL,
+ dict_type VARCHAR(32) NOT NULL,
+ dict_type_value varchar(32),
+ state CHAR(1) NOT NULL DEFAULT TRUE,
+ description VARCHAR(32),
+ create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ deleted char(1) DEFAULT 0
+);
+--rollback DROP TABLE sys_dict_data;
+
+
+--changeset zsh:20240904003
+--preconditions onFail:CONTINUE onError:CONTINUE
+--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('鐧界幓', 'clearGlass', '1', '0', '0');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('鍗曢摱', 'silver', '1', '1', '0');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('鍙岄摱', 'doubleSilver', '1', '2', '0');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('涓夐摱', 'thirdSilver', '1', '3', '0');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('瓒呯櫧', 'ultraClear', '1', '4', '0');
+INSERT INTO sys_dict_type (dict_name, dict_type, state, description, deleted)
+VALUES ('鐑弽灏�', 'heatReflect', '1', '5', '0');
+--rollback DELETE FROM sys_dict_type WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');
+
+--changeset zsh:20240904004
+--preconditions onFail:CONTINUE onError:CONTINUE
+--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_data WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (1, '鐧界幓', 'clearGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (2, '瓒呯櫧', 'ultraClear', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (3, '鏉ユ枡鐧界幓', 'incomingClearGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (4, '娆у窞鑼�', 'europeTeaColor', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (5, '姘存櫠鐏�', 'cristalGrey', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (6, '鐏扮幓', 'grayGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (7, '鐏伴晙鑶�', 'grayCoating', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (8, '纾ㄧ爞', 'frosted', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (9, '绂忕壒钃�', 'fordBlue', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (10, '绂忕壒钃濋晙鑶�', 'fordBlueCoating', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (11, '钃濇槦鐏�', 'blueAstralGrey', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (12, '钃濈幓', 'blueGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (13, '瓒呯櫧闀胯櫣', 'ultraClearChanghong', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (14, '閲戞櫠鐏�', 'jinjinGrey', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (15, '閲戞櫠鐏拌尪', 'jinjinTeaGrey', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (16, '闀�鑶�', 'coatingFilm', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (17, '闀胯櫣', 'clearGlassChanghong', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (18, '闃冲厜鑶�', 'solorControl', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (19, '楂樺弽搴曢��', 'arGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (20, '楂樼櫧', 'arClear', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (21, '榛戠幓', 'blackGlass', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (22, '鐜夌爞', 'emery', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (23, '瓒呯櫧纾ㄧ爞', 'ultraClearFrosted', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (24, '閲戣尪鐜�', 'goldenTea', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (25, '钃濈伆闀�鑶�', 'blueGraycoatingFilm', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (26, '鍗曢」閫忚', 'onePoint', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (27, '瓒呯櫧闀�鑶�', 'ultraClearCoatingFilm', '鐧界幓', '0', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (1, 'F缁�', 'fGreen', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (2, 'F缁縧owe', 'fGreenLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (3, 'F缁块晙鑶�', 'fGreenCoating', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (4, 'Low-e', 'lowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (5, 'super52', 'super52', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (6, '涓幓鍦ㄧ嚎', 'zgOnlineGlass', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (7, '鍖楃幓60绂荤嚎lowe', 'ng60OfflineLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (8, '鍗楃幓鍦ㄧ嚎lowe', 'csgOnlineLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (9, '鍙扮幓81A', 'tg81a', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (10, '鍙扮幓lowe70', 'tgLowe70', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (11, '鍙扮幓LOWE78', 'tgLowe78', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (12, '娌冲寳閲戠憺lowe80', 'hbJinruiLowe80', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (13, '绂忕壒钃漧owe', 'fordBlueLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (14, '绂忚幈鐗笷XB60', 'flatFxb60', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (15, '绂忚幈鐗筶owe60', 'flatLowe60', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (16, '绂忚幈鐗筶owe70', 'flatLowe70', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (17, '绂忚幈鐗筶owe80', 'flatLowe80', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (18, '鑰�鐨湪绾縇OWE', 'sypOnlineLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (19, '瓒呯櫧Lowe', 'ultraClearLowe', '鍗曢摱', '1', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (1, '鍙岄摱lowe', 'doubleSilverLowe', '鍙岄摱', '2', '1', '1', '0');
+INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, dict_type_value, state, description, deleted)
+VALUES (2, '瓒呯櫧鍙岄摱Lowe', 'ultraDoubleSilverLowe', '鍙岄摱', '2', '1', '1', '0');
+--rollback DELETE FROM sys_dict_data WHERE dict_type in ('clearGlass', 'silver', 'doubleSilver', 'thirdSilver', 'ultraClear', 'heatReflect');
+
+
+
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/BarcodeReadThread.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/BarcodeReadThread.java
new file mode 100644
index 0000000..cc6dabc
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/BarcodeReadThread.java
@@ -0,0 +1,82 @@
+package com.mes.job;
+
+
+import com.mes.glassinfo.service.GlassInfoService;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+
+public class BarcodeReadThread extends Thread{
+
+ public BarcodeReadThread(String ip,Integer port,Downpush downpush)
+ {
+ this.ip=ip;
+ this.port=port;
+ this.downpush=downpush;
+ }
+ private Socket socket;
+ private String ip;
+ private Integer port;
+ private Downpush downpush;
+ private BufferedReader in;
+
+ @SneakyThrows
+ @Override
+ public void run()
+ {
+ connectCheckin();//鍒濇 寰幆灏濊瘯杩炴帴锛岀洿鍒拌繛鎺ユ垚鍔�
+ while (this!=null)
+ {
+ try
+ {
+ in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
+ String response = in.readLine();
+ if(response!=null)
+ {
+ downpush.barcodeCheckin(response);
+ }
+ }
+ catch (Exception exception)
+ {
+ //寮傚父锛岄噸杩�
+ connectCheckin();
+ }
+ finally {
+ if(in!=null)
+ {
+ in.close();
+ }
+ }
+
+ Thread.sleep(100);
+ }
+ }
+
+ @SneakyThrows
+ private void connectCheckin()
+ {
+ while (this!=null)
+ {
+ try
+ {
+ socket=new Socket();
+ socket.setSoTimeout(10000);
+ socket.connect(new InetSocketAddress(ip,port));
+ if(socket.isConnected())
+ {
+ return;
+ }
+ }
+ catch (Exception exception)
+ {
+
+ }
+
+ Thread.sleep(1000);
+ }
+ }
+}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
index d1fc2b2..95facd4 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/DownLoadCacheGlassTask.java
@@ -30,6 +30,7 @@
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -80,6 +81,7 @@
@Scheduled(fixedDelay = 300)
+ @Async
public void plcHomeEdgTask() {
PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject;
String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue();
@@ -129,6 +131,7 @@
}
@Scheduled(fixedDelay = 300)
+ @Async
public void plcShelfFull() {
List<DownWorkstation> list = downGlassInfoService.queryWorkStationIsFull();
if (CollectionUtils.isNotEmpty(list)) {
@@ -139,6 +142,7 @@
}
@Scheduled(fixedDelay = 1000)
+ @Async
public void dealDamageTask() {
Date startDate = new Date();
log.info("涓嬬墖鐮存崯鐜荤拑娓呴櫎浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
@@ -183,6 +187,7 @@
* 鏇存柊宸茬粦瀹氬伐浣嶆祦绋嬪崱鐨勭牬鎹�/鎷胯蛋鐨勬暟閲忎俊鎭�
*/
@Scheduled(fixedDelay = 1000)
+ @Async
public void updateWorkStationOtherCount() {
Date startDate = new Date();
log.info("涓嬬墖鐮存洿鏂版崯鐜荤拑鏁伴噺浠诲姟寮�濮嬫墽琛屾椂闂达細{}", startDate);
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 54b5416..0bc5c30 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
@@ -22,15 +22,19 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.TaskScheduler;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.BufferedReader;
import java.io.InputStreamReader;
+import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.*;
import java.util.stream.Collectors;
@Slf4j
@@ -47,6 +51,13 @@
private DownGlassTaskService downGlassTaskService;
@Autowired
private GlassInfoService glassInfoService;
+ private final ExecutorService scanCodeThreadPool = new ThreadPoolExecutor(
+ 10, // core pool size
+ 20, // maximum pool size
+ 60L, TimeUnit.SECONDS,
+ new LinkedBlockingQueue<>()
+ );
+ private final ExecutorService isRunThreadPool = Executors.newFixedThreadPool(5);
@Value("${mes.scan.ip}")
private String scanIp;
@@ -167,8 +178,8 @@
new QueryWrapper<DownGlassTask>()
.select("Top 1 *")
.eq("end_cell", Const.G13_WORK_STATION)
+ .lt("task_status", Const.UNLOAD_GLASS_DOWN)
.orderByDesc("id")
-
);
jsonObject4.append("takeGlass", takeGlass);
@@ -185,46 +196,84 @@
@Scheduled(fixedDelay = 1000)
public void isRun() {
- JSONObject jsonObject = new JSONObject();
- //姝e湪杩涜鐨勪换鍔�
- List<DownWorkstation> downWorkstation = downWorkstationService.getoneDownWorkstations(1, 6);
- jsonObject.append("downWorkstation", downWorkstation);
- List<DownGlassTask> downGlassTask = downGlassTaskService.selectOutTaskCache();
- jsonObject.append("downGlassTask", downGlassTask);
- ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
- if (sendwServer != null) {
- for (WebSocketServer webserver : sendwServer) {
- if (webserver != null) {
- webserver.sendMessage(jsonObject.toString());
- } else {
- log.info("unLoadGlassIsRun is closed");
+ isRunThreadPool.execute(() -> {
+ JSONObject jsonObject = new JSONObject();
+ //姝e湪杩涜鐨勪换鍔�
+ List<DownWorkstation> downWorkstation = downWorkstationService.getoneDownWorkstations(1, 6);
+ jsonObject.append("downWorkstation", downWorkstation);
+ List<DownGlassTask> downGlassTask = downGlassTaskService.selectOutTaskCache();
+ jsonObject.append("downGlassTask", downGlassTask);
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unLoadGlassIsRun");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ } else {
+ log.info("unLoadGlassIsRun is closed");
+ }
}
+ }
+ });
+
+ }
+
+ @Async
+ @Scheduled(fixedDelay = Long.MAX_VALUE)
+ public void scanCodeTask() {
+ JSONObject jsonObject = new JSONObject();
+ log.info("鎵弿浠诲姟宸插惎鍔�");
+ while (true) {
+ try (Socket socket = new Socket(scanIp, scanPort);
+ BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
+ // 鎺ユ敹鏈嶅姟鍣ㄥ搷搴�
+// socket.setSoTimeout(1000);
+ log.info("绛夊緟鎵爜涓�......");
+ String glassId = in.readLine();
+ log.info("鎵弿鍒扮殑鐜荤拑id锛歿}", glassId);
+ List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
+ if (CollectionUtils.isNotEmpty(sendwServer)) {
+ //鎸夌収鐜荤拑id鑾峰彇鐜荤拑淇℃伅杩斿洖缁欏墠绔晫闈紝鍏蜂綋闇�瑕佸摢浜涙暟鎹緟纭
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
+ .eq(GlassInfo::getGlassId, glassId).last("limit 1"));
+ if (null == glassInfo) {
+ log.info("鎸夌収鐜荤拑id锛歿}锛屾棤娉曟壘鍒扮幓鐠冧俊鎭�", glassId);
+ } else {
+ jsonObject.append("scanGlass",glassInfo);
+ sendwServer.get(0).sendMessage(jsonObject.toString());
+ }
+ }
+ } catch (Exception exception) {
+ log.info("璇诲彇寮傚父锛屽師鍥犱负{}", exception.getMessage());
}
}
}
@Scheduled(fixedDelay = Long.MAX_VALUE)
- public void scanCodeTask() {
- while (true) {
- try (Socket socket = new Socket(scanIp, scanPort);
- BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
- // 鎺ユ敹鏈嶅姟鍣ㄥ搷搴�
- String response;
- while ((response = in.readLine()) != null) {
- List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanCode");
- if (CollectionUtils.isNotEmpty(sendwServer)) {
- //鎸夌収鐜荤拑id鑾峰彇鐜荤拑淇℃伅杩斿洖缁欏墠绔晫闈紝鍏蜂綋闇�瑕佸摢浜涙暟鎹緟纭
- GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
- .eq(GlassInfo::getGlassId, response).last("limit 1"));
- if (null == glassInfo) {
- log.info("鎸夌収鐜荤拑id锛歿}锛屾棤娉曟壘鍒扮幓鐠冧俊鎭�", response);
- } else {
- sendwServer.get(0).sendMessage(glassInfo.toString());
- }
- }
- }
- } catch (Exception exception) {
- log.info("璇诲彇寮傚父锛屽師鍥犱负{}", exception.getMessage());
+ public void scanCodeTaskCopy()
+ {
+ log.info("鎵弿浠诲姟宸插惎鍔�");
+ try {
+ BarcodeReadThread brt=new BarcodeReadThread(scanIp,scanPort,this);
+ brt.start();
+
+ }catch (Exception exception) {
+ log.info("鎵弿浠诲姟鍚姩寮傚父锛屽師鍥犱负{}", exception.getMessage());
+ }
+
+ }
+ //socket璇诲彇鍒版秷鎭悗浼氳皟鐢ㄨ繖涓嚱鏁�
+ public void barcodeCheckin(String response)
+ {
+ log.info("鎵弿鍒扮殑鐜荤拑id锛歿}", response);
+ List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanCode");
+ if (CollectionUtils.isNotEmpty(sendwServer)) {
+ //鎸夌収鐜荤拑id鑾峰彇鐜荤拑淇℃伅杩斿洖缁欏墠绔晫闈紝鍏蜂綋闇�瑕佸摢浜涙暟鎹緟纭
+ GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
+ .eq(GlassInfo::getGlassId, response).last("limit 1"));
+ if (null == glassInfo) {
+ log.info("鎸夌収鐜荤拑id锛歿}锛屾棤娉曟壘鍒扮幓鐠冧俊鎭�", response);
+ } else {
+ sendwServer.get(0).sendMessage(glassInfo.toString());
}
}
}
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
index 6c89ab2..8a593cc 100644
--- a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application.yml
@@ -6,6 +6,13 @@
active: dev
application:
name: unLoadGlass
+ liquibase:
+ enabled: false
+ task:
+ scheduling:
+ pool:
+ size: 10
+ thread-name-prefix: task-unLoad
mybatis-plus:
@@ -22,5 +29,5 @@
throughHeight: 2500
threshold: 5 #涓嬬墖鐨勬渶澶ч槇鍊�
scan:
- ip: 127.0.0.1
+ ip: 169.254.171.199
port: 5000
--
Gitblit v1.8.0