新增多个库页面:常温库、分容库、高温库,并更新导航栏以包含这些新页面
已添加12个文件
已修改29个文件
已删除3个文件
| | |
| | | "@microsoft/signalr": "^6.0.4", |
| | | "ali-oss": "^6.17.1", |
| | | "axios": "^0.21.1", |
| | | "bootstrap": "^5.3.3", |
| | | "core-js": "^3.6.5", |
| | | "echarts": "^5.0.2", |
| | | "element-plus": "^2.2.14", |
| | |
| | | "vue": "^3.2.37", |
| | | "vue-draggable-next": "^2.0.1", |
| | | "vue-router": "^4.0.0-0", |
| | | "vuex": "^4.0.0-0", |
| | | "vuex": "^4.0.0-0", |
| | | "wangeditor": "^4.7.6" |
| | | }, |
| | | "devDependencies": { |
| | |
| | | let loadingInstance; |
| | | let loadingStatus = false; |
| | | if (process.env.NODE_ENV == 'development') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:9291/'; |
| | | // axios.defaults.baseURL = 'http://192.168.20.251:9291/'; |
| | | // axios.defaults.baseURL = 'http://127.0.0.1:9291/'; |
| | | axios.defaults.baseURL = 'http://192.168.5.251:9291/'; |
| | | } |
| | | else if (process.env.NODE_ENV == 'debug') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:8098/'; |
| | | } |
| | | |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | axios.defaults.baseURL = 'http://192.168.20.251:9291/'; |
| | | axios.defaults.baseURL = 'http://192.168.5.251:9291/'; |
| | | } |
| | | if (!axios.defaults.baseURL.endsWith('/')) { |
| | | axios.defaults.baseURL+="/"; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="Linebox" > |
| | | <div class="card"> |
| | | <div class="card-header"> |
| | | <div id="lines2"> |
| | | <div class="card-body">{{ device.deviceName }}<br /> |
| | | -{{ device.childDeviceCode }}- |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="card-body"> |
| | | <ul class="list-group lis"> |
| | | <li class="list-group-item list-group-item-dark">读åä¿¡å·</li> |
| | | <li class="list-group-item list-group-item-secondary">ä»»å¡å·ï¼{{ |
| | | device.data.command.taskNum }}</li> |
| | | <li class="list-group-item list-group-item-secondary">æçå·ï¼{{ |
| | | device.data.command.barcode }}</li> |
| | | <li class="list-group-item list-group-item-secondary">ç»ç¹å°åï¼{{ |
| | | device.data.command.targetAddress }}</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[6])">æ«ç ç«å°å
¥åºè¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[4])">å åæºåºåºç«å°è¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[2])">å åæºå
¥åºç«å°è¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[0])">线ä½åºåºå£è¯·æ±</li> |
| | | </ul> |
| | | <ul class="list-group lis"> |
| | | <li class="list-group-item list-group-item-dark">åå
¥ä¿¡å·</li> |
| | | <li class="list-group-item list-group-item-secondary">ä»»å¡å·ï¼{{ |
| | | device.data.commandWrite.taskNum }}</li> |
| | | <li class="list-group-item list-group-item-secondary">æçå·ï¼{{ |
| | | device.data.commandWrite.barcode }}</li> |
| | | <li class="list-group-item list-group-item-secondary">ç»ç¹å°åï¼{{ |
| | | device.data.commandWrite.targetAddress }}</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[7])">æ«ç ç«å°å
¥åºè¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[5])">å åæºåºåºç«å°è¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[3])">å åæºå
¥åºç«å°è¯·æ±</li> |
| | | <li :class="getSignalClass(device.data.writeInteractiveSignal[1])">线ä½åºåºå£è¯·æ±</li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { defineProps } from "vue"; |
| | | |
| | | // å®ä¹ç»ä»¶å±æ§ |
| | | const props = defineProps({ |
| | | device: { |
| | | type: Object, |
| | | required: true |
| | | } |
| | | }); |
| | | |
| | | // è·åä¿¡å·ç±»å |
| | | const getSignalClass = (signal) => { |
| | | // console.log("ð ~ getSignalClass ~ signal:", signal) |
| | | return signal !== true ? 'list-group-item list-group-item-danger' : 'list-group-item list-group-item-success'; |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* .Stackerbox{ |
| | | width: 220px; |
| | | float: left; |
| | | } */ |
| | | .Linebox{ |
| | | width: 500px; |
| | | float: left; |
| | | } |
| | | .box1{ |
| | | float: left; |
| | | } |
| | | .card-body{ |
| | | text-align: center; |
| | | border-radius: 6% ; |
| | | } |
| | | .Stacker{ |
| | | background-color: burlywood; |
| | | } |
| | | .lis{ |
| | | float: left; |
| | | width: 233px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="Stackerbox"> |
| | | <div class="card"> |
| | | <div class="card-header"> |
| | | <div> |
| | | <div class="card-body Stacker"> |
| | | {{ Stacker.deviceName }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="card-body"> |
| | | <ul class="list-group"> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | ä»»å¡å·ï¼{{ Stacker.data.currentTaskNum || 'ææ ä»»å¡å·' }} |
| | | </li> |
| | | <li :class="getStatusClass(Stacker.data.stackerCraneAutoStatusDes)"> |
| | | 工使¨¡å¼ï¼{{ Stacker.data.stackerCraneAutoStatusDes }} |
| | | </li> |
| | | <li :class="getStatusClass(Stacker.data.stackerCraneStatusDes)"> |
| | | 设å¤ç¶æï¼{{ Stacker.data.stackerCraneStatusDes }} |
| | | </li> |
| | | <li :class="getStatusClass(Stacker.data.stackerCraneWorkStatusDes)"> |
| | | å·¥ä½ç¶æï¼{{ Stacker.data.stackerCraneWorkStatusDes }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { defineProps } from "vue"; |
| | | |
| | | // å®ä¹ç»ä»¶å±æ§ |
| | | const props = defineProps({ |
| | | Stacker: { |
| | | type: Object, |
| | | required: true |
| | | } |
| | | }); |
| | | |
| | | // è·åç¶æç±»åï¼ä¼åç¶æå¤æï¼ |
| | | const getStatusClass = (status) => { |
| | | if (status === 'æ£å¸¸' || status === 'èªå¨' || status === 'å¾
æº') { |
| | | return 'list-group-item list-group-item-success'; |
| | | } |
| | | if (status === 'æ
é' || status === 'åæº') { |
| | | return 'list-group-item list-group-item-danger'; |
| | | } |
| | | return 'list-group-item list-group-item-warning'; // é»è®¤è¦åç¶æ |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
| | |
| | | // import 'dayjs/locale/zh-cn' |
| | | // import locale from 'element-plus/lib/locale/lang/zh-cn' |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | | |
| | | import 'bootstrap/dist/css/bootstrap.min.css'; |
| | | |
| | | |
| | | import permission from './api/permission' |
| | |
| | | let redirect = [ |
| | | { |
| | | path: "/404", |
| | | name: "404", |
| | | component: () => import("@/components/redirect/404"), |
| | | meta: { |
| | | anonymous: true, |
| | | }, |
| | | }, |
| | | { |
| | | path: "/401", |
| | | name: "401", |
| | | component: () => import("@/components/redirect/401"), |
| | | }, |
| | | { |
| | | path: "/coding", |
| | | name: "coding", |
| | | component: () => import("@/components/redirect/coding"), |
| | | }, |
| | | { |
| | | path: "/message", |
| | | name: "message", |
| | | component: () => import("@/components/redirect/Message.vue"), |
| | | }, |
| | | |
| | | let redirect = [{ |
| | | path: '/404', |
| | | name: '404', |
| | | component: () => import('@/components/redirect/404'), |
| | | meta:{ |
| | | anonymous:true |
| | | } |
| | | }, { |
| | | path: '/401', |
| | | name: '401', |
| | | component: () => import('@/components/redirect/401') |
| | | }, { |
| | | path: '/coding', |
| | | name: 'coding', |
| | | component: () => import('@/components/redirect/coding') |
| | | }, { |
| | | path: '/message', |
| | | name: 'message', |
| | | component: () => import('@/components/redirect/Message.vue') |
| | | }] |
| | | export default redirect; |
| | | { |
| | | path: "/indexLibrary", |
| | | component: () => import("@/views/Devicestatus/indexLibrary.vue"), |
| | | children: [ |
| | | { |
| | | path: "/AgingLibrary", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/AgingLibrary.vue"), |
| | | }, |
| | | { |
| | | path: "/FormationLibrary", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/FormationLibrary.vue"), |
| | | }, |
| | | { |
| | | path: "/highTemperature", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/hightemperature.vue"), |
| | | }, |
| | | { |
| | | path: "/roomTemperature", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/roomtemperature.vue"), |
| | | }, |
| | | { |
| | | path: "/StaticLibrary", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/Staticlibrary.vue"), |
| | | }, |
| | | { |
| | | path: "/Volume", |
| | | component: () => import("@/views/Devicestatus/Craftlibrary/Volume.vue"), |
| | | }, |
| | | { |
| | | path: "/Twoletters", |
| | | component: () => |
| | | import("@/views/Devicestatus/Craftlibrary/Twoletters.vue"), |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | export default redirect; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div> |
| | | <div class="Stackerbox"> |
| | | <div class="card"> |
| | | <div class="card-header"> |
| | | <div> |
| | | <div class="card-body Stacker"> |
| | | {{ StackerOne.deviceName }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="card-body"> |
| | | <ul class="list-group"> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | ä»»å¡å·ï¼{{ StackerOne.data.currentTaskNum || 'ææ ä»»å¡å·' }} |
| | | </li> |
| | | <li :class="getStatusClass(StackerOne.data.stackerCraneAutoStatusDes)"> |
| | | 工使¨¡å¼ï¼{{ StackerOne.data.stackerCraneAutoStatusDes }} |
| | | </li> |
| | | <li :class="getStatusClass(StackerOne.data.stackerCraneStatusDes)"> |
| | | 设å¤ç¶æï¼{{ StackerOne.data.stackerCraneStatusDes }} |
| | | </li> |
| | | <li :class="getStatusClass(StackerOne.data.stackerCraneWorkStatusDes)"> |
| | | å·¥ä½ç¶æï¼{{ StackerOne.data.stackerCraneWorkStatusDes }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <device-line v-for="device in devices" :key="device.deviceName" :device="device" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, reactive, toRefs } from "vue"; |
| | | import eventBus from "@/uitils/eventBus"; |
| | | import DeviceLine from "@/components/DeviceLine.vue"; |
| | | |
| | | // å åæº |
| | | const StackerOne = reactive({ |
| | | deviceName: "", |
| | | data: { |
| | | } |
| | | }); |
| | | |
| | | // 设å¤å表ï¼ä¿®æ¹éå¤è®¾å¤åç§°ï¼ |
| | | const devices = reactive([ |
| | | { deviceName: "éååºåºè¾é线", data: { command: {}, commandWrite: {}, writeInteractiveSignal: [] } }, |
| | | { deviceName: "éåå
¥åºè¾é线", data: { command: {}, commandWrite: {}, writeInteractiveSignal: [] } }, |
| | | // { deviceName: "å åæº1", data: { command: {}, commandWrite: {}, writeInteractiveSignal: [] } }, |
| | | // Add all devices similarly... |
| | | ]); |
| | | |
| | | // è·åç¶æç±»åï¼ä¼åç¶æå¤æï¼ |
| | | const getStatusClass = (status) => { |
| | | if (status === 'æ£å¸¸' || status === 'èªå¨' || status === 'å¾
æº') { |
| | | return 'list-group-item list-group-item-success'; |
| | | } |
| | | if (status === 'æ
é' || status === 'åæº') { |
| | | return 'list-group-item list-group-item-danger'; |
| | | } |
| | | return 'list-group-item list-group-item-warning'; // é»è®¤è¦åç¶æ |
| | | }; |
| | | |
| | | // çå¬è®¾å¤æ°æ®åå |
| | | onMounted(() => { |
| | | eventBus.on('locationData', eventData => { |
| | | const device = devices.find(d => d.deviceName === eventData.deviceName); |
| | | if (device) { |
| | | // ä½¿ç¨æ©å±è¿ç®ç¬¦æ´æ°å¯¹è±¡å±æ§ï¼ä¿æååºæ§ |
| | | device.data = { ...device.data, ...eventData.data }; |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .Stackerbox { |
| | | width: 220px; |
| | | float: left; |
| | | } |
| | | |
| | | .Linebox { |
| | | width: 500px; |
| | | float: left; |
| | | } |
| | | |
| | | .box1 { |
| | | float: left; |
| | | } |
| | | |
| | | .card-body { |
| | | text-align: center; |
| | | border-radius: 6%; |
| | | } |
| | | |
| | | .Stacker { |
| | | background-color: burlywood; |
| | | } |
| | | |
| | | .lis { |
| | | float: left; |
| | | width: 233px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <device-line v-for="device in devices" :key="device.deviceName" :device="device" /> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, reactive, toRefs } from "vue"; |
| | | import eventBus from "@/uitils/eventBus"; |
| | | import DeviceLine from "@/components/DeviceLine.vue"; |
| | | |
| | | // 设å¤å表ï¼ä¿®æ¹éå¤è®¾å¤åç§°ï¼ |
| | | const devices = reactive([]); |
| | | |
| | | const intToBitArrayFromBinaryString = (num, numBits) => { |
| | | let binaryString = num.toString(2).padStart(numBits, '0'); |
| | | return Array.from({ length: numBits }, (_, index) => binaryString[index] === '1'); |
| | | }; |
| | | |
| | | // çå¬è®¾å¤æ°æ®åå |
| | | onMounted(() => { |
| | | eventBus.on('locationData', eventData => { |
| | | if (eventData.deviceName === "åæå
¥åºè¾é线") { |
| | | if (devices.length <= 0) { |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | else { |
| | | const device = devices.find(c => c.childDeviceCode == eventData.childDeviceCode) |
| | | if (device) { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | device.data = eventData.data |
| | | console.log("ð ~ onMounted ~ device:", device.data) |
| | | } |
| | | else { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .Linebox{ |
| | | width: 573px; |
| | | float: left; |
| | | } |
| | | .box1{ |
| | | float: left; |
| | | } |
| | | .card-body{ |
| | | text-align: center; |
| | | border-radius: 6% ; |
| | | } |
| | | .Stacker{ |
| | | background-color: burlywood; |
| | | } |
| | | .lis{ |
| | | float: left; |
| | | width: 269px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="3"> |
| | | <device-stacker v-for="stacker in Stackers" :key="stacker.deviceName" :Stacker="stacker"></device-stacker> |
| | | </el-col> |
| | | <el-col :span="21"> |
| | | <device-line v-for="device in devices" :key="device.deviceName" :device="device" /> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, reactive, toRefs } from "vue"; |
| | | import eventBus from "@/uitils/eventBus"; |
| | | import DeviceLine from "@/components/DeviceLine.vue"; |
| | | import DeviceStacker from "@/components/DeviceStacker.vue"; |
| | | |
| | | // å åæº |
| | | const Stackers = reactive([]); |
| | | |
| | | // 设å¤å表ï¼ä¿®æ¹éå¤è®¾å¤åç§°ï¼ |
| | | const devices = reactive([]); |
| | | |
| | | const intToBitArrayFromBinaryString = (num, numBits) => { |
| | | let binaryString = num.toString(2).padStart(numBits, '0'); |
| | | return Array.from({ length: numBits }, (_, index) => binaryString[index] === '1'); |
| | | }; |
| | | |
| | | // çå¬è®¾å¤æ°æ®åå |
| | | onMounted(() => { |
| | | eventBus.on('locationData', eventData => { |
| | | if (eventData.deviceName === "éç½®è¾é线") { |
| | | |
| | | if (devices.length <= 0) { |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | else { |
| | | const device = devices.find(c => c.childDeviceCode == eventData.childDeviceCode) |
| | | if (device) { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | device.data = eventData.data |
| | | } |
| | | else { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | eventBus.on('stackerData', eventData => { |
| | | if (eventData.deviceName == "éç½®1å·å åæº") { |
| | | if (Stackers.length == 0) { |
| | | Stackers.push({ deviceName: eventData.deviceName, data: eventData.data }); |
| | | } |
| | | else { |
| | | const Stacker = Stackers.find(c => c.deviceName == eventData.deviceName); |
| | | if (Stacker) { |
| | | Stacker.data = eventData.data |
| | | } |
| | | else { |
| | | Stackers.push({ deviceName: eventData.deviceName, data: eventData.data }); |
| | | } |
| | | } |
| | | } |
| | | // if (eventData.deviceName == "éå1å·å åæº") { |
| | | // StackerOne.deviceName = eventData.deviceName; |
| | | // StackerOne.data = eventData.data |
| | | // } |
| | | }) |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .Stackerbox { |
| | | width: 220px; |
| | | float: left; |
| | | } |
| | | |
| | | .Linebox { |
| | | width: 500px; |
| | | float: left; |
| | | } |
| | | |
| | | .box1 { |
| | | float: left; |
| | | } |
| | | |
| | | .card-body { |
| | | text-align: center; |
| | | border-radius: 6%; |
| | | } |
| | | |
| | | .Stacker { |
| | | background-color: burlywood; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <device-line v-for="device in devices" :key="device.deviceName" :device="device" /> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, reactive, toRefs } from "vue"; |
| | | import eventBus from "@/uitils/eventBus"; |
| | | import DeviceLine from "@/components/DeviceLine.vue"; |
| | | |
| | | // 设å¤å表ï¼ä¿®æ¹éå¤è®¾å¤åç§°ï¼ |
| | | const devices = reactive([]); |
| | | |
| | | const intToBitArrayFromBinaryString = (num, numBits) => { |
| | | let binaryString = num.toString(2).padStart(numBits, '0'); |
| | | return Array.from({ length: numBits }, (_, index) => binaryString[index] === '1'); |
| | | }; |
| | | |
| | | // çå¬è®¾å¤æ°æ®åå |
| | | onMounted(() => { |
| | | eventBus.on('locationData', eventData => { |
| | | if (eventData.deviceName === "äºå°è¾é线") { |
| | | |
| | | if (devices.length <= 0) { |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | else { |
| | | const device = devices.find(c => c.childDeviceCode == eventData.childDeviceCode) |
| | | if (device) { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | device.data = eventData.data |
| | | } |
| | | else { |
| | | const number = eventData.data.commandWrite.writeInteractiveSignal; |
| | | const writeInteractiveSignal = intToBitArrayFromBinaryString(number, 8) |
| | | eventData.data.writeInteractiveSignal = writeInteractiveSignal; |
| | | devices.push({ deviceName: eventData.deviceName, data: eventData.data, childDeviceCode: eventData.childDeviceCode }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .Linebox{ |
| | | width: 573px; |
| | | float: left; |
| | | } |
| | | .box1{ |
| | | float: left; |
| | | } |
| | | .card-body{ |
| | | text-align: center; |
| | | border-radius: 6% ; |
| | | } |
| | | .Stacker{ |
| | | background-color: burlywood; |
| | | } |
| | | .lis{ |
| | | float: left; |
| | | width: 269px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | åå®¹åº |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | 髿¸©åº |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | å¸¸æ¸©åº |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | <!--导èªåº --> |
| | | <div class="nav-bar"> |
| | | <RouterLink class="navlink" to="/AgingLibrary" >éååº</RouterLink> |
| | | <RouterLink class="navlink" to="/FormationLibrary" >åæåº</RouterLink> |
| | | <RouterLink class="navlink" to="/StaticLibrary" >éç½®åº</RouterLink> |
| | | <RouterLink class="navlink" to="/Twoletters" >äºå°åº</RouterLink> |
| | | <RouterLink class="navlink" to="/Volume" >å容åº</RouterLink> |
| | | <RouterLink class="navlink" to="/highTemperature" >髿¸©åº</RouterLink> |
| | | <RouterLink class="navlink" to="/roomTemperature" >常温åº</RouterLink> |
| | | </div> |
| | | <!--注æäºé¡¹--> |
| | | <div class="area"> |
| | | <RouterView></RouterView> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { RouterView,RouterLink } from 'vue-router'; |
| | | |
| | | </script> |
| | | <style> |
| | | .nav-bar { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | height: 50px; |
| | | background-color: #f5f5f5; |
| | | border-bottom: 1px solid #ccc; |
| | | } |
| | | .navlink { |
| | | width: 100px; |
| | | height: 100%; |
| | | text-decoration:none; |
| | | text-align: center; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | color: rgb(0, 195, 255); |
| | | } |
| | | .navlink:hover{ |
| | | background-color: rgb(0, 195, 255); |
| | | color: #ffffff; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div class="home-contianer"> |
| | | <div> |
| | | <el-tabs type="border-card" @tab-click="handleClick" style="width: 100%; height: 100%;"> |
| | | <el-tab-pane label="éååº" style="width: 100%;height: 100%;"> |
| | | <div class="StackerOne"> |
| | | <div class="content">{{ this.StackerOne.deviceName }}:</div> |
| | | <!-- <div :class="this.ConveyorlineOut.data.command.interactiveSignal==1 ? 'bool_false' : 'bool_true'"></div> --> |
| | | <div class="content">ä»»å¡å·ï¼{{ this.StackerOne.data.currentTaskNum }}</div> |
| | | <div class="content display"> |
| | | <div>工使¨¡å¼ï¼{{ this.StackerOne.data.stackerCraneAutoStatusDes }}</div> |
| | | <div :class="this.StackerOne.data.stackerCraneAutoStatusDes != 'èªå¨' ? 'bool_false' : 'bool_true'"></div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>设å¤ç¶æï¼{{ this.StackerOne.data.stackerCraneStatusDes }}</div> |
| | | <div :class="this.StackerOne.data.stackerCraneStatusDes != 'æ£å¸¸' ? 'bool_false' : 'bool_true'"></div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>ä½ä¸ç¶æï¼{{ this.StackerOne.data.stackerCraneWorkStatusDes }}</div> |
| | | <div :class="this.StackerOne.data.stackerCraneWorkStatusDes != 'å¾
æº' ? 'bool_false' : 'bool_true'"></div> |
| | | </div> |
| | | </div> |
| | | <div class="ConveyorlineOut"> |
| | | <div class="content">{{ this.ConveyorlineOut.deviceName }}-----{{ |
| | | this.ConveyorlineOut.data.childDeviceCode}}:</div> |
| | | <div class="display"> |
| | | <div> |
| | | <div class="Signal">读åä¿¡å·ï¼</div> |
| | | <div class="content ">ä»»å¡å·ï¼{{ this.ConveyorlineOut.data.command.taskNum }}</div> |
| | | <div class="content ">æçå·ï¼{{ this.ConveyorlineOut.data.command.barcode }}</div> |
| | | <div class="content ">ç»ç¹å°åï¼{{ this.ConveyorlineOut.data.command.targetAddress}}</div> |
| | | <div class="content display"> |
| | | <div>æ«ç ç«å°å
¥åºè¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[0] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>å åæºåºåºç«å°è¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[2] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>å åæºå
¥åºç«å°è¯·æ±</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[4] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>线ä½åºåºå£è¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[6] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="margin-left: 40px;"> |
| | | <div class="Signal">åå
¥ä¿¡å·ï¼</div> |
| | | <div class="content ">ä»»å¡å·ï¼{{ this.ConveyorlineOut.data.commandWrite.taskNum }}</div> |
| | | <div class="content ">æçå·ï¼{{ this.ConveyorlineOut.data.commandWrite.barcode }}</div> |
| | | <div class="content ">ç»ç¹å°åï¼{{ this.ConveyorlineOut.data.commandWrite.targetAddress}}</div> |
| | | <div class="content display"> |
| | | <div>æ«ç ç«å°å
¥åºè¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[1] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>å åæºåºåºç«å°è¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[3] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>å åæºå
¥åºç«å°è¯·æ±</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[5] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | <div class="content display"> |
| | | <div>线ä½åºåºå£è¯·æ±ï¼</div> |
| | | <div |
| | | :class="this.ConveyorlineOut.data.writeInteractiveSignal[7] != true ? 'bool_false' : 'bool_true'"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="éç½®åº" id="print-content"> |
| | | |
| | | </el-tab-pane> |
| | | <el-tab-pane label="å容åº" id="print-content"> |
| | | |
| | | </el-tab-pane><el-tab-pane label="髿¸©åº" id="print-content"> |
| | | |
| | | </el-tab-pane> |
| | | <el-tab-pane label="常温åº" id="print-content"> |
| | | |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | <div class="title"></div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | export default { |
| | | setup() { |
| | | return { |
| | | StackerOne: { |
| | | deviceName: "", |
| | | data: {}, |
| | | }, |
| | | ConveyorlineOut: { |
| | | deviceName: "", |
| | | data: { |
| | | command: {}, |
| | | commandWrite: {}, |
| | | writeInteractiveSignal:[], |
| | | }, |
| | | }, |
| | | ConveyorlineIn: { |
| | | deviceName: "", |
| | | data: { |
| | | command: {}, |
| | | commandWrite: {}, |
| | | writeInteractiveSignal:[], |
| | | }, |
| | | } |
| | | } |
| | | |
| | | }, |
| | | methods: { |
| | | intToBitArrayFromBinaryString (num, numBits){ |
| | | // å°æ´æ°è½¬æ¢ä¸ºäºè¿å¶å符串ï¼å¹¶ä½¿ç¨padStartæ¹æ³è¡¥è¶³å°æå®ç使°ï¼åé¢è¡¥0ï¼ |
| | | let binaryString = num.toString(2).padStart(numBits, '0'); |
| | | let bitArray = []; |
| | | for (let i = 0; i < numBits; i++) { |
| | | // ç´æ¥æ ¹æ®å符串ä¸å符æ¯å¦ä¸º'1'æ¥ç¡®å®æ¯ä¸ä½çå¼ï¼è½¬æ¢ä¸ºå¸å°å¼ï¼ |
| | | bitArray.push(binaryString[i] === '1'); |
| | | } |
| | | return bitArray; |
| | | } |
| | | }, |
| | | mounted() { |
| | | eventBus.on('stackerData', eventData => { |
| | | if (eventData.deviceName == "éå1å·å åæº") { |
| | | this.StackerOne.deviceName = eventData.deviceName; |
| | | this.StackerOne.data = eventData.data |
| | | } |
| | | // console.log(eventData); |
| | | console.log(eventData); |
| | | }) |
| | | eventBus.on('locationData', eventData => { |
| | | console.log(eventData); |
| | | if (eventData.deviceName == "éååºåºè¾é线") { |
| | | this.ConveyorlineOut.deviceName = eventData.deviceName; |
| | | this.ConveyorlineOut.data = eventData.data |
| | | } |
| | | if (eventData.data.childDeviceCode == '1018') { |
| | | this.ConveyorlineIn.deviceName = eventData.deviceName; |
| | | this.ConveyorlineIn.data = eventData.data |
| | | let number = eventData.data.commandWrite.writeInteractiveSignal |
| | | this.ConveyorlineIn.data.writeInteractiveSignal = this.intToBitArrayFromBinaryString(number, 8); |
| | | console.log(this.ConveyorlineIn.data.writeInteractiveSignal); |
| | | } |
| | | console.log(eventData); |
| | | }) |
| | | } |
| | | } |
| | |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | } |
| | | |
| | | .bool_true { |
| | | width: 30px; |
| | | height: 20px; |
| | | margin-top: 10px; |
| | | margin-left: 10px; |
| | | background-color: rgb(99, 155, 16); |
| | | } |
| | | |
| | | .bool_info { |
| | | width: 30px; |
| | | height: 10px; |
| | | background-color: #ccc; |
| | | } |
| | | |
| | | .StackerOne { |
| | | width: 100%; |
| | | margin-bottom: 10px; |
| | | padding-left: 30px; |
| | | font-size: 25px; |
| | | border: 1px solid #ccc; |
| | | } |
| | | |
| | | .ConveyorlineOut { |
| | | width: 100%; |
| | | margin-bottom: 10px; |
| | | padding-left: 30px; |
| | | font-size: 25px; |
| | | border: 1px solid #ccc; |
| | | } |
| | | |
| | | .bool_false { |
| | | display: block; |
| | | width: 30px; |
| | | height: 20px; |
| | | margin-top: 10px; |
| | | margin-left: 10px; |
| | | background-color: rgb(204, 71, 71); |
| | | } |
| | | |
| | | .content { |
| | | margin-bottom: 20px; |
| | | } |
| | | .Signal{ |
| | | margin-bottom: 20px; |
| | | color:blueviolet; |
| | | } |
| | | .display { |
| | | display: flex; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="data-left-item"> |
| | | <div class="title">7æ¥è®¢åéé</div> |
| | | <div id="chart-vleft-2" style="height: calc(100% - 30px)"></div> |
| | | <div id="chart-vleft-2" style="height: calc(100% - 30px)"></div> |
| | | <div class="data-foot-line"></div> |
| | | </div> |
| | | </div> |
| | |
| | | /// <returns></returns> |
| | | Dt_Task QueryCompletedConveyorLineTask(int taskNum, string currentAddress); |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·ãå½åå°åæ¥è¯¢ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | Dt_Task QueryBarcodeTask(string barcode, string currentAddress); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä»»å¡å·ãå½åå°åæ¥è¯¢è¾é线æ°å»ºçä»»å¡ |
| | | /// </summary> |
| | |
| | | /// <returns>读åå°çæ°æ®</returns> |
| | | public TRsult GetValue<TEnum, TRsult>(TEnum value, string deviceChildCode) where TEnum : Enum |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»ã {DeviceName} ã"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == value.ToString() && x.DeviceChildCode == deviceChildCode); |
| | | return devicePro == null ? throw new Exception() : (TRsult)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType); |
| | | } |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public bool SendCommand<T>(T command, string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»ã{DeviceName}ã"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (devicePro == null) |
| | | { |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»ã{DeviceName}ã"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "ReadDeviceCommand" && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public T ReadCustomer<T>(string deviceChildCode, string deviceProParamType) where T : IDataTransfer, new() |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»:" + DeviceName); |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»ã{DeviceName}ã"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == deviceProParamType && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | |
| | | where TEnum : Enum |
| | | where TValue : notnull |
| | | { |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»"); |
| | | if (!IsConnected) throw new Exception($"éè®¯è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»ã {DeviceName} ã"); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == @enum.ToString() && x.DeviceChildCode == deviceChildCode); |
| | | return devicePro == null ? throw new Exception() : Communicator.WriteObj(devicePro.DeviceProAddress, devicePro.DeviceDataType, value); |
| | | } |
| | |
| | | /// <param name="startPosi">èµ·ç¹/å½åä½ç½®ã</param> |
| | | /// <param name="endPosi">ç»ç¹ã</param> |
| | | /// <returns>è¿åè·¯ç±å®ä½éåã</returns> |
| | | //public List<Dt_Router> QueryNextRoutes(string startPosi, string endPosi) |
| | | //{ |
| | | // //todo æ¹æ³éä¼å |
| | | // List<Dt_Router> routers = new List<Dt_Router>(); |
| | | // try |
| | | // { |
| | | // List<Dt_Router> dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } }); |
| | | // if (dt_Routers.Count > 0) |
| | | // { |
| | | // foreach (var item in dt_Routers) |
| | | // { |
| | | // if (item.StartPosi == startPosi && !routers.Any(x => x.Id == item.Id)) |
| | | // { |
| | | // routers.Add(item); |
| | | // } |
| | | // else |
| | | // { |
| | | // List<Dt_Router> tempRouters = QueryNextRoutes(startPosi, item.StartPosi); |
| | | // foreach (var router in tempRouters) |
| | | // { |
| | | // if (router.StartPosi == startPosi && !routers.Any(x => x.Id == router.Id)) |
| | | // { |
| | | // routers.Add(router); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // throw new Exception($"è¯¥è·¯å¾æªé
ç½®æé
ç½®é误,è¯·æ£æ¥è®¾å¤è·¯ç±ä¿¡æ¯,èµ·ç¹:ã{startPosi}ã,ç»ç¹:ã{endPosi}ã"); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // //throw new Exception(ex.Message); |
| | | // //è®°å½éè¯¯ä¿¡æ¯ |
| | | // } |
| | | // return routers; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®èµ·ç¹/å½åä½ç½®ãç»ç¹è·åä¸ä¸ä¸ªåèç¹ã |
| | | /// </summary> |
| | | /// <param name="startPosi">èµ·ç¹/å½åä½ç½®ã</param> |
| | | /// <param name="endPosi">ç»ç¹ã</param> |
| | | /// <returns>è¿åè·¯ç±å®ä½éåã</returns> |
| | | public List<Dt_Router> QueryNextRoutes(string startPosi, string endPosi) |
| | | { |
| | | //todo æ¹æ³éä¼å |
| | | // ç¨äºè®°å½å·²ç»è®¿é®è¿çèµ·ç¹åç»ç¹ç»åï¼é¿å
éå¤è®¿é®è¿å
¥æ»å¾ªç¯ |
| | | HashSet<string> visitedRoutes = new HashSet<string>(); |
| | | return QueryNextRoutesInternal(startPosi, endPosi, visitedRoutes); |
| | | } |
| | | |
| | | private List<Dt_Router> QueryNextRoutesInternal(string startPosi, string endPosi, HashSet<string> visitedRoutes) |
| | | { |
| | | List<Dt_Router> routers = new List<Dt_Router>(); |
| | | try |
| | | { |
| | | // æå»ºä¸ä¸ªå¯ä¸æ è¯å½åèµ·ç¹åç»ç¹ç»åçå符串 |
| | | string routeKey = $"{startPosi}_{endPosi}"; |
| | | if (visitedRoutes.Contains(routeKey)) |
| | | { |
| | | // 妿已ç»è®¿é®è¿ï¼ç´æ¥è¿å空å表ï¼é¿å
éå¤è¿å
¥ç¸åçéå½åæ¯ |
| | | return routers; |
| | | } |
| | | visitedRoutes.Add(routeKey); |
| | | |
| | | List<Dt_Router> dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } }); |
| | | if (dt_Routers.Count > 0) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | List<Dt_Router> tempRouters = QueryNextRoutes(startPosi, item.StartPosi); |
| | | List<Dt_Router> tempRouters = QueryNextRoutesInternal(startPosi, item.StartPosi, visitedRoutes); |
| | | foreach (var router in tempRouters) |
| | | { |
| | | if (router.StartPosi == startPosi && !routers.Any(x => x.Id == router.Id)) |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // è¿éå¯ä»¥æ ¹æ®å®é
éæ±æ´å¥½å°å¤çå¼å¸¸ï¼æ¯å¦è®°å½æ¥å¿çï¼ç®ååªæ¯æ³¨éæäºç´æ¥æåºå¼å¸¸ |
| | | //throw new Exception(ex.Message); |
| | | //è®°å½éè¯¯ä¿¡æ¯ |
| | | } |
| | |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=True", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BBGY;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | |
| | | return BaseDal.QueryFirst(x => x.TaskNum == taskNum && x.CurrentAddress == currentAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InFinish || x.TaskState == (int)TaskOutStatusEnum.Line_OutFinish), TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_Task QueryBarcodeTask(string barcode, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.PalletCode == barcode && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä»»å¡å·ãå½åå°åæ¥è¯¢è¾é线æ°å»ºçä»»å¡ |
| | | /// </summary> |
| | |
| | | _noticeService = noticeService; |
| | | } |
| | | |
| | | public async Task Execute(IJobExecutionContext context) |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | try |
| | | { |
| | |
| | | List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode); |
| | | foreach (string childDeviceCode in childDeviceCodes) |
| | | { |
| | | await ProcessDeviceAsync(conveyorLine, childDeviceCode); |
| | | ProcessDeviceAsync(conveyorLine, childDeviceCode); |
| | | } |
| | | |
| | | List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode); |
| | |
| | | { |
| | | Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString()); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private async Task ProcessDeviceAsync(CommonConveyorLine conveyorLine, string childDeviceCode) |
| | | private void ProcessDeviceAsync(CommonConveyorLine conveyorLine, string childDeviceCode) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); |
| | | ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand"); |
| | |
| | | MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType); |
| | | if (method != null) |
| | | { |
| | | command.InteractiveSignal = commandWrite.WriteInteractiveSignal; |
| | | method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, item.ProtocalDetailValue.ObjToInt() }); |
| | | var numRead = item.ProtocalDetailValue.ObjToInt(); |
| | | var numWrite = item.ProtocalDetailValue.ObjToInt() + 1; |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine.DeviceName}ãã{childDeviceCode}ãã{numRead.ToString()}ãä½è¾é线读åä¿¡å·ï¼ã{structs[item.ProtocalDetailValue.ObjToInt()]}ã ã{numWrite}ãä½WCSåå
¥ä¿¡å·ï¼ã{structs[item.ProtocalDetailValue.ObjToInt() + 1]}ã"); |
| | | if (structs[item.ProtocalDetailValue.ObjToInt() + 1] != structs[item.ProtocalDetailValue.ObjToInt()]) |
| | | { |
| | | command.InteractiveSignal = commandWrite.WriteInteractiveSignal; |
| | | method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, item.ProtocalDetailValue.ObjToInt() }); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | DeviceProDTO? devicePro = conveyorLine.DeviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == childDeviceCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | string[] x = devicePro.DeviceProAddress.Split('.'); |
| | | x[x.Length - 1] = (item.ProtocalDetailValue.ObjToInt() + 1).ToString(); |
| | | string DeviceProAddress = string.Join(".", x); |
| | | var writeRead = conveyorLine.Communicator.Read<bool>(DeviceProAddress); |
| | | if (writeRead) |
| | | { |
| | | conveyorLine.Communicator.Write(DeviceProAddress, false); |
| | | //ConveyorLineSendFinish(conveyorLine, childDeviceCode, item.ProtocalDetailValue.ObjToInt(), false); |
| | | } |
| | | |
| | | |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, item.ProtocalDetailValue.ObjToInt(), false); |
| | | |
| | | //DeviceProDTO? devicePro = conveyorLine.DeviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == childDeviceCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | //string[] x = devicePro.DeviceProAddress.Split('.'); |
| | | //x[x.Length - 1] = (item.ProtocalDetailValue.ObjToInt() + 1).ToString(); |
| | | //string DeviceProAddress = string.Join(".", x); |
| | | //var writeRead = conveyorLine.Communicator.Read<bool>(DeviceProAddress); |
| | | //if (writeRead) |
| | | //{ |
| | | // conveyorLine.Communicator.Write(DeviceProAddress, false); |
| | | // //ConveyorLineSendFinish(conveyorLine, childDeviceCode, item.ProtocalDetailValue.ObjToInt(), false); |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | object obj = new |
| | | { |
| | | childDeviceCode, |
| | | command, |
| | | commandWrite |
| | | }; |
| | | _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj }); |
| | | _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj }); |
| | | |
| | | #endregion è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | } |
| | |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¯·æ±æ«ç å
¥åº"); |
| | | |
| | | var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task); |
| | | |
| | | if (task == null && command.Barcode != "NoRead" && command.Barcode.IsNotEmptyOrNull()) |
| | | if (task != null) |
| | | { |
| | | HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray || task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (task == null && command.Barcode != "NoRead" && command.Barcode.IsNotEmptyOrNull()) |
| | | { |
| | | task = _taskService.QueryBarcodeTask(command.Barcode, childDeviceCode); |
| | | if (task == null) |
| | | HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¾é线å
¥åºå®æ"); |
| | | var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); |
| | | if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish) |
| | | { |
| | |
| | | public void RequestOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue) |
| | | { |
| | | var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | ConsoleHelper.WriteSuccessLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¾é线请æ±åºåº,task{task.ToJsonString()}"); |
| | | if (task != null) |
| | | { |
| | | if (command.Barcode == task.PalletCode) |
| | | //if (command.Barcode == task.PalletCode) |
| | | { |
| | | //task.NextAddress = task.NextAddress.Replace("-1", ""); |
| | | //ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | |
| | | var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode); |
| | | if (tasks.Count < index) |
| | | { |
| | | ConsoleHelper.WriteErrorLine($"ã{childDeviceCode}ã请æ±ã{taskType.ToString()}ãä»»å¡,å·²æã{taskType.ToString()}ãä»»å¡ã{tasks.Count}ã,æå¤æ¥æã{index - 1}ã"); |
| | | //ConsoleHelper.WriteErrorLine($"ã{childDeviceCode}ã请æ±ã{taskType.ToString()}ãä»»å¡,å·²æã{taskType.ToString()}ãä»»å¡ã{tasks.Count}ã,æå¤æ¥æã{index - 1}ã"); |
| | | |
| | | #region è°ç¨WMSè·ååºåºä»»å¡ |
| | | |
| | |
| | | using HslCommunication; |
| | | using Newtonsoft.Json; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | |
| | | { |
| | | // ä½¿ç¨æ£å表达å¼å¹é
类似 -æ°å çæ¨¡å¼ï¼å¹¶æ¿æ¢ä¸ºç©ºå符串 |
| | | task.NextAddress = Regex.Replace(task.NextAddress, @"-(\d+)", ""); |
| | | if (Convert.ToInt32(task.NextAddress) > 1999) |
| | | { |
| | | task.NextAddress = (Convert.ToInt32(task.NextAddress) - 1000).ToString(); |
| | | } |
| | | var comm = _mapper.Map<ConveyorLineTaskCommand>(task); |
| | | comm.InteractiveSignal = command.InteractiveSignal; |
| | | return comm; |
| | |
| | | var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | if (task != null) |
| | | { |
| | | //var taskCommand = MapTaskCommand(task, command); |
| | | var next = task.NextAddress; |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | task.NextAddress = next; |
| | | if (task.NextAddress.Contains("JZ")) |
| | | { |
| | | command.Barcode = task.PalletCode; |
| | | command.TaskNum = task.TaskNum; |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | task.TaskState = nextStatus; |
| | | |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¯·æ±æ«ç å
¥åº(æ¯è),ä¸ä¸ç®æ å°åã{taskCommand.TargetAddress}ã"); |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¯·æ±æ«ç å
¥åº(å®ç),ä¸ä¸ç®æ å°åã{task.TargetAddress}ã"); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | } |
| | | else |
| | | { |
| | | //var taskCommand = MapTaskCommand(task, command); |
| | | var next = task.NextAddress; |
| | | var taskCommand = MapTaskCommand(task, command); |
| | | task.NextAddress = next; |
| | | |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | ConsoleHelper.WriteWarningLine($"ã{conveyorLine._deviceName}ãä»»å¡å·ï¼ã{command.TaskNum}ã,æçæ¡ç ï¼ã{command.Barcode}ãå·²å°è¾¾ã{childDeviceCode}ãè¯·æ±æ«ç å
¥åº(æ¯è),ä¸ä¸ç®æ å°åã{taskCommand.TargetAddress}ã"); |
| | | |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ") |
| | | }; |
| | | |
| | | var MOMIpAddress = wmsBase + ipAddress; |
| | | var MOMIpAddress = wmsBase + ipAddress; |
| | | |
| | | var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result; |
| | | WriteInfo("å
¥ç«æ ¡éª", $"ã{childDeviceCode}ãå
¥ç«æ ¡éªè¯·æ±åæ°ã{trayCells.ToJsonString()}ã"); |
| | | WriteInfo("å
¥ç«æ ¡éª", ""); |
| | | WriteInfo("å
¥ç«æ ¡éª", $"ã{childDeviceCode}ãå
¥ç«æ ¡éªè¿ååæ°ã{result}ã"); |
| | | ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result); |
| | | if (result1.Success || task.Remark != "NG") |
| | | var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.ToJsonString()).Result; |
| | | WriteInfo("å
¥ç«æ ¡éª", $"ã{childDeviceCode}ãå
¥ç«æ ¡éªè¯·æ±åæ°ã{trayCells.ToJsonString()}ã"); |
| | | WriteInfo("å
¥ç«æ ¡éª", ""); |
| | | WriteInfo("å
¥ç«æ ¡éª", $"ã{childDeviceCode}ãå
¥ç«æ ¡éªè¿ååæ°ã{result}ã"); |
| | | ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result); |
| | | if (result1.Success || task.Remark != "NG") |
| | | { |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | if (newTask != null) |
| | | { |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | if (newTask != null) |
| | | { |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode); |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task); |
| | | taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode); |
| | | conveyorLine.SendCommand(taskCommand, childDeviceCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | using WIDESEAWCS_Core.HttpContextUser; |
| | | using WIDESEAWCS_DTO.MOM; |
| | | using WIDESEAWCS_IProcessRepository; |
| | | using WIDESEAWCS_ITaskInfo_HtyRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model; |
| | |
| | | private readonly ICacheService _cacheService; |
| | | private readonly INoticeService _noticeService; |
| | | private readonly IDt_StationManagerRepository _stationManagerRepository; |
| | | private readonly ITask_HtyRepository _htyRepository; |
| | | |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository) |
| | | public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository htyRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _cacheService = cacheService; |
| | | _noticeService = noticeService; |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _htyRepository = htyRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | //var x = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | //if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | //Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | ConsoleHelper.WriteColorLine($"ã{commonStackerCrane.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{e.TaskNum}ã", ConsoleColor.Blue); |
| | |
| | | task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | | Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress); |
| | | } |
| | | if(task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TargetAddress == "1359-4") |
| | | { |
| | | var TASKHTY = task.Adapt<Dt_Task_Hty>(); |
| | | _taskRepository.DeleteData(task); |
| | | _htyRepository.AddData(TASKHTY); |
| | | } |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; |
| | | else |
| | | where += $" and {searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; |
| | | where += $" and {searchParametersList[i].Name} = '{searchParametersList[i].Value}'"; |
| | | } |
| | | else |
| | | { |
| | |
| | | using SqlSugar; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçæ¡ç |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æçç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "è´§ä½ID")] |
| | | [ExporterHeader(DisplayName = "è´§ä½ID")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è´§ä½ID")] |
| | | public int LocationId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "è´§ä½ç¼å·")] |
| | | [ExporterHeader(DisplayName = "è´§ä½ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "è´§ä½ç¼å·")] |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ»¡ç |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æ¯å¦å®ç")] |
| | | [ExporterHeader(DisplayName = "æ¯å¦å®ç")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¯å¦æ»¡ç", DefaultValue = "0")] |
| | | public bool IsFull { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ (éå¶\éåæ¶é´) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | [ImporterHeader(Name = "çµè¯æ°é")] |
| | | [ExporterHeader(DisplayName = "çµè¯æ°é")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "çµè¯æ°é")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
³èå·¥åºè¿åæ¶é´ï¼æ³¨æ¶²\éç½®æ¶é¿ï¼ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å·¥åºè¿åæ¶é´")] |
| | | [ExporterHeader(DisplayName = "å·¥åºè¿åæ¶é´")] |
| | | public string LinedProcessFeedbackTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¹å¾åæ°è¿å(éç½®æ¶é¿) |
| | | /// </summary> |
| | | [ImporterHeader(Name = "éç½®æ¶é¿")] |
| | | [ExporterHeader(DisplayName = "éç½®æ¶é¿")] |
| | | public string SpecialParameterDuration { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产产线 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç产产线")] |
| | | [ExporterHeader(DisplayName = "ç产产线")] |
| | | public string ProductionLine { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç¼ç |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åºåç¼ç ")] |
| | | [ExporterHeader(DisplayName = "åºåç¼ç ")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç¼ç ")] |
| | | public string AreaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåºæ¶é´ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åºåºåºæ¶é´")] |
| | | [ExporterHeader(DisplayName = "åºåºåºæ¶é´")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåºåºæ¶é´")] |
| | | public DateTime? OutboundTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°ä¿¡æ¯ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åæ°ä¿¡æ¯")] |
| | | [ExporterHeader(DisplayName = "åæ°ä¿¡æ¯")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åæ°ä¿¡æ¯")] |
| | | public string ParameterInfos { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç¶æ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å建è
")] |
| | | [ExporterHeader(DisplayName = "å建è
")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç¶æ")] |
| | | public int StockStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½åå·¥åº |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å½åå·¥åº")] |
| | | [ExporterHeader(DisplayName = "å½åå·¥åº")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å½åå·¥åº")] |
| | | public string ProcessCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸å·¥åº |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä¸ä¸å·¥åº")] |
| | | [ExporterHeader(DisplayName = "ä¸ä¸å·¥åº")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä¸ä¸å·¥åº")] |
| | | public string NextProcessCode { get; set; } |
| | | |
| | |
| | | LocationType = locType, |
| | | Remark = "", |
| | | Depth = locType > 1 ? (((line - 1) % 4) + 1) == 2 || (((line - 1) % 4) + 1) == 3 ? 1 : 2 : 1, |
| | | RoadwayNo = locType > 1 ? $"CHSC{((line - 1) / 4) + 1}" : $"CHSC{((line - 1) / 2) + 1}", |
| | | RoadwayNo = locType > 1 ? $"JZSC{((line - 1) / 4) + 1}" : $"JZSC{((line - 1) / 2) + 1}", |
| | | LocationStatus = LocationEnum.Free.ObjToInt(), |
| | | AreaId = areaId, |
| | | Creater = "systeam", |
| | |
| | | using Masuit.Tools; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IServices; |
| | | using WIDESEA_Repository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEA_Model; |
| | | |
| | | namespace WIDESEA_StorageTaskServices |
| | | { |
| | |
| | | private readonly ILocationInfoRepository _locationRepository; |
| | | |
| | | private Timer _timer; |
| | | |
| | | public MyBackgroundService(ILogger<MyBackgroundService> logger, ILocationInfoRepository locationRepository, IStockInfoRepository stockInfoRepository, IDt_AreaInfoRepository areaInfoRepository, IDt_TaskRepository taskRepository, IDt_StationManagerRepository stationManagerRepository, ISys_ConfigService configService) |
| | | { |
| | | _logger = logger; |
| | |
| | | _stationManagerRepository = stationManagerRepository; |
| | | _configService = configService; |
| | | } |
| | | |
| | | public Task StartAsync(CancellationToken cancellationToken) |
| | | { |
| | | _timer = new Timer(DoWork, null, 0, 10000); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | private void DoWork(object state) |
| | | { |
| | | try |
| | | { |
| | | var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == "GWSC1"); |
| | | |
| | | if (area == null) { return; } |
| | | var stockInfo = _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // é¢å è½½LocationInfo |
| | | .Includes(x => x.StockInfoDetails) // é¢å è½½StockInfoDetails |
| | |
| | | if (stockInfo.Count <= 0) return; |
| | | foreach (var item in stockInfo) |
| | | { |
| | | |
| | | var hasTask = _taskRepository.QueryFirst(x => x.PalletCode == item.PalletCode); |
| | | if (hasTask != null) |
| | | { |
| | |
| | | task.NextAddress = "002-000-002"; |
| | | // å建任å¡DTO |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | |
| | | |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; |
| | |
| | | _locationRepository.UpdateData(item.LocationInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | ConsoleHelper.WriteSuccessLine($"髿¸©åºåºè°ç¨ï¼" + DateTime.Now.ToString()); |
| | | } |
| | | |
| | | public Task StopAsync(CancellationToken cancellationToken) |
| | | { |
| | | _logger.LogInformation("MyBackgroundService is stopping."); |
| | | _timer?.Change(Timeout.Infinite, 0); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | _timer?.Dispose(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å建任å¡å®ä¾ |
| | |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | |
| | | // å建åå²ä»»å¡å®ä¾æ¨¡å |
| | | var taskHty = CreateHistoricalTask(task); |
| | | |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InQuality) |
| | | { |
| | | await _locationRepository.UpdateDataAsync(locationInf); |
| | | await _task_HtyRepository.AddDataAsync(taskHty); |
| | | await BaseDal.DeleteDataAsync(task); |
| | | return content.OK("å
¥åºä»»å¡å®ææå"); |
| | | } |
| | | // æ ¹æ®æ¯å¦æç»çä¿¡æ¯å建åºåå®ä¾æ¨¡å |
| | | DtStockInfo stock = boxing == null ? CreateEmptyPalletStock(task, locationInf) : CreateFullPalletStock(task, locationInf, boxing); |
| | | |
| | |
| | | AreaCode = area.AreaCode, |
| | | LocationId = loation.Id, |
| | | StockInfoDetails = boxDetail, |
| | | ProcessCode = boxing.ProcessCode, |
| | | NextProcessCode = boxing.NextProcessCode, |
| | | Remark = boxing.BoxingInfoDetails.Count().ToString(), |
| | | }; |
| | | |
| | | // å¤ç请æ±åæ° |
| | |
| | | PalletCode = stock.PalletCode, |
| | | SourceAddress = input.Position, |
| | | CurrentAddress = input.Position, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskState = stock.LocationInfo.RoadwayNo.Contains("CH") ? (int)TaskInStatusEnum.InNew : (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskInboundTypeEnum.InQuality, |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | Creater = "System", // ä¿®æ£æ¼åé误 |
| | |
| | | TaskId = 0, |
| | | }; |
| | | |
| | | var taskDTO = CreateTaskDTO(task); |
| | | var taskDTO = CreateTaskDTO(taskNew); |
| | | BaseDal.AddData(taskNew); |
| | | return content.OK(data: taskDTO); |
| | | // TODOè´¨æ£ååº |
| | | } |
| | | |
| | | // æ ¹æ®ä½ç½®æ¥è¯¢åºåä¿¡æ¯ |
| | | var area = await QueryAreaInfoByPosition(input.Position.Replace("-1", "")); |
| | | var areaCode = Regex.Replace(input.Position, @"-(\d+)", ""); |
| | | var area = await QueryAreaInfoByPosition(areaCode); |
| | | if (area == null) |
| | | { |
| | | return content.Error("该ç¹ä½ä¸å¨åºåå表ä¸åå¨"); |
| | |
| | | TaskType = task.TaskType, |
| | | }; |
| | | return content.OK(data: task); |
| | | } |
| | | } |
| | | |
| | | var stationManagers = _stationManagerRepository.QueryData(x => x.stationType == 6 && x.stationChildCode == input.Position).FirstOrDefault(); |
| | | if (stationManagers == null) |
| | |
| | | |
| | | #endregion ä»»å¡ç¶ææ´æ¹ |
| | | |
| | | #region åºåºè§£ç |
| | | |
| | | /// <summary> |
| | | /// åºåºè§£çæ¥å£ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> OutUnblockInterface(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = await BaseDal.QueryFirstAsync(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | return content.Error("æªæ¾å°ä»»å¡"); |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutFinish; |
| | | var taskHty = CreateHistoricalTask(task); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | #endregion åºåºè§£ç |
| | | |
| | | #region æå®ä»»å¡åºåº |
| | | |
| | | public async Task<WebResponseContent> CreateAndSendOutboundTask(string locationCode, string palletCode) |
| | |
| | | taskType = (int)TaskOutboundTypeEnum.OutQuality; |
| | | else |
| | | taskType = (int)TaskOutboundTypeEnum.OutTray; |
| | | // å建并添å ä»»å¡å°æ°æ®åº |
| | | task = CreateTask(stockInfo, "1020-1", taskType); |
| | | |
| | | if (stockInfo.AreaCode.Contains("CH")) |
| | | { |
| | | // å建并添å ä»»å¡å°æ°æ®åº |
| | | task = CreateTask(stockInfo, "1020-1", taskType); |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.LocationInfo.RoadwayNo == "JZSC1") |
| | | { |
| | | task = CreateTask(stockInfo, "1359-4", taskType); |
| | | } |
| | | } |
| | | //var taskId = await BaseDal.AddDataAsync(task); |
| | | //if (taskId <= 0) |
| | | //{ |
| | |
| | |  |
| | | using log4net.Core; |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using Masuit.Tools.Models; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using SixLabors.Fonts.Tables.AdvancedTypographic; |
| | | using System.Diagnostics; |
| | | using WIDESEA_Common; |
| | | using Masuit.Tools; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IStorageBasicRepository; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEA_StorageTaskRepository; |
| | | using WIDESEA_StoragIntegrationServices; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEA_StorageTaskServices; |
| | | |
| | | public partial class Dt_TaskService : ServiceBase<Dt_Task, IDt_TaskRepository>, IDt_TaskService |
| | | { |
| | | |
| | | #region åºåºä»»å¡å®æ |
| | | |
| | | |
| | | //public async Task<WebResponseContent> CompleteStackTaskAsync(Dt_Task task, DtStockInfo stock) |
| | | //{ |
| | |
| | | #endregion ä»»å¡å®æ |
| | | |
| | | #region 请æ±ä»»å¡å
¥åº |
| | | |
| | | /// <summary> |
| | | /// 请æ±å
¥åº |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // è°ç¨CreateNewTaskæ¹æ³ï¼å建æ°ä»»å¡ |
| | | content = await CreateNewTask(input); |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | /// <param name="input">请æ±åæ°</param> |
| | | /// <param name="flag">宿¡ç©ºæ¡æ è¯</param> |
| | |
| | | var task = await CreateNewTaskByStation(input, stationinfo); |
| | | |
| | | // å°è¯æ·»å æ°ä»»å¡ |
| | | if (task == null) return content.Error() ; |
| | | if (task == null) return content.Error(); |
| | | var taskId = await BaseDal.AddDataAsync(task); |
| | | bool isResult = taskId > 0; |
| | | if (isResult) |
| | |
| | | TaskType = task.TaskType, |
| | | }; |
| | | content.OK(data: taskDTO); |
| | | |
| | | |
| | | } |
| | | else |
| | | content.Error("æ·»å ä»»å¡å¤±è´¥"); |
| | |
| | | } |
| | | |
| | | #region ç´æ¥åºåºä»»å¡ |
| | | |
| | | private async Task<Dt_Task> CreateInToOutTaskAsync(RequestTaskDto input, Dt_StationManager stationManager) |
| | | { |
| | | //if (stationManager.stationType != 5) throw new Exception("é误çè°å"); |
| | | |
| | | |
| | | input.EquiCodeMOM = "24MEJQ11-1006-1"; |
| | | |
| | |
| | | |
| | | return task; |
| | | } |
| | | #endregion |
| | | |
| | | #endregion ç´æ¥åºåºä»»å¡ |
| | | |
| | | #region å
¥åºä»»å¡ |
| | | |
| | | private async Task<Dt_Task> CreateInTaskAsync(RequestTaskDto input, Dt_StationManager stationManager) |
| | | { |
| | | if (stationManager.stationType != 1 && stationManager.stationType != 6) throw new Exception("é误çè°å"); |
| | |
| | | |
| | | return task; |
| | | } |
| | | #endregion |
| | | |
| | | #endregion å
¥åºä»»å¡ |
| | | |
| | | #region åºä½åé
|
| | | |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | /// <param name="requestTask">请æ±åæ°</param> |
| | | /// <returns></returns> |
| | | private async Task<DtLocationInfo> RequestLocation(RequestTaskDto requestTask, bool isCheckRequest = false) |
| | | { |
| | | #region è·åè´§ä½ |
| | | |
| | | try |
| | | { |
| | | List<DtLocationInfo> locations; |
| | |
| | | Console.WriteLine(err.Message.ToString()); |
| | | return null; |
| | | } |
| | | |
| | | #endregion è·åè´§ä½ |
| | | } |
| | | #endregion |
| | | |
| | | #endregion åºä½åé
|
| | | |
| | | // è·åå·¥èºç³è¯· |
| | | private async Task<ProcessApplyDto> GetProcessApplyAsync(RequestTaskDto input, ResultTrayCellsStatus content) |
| | |
| | | }; |
| | | } |
| | | |
| | | #endregion 请æ±ç©ºæ¡åºåº |
| | | #endregion 请æ±ä»»å¡å
¥åº |
| | | |
| | | public async Task<Dt_Task> CreateEmptyOutTaskAsync(RequestTaskDto input, Dt_StationManager stationManager) |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | #region ç´æ¥åºåºä»»å¡å®æ |
| | | |
| | | public async Task<WebResponseContent> CompleteInToOutTaskAsync(Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion ç´æ¥åºåºä»»å¡å®æ |
| | | |
| | | #region MyRegion |
| | | private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo fromLocation,DtLocationInfo toLocation, int taskId) |
| | | |
| | | private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo fromLocation, DtLocationInfo toLocation, int taskId) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | try |
| | |
| | | throw new Exception(err.Message); // æåºå¼å¸¸ä»¥ä¾¿å¤é¨æè· |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion MyRegion |
| | | |
| | | #region æ£æµé«æ¸©åºæ¯å¦æå¯åºåºåºå |
| | | |
| | | public WebResponseContent StockCheckingAsync() |
| | | { |
| | | |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | try |
| | | { |
| | |
| | | if (stockInfo.Count <= 0) continue; |
| | | foreach (var item in stockInfo) |
| | | { |
| | | |
| | | var hasTask = BaseDal.QueryFirst(x => x.PalletCode == item.PalletCode); |
| | | if (hasTask != null) |
| | | { |
| | |
| | | task.NextAddress = "002-000-002"; |
| | | // å建任å¡DTO |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | |
| | | |
| | | var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue; |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion æ£æµé«æ¸©åºæ¯å¦æå¯åºåºåºå |
| | | |
| | | #region 常温补空æçè³å容 |
| | | |
| | |
| | | return content; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion 常温补空æçè³å容 |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Masuit.Tools; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Repository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using Masuit.Tools; |
| | | |
| | | namespace WIDESEA_StorageTaskServices; |
| | | |
| | | |
| | | public partial class Dt_TaskService : ServiceBase<Dt_Task, IDt_TaskRepository>, IDt_TaskService |
| | | { |
| | |
| | | { |
| | | case "CH01": |
| | | return "CH001"; |
| | | |
| | | case "JZ01": |
| | | return "JZ001"; |
| | | |
| | | case "GW01": |
| | | return "GWSC1"; |
| | | |
| | | case "CW01": |
| | | return "CWSC1"; |
| | | |
| | | case "CW02": |
| | | return "CWSC2"; |
| | | |
| | | default: |
| | | return string.Empty; |
| | | } |
| | |
| | | { |
| | | return await _areaInfoRepository.QueryFirstAsync(x => x.Spare1.Contains(position)); |
| | | } |
| | | } |
| | | } |