已删除4个文件
已修改52个文件
已添加6个文件
已重命名1个文件
| | |
| | | // import { config } from 'vue/types/umd'; |
| | | axios.defaults.withCredentials=true; |
| | | axios.defaults.crossDomain=true; |
| | | axios.defaults.baseURL = 'http://10.30.4.92:9283';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.baseURL = 'http://10.30.4.92:7081';//'http://192.168.2.51:8099'; //'http://localhost:8099'; //'http://192.168.2.51:8099';// |
| | | axios.defaults.headers.post["Content-Type"]="application/json;charset=utf-8"; |
| | | // é误信æ¯å¤ç |
| | | const errorHandle = (status, other) => { |
| | |
| | | let baseUrl = UtilVar.baseUrl |
| | | const CancelToken = axios.CancelToken; |
| | | export { baseUrl }; |
| | | // axios.defaults.withCredentials = true; |
| | | axios.defaults.withCredentials = true; |
| | | // æ·»å è¯·æ±æ¦æªå¨ |
| | | axios.interceptors.request.use(function (config) { |
| | | // å¨åé请æ±ä¹ååäºä»ä¹ ä¼ token |
| | |
| | | export function ProLocationStatistics (data) { |
| | | return axios.post('/api/Large/ProLocationStatistics?id=7', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æåè¿ä¸å¤©ç»è®¡ |
| | | //æåå
¥åºäº§éç»è®¡ |
| | | export function Productions (data) { |
| | | return axios.post('/api/Large/Productions', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | export function ProductionStock (data) { |
| | | return axios.post('/api/Large/ProductionStock', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æå产ååºåæ»æ°ç»è®¡ |
| | | export function GetCPLargeStockCount (data) { |
| | | return axios.post('/api/Large/GetCPLargeStockCount', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | | //æåè¿ä¸å¤©ä»»å¡ç»è®¡ |
| | | export function GetProWeekTasks (data) { |
| | | return axios.post('/api/Large/GetProWeekTasks', data)//è¿åçæ¶promieså¯¹è±¡ï¼æä»¥ç´æ¥returnåºå»å°±å¥½äº |
| | | } |
| | |
| | | ]; |
| | | const router = new VueRouter({ |
| | | mode: "hash", |
| | | // base: process.env.BASE_URL, |
| | | base: process.env.BASE_URL, |
| | | routes |
| | | }); |
| | | |
| | |
| | | limitMoveNum: 4, // å¼å§æ ç¼æ»å¨çæ°æ®é this.dataList.length |
| | | singleHeight: 0, // 忥è¿å¨åæ¢çé«åº¦(é»è®¤å¼0æ¯æ ç¼ä¸åæ¢çæ»å¨) direction => 0/1 |
| | | singleWidth: 0, // 忥è¿å¨åæ¢ç宽度(é»è®¤å¼0æ¯æ ç¼ä¸åæ¢çæ»å¨) direction => 2/3 |
| | | waitTime: 3000 // 忥è¿å¨åæ¢çæ¶é´(é»è®¤å¼1000ms) |
| | | waitTime: 8000 // 忥è¿å¨åæ¢çæ¶é´(é»è®¤å¼1000ms) |
| | | }, |
| | | echartsAutoTime:3000,//echarts å¾èªå¨è¯·æ±æ¥å£æ¶é´ |
| | | echartsAutoTime:8000,//echarts å¾èªå¨è¯·æ±æ¥å£æ¶é´ |
| | | }), |
| | | getters: { |
| | | //æ ¹æ®èåè·¯å¾è·å èåä¿¡æ¯ |
| | |
| | | color: "#FFF", |
| | | show: true, |
| | | }, |
| | | // colorBy: "data", |
| | | colorBy: "data", |
| | | itemStyle: { |
| | | color: "rgba(255,255,255,1)", |
| | | borderColor: "rgba(2255,255,255,2)", |
| | |
| | | #00eaff 48.8525390625%, |
| | | #01aaff 100% |
| | | ); |
| | | -webkit-background-clip: text; |
| | | |
| | | -webkit-text-fill-color: transparent; |
| | | margin: 0 10px; |
| | | } |
| | |
| | | |
| | | <ItemWrap |
| | | class="contetn_left-bottom contetn_lr-item" |
| | | title="æåæ§è¡ä»»å¡ç»è®¡" |
| | | title="æå彿æ§è¡ä»»å¡ç»è®¡" |
| | | > |
| | | <stationone/> |
| | | </ItemWrap> |
| | | |
| | | <ItemWrap |
| | | class="contetn_left-bottom contetn_lr-item" |
| | | title="æååºå屿§åå¸" |
| | | title="æåä»äº§ååºåæ»æ°ç»è®¡" |
| | | > |
| | | <stationtwo/> |
| | | </ItemWrap> |
| | |
| | | |
| | | </div> |
| | | <div class="contetn_center"> |
| | | <ItemWrap class="contetn_left-bottom contetn_lr-item" style="height: 66vh;" title="æåä»»å¡ç»è®¡"> |
| | | <ItemWrap class="contetn_left-bottom contetn_lr-item" style="height: 66vh;" title="æåè¿ä¹å¤©ä»»å¡ç»è®¡"> |
| | | <LeftBottom/> |
| | | </ItemWrap> |
| | | <ItemWrap |
| | |
| | | <!-- |
| | | * @Author: daidai |
| | | * @Date: 2022-02-28 16:16:42 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2022-07-20 17:57:11 |
| | | * @FilePath: \web-pc\src\pages\big-screen\view\indexs\left-center.vue |
| | | --> |
| | | <template> |
| | | <div id="name" style="width: 100%; height: 100%"> |
| | | <Echart :options="options" style="width: 100%; height: 100%"></Echart> |
| | | <Echart |
| | | :options="options" |
| | | style="width: 100%; height: 100%" |
| | | v-if="!loading" |
| | | /> |
| | | <div v-else style="color: white; text-align: center; padding-top: 50px"> |
| | | æ°æ®å è½½ä¸... |
| | | </div> |
| | | <div v-if="error" style="color: red; text-align: center; padding-top: 50px"> |
| | | æ°æ®å 载失败: {{ error }} |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { currentGET } from "api/modules"; |
| | | import { ProLocationStatistics } from "@/api/http.js"; |
| | | import { GetProWeekTasks } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | let style = { |
| | | fontSize: 24, |
| | | }; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageflag: true, |
| | | myChart: {}, |
| | | options: {}, |
| | | loading: false, |
| | | error: null, |
| | | timer: null |
| | | }; |
| | | }, |
| | | filters: { |
| | | numsFilter(msg) { |
| | | return msg || 0; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | this.fetchData(); |
| | | this.startAutoRefresh(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.clearData(); |
| | | this.stopAutoRefresh(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | initEmptyChart() { |
| | | this.options = { |
| | | //æµ®å¨æ¡ |
| | | tooltip: {}, |
| | | //å¾ä¾ |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['PM2.5', 'CO2', 'SO'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | visualMap: [{ |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'SO', |
| | | seriesIndex: 2 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'CO2', |
| | | seriesIndex: 1 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'PM2.5', |
| | | seriesIndex: 0 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'SO', |
| | | seriesIndex: 5 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'CO2', |
| | | seriesIndex: 4 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'PM2.5', |
| | | seriesIndex: 3 |
| | | }], |
| | | //xè½´ |
| | | xAxis: { |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //åæ è½´æ¾ç¤ºå¼ |
| | | data: ["1æ¶", "2æ¶", "3æ¶", "4æ¶", "5æ¶", "6æ¶", "7æ¶", "8æ¶"] |
| | | }, |
| | | //yè½´ |
| | | yAxis: { |
| | | min: 0, |
| | | max: 100, |
| | | axisLabel: { // æ¹åyè½´åä½é¢è²åå¤§å° |
| | | //formatter: '{value} m³ ', // ç»yè½´æ·»å åä½ |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | //åæ è½´çº¿ |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //å¨gridåºåä¸çåé线 |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // |
| | | series: [{ |
| | | name: 'PM2.5', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#feb01e' |
| | | }, |
| | | data: [43, 50, 41, 18, 28, 25, 26, 40], |
| | | }, { |
| | | name: 'CO2', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#1be57a' |
| | | }, |
| | | data: [21, 30, 37, 39, 23, 37, 5, 50] |
| | | }, { |
| | | name: 'SO', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#69dbf7' |
| | | }, |
| | | data: [76, 58, 60, 38, 49, 59, 78, 60] |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'PM2.5', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#feb01e' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(254,176,30,.3)' |
| | | }]) |
| | | }, |
| | | data: [43, 50, 41, 18, 28, 25, 26, 40] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'CO2', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#1be57a' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(27,229,122,.3)' |
| | | }]) |
| | | }, |
| | | data: [21, 30, 37, 39, 23, 37, 5, 50] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'SO', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#69dbf7' |
| | | }, { |
| | | offset: 1, |
| | | color: '#aefbc3' |
| | | }]) |
| | | }, |
| | | markLine: { |
| | | symbol: "none", |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | }, |
| | | lineStyle: { |
| | | type: "solid", |
| | | color: 'rgba(210,56,56,.6)', |
| | | width: 2 |
| | | }, |
| | | data: [{ |
| | | yAxis: 60 |
| | | }] |
| | | }, |
| | | data: [76, 58, 60, 38, 49, 59, 78, 60] |
| | | |
| | | }] |
| | | }; |
| | | }, |
| | | clearData() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | async getData() { |
| | | this.pageflag = true; |
| | | // currentGET("big2").then((res) => { |
| | | // if (!this.timer) { |
| | | // console.log("è®¾å¤æ»è§2", res); |
| | | // } |
| | | // if (res.success) { |
| | | // this.userOverview = res.data; |
| | | // this.onlineconfig = { |
| | | // ...this.onlineconfig, |
| | | // number: [1] |
| | | // } |
| | | // this.config = { |
| | | // ...this.config, |
| | | // number: [7] |
| | | // } |
| | | // this.offlineconfig = { |
| | | // ...this.offlineconfig, |
| | | // number: [4] |
| | | // } |
| | | // this.laramnumconfig = { |
| | | // ...this.laramnumconfig, |
| | | // number: [10] |
| | | // } |
| | | // this.switper(); |
| | | // } else { |
| | | // this.pageflag = false; |
| | | // this.$Message.warning(res.msg); |
| | | // } |
| | | // }); |
| | | var rep = await ProLocationStatistics(); |
| | | this.options = { |
| | | //æµ®å¨æ¡ |
| | | tooltip: {}, |
| | | //å¾ä¾ |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['æåå
¥åº', 'æååºåº', 'æååæ¡'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | visualMap: [{ |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#69dbf7' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æåå
¥åº', |
| | | seriesIndex: 2 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#1be57a' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æååºåº', |
| | | seriesIndex: 1 |
| | | }, { |
| | | type: 'piecewise', |
| | | show: false, |
| | | pieces: [{ |
| | | gt: 0, |
| | | lte: 60, |
| | | color: '#feb01e' |
| | | }, { |
| | | gte: 60, |
| | | color: '#e5421b' |
| | | }], |
| | | seriesName: 'æååæ¡', |
| | | seriesIndex: 0 |
| | | }], |
| | | //xè½´ |
| | | xAxis: { |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //åæ è½´æ¾ç¤ºå¼ |
| | | data: ["04/19", "04/20", "04/21", "04/22", "04/23", "04/24", "04/25"] |
| | | }, |
| | | //yè½´ |
| | | yAxis: { |
| | | axisLabel: { // æ¹åyè½´åä½é¢è²åå¤§å° |
| | | //formatter: '{value} m³ ', // ç»yè½´æ·»å åä½ |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | //åæ è½´çº¿ |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | //å»åº¦çº¿ |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | //å¨gridåºåä¸çåé线 |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | |
| | | // |
| | | series: [{ |
| | | name: 'æåå
¥åº', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#feb01e' |
| | | }, |
| | | data: [160, 156, 150, 180, 170, 200, 20], |
| | | }, { |
| | | name: 'æååºåº', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#1be57a' |
| | | }, |
| | | data: [80, 115, 120, 130, 91, 99, 20] |
| | | }, { |
| | | name: 'æååæ¡', |
| | | type: 'line', |
| | | symbolSize: [0, 0], |
| | | itemStyle: { |
| | | color: '#69dbf7' |
| | | }, |
| | | data: [70, 113, 118, 111, 89, 99, 32] |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æåå
¥åº', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#feb01e' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(254,176,30,.3)' |
| | | }]) |
| | | }, |
| | | data: [160, 156, 150, 180, 170, 200, 20] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æååºåº', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#1be57a' |
| | | }, { |
| | | offset: 1, |
| | | color: 'rgba(27,229,122,.3)' |
| | | }]) |
| | | }, |
| | | data: [80, 115, 120, 130, 91, 99, 20] |
| | | |
| | | }, { //æ°´æ³¢çº¹ç¹ |
| | | name: 'æååæ¡', |
| | | type: 'effectScatter', |
| | | symbolSize: [5, 5], |
| | | rippleEffect: { |
| | | period: 1, |
| | | scale: 4, |
| | | brushType: 'fill' |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{ |
| | | offset: 0, |
| | | color: '#69dbf7' |
| | | }, { |
| | | offset: 1, |
| | | color: '#aefbc3' |
| | | }]) |
| | | }, |
| | | markLine: { |
| | | symbol: "none", |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | }, |
| | | lineStyle: { |
| | | type: "solid", |
| | | color: 'rgba(210,56,56,.6)', |
| | | width: 2 |
| | | }, |
| | | data: [{ |
| | | yAxis: 60 |
| | | }] |
| | | }, |
| | | data: [70, 113, 118, 111, 89, 99, 32] |
| | | |
| | | }] |
| | | }; |
| | | this.switper(); |
| | | }, |
| | | //轮询 |
| | | switper() { |
| | | if (this.timer) { |
| | | return; |
| | | } |
| | | let looper = (a) => { |
| | | this.getData(); |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | formatter: params => { |
| | | let result = `${params[0].axisValue}<br>`; |
| | | params.forEach(item => { |
| | | result += `${item.marker} ${item.seriesName}: ${item.value}<br>`; |
| | | }); |
| | | return result; |
| | | } |
| | | }, |
| | | legend: { |
| | | right: '12%', |
| | | bottom: '4%', |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: '13' |
| | | }, |
| | | itemGap: 20, |
| | | itemWidth: 10, |
| | | itemHeight: 10, |
| | | icon: 'circle', |
| | | data: ['æåå
¥åº', 'æååºåº', '空æ¡åæµ', 'æåååº'] |
| | | }, |
| | | grid: { |
| | | left: '8%', |
| | | top: '15%', |
| | | bottom: '14%', |
| | | width: '86%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#132987' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#FFF', |
| | | fontSize: 12 |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | data: ['å è½½ä¸...'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: '#fff', |
| | | fontSize: 12, |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: '#132987', |
| | | } |
| | | }, |
| | | }, |
| | | series: [ |
| | | { name: 'æåå
¥åº', type: 'line', data: [] }, |
| | | { name: 'æååºåº', type: 'line', data: [] }, |
| | | { name: '空æ¡åæµ', type: 'line', data: [] }, |
| | | { name: 'æåååº', type: 'line', data: [] } |
| | | ] |
| | | }; |
| | | this.timer = setInterval( |
| | | looper, |
| | | this.$store.state.setting.echartsAutoTime |
| | | ); |
| | | }, |
| | | }, |
| | | async fetchData() { |
| | | this.loading = true; |
| | | this.error = null; |
| | | |
| | | try { |
| | | console.log('æ£å¨è¯·æ±æ°æ®...'); |
| | | const response = await GetProWeekTasks({}); |
| | | console.log('宿´ååº:', response); // æå°å®æ´ååºæ¥çç»æ |
| | | |
| | | // ç´æ¥ä½¿ç¨responseä½ä¸ºæ°æ®ï¼æ ¹æ®å®é
ååºç»æè°æ´ï¼ |
| | | if (!response || !response.dateRange || !response.dailyStatistics) { |
| | | throw new Error('æ°æ®æ ¼å¼ä¸æ£ç¡®'); |
| | | } |
| | | |
| | | this.updateChart(response); // ç´æ¥ä¼ å
¥responseï¼èéresponse.data |
| | | } catch (error) { |
| | | console.error('è·åæ°æ®é误:', error); |
| | | this.error = error.message; |
| | | this.initEmptyChart(); |
| | | } finally { |
| | | this.loading = false; |
| | | } |
| | | }, |
| | | updateChart(data) { |
| | | |
| | | |
| | | const dates = data.dateRange; |
| | | const stats = data.dailyStatistics; |
| | | |
| | | const seriesData = { |
| | | 'æåå
¥åº': [], |
| | | 'æååºåº': [], |
| | | '空æ¡åæµ': [], |
| | | 'æåååº': [] |
| | | }; |
| | | |
| | | // æ ¹æ®å®é
æ°æ®æ ¼å¼è°æ´å段åï¼å°åå¼å¤´ï¼ |
| | | stats.forEach(day => { |
| | | seriesData['æåå
¥åº'].push(day.inProduct || 0); |
| | | seriesData['æååºåº'].push(day.outProduct || 0); |
| | | seriesData['空æ¡åæµ'].push(day.emptyProductBack || 0); |
| | | seriesData['æåååº'].push(day.inProductBack || 0); |
| | | }); |
| | | |
| | | this.options = { |
| | | ...this.options, |
| | | xAxis: { |
| | | ...this.options.xAxis, |
| | | data: dates |
| | | }, |
| | | series: this.options.series.map(series => ({ |
| | | ...series, |
| | | data: seriesData[series.name] || [] |
| | | })) |
| | | }; |
| | | }, |
| | | startAutoRefresh() { |
| | | this.stopAutoRefresh(); |
| | | this.timer = setInterval(() => { |
| | | this.fetchData(); |
| | | }, this.$store.state.setting.echartsAutoTime || 10000); |
| | | }, |
| | | stopAutoRefresh() { |
| | | if (this.timer) clearInterval(this.timer); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang='scss' scoped> |
| | | .user_Overview { |
| | | li { |
| | |
| | | <!-- |
| | | * @Author: daidai |
| | | * @Date: 2022-02-28 16:16:42 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2022-07-20 17:57:11 |
| | | * @FilePath: \web-pc\src\pages\big-screen\view\indexs\left-center.vue |
| | | --> |
| | | <template> |
| | | <div id="name" style="width: 100%; height: 100%"> |
| | | <Echart :options="options" style="width: 100%; height: 100%"></Echart> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { currentGET } from "api/modules"; |
| | | import { ProductionStock } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | let style = { |
| | | fontSize: 24, |
| | | }; |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageflag: true, |
| | | myChart: {}, |
| | | options: {}, |
| | | }; |
| | | }, |
| | | filters: { |
| | | numsFilter(msg) { |
| | | return msg || 0; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.clearData(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | let dataPie = [ |
| | | <div class="tech-chart-container"> |
| | | <Echart |
| | | :options="options" |
| | | :autoresize="true" |
| | | style="width: 100%; height: 100%" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | { |
| | | value: 410, |
| | | name: 'ä¼ä¸' |
| | | }, |
| | | { |
| | | value: 380, |
| | | name: 'æ¿åº' |
| | | }, |
| | | { |
| | | value: 501, |
| | | name: '个人' |
| | | }, |
| | | ]; |
| | | let colorPie = ['#173852', '#0b2036', '#002e49']; |
| | | let colorWrap = ['#3087d6', '#afe1ff', '#4be1ff']; |
| | | let baseDataPie = [], |
| | | baseDataWrap = []; |
| | | for (var i = 0; i < dataPie.length; i++) { |
| | | baseDataPie.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | borderWidth: 50, |
| | | <script> |
| | | import { GetCPLargeStockCount } from "@/api/http.js"; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | borderColor: colorPie[i], |
| | | |
| | | } |
| | | } |
| | | }); |
| | | baseDataWrap.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | color: colorWrap[i], |
| | | borderWidth: 10, |
| | | borderColor: colorWrap[i], |
| | | shadowBlur: 50, |
| | | shadowColor: 'rgba(48, 135, 214, 0.3)', |
| | | } |
| | | } |
| | | }, { |
| | | value: 10, |
| | | name: '', |
| | | itemStyle: { |
| | | normal: { |
| | | color: 'transparent', |
| | | borderWidth: 10, |
| | | borderColor: 'transparent', |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.options = { |
| | | backgroundColor: '#021228', |
| | | title: { |
| | | text: 'æ¥è¦æ»æ°', |
| | | subtext: '10,225', |
| | | textStyle: { |
| | | export default { |
| | | data() { |
| | | return { |
| | | options: { |
| | | backgroundColor: 'transparent', |
| | | title: { |
| | | text: 'æå产ååºåæ»æ°', |
| | | subtext: 'å è½½ä¸...', |
| | | textStyle: { |
| | | color: '#00b5f3', |
| | | fontSize: 12, |
| | | |
| | | }, |
| | | subtextStyle: { |
| | | fontSize: 14, |
| | | }, |
| | | subtextStyle: { |
| | | align: 'center', |
| | | fontSize: 18, |
| | | color: ['#85c7e3'], |
| | | fontWeight:800 |
| | | fontSize: 28, |
| | | color: '#4be1ff', |
| | | fontWeight: 'bold', |
| | | textShadow: '0 0 15px rgba(75, 225, 255, 0.7)' |
| | | }, |
| | | x: 'center', |
| | | y: 'center', |
| | | }, |
| | | x: '38%', |
| | | y: 'center', |
| | | }, |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'item', |
| | | formatter: "{a}ï¼{b} <br/>å æ¯ï¼{d}%" |
| | | }, |
| | | legend: { |
| | | data: ['ä¼ä¸', 'æ¿åº', '个人'], |
| | | icon: 'vertical', |
| | | right: '1%', |
| | | top: 'center', |
| | | orient: 'vertical', |
| | | itemGap: 20, |
| | | itemWidth: 15, |
| | | itemHeight: 8, |
| | | |
| | | formatter: function(name) { |
| | | let target; |
| | | for (let i = 0; i < dataPie.length; i++) { |
| | | if (dataPie[i].name === name) { |
| | | target = dataPie[i].value |
| | | } |
| | | } |
| | | let arr = [name, target]; |
| | | return arr.join("\n") |
| | | |
| | | tooltip: { |
| | | show: false // å®å
¨ç¦ç¨tooltip |
| | | }, |
| | | textStyle: { |
| | | lineHeight: 20, |
| | | color: '#9ed2f5', |
| | | |
| | | }, |
| | | }, |
| | | grid: { |
| | | left: '1%', // ä¸å®¹å¨å·¦ä¾§çè·ç¦» |
| | | right: '1%', // ä¸å®¹å¨å³ä¾§çè·ç¦» |
| | | top: '1%', // ä¸å®¹å¨é¡¶é¨çè·ç¦» |
| | | bottom: '1%', // ä¸å®¹å¨åºé¨çè·ç¦» |
| | | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '', |
| | | series: [ |
| | | { |
| | | name: 'åºåæ°é', |
| | | type: 'pie', |
| | | clockWise: false, //顺æ¶å è½½ |
| | | hoverAnimation: false, //é¼ æ ç§»å
¥å大 |
| | | center: ['40%', '50%'], |
| | | radius: ['80%', '81%'], |
| | | tooltip: { |
| | | show: false |
| | | }, |
| | | radius: ['65%', '85%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, // ç¦ç¨æ¬åå¨ç» |
| | | silent: true, // ç¦ç¨ææäº¤äº |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | show: false |
| | | }, |
| | | data: baseDataWrap |
| | | }, |
| | | { |
| | | |
| | | name: 'æ¥è¦', |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | itemStyle: { |
| | | borderWidth: 0, |
| | | shadowBlur: 20, |
| | | shadowColor: 'rgba(0, 150, 255, 0.5)' |
| | | }, |
| | | data: [{ |
| | | value: 0, |
| | | name: '', |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | } |
| | | }] |
| | | }, |
| | | // æ·»å å¤åå
åç¯ |
| | | { |
| | | type: 'pie', |
| | | color: colorPie, |
| | | selectedMode: 'single', |
| | | radius: ['55%', '58%'], |
| | | center: ['40%', '50%'], |
| | | radius: ['85%', '87%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | silent: true, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | }, |
| | | |
| | | data: baseDataPie |
| | | }, |
| | | |
| | | ] |
| | | }; |
| | | }, |
| | | clearData() { |
| | | if (this.timer) { |
| | | clearInterval(this.timer); |
| | | this.timer = null; |
| | | } |
| | | }, |
| | | async getData() { |
| | | this.pageflag = true; |
| | | // currentGET("big2").then((res) => { |
| | | // if (!this.timer) { |
| | | // console.log("è®¾å¤æ»è§2", res); |
| | | // } |
| | | // if (res.success) { |
| | | // this.userOverview = res.data; |
| | | // this.onlineconfig = { |
| | | // ...this.onlineconfig, |
| | | // number: [1] |
| | | // } |
| | | // this.config = { |
| | | // ...this.config, |
| | | // number: [7] |
| | | // } |
| | | // this.offlineconfig = { |
| | | // ...this.offlineconfig, |
| | | // number: [4] |
| | | // } |
| | | // this.laramnumconfig = { |
| | | // ...this.laramnumconfig, |
| | | // number: [10] |
| | | // } |
| | | // this.switper(); |
| | | // } else { |
| | | // this.pageflag = false; |
| | | // this.$Message.warning(res.msg); |
| | | // } |
| | | // }); |
| | | // var rep = await ProductionStock(); |
| | | let dataPie = [ |
| | | { |
| | | value: 430, |
| | | name: 'åºå产å' |
| | | }, |
| | | ]; |
| | | let colorPie = ['#173852']; |
| | | let colorWrap = ['#3087d6']; |
| | | let baseDataPie = [], |
| | | baseDataWrap = []; |
| | | for (var i = 0; i < dataPie.length; i++) { |
| | | baseDataPie.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | borderWidth: 50, |
| | | |
| | | borderColor: colorPie[i], |
| | | |
| | | } |
| | | } |
| | | }); |
| | | baseDataWrap.push({ |
| | | value: dataPie[i].value, |
| | | name: dataPie[i].name, |
| | | itemStyle: { |
| | | normal: { |
| | | color: colorWrap[i], |
| | | borderWidth: 10, |
| | | borderColor: colorWrap[i], |
| | | shadowBlur: 50, |
| | | shadowColor: 'rgba(48, 135, 214, 0.3)', |
| | | } |
| | | } |
| | | }, { |
| | | value: 10, |
| | | name: '', |
| | | itemStyle: { |
| | | normal: { |
| | | color: 'transparent', |
| | | borderWidth: 10, |
| | | borderColor: 'transparent', |
| | | |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.options = { |
| | | title: { |
| | | text: 'äº§åæ»æ°', |
| | | subtext: '430', |
| | | textStyle: { |
| | | color: '#00b5f3', |
| | | fontSize: 12, |
| | | |
| | | }, |
| | | subtextStyle: { |
| | | align: 'center', |
| | | fontSize: 18, |
| | | color: ['#85c7e3'], |
| | | fontWeight:800 |
| | | }, |
| | | x: '33%', |
| | | y: 'center', |
| | | }, |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'item', |
| | | formatter: "{a}ï¼{b} <br/>å æ¯ï¼{d}%" |
| | | }, |
| | | legend: { |
| | | data: ['åºå产å'], |
| | | icon: 'vertical', |
| | | right: '1%', |
| | | top: 'center', |
| | | orient: 'vertical', |
| | | itemGap: 20, |
| | | itemWidth: 15, |
| | | itemHeight: 8, |
| | | |
| | | formatter: function(name) { |
| | | let target; |
| | | for (let i = 0; i < dataPie.length; i++) { |
| | | if (dataPie[i].name === name) { |
| | | target = dataPie[i].value |
| | | } |
| | | } |
| | | let arr = [name, target]; |
| | | return arr.join("\n") |
| | | |
| | | }, |
| | | textStyle: { |
| | | lineHeight: 20, |
| | | color: '#9ed2f5', |
| | | |
| | | }, |
| | | }, |
| | | grid: { |
| | | left: '1%', // ä¸å®¹å¨å·¦ä¾§çè·ç¦» |
| | | right: '1%', // ä¸å®¹å¨å³ä¾§çè·ç¦» |
| | | top: '1%', // ä¸å®¹å¨é¡¶é¨çè·ç¦» |
| | | bottom: '1%', // ä¸å®¹å¨åºé¨çè·ç¦» |
| | | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '', |
| | | data: [{ |
| | | value: 1, |
| | | name: '' |
| | | }] |
| | | }, |
| | | // æ·»å å
åå
åç¯ |
| | | { |
| | | type: 'pie', |
| | | clockWise: false, //顺æ¶å è½½ |
| | | hoverAnimation: false, //é¼ æ ç§»å
¥å大 |
| | | center: ['40%', '50%'], |
| | | radius: ['80%', '81%'], |
| | | tooltip: { |
| | | show: false |
| | | }, |
| | | label: { |
| | | normal: { |
| | | show: false |
| | | } |
| | | }, |
| | | data: baseDataWrap |
| | | }, |
| | | { |
| | | |
| | | name: 'ç§ç±»', |
| | | type: 'pie', |
| | | color: colorPie, |
| | | selectedMode: 'single', |
| | | radius: ['55%', '58%'], |
| | | center: ['40%', '50%'], |
| | | radius: ['63%', '65%'], |
| | | center: ['50%', '50%'], |
| | | hoverAnimation: false, |
| | | label: { |
| | | normal: { |
| | | show: false, |
| | | } |
| | | silent: true, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | itemStyle: { |
| | | // éèè²å°èç½è²æ¸åï¼æ·»å å¨æææ |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { offset: 0, color: '#00ffcc' }, |
| | | { offset: 0.5, color: '#00b4ff' }, |
| | | { offset: 1, color: '#0062ff' } |
| | | ], |
| | | global: false |
| | | } |
| | | }, |
| | | |
| | | data: baseDataPie |
| | | }, |
| | | |
| | | ] |
| | | }; |
| | | this.switper(); |
| | | data: [{ |
| | | value: 1, |
| | | name: '' |
| | | }] |
| | | }, |
| | | // æ·»å 卿ç²åææ |
| | | { |
| | | type: 'scatter', |
| | | coordinateSystem: 'none', |
| | | data: this.generateParticles(30), |
| | | symbolSize: (val) => { |
| | | return val[2] * 2; |
| | | }, |
| | | itemStyle: { |
| | | color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [ |
| | | { offset: 0, color: 'rgba(0, 255, 255, 0.8)' }, |
| | | { offset: 1, color: 'rgba(0, 255, 255, 0)' } |
| | | ]) |
| | | }, |
| | | // æ·»å ç²åéªçææ |
| | | effect: { |
| | | show: true, |
| | | period: 2, |
| | | trailLength: 0.1, |
| | | symbol: 'circle', |
| | | symbolSize: 0 |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | //轮询 |
| | | switper() { |
| | | if (this.timer) { |
| | | return; |
| | | } |
| | | let looper = (a) => { |
| | | this.getData(); |
| | | }; |
| | | this.timer = setInterval( |
| | | looper, |
| | | this.$store.state.setting.echartsAutoTime |
| | | ); |
| | | }, |
| | | timer: null, |
| | | particleTimer: null, |
| | | gradientTimer: null |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.fetchData(); |
| | | this.startAutoRefresh(); |
| | | this.startParticleAnimation(); |
| | | this.startGradientAnimation(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.stopAutoRefresh(); |
| | | this.stopParticleAnimation(); |
| | | this.stopGradientAnimation(); |
| | | }, |
| | | methods: { |
| | | generateParticles(count) { |
| | | const particles = []; |
| | | for (let i = 0; i < count; i++) { |
| | | const angle = Math.random() * Math.PI * 2; |
| | | const radius = 0.7 + Math.random() * 0.2; |
| | | particles.push([ |
| | | Math.cos(angle) * radius, |
| | | Math.sin(angle) * radius, |
| | | Math.random() * 2 + 1 |
| | | ]); |
| | | } |
| | | return particles; |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang='scss' scoped> |
| | | .user_Overview { |
| | | li { |
| | | flex: 1; |
| | | |
| | | p { |
| | | text-align: center; |
| | | height: 16px; |
| | | font-size: 16px; |
| | | async fetchData() { |
| | | try { |
| | | const response = await GetCPLargeStockCount({}); |
| | | const stockCount = response.stockCount || 0; |
| | | this.updateChart(stockCount); |
| | | } catch (error) { |
| | | console.error('è·ååºåæ»æ°å¤±è´¥:', error); |
| | | this.options.title.subtext = 'æ°æ®å¼å¸¸'; |
| | | this.options.title.subtextStyle.color = '#ff4d4f'; |
| | | } |
| | | |
| | | .user_Overview_nums { |
| | | width: 100px; |
| | | height: 100px; |
| | | text-align: center; |
| | | line-height: 100px; |
| | | font-size: 22px; |
| | | margin: 50px auto 30px; |
| | | background-size: cover; |
| | | background-position: center center; |
| | | position: relative; |
| | | |
| | | &::before { |
| | | content: ""; |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | top: 0; |
| | | left: 0; |
| | | } |
| | | |
| | | &.bgdonghua::before { |
| | | animation: rotating 14s linear infinite; |
| | | } |
| | | } |
| | | |
| | | .allnum { |
| | | // background-image: url("../../assets/img/left_top_lan.png"); |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_lan.png"); |
| | | } |
| | | } |
| | | |
| | | .online { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_lv.png"); |
| | | } |
| | | } |
| | | |
| | | .offline { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_huang.png"); |
| | | } |
| | | } |
| | | |
| | | .laramnum { |
| | | &::before { |
| | | background-image: url("../../assets/img/left_top_hong.png"); |
| | | } |
| | | } |
| | | }, |
| | | updateChart(count) { |
| | | this.options.series[0].data[0].value = count; |
| | | this.options.title.subtext = count + 'ç§'; |
| | | this.options.title.subtextStyle.color = count > 0? '#4be1ff' : '#ff4d4f'; |
| | | }, |
| | | startAutoRefresh() { |
| | | this.stopAutoRefresh(); |
| | | this.timer = setInterval(() => { |
| | | this.fetchData(); |
| | | }, 3000); |
| | | }, |
| | | stopAutoRefresh() { |
| | | if (this.timer) clearInterval(this.timer); |
| | | }, |
| | | startParticleAnimation() { |
| | | this.stopParticleAnimation(); |
| | | this.particleTimer = setInterval(() => { |
| | | this.options.series[3].data = this.generateParticles(30); |
| | | this.options = {...this.options }; // 触åè§å¾æ´æ° |
| | | }, 2000); |
| | | }, |
| | | stopParticleAnimation() { |
| | | if (this.particleTimer) clearInterval(this.particleTimer); |
| | | }, |
| | | startGradientAnimation() { |
| | | this.stopGradientAnimation(); |
| | | this.gradientTimer = setInterval(() => { |
| | | const offset = Math.random(); |
| | | this.options.series.forEach(series => { |
| | | if (series.itemStyle.color.type === 'linear') { |
| | | series.itemStyle.color.colorStops.forEach(stop => { |
| | | stop.offset = (stop.offset + offset) % 1; |
| | | }); |
| | | } |
| | | }); |
| | | this.options = {...this.options }; // 触åè§å¾æ´æ° |
| | | }, 1000); |
| | | }, |
| | | stopGradientAnimation() { |
| | | if (this.gradientTimer) clearInterval(this.gradientTimer); |
| | | } |
| | | } |
| | | </style> |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .tech-chart-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | background: radial-gradient(circle at center, #021228 0%, #000810 100%); |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | box-shadow: 0 0 30px rgba(0, 100, 255, 0.2); |
| | | |
| | | &::before { |
| | | content: ''; |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: |
| | | radial-gradient(circle at 20% 30%, rgba(0, 150, 255, 0.1) 0%, transparent 50%), |
| | | radial-gradient(circle at 80% 70%, rgba(0, 200, 255, 0.1) 0%, transparent 50%); |
| | | z-index: 0; |
| | | animation: pulse 8s infinite alternate; |
| | | } |
| | | } |
| | | |
| | | @keyframes pulse { |
| | | 0% { |
| | | opacity: 0.3; |
| | | } |
| | | 100% { |
| | | opacity: 0.7; |
| | | } |
| | | } |
| | | |
| | | ::v-deep .echarts { |
| | | position: relative; |
| | | z-index: 1; |
| | | } |
| | | </style> |
| | |
| | | /// </summary> |
| | | public string GroupId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | | public int TaskLength { get; set; } |
| | | |
| | | public string AGVArea { get; set; } |
| | | |
| | | public int PalletType { get; set; } |
| | |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress); |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = ""); |
| | | |
| | | /// <summary> |
| | | /// åWMSç³è¯·ä»»å¡ |
| | |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <param name="roadway">å··éå·</param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); |
| | | //WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç»")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç»")] |
| | | public string GroupId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç©æé¿åº¦")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç©æé¿åº¦")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç©æé¿åº¦")] |
| | | public int TaskLength { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | |
| | | //è°ç¨AGVé¢è°åº¦æ¥å£ |
| | | AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO() |
| | | { |
| | | PositionCode = task.CurrentAddress, |
| | | NextTask = "60", |
| | | PositionCode = "8001", |
| | | NextTask = "90", |
| | | UseableLayers = "1", |
| | | CacheCount = "1", |
| | | Update = "0", |
| | | AgvTyp = "11", |
| | | AgvTyp = "10", |
| | | PreTaskQty = "1", |
| | | ReqCode = Guid.NewGuid().ToString().Replace("-", ""), |
| | | ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress) |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "") |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); |
| | | string responseStr = ""; |
| | | if (!string.IsNullOrEmpty(materielBoxCode)) |
| | | { |
| | | responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}"); |
| | | } |
| | | else |
| | | { |
| | | responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); |
| | | } |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="roadway"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | | WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | if (taskDTO != null) |
| | | { |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | } |
| | | } |
| | | //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) |
| | | //{ |
| | | // WebResponseContent content = new WebResponseContent(); |
| | | // try |
| | | // { |
| | | // string address = AppSettings.Get("WMSApiAddress"); |
| | | // if (string.IsNullOrEmpty(address)) |
| | | // { |
| | | // return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | // } |
| | | // string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); |
| | | // WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | // if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | // { |
| | | // WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | // if (taskDTO != null) |
| | | // { |
| | | // content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // content = WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | // return content; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | /// </summary> |
| | | public short CheckPos { get; set; } |
| | | } |
| | | public class R_ConveyorLineGMInfo : DeviceCommand |
| | | { |
| | | /// <summary> |
| | | /// ç®±å· |
| | | /// </summary> |
| | | /// <summary> |
| | | [DataLength(120)] |
| | | public string Boxcode { get; set; } |
| | | } |
| | | public class R_ConveyorLineFLInfo : DeviceCommand |
| | | { |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// ååºä¿¡å· |
| | | /// </summary> |
| | | ACK |
| | | ACK, |
| | | /// <summary> |
| | | /// æ¡ç |
| | | /// </summary> |
| | | Boxcode |
| | | } |
| | | |
| | | public enum R_ConveyorLineWorkType |
| | |
| | | { |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) |
| | | { |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) |
| | | string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); |
| | | |
| | | if (!string.IsNullOrEmpty(boxcode)) |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | string sc = device.Communicator.Read<string>("DB900.598.0"); |
| | | WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); |
| | | string boxEndCode = ""; |
| | | if (boxcode.LastIndexOf(",SC:") >= 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",SC") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",S") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | |
| | | //å
¥åºç³è¯·ä»»å¡ |
| | | WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); |
| | | if (content.Status) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | } |
| | | } |
| | | //if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) |
| | | //{ |
| | | // WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | // if (content.Status) |
| | | // { |
| | | // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | // } |
| | | //} |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #region << ç æ¬ 注 é >> |
| | | /*---------------------------------------------------------------- |
| | | * å½å空é´ï¼WIDESEAWCS_Tasks.StackerCraneJob |
| | | * å建è
ï¼è¡ç«¥åº |
| | | * å建æ¶é´ï¼2024/8/2 16:13:36 |
| | | * çæ¬ï¼V1.0.0 |
| | | * æè¿°ï¼ |
| | | * |
| | | * ---------------------------------------------------------------- |
| | | * ä¿®æ¹äººï¼ |
| | | * ä¿®æ¹æ¶é´ï¼ |
| | | * çæ¬ï¼V1.0.1 |
| | | * ä¿®æ¹è¯´æï¼ |
| | | * |
| | | *----------------------------------------------------------------*/ |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | |
| | | namespace WIDESEAWCS_Tasks.StackerCraneJob |
| | | { |
| | | public class StackerCraneTaskCommandGMPP : DeviceCommand |
| | | { |
| | | #region <Public Menber> |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public int TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä½ä¸ç±»å |
| | | /// </summary> |
| | | public short WorkType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public short TrayType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§è¡ |
| | | /// </summary> |
| | | public short StartRow { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§å |
| | | /// </summary> |
| | | public short StartColumn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§å± |
| | | /// </summary> |
| | | public short StartLayer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ è¡ |
| | | /// </summary> |
| | | public short EndRow { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ å |
| | | /// </summary> |
| | | public short EndColumn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ å± |
| | | /// </summary> |
| | | public short EndLayer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | [DataLength(30)] |
| | | public string Barcode { get; set; } |
| | | /// <summary> |
| | | /// ç©æé¿åº¦ |
| | | /// </summary> |
| | | public short TaskLength { get; set; } |
| | | #endregion <Public Menber> |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) |
| | | { |
| | | if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) |
| | | string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); |
| | | |
| | | if (!string.IsNullOrEmpty(boxcode)) |
| | | { |
| | | string sc = device.Communicator.Read<string>("DB900.508.0"); |
| | | WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); |
| | | string boxEndCode = ""; |
| | | if (boxcode.LastIndexOf(",SC:") >=0) |
| | | { |
| | | boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",SC") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",S") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | |
| | | //å
¥åºç³è¯·ä»»å¡ |
| | | WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); |
| | | if (content.Status) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress); |
| | |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | task.Dispatchertime = DateTime.Now; |
| | | task.ExceptionMessage = ""; |
| | | if (task.TaskLength<=0) |
| | | { |
| | | WriteInfo(commonStackerCrane.DeviceCode, $"ç©æé¿åº¦é误{task.TaskLength}"); |
| | | return Task.CompletedTask; |
| | | } |
| | | commonStackerCrane.Communicator.Write("DB105.58", (short)task.TaskLength); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); |
| | | commonStackerCrane.Communicator.Write("DB105.54", (short)1); |
| | | //å»¶æ¶1s |
| | |
| | | stackerCraneTaskCommand.Barcode = task.PalletCode; |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | stackerCraneTaskCommand.TrayType = (Int16)task.PalletType; |
| | | stackerCraneTaskCommand.TrayType = 0; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | string[] startCodes = task.CurrentAddress.Split("-"); |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | try |
| | | { |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineFLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | { |
| | | R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress); |
| | | bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); |
| | | if (conveyArrivaled) |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ConveyorLineFLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | Dt_Task newTask = _taskRepository.QueryFirst(x => x.TaskNum== conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode== item.StackerCraneCode && !string.IsNullOrEmpty(x.DeviceCode)); |
| | | if (newTask != null) |
| | | R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress); |
| | | bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode); |
| | | if (conveyArrivaled) |
| | | { |
| | | _taskService.UpdateTask(newTask, TaskStatusEnum.AGV_Execute); |
| | | Dt_Task newTask = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == item.StackerCraneCode && !string.IsNullOrEmpty(x.DeviceCode)); |
| | | if (newTask != null) |
| | | { |
| | | _taskService.UpdateTask(newTask, TaskStatusEnum.AGV_Execute); |
| | | } |
| | | WriteError(item.StationName, $"å
¥åºå°ä½ä¿¡å·ï¼æçå·{conveyorLineInfoRead.Barcode},ä»»å¡å·:{conveyorLineInfoRead.TaskNum}"); |
| | | } |
| | | WriteError(item.StationName, $"å
¥åºå°ä½ä¿¡å·ï¼æçå·{conveyorLineInfoRead.Barcode},ä»»å¡å·:{conveyorLineInfoRead.TaskNum}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(ConveyorLineJob_FL), ex.Message, ex); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | :selectable="detailSelectable" |
| | | ></vol-table> |
| | | </div> |
| | | |
| | | <!--æç»bodyèªå®ä¹ç»ä»¶--> |
| | | <component |
| | | :is="dynamicComponent.modelSpec" |
| | | ref="modelSpec" |
| | | @parentCall="parentCall" |
| | | ></component> |
| | | |
| | | |
| | | <!--æç»footerèªå®ä¹ç»ä»¶--> |
| | | <component |
| | | :is="dynamicComponent.modelFooter" |
| | |
| | | gridFooter: Empty, |
| | | modelHeader: Empty, |
| | | modelBody: Empty, |
| | | modelFooter: Empty |
| | | modelFooter: Empty, |
| | | modelSpec:Empty |
| | | }; |
| | | //åå¹¶æ©å±ç»ä»¶ |
| | | if (props.extend.components) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box |
| | | :lazy="true" |
| | | v-model="model" |
| | | title="éæ©ç©æè§æ ¼" |
| | | :width="280" |
| | | :padding="0" |
| | | > |
| | | <div> |
| | | <div> |
| | | <!-- æç´¢é
ç½® --> |
| | | <div class="search-form"> |
| | | <label>ç©æè§æ ¼ï¼</label> |
| | | <el-input style="width: 160px" v-model="MaterialCode"></el-input> |
| | | </div> |
| | | <el-table |
| | | ref="singleTable" |
| | | :data="filteredData" |
| | | style="width: 100%; height: 100%" |
| | | highlight-current-row |
| | | height="500px" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | > |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in tableColumns.filter((x) => !x.hidden)" |
| | | :key="index" |
| | | :prop="item.prop" |
| | | :label="item.title" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div><el-button type="primary" @click="onSelect">确认</el-button></div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | |
| | | /******注æï¼å¦æåºç°æç¤ºæ²¡ææéçé®é¢ï¼è§åå°å¼åææ¡£ä¸çãéååå°æéã*****/ |
| | | |
| | | //è¿é使ç¨çvue2è¯æ³ï¼ä¹å¯ä»¥åævue3è¯æ³ |
| | | export default { |
| | | components: { |
| | | "vol-box": VolBox, |
| | | }, |
| | | methods: {}, |
| | | data() { |
| | | return { |
| | | model: false, //å¼¹åºæ¡ |
| | | wareId: null, |
| | | materielSpec:null, |
| | | showDetialBox: false, |
| | | MaterialCode:null, |
| | | selection:null, |
| | | tableData: [], |
| | | filteredData: [], |
| | | tableColumns: [ |
| | | { |
| | | prop: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | MaterialCode(newVal) { |
| | | this.filterLocalData(newVal); |
| | | } |
| | | }, |
| | | methods: { |
| | | open(purchaseOrderNo, materielCode) { // éå½ååæ°ï¼è¯ä¹æ´æ¸
æ° |
| | | this.model = true; |
| | | this.purchaseOrderNo = purchaseOrderNo; // åå¨éè´åå· |
| | | this.materielCode = materielCode; // åå¨ç©æç¼å· |
| | | this.getData(); // è°ç¨è·åæ°æ®æ¹æ³ |
| | | }, |
| | | filterLocalData(code) { |
| | | if (code) { |
| | | this.filteredData = this.tableData.filter((item) => { |
| | | return item.materielSpec.includes(code); |
| | | }); |
| | | console.log(this.filteredData.length); |
| | | console.log(this.tableData.length); |
| | | } else { |
| | | this.filteredData = [...this.tableData]; // éç½®ä¸ºå®æ´æ°æ® |
| | | } |
| | | }, |
| | | handleSelectionChange(val,val2) { |
| | | this.selection = val; |
| | | this.selection1 = val2; |
| | | if (this.selection.length > 1) { |
| | | this.$message.error("ä»
鿩䏿¡æ°æ®"); |
| | | // æ¸
空éä¸çç¬¬ä¸æ¡æ°æ® |
| | | this.$refs.singleTable.clearSelection(); |
| | | } |
| | | if (this.selection1.length > 1) { |
| | | this.$message.error("ä»
鿩䏿¡æ°æ®"); |
| | | // æ¸
空éä¸çç¬¬ä¸æ¡æ°æ® |
| | | this.$refs.singleTable.clearSelection(); |
| | | } |
| | | console.log(this.selection); |
| | | }, |
| | | getData() { |
| | | const url = `/api/PurchaseOrderDetail/GetOrderMaterielSpec?` + |
| | | `purchaseOrderNo=${encodeURIComponent(this.purchaseOrderNo)}&` + |
| | | `materielCode=${encodeURIComponent(this.materielCode)}`; |
| | | |
| | | this.http.post(url, null, "æ¥è¯¢ä¸") |
| | | .then((x) => { |
| | | if (!x.status) { |
| | | return this.$error(x.message); |
| | | } |
| | | this.tableData = x.data.map((item) => ({ |
| | | materielSpec: item // å设æ¥å£è¿åçè§æ ¼ç´æ¥æ¯å符串 |
| | | })); |
| | | this.filteredData = [...this.tableData]; // éç½®è¿æ»¤æ°æ® |
| | | }) |
| | | .catch((error) => { |
| | | console.error("æ¥å£è¯·æ±å¤±è´¥:", error); |
| | | this.$message.error("è·åç©æè§æ ¼å¤±è´¥ï¼è¯·éè¯"); |
| | | }); |
| | | }, |
| | | onSelect() { |
| | | if (!this.selection) { |
| | | return this.$message.error("è¯·éæ©æ°æ®"); |
| | | } |
| | | this.$emit("parentCall", ($parent) => { |
| | | //å¦ï¼ååç¼è¾è¡¨åæ°æ® |
| | | $parent.editFormFields.materielSpec = this.selection[0].materielSpec; |
| | | this.model = false; |
| | | }); |
| | | this.MaterialCode = null; |
| | | this.tableData = []; |
| | | this.filteredData = []; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | | .search-form { |
| | | display: flex; |
| | | padding: 10px; |
| | | line-height: 34px; |
| | | button { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import modelHeader from './extend/materielcodeSelectView.vue' |
| | | import modelBody from './extend/purchaseOrderNoSelectView.vue' |
| | | import modelFooter from './extend/GetOrderQuantityView.vue' |
| | | import modelSpec from './extend/GetOrderMaterielSpec.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: modelHeader, |
| | | modelBody: modelBody, |
| | | modelFooter: modelFooter |
| | | modelFooter: modelFooter, |
| | | modelSpec: modelSpec |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | |
| | | } |
| | | }); |
| | | }); |
| | | this.editFormOptions.forEach((option) => { |
| | | option.forEach((item) => { |
| | | if (item.field == 'materielSpec') { |
| | | //åå§åå¼¹åºæ¡éæ©å¨é
ç½® |
| | | item.extra = { |
| | | icon: 'el-icon-zoom-out', //æ¾ç¤ºå¾æ |
| | | text: 'éæ©ç©æè§æ ¼', //æ¾ç¤ºææ¬ |
| | | style: 'color: #3a8ee6;font-size: 13px;cursor: pointer;', |
| | | //触åäºä»¶ |
| | | click: (item) => { |
| | | this.$refs.modelSpec.open(this.editFormFields.purchaseOrderNo,this.editFormFields.materielCode); |
| | | } |
| | | }; |
| | | } |
| | | }); |
| | | }); |
| | | // warehouseIdOption.onChange = (val, option) => { |
| | | // this.editFormFields.materielCode = ""; |
| | | // materielCodeOption.data = []; |
| | |
| | | // } |
| | | }); |
| | | |
| | | // 页é¢å è½½æ¶åå§åå·²é«äº®çè¡ |
| | | const initHighlightedRows = () => { |
| | | try { |
| | | const highlightedRowIds = localStorage.getItem('highlightedRowIds'); |
| | | if (highlightedRowIds) { |
| | | this.highlightedRowIds = JSON.parse(highlightedRowIds); |
| | | } else { |
| | | this.highlightedRowIds = []; |
| | | } |
| | | } catch (e) { |
| | | console.error('Failed to load highlighted rows from localStorage:', e); |
| | | this.highlightedRowIds = []; |
| | | } |
| | | }; |
| | | |
| | | // ä¿åé«äº®è¡IDå°æ¬å°åå¨ |
| | | const saveHighlightedRows = () => { |
| | | try { |
| | | localStorage.setItem('highlightedRowIds', JSON.stringify(this.highlightedRowIds)); |
| | | } catch (e) { |
| | | console.error('Failed to save highlighted rows to localStorage:', e); |
| | | } |
| | | }; |
| | | |
| | | // å¨ç»ä»¶åå§åæ¶è°ç¨ |
| | | initHighlightedRows(); |
| | | |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-printer">æå°</i>' |
| | | '<i style="cursor: pointer;color: #2d8cf0;" class="el-icon-printer">æå°</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | // æå¼è¯¦æ
|
| | | this.$refs.gridBody.open(row); |
| | | // è·åè¡çå¯ä¸æ è¯ï¼å设row.idæ¯å¯ä¸IDï¼ |
| | | const rowId = row.id; |
| | | // æ·»å å°å·²é«äº®å表 |
| | | if (!this.highlightedRowIds.includes(rowId)) { |
| | | this.highlightedRowIds.push(rowId); |
| | | // ä¿åå°æ¬å°åå¨ |
| | | saveHighlightedRows(); |
| | | // å·æ°è¡¨æ ¼ä»¥åºç¨æ ·å¼ |
| | | this.$refs.gridBody.refresh(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // é
ç½®cellStyle |
| | | this.columns.forEach((column) => { |
| | | // ä¿ååæçcellStyle彿° |
| | | const originalCellStyle = column.cellStyle; |
| | | |
| | | column.cellStyle = (row) => { |
| | | // å
åºç¨åæçæ ·å¼é»è¾ |
| | | let style = originalCellStyle ? originalCellStyle(row) : {}; |
| | | |
| | | // 妿è¡è¢«æ 记为é«äº®ï¼åæ·»å 绿è²èæ¯ |
| | | if (this.highlightedRowIds.includes(row.id)) { |
| | | style = { |
| | | ...style, |
| | | background: '#d4edda', |
| | | color: '#155724' |
| | | }; |
| | | } |
| | | |
| | | return style; |
| | | }; |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 160, |
| | | |
| | | }, |
| | | { |
| | | prop: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 160, |
| | | |
| | | }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | |
| | | "æ¥è¯¢ä¸" |
| | | ) |
| | | .then((x) => { |
| | | |
| | | var label=[ |
| | | { label: 'å·²åé
', value: 0 }, |
| | | { label: 'åºåºä¸', value: 1 }, |
| | |
| | | <p><strong>è´§ä½å·:</strong>{{ currentLocation.locationCode }}</p> |
| | | <p> |
| | | <strong>è´§ä½æåå±:</strong> {{ currentLocation.row }}æ{{ |
| | | currentLocation.layer |
| | | }}å{{ currentLocation.index }}å± |
| | | currentLocation.index |
| | | }}å{{ currentLocation.layer }}å± |
| | | </p> |
| | | <p><strong>ç¶æ:</strong> {{ getStatusText(currentLocation) }}</p> |
| | | <p> |
| | |
| | | ], |
| | | [ |
| | | { |
| | | title: "ç©æè§æ ¼", |
| | | field: "materielSpec", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | field: "lotNo", |
| | | required: true, |
| | |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 100, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | field: "pickCode", |
| | | title: "ç³è¯·åæåå·", |
| | | type: "select", |
| | | width: 160, |
| | | width: 180, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | |
| | | field: "mCode", |
| | | title: "ç©æç¼ç ", |
| | | type: "string", |
| | | width: 90, |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "qty", |
| | | title: "å¯éæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "returnQty", |
| | | title: "éåæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "overReturnQty", |
| | | title: "å·²éåæ°é", |
| | | type: "float", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | |
| | | field: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "string", |
| | | width: 90, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "taskNum", |
| | | title: "ä»»å¡å·", |
| | | type: "string", |
| | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "åºå主é®", |
| | | readonly:true, |
| | | field: "stockId", |
| | | type: "string", |
| | | }, |
| | | |
| | | { |
| | | title: "ç©æç¼å·", |
| | | required: true, |
| | | field: "materielCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åæ®ç¼å·", |
| | | title: "ç©æåç§°", |
| | | required: true, |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | title: "åæ®ç¼å·", |
| | | readonly: true, |
| | | field: "orderNo", |
| | | type: "string", |
| | | }, |
| | | |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | field: "batchNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåæ°é", |
| | | required: true, |
| | | field: "stockQuantity", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "çäº§æ¥æ", |
| | | required: true, |
| | | field: "productionDate", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "æææ", |
| | | required: true, |
| | | field: "effectiveDate", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åºåå·", |
| | | required: true, |
| | | readonly: true, |
| | | field: "serialNumber", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåºæ°é", |
| | | required: true, |
| | | field: "outboundQuantity", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åºåæç»ç¶æ", |
| | | readonly: true, |
| | | field: "status", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "å
¥åºåæç»è¡å·", |
| | | readonly: true, |
| | | field: "inboundOrderRowNo", |
| | | type: "string", |
| | | }, |
| | | ], |
| | |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | { |
| | | field: "productionDate", |
| | | title: "çäº§æ¥æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | |
| | | }, |
| | | { |
| | | field: "effectiveDate", |
| | | title: "æææ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "ç©ææ°é", |
| | | type: "float", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "ç©ææ°é", |
| | | type: "float", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | |
| | | public string GroupId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | | public int TaskLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string AGVArea { get; set; } |
| | |
| | | //WebResponseContent FeedbackInboundOrder(int id); |
| | | |
| | | WebResponseContent MaterielGroup(SaveModel saveModel); |
| | | |
| | | WebResponseContent MaterielPPorGM(string materielBoxCode=""); |
| | | /// <summary> |
| | | /// å
¥åºå®æä¸æ¥ |
| | | /// </summary> |
| | |
| | | WebResponseContent GetPurchaseOrderNos(string materielCode); |
| | | |
| | | WebResponseContent GetOrderQuantity(string purchaseOrderNo); |
| | | |
| | | WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode); |
| | | } |
| | | } |
| | |
| | | /// <param name="roadwayNo"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode); |
| | | WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = ""); |
| | | |
| | | /// <summary> |
| | | /// ä»
ç³è¯·ä»»å¡ï¼è®©WCSæ ¹æ®è·¯ç±ç¡®å®ä¸ä¸å°å |
| | |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | |
| | | notGroupDetail.ReceiptQuantity += model.Quantity; |
| | | if (notGroupDetail.ReceiptQuantity>notGroupDetail.OrderQuantity) |
| | | decimal decimalReceiptQuantity = Convert.ToDecimal(notGroupDetail.ReceiptQuantity); |
| | | decimal decimalModelQuantity = Convert.ToDecimal(model.Quantity); |
| | | decimal decimalOrderQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity); |
| | | decimalReceiptQuantity += decimalModelQuantity; |
| | | // æ£æ¥æ¯å¦è¶
åºè®¢åæ°é |
| | | if (decimalReceiptQuantity > decimalOrderQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{notGroupDetail.ReceiptQuantity - notGroupDetail.OrderQuantity}"); |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{decimalReceiptQuantity - decimalOrderQuantity}"); |
| | | } |
| | | // 转åfloatç±»ååå¨ï¼ä½æ¯è¾å计ç®é½ä½¿ç¨decimal宿 |
| | | notGroupDetail.ReceiptQuantity = Convert.ToSingle(decimalReceiptQuantity); |
| | | if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | public WebResponseContent MaterielPPorGM(string materielBoxCode = "") |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1); |
| | | MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum); |
| | | //éªè¯å¤ææ¶é´æ ¼å¼ |
| | | WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model }); |
| | | if (!IsValidContent.Status) |
| | | { |
| | | return content.Error(IsValidContent.Message); |
| | | } |
| | | string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); |
| | | //è·åå
¥åºåæç» |
| | | Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | return InOtherGMOrPP(model, result); |
| | | } |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().First(x => x.Id == inboundOrderDetail.OrderId); |
| | | |
| | | if (inboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å
¥åºåä¿¡æ¯"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId); |
| | | //é¤éè´å
¥åºå以å¤å
¶ä»å
¥åºåç»çæ°æ®å¤ç |
| | | if (inboundOrder.OrderType != InOrderTypeEnum.Purchase.ObjToInt()) |
| | | { |
| | | return OtherInGroup(inboundOrder, model.LotNo, 0, warehouse, new List<MatSerNumAnalysisModel>() { model }); |
| | | } |
| | | Dt_ReceiveOrder receiveOrder = _inboundRepository.ReceiveOrderRepository.Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderNo == inboundOrder.UpperOrderNo).Includes(x => x.Details).First(); |
| | | if (receiveOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçæ¶è´§å"); |
| | | } |
| | | if (receiveOrder.Details == null || receiveOrder.Details.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçæ¶è´§åæç»"); |
| | | } |
| | | |
| | | List<string> purchaseOrderNos = receiveOrder.Details.Select(x => x.PurchaseOrderNo).ToList(); |
| | | |
| | | string materielCode = model?.MaterielCode ?? ""; |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æçä¿¡æ¯"); |
| | | } |
| | | |
| | | float beforeQuantity = 0; |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | stockInfo = new Dt_StockInfo() |
| | | { |
| | | PalletCode = model.LotNo, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]), |
| | | StockLength = result.Split("*")[0].ObjToInt(), |
| | | Details = new List<Dt_StockInfoDetail>() |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå·éå¤"); |
| | | } |
| | | } |
| | | if (stockInfo.PalletType==-1) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçç±»åä¸åå¨"); |
| | | } |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | if (purchaseOrderNos.FirstOrDefault(x => x == model.PurchaseOrderNo) == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªå¨æ¶è´§æç»ä¸æ¾å°è¯¥éè´å"); |
| | | } |
| | | |
| | | if (inboundOrderDetail.OrderDetailStatus > OrderDetailStatusEnum.Inbounding.ObjToInt() || inboundOrderDetail.OrderQuantity == inboundOrderDetail.ReceiptQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥ç©æå¨è¯¥å
¥åºåä¸å·²å
¨é¨ç»ç宿"); |
| | | } |
| | | Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() |
| | | { |
| | | BatchNo = model.LotNo, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | OrderNo = inboundOrder.InboundOrderNo, |
| | | SerialNumber = model.SerialNumber, |
| | | StockQuantity = model.Quantity, |
| | | OutboundQuantity = 0, |
| | | Unit = materielInfo.MaterielUnit, |
| | | Status = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | ProductionDate = model.ProductionDate, |
| | | EffectiveDate = model.EffectiveDate, |
| | | InboundOrderRowNo = inboundOrderDetail.RowNo, |
| | | }; |
| | | |
| | | stockInfo.Details.Add(stockInfoDetail); |
| | | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | |
| | | inboundOrderDetail.ReceiptQuantity += model.Quantity; |
| | | if (inboundOrderDetail.ReceiptQuantity > inboundOrderDetail.OrderQuantity) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{inboundOrderDetail.ReceiptQuantity - inboundOrderDetail.OrderQuantity}"); |
| | | } |
| | | if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); |
| | | } |
| | | float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | if (inboundOrder.OrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.OrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | } |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); |
| | | content.OK(data: stockInfo); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | public WebResponseContent InOtherGMOrPP(MatSerNumAnalysisModel model,string request = "") |
| | | { |
| | | string materielCode = model?.MaterielCode ?? ""; |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æçä¿¡æ¯"); |
| | | } |
| | | float beforeQuantity = 0; |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == materielInfo.WarehouseId); |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | stockInfo = new Dt_StockInfo() |
| | | { |
| | | PalletCode = model.LotNo, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]), |
| | | StockLength = request.Split("*")[0].ObjToInt(), |
| | | Details = new List<Dt_StockInfoDetail>() |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå·éå¤"); |
| | | } |
| | | } |
| | | if (stockInfo.PalletType == -1) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçç±»åä¸åå¨"); |
| | | } |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() |
| | | { |
| | | BatchNo = model.LotNo, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | OrderNo = "", |
| | | SerialNumber = model.SerialNumber, |
| | | StockQuantity = model.Quantity, |
| | | OutboundQuantity = 0, |
| | | Unit = materielInfo.MaterielUnit, |
| | | Status = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | ProductionDate = model.ProductionDate, |
| | | EffectiveDate = model.EffectiveDate, |
| | | InboundOrderRowNo = 0, |
| | | }; |
| | | |
| | | stockInfo.Details.Add(stockInfoDetail); |
| | | |
| | | stockInfoDetails.Add(stockInfoDetail); |
| | | float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); |
| | | return WebResponseContent.Instance.OK(data: stockInfo); |
| | | } |
| | | public int GetPalletTypeGMOrPP(Dt_Warehouse warehouse, string boxWidth) |
| | | { |
| | | if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString()) |
| | | { |
| | | |
| | | if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515) |
| | | { |
| | | return 15; |
| | | } |
| | | else if (boxWidth.ObjToInt() > 690 && boxWidth.ObjToInt() <= 1400) |
| | | { |
| | | return 16; |
| | | } |
| | | |
| | | } |
| | | else if (warehouse.WarehouseCode == WarehouseEnum.HA58.ToString()) |
| | | { |
| | | Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.WarehouseId == warehouse.WarehouseId); |
| | | return palletTypeInfo.PalletType; |
| | | } |
| | | return -1; |
| | | } |
| | | public WebResponseContent OtherInGroup(Dt_InboundOrder inboundOrder,string? palletCode,int Initiallife,Dt_Warehouse warehouse,List<MatSerNumAnalysisModel> models) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_PurchaseOrder> purchaseOrders = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Where(x => x.PurchaseOrderNo == purchaseOrderNo).ToList(); |
| | | List<int> purchaseOrderIds = purchaseOrders.Select(x => x.Id).ToList(); |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.Db.Queryable<Dt_PurchaseOrderDetail>() |
| | | .Where(x => purchaseOrderIds.Contains(x.PurchaseOrderId)&& x.MaterielCode == materielCode).ToList(); |
| | | List<string> materielSpec = purchaseOrderDetails.Select(x => x.MaterielSpec).ToList(); |
| | | return WebResponseContent.Instance.OK(data: materielSpec); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä¾åºåç¼ç ")] |
| | | public string SupplierCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç©æè§æ ¼")] |
| | | public string MaterielSpec { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¶æ")] |
| | | public int Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çäº§æ¥æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "çäº§æ¥æ")] |
| | | public string ProductionDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æææ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æææ")] |
| | | public string EffectiveDate { get; set; } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// åºåç©æé¿åº¦GM/PP |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç©æé¿åº¦")] |
| | | public int StockLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåæç» |
| | |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç»")] |
| | | public string GroupId { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç©æé¿åº¦")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç©æé¿åº¦")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç©æé¿åº¦")] |
| | | public int TaskLength { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "夿³¨")] |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç©æç¼å·")] |
| | | [ExporterHeader(DisplayName = "ç©æç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | /// <summary> |
| | | /// ç©ææ°é |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç©ææ°é")] |
| | | [ExporterHeader(DisplayName = "ç©ææ°é")] |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "ç©ææ°é")] |
| | | public float Quantity { get; set; } |
| | | } |
| | | } |
| | |
| | | OriginalQuantity = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity), |
| | | Status = taskNum == null ? OutLockStockStatusEnum.å·²åé
.ObjToInt() : OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = item.Id, |
| | | TaskNum = taskNum |
| | | TaskNum = taskNum, |
| | | ProductionDate = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = item.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | TaskNum = taskNum, |
| | | OrderQuantity = outboundOrderDetail.OrderQuantity, |
| | | Unit = outboundOrderDetail.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesOutboundOrder.OrderQuantity, |
| | | Unit = mesOutboundOrder.Unit |
| | | Unit = mesOutboundOrder.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == mesOutboundOrder.MaterialCode).FirstOrDefault()?.EffectiveDate |
| | | |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = item.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesPPCutOutboundOrderDetail.OrderQuantity, |
| | | Unit = mesPPCutOutboundOrderDetail.Unit |
| | | Unit = mesPPCutOutboundOrderDetail.Unit, |
| | | ProductionDate = item.Details.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = item.Details.Where(x => x.MaterielCode == mesPPCutOutboundOrderDetail.MaterielCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = mesPPOutboundOrder.OrderQuantity, |
| | | Unit = mesPPOutboundOrder.Unit |
| | | Unit = mesPPOutboundOrder.Unit, |
| | | ProductionDate = outStock.Details.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).FirstOrDefault()?.ProductionDate, |
| | | EffectiveDate = outStock.Details.Where(x => x.MaterielCode == mesPPOutboundOrder.MaterialCode).FirstOrDefault()?.EffectiveDate |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = stockInfo.Id, |
| | | TaskNum = 0, |
| | | OrderQuantity = outboundOrderDetail.OrderQuantity, |
| | | Unit = outboundOrderDetail.Unit |
| | | Unit = outboundOrderDetail.Unit, |
| | | ProductionDate = stockInfoDetail.ProductionDate, |
| | | EffectiveDate = stockInfoDetail.EffectiveDate |
| | | }; |
| | | |
| | | #region ä¿®æ¹åºåºå |
| | |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | TaskType = TaskTypeEnum.InProduct.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = proStockInfo.PalletType |
| | | PalletType = proStockInfo.PalletType, |
| | | MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty) |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | LocationStatusEnum lastStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | _unitOfWorkManage.BeginTran(); |
| | |
| | | TaskType = TaskTypeEnum.OutAllocate.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.AddData(newTask); |
| | |
| | | }); |
| | | //æ´æ°ä»»å¡ç¶æ |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | |
| | | } |
| | | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | |
| | | { |
| | | x.Status = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | }); |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | | stockInfo.StockLength = 0; |
| | | } |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); |
| | | } |
| | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, (LocationStatusEnum)beforeStatus, LocationStatusEnum.Free, LocationChangeType.OutboundCompleted, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.APIEnum; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OtherEnum; |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åè°wcsæå¨å®æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedBackWCSTaskCompleted(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_ApiInfo? url = _apiInfoRepository.QueryData(x => x.ApiCode == APIEnum.FeedBackWCSTaskCompleted.ToString()).First(); |
| | | string? apiAddress = url.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"{taskNum},æªæ¾å°WCSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | } |
| | | string responseStr = HttpHelper.Get(apiAddress + "?taskNum=" + taskNum); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡å®æè¿åå¼"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode = stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity = (float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | //è·åæ¯å¦åå¨å
¥åºå |
| | | Dt_InboundOrder? inboundOrder = null; |
| | |
| | | /// <param name="roadwayNo"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); |
| | | } |
| | | if (!string.IsNullOrEmpty(materielBoxCode)) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | WebResponseContent responseGroup = _inboundOrderService.MaterielPPorGM(materielBoxCode); |
| | | if (!responseGroup.Status) |
| | | { |
| | | return WebResponseContent.Instance.Error($"{responseGroup.Message}"); |
| | | } |
| | | Dt_StockInfo stockInfoPPorGM = responseGroup.Data as Dt_StockInfo ?? null; |
| | | if (stockInfoPPorGM==null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç»çæ°æ®è½¬æ¢å¤±è´¥"); |
| | | } |
| | | Dt_LocationInfo? locationInfoPPorGM = _basicService.LocationInfoService.AssignLocation(roadwayNo, stockInfoPPorGM.PalletType, stockInfoPPorGM.WarehouseId); |
| | | if (locationInfoPPorGM == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½åé
失败,æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | Dt_Task newTaskPPorGM = new Dt_Task() |
| | | { |
| | | CurrentAddress = stationCode, |
| | | Grade = 0, |
| | | NextAddress = locationInfoPPorGM.LocationCode, |
| | | PalletCode = stockInfoPPorGM.PalletCode, |
| | | Roadway = roadwayNo, |
| | | SourceAddress = stationCode, |
| | | TargetAddress = locationInfoPPorGM.LocationCode, |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfoPPorGM.WarehouseId, |
| | | PalletType = stockInfoPPorGM.PalletType, |
| | | TaskLength= stockInfoPPorGM.StockLength |
| | | }; |
| | | |
| | | //è·åæ¯å¦åå¨å
¥åºå |
| | | Dt_InboundOrder? inboundOrderPPorGM = null; |
| | | if (stockInfoPPorGM != null && stockInfoPPorGM.Details.Count > 0) |
| | | { |
| | | string? orderNo = stockInfoPPorGM.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | | inboundOrderPPorGM = _inboundOrderService.Repository.QueryFirst(x => x.InboundOrderNo == orderNo && x.OrderStatus < InOrderStatusEnum.å
¥åºå®æ.ObjToInt()); |
| | | } |
| | | |
| | | if (inboundOrderPPorGM != null) |
| | | { |
| | | if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Allocat.ObjToInt()) |
| | | { |
| | | newTaskPPorGM.TaskType = TaskTypeEnum.InAllocate.ObjToInt(); |
| | | } |
| | | else if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Return.ObjToInt()) |
| | | { |
| | | newTaskPPorGM.TaskType = TaskTypeEnum.ProductionReturn.ObjToInt(); |
| | | } |
| | | } |
| | | stockInfoPPorGM.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | LocationStatusEnum lastStatusPPorGM = (LocationStatusEnum)locationInfoPPorGM.LocationStatus; |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoPPorGM, lastStatusPPorGM, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoPPorGM, newTaskPPorGM.PalletType, LocationStatusEnum.Lock, newTaskPPorGM.WarehouseId); |
| | | int taskIdPPorGM = BaseDal.AddData(newTaskPPorGM); |
| | | newTaskPPorGM.TaskId = taskIdPPorGM; |
| | | _stockRepository.StockInfoRepository.Db.InsertNav(stockInfoPPorGM).Include(x => x.Details).ExecuteCommand(); |
| | | _unitOfWorkManage.CommitTran(); |
| | | WMSTaskDTO wMSTaskDTOPPorGM = _mapper.Map<WMSTaskDTO>(newTaskPPorGM); |
| | | |
| | | PushTasksToWCS(new List<Dt_Task> { newTaskPPorGM }); |
| | | return WebResponseContent.Instance.OK(data: wMSTaskDTOPPorGM); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | }; |
| | | |
| | | //è·åæ¯å¦åå¨å
¥åºå |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | }; |
| | | |
| | | |
| | |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | PalletType = stockInfo.PalletType, |
| | | }; |
| | | |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | |
| | | TaskType = TaskTypeEnum.InProductBack.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = warePoint.WarehouseId, |
| | | PalletType = proStockInfo.PalletType |
| | | PalletType = proStockInfo.PalletType, |
| | | MaterielCode = proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)proStockInfo.proStockInfoDetails.Where(x => x.ProStockId == proStockInfo.Id).Sum(x => x.StockPcsQty) |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | GroupId= groupId |
| | | GroupId= groupId, |
| | | MaterielCode = stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).FirstOrDefault()?.ProductCode, |
| | | Quantity = (float)stockInfo.proStockInfoDetails.Where(x => x.ProStockId == stockInfo.Id).Sum(x=> x.StockPcsQty) |
| | | }; |
| | | tasks.Add(task); |
| | | } |
| | |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | MaterielCode = stockInfo.Details.Where(x =>x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode, |
| | | Quantity =(float)stockInfo.Details.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.StockQuantity, |
| | | }; |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | | task.TaskLength = stockInfo.StockLength; |
| | | } |
| | | tasks.Add(task); |
| | | } |
| | | } |
| | |
| | | StockId = x.Id, |
| | | TaskNum = 0, |
| | | OrderQuantity = OrderDetail.OrderQuantity, |
| | | Unit = OrderDetail.Unit |
| | | Unit = OrderDetail.Unit, |
| | | ProductionDate = v.ProductionDate, |
| | | EffectiveDate = v.EffectiveDate |
| | | }; |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(task.TaskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | |
| | | { |
| | | return Service.GetOrderQuantity(purchaseOrderNo); |
| | | } |
| | | //è·åç©æè§æ ¼ |
| | | [HttpPost, HttpGet, Route("GetOrderMaterielSpec"), AllowAnonymous] |
| | | public WebResponseContent GetOrderMaterielSpec(string purchaseOrderNo, string materielCode) |
| | | { |
| | | return Service.GetOrderMaterielSpec(purchaseOrderNo, materielCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("DeviceRequestInboundTask"), AllowAnonymous] |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") |
| | | { |
| | | return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode); |
| | | return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode, materielBoxCode); |
| | | } |
| | | |
| | | /// <summary> |