Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
# Conflicts:
# 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/ProOutOrderService.cs
| | |
| | | <meta name="description" content="" /> |
| | | <link rel="icon" href="<%= BASE_URL %>wcslogo.png"> |
| | | <title><%= htmlWebpackPlugin.options.title %></title> |
| | | <script src="webconfig.js"></script> |
| | | </head> |
| | | |
| | | <body> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | window.webConfig = { |
| | | "webApiDevelopment": "http://localhost:9291/", |
| | | "webApiProduction": "http://localhost:9291/", |
| | | "webApiDebug": "http://localhost:9291/", |
| | | "webSocketUrl": "ws://localhost:9260/", |
| | | } |
| | |
| | | }, |
| | | updateLoadingState(state, flag) { |
| | | state.isLoading = flag |
| | | }, |
| | | |
| | | |
| | | uphomedata(state, data) { |
| | | // console.log('123',data); |
| | | |
| | | state.homedata = data; |
| | | // console.log('12state.homedata3',state.homedata); |
| | | } |
| | | |
| | | }, getters: { |
| | | getPermission: (state) => (path) => { //è°ç¨æ¹å¼ store.getters.getPermission('sys_User') |
| | | if (!path) return state.permission; |
| | |
| | | }, |
| | | onLoading(context, flag) { |
| | | context.commit("updateLoadingState", flag); |
| | | }, |
| | | |
| | | sethomedata(context, data) { |
| | | context.commit("uphomedata", data); |
| | | } |
| | | } |
| | | }) |
| | |
| | | <template> |
| | | <div class="title"></div> |
| | | <div class="warehouse-dashboard"> |
| | | <!-- å¯¼èªæ --> |
| | | <nav class="navbar"> |
| | | <div class="nav-container"> |
| | | <h1 class="logo">ä»åºè°åº¦ç³»ç»</h1> |
| | | <ul class="nav-links"> |
| | | <li |
| | | v-for="(warehouse, index) in warehouses" |
| | | :key="index" |
| | | :class="{ active: activeWarehouse === index }" |
| | | @click="switchWarehouse(index)" |
| | | > |
| | | {{ warehouse.name }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </nav> |
| | | |
| | | <!-- 主å
å®¹åº - å¨ææ¸²æéä¸çä»åºé¡µé¢ --> |
| | | <main class="content-area"> |
| | | <component :is="currentComponent" class="warehouse-content"></component> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, reactive } from 'vue' |
| | | import { ref, computed } from 'vue'; |
| | | // 导å
¥å个ä»åºçç»ä»¶ |
| | | import BoardWarehouse from './deviceMonitoring/BoardWarehouse.vue'; |
| | | import TestFrameWarehouse from './deviceMonitoring/TestFrameWarehouse.vue'; |
| | | import SolderMaskWarehouse from './deviceMonitoring/SolderMaskWarehouse.vue'; |
| | | import PpWarehouse from './deviceMonitoring/PpWarehouse.vue'; |
| | | import InkWarehouse from './deviceMonitoring/InkWarehouse.vue'; |
| | | import AuxiliaryWarehouse from './deviceMonitoring/AuxiliaryWarehouse.vue'; |
| | | import DryFilmWarehouse from './deviceMonitoring/DryFilmWarehouse.vue'; |
| | | |
| | | export default { |
| | | setup() { |
| | | return { |
| | | // å®ä¹ä»åºå表 |
| | | const warehouses = [ |
| | | { name: 'æ¿æä»', component: BoardWarehouse }, |
| | | { name: 'æµè¯æ¶ä»', component: TestFrameWarehouse }, |
| | | { name: 'é»çä»', component: SolderMaskWarehouse }, |
| | | { name: 'PPä»', component: PpWarehouse }, |
| | | { name: '油墨ä»', component: InkWarehouse }, |
| | | { name: 'è¾
æä»', component: AuxiliaryWarehouse }, |
| | | { name: 'æåä»', component: BoardWarehouse }, |
| | | { name: 'å¹²èä»', component: DryFilmWarehouse}, |
| | | ]; |
| | | |
| | | } |
| | | // å½åéä¸çä»åºç´¢å¼ |
| | | const activeWarehouse = ref(0); |
| | | |
| | | // 忢ä»åº |
| | | const switchWarehouse = (index) => { |
| | | activeWarehouse.value = index; |
| | | }; |
| | | |
| | | // æ ¹æ®éä¸çä»åºè·åå½åè¦æ¸²æçç»ä»¶ |
| | | const currentComponent = computed(() => { |
| | | return warehouses[activeWarehouse.value].component; |
| | | }); |
| | | |
| | | return { |
| | | warehouses, |
| | | activeWarehouse, |
| | | switchWarehouse, |
| | | currentComponent |
| | | }; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | line-height: 70vh; |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | .warehouse-dashboard { |
| | | display: flex; |
| | | flex-direction: column; |
| | | min-height: 100vh; |
| | | } |
| | | </style> |
| | | |
| | | .navbar { |
| | | background-color: #2c3e50; |
| | | color: white; |
| | | padding: 0 20px; |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .nav-container { |
| | | max-width: 1200px; |
| | | margin: 0 auto; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 60px; |
| | | } |
| | | |
| | | .logo { |
| | | margin: 0; |
| | | font-size: 1.5rem; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .nav-links { |
| | | display: flex; |
| | | list-style: none; |
| | | margin: 0; |
| | | padding: 0; |
| | | gap: 1px; |
| | | } |
| | | |
| | | .nav-links li { |
| | | padding: 0 15px; |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | background-color: #34495e; |
| | | } |
| | | |
| | | .nav-links li:hover { |
| | | background-color: #3d5a7c; |
| | | } |
| | | |
| | | .nav-links li.active { |
| | | background-color: #3498db; |
| | | font-weight: 500; |
| | | box-shadow: inset 0 -3px 0 #2980b9; |
| | | } |
| | | |
| | | .content-area { |
| | | flex: 1; |
| | | padding: 20px; |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | .warehouse-content { |
| | | background-color: white; |
| | | border-radius: 8px; |
| | | padding: 20px; |
| | | min-height: calc(100vh - 100px); |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); |
| | | } |
| | | </style> |
| | |
| | | <div class="vol-aside" :style="{ width: menuWidth + 'px' }"> |
| | | <div class="header" :style="{ width: menuWidth - 1 + 'px' }"> |
| | | <img v-show="!isCollapse" v-bind:src="logo" /> |
| | | <i @click="toggleLeft" class="el-icon-s-fold collapse-menu" /> |
| | | <i |
| | | @click="toggleLeft" |
| | | class="collapse-menu" |
| | | :class="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" |
| | | /> |
| | | </div> |
| | | <div class="vol-menu"> |
| | | <el-scrollbar style="height: 100%"> |
| | | <VolMenu :currentMenuId="currentMenuId" :on-select="onSelect" :enable="true" :open-select="false" |
| | | :isCollapse="isCollapse" :list="menuOptions"></VolMenu> |
| | | <VolMenu |
| | | :currentMenuId="currentMenuId" |
| | | :on-select="onSelect" |
| | | :enable="true" |
| | | :open-select="false" |
| | | :isCollapse="isCollapse" |
| | | :list="menuOptions" |
| | | ></VolMenu> |
| | | </el-scrollbar> |
| | | </div> |
| | | </div> |
| | | <div class="vol-container" :style="{ left: menuWidth - 1 + 'px' }"> |
| | | <div class="vol-header"> |
| | | <div class="project-name">WCS</div> |
| | | <div class="project-name">WMS</div> |
| | | <div class="header-text"> |
| | | <!-- <div class="h-link"> |
| | | <div class="h-link"> |
| | | <a |
| | | href="javascript:void(0)" |
| | | @click="to(item)" |
| | |
| | | })" |
| | | :key="index" |
| | | > |
| | | <span v-if="!item.icon"> {{ item.text }}</span> |
| | | <span v-if="!item.icon">{{ item.text }}</span> |
| | | <i v-else :class="item.icon"></i> |
| | | </a> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div class="header-info"> |
| | | <div class="h-link"> |
| | | <a href="javascript:void(0)" @click="to(item)" v-for="(item, index) in links.filter((c) => { |
| | | return c.icon; |
| | | })" :key="index"> |
| | | <span> {{ item.text }}</span> |
| | | <a |
| | | href="javascript:void(0)" |
| | | @click="to(item)" |
| | | v-for="(item, index) in links.filter((c) => { |
| | | return c.icon; |
| | | })" |
| | | :key="index" |
| | | > |
| | | <span v-if="!item.icon">{{ item.text }}</span> |
| | | <i v-else :class="item.icon"></i> |
| | | </a> |
| | | </div> |
| | | <!--æ¶æ¯ç®¡ç--> |
| | | |
| | | <div class="h-link" @click="messageModel = true"> |
| | | <a> |
| | | <i class="el-icon-message-solid"> |
| | | <el-badge |
| | | :value="messageList.length" |
| | | :type="messageList.length > 0 ? 'danger' : 'success'" |
| | | class="item" |
| | | style="width: 10px" |
| | | ></el-badge> |
| | | </i> |
| | | </a> |
| | | </div> |
| | | <div> |
| | | <img class="user-header" :src="userImg" :onerror="errorImg" /> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="vol-path"> |
| | | <el-tabs @tab-click="selectNav" @tab-remove="removeNav" @contextmenu.prevent="bindRightClickMenu(false)" |
| | | type="border-card" class="header-navigation" v-model="selectId" :strtch="false"> |
| | | <el-tab-pane v-for="(item, navIndex) in navigation" type="card" :name="navIndex + ''" :closable="navIndex > 0" |
| | | :key="navIndex" :label="item.name"> |
| | | <el-tabs |
| | | @tab-click="selectNav" |
| | | @tab-remove="removeNav" |
| | | @contextmenu.prevent="bindRightClickMenu(false)" |
| | | type="border-card" |
| | | class="header-navigation" |
| | | v-model="selectId" |
| | | :strtch="false" |
| | | > |
| | | <el-tab-pane |
| | | v-for="(item, navIndex) in navigation" |
| | | type="card" |
| | | :name="navIndex + ''" |
| | | :closable="navIndex > 0" |
| | | :key="navIndex" |
| | | :label="item.name" |
| | | > |
| | | <span style="display: none">{{ navIndex }}</span> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | <el-button link @click="closeTabs()"> |
| | | <i class="el-icon-close"></i> |
| | | {{ |
| | | navigation.length == 2 ? "å
³éèå" : "å
³éææ" |
| | | }}</el-button> |
| | | navigation.length == 2 ? "å
³éèå" : "å
³éææ" |
| | | }} |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.left"> |
| | | <el-button link @click="closeTabs('left')"><i class="el-icon-back"></i>å
³é左边</el-button> |
| | | <el-button link @click="closeTabs('left')"> |
| | | <i class="el-icon-back"></i>å
³é左边 |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.right"> |
| | | <el-button link @click="closeTabs('right')"> |
| | | <i class="el-icon-right"></i>å
³éå³è¾¹</el-button> |
| | | <i class="el-icon-right"></i>å
³éå³è¾¹ |
| | | </el-button> |
| | | </li> |
| | | <li v-show="visibleItem.other"> |
| | | <el-button link @click="closeTabs('other')"><i class="el-icon-right"></i>å
³éå
¶ä» |
| | | <el-button link @click="closeTabs('other')"> |
| | | <i class="el-icon-right"></i>å
³éå
¶ä» |
| | | </el-button> |
| | | </li> |
| | | </ul> |
| | |
| | | <loading v-show="$store.getters.isLoading()"></loading> |
| | | <router-view v-slot="{ Component }"> |
| | | <keep-alive> |
| | | <component :is="Component" :key="$route.name" |
| | | v-if="!$route.meta || ($route.meta && !$route.meta.hasOwnProperty('keepAlive'))" /> |
| | | <component |
| | | :is="Component" |
| | | :key="$route.name" |
| | | v-if=" |
| | | !$route.meta || |
| | | ($route.meta && !$route.meta.hasOwnProperty('keepAlive')) |
| | | " |
| | | /> |
| | | </keep-alive> |
| | | <component :is="Component" :key="$route.name" v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')" /> |
| | | <component |
| | | :is="Component" |
| | | :key="$route.name" |
| | | v-if="$route.meta && $route.meta.hasOwnProperty('keepAlive')" |
| | | /> |
| | | </router-view> |
| | | </el-scrollbar> |
| | | </div> |
| | | </div> |
| | | <el-drawer title="鿩䏻é¢" v-model="drawer_model" direction="rtl" destroy-on-close> |
| | | <div class="theme-selector"> |
| | | <div @click="changeTheme(item.name)" class="item" v-for="(item, index) in theme_color" :key="index" |
| | | :style="{ background: item.color }"> |
| | | <div v-show="item.leftColor" :style="{ background: item.leftColor }" style="height: 100%; width: 20px" |
| | | class="t-left"></div> |
| | | <div |
| | | @click="changeTheme(item.name)" |
| | | class="item" |
| | | v-for="(item, index) in theme_color" |
| | | :key="index" |
| | | :style="{ background: item.color }" |
| | | > |
| | | <div |
| | | v-show="item.leftColor" |
| | | :style="{ background: item.leftColor }" |
| | | style="height: 100%; width: 20px" |
| | | class="t-left" |
| | | ></div> |
| | | <div class="t-right"></div> |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | | |
| | | <el-drawer title="æ¶æ¯å表" v-model="messageModel" direction="rtl" destroy-on-close> |
| | | <el-drawer title="æ¶æ¯å表" v-model="messageModel" direction="rtl" destroy-on-close size="40%"> |
| | | <Message :list="messageList"></Message> |
| | | </el-drawer> |
| | | </div> |
| | |
| | | watch, |
| | | onMounted, |
| | | getCurrentInstance, |
| | | h |
| | | } from "vue"; |
| | | import { useRouter, useRoute } from "vue-router"; |
| | | import store from "../store/index"; |
| | | import http from "@/../src/api/http.js"; |
| | | import { ElNotification } from "element-plus"; |
| | | import { useStore } from "vuex"; |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | VolMenu, |
| | | loading, |
| | | Message, |
| | | Message |
| | | }, |
| | | |
| | | data() { |
| | |
| | | rightTabs: true, |
| | | otherTabs: true, |
| | | menuLeft: 0, |
| | | menuTop: 0, |
| | | menuTop: 0 |
| | | |
| | | // contextMenuVisible: false, // å³é®å
³éæ¾/é |
| | | }; |
| | | }, |
| | | setup(props, context) { |
| | | let client = ref(null); |
| | | |
| | | // è·åå
¨å±å±æ§åæ¹æ³ |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | |
| | | { name: "orange2", color: "#ff9900", leftColor: "rgb(232 141 5)" }, |
| | | { name: "green", color: "rgb(25, 190, 107)" }, |
| | | { name: "green2", color: "rgb(25, 190, 107)", leftColor: "#019e4f" }, |
| | | { name: "white", color: "#fff" }, |
| | | { name: "white", color: "#fff" } |
| | | ]); |
| | | const links = ref([ |
| | | // { |
| | | // text: "æ¡æ¶è§é¢", |
| | | // path: "https://www.cctalk.com/m/group/90268531", |
| | | // id: -3, |
| | | // }, |
| | | // { text: "大屿°æ®", path: "/bigdata", id: -3 }, |
| | | // { |
| | | // text: "æ¡æ¶ææ¡£", |
| | | // path: "http://v2.volcore.xyz/document/guide", |
| | | // id: -2, |
| | | // }, { |
| | | // text: "æ¡æ¶ä¼ä¸ç", |
| | | // path: "http://pro.volcore.xyz/", |
| | | // id: 10, |
| | | // }, |
| | | { text: "个人ä¸å¿", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" }, |
| | | { |
| | | text: "å®å
¨éåº", |
| | | path: "/login", |
| | | id: -4, |
| | | icon: "el-icon-switch-button", |
| | | }, |
| | | icon: "el-icon-switch-button" |
| | | } |
| | | ]); |
| | | const errorImg = ref( |
| | | 'this.src="' + require("@/assets/imgs/error-img.png") + '"' |
| | |
| | | //2022.05.29å¢å tabé项ä¸èåèå¨åè½ |
| | | const currentMenuId = ref(0); |
| | | const userName = ref("--"); |
| | | const userTrueName = ref("--"); |
| | | const userInfo = ref({}); |
| | | const visibleItem = reactive({ |
| | | left: false, |
| | | right: false, |
| | | all: false, |
| | | other: false, |
| | | other: false |
| | | }); |
| | | const userImg = ref(""); |
| | | const navigation = reactive([ |
| | | { orderNo: "0", id: "1", name: "é¦é¡µ", path: "/home" }, |
| | | { orderNo: "0", id: "1", name: "é¦é¡µ", path: "/home" } |
| | | ]); |
| | | const logo = ref(imgUrl); |
| | | const theme = ref("blue2"); |
| | |
| | | }, |
| | | hide() { |
| | | toggleLeft(); |
| | | }, |
| | | } |
| | | }; |
| | | const changeTheme = (name) => { |
| | | const Store = useStore(); |
| | | const s = ref(null); |
| | | |
| | | const handleMessage = e => { |
| | | if (e) { |
| | | s.value = e.data; |
| | | console.log("WebSocket æ¶å°æ¶æ¯: ", e.data); |
| | | store.dispatch("sethomedata", s.value); |
| | | let data = JSON.parse(e.data); |
| | | messageList.push(data); |
| | | ElNotification({ |
| | | title: data.title, |
| | | message: h("i", { style: "color: teal" }, data.message), |
| | | position: "bottom-right" |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const createSocket = url => { |
| | | //console.log(url); |
| | | |
| | | //å建WebSocketè¿æ¥ |
| | | //"ws://127.0.0.1:9295/admin" |
| | | //client = new WebSocket("ws://192.168.0.250:9260/"); |
| | | client = new WebSocket("ws:localhost:9260/"); |
| | | client.onopen = function() { |
| | | //client.onmessage = handleMessage; |
| | | // store.commit("setWebsocket", client); |
| | | console.log("WebSocket è¿æ¥æå"); |
| | | }; |
| | | |
| | | client.onmessage = function(event) { |
| | | // console.log("WebSocket æ¶å°æ¶æ¯: ", event); |
| | | |
| | | if (event != undefined) { |
| | | store.dispatch("sethomedata", JSON.parse(event.data)); |
| | | } |
| | | // handleMessage(event); |
| | | }; |
| | | |
| | | client.onclose = function() { |
| | | console.log("WebSocket è¿æ¥å
³é"); |
| | | setTimeout(createSocket, 10000); |
| | | }; |
| | | |
| | | client.onerror = function(err) { |
| | | console.log("WebSocket è¿æ¥é误: ", err); |
| | | }; |
| | | client.onmessage(); |
| | | }; |
| | | |
| | | const changeTheme = name => { |
| | | if (theme.value != name) { |
| | | theme.value = name; |
| | | } |
| | | localStorage.setItem("vol3_theme", name); |
| | | }; |
| | | const to = (item) => { |
| | | const to = item => { |
| | | /* 2020.07.31å¢å æå¨æå¼tabs*/ |
| | | if (item.path == "#") { |
| | | window.open("https://github.com/cq-panda/Vue.NetCore"); |
| | | return; |
| | | } |
| | | if (item.path.indexOf("http") != -1) { |
| | | window.open(item.path); |
| | | return; |
| | | } |
| | | if (typeof item == "string" || item.path == "/login") { |
| | | if (item == "/login" || item.path == "/login") { |
| | | //确认æ¯å¦éåº |
| | | store.commit("clearUserInfo", ""); |
| | | window.location.href = "/"; |
| | | return; |
| | |
| | | }; |
| | | const open = (item, useRoute) => { |
| | | /* 2020.07.31å¢å æå¨æå¼tabs*/ |
| | | let _index = navigation.findIndex((x) => { |
| | | let _index = navigation.findIndex(x => { |
| | | return x.path == item.path; |
| | | }); |
| | | if (_index == -1) { |
| | |
| | | id: item.id + "", |
| | | name: item.name || item.text || "æ æ é¢", |
| | | path: item.path, |
| | | query: item.query, //2021.03.20ä¿®å¤èªå®ä¹äºæ¬¡æå¼$tabsæ¶åæ°ä¸¢å¤±çé®é¢ |
| | | query: item.query //2021.03.20ä¿®å¤èªå®ä¹äºæ¬¡æå¼$tabsæ¶åæ°ä¸¢å¤±çé®é¢ |
| | | }); |
| | | //æ°æå¼çtabç§»è³æåä¸ä¸ªé项 |
| | | selectId.value = navigation.length - 1 + ""; |
| | |
| | | } |
| | | currentMenuId.value = item.id * 1; |
| | | // tabèåç»å®å³é®äºä»¶ |
| | | proxy.$nextTick(function (e) { |
| | | proxy.$nextTick(function(e) { |
| | | proxy.bindRightClickMenu(true); |
| | | }); |
| | | }; |
| | | const close = (path) => { |
| | | const close = path => { |
| | | /* 2020.07.31å¢å æå¨æå¼tabs*/ |
| | | let index = navigation.findIndex((x) => { |
| | | let index = navigation.findIndex(x => { |
| | | return x.path == path; |
| | | }); |
| | | if (index == -1) { |
| | |
| | | } |
| | | removeNav(index); |
| | | }; |
| | | const setItem = (item) => { |
| | | const setItem = item => { |
| | | /* 2020.07.31å¢å æå¨æå¼tabs*/ |
| | | localStorage.setItem( |
| | | window.location.origin + "_tabs", |
| | |
| | | let nav = localStorage.getItem(window.location.origin + "_tabs"); |
| | | return nav ? JSON.parse(nav) : null; |
| | | }; |
| | | const selectNav = (item) => { |
| | | const selectNav = item => { |
| | | //å级elementæ£å¼çä¿®æ¹ |
| | | selectId.value = item.props.name; |
| | | let _path = navigation[item.index].path; |
| | | currentMenuId.value = ( |
| | | menuOptions.value.find((c) => { |
| | | menuOptions.value.find(c => { |
| | | return c.path == _path; |
| | | }) || { id: 0 } |
| | | ).id; |
| | | |
| | | router.push({ |
| | | path: navigation[item.index].path, |
| | | query: navigation[item.index].query, |
| | | query: navigation[item.index].query |
| | | }); |
| | | }; |
| | | |
| | | const removeNav = (_index) => { |
| | | const removeNav = _index => { |
| | | return new Promise(() => { |
| | | //å
³éçå½å项,跳转å°åä¸ä¸ªé¡µé¢ |
| | | if (selectId.value == _index + "") { |
| | |
| | | router.push({ |
| | | path: navigation[_index - 1].path, |
| | | //2022.06.27ä¿®å¤tabsäºæ¬¡åæ¢å忰䏢失çé®é¢ |
| | | query: navigation[_index - 1].query, |
| | | query: navigation[_index - 1].query |
| | | }); |
| | | navigation.splice(_index, 1); |
| | | selectId.value = selectId.value - 1 + ""; |
| | |
| | | } |
| | | navigation.splice(_index, 1); |
| | | currentMenuId.value = ( |
| | | menuOptions.value.find((c) => { |
| | | menuOptions.value.find(c => { |
| | | return c.path == navigation[selectId.value * 1].path; |
| | | }) || { id: 0 } |
| | | ).id; |
| | | }); |
| | | }; |
| | | |
| | | const getSelectMenuName = (id) => { |
| | | return menuOptions.value.find(function (x) { |
| | | const getSelectMenuName = id => { |
| | | return menuOptions.value.find(function(x) { |
| | | return x.id == id; |
| | | }); |
| | | }; |
| | | const onSelect = (treeId) => { |
| | | const onSelect = treeId => { |
| | | /* 2020.07.31å¢å æå¨æå¼tabs*/ |
| | | var item = getSelectMenuName(treeId); |
| | | open(item, false); |
| | |
| | | * æ¾ç¤ºå³é®èå |
| | | * @param {*} e äºä»¶å¯¹è±¡ |
| | | */ |
| | | const openTabsMenu = function (e) { |
| | | const openTabsMenu = function(e) { |
| | | e.preventDefault(); // 鲿¢é»è®¤èåå¼¹åº |
| | | let tabId = e.target.id.split("-")[1] * 1; |
| | | |
| | |
| | | const toHome = () => { |
| | | open({ |
| | | text: navigation[0].name, |
| | | path: navigation[0].path, |
| | | path: navigation[0].path |
| | | }); |
| | | }; |
| | | /** |
| | | * å
³éå
¶å®æ ç¾é¡µ |
| | | * @param {*} par å
³éç±»å(left,right,other) |
| | | */ |
| | | const closeTabs = (value) => { |
| | | const closeTabs = value => { |
| | | let _menuId = navigation[selectId.value * 1].id; |
| | | let currnetIndex = selectId.value * 1; // navigation.findIndex(c => { return c.id == selectId.value }); |
| | | switch (value) { |
| | |
| | | } |
| | | } |
| | | selectId.value = |
| | | navigation.findIndex((c) => { |
| | | navigation.findIndex(c => { |
| | | return c.id == _menuId; |
| | | }) + ""; |
| | | closeTabsMenu(); |
| | |
| | | let _userInfo = store.getters.getUserInfo(); |
| | | if (_userInfo) { |
| | | userName.value = _userInfo.userName; |
| | | userTrueName.value = _userInfo.userTrueName; |
| | | if (_userInfo.img) { |
| | | userImg.value = _config.base.getImgSrc(_userInfo.img, http.ipAddress); |
| | | } |
| | | } |
| | | |
| | | createSocket(window.webConfig.webSocketUrl); |
| | | |
| | | Object.assign(_config.$tabs, { open: open, close: close }); |
| | | |
| | | http.get("api/Sys_Menu/getTreeMenu", {}, true).then((data) => { |
| | | http.get("api/Sys_Menu/getTreeMenu", {}, true).then(data => { |
| | | data.push({ id: "1", name: "é¦é¡µ", url: "/home" }); // 为äºè·åéä¸idä½¿ç¨ |
| | | data.forEach((d) => { |
| | | data.forEach(d => { |
| | | d.path = (d.url || "").replace("/Manager", ""); |
| | | d.to = (d.url || "").replace("/Manager", ""); |
| | | if (!d.icon || d.icon.substring(0, 3) != "el-") { |
| | | d.icon = "el-icon-menu"; |
| | | } |
| | | }); |
| | | |
| | | store.dispatch("setPermission", data); |
| | | menuOptions.value = data; |
| | | permissionInited.value = true; |
| | | |
| | | //å¼å¯æ¶æ¯æ¨éï¼main.jsä¸è®¾ç½®æ¯å¦å¼å¯signalRï¼2022.05.05 |
| | | if (_config.$global.signalR) { |
| | | MessageConfig(http, (result) => { |
| | | MessageConfig(http, result => { |
| | | messageList.unshift(result); |
| | | // console.log(result) |
| | | }); |
| | |
| | | //å½åå·æ°æ¯ä¸æ¯é¦é¡µ |
| | | if (router.currentRoute.value.path != navigation[0].path) { |
| | | //æ¥æ¾ç³»ç»èå |
| | | let item = menuOptions.value.find((x) => { |
| | | let item = menuOptions.value.find(x => { |
| | | return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | }); |
| | | if (item) return onSelect(item.id); |
| | | //æ¥æ¾é¡¶é¨å¿«æ·è¿æ¥ |
| | | item = links.value.find((x) => { |
| | | item = links.value.find(x => { |
| | | return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | }); |
| | | //æ¥æ¾æå䏿¬¡è·³è½¬çé¡µé¢ |
| | |
| | | errorImg, |
| | | userInfo, |
| | | userName, |
| | | userTrueName, |
| | | userImg, |
| | | selectId, |
| | | selectMenuIndex, |
| | |
| | | visibleItem, |
| | | closeTabsMenu, |
| | | closeTabs, |
| | | currentMenuId, |
| | | currentMenuId |
| | | }; |
| | | }, |
| | | /** |
| | |
| | | let _date = showTime(); |
| | | $indexDate = document.getElementById("index-date"); |
| | | $indexDate.innerText = _date; |
| | | $interval = setInterval(function () { |
| | | $interval = setInterval(function() { |
| | | $indexDate.innerText = showTime(); |
| | | }, 1000); |
| | | |
| | |
| | | item.oncontextmenu = that.openTabsMenu; |
| | | }); |
| | | }); |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | destroyed() { |
| | | $this = null; |
| | | clearInterval($interval); |
| | | }, |
| | | } |
| | | }); |
| | | const week = new Array( |
| | | "ææä¸", |
| | |
| | | padding: 0; |
| | | } |
| | | |
| | | .item { |
| | | margin-top: -20px; |
| | | margin-right: 40px; |
| | | } |
| | | |
| | | .contextMenu { |
| | | width: 120px; |
| | | margin: 0; |
| | |
| | | font-size: 14px; |
| | | color: #333; |
| | | box-shadow: 2px 2px 3px 0 rgb(182 182 182 / 20%); |
| | | |
| | | i, |
| | | button { |
| | | font-size: 14px !important; |
| | |
| | | letter-spacing: 1px; |
| | | } |
| | | |
| | | .el-tabs.el-tabs--top.el-tabs--border-card.header-navigation>.el-tabs__header .el-tabs__item:last-child, |
| | | .el-tabs--top.el-tabs--border-card.header-navigation>.el-tabs__header .el-tabs__item:nth-child(2) { |
| | | .el-tabs.el-tabs--top.el-tabs--border-card.header-navigation |
| | | > .el-tabs__header |
| | | .el-tabs__item:last-child, |
| | | .el-tabs--top.el-tabs--border-card.header-navigation |
| | | > .el-tabs__header |
| | | .el-tabs__item:nth-child(2) { |
| | | padding: 0; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">å
¥åº8005ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_PutFinish5">{{ data.W_PutFinish5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å
¥åºå°ä½æä»¤(读):</div> |
| | | <div class="xzhi" :title="data.R_ConveyArrivaled5">{{ data.R_ConveyArrivaled5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å°ä½æçå·(读):</div> |
| | | <div class="xzhi" :title="data.R_Barcode5">{{ data.R_Barcode5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å°ä½ä»»å¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_TaskNum5">{{ data.R_TaskNum5 }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºåº8001ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_PutFinish1">{{ data.W_PutFinish1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xzhi" :title="data.R_IsCanPut">{{ data.R_IsCanPut }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | const data = ref({}); |
| | | |
| | | // 1. å®ä¹æ®éåæ®µçæ å°è§å |
| | | const statusMap = { |
| | | |
| | | }; |
| | | |
| | | // 2. å®ä¹éè¦å
±ç¨æ å°è§åçåæ®µå表å对åºçæ å°è§å |
| | | const booleanFields = [ |
| | | "W_PutFinish5", "W_PutFinish1", |
| | | "R_IsCanPut", "R_ConveyArrivaled5", |
| | | ]; |
| | | const booleanMap = { |
| | | true: "æ¯", |
| | | false: "å¦" |
| | | }; |
| | | |
| | | // å¤çæ°æ®ï¼å
å¤çæ®éæ å°ï¼åæ¹éå¤çå
±ç¨æ å°çåæ®µ |
| | | const processData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processed = { ...rawData }; |
| | | |
| | | // å¤çæ®éåæ®µæ å° |
| | | Object.keys(statusMap).forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | const map = statusMap[key]; |
| | | processed[key] = map[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | // æ¹éå¤çå
±ç¨æ å°è§åçåæ®µ |
| | | booleanFields.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = booleanMap[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | return processed; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | setInterval(() => { |
| | | const rawData = store.state.homedata; |
| | | data.value = processData(rawData); |
| | | const xian = document.getElementsByClassName("xzhi"); |
| | | for (let i = 0; i < xian.length; i++) { |
| | | if (xian[i].innerHTML === "æ¯") { |
| | | xian[i].style.color = "yellow"; |
| | | } else if (xian[i].innerHTML === "å¦") { |
| | | xian[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | data, |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .zhuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xzhi { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .zhankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="message-container"> |
| | | <div class="item" v-for="(item, index) in list" :key="index"> |
| | | <div class="title">{{ item.title }}({{ item.date }})</div> |
| | | <div class="content">{{ item.message }}</div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | if (!this.list.length) { |
| | | this.list.push({ |
| | | title: 'æ¶æ¯æµè¯æ qweqweqweqwé¢', |
| | | message: 'æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
容', |
| | | date: '2022-05-02 03:10' |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .message-container { |
| | | .title { |
| | | padding-bottom: 10px; |
| | | } |
| | | .item { |
| | | border-bottom: 1px solid #eee; |
| | | padding: 10px 20px; |
| | | } |
| | | .content { |
| | | color: #7e7e7e; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <div class="skuang"> |
| | | <div class="zhuname">å¹²èä»å åæº</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_GM_Status">{{ data.R_GM_Status }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_GM_AutoStatus">{{ data.R_GM_AutoStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xzhi" :title="data.R_GM_TaskNum">{{ data.R_GM_TaskNum }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_GM_WorkStatus">{{ data.R_GM_WorkStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xzhi" :title="data.R_GM_WorkType">{{ data.R_GM_WorkType }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xzhi" :title="data.R_GM_TrayType">{{ data.R_GM_TrayType }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="skuang"> |
| | | <div class="zhuname">å
¥åº7003ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">读åç®±ä½ç (读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Boxcode">{{ data.R_GM_Boxcode }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_HandShake3">{{ data.R_GM_HandShake3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Online3">{{ data.R_GM_Online3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Free3">{{ data.R_GM_Free3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Goods3">{{ data.R_GM_Goods3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Alarm3">{{ data.R_GM_Alarm3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_STB3">{{ data.R_GM_STB3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_ACK3">{{ data.R_GM_ACK3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_STB3">{{ data.W_GM_STB3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_ACK3">{{ data.W_GM_ACK3 }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºåºç»ç¹7004ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_HandShake4">{{ data.R_GM_HandShake4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Online4">{{ data.R_GM_Online4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Free4">{{ data.R_GM_Free4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Goods4">{{ data.R_GM_Goods4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Alarm4">{{ data.R_GM_Alarm4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_STB4">{{ data.R_GM_STB4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_ACK4">{{ data.R_GM_ACK4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_STB4">{{ data.W_GM_STB4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_ACK4">{{ data.W_GM_ACK4 }}</div> |
| | | </div> |
| | | <div class="zhuname">åºåº7005ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_HandShake5">{{ data.R_GM_HandShake5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Online5">{{ data.R_GM_Online5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Free5">{{ data.R_GM_Free5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Goods5">{{ data.R_GM_Goods5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_Alarm5">{{ data.R_GM_Alarm5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_STB5">{{ data.R_GM_STB5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_GM_ACK5">{{ data.R_GM_ACK5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_STB5">{{ data.W_GM_STB5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_GM_ACK5">{{ data.W_GM_ACK5 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | const data = ref({}); |
| | | |
| | | // 1. å®ä¹æ®éåæ®µçæ å°è§å |
| | | const statusMap = { |
| | | R_GM_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_GM_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_GM_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_GM_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_GM_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | const onlines = [ |
| | | "R_GM_Online3","R_GM_Online4", |
| | | "R_GM_Online5", |
| | | ] |
| | | const online = { |
| | | 1: "èæº", |
| | | 0: "è±æº" |
| | | }; |
| | | const alarms = [ |
| | | "R_GM_Alarm3","R_GM_Alarm4", |
| | | "R_GM_Alarm5", |
| | | ] |
| | | const alarm = { |
| | | 1: "æ
é", |
| | | 0: "æ£å¸¸" |
| | | }; |
| | | const frees = [ |
| | | "R_GM_Free3","R_GM_Free4", |
| | | "R_GM_Free5", |
| | | ] |
| | | const free = { |
| | | 1: "空é²", |
| | | 0: "ç¹å¿" |
| | | }; |
| | | const goods = [ |
| | | "R_GM_Goods3", "R_GM_Goods4", |
| | | "R_GM_Goods5", |
| | | ] |
| | | const good = { |
| | | 1: "æè´§", |
| | | 0: "æ è´§" |
| | | }; |
| | | // 2. å®ä¹éè¦å
±ç¨æ å°è§åçåæ®µå表å对åºçæ å°è§å |
| | | const booleanFields = [ |
| | | "R_GM_HandShake3", |
| | | "R_GM_STB3", |
| | | "R_GM_ACK3", "W_GM_STB3", |
| | | "W_GM_ACK3", |
| | | "R_GM_HandShake4", |
| | | "R_GM_STB4", |
| | | "R_GM_ACK4", "W_GM_STB4", |
| | | "W_GM_ACK4", |
| | | "R_GM_HandShake5", |
| | | "R_GM_STB5", |
| | | "R_GM_ACK5", "W_GM_STB5", |
| | | "W_GM_ACK5", |
| | | ]; |
| | | const booleanMap = { |
| | | true: "æ¯", |
| | | false: "å¦" |
| | | }; |
| | | |
| | | // å¤çæ°æ®ï¼å
å¤çæ®éæ å°ï¼åæ¹éå¤çå
±ç¨æ å°çåæ®µ |
| | | const processData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processed = { ...rawData }; |
| | | |
| | | // å¤çæ®éåæ®µæ å° |
| | | Object.keys(statusMap).forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | const map = statusMap[key]; |
| | | processed[key] = map[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | // æ¹éå¤çå
±ç¨æ å°è§åçåæ®µ |
| | | booleanFields.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = booleanMap[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | onlines.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = online[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | alarms.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = alarm[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | frees.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = free[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | goods.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = good[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | return processed; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | setInterval(() => { |
| | | const rawData = store.state.homedata; |
| | | data.value = processData(rawData); |
| | | const xian = document.getElementsByClassName("xzhi"); |
| | | for (let i = 0; i < xian.length; i++) { |
| | | if (xian[i].innerHTML === "æ¯" || xian[i].innerHTML === "èæº") { |
| | | xian[i].style.color = "yellow"; |
| | | } else if (xian[i].innerHTML === "å¦") { |
| | | xian[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | data, |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .zhuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xzhi { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .zhankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <div class="skuang"> |
| | | <div class="zhuname">油墨ä»å åæº</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_YM_Status">{{ data.R_YM_Status }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_YM_AutoStatus">{{ data.R_YM_AutoStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xzhi" :title="data.R_YM_TaskNum">{{ data.R_YM_TaskNum }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_YM_WorkStatus">{{ data.R_YM_WorkStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xzhi" :title="data.R_YM_WorkType">{{ data.R_YM_WorkType }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xzhi" :title="data.R_YM_TrayType">{{ data.R_YM_TrayType }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºå
¥åº9001ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Tray1">{{ data.R_YM_Tray1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å
¥åºæ§è¡ä¸(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Inbounding1">{{ data.R_YM_Inbounding1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æåæºç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Leisure1">{{ data.R_YM_Leisure1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åºåºæ§è¡ä¸(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Outbounding1">{{ data.R_YM_Outbounding1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ç³è¯·å
¥åº(å):</div> |
| | | <div class="xzhi" :title="data.W_YM_RequestIn1">{{ data.W_YM_RequestIn1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ç³è¯·åºåº(å):</div> |
| | | <div class="xzhi" :title="data.W_YM_RequestOut1">{{ data.W_YM_RequestOut1 }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºå
¥åº9002ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Tray2">{{ data.R_YM_Tray2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å
¥åºæ§è¡ä¸(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Inbounding2">{{ data.R_YM_Inbounding2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æåæºç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Leisure2">{{ data.R_YM_Leisure2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åºåºæ§è¡ä¸(读):</div> |
| | | <div class="xzhi" :title="data.R_YM_Outbounding2">{{ data.R_YM_Outbounding2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ç³è¯·å
¥åº(å):</div> |
| | | <div class="xzhi" :title="data.W_YM_RequestIn2">{{ data.W_YM_RequestIn2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ç³è¯·åºåº(å):</div> |
| | | <div class="xzhi" :title="data.W_YM_RequestOut2">{{ data.W_YM_RequestOut2 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | const data = ref({}); |
| | | |
| | | // 1. å®ä¹æ®éåæ®µçæ å°è§å |
| | | const statusMap = { |
| | | R_YM_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_YM_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_YM_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_YM_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_YM_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | |
| | | // 2. å®ä¹éè¦å
±ç¨æ å°è§åçåæ®µå表å对åºçæ å°è§å |
| | | const booleanFields = [ |
| | | "R_YM_Tray1", "R_YM_Inbounding1", |
| | | "R_YM_Leisure1", "R_YM_Outbounding1", |
| | | "W_YM_RequestIn1", "W_YM_RequestOut1", |
| | | "R_YM_Tray2", "R_YM_Inbounding2", |
| | | "R_YM_Leisure2", "R_YM_Outbounding2", |
| | | "W_YM_RequestIn2", "W_YM_RequestOut2", |
| | | ]; |
| | | const booleanMap = { |
| | | true: "æ¯", |
| | | false: "å¦" |
| | | }; |
| | | |
| | | // å¤çæ°æ®ï¼å
å¤çæ®éæ å°ï¼åæ¹éå¤çå
±ç¨æ å°çåæ®µ |
| | | const processData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processed = { ...rawData }; |
| | | |
| | | // å¤çæ®éåæ®µæ å° |
| | | Object.keys(statusMap).forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | const map = statusMap[key]; |
| | | processed[key] = map[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | // æ¹éå¤çå
±ç¨æ å°è§åçåæ®µ |
| | | booleanFields.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = booleanMap[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | return processed; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | setInterval(() => { |
| | | const rawData = store.state.homedata; |
| | | data.value = processData(rawData); |
| | | const xian = document.getElementsByClassName("xzhi"); |
| | | for (let i = 0; i < xian.length; i++) { |
| | | if (xian[i].innerHTML === "æ¯") { |
| | | xian[i].style.color = "yellow"; |
| | | } else if (xian[i].innerHTML === "å¦") { |
| | | xian[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | data, |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .zhuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xzhi { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .zhankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <div class="skuang"> |
| | | <div class="zhuname">PPä»å åæº</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_PP_Status">{{ data.R_PP_Status }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_PP_AutoStatus">{{ data.R_PP_AutoStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xzhi" :title="data.R_PP_TaskNum">{{ data.R_PP_TaskNum }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_PP_WorkStatus">{{ data.R_PP_WorkStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xzhi" :title="data.R_PP_WorkType">{{ data.R_PP_WorkType }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xzhi" :title="data.R_PP_TrayType">{{ data.R_PP_TrayType }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="skuang"> |
| | | <div class="zhuname">å
¥åº2004ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">读åç®±ä½ç (读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Boxcode">{{ data.R_PP_Boxcode }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_HandShake4">{{ data.R_PP_HandShake4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Online4">{{ data.R_PP_Online4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Free4">{{ data.R_PP_Free4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Goods4">{{ data.R_PP_Goods4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Alarm4">{{ data.R_PP_Alarm4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_STB4">{{ data.R_PP_STB4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_ACK4">{{ data.R_PP_ACK4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_STB4">{{ data.W_PP_STB4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_ACK4">{{ data.W_PP_ACK4 }}</div> |
| | | </div> |
| | | |
| | | <div class="zhuname">åºåº2005ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_HandShake5">{{ data.R_PP_HandShake5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Online5">{{ data.R_PP_Online5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Free5">{{ data.R_PP_Free5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Goods5">{{ data.R_PP_Goods5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Alarm5">{{ data.R_PP_Alarm5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_STB5">{{ data.R_PP_STB5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_ACK5">{{ data.R_PP_ACK5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_STB5">{{ data.W_PP_STB5 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_ACK5">{{ data.W_PP_ACK5 }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºåº2016ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_HandShake6">{{ data.R_PP_HandShake6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Online6">{{ data.R_PP_Online6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Free6">{{ data.R_PP_Free6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Goods6">{{ data.R_PP_Goods6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Alarm6">{{ data.R_PP_Alarm6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_STB6">{{ data.R_PP_STB6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_ACK6">{{ data.R_PP_ACK6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_STB6">{{ data.W_PP_STB6 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_ACK6">{{ data.W_PP_ACK6 }}</div> |
| | | </div> |
| | | <div class="zhuname">åºåº2017ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¡æä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_HandShake7">{{ data.R_PP_HandShake7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦èæº(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Online7">{{ data.R_PP_Online7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦ç©ºé²(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Free7">{{ data.R_PP_Free7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Goods7">{{ data.R_PP_Goods7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦æ
é(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_Alarm7">{{ data.R_PP_Alarm7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_STB7">{{ data.R_PP_STB7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(读):</div> |
| | | <div class="xzhi" :title="data.R_PP_ACK7">{{ data.R_PP_ACK7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">请æ±ä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_STB7">{{ data.W_PP_STB7 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ååºä¿¡å·(å):</div> |
| | | <div class="xzhi" :title="data.W_PP_ACK7">{{ data.W_PP_ACK7 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | const data = ref({}); |
| | | |
| | | // 1. å®ä¹æ®éåæ®µçæ å°è§å |
| | | const statusMap = { |
| | | R_PP_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_PP_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_PP_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_PP_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_PP_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | const onlines = [ |
| | | "R_PP_Online6","R_PP_Online4", |
| | | "R_PP_Online5","R_PP_Online7" |
| | | ] |
| | | const online = { |
| | | true: "èæº", |
| | | false: "è±æº" |
| | | }; |
| | | const alarms = [ |
| | | "R_PP_Alarm6","R_PP_Alarm4", |
| | | "R_PP_Alarm5","R_PP_Alarm7" |
| | | ] |
| | | const alarm = { |
| | | true: "æ
é", |
| | | false: "æ£å¸¸" |
| | | }; |
| | | const frees = [ |
| | | "R_PP_Free6","R_PP_Free4", |
| | | "R_PP_Free5","R_PP_Free7" |
| | | ] |
| | | const free = { |
| | | true: "空é²", |
| | | false: "ç¹å¿" |
| | | }; |
| | | const goods = [ |
| | | "R_PP_Goods6", "R_PP_Goods4", |
| | | "R_PP_Goods5","R_PP_Goods7" |
| | | ] |
| | | const good = { |
| | | true: "æè´§", |
| | | false: "æ è´§" |
| | | }; |
| | | |
| | | // 2. å®ä¹éè¦å
±ç¨æ å°è§åçåæ®µå表å对åºçæ å°è§å |
| | | const booleanFields = [ |
| | | "R_PP_HandShake4", "R_PP_STB4", |
| | | "R_PP_ACK4", "W_PP_STB4", |
| | | "W_PP_ACK4", |
| | | "R_PP_HandShake5", "R_PP_STB5", |
| | | "R_PP_ACK5", "W_PP_STB5", |
| | | "W_PP_ACK5", |
| | | "R_PP_HandShake6", "R_PP_STB6", |
| | | "R_PP_ACK6", "W_PP_STB6", |
| | | "W_PP_ACK6", |
| | | "R_PP_HandShake7", "R_PP_STB7", |
| | | "R_PP_ACK7", "W_PP_STB7", |
| | | "W_PP_ACK7", |
| | | ]; |
| | | const booleanMap = { |
| | | true: "æ¯", |
| | | false: "å¦" |
| | | }; |
| | | |
| | | // å¤çæ°æ®ï¼å
å¤çæ®éæ å°ï¼åæ¹éå¤çå
±ç¨æ å°çåæ®µ |
| | | const processData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processed = { ...rawData }; |
| | | |
| | | // å¤çæ®éåæ®µæ å° |
| | | Object.keys(statusMap).forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | const map = statusMap[key]; |
| | | processed[key] = map[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | // æ¹éå¤çå
±ç¨æ å°è§åçåæ®µ |
| | | booleanFields.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = booleanMap[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | onlines.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = online[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | alarms.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = alarm[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | frees.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = free[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | goods.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = good[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | return processed; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | setInterval(() => { |
| | | const rawData = store.state.homedata; |
| | | data.value = processData(rawData); |
| | | const xian = document.getElementsByClassName("xzhi"); |
| | | for (let i = 0; i < xian.length; i++) { |
| | | if (xian[i].innerHTML === "æ¯") { |
| | | xian[i].style.color = "yellow"; |
| | | } else if (xian[i].innerHTML === "å¦") { |
| | | xian[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | data, |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .zhuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xzhi { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .zhankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="title"> |
| | | <div id="bkuang" style="border-top: none"> |
| | | <div class="skuang"> |
| | | <div class="zhuname">é»çä»å åæº</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_ZH_Status">{{ data.R_ZH_Status }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºæèªå¨ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_ZH_AutoStatus">{{ data.R_ZH_AutoStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ£å¨æ§è¡çä»»å¡å·:</div> |
| | | <div class="xzhi" :title="data.R_ZH_TaskNum">{{ data.R_ZH_TaskNum }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å åæºå·¥ä½ç¶æ:</div> |
| | | <div class="xzhi" :title="data.R_ZH_WorkStatus">{{ data.R_ZH_WorkStatus }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">ä½ä¸ç±»å:</div> |
| | | <div class="xzhi" :title="data.R_ZH_WorkType">{{ data.R_ZH_WorkType }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æçç±»å:</div> |
| | | <div class="xzhi" :title="data.R_ZH_TrayType">{{ data.R_ZH_TrayType }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="skuang"> |
| | | <div class="zhuname">å
¥åº301ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanPut1">{{ data.R_ZH_IsCanPut1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanTake1">{{ data.R_ZH_IsCanTake1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§æçç±»å(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_TakePalletType1">{{ data.R_ZH_TakePalletType1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§æçç±»å(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutPalletType1">{{ data.W_ZH_PutPalletType1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutRequest1">{{ data.W_ZH_PutRequest1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutFinish1">{{ data.W_ZH_PutFinish1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeRequest1">{{ data.W_ZH_TakeRequest1 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeFinish1">{{ data.W_ZH_TakeFinish1 }}</div> |
| | | </div> |
| | | <div class="zhuname">å
¥åº302ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanPut2">{{ data.R_ZH_IsCanPut2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanTake2">{{ data.R_ZH_IsCanTake2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§æçç±»å(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_TakePalletType2">{{ data.R_ZH_TakePalletType2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§æçç±»å(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutPalletType2">{{ data.W_ZH_PutPalletType2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutRequest2">{{ data.W_ZH_PutRequest2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutFinish2">{{ data.W_ZH_PutFinish2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeRequest2">{{ data.W_ZH_TakeRequest2 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeFinish2">{{ data.W_ZH_TakeFinish2 }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="skuang"> |
| | | <div class="zhuname">åºåº303ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanPut3">{{ data.R_ZH_IsCanPut3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanTake3">{{ data.R_ZH_IsCanTake3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§æçç±»å(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_TakePalletType3">{{ data.R_ZH_TakePalletType3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§æçç±»å(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutPalletType3">{{ data.W_ZH_PutPalletType3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutRequest3">{{ data.W_ZH_PutRequest3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutFinish3">{{ data.W_ZH_PutFinish3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeRequest3">{{ data.W_ZH_TakeRequest3 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeFinish3">{{ data.W_ZH_TakeFinish3 }}</div> |
| | | </div> |
| | | <div class="zhuname">åºåº304ç«å°</div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许æ¾è´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanPut4">{{ data.R_ZH_IsCanPut4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¯å¦å
许åè´§(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_IsCanTake4">{{ data.R_ZH_IsCanTake4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§æçç±»å(读):</div> |
| | | <div class="xzhi" :title="data.R_ZH_TakePalletType4">{{ data.R_ZH_TakePalletType4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§æçç±»å(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutPalletType4">{{ data.W_ZH_PutPalletType4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§è¯·æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutRequest4">{{ data.W_ZH_PutRequest4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">æ¾è´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_PutFinish4">{{ data.W_ZH_PutFinish4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">å货请æ±(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeRequest4">{{ data.W_ZH_TakeRequest4 }}</div> |
| | | </div> |
| | | <div class="zhankuang"> |
| | | <div class="xname">åè´§å®æ(å):</div> |
| | | <div class="xzhi" :title="data.W_ZH_TakeFinish4">{{ data.W_ZH_TakeFinish4 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, nextTick } from "vue"; |
| | | import { useStore } from "vuex"; |
| | | import { onMounted } from "vue"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | xuan: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | | }, |
| | | setup() { |
| | | const store = useStore(); |
| | | const data = ref({}); |
| | | |
| | | // 1. å®ä¹æ®éåæ®µçæ å°è§å |
| | | const statusMap = { |
| | | R_ZH_Status: { |
| | | 1: "æ£å¸¸", |
| | | 2: "æ
é", |
| | | 3: "æ¥å", |
| | | }, |
| | | R_ZH_AutoStatus: { |
| | | 0: "ç»´ä¿®", |
| | | 1: "æå¨", |
| | | 2: "åèªå¨", |
| | | 3: "èªå¨", |
| | | }, |
| | | R_ZH_WorkStatus: { |
| | | 0: "å¾
æº", |
| | | 1: "åè´§ä¸", |
| | | 2: "åè´§å®æ", |
| | | 4: "æ¾è´§ä¸", |
| | | 5: "æ¾è´§å®æ", |
| | | 6: "ä»»å¡å®æ", |
| | | }, |
| | | R_ZH_WorkType: { |
| | | 0: "æ ä½ä¸ä»»å¡(0)", |
| | | 1: "åæ¾è´§ä½ä¸(1)", |
| | | 2: "åªåè´§ä½ä¸(2)", |
| | | 3: "åªæ¾è´§ä½ä¸(3)", |
| | | 4: "ç§»å¨å°æå®ä½ç½®" |
| | | }, |
| | | R_ZH_TrayType: { |
| | | "-1": "空箱(-1)", |
| | | 1: "å°æç(1)", |
| | | 2: "䏿ç(2)", |
| | | 3: "大æç(3)", |
| | | 4: "ç¹å¤§æç(4)", |
| | | } |
| | | }; |
| | | |
| | | // 2. å®ä¹éè¦å
±ç¨æ å°è§åçåæ®µå表å对åºçæ å°è§å |
| | | const booleanFields = [ |
| | | "R_ZH_IsCanPut1", "R_ZH_IsCanTake1", |
| | | "W_ZH_PutRequest1", "W_ZH_PutFinish1", |
| | | "W_ZH_TakeRequest1", "W_ZH_TakeFinish1", |
| | | "R_ZH_IsCanPut2", "R_ZH_IsCanTake2", |
| | | "W_ZH_PutRequest2", "W_ZH_PutFinish2", |
| | | "W_ZH_TakeRequest2", "W_ZH_TakeFinish2", |
| | | "R_ZH_IsCanPut3", "R_ZH_IsCanTake3", |
| | | "W_ZH_PutRequest3", "W_ZH_PutFinish3", |
| | | "W_ZH_TakeRequest3", "W_ZH_TakeFinish3", |
| | | "R_ZH_IsCanPut4", "R_ZH_IsCanTake4", |
| | | "W_ZH_PutRequest4", "W_ZH_PutFinish4", |
| | | "W_ZH_TakeRequest4", "W_ZH_TakeFinish4", |
| | | ]; |
| | | const booleanMap = { |
| | | true: "æ¯", |
| | | false: "å¦" |
| | | }; |
| | | |
| | | // å¤çæ°æ®ï¼å
å¤çæ®éæ å°ï¼åæ¹éå¤çå
±ç¨æ å°çåæ®µ |
| | | const processData = (rawData) => { |
| | | if (!rawData) return {}; |
| | | const processed = { ...rawData }; |
| | | |
| | | // å¤çæ®éåæ®µæ å° |
| | | Object.keys(statusMap).forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | const map = statusMap[key]; |
| | | processed[key] = map[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | // æ¹éå¤çå
±ç¨æ å°è§åçåæ®µ |
| | | booleanFields.forEach(key => { |
| | | if (processed.hasOwnProperty(key)) { |
| | | processed[key] = booleanMap[processed[key]] || processed[key]; |
| | | } |
| | | }); |
| | | |
| | | return processed; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | setInterval(() => { |
| | | const rawData = store.state.homedata; |
| | | data.value = processData(rawData); |
| | | const xian = document.getElementsByClassName("xzhi"); |
| | | for (let i = 0; i < xian.length; i++) { |
| | | if (xian[i].innerHTML === "æ¯") { |
| | | xian[i].style.color = "yellow"; |
| | | } else if (xian[i].innerHTML === "å¦") { |
| | | xian[i].style.color = "red"; |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | return { |
| | | data, |
| | | }; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ding { |
| | | float: left; |
| | | width: 20px; |
| | | height: 20px; |
| | | margin-top: 7px; |
| | | } |
| | | .yan { |
| | | color: white; |
| | | float: left; |
| | | font-size: 25px; |
| | | } |
| | | .dakuang { |
| | | width: 250px; |
| | | height: 50px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 200px; |
| | | } |
| | | #xiugai { |
| | | width: 100px; |
| | | height: 30px; |
| | | float: left; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | cursor: pointer; |
| | | border: 1px solid white; |
| | | color: white; |
| | | background: rgba(255, 255, 255, 0.5); |
| | | font-size: 25px; |
| | | position: absolute; |
| | | top: 150px; |
| | | left: 450px; |
| | | } |
| | | #xiugai:hover { |
| | | background: #f60; |
| | | } |
| | | #shu1, |
| | | #shu2 { |
| | | width: 200px; |
| | | height: 30px; |
| | | float: left; |
| | | margin-top: 0px; |
| | | margin-right: 0px; |
| | | border-radius: 5px; |
| | | border: 1px solid white; |
| | | } |
| | | #guan { |
| | | width: 40px; |
| | | height: 40px; |
| | | float: left; |
| | | font-size: 1.1cqw; |
| | | text-align: center; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-left: 560px; |
| | | color: white; |
| | | position: absolute; |
| | | } |
| | | #ti { |
| | | width: 600px; |
| | | height: 300px; |
| | | position: relative; |
| | | background: rgba(255, 255, 255, 1); |
| | | border-radius: 10px; |
| | | top: 230px; |
| | | left: 35%; |
| | | display: none; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 170%; |
| | | background-position: -220px 0px; |
| | | } |
| | | .zhuname { |
| | | width: 100%; |
| | | height: 5vh; |
| | | float: left; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-weight: 700; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xname { |
| | | width: 70%; |
| | | height: 80px; |
| | | float: left; |
| | | line-height: 7vh; |
| | | font-size: 1.1cqw; |
| | | color: white; |
| | | } |
| | | .xzhi { |
| | | width: 30%; |
| | | height: 7vh; |
| | | float: left; |
| | | line-height: 50px; |
| | | font-size: 1.1cqw; |
| | | color: rgb(242, 242, 50); |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .zhankuang { |
| | | width: 45%; |
| | | height: 3vh; |
| | | margin-top: 10px; |
| | | margin-left: 5%; |
| | | float: left; |
| | | } |
| | | #title { |
| | | float: left; |
| | | width: 95%; |
| | | height: 88vh; |
| | | margin-top: 40px; |
| | | margin-left: 3%; |
| | | background-image: url("../../img/1.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100%; |
| | | container-type: inline-size; |
| | | } |
| | | #bkuang { |
| | | width: 100%; |
| | | height: 55vh; |
| | | float: left; |
| | | } |
| | | .skuang { |
| | | width: 31%; |
| | | height: 55vh; |
| | | float: left; |
| | | border-top: none; |
| | | border-left: none; |
| | | border-bottom: none; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | margin-left: 1.7%; |
| | | border-radius: 10px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="message-container"> |
| | | <div class="item" v-for="(item, index) in list" :key="index"> |
| | | <div class="title">{{ item.title }}({{ item.date }})</div> |
| | | <div class="content">{{ item.message }}</div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: () => { |
| | | return []; |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | if (!this.list.length) { |
| | | this.list.push({ |
| | | title: 'æ¶æ¯werweræµè¯æ é¢', |
| | | message: 'æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
å®¹æ¶æ¯æµè¯å
容', |
| | | date: '2022-05-02 03:10' |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="less"> |
| | | .message-container { |
| | | .title { |
| | | padding-bottom: 10px; |
| | | } |
| | | .item { |
| | | border-bottom: 1px solid #eee; |
| | | padding: 10px 20px; |
| | | } |
| | | .content { |
| | | color: #7e7e7e; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers.QuartzJob |
| | | { |
| | |
| | | [HttpPost, Route("GetImportData"), AllowAnonymous] |
| | | public WebResponseContent GetImportData(List<IFormFile> fileInput) |
| | | { |
| | | |
| | | return Service.GetImportData(fileInput); |
| | | } |
| | | } |
| | |
| | | builder.RegisterModule<AutofacPropertityModuleReg>();// |
| | | }).ConfigureAppConfiguration((hostingContext, config) => |
| | | { |
| | | |
| | | hostingContext.Configuration.ConfigureApplication(); |
| | | config.Sources.Clear(); |
| | | config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false); |
| | |
| | | builder.Services.AddHostedService<QuartzJobDataTableHostedService>(); |
| | | |
| | | //builder.Services.AddWebSocketSetup(); |
| | | builder.Services.AddWebSocketSetup(); |
| | | |
| | | builder.Services.AddHostedService<WarehouseHostedService>(); |
| | | |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |
| | |
| | | |
| | | builder.Services.AddHttpContextSetup(); |
| | | |
| | | |
| | | builder.Services.AddHostedService<QuartzJobHostedService>(); |
| | | |
| | | builder.Services.AddMvc(options => |
| | |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | R_ConveyorLineInfo conveyorLineInfoRead1 = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | W_ConveyorLineInfo conveyorLineInfoWrite1 = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); |
| | | R_ConveyorLineStatus conveyorLineStatus1 = conveyorLineInfoRead1.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | ConveyorLineSignal conveyorLineSignalRead1 = conveyorLineInfoRead1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | ConveyorLineSignal conveyorLineSignalWrite1 = conveyorLineInfoWrite1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | if (item.StationCode == "2004") |
| | | { |
| | | if (conveyorLineSignalRead1.STB && conveyorLineStatus1.Online && conveyorLineStatus1.Goods && !conveyorLineStatus1.Alarm && !conveyorLineSignalWrite1.ACK) |
| | | { |
| | | StackerCraneJob_PP.pPReadData.R_PP_Boxcode = device.Communicator.Read<string>("DB900.578.0"); |
| | | } |
| | | StackerCraneJob_PP.pPReadData.R_PP_HandShake4 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Online4 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Free4 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Goods4 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Alarm4 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_PP.pPReadData.R_PP_STB4 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_PP.pPReadData.R_PP_ACK4 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_PP.pPReadData.W_PP_STB4 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_PP.pPReadData.W_PP_ACK4 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.PPä» |
| | | { |
| | | public class PPReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_PP_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_PP_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_PP_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_PP_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_PP_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_PP_TrayType; |
| | | |
| | | |
| | | ///ç«å° |
| | | |
| | | ///<summary> |
| | | /// è¯»åæ¡ç |
| | | /// </summary> |
| | | public string R_PP_Boxcode; |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_PP_HandShake4; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_PP_Online4; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_PP_Free4; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_PP_Goods4; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_PP_Alarm4; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_STB4; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_ACK4; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_STB4; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_ACK4; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_PP_HandShake5; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_PP_Online5; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_PP_Free5; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_PP_Goods5; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_PP_Alarm5; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_STB5; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_ACK5; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_STB5; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_ACK5; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_PP_HandShake6; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_PP_Online6; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_PP_Free6; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_PP_Goods6; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_PP_Alarm6; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_STB6; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_ACK6; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_STB6; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_ACK6; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_PP_HandShake7; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_PP_Online7; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_PP_Free7; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_PP_Goods7; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_PP_Alarm7; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_STB7; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_PP_ACK7; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_STB7; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_PP_ACK7; |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using AutoMapper; |
| | | using WIDESEAWCS_Tasks.PPä»; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Tasks.å¹²èä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public static PPReadData pPReadData = new PPReadData(); |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public StackerCraneJob_PP(IMapper mapper, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, ICacheService cacheService) |
| | | public StackerCraneJob_PP(IMapper mapper, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, ICacheService cacheService,WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper=mapper; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | } |
| | | } |
| | | } |
| | | pPReadData.R_PP_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | pPReadData.R_PP_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | pPReadData.R_PP_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | pPReadData.R_PP_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | pPReadData.R_PP_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | pPReadData.R_PP_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string pPData = JsonConvert.SerializeObject(pPReadData); |
| | | _webSocketServer.PublishAllClientPayload(pPData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | R_ConveyorLineInfo conveyorLineInfoRead1 = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | W_ConveyorLineInfo conveyorLineInfoWrite1 = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); |
| | | R_ConveyorLineStatus conveyorLineStatus1 = conveyorLineInfoRead1.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | ConveyorLineSignal conveyorLineSignalRead1 = conveyorLineInfoRead1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | ConveyorLineSignal conveyorLineSignalWrite1 = conveyorLineInfoWrite1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | if (item.StationCode == "2005") |
| | | { |
| | | if (conveyorLineSignalRead1.STB && conveyorLineStatus1.Online && conveyorLineStatus1.Goods && !conveyorLineStatus1.Alarm && !conveyorLineSignalWrite1.ACK) |
| | | { |
| | | StackerCraneJob_PP.pPReadData.R_PP_Boxcode = device.Communicator.Read<string>("DB900.578.0"); |
| | | } |
| | | StackerCraneJob_PP.pPReadData.R_PP_HandShake5 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Online5 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Free5 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Goods5 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Alarm5 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_PP.pPReadData.R_PP_STB5 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_PP.pPReadData.R_PP_ACK5 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_PP.pPReadData.W_PP_STB5 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_PP.pPReadData.W_PP_ACK5 = conveyorLineSignalWrite1.ACK; |
| | | }else if(item.StationCode == "2016") |
| | | { |
| | | StackerCraneJob_PP.pPReadData.R_PP_HandShake6 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Online6 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Free6 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Goods6 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Alarm6 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_PP.pPReadData.R_PP_STB6 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_PP.pPReadData.R_PP_ACK6 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_PP.pPReadData.W_PP_STB6 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_PP.pPReadData.W_PP_ACK6 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | else if (item.StationCode == "2016") |
| | | { |
| | | StackerCraneJob_PP.pPReadData.R_PP_HandShake7 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Online7 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Free7 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Goods7 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Alarm7 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_PP.pPReadData.R_PP_STB7 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_PP.pPReadData.R_PP_ACK7 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_PP.pPReadData.W_PP_STB7 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_PP.pPReadData.W_PP_ACK7 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public partial class UpdateExpirationlabelJob : JobBase, IJob |
| | | { |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | Thread.Sleep(4320000); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) throw new Exception("æªæ¾å°WMSApiå°å"); |
| | | string responseStr = HttpHelper.Get($"{address}/api/StockInfo/UpdateExpirationlabel"); |
| | | |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent.Status) |
| | | { |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.Out.WriteLine(nameof(UpdateExpirationlabelJob) + ":" + ex.Message); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.ConveyorLine.Enum; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | R_ConveyorLineInfo conveyorLineInfoRead1 = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | W_ConveyorLineInfo conveyorLineInfoWrite1 = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); |
| | | R_ConveyorLineStatus conveyorLineStatus1 = conveyorLineInfoRead1.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | ConveyorLineSignal conveyorLineSignalRead1 = conveyorLineInfoRead1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | ConveyorLineSignal conveyorLineSignalWrite1 = conveyorLineInfoWrite1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | if (item.StationCode == "7003") { |
| | | if (conveyorLineSignalRead1.STB && conveyorLineStatus1.Online && conveyorLineStatus1.Goods && !conveyorLineStatus1.Alarm && !conveyorLineSignalWrite1.ACK) |
| | | { |
| | | StackerCraneJob_GM.gMReadData.R_GM_Boxcode = device.Communicator.Read<string>("DB900.478.0"); |
| | | } |
| | | StackerCraneJob_GM.gMReadData.R_GM_HandShake3 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Online3 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Free3 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Goods3 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Alarm3 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_GM.gMReadData.R_GM_STB3 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_GM.gMReadData.R_GM_ACK3 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_GM.gMReadData.W_GM_STB3 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_GM.gMReadData.W_GM_ACK3 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | else if(item.StationCode == "7004") |
| | | { |
| | | StackerCraneJob_GM.gMReadData.R_GM_HandShake4 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Online4 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Free4 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Goods4 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Alarm4 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_GM.gMReadData.R_GM_STB4 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_GM.gMReadData.R_GM_ACK4 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_GM.gMReadData.W_GM_STB4 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_GM.gMReadData.W_GM_ACK4 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | else if (item.StationCode == "7005") |
| | | { |
| | | StackerCraneJob_GM.gMReadData.R_GM_HandShake5 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Online5 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Free5 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Goods5 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_GM.gMReadData.R_GM_Alarm5 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_GM.gMReadData.R_GM_STB5 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_GM.gMReadData.R_GM_ACK5 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_GM.gMReadData.W_GM_STB5 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_GM.gMReadData.W_GM_ACK5 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.å¹²èä» |
| | | { |
| | | public class GMReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_GM_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_GM_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_GM_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_GM_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_GM_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_GM_TrayType; |
| | | |
| | | |
| | | ///ç«å° |
| | | |
| | | ///<summary> |
| | | /// è¯»åæ¡ç |
| | | /// </summary> |
| | | public string R_GM_Boxcode; |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_GM_HandShake3; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_GM_Online3; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_GM_Free3; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_GM_Goods3; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_GM_Alarm3; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_STB3; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_ACK3; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_STB3; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_ACK3; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_GM_HandShake4; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_GM_Online4; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_GM_Free4; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_GM_Goods4; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_GM_Alarm4; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_STB4; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_ACK4; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_STB4; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_ACK4; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¡æä¿¡å· |
| | | /// </summary> |
| | | public bool R_GM_HandShake5; |
| | | |
| | | /// <summary> |
| | | /// 1èæº 0è±æº |
| | | /// </summary> |
| | | public bool R_GM_Online5; |
| | | |
| | | /// <summary> |
| | | /// 1ç©ºé² 0ç¹å¿ |
| | | /// </summary> |
| | | public bool R_GM_Free5; |
| | | |
| | | /// <summary> |
| | | /// 1æè´§ 0æ è´§ |
| | | /// </summary> |
| | | public bool R_GM_Goods5; |
| | | |
| | | /// <summary> |
| | | /// 1æ
é 0æ£å¸¸ |
| | | /// </summary> |
| | | public bool R_GM_Alarm5; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_STB5; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(读) |
| | | /// </summary> |
| | | public bool R_GM_ACK5; |
| | | |
| | | /// <summary> |
| | | /// 请æ±ä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_STB5; |
| | | |
| | | /// <summary> |
| | | /// ååºä¿¡å·(å) |
| | | /// </summary> |
| | | public bool W_GM_ACK5; |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using AutoMapper; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_Tasks.å¹²èä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public static GMReadData gMReadData = new GMReadData(); |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IMapper _mapper; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper) |
| | | public StackerCraneJob_GM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IMapper mapper,WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _cacheService = cacheService; |
| | | _routerRepository = routerRepository; |
| | | _mapper = mapper; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | } |
| | | } |
| | | } |
| | | gMReadData.R_GM_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | gMReadData.R_GM_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | gMReadData.R_GM_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | gMReadData.R_GM_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | gMReadData.R_GM_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | gMReadData.R_GM_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string gMData = JsonConvert.SerializeObject(gMReadData); |
| | | _webSocketServer.PublishAllClientPayload(gMData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using Quartz; |
| | | using Autofac.Core; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | WriteError(hoister.DeviceName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,{deviceChildCode}"); |
| | | } |
| | | } |
| | | if (deviceChildCode == "9001") |
| | | { |
| | | StackerCraneJob_YM.yMReadData.R_YM_Tray1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Tray, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Leisure1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Leisure, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.W_YM_RequestIn1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.RequestIn, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.W_YM_RequestOut1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.RequestOut, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Inbounding1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Inbounding, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Outbounding1 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Outbounding, deviceChildCode); |
| | | } |
| | | else if (deviceChildCode == "9002") |
| | | { |
| | | StackerCraneJob_YM.yMReadData.R_YM_Tray2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Tray, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Leisure2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Leisure, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.W_YM_RequestIn2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.RequestIn, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.W_YM_RequestOut2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.RequestOut, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Inbounding2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Inbounding, deviceChildCode); |
| | | StackerCraneJob_YM.yMReadData.R_YM_Outbounding2 = hoister.GetValue<HoisterDBName, bool>(HoisterDBName.Outbounding, deviceChildCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using WIDESEAWCS_Tasks.油墨ä»; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ITaskService _taskService; |
| | | public static YMReadData yMReadData = new YMReadData(); |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public StackerCraneJob_YM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | public StackerCraneJob_YM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,WebSocketServer webSocketServer) |
| | | { |
| | | _cacheService = cacheService; |
| | | _taskService = taskService; |
| | |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | } |
| | | } |
| | | } |
| | | yMReadData.R_YM_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | yMReadData.R_YM_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | yMReadData.R_YM_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | yMReadData.R_YM_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | yMReadData.R_YM_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | yMReadData.R_YM_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string yMData = JsonConvert.SerializeObject(yMReadData); |
| | | _webSocketServer.PublishAllClientPayload(yMData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.æ²¹å¢¨ä» |
| | | { |
| | | public class YMReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_YM_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_YM_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_YM_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_YM_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_YM_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_YM_TrayType; |
| | | |
| | | |
| | | ///æåæº |
| | | /// <summary> |
| | | /// æè´§(读) |
| | | /// </summary> |
| | | public bool R_YM_Tray1; |
| | | |
| | | /// <summary> |
| | | /// å
¥åºæ§è¡ä¸(读) |
| | | /// </summary> |
| | | public bool R_YM_Inbounding1; |
| | | |
| | | /// <summary> |
| | | /// æåæºç©ºé²(读) |
| | | /// </summary> |
| | | public bool R_YM_Leisure1; |
| | | |
| | | /// <summary> |
| | | /// åºåºæ§è¡ä¸(读) |
| | | /// </summary> |
| | | public bool R_YM_Outbounding1; |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·å
¥åº(å) |
| | | /// </summary> |
| | | public bool W_YM_RequestIn1; |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·åºåº(å) |
| | | /// </summary> |
| | | public bool W_YM_RequestOut1; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æè´§(读) |
| | | /// </summary> |
| | | public bool R_YM_Tray2; |
| | | |
| | | /// <summary> |
| | | /// å
¥åºæ§è¡ä¸(读) |
| | | /// </summary> |
| | | public bool R_YM_Inbounding2; |
| | | |
| | | /// <summary> |
| | | /// æåæºç©ºé²(读) |
| | | /// </summary> |
| | | public bool R_YM_Leisure2; |
| | | |
| | | /// <summary> |
| | | /// åºåºæ§è¡ä¸(读) |
| | | /// </summary> |
| | | public bool R_YM_Outbounding2; |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·å
¥åº(å) |
| | | /// </summary> |
| | | public bool W_YM_RequestIn2; |
| | | |
| | | /// <summary> |
| | | /// ç³è¯·åºåº(å) |
| | | /// </summary> |
| | | public bool W_YM_RequestOut2; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_Tasks.è¾
æä»; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public static FLReadData fLReadData = new FLReadData(); |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private WebSocketServer _webSocketServer; |
| | | |
| | | public ConveyorLineJob_FL(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | public ConveyorLineJob_FL(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension,WebSocketServer webSocketServer) |
| | | { |
| | | _cacheService = cacheService; |
| | | _taskService = taskService; |
| | |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | _webSocketServer = webSocketServer; |
| | | |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | |
| | | _taskService.UpdateTask(newTask, TaskStatusEnum.Line_Executing); |
| | | } |
| | | } |
| | | if (item.StationCode == "8005") |
| | | { |
| | | R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress); |
| | | bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); |
| | | fLReadData.W_PutFinish5 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | fLReadData.R_ConveyArrivaled5 = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); |
| | | fLReadData.R_Barcode5 = conveyorLineInfoRead.Barcode; |
| | | fLReadData.R_TaskNum5 = conveyorLineInfoRead.TaskNum; |
| | | } |
| | | else if (item.StationCode == "8001") |
| | | { |
| | | fLReadData.W_PutFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | fLReadData.R_IsCanPut = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | } |
| | | string yMData = JsonConvert.SerializeObject(fLReadData); |
| | | _webSocketServer.PublishAllClientPayload(yMData); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.è¾
æä» |
| | | { |
| | | public class FLReadData |
| | | { |
| | | ///è¾é线 |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_PutFinish5; |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string W_Barcode5; |
| | | |
| | | /// <summary> |
| | | /// åå
¥ä»»å¡å· |
| | | /// </summary> |
| | | public string W_TaskNum5; |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå°ä½æä»¤ |
| | | /// </summary> |
| | | public bool R_ConveyArrivaled5; |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå°ä½æçå· |
| | | /// </summary> |
| | | public string R_Barcode5; |
| | | |
| | | /// <summary> |
| | | /// å
¥åºå°ä½ä»»å¡å· |
| | | /// </summary> |
| | | public string R_TaskNum5; |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_PutFinish1; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_IsCanPut; |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); |
| | | } |
| | | } |
| | | if (item.StationCode == "301") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType1= device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType1 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | }else if(item.StationCode == "302") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | else if (item.StationCode == "303") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | else if (item.StationCode == "304") |
| | | { |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode); |
| | | StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using AutoMapper; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | using HslCommunication.WebSocket; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | public static ZHReadData zHReadData = new ZHReadData(); |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly IMapper _mapper; |
| | | private WebSocketServer _webSocketServer; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper) |
| | | public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository,ICacheService cacheService, IMapper mapper, WebSocketServer webSocketServer) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper = mapper; |
| | | _webSocketServer = webSocketServer; |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | zHReadData.R_ZH_Status = ((short)commonStackerCrane.StackerCraneStatusValue); |
| | | zHReadData.R_ZH_AutoStatus = ((short)commonStackerCrane.StackerCraneAutoStatusValue); |
| | | zHReadData.R_ZH_WorkStatus = ((short)commonStackerCrane.StackerCraneWorkStatusValue); |
| | | zHReadData.R_ZH_TaskNum = commonStackerCrane.CurrentTaskNum.ObjToInt(); |
| | | zHReadData.R_ZH_WorkType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType); |
| | | zHReadData.R_ZH_TrayType = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TrayType); |
| | | string zHData = JsonConvert.SerializeObject(zHReadData); |
| | | _webSocketServer.PublishAllClientPayload(zHData); |
| | | } |
| | | } |
| | | catch (Exception ex) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.é»çä» |
| | | { |
| | | public class ZHReadData |
| | | { |
| | | /// <summary> |
| | | /// å åæºç¶æ |
| | | /// </summary> |
| | | public short R_ZH_Status; |
| | | |
| | | /// <summary> |
| | | /// å åæºæèªå¨ç¶æ |
| | | /// </summary> |
| | | public short R_ZH_AutoStatus; |
| | | |
| | | /// <summary> |
| | | /// å½åæ£å¨æ§è¡çä»»å¡å· |
| | | /// </summary> |
| | | public int R_ZH_TaskNum; |
| | | |
| | | /// <summary> |
| | | /// å åæºå·¥ä½ç¶æ |
| | | /// </summary> |
| | | public short R_ZH_WorkStatus; |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short R_ZH_WorkType; |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short R_ZH_TrayType; |
| | | |
| | | ///åç«å°è¯»å301 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_ZH_TakePalletType1; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_ZH_PutPalletType1; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanPut1; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanTake1; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutRequest1; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutFinish1; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeRequest1; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeFinish1; |
| | | |
| | | |
| | | ///åç«å°è¯»å302 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_ZH_TakePalletType2; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_ZH_PutPalletType2; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanPut2; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanTake2; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutRequest2; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutFinish2; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeRequest2; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeFinish2; |
| | | |
| | | ///åç«å°è¯»å303 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_ZH_TakePalletType3; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_ZH_PutPalletType3; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanPut3; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanTake3; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutRequest3; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutFinish3; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeRequest3; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeFinish3; |
| | | |
| | | ///åç«å°è¯»å304 |
| | | |
| | | ///åè´§æçç±»å(读) |
| | | public short R_ZH_TakePalletType4; |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | public short W_ZH_PutPalletType4; |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanPut4; |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | public bool R_ZH_IsCanTake4; |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutRequest4; |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_PutFinish4; |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeRequest4; |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | public bool W_ZH_TakeFinish4; |
| | | } |
| | | } |
| | |
| | | this.proCodeOptions = []; |
| | | } |
| | | }, |
| | | created() { |
| | | // åå§åæ¶é¢å è½½ä»åºæ°æ® |
| | | if (this.warehouses.length === 0) { |
| | | this.getWarehouseList(); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | if (column.field == 'proinventoryage') { |
| | | const today = new Date() |
| | | column.formatter = (row) => { |
| | | if (row.details.length > 0) { |
| | | const closestDate = row.details |
| | | .map(x => { |
| | | const date = new Date(x.createDate); |
| | | const ageInDays = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); |
| | | return { date, ageInDays }; |
| | | }) |
| | | .reduce((closest, current) => (current.ageInDays < closest.ageInDays ? current : closest)) |
| | | .date; |
| | | |
| | | const inventoryAge = Math.ceil((today - closestDate) / (1000 * 60 * 60 * 24)); |
| | | |
| | | row.inventoryAge = inventoryAge; |
| | | |
| | | return `${inventoryAge} 天`; |
| | | } |
| | | // å¦ææ²¡ææç»ï¼è¿å空ææç¤ºä¿¡æ¯ |
| | | return '-'; |
| | | } |
| | | } |
| | | if (column.field == 'sumStock') { |
| | | column.formatter = (row) => { |
| | | if (row.details.length > 0) { |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | import { el } from "element-plus/es/locales.mjs"; |
| | |
| | | return str = list[0] == "" ? "æ " : str; |
| | | } |
| | | } |
| | | if (column.field == 'materielInfo') { |
| | | const today = new Date() |
| | | column.formatter = (row) => { |
| | | if (row.details.length > 0) { |
| | | const today = new Date(); |
| | | const closestDate = row.details |
| | | .map(x => { |
| | | const date = new Date(x.effectiveDate); |
| | | const diffInDays = Math.ceil((date - today) / (1000 * 60 * 60 * 24)); // æ¹ä¸ºè®¡ç®å©ä½å¤©æ° |
| | | return { date, diffInDays }; |
| | | }) |
| | | .reduce((closest, current) => (current.diffInDays < closest.diffInDays ? current : closest)) |
| | | .date; |
| | | if (column.field == 'materielInfo') { |
| | | const today = new Date() |
| | | column.formatter = (row) => { |
| | | if (row.details.length > 0) { |
| | | const today = new Date(); |
| | | const closestDate = row.details |
| | | .map(x => { |
| | | const date = new Date(x.effectiveDate); |
| | | const diffInDays = Math.ceil((date - today) / (1000 * 60 * 60 * 24)); // æ¹ä¸ºè®¡ç®å©ä½å¤©æ° |
| | | return { date, diffInDays }; |
| | | }) |
| | | .reduce((closest, current) => (current.diffInDays < closest.diffInDays ? current : closest)) |
| | | .date; |
| | | |
| | | const daysRemaining = Math.ceil((closestDate - today) / (1000 * 60 * 60 * 24)); |
| | | |
| | | row.expiryDays = daysRemaining; |
| | | |
| | | if (daysRemaining <= 0) { |
| | | return '<span style="color:rgb(30, 27, 27)">æ ä¿è´¨æ</span>'; |
| | | const daysRemaining = Math.ceil((closestDate - today) / (1000 * 60 * 60 * 24)); |
| | | |
| | | row.expiryDays = daysRemaining; |
| | | |
| | | if (daysRemaining <= 0) { |
| | | return '<span style="color:rgb(30, 27, 27)">æ ä¿è´¨æ</span>'; |
| | | } else { |
| | | return '<span style="color: #F56C6C">' + daysRemaining + "天" + '</span>'; |
| | | } |
| | | } else { |
| | | return '<span style="color: #F56C6C">' + daysRemaining + "天" + '</span>'; |
| | | row.expiryDays = null; |
| | | return '<span style="color:rgb(24, 18, 18)">æ ä¿è´¨æ</span>'; |
| | | } |
| | | } else { |
| | | row.expiryDays = null; |
| | | return '<span style="color:rgb(24, 18, 18)">æ ä¿è´¨æ</span>'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (column.field == 'inventoryage') { |
| | | const today = new Date() |
| | | column.formatter = (row) => { |
| | | if (row.details.length > 0) { |
| | | const closestDate = row.details |
| | | .map(x => { |
| | | const date = new Date(x.createDate); |
| | | const ageInDays = Math.ceil((today - date) / (1000 * 60 * 60 * 24)); |
| | | return { date, ageInDays }; |
| | | }) |
| | | .reduce((closest, current) => (current.ageInDays < closest.ageInDays ? current : closest)) |
| | | .date; |
| | | |
| | | const inventoryAge = Math.ceil((today - closestDate) / (1000 * 60 * 60 * 24)); |
| | | |
| | | row.inventoryAge = inventoryAge; |
| | | |
| | | return `${inventoryAge} 天`; |
| | | } |
| | | // å¦ææ²¡ææç»ï¼è¿å空ææç¤ºä¿¡æ¯ |
| | | return '-'; |
| | | } |
| | | } |
| | | if (column.field == 'sumStock') { |
| | | column.formatter = (row) => { |
| | |
| | | .map(x => { |
| | | sum += (x.stockQuantity) |
| | | }) |
| | | return '<span style="color: #F56C6C">' + sum.toFixed(3) + row.details[0].unit + '</span>'; |
| | | return '<span style="color: rgb(24, 18, 18)">' + sum.toFixed(3) + row.details[0].unit + '</span>'; |
| | | } else { |
| | | return '<span style="color: #F56C6C">' + "1个" + '</span>'; |
| | | return '<span style="color: rgb(24, 18, 18)">' + "1个" + '</span>'; |
| | | } |
| | | |
| | | } |
| | |
| | | }) |
| | | this.columns.forEach((column) => { |
| | | column.cellStyle = (row) => { |
| | | // åªå¤çæä¿è´¨ææ°æ®çæ
åµ |
| | | if (row.expiryDays !== null && row.expiryDays !== undefined) { |
| | | if (row.expiryDays <= 0) { |
| | | return { background: 'red' }; // 红è²èæ¯ï¼å·²è¿æï¼ |
| | | } else if (row.expiryDays <= 30) { |
| | | return { background: 'yellow' }; // é»è²èæ¯ï¼ä¸´æï¼ |
| | | if (row.expirationlabel !== undefined && row.expirationlabel !== null) { |
| | | if (row.expirationlabel === 2) { |
| | | return { background: 'yellow' }; |
| | | } else if (row.expirationlabel === 3) { |
| | | return { background: '#ffc0cb' }; |
| | | } |
| | | } |
| | | return {}; // é»è®¤æ èæ¯è² |
| | | }; |
| | | } |
| | | return {}; |
| | | }; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | //å¦ææ ¹æ®è¡çæä¸ªå¼è®¾ç½®æ´è¡é¢è² |
| | | //设置æ´è¡èæ¯é¢è² |
| | | // x.cellStyle = (row, rowIndex, columnIndex) => { |
| | | // if (row.ProductCode == '10044464880643') { |
| | | // return { background: '#ddecfd' }; |
| | | // } |
| | | // }; |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | | export default extension; |
| | |
| | | let TaskHandCancelBtn = this.buttons.find(x => x.value == 'TaskHandCancel'); |
| | | if (TaskHandCancelBtn) { |
| | | TaskHandCancelBtn.onClick = function () { |
| | | this.$confirm("æ¯å¦ç¡®è®¤åæ¶ä»»å¡","æå¨ä»»å¡åæ¶è¦å",{ |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'TaskHandCompleted'); |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind:{key: "warehouses", data: []} |
| | | bind:{ key: "warehouses", data: []} |
| | | }, |
| | | { |
| | | field: "orderType", |
| | |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "like" }, |
| | | { title: "ç¶æ", field: "status", type: "select",dataKey:"outLockStockStatusEnum", data:[]}, |
| | | ], |
| | | [ |
| | | { title: "åºåºæ¶é´",field: "createDate",type: "datetime"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 180, |
| | | align: "left", |
| | | |
| | | }, |
| | |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "datetime", |
| | | width: 160, |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | align: "left", |
| | | bind:{key:"outLockStockStatusEnum", data: []} |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | |
| | | ], |
| | | [ |
| | | { title: "产åçæ¬", field: "productVersion",type: "like"}, |
| | | { title: "åºåå建æ¶é´",field: "createDate",type: "datetime"}, |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "proinventoryage", |
| | | title: "æååºé¾", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "lotNumber", |
| | | title: "äº§åæ¹å·", |
| | | type: "string", |
| | |
| | | [ |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type :"like"}, |
| | | {title: "åºåæç»ç¶æ",field: "status",type: "select",dataKey:"stockStatusEmun", data: []}, |
| | | { title: "ææææ¥è¯¢",field: "effectiveDate",type: "datetime"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | { title: "ç©æç¼å·", field: "materielCode",type: "like"}, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo",type: "like"}, |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],}, |
| | | { title: "åºåå建æ¶é´",field: "createDate",type: "datetime"}, |
| | | ], |
| | | [ |
| | | { title: "ææææ¥è¯¢",field: "effectiveDate",type: "date"}, |
| | | {title: "ç©ææææ",field: "expirationlabel",type: "selectList",dataKey:"expirationlabelEnum",data:[]}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | align: "left" |
| | | }, |
| | | { |
| | | field: "expirationlabel", |
| | | title: "ç©ææææ", |
| | | type: "string", |
| | | width: 140, |
| | | align: "left", |
| | | bind: { key: "expirationlabelEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "materielInfo", |
| | | title: "æå«ç©æææ©ä¸´æ", |
| | | type: "string", |
| | | width: 140, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "inventoryage", |
| | | title: "åºé¾", |
| | | type: "string", |
| | | width: 140, |
| | | align: "left", |
| | |
| | | align: "left", |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | |
| | | { |
| | | field: "locationType", |
| | | title: "è´§ä½ç±»å", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.StockEnum |
| | | { |
| | | public enum ExpirationlabelEnum |
| | | { |
| | | [Description("æªä¸´æ")] |
| | | æªä¸´æ = 1, |
| | | |
| | | [Description("临æé¢è¦")] |
| | | 临æé¢è¦ = 2, |
| | | |
| | | [Description("è¿æ")] |
| | | è¿æ = 3, |
| | | } |
| | | } |
| | |
| | | case HtmlElementType.Contains: |
| | | linqExpression = LinqExpressionType.In; |
| | | break; |
| | | case HtmlElementType.ThanOrEqual: |
| | | case HtmlElementType.thanorequal: |
| | | linqExpression = LinqExpressionType.ThanOrEqual; |
| | | break; |
| | | case HtmlElementType.LessOrequal: |
| | | case HtmlElementType.lessorequal: |
| | | linqExpression = LinqExpressionType.LessThanOrEqual; |
| | | break; |
| | | case HtmlElementType.GT: |
| | |
| | | else |
| | | { |
| | | |
| | | int length = sugarColumn.Length; |
| | | if (length == 0) { return (true, null, value); } |
| | | //夿ååèä¸ååæ®µ |
| | | else if (length < 8000 && |
| | | ((dbType.Substring(0, 1) != "n" |
| | | && Encoding.UTF8.GetBytes(val.ToCharArray()).Length > length) |
| | | || val.Length > length) |
| | | ) |
| | | if (sugarColumn != null) |
| | | { |
| | | reslutMsg = $"æå¤åªè½ã{length}ã个å符ã"; |
| | | int length = sugarColumn.Length; |
| | | if (length == 0) { return (true, null, null); } |
| | | //夿ååèä¸ååæ®µ |
| | | else if (length < 8000 && |
| | | ((dbType.Substring(0, 1) != "n" |
| | | && Encoding.UTF8.GetBytes(val.ToCharArray()).Length > length) |
| | | || val.Length > length) |
| | | ) |
| | | { |
| | | reslutMsg = $"æå¤åªè½ã{length}ã个å符ã"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public int StockStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåè¶
ææ è¯ |
| | | /// </summary> |
| | | [ExporterHeader(IsIgnore = true)] |
| | | public int Expirationlabel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºå夿³¨ |
| | | /// </summary> |
| | | [ExporterHeader(IsIgnore = true)] |
| | |
| | | |
| | | List<PPStockSelectViewDTO> PPGetStockSelectViews(int orderId, string materielCode); |
| | | List<PPStockSelectViewDTO> PPGetPKStockSelectViews(int orderId, string materielCode); |
| | | |
| | | WebResponseContent UpdateExpirationlabel(); |
| | | } |
| | | } |
| | |
| | | using SqlSugar; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åæ®ç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®æç»ä¸»é® |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åæ®æç»ä¸»é®")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®æç»ä¸»é®")] |
| | | public int OrderDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç±»å |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åæ®ç±»å")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç±»å")] |
| | | public int OrderType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ¹æ¬¡å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æåç§°")] |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåä¸»é® |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºå主é®")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºå主é®")] |
| | | public int StockId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®æ°é |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åæ®æ°é")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®æ°é")] |
| | | public float OrderQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå§åºåé |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åå§åºåé")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åå§åºåé")] |
| | | public float OriginalQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åé
åºåºé |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åé
åºåºé")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åé
åºåºé")] |
| | | public float AssignQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "è´§ä½ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "è´§ä½ç¼å·")] |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æçç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æçç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åä½")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åä½")] |
| | | public string Unit { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ä»»å¡å·")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡å·")] |
| | | public int? TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç¶æ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¶æ")] |
| | | public int Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ¥æ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "çäº§æ¥æ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "çäº§æ¥æ")] |
| | | public string ProductionDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æææ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æææ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æææ")] |
| | | public string EffectiveDate { get; set; } |
| | | } |
| | |
| | | public int StockLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåè¿ææ è¯ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåè¿ææ è¯")] |
| | | public int Expirationlabel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåæç» |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(Id))] |
| | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç±»å")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å")] |
| | | public int PalletType { get; set; } |
| | | |
| | |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_StockService |
| | | { |
| | |
| | | try |
| | | { |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList.Count > 0) |
| | | if (searchParametersList?.Any() == true) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.ProductCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | switch (param.Name) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.ProductCode.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | case var name when name == nameof(Dt_ProStockInfoDetail.ProductCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.proStockInfoDetails.Any(v => v.ProductCode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_ProStockInfoDetail.LotNumber).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.proStockInfoDetails.Any(v => v.LotNumber.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.ProductVersion).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.ProductVersion.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.SpecifyVer).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.SpecifyVer.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.LotNumber).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.LotNumber.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfo.LocationCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.LocationCode == searchParameters.Value); |
| | | } |
| | | } |
| | | case var name when name == nameof(Dt_ProStockInfo.LocationCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_ProStockInfoDetail.ProductVersion).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.proStockInfoDetails.Any(v => v.ProductVersion.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_ProStockInfoDetail.SpecifyVer).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.proStockInfoDetails.Any(v => v.SpecifyVer.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | |
| | | case var name when name == nameof(Dt_ProStockInfo.CreateDate).FirstLetterToLower(): |
| | | if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate)) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minDate); |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= minDate); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch { } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | string whereSto = GetDataRole(typeof(Dt_ProStockInfo)); |
| | | sugarQueryable1 = sugarQueryable1.Where(whereSto); |
| | |
| | | return BaseDal.GetStockInfos(materielCode, batchNo, locationCodes); |
| | | } |
| | | |
| | | public WebResponseContent UpdateExpirationlabel() |
| | | { |
| | | try |
| | | { |
| | | var today = DateTime.Today; |
| | | int batchSize = 1000; // æ¹æ¬¡å¤çå¤§å° |
| | | |
| | | var query = BaseDal.Db.Queryable<Dt_StockInfoDetail>() |
| | | .InnerJoin<Dt_StockInfo>((detail, master) => detail.StockId == master.Id) |
| | | .Select((detail, master) => new |
| | | { |
| | | MasterId = master.Id, |
| | | master.WarehouseId, |
| | | detail.EffectiveDate, |
| | | CurrentExpirationlabel = master.Expirationlabel // ç¨äºå¤ææ¯å¦éè¦æ´æ° |
| | | }); |
| | | |
| | | // åæ¹å¤çï¼ä½¿ç¨TakeåSkipå®ç°å页 |
| | | var totalUpdated = 0; |
| | | int skipCount = 0; |
| | | |
| | | while (true) |
| | | { |
| | | // 使ç¨SkipåTakeå®ç°å页è·åæ°æ® |
| | | var batchData = query.Skip(skipCount).Take(batchSize).ToList(); |
| | | if (!batchData.Any()) break; // æ²¡ææ´å¤æ°æ®æ¶éåºå¾ªç¯ |
| | | |
| | | var updateDic = new Dictionary<long, int>(); |
| | | |
| | | foreach (var item in batchData) |
| | | { |
| | | if (!DateTime.TryParse(item.EffectiveDate, out DateTime effectiveDate)) |
| | | continue; |
| | | int newLabel; |
| | | if (effectiveDate < today) |
| | | { |
| | | newLabel = ExpirationlabelEnum.è¿æ.ObjToInt(); |
| | | } |
| | | else if (item.WarehouseId == 3) |
| | | { |
| | | int daysDiff = (effectiveDate - today).Days; |
| | | newLabel = daysDiff <= 60 ? ExpirationlabelEnum.临æé¢è¦.ObjToInt() : ExpirationlabelEnum.æªä¸´æ.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | int daysDiff = (effectiveDate - today).Days; |
| | | newLabel = daysDiff <= 30 ? ExpirationlabelEnum.临æé¢è¦.ObjToInt() : ExpirationlabelEnum.æªä¸´æ.ObjToInt(); |
| | | } |
| | | |
| | | // åªæ´æ°æååçå¼ï¼å¹¶ä¸å»é |
| | | if (newLabel != item.CurrentExpirationlabel && !updateDic.ContainsKey(item.MasterId)) |
| | | { |
| | | updateDic[item.MasterId] = newLabel; |
| | | } |
| | | } |
| | | |
| | | if (updateDic.Any()) |
| | | { |
| | | // æå»ºæ¹éæ´æ°è¯å¥ |
| | | var updateBuilder = BaseDal.Db.Updateable<Dt_StockInfo>(); |
| | | foreach (var kvp in updateDic) |
| | | { |
| | | updateBuilder.SetColumns(m => m.Expirationlabel == kvp.Value) |
| | | .Where(m => m.Id == kvp.Key); |
| | | } |
| | | totalUpdated += updateBuilder.ExecuteCommand(); |
| | | } |
| | | skipCount += batchSize; // åå¤è·åä¸ä¸æ¹æ°æ® |
| | | } |
| | | return WebResponseContent.Instance.OK($"æ´æ°æåï¼å
±æ´æ° {totalUpdated} æ¡è®°å½"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ´æ°å¤±è´¥ï¼è¯·è系管çå"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | List<StockViewDTO> stockViewDTOs = new List<StockViewDTO>(); |
| | | |
| | | string where = string.Empty; |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x => x.Details); |
| | | if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList.Count > 0) |
| | | if (searchParametersList?.Any() == true) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | switch (param.Name) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | case var name when name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.MaterielCode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.BatchNo.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.BatchNo.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.LocationCode == searchParameters.Value); |
| | | } |
| | | } |
| | | case var name when name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower(): |
| | | if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate)) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if(expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minDate); |
| | | } |
| | | else if(expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= minDate); |
| | | } |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.EffectiveDate).FirstLetterToLower(): |
| | | // åç«¯ä¼ éç忰鿝 yyyy-MM-dd æ ¼å¼ï¼å¦ "2025-05-08"ï¼ï¼ç´æ¥ä½ä¸ºå符串å¤ç |
| | | string effectiveDateStr = param.Value?.ToString().Trim(); |
| | | if (!string.IsNullOrEmpty(effectiveDateStr) && effectiveDateStr.Length == 10) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details |
| | | .Any(d =>!string.IsNullOrEmpty(d.EffectiveDate) && d.EffectiveDate.CompareTo(effectiveDateStr) >= 0)); |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details |
| | | .Any(d =>!string.IsNullOrEmpty(d.EffectiveDate) && d.EffectiveDate.CompareTo(effectiveDateStr) <= 0)); |
| | | |
| | | |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch { } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | |
| | | string whereSto = GetDataRole(typeof(Dt_StockInfo)); |
| | | sugarQueryable1 = sugarQueryable1.Where(whereSto); |
| | | |
| | | EntityProperties.ValidatePageOptions(options, ref sugarQueryable1); |
| | | |
| | | string whereLo = GetDataRole(typeof(Dt_LocationInfo)); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>().Where(whereLo); |
| | | |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>() |
| | | .Where(whereLo); |
| | | EntityProperties.ValidatePageOptions(options, ref sugarQueryable); |
| | | |
| | | ISugarQueryable<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).Select((b, a) |
| | | => new StockViewDTO |
| | | ISugarQueryable<StockViewDTO> list = sugarQueryable1 |
| | | .InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode) |
| | | .Select((b, a) => new StockViewDTO |
| | | { |
| | | LocationCode = b.LocationCode, |
| | | Expirationlabel = b.Expirationlabel, |
| | | Column = a.Column, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | |
| | | Details = b.Details, |
| | | }); |
| | | |
| | | var pklist = sugarQueryable1.Where(b => b.LocationCode == "å¹³åºä½").Select(b => new StockViewDTO |
| | | { |
| | | LocationCode = b.LocationCode, |
| | | Column = 0, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = 0, |
| | | EnalbeStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = 0, |
| | | LocationName = "å¹³åºä½", |
| | | LocationStatus = LocationStatusEnum.InStock.ObjToInt(), |
| | | LocationType = LocationTypeEnum.Undefined.ObjToInt(), |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = "å¹³åº", |
| | | Row = 0, |
| | | StockId = b.Id, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }); |
| | | // å¹³åºä½æ°æ®æ¥è¯¢ |
| | | var pklist = sugarQueryable1 |
| | | .Where(b => b.LocationCode == "å¹³åºä½") |
| | | .Select(b => new StockViewDTO |
| | | { |
| | | LocationCode = b.LocationCode, |
| | | Column = 0, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Expirationlabel = b.Expirationlabel, |
| | | Creater = b.Creater, |
| | | Depth = 0, |
| | | EnalbeStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = 0, |
| | | LocationName = "å¹³åºä½", |
| | | LocationStatus = LocationStatusEnum.InStock.ObjToInt(), |
| | | LocationType = LocationTypeEnum.Undefined.ObjToInt(), |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = "å¹³åº", |
| | | Row = 0, |
| | | StockId = b.Id, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }); |
| | | |
| | | int totalCount = 0; |
| | | int pktotalCount = 0; |
| | | |
| | | stockViewDTOs = list.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | var stockViewDTOs = list.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | stockViewDTOs.AddRange(pklist.ToPageList(options.Page, options.Rows, ref pktotalCount)); |
| | | |
| | | stockViewDTOs.ForEach(x => |
| | | { |
| | | x.MaterielCode = string.Join(",", x.Details.Select(x => x.MaterielCode).Distinct()); |
| | | x.BatchNo = string.Join(",", x.Details.Select(x => x.BatchNo).Distinct()); |
| | | x.MaterielCode = string.Join(",", x.Details.Select(d => d.MaterielCode).Distinct()); |
| | | x.BatchNo = string.Join(",", x.Details.Select(d => d.BatchNo).Distinct()); |
| | | x.MaterielSpec = x.Details.FirstOrDefault()?.MaterielSpec ?? ""; |
| | | x.MaterielName = x.Details.FirstOrDefault()?.MaterielName ?? ""; |
| | | } |
| | | ); |
| | | }); |
| | | |
| | | return new PageGridData<StockViewDTO>(totalCount + pktotalCount, stockViewDTOs); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | return new PageGridData<StockViewDTO>(); |
| | | } |
| | | |
| | | |
| | | public virtual object GetDetailPage(PageDataOptions pageData) |
| | | { |
| | |
| | | try |
| | | { |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList.Count > 0) |
| | | if (searchParametersList?.Any() == true) |
| | | { |
| | | foreach (var param in searchParametersList) |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | switch (param.Name) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.MaterielCode.Contains(searchParameters.Value))); |
| | | case var name when name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.MaterielCode.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.Details.Any(v => v.BatchNo.Contains(param.Value.ToString()))); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower(): |
| | | if (!string.IsNullOrEmpty(param.Value?.ToString())) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1 |
| | | .Where(x => x.LocationCode == param.Value.ToString()); |
| | | } |
| | | break; |
| | | |
| | | case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower(): |
| | | if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate)) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minDate); |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= minDate); |
| | | } |
| | | } |
| | | break; |
| | | case var name when name == nameof(Dt_StockInfoDetail.EffectiveDate).FirstLetterToLower(): |
| | | // åç«¯ä¼ éç忰鿝 yyyy-MM-dd æ ¼å¼ï¼å¦ "2025-05-08"ï¼ï¼ç´æ¥ä½ä¸ºå符串å¤ç |
| | | string effectiveDateStr = param.Value?.ToString().Trim(); |
| | | if (!string.IsNullOrEmpty(effectiveDateStr) && effectiveDateStr.Length == 10) |
| | | { |
| | | LinqExpressionType expressionType = param.DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details |
| | | .Any(d => !string.IsNullOrEmpty(d.EffectiveDate) && d.EffectiveDate.CompareTo(effectiveDateStr) >= 0)); |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details |
| | | .Any(d => !string.IsNullOrEmpty(d.EffectiveDate) && d.EffectiveDate.CompareTo(effectiveDateStr) <= 0)); |
| | | |
| | | |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.Details.Any(v => v.BatchNo.Contains(searchParameters.Value))); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | catch { } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | string whereSto = GetDataRole(typeof(Dt_StockInfo)); |
| | | sugarQueryable1 = sugarQueryable1.Where(whereSto); |
| | |
| | | { |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | Expirationlabel = b.Expirationlabel, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | |
| | | LocationCode = b.LocationCode, |
| | | Column = 0, |
| | | WarehouseId = b.WarehouseId, |
| | | Expirationlabel = b.Expirationlabel, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = 0, |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "expirationlabelEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | { |
| | | Type type = typeof(ExpirationlabelEnum); |
| | | List<int> enums = Enum.GetValues(typeof(ExpirationlabelEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(ExpirationlabelEnum).GetField(((ExpirationlabelEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent InboundTaskHandCancel(int taskNum, int warehouseId) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç对åºçç»çä¿¡æ¯"); |
| | | } |
| | | if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æçåºåæç»ä¿¡æ¯"); |
| | | } |
| | | if (task.TaskType == TaskTypeEnum.MesPalletLargeReturn.ObjToInt() || task.TaskType == TaskTypeEnum.MesPalletSmallReturn.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Cancel.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.人工å é¤ : OperateTypeEnum.èªå¨å é¤); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å é¤ : OperateTypeEnum.人工å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="warehouseId"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum,int warehouseId) |
| | | { |
| | | try |
| | |
| | | { |
| | | return Service.StockQueryData(saveModel); |
| | | } |
| | | /// <summary> |
| | | /// è¿ææ è¯æ´æ° |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("UpdateExpirationlabel"),AllowAnonymous] |
| | | public WebResponseContent UpdateExpirationlabel() |
| | | { |
| | | return Service.UpdateExpirationlabel(); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("TaskHandCancel"), AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("TaskHandCa"), AllowAnonymous] |
| | | public async Task<WebResponseContent> TaskHandCancel(int taskNum ,int warehouseId) |
| | | { |
| | | return await Service.TaskHandCancel(taskNum,warehouseId); |