| | |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "@popperjs/core": { |
| | | "version": "npm:@sxzz/popperjs-es@2.11.7", |
| | | "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", |
| | | "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" |
| | | }, |
| | | "@soda/friendly-errors-webpack-plugin": { |
| | | "version": "1.8.0", |
| | | "resolved": "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.8.0.tgz?cache=0&sync_timestamp=1607927406873&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40soda%2Ffriendly-errors-webpack-plugin%2Fdownload%2F%40soda%2Ffriendly-errors-webpack-plugin-1.8.0.tgz", |
| | |
| | | "webpack-chain": "^6.4.0", |
| | | "webpack-dev-server": "^3.11.0", |
| | | "webpack-merge": "^4.2.2" |
| | | }, |
| | | "dependencies": { |
| | | "ansi-styles": { |
| | | "version": "4.3.0", |
| | | "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", |
| | | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-convert": "^2.0.1" |
| | | } |
| | | }, |
| | | "chalk": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", |
| | | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "ansi-styles": "^4.1.0", |
| | | "supports-color": "^7.1.0" |
| | | } |
| | | }, |
| | | "color-convert": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", |
| | | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-name": "~1.1.4" |
| | | } |
| | | }, |
| | | "color-name": { |
| | | "version": "1.1.4", |
| | | "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", |
| | | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "loader-utils": { |
| | | "version": "2.0.4", |
| | | "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", |
| | | "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "big.js": "^5.2.2", |
| | | "emojis-list": "^3.0.0", |
| | | "json5": "^2.1.2" |
| | | } |
| | | }, |
| | | "supports-color": { |
| | | "version": "7.2.0", |
| | | "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", |
| | | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "has-flag": "^4.0.0" |
| | | } |
| | | }, |
| | | "vue-loader-v16": { |
| | | "version": "npm:vue-loader@16.8.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", |
| | | "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "chalk": "^4.1.0", |
| | | "hash-sum": "^2.0.0", |
| | | "loader-utils": "^2.0.0" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "@vue/cli-shared-utils": { |
| | |
| | | "lodash-unified": "^1.0.2", |
| | | "memoize-one": "^6.0.0", |
| | | "normalize-wheel-es": "^1.2.0" |
| | | }, |
| | | "dependencies": { |
| | | "@popperjs/core": { |
| | | "version": "npm:@sxzz/popperjs-es@2.11.7", |
| | | "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", |
| | | "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" |
| | | } |
| | | } |
| | | }, |
| | | "element-ui": { |
| | |
| | | "resolved": "https://registry.npm.taobao.org/hash-sum/download/hash-sum-1.0.2.tgz", |
| | | "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=", |
| | | "dev": true |
| | | } |
| | | } |
| | | }, |
| | | "vue-loader-v16": { |
| | | "version": "npm:vue-loader@16.8.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", |
| | | "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "chalk": "^4.1.0", |
| | | "hash-sum": "^2.0.0", |
| | | "loader-utils": "^2.0.0" |
| | | }, |
| | | "dependencies": { |
| | | "ansi-styles": { |
| | | "version": "4.3.0", |
| | | "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", |
| | | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-convert": "^2.0.1" |
| | | } |
| | | }, |
| | | "chalk": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", |
| | | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "ansi-styles": "^4.1.0", |
| | | "supports-color": "^7.1.0" |
| | | } |
| | | }, |
| | | "color-convert": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", |
| | | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-name": "~1.1.4" |
| | | } |
| | | }, |
| | | "color-name": { |
| | | "version": "1.1.4", |
| | | "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", |
| | | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "loader-utils": { |
| | | "version": "2.0.4", |
| | | "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", |
| | | "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "big.js": "^5.2.2", |
| | | "emojis-list": "^3.0.0", |
| | | "json5": "^2.1.2" |
| | | } |
| | | }, |
| | | "supports-color": { |
| | | "version": "7.2.0", |
| | | "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", |
| | | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "has-flag": "^4.0.0" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | name: 'takeStockOrderDetail', |
| | | component: () => import('@/views/inbound/takeStockOrderDetail.vue') |
| | | }, { |
| | | path: '/dashboard', |
| | | name: 'dashboard', |
| | | path: '/wms-dashboard', |
| | | name: 'wms-dashboard', |
| | | component: () => import('@/views/charts/wms-dashboard.vue') |
| | | } |
| | | ] |
| | |
| | | <template> |
| | | <div class="wms-dashboard"> |
| | | <!-- 顶鍿 颿 --> |
| | | <div class="header"> |
| | | <!-- <div class="header"> |
| | | <h1>WMSä»å¨å¯è§åå¾è¡¨çæ¿</h1> |
| | | <div class="header-right"> |
| | | <span>2025-12-24 16:11:44</span> |
| | |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="refreshCharts">å·æ°</el-button> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <!-- ç»è®¡å¡çåºå --> |
| | | <!-- ç»è®¡å¡çåºå - ç»å®ååºå¼æ°æ® --> |
| | | <el-row :gutter="20" class="stats-card-row"> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">æ»åºåï¼ä»¶ï¼</div> |
| | | <div class="card-value">269,225</div> |
| | | <div class="card-change"><el-tag type="success">â 2.1% è¾æ¨æ¥</el-tag></div> |
| | | <div class="card-value">{{ formatNumber(bigscreendata.totalStockQuantity) }}</div> |
| | | <!-- <div class="card-change"><el-tag type="success">â 2.1% è¾æ¨æ¥</el-tag></div> --> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">å¾
åºåºè®¢å</div> |
| | | <div class="card-value">425</div> |
| | | <div class="card-change"><el-tag type="warning">â 5.3% è¾1å°æ¶å</el-tag></div> |
| | | <div class="card-value">{{ bigscreendata.unOutBoundOrderCount }}</div> |
| | | <!-- <div class="card-change"><el-tag type="warning">â 5.3% è¾1å°æ¶å</el-tag></div> --> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">仿¥ä½ä¸å®æç</div> |
| | | <div class="card-value">93.9%</div> |
| | | <div class="card-change"><el-tag type="success">â 1.8% è¾æ¨æ¥</el-tag></div> |
| | | <div class="card-value">{{ bigscreendata.dailyCompletionRate ? `${bigscreendata.dailyCompletionRate}%` : '0%' }}</div> |
| | | <!-- <div class="card-change"><el-tag type="success">â 1.8% è¾æ¨æ¥</el-tag></div> --> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">æªå¤çå¼å¸¸</div> |
| | | <div class="card-value">7</div> |
| | | <div class="card-change"><el-tag type="danger">â 1 è¾30åéå</el-tag></div> |
| | | <div class="card-value">{{ bigscreendata.unhandledExceptionCount || 0 }}</div> |
| | | <!-- <div class="card-change"><el-tag type="danger">â 1 è¾30åéå</el-tag></div> --> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-row :gutter="20" class="chart-row"> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">åºååºä½åå¸ï¼å¾ååå æ¯ï¼<el-button type="text" class="view-btn">忢è§å¾</el-button></div> |
| | | <div class="chart-title">åºååºä½åå¸ï¼å¾ååå æ¯ï¼</div> |
| | | <div ref="inventoryPieRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">è¿7æ¥åºå
¥åºè¶å¿ï¼å¾ååèµ°å¿ï¼ |
| | | <el-button-group class="btn-group"> |
| | | <!-- <el-button-group class="btn-group"> |
| | | <el-button type="primary" size="small">å
¨é¨</el-button> |
| | | <el-button type="default" size="small">å
¥åº</el-button> |
| | | <el-button type="default" size="small">åºåº</el-button> |
| | | </el-button-group> |
| | | </el-button-group> --> |
| | | </div> |
| | | <div ref="stockTrendRef" class="chart-container"></div> |
| | | </el-card> |
| | |
| | | |
| | | <!-- å¾è¡¨åºåï¼ç¬¬äºè¡ï¼ --> |
| | | <el-row :gutter="20" class="chart-row"> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">åºä½å©ç¨ç</div> |
| | | <div ref="locationRateRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">ä½ä¸ç±»ååå¸<el-button type="text" class="view-btn">æ¥ç详æ
</el-button></div> |
| | | <div ref="operationRadarRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">å¼å¸¸ç±»åç»è®¡è¶å¿<el-button type="text" class="view-btn">çé</el-button></div> |
| | | <div ref="exceptionTrendRef" class="chart-container"></div> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- è¡¨æ ¼åºå --> |
| | | <el-row :gutter="20" class="table-row"> |
| | | <el-col :span="12"> |
| | | <el-card class="table-card"> |
| | | <div class="table-title">订åå¤çè¿åº¦<el-select v-model="orderType" placeholder="éè´§å
¥åº" |
| | | style="width: 100px; margin-left: 10px;"> |
| | | <el-option label="éè´§å
¥åº" value="return"></el-option> |
| | | <el-option label="æ®éåºåº" value="normal"></el-option> |
| | | </el-select></div> |
| | | <el-table :data="orderList" border style="width: 100%;"> |
| | | <el-table-column prop="orderNo" label="订åå·" /> |
| | | <el-table-column prop="type" label="ç±»å" /> |
| | | <el-table-column prop="priority" label="ä¼å
级"> |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.priority === 'ç´§æ¥' ? 'danger' : scope.row.priority === 'å æ¥' ? 'warning' : 'success'"> |
| | | {{ scope.row.priority }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="progress" label="è¿åº¦"> |
| | | <template #default="scope"> |
| | | <el-progress :percentage="scope.row.progress" :color="scope.row.progressColor" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="table-pagination"> |
| | | <el-button type="text">å è½½æ´å¤è®¢å</el-button> |
| | | <el-pagination layout="prev, pager, next, jumper" :current-page="1" :total="50" /> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- è¡¨æ ¼åºå - ç»å®å端ä½ä¸æ°æ® --> |
| | | <el-row :gutter="20" class="table-row" width="100%"> |
| | | <el-col :span="24"> |
| | | <el-card class="table-card"> |
| | | <div class="table-title">宿¶ä½ä¸çæ§ |
| | | <el-button-group class="btn-group"> |
| | |
| | | <el-button type="default" size="small">çç¹</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | <el-table :data="operationList" border style="width: 100%;"> |
| | | <el-table :data="bigscreendata.taskList.length ? bigscreendata.taskList : operationList" border style="width: 100%;"> |
| | | <el-table-column prop="opNo" label="ä½ä¸åå·" /> |
| | | <el-table-column prop="opType" label="ä½ä¸ç±»å" /> |
| | | <el-table-column prop="operator" label="æä½äººå" /> |
| | |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, nextTick } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import http from "@/api/http.js"; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const month = ref('month'); |
| | | const orderType = ref('return'); |
| | | |
| | | // æ¨¡ææ°æ® |
| | | const orderList = ref([ |
| | | { orderNo: 'OD20251224001', type: 'æ®éåºåº', priority: 'ç´§æ¥', progress: 60, progressColor: '#ff4d4f' }, |
| | | { orderNo: 'OD20251224002', type: 'éè´§å
¥åº', priority: 'æ®é', progress: 80, progressColor: '#1890ff' }, |
| | | { orderNo: 'OD20251224003', type: 'è°æ¨è®¢å', priority: 'å æ¥', progress: 40, progressColor: '#faad14' }, |
| | | { orderNo: 'OD20251224004', type: 'æ®éåºåº', priority: '常è§', progress: 100, progressColor: '#52c41a' } |
| | | ]); |
| | | // å端è¿åæ°æ®ï¼ååºå¼ï¼ |
| | | const bigscreendata = ref({ |
| | | totalStockQuantity: 0, |
| | | unOutBoundOrderCount: 0, |
| | | dailyCompletionRate: 0, |
| | | unhandledExceptionCount: 0, |
| | | locationUtilizationRate: 0, |
| | | dailyInOutBoundList: [], |
| | | taskList: [], |
| | | inventoryLocationDist: [], // åºååºä½å叿°æ® |
| | | exceptionTypeTrend: [] // å¼å¸¸ç±»åè¶å¿æ°æ® |
| | | }); |
| | | |
| | | // æ°åæ ¼å¼åï¼ååä½åéï¼ |
| | | const formatNumber = (num) => { |
| | | if (!num) return '0'; |
| | | return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); |
| | | }; |
| | | |
| | | // è·ååç«¯å¤§å±æ°æ® |
| | | const fetchBigGreenData = async () => { |
| | | try { |
| | | // ä¿®æ£ï¼ä»£çå·²é
ç½®ï¼ç§»é¤å¤ä½ç/apiåç¼ |
| | | const res = await http.get('/api/BigScreen/GetBigGreenData'); |
| | | console.log('大屿°æ®', res); |
| | | // èµå¼ååºå¼æ°æ®ï¼å
¼å®¹å端ç»ä¸è¿åæ ¼å¼ï¼ |
| | | bigscreendata.value = res.data || res; |
| | | // æ°æ®æ´æ°åå·æ°å¾è¡¨ |
| | | nextTick(() => { |
| | | refreshCharts(); |
| | | }); |
| | | } catch (error) { |
| | | console.error('è·å大屿°æ®å¤±è´¥ï¼', error); |
| | | ElMessage.error('æ°æ®è·å失败ï¼è¯·æ£æ¥å端æ¥å£æ¯å¦æ£å¸¸'); // æ¿æ¢ä¸ºElement Plusæ¶æ¯æç¤º |
| | | } |
| | | }; |
| | | |
| | | console.log('大屿°æ®111', bigscreendata.value); |
| | | |
| | | // å¤ç¨æ¨¡ææ°æ® |
| | | const operationList = ref([ |
| | | { opNo: 'JW251224001', opType: 'å
¥åº', operator: 'å¼ ä¸', startTime: '15:30:22', status: 'å¤çä¸' }, |
| | | { opNo: 'CK251224002', opType: 'åºåº', operator: 'æå', startTime: '15:25:10', status: '已宿' }, |
| | |
| | | { opNo: 'SC251224005', opType: '䏿¶', operator: 'åä¸', startTime: '15:10:18', status: 'å¼å¸¸' } |
| | | ]); |
| | | |
| | | // å¾è¡¨å®¹å¨ |
| | | // å¾è¡¨å®¹å¨Ref |
| | | const inventoryPieRef = ref(null); |
| | | const stockTrendRef = ref(null); |
| | | const locationRateRef = ref(null); |
| | | const operationRadarRef = ref(null); |
| | | const exceptionTrendRef = ref(null); |
| | | |
| | | // å¾è¡¨å®ä¾ |
| | | // å¾è¡¨å®ä¾ï¼å
¨å±ç®¡çï¼ç¨äºéæ¯åresizeï¼ |
| | | let inventoryPieChart = null; |
| | | let stockTrendChart = null; |
| | | let locationRateChart = null; |
| | | let operationRadarChart = null; |
| | | let exceptionTrendChart = null; |
| | | |
| | | // åå§ååºååºä½åå¸é¥¼å¾ |
| | | // åå§ååºååºä½åå¸é¥¼å¾ï¼å
³èåç«¯æ°æ®ï¼ |
| | | const initInventoryPie = () => { |
| | | if (!inventoryPieRef.value) return; |
| | | |
| | | // 鿝æ§å®ä¾ï¼é²æ¢å
åæ³æ¼ |
| | | if (inventoryPieChart) { |
| | | inventoryPieChart.dispose(); |
| | | } |
| | | |
| | | inventoryPieChart = echarts.init(inventoryPieRef.value); |
| | | // ä¼å
使ç¨åç«¯æ°æ®ï¼æ æ°æ®åç¨é»è®¤å¼ |
| | | const locationData = bigscreendata.value.inventoryLocationDist.length |
| | | ? bigscreendata.value.inventoryLocationDist |
| | | : [ |
| | | { value: 48.7, name: '常温åºAåº', itemStyle: { color: '#5470c6' } }, |
| | | { value: 29.2, name: 'å·èåºBåº', itemStyle: { color: '#91cc75' } }, |
| | | { value: 21.9, name: 'ä¿ç¨åºCåº', itemStyle: { color: '#fac858' } }, |
| | | { value: 2.2, name: 'æ®æ¬¡ååºDåº', itemStyle: { color: '#ee6666' } } |
| | | ]; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | |
| | | legend: { |
| | | bottom: 0, |
| | | left: 'center', |
| | | data: ['常温åºAåº', 'å·èåºBåº', 'ä¿ç¨åºCåº', 'æ®æ¬¡ååºDåº'] |
| | | data: locationData.map(item => item.name) |
| | | }, |
| | | series: [{ |
| | | name: 'åºååºä½åå¸', |
| | |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: 48.7, name: '常温åºAåº', itemStyle: { color: '#5470c6' } }, |
| | | { value: 29.2, name: 'å·èåºBåº', itemStyle: { color: '#91cc75' } }, |
| | | { value: 21.9, name: 'ä¿ç¨åºCåº', itemStyle: { color: '#fac858' } }, |
| | | { value: 2.2, name: 'æ®æ¬¡ååºDåº', itemStyle: { color: '#ee6666' } } |
| | | ] |
| | | data: locationData |
| | | }] |
| | | }; |
| | | |
| | |
| | | return inventoryPieChart; |
| | | }; |
| | | |
| | | // åå§åè¿7æ¥åºå
¥åºè¶å¿å¾ |
| | | // åå§åè¿7æ¥åºå
¥åºè¶å¿å¾ï¼å
³èåç«¯æ°æ®ï¼ |
| | | const initStockTrend = () => { |
| | | if (!stockTrendRef.value) return; |
| | | |
| | |
| | | } |
| | | |
| | | stockTrendChart = echarts.init(stockTrendRef.value); |
| | | // ä¼å
使ç¨åç«¯æ°æ® |
| | | const trendData = bigscreendata.value.dailyInOutBoundList.length |
| | | ? bigscreendata.value.dailyInOutBoundList |
| | | : [ |
| | | { date: '12-18', inNum: 10, outNum: 16 }, |
| | | { date: '12-19', inNum: 12, outNum: 18 }, |
| | | { date: '12-20', inNum: 10, outNum: 14 }, |
| | | { date: '12-21', inNum: 12, outNum: 18 }, |
| | | { date: '12-22', inNum: 10, outNum: 16 }, |
| | | { date: '12-23', inNum: 12, outNum: 18 }, |
| | | { date: '12-24', inNum: 12, outNum: 20 } |
| | | ]; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: true, |
| | | data: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'] |
| | | data: trendData.map(item => item.date) |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | name: 'å
¥åºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: [10, 12, 10, 12, 10, 12, 12], |
| | | data: trendData.map(item => item.inNum), |
| | | itemStyle: { color: '#52c41a' } |
| | | }, |
| | | { |
| | | name: 'åºåºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: [16, 18, 14, 18, 16, 18, 20], |
| | | data: trendData.map(item => item.outNum), |
| | | itemStyle: { color: '#1890ff' } |
| | | } |
| | | ] |
| | |
| | | return stockTrendChart; |
| | | }; |
| | | |
| | | // åå§ååºä½å©ç¨çç¯å½¢å¾ |
| | | // åå§ååºä½å©ç¨çç¯å½¢å¾ï¼ä¿®æ£ï¼ç»ä¸å®ä¾ç®¡çï¼å
³èåç«¯æ°æ®ï¼ |
| | | const initLocationRate = () => { |
| | | if (!locationRateRef.value) return; |
| | | |
| | | // 鿝æ§å®ä¾ |
| | | if (locationRateChart) { |
| | | locationRateChart.dispose(); |
| | | } |
| | | |
| | | locationRateChart = echarts.init(locationRateRef.value); |
| | | // ä¼å
使ç¨åç«¯æ°æ®ï¼æ æ°æ®åç¨é»è®¤å¼ |
| | | console.log('åºä½å©ç¨çæ°æ®', bigscreendata.value.locationUtilizationRate); |
| | | const utilizationRate = bigscreendata.value.locationUtilizationRate || 86.2; |
| | | const freeRate = 100 - utilizationRate; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | formatter: '{a} <br/>{b} : {c}%' |
| | | trigger: 'item', |
| | | formatter: '{b}: {c}%' |
| | | }, |
| | | series: [{ |
| | | name: 'åºä½å©ç¨ç', |
| | | type: 'gauge', |
| | | min: 0, |
| | | max: 100, |
| | | splitNumber: 10, |
| | | radius: '90%', |
| | | center: ['50%', '55%'], |
| | | startAngle: 180, |
| | | endAngle: 0, |
| | | progress: { |
| | | show: true, |
| | | width: 20, |
| | | itemStyle: { |
| | | color: '#1890ff' |
| | | legend: { |
| | | bottom: 0, |
| | | left: 'center', |
| | | data: ['å·²å ç¨åºä½', '空é²åºä½'], |
| | | textStyle: { fontSize: 12, color: '#666' } |
| | | }, |
| | | graphic: [ |
| | | { |
| | | type: 'text', |
| | | left: 'right', |
| | | top: '10%', |
| | | style: { |
| | | text: `${utilizationRate}%`, |
| | | fontSize: 24, |
| | | fontWeight: 'bold', |
| | | fill: '#333' |
| | | } |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | width: 20, |
| | | color: [[1, 'rgba(200,200,200,0.3)']] |
| | | { |
| | | type: 'text', |
| | | left: 'right', |
| | | top: '25%', |
| | | style: { |
| | | text: 'åºä½å©ç¨ç', |
| | | fontSize: 14, |
| | | fill: '#666' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | distance: -30, |
| | | splitNumber: 5, |
| | | lineStyle: { |
| | | width: 2, |
| | | color: '#999' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | distance: -30, |
| | | length: 14, |
| | | lineStyle: { |
| | | width: 3, |
| | | color: '#999' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | distance: -20, |
| | | color: '#999', |
| | | fontSize: 12 |
| | | }, |
| | | anchor: { |
| | | show: false |
| | | }, |
| | | title: { |
| | | show: true, |
| | | offsetCenter: [0, '30%'], |
| | | fontSize: 16, |
| | | fontWeight: 'bold' |
| | | }, |
| | | detail: { |
| | | valueAnimation: true, |
| | | formatter: '{value}%', |
| | | fontSize: 20, |
| | | fontWeight: 'bold', |
| | | offsetCenter: [0, '70%'] |
| | | }, |
| | | data: [{ |
| | | value: 86.2, |
| | | name: 'åºä½å©ç¨ç' |
| | | }] |
| | | }] |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | type: 'pie', |
| | | radius: ['50%', '70%'], |
| | | center: ['40%', '50%'], |
| | | avoidLabelOverlap: false, |
| | | label: { show: false }, |
| | | labelLine: { show: false }, |
| | | data: [ |
| | | { value: utilizationRate, name: 'å·²å ç¨åºä½', itemStyle: { color: '#1890ff' } }, |
| | | { value: freeRate, name: '空é²åºä½', itemStyle: { color: '#e5e9f2' } } |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | locationRateChart.setOption(option); |
| | | return locationRateChart; |
| | | }; |
| | | |
| | | // åå§åä½ä¸ç±»åé·è¾¾å¾ |
| | | const initOperationRadar = () => { |
| | | if (!operationRadarRef.value) return; |
| | | |
| | | if (operationRadarChart) { |
| | | operationRadarChart.dispose(); |
| | | } |
| | | |
| | | operationRadarChart = echarts.init(operationRadarRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | show: false |
| | | }, |
| | | radar: { |
| | | indicator: [ |
| | | { name: 'åºåºä½ä¸', max: 100 }, |
| | | { name: 'å
¥åºä½ä¸', max: 100 }, |
| | | { name: 'è°æ¨ä½ä¸', max: 100 }, |
| | | { name: 'çç¹ä½ä¸', max: 100 } |
| | | ], |
| | | shape: 'circle', |
| | | splitNumber: 5, |
| | | axisName: { |
| | | color: '#666' |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: 'rgba(0,0,0,0.1)' |
| | | } |
| | | }, |
| | | splitArea: { |
| | | show: true, |
| | | areaStyle: { |
| | | color: ['rgba(255,255,255,0.8)', 'rgba(200,200,200,0.2)'] |
| | | } |
| | | } |
| | | }, |
| | | series: [{ |
| | | name: 'ä½ä¸ç±»ååå¸', |
| | | type: 'radar', |
| | | symbolSize: 8, |
| | | areaStyle: { |
| | | color: 'rgba(24,144,255,0.3)' |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | itemStyle: { |
| | | color: '#1890ff' |
| | | }, |
| | | data: [{ |
| | | value: [45, 30, 15, 10], |
| | | name: 'ä½ä¸å æ¯', |
| | | label: { |
| | | show: true, |
| | | formatter: function (params) { |
| | | return params.value + '%'; |
| | | } |
| | | } |
| | | }] |
| | | }] |
| | | }; |
| | | |
| | | operationRadarChart.setOption(option); |
| | | return operationRadarChart; |
| | | }; |
| | | |
| | | // åå§åå¼å¸¸è¶å¿æçº¿å¾ |
| | | // åå§åå¼å¸¸ç±»åç»è®¡è¶å¿å¾ï¼å
³èåç«¯æ°æ®ï¼ |
| | | const initExceptionTrend = () => { |
| | | if (!exceptionTrendRef.value) return; |
| | | |
| | |
| | | } |
| | | |
| | | exceptionTrendChart = echarts.init(exceptionTrendRef.value); |
| | | // ä¼å
使ç¨åç«¯æ°æ® |
| | | const exceptionData = bigscreendata.value.exceptionTypeTrend.length |
| | | ? bigscreendata.value.exceptionTypeTrend |
| | | : { |
| | | dates: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'], |
| | | stockShort: [10, 11, 9, 12, 10, 13, 12], |
| | | orderTimeout: [8, 9, 7, 8, 7, 9, 8], |
| | | locationException: [4, 5, 2, 4, 3, 5, 4], |
| | | checkDiff: [2, 3, 1, 2, 1, 3, 2] |
| | | }; |
| | | |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'] |
| | | data: exceptionData.dates |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [10, 11, 9, 12, 10, 13, 12], |
| | | data: exceptionData.stockShort, |
| | | itemStyle: { color: '#ff4d4f' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: '订åè¶
æ¶', |
| | |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [8, 9, 7, 8, 7, 9, 8], |
| | | data: exceptionData.orderTimeout, |
| | | itemStyle: { color: '#faad14' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: 'åºä½å¼å¸¸', |
| | |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [4, 5, 2, 4, 3, 5, 4], |
| | | data: exceptionData.locationException, |
| | | itemStyle: { color: '#722ed1' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | lineStyle: { width: 3 } |
| | | }, |
| | | { |
| | | name: 'çç¹å·®å¼', |
| | |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [2, 3, 1, 2, 1, 3, 2], |
| | | data: exceptionData.checkDiff, |
| | | itemStyle: { color: '#13c2c2' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | lineStyle: { width: 3 } |
| | | } |
| | | ] |
| | | }; |
| | |
| | | return exceptionTrendChart; |
| | | }; |
| | | |
| | | // å·æ°ææå¾è¡¨ |
| | | // å·æ°ææå¾è¡¨ï¼ç§»é¤æ æé·è¾¾å¾é»è¾ï¼ |
| | | const refreshCharts = () => { |
| | | const charts = [ |
| | | initInventoryPie, |
| | | initStockTrend, |
| | | initLocationRate, |
| | | initOperationRadar, |
| | | initExceptionTrend |
| | | ]; |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | // çå¬çªå£å¤§å°åå |
| | | // çªå£å¤§å°ååçå¬ |
| | | const handleResize = () => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | operationRadarChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | // æè½½ååå§åå¾è¡¨ |
| | | // ç»ä»¶æè½½æ¶ï¼å
è¯·æ±æ°æ®ï¼ååå§åå¾è¡¨ |
| | | onMounted(() => { |
| | | // å
è·ååç«¯æ°æ® |
| | | fetchBigGreenData(); |
| | | // åå§åå¾è¡¨ï¼ç¡®ä¿DOM已渲æï¼ |
| | | nextTick(() => { |
| | | initInventoryPie(); |
| | | initStockTrend(); |
| | | initLocationRate(); |
| | | initOperationRadar(); |
| | | initExceptionTrend(); |
| | | |
| | | window.addEventListener('resize', handleResize); |
| | | }); |
| | | }); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶æ¸
ç |
| | | // ç»ä»¶å¸è½½æ¶ï¼éæ¯å¾è¡¨å®ä¾ï¼ç§»é¤äºä»¶çå¬ |
| | | onUnmounted(() => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | operationRadarChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | |
| | | } |
| | | |
| | | .chart-card { |
| | | height: 320px; |
| | | height: 350px; |
| | | padding: 15px; |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | .chart-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | min-height: 250px; |
| | | min-height: 240px; |
| | | flex: 1; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using IBigBreenService; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace BigGreenService |
| | | { |
| | | public class BigGreenService : IBigGreenService |
| | | { |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository; |
| | | private readonly IRepository<Dt_OutboundOrder> _outBoundOrderRepository; |
| | | private readonly IRepository<Dt_LocationInfo> _locationInfoRepository; |
| | | private readonly IRepository<Dt_OutboundOrderDetail> _outBoundOrderDetailRepository; |
| | | private readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | |
| | | public BigGreenService(IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_OutboundOrder> outBoundOrderRepository, IRepository<Dt_LocationInfo> locationInfoRepository,IRepository<Dt_OutboundOrderDetail> outBoundOrderDetailRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository,IRepository<Dt_Task> taskRepository) |
| | | { |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _outBoundOrderRepository = outBoundOrderRepository; |
| | | _locationInfoRepository = locationInfoRepository; |
| | | _outBoundOrderDetailRepository = outBoundOrderDetailRepository; |
| | | _inboundOrderDetailRepository = inboundOrderDetailRepository; |
| | | _taskRepository = taskRepository; |
| | | } |
| | | public WebResponseContent GetBigGreenData() |
| | | { |
| | | //è®¡ç®æ»åºåæ°é |
| | | var totalStockQuantity = _stockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Sum(x => (decimal?)x.StockQuantity) ?? 0; |
| | | |
| | | //计ç®å¾
åºåºè®¢å |
| | | var targetStatus = new List<int> |
| | | { |
| | | (int)OutOrderStatusEnum.åºåºä¸, |
| | | (int)OutOrderStatusEnum.æªå¼å§ |
| | | }; |
| | | var unOutBound =_outBoundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x =>targetStatus.Contains(x.OrderStatus)).Count(); |
| | | |
| | | //计ç®åºä½å©ç¨ç |
| | | var freeLocation =_locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x=>x.LocationStatus==(int)LocationStatusEnum.Free).Count(); |
| | | var inStockLocation =_locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationStatus == (int)LocationStatusEnum.InStock).Count(); |
| | | int totalLocation = freeLocation + inStockLocation; |
| | | decimal locationUtilizationRate = totalLocation == 0 |
| | | ? 0 |
| | | : Math.Round((decimal)inStockLocation / totalLocation, 4); |
| | | |
| | | // 4. è·åè¿7æ¥æ¯æ¥åºå
¥åºæç»ï¼æ ¸å¿ä¿®æ¹ï¼è°ç¨ä¸é¢çæ¹æ³ï¼ |
| | | var dailyInOutBoundList = Get7DaysDailyInOutBound(); |
| | | |
| | | //ä»»å¡ |
| | | List<Dt_Task> tasks = _taskRepository.QueryData(); |
| | | |
| | | var bigGreenData = new BigGreenDataDto |
| | | { |
| | | TotalStockQuantity=totalStockQuantity, |
| | | UnOutBoundOrderCount = unOutBound, |
| | | LocationUtilizationRate = locationUtilizationRate, |
| | | DailyInOutBoundList = dailyInOutBoundList, |
| | | TaskList = tasks |
| | | }; |
| | | return WebResponseContent.Instance.OK(data: bigGreenData); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åè¿7æ¥æ¯æ¥åºå
¥åºæç» |
| | | /// </summary> |
| | | /// <returns>æ¯æ¥åºå
¥åºæç»å表</returns> |
| | | private List<DailyInOutBoundDto> Get7DaysDailyInOutBound() |
| | | { |
| | | // 1. å®ä¹æ¶é´èå´ï¼è¿7个èªç¶æ¥ï¼ |
| | | DateTime endDate = DateTime.Today; |
| | | DateTime startDate = endDate.AddDays(-6); |
| | | // çæè¿7æ¥æææ¥æï¼ç¡®ä¿æ 缺失ï¼å³ä½¿æä¸å¤©æ æ°æ®ä¹è¿å0ï¼ |
| | | var all7Days = Enumerable.Range(0, 7) |
| | | .Select(i => endDate.AddDays(-i).ToString("MM-dd")) |
| | | .Reverse() // ææ¥æååºæåï¼ä»7天åå°ä»æ¥ï¼ |
| | | .ToList(); |
| | | |
| | | // 2. æ¥è¯¢æ¯æ¥åºåºæç»ï¼ææ¥æåç»ï¼ |
| | | var dailyOutboundList = _outBoundOrderDetailRepository.Db |
| | | .Queryable<Dt_OutboundOrderDetail>() |
| | | .Where(x => x.CreateDate >= startDate |
| | | && x.CreateDate < endDate.AddDays(1)) |
| | | .GroupBy(x => x.CreateDate) // ææ¥ææ ¼å¼ååç» |
| | | .Select(x => new |
| | | { |
| | | Date = x.CreateDate.ToString( "MM-dd"), |
| | | DailyOutbound = SqlFunc.AggregateSum((decimal?)x.OverOutQuantity) ?? 0 |
| | | }) |
| | | .ToList() |
| | | .ToDictionary(k => k.Date, v => v.DailyOutbound); // 转为åå
¸æ¹ä¾¿å¹é
|
| | | |
| | | // 3. æ¥è¯¢æ¯æ¥å
¥åºæç»ï¼ææ¥æåç»ï¼ |
| | | var dailyInboundList = _inboundOrderDetailRepository.Db |
| | | .Queryable<Dt_InboundOrderDetail>() |
| | | .Where(x => x.CreateDate != null // è¿æ»¤ç©ºæ¥æ |
| | | && x.CreateDate >= startDate |
| | | && x.CreateDate < endDate.AddDays(1)) |
| | | .GroupBy(x => x.CreateDate).Distinct() // ææ¥ææ ¼å¼ååç» |
| | | .Select(x => new |
| | | { |
| | | Date = x.CreateDate.ToString("MM-dd"), |
| | | DailyInbound = SqlFunc.AggregateSum((decimal?)x.OverInQuantity) ?? 0 |
| | | }) |
| | | .ToList() |
| | | .ToDictionary(k => k.Date, v => v.DailyInbound); // 转为åå
¸æ¹ä¾¿å¹é
|
| | | |
| | | // 4. åå¹¶æ¯æ¥æ°æ®ï¼ç¡®ä¿7å¤©æ¥æå®æ´ï¼æ æ°æ®è¡¥0ï¼ |
| | | var dailyInOutBoundList = all7Days.Select(date => new DailyInOutBoundDto |
| | | { |
| | | Date = date, |
| | | DailyOutboundQuantity = dailyOutboundList.ContainsKey(date) ? dailyOutboundList[date] : 0, |
| | | DailyInboundQuantity = dailyInboundList.ContainsKey(date) ? dailyInboundList[date] : 0, |
| | | |
| | | }).ToList(); |
| | | |
| | | return dailyInOutBoundList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 大å±/æ±æ»æ°æ®è¿åDTOï¼å¤§ç»¿æ°æ®æ±æ»ï¼ |
| | | /// </summary> |
| | | public class BigGreenDataDto |
| | | { |
| | | /// <summary> |
| | | /// æ»åºåæ°é |
| | | /// </summary> |
| | | public decimal TotalStockQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¾
åºåºè®¢åæ°éï¼åºåºä¸+æªå¼å§ï¼ |
| | | /// </summary> |
| | | public int UnOutBoundOrderCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 空é²åºä½æ°é |
| | | /// </summary> |
| | | public int FreeLocationCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å ç¨åºä½æ°éï¼å·²ååºï¼ |
| | | /// </summary> |
| | | public int InStockLocationCount { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºä½å©ç¨çï¼å°æ°å½¢å¼ï¼å¦0.85对åº85%ï¼ |
| | | /// </summary> |
| | | public decimal LocationUtilizationRate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿7æ¥æ¯æ¥åºå
¥åºæç» |
| | | /// </summary> |
| | | public List<DailyInOutBoundDto> DailyInOutBoundList { get; set; } = new List<DailyInOutBoundDto>(); |
| | | |
| | | /// <summary> |
| | | /// è¿7æ¥åå
¥åºéï¼å
¥åº-åºåºï¼ |
| | | /// </summary> |
| | | public decimal NetStock7Days { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å表 |
| | | /// </summary> |
| | | public List<Dt_Task> TaskList { get; set; } = new List<Dt_Task>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¯æ¥åºå
¥åºæç»DTO |
| | | /// </summary> |
| | | public class DailyInOutBoundDto |
| | | { |
| | | /// <summary> |
| | | /// æ¥æï¼æ ¼å¼ï¼yyyy-MM-ddï¼ |
| | | /// </summary> |
| | | public string Date { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 彿¥åºåºæ»é |
| | | /// </summary> |
| | | public decimal DailyOutboundQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 彿¥å
¥åºæ»é |
| | | /// </summary> |
| | | public decimal DailyInboundQuantity { get; set; } |
| | | |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\IBigBreen\IBigBreenService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_Model\WIDESEA_Model.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace IBigBreenService |
| | | { |
| | | public interface IBigGreenService : IDependency |
| | | { |
| | | WebResponseContent GetBigGreenData(); |
| | | } |
| | | } |
| | |
| | | using SqlSugar; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | public partial class StockInfoService : ServiceBase<Dt_StockInfo, IRepository<Dt_StockInfo>>, IStockInfoService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IRecordService _recordService; |
| | | public IRepository<Dt_StockInfo> Repository => BaseDal; |
| | | private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository; |
| | |
| | | |
| | | private readonly IRepository<Dt_AllocateOrder> _allocateRepository; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService, IRepository<Dt_AllocateOrder> allocateRepository) : base(BaseDal) |
| | | public StockInfoService(IRepository<Dt_StockInfo> BaseDal, IUnitOfWorkManage unitOfWorkManage, IMapper mapper, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRecordService recordService, ILocationInfoService locationInfoService, IOutboundOrderService outboundOrderService, IRepository<Dt_AllocateOrder> allocateRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | |
| | | _locationInfoService = locationInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | _allocateRepository = allocateRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | //_outboundOrderDetailService = outboundOrderDetailService; |
| | | } |
| | | |
| | |
| | | return stockInfo; |
| | | } |
| | | |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | try |
| | | { |
| | | List<int> stockIds = keys.Select(x => x.ObjToInt()).ToList(); |
| | | |
| | | List<Dt_StockInfo> stockInfos = BaseDal.QueryData(x => stockIds.Contains(x.Id) && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt()); |
| | | |
| | | List<string> locationCodes = stockInfos.Select(x => x.LocationCode).Distinct().ToList(); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = _locationInfoService.Repository.QueryData(x => locationCodes.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()); |
| | | |
| | | stockInfos = stockInfos.Where(x => locationInfos.Select(l => l.LocationCode).Contains(x.LocationCode)).ToList(); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationInfoService.UpdateLocationStatus(locationInfos, LocationStatusEnum.Free); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(stockInfos, WIDESEA_Core.Enums.OperateTypeEnum.人工å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return WebResponseContent.Instance.OK("å 餿å"); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error("å é¤å¤±è´¥ï¼"+ex.Message); |
| | | } |
| | | } |
| | | public void AddMaterielGroup(Dt_StockInfo stockInfo) |
| | | { |
| | | decimal beforeQuantity = 0; |
| | |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogLibrary", "LogLibrary\LogLibrary.csproj", "{A7C339A4-CC00-2872-6005-A272626BC5F1}" |
| | | EndProject |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BigGreen", "BigGreen", "{23BE058E-6D08-4075-99BD-8054DC328FFE}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBigBreenService", "IBigBreen\IBigBreenService.csproj", "{21939E11-C422-4E19-BDD6-333804F5128C}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigGreenService", "BigGreenService\BigGreenService.csproj", "{2CB630FF-FEB0-46DB-B2A1-88F34DB91725}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | | Debug|Any CPU = Debug|Any CPU |
| | |
| | | {A7C339A4-CC00-2872-6005-A272626BC5F1}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {A7C339A4-CC00-2872-6005-A272626BC5F1}.Release|x86.ActiveCfg = Release|x86 |
| | | {A7C339A4-CC00-2872-6005-A272626BC5F1}.Release|x86.Build.0 = Release|x86 |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Debug|x86.ActiveCfg = Debug|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Debug|x86.Build.0 = Debug|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Dev|Any CPU.ActiveCfg = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Dev|Any CPU.Build.0 = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Dev|x86.ActiveCfg = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Dev|x86.Build.0 = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Release|x86.ActiveCfg = Release|Any CPU |
| | | {21939E11-C422-4E19-BDD6-333804F5128C}.Release|x86.Build.0 = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Debug|x86.ActiveCfg = Debug|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Debug|x86.Build.0 = Debug|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Dev|Any CPU.ActiveCfg = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Dev|Any CPU.Build.0 = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Dev|x86.ActiveCfg = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Dev|x86.Build.0 = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Release|x86.ActiveCfg = Release|Any CPU |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725}.Release|x86.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | |
| | | {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {60DE2920-37C6-4C2B-A053-6B1B2DAF047A} |
| | | {D35E0897-0E66-4E1E-B8DA-28701BE3B2B7} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} |
| | | {A6E822A3-5A09-4B18-BEE6-57CC7D7B8BEC} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} |
| | | {23BE058E-6D08-4075-99BD-8054DC328FFE} = {60DE2920-37C6-4C2B-A053-6B1B2DAF047A} |
| | | {21939E11-C422-4E19-BDD6-333804F5128C} = {23BE058E-6D08-4075-99BD-8054DC328FFE} |
| | | {2CB630FF-FEB0-46DB-B2A1-88F34DB91725} = {23BE058E-6D08-4075-99BD-8054DC328FFE} |
| | | EndGlobalSection |
| | | GlobalSection(ExtensibilityGlobals) = postSolution |
| | | SolutionGuid = {599A7267-7402-4143-84AE-9B407FC2BB69} |
| | |
| | | var lists = Service.GetLocationTypes(); |
| | | return WebResponseContent.Instance.OK("", lists); |
| | | } |
| | | |
| | | [HttpPost, Route("LocationDisableStatus")] |
| | | public WebResponseContent LocationDisableStatus([FromBody]int[] keys) |
| | | { |
| | | return Service.LocationDisableStatus(keys); |
| | | } |
| | | |
| | | [HttpPost, Route("LocationEnableStatus")] |
| | | public WebResponseContent LocationEnableStatus([FromBody] int[] keys) |
| | | { |
| | | return Service.LocationEnableStatus(keys); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using IBigBreenService; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.BigGreen |
| | | { |
| | | [Route("api/BigScreen")] |
| | | [ApiController] |
| | | public class BigScreenController : ControllerBase |
| | | { |
| | | private readonly IBigGreenService _bigGreenService; |
| | | public BigScreenController(IBigGreenService bigGreenService) |
| | | { |
| | | _bigGreenService = bigGreenService; |
| | | } |
| | | |
| | | [HttpGet, Route("GetBigGreenData"),AllowAnonymous] |
| | | public WebResponseContent GetBigGreenData() |
| | | { |
| | | return _bigGreenService.GetBigGreenData(); |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using WIDESEA.QuartzJob; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Helper; |
| | | |
| | | namespace WIDESEA_WMSServer |
| | |
| | | }, |
| | | |
| | | }; |
| | | |
| | | //Console.WriteLine("HostEnvironment"+App.HostEnvironment.IsDevelopment()); |
| | | if(App.HostEnvironment.IsDevelopment()) |
| | | { |
| | | return; |
| | | } |
| | | foreach (var item in allQzServices) |
| | | { |
| | | var ResuleModel = schedulerCenter.AddScheduleJobAsync(item).Result; |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\BigGreenService\BigGreenService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_AllocateService\WIDESEA_AllocateService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_BasicService\WIDESEA_BasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_CheckService\WIDESEA_CheckService.csproj" /> |