| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | // this.buttons.unshift({ //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | | // name: 'æé®', //æé®åç§° |
| | | // icon: 'el-icon-document', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | // type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | // onClick: function () { |
| | | // this.$Message.success('ç¹å»äºæé®'); |
| | | // } |
| | | // }); |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | // this.boxOptions.labelWidth = 150; |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | <template> |
| | | <vol-box v-model="show" title="æ¤éç»ç" :width="500" :height="300"> |
| | | <template #content> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <el-form-item label="æçæ¡ç :" prop="code"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form-item label="æçææ¡ç :" prop="code"> |
| | | <el-input |
| | | v-model="form.code" |
| | | placeholder="è¯·æ«æ/è¾å
¥æçæ¡ç " |
| | | placeholder="è¯·æ«æ/è¾å
¥æçææ¡ç " |
| | | @keydown.enter.prevent="submit" |
| | | clearable |
| | | @paste="handlePaste" |
| | |
| | | path: '/wms-dashboard', |
| | | name: 'wms-dashboard', |
| | | component: () => import('@/views/charts/wms-dashboard.vue') |
| | | }, { |
| | | path: '/Dt_MesReturnRecord', |
| | | name: 'Dt_MesReturnRecord', |
| | | component: () => import('@/views/basic/Dt_MesReturnRecord.vue') |
| | | } |
| | | ] |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | |
| | | <script> |
| | | import extend from "@/extension/basic/warehouse.js"; // 注æï¼è¥æä¸å±çåä¼ è®°å½æ©å±æä»¶ï¼éæ¿æ¢æ¤è·¯å¾ |
| | | import { ref, defineComponent } from "vue"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | // 1. è¡¨æ ¼åºç¡é
ç½®ï¼éé
åä¼ è®°å½å®ä½ |
| | | const table = ref({ |
| | | key: "id", // 对åºå®ä½ä¸»é®Id |
| | | footer: "Foots", |
| | | cnName: "æ¥å£åä¼ è®°å½", // æ¿æ¢åä»åºä¿¡æ¯ |
| | | name: "returnRecord", // èªå®ä¹è¡¨åæ è¯ |
| | | url: "/MesReturnRecord/", // 对åºå端æ¥å£è·¯å¾ï¼éæ ¹æ®å®é
å端路ç±è°æ´ï¼ |
| | | sortName: "id", |
| | | }); |
| | | |
| | | // 2. ç¼è¾è¡¨ååæ®µï¼å¯¹åºå®ä½ææå段 |
| | | const editFormFields = ref({ |
| | | id: "", |
| | | orderId: "", |
| | | orderNo: "", |
| | | returnType: "", |
| | | interfaceType: "", |
| | | requestData: "", |
| | | apiUrl: "", |
| | | responseData: "", |
| | | httpStatusCode: "", |
| | | returnCount: "", |
| | | requestCode: "", |
| | | returnStatus: "", |
| | | lastReturnTime: "", |
| | | successTime: "", |
| | | failureReason: "", |
| | | }); |
| | | |
| | | // 3. ç¼è¾è¡¨åé
ç½®ï¼åºåå¿
填项ï¼éé
åæ®µç±»å |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "åæ®ä¸»è¡¨ID", |
| | | required: true, |
| | | field: "orderId", |
| | | type: "int", |
| | | }, |
| | | { |
| | | title: "åæ®ç¼å·", |
| | | required: true, |
| | | field: "orderNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "åä¼ ç±»å", |
| | | required: true, |
| | | field: "returnType", |
| | | type: "select", // æä¸¾ç±»åç¨ä¸ææ¡ |
| | | data: [ |
| | | { label: "æ´å", value: 1 }, |
| | | { label: "åæ¹", value: 2 }, |
| | | ], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åä¼ æ¥å£ç±»å", |
| | | required: true, |
| | | field: "interfaceType", |
| | | type: "select", |
| | | data: [ |
| | | { label: "åºåº", value: 1 }, |
| | | { label: "å
¥åº", value: 2 }, |
| | | { label: "è°æ¨", value: 3 }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "APIå°å", |
| | | required: true, |
| | | field: "apiUrl", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "请æ±ä»£ç ", |
| | | required: true, |
| | | field: "requestCode", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åä¼ æ¬¡æ°", |
| | | required: true, |
| | | field: "returnCount", |
| | | type: "int", |
| | | }, |
| | | { |
| | | title: "åä¼ ç¶æ", |
| | | required: true, |
| | | field: "returnStatus", |
| | | type: "select", |
| | | data: [ |
| | | { label: "åä¼ æå", value: 1 }, |
| | | { label: "åä¼ å¤±è´¥", value: 2 }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "HTTPç¶æç ", |
| | | field: "httpStatusCode", |
| | | type: "int", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åä¼ æ°æ®(JSON)", |
| | | required: true, |
| | | field: "requestData", |
| | | type: "textarea", // å¤§ææ¬ç¨ææ¬å |
| | | rows: 4, |
| | | }, |
| | | { |
| | | title: "è¿åæ¥æ(JSON)", |
| | | field: "responseData", |
| | | type: "textarea", |
| | | rows: 4, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æååä¼ æ¶é´", |
| | | field: "lastReturnTime", |
| | | type: "datetime", |
| | | }, |
| | | { |
| | | title: "åä¼ æåæ¶é´", |
| | | field: "successTime", |
| | | type: "datetime", |
| | | }, |
| | | { |
| | | title: "失败åå ", |
| | | field: "failureReason", |
| | | type: "textarea", |
| | | rows: 3, |
| | | }, |
| | | ], |
| | | ]); |
| | | |
| | | // 4. æç´¢è¡¨ååæ®µï¼é
ç½®å¸¸ç¨æç´¢é¡¹ |
| | | const searchFormFields = ref({ |
| | | orderNo: "", |
| | | returnType: "", |
| | | interfaceType: "", |
| | | returnStatus: "", |
| | | requestCode: "", |
| | | }); |
| | | |
| | | // 5. æç´¢è¡¨åé
ç½®ï¼éé
æç´¢ç±»å |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "åæ®ç¼å·", field: "orderNo", type: "like" }, |
| | | { |
| | | title: "åä¼ ç±»å", |
| | | field: "returnType", |
| | | type: "select", |
| | | data: [ |
| | | { label: "æ´å", value: 1 }, |
| | | { label: "åæ¹", value: 2 }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "åä¼ æ¥å£ç±»å", |
| | | field: "interfaceType", |
| | | type: "select", |
| | | data: [ |
| | | { label: "åºåº", value: 1 }, |
| | | { label: "å
¥åº", value: 2 }, |
| | | { label: "è°æ¨", value: 3 }, |
| | | ], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åä¼ ç¶æ", |
| | | field: "returnStatus", |
| | | type: "select", |
| | | data: [ |
| | | { label: "åä¼ æå", value: 1 }, |
| | | { label: "åä¼ å¤±è´¥", value: 2 }, |
| | | ], |
| | | }, |
| | | { title: "请æ±ä»£ç ", field: "requestCode", type: "like" }, |
| | | ], |
| | | ]); |
| | | |
| | | // 6. è¡¨æ ¼åé
ç½®ï¼å®å
¨å¹é
C#å®ä½å段 |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "主é®ID", |
| | | type: "int", |
| | | width: 80, |
| | | hidden: true, // 主é®é»è®¤éè |
| | | readonly: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderId", |
| | | title: "åæ®ä¸»è¡¨ID", |
| | | type: "int", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | |
| | | { |
| | | field: "interfaceType", |
| | | title: "æ¥å£ç±»å", |
| | | type: "int", |
| | | width: 90, |
| | | align: "left", |
| | | formatter: (row) => { |
| | | const map = { 1: "åºåº", 2: "å
¥åº", 3: "è°æ¨" }; |
| | | return map[row.interfaceType] || "-"; |
| | | }, |
| | | }, |
| | | { |
| | | field: "apiUrl", |
| | | title: "APIå°å", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "returnCount", |
| | | title: "åä¼ æ¬¡æ°", |
| | | type: "int", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "returnStatus", |
| | | title: "åä¼ ç¶æ", |
| | | type: "int", |
| | | width: 90, |
| | | align: "center", |
| | | formatter: (row) => { |
| | | return row.returnStatus === 1 |
| | | ? '<span style="color: green;">æå</span>' |
| | | : '<span style="color: red;">失败</span>'; |
| | | }, |
| | | }, |
| | | { |
| | | field: "httpStatusCode", |
| | | title: "HTTPç¶æç ", |
| | | type: "int", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | field: "lastReturnTime", |
| | | title: "æååä¼ æ¶é´", |
| | | type: "datetime", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "successTime", |
| | | title: "æåæ¶é´", |
| | | type: "datetime", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "requestCode", |
| | | title: "请æ±ä»£ç ", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "failureReason", |
| | | title: "失败åå ", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | |
| | | }, |
| | | { |
| | | field: "requestData", |
| | | title: "åä¼ æ°æ®", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | hidden: true, // å¤§ææ¬é»è®¤éèï¼å¯éè¿åé
ç½®æ¾ç¤º |
| | | }, |
| | | { |
| | | field: "responseData", |
| | | title: "è¿åæ¥æ", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | |
| | | // 7. 详æ
é
ç½®ï¼éé
æ°å®ä½ |
| | | const detail = ref({ |
| | | cnName: "æ¥å£åä¼ è®°å½è¯¦æ
", |
| | | table: "returnRecord", |
| | | columns: [], |
| | | sortName: "id", |
| | | }); |
| | | |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | field: "operator", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | field: "operator", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | |
| | | using IBigBreenService; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.Basic; |
| | | |
| | | namespace BigGreenService |
| | | { |
| | |
| | | private readonly IRepository<Dt_Task_Hty> _taskHtyRepository; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly IRepository<Dt_StockInfo> _stockInfoRepository; |
| | | private readonly IRepository<Dt_MaterialExpirationDate> _materialExpirationDateRepository; |
| | | |
| | | 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,IRepository<Dt_Task_Hty> taskHtyRepository, IRepository<Dt_StockInfo> stockInfoRepository) |
| | | 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, IRepository<Dt_Task_Hty> taskHtyRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_MaterialExpirationDate> materialExpirationDateRepository) |
| | | { |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _outBoundOrderRepository = outBoundOrderRepository; |
| | |
| | | _taskRepository = taskRepository; |
| | | _taskHtyRepository = taskHtyRepository; |
| | | _stockInfoRepository = stockInfoRepository; |
| | | _materialExpirationDateRepository = materialExpirationDateRepository; |
| | | } |
| | | public WebResponseContent GetBigGreenData() |
| | | { |
| | |
| | | (int)OutOrderStatusEnum.åºåºä¸, |
| | | (int)OutOrderStatusEnum.æªå¼å§ |
| | | }; |
| | | var unOutBound =_outBoundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x =>targetStatus.Contains(x.OrderStatus)).Count(); |
| | | 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 || x.LocationStatus == (int)LocationStatusEnum.Pallet).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 || x.LocationStatus == (int)LocationStatusEnum.Pallet).Count(); |
| | | int totalLocation = freeLocation + inStockLocation; |
| | | decimal locationUtilizationRate = totalLocation == 0 |
| | | ? 0 |
| | | : Math.Round((decimal)inStockLocation / totalLocation, 4)*100; |
| | | : Math.Round((decimal)inStockLocation / totalLocation, 4) * 100; |
| | | |
| | | //计ç®å
¥åºä»»å¡ååºåºä»»å¡å®ææ°é |
| | | var inboundCount =_taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 500 && x.TaskType < 900 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count(); |
| | | var outboundCount =_taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 100 && x.TaskType < 500 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count(); |
| | | var inboundCount = _taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 500 && x.TaskType < 900 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count(); |
| | | var outboundCount = _taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 100 && x.TaskType < 500 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count(); |
| | | |
| | | //è®¡ç®æè´§æç®±æ°é |
| | | var inStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType ==(int) PalletTypeEnum.None && !string.IsNullOrEmpty(x.LocationCode)).Count(); |
| | | var inStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == (int)PalletTypeEnum.None && !string.IsNullOrEmpty(x.LocationCode)).Count(); |
| | | //计ç®ç©ºç®±æ°é |
| | | var freeStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == (int)PalletTypeEnum.Empty && !string.IsNullOrEmpty(x.LocationCode)).Count(); |
| | | // 4. è·åè¿7æ¥æ¯æ¥åºå
¥åºæç»ï¼æ ¸å¿ä¿®æ¹ï¼è°ç¨ä¸é¢çæ¹æ³ï¼ |
| | | var dailyInOutBoundList = Get7DaysDailyInOutBound(); |
| | | |
| | | var nearExpirationList = GetMaterialsNearExpiration(); |
| | | //è·åä½ä¸ç»è®¡ |
| | | var completeTask = SimpleStatistics(); |
| | | //ä»»å¡ |
| | |
| | | |
| | | var bigGreenData = new BigGreenDataDto |
| | | { |
| | | TotalStockQuantity=totalStockQuantity, |
| | | TotalStockQuantity = totalStockQuantity, |
| | | UnOutBoundOrderCount = unOutBound, |
| | | LocationUtilizationRate = locationUtilizationRate, |
| | | DailyInOutBoundList = dailyInOutBoundList, |
| | |
| | | OutboundCount = outboundCount, |
| | | InStockPallet = inStockPallet, |
| | | FreeStockPallet = freeStockPallet, |
| | | CompleteTask = completeTask |
| | | CompleteTask = completeTask, |
| | | NearExpirationList = nearExpirationList |
| | | }; |
| | | return WebResponseContent.Instance.OK(data: bigGreenData); |
| | | } |
| | |
| | | }) |
| | | .ToList() |
| | | .GroupBy(x => x.Date) |
| | | .ToDictionary(k => k.Key , g => g.Sum(x => (decimal?)x.OverOutQuantity) ?? 0); // 转为åå
¸æ¹ä¾¿å¹é
|
| | | .ToDictionary(k => k.Key, g => g.Sum(x => (decimal?)x.OverOutQuantity) ?? 0); // 转为åå
¸æ¹ä¾¿å¹é
|
| | | |
| | | // 3. æ¥è¯¢æ¯æ¥å
¥åºæç»ï¼ææ¥æåç»ï¼ |
| | | var dailyInboundList = _inboundOrderDetailRepository.Db |
| | | .Queryable<Dt_InboundOrderDetail>() |
| | | .Where(x => x.CreateDate != null // è¿æ»¤ç©ºæ¥æ |
| | | && x.CreateDate >= startDate |
| | | .Where(x => x.CreateDate >= startDate |
| | | && x.CreateDate < endDate.AddDays(1)) |
| | | .Select(x => new |
| | | { |
| | |
| | | x.OverInQuantity |
| | | }) |
| | | .ToList() |
| | | .GroupBy(x=>x.Date) |
| | | .GroupBy(x => x.Date) |
| | | .ToDictionary(k => k.Key, g => g.Sum(x => (decimal?)x.OverInQuantity) ?? 0); // 转为åå
¸æ¹ä¾¿å¹é
|
| | | |
| | | // 4. åå¹¶æ¯æ¥æ°æ®ï¼ç¡®ä¿7å¤©æ¥æå®æ´ï¼æ æ°æ®è¡¥0ï¼ |
| | |
| | | Date = date, |
| | | DailyOutboundQuantity = dailyOutboundList.ContainsKey(date) ? dailyOutboundList[date] : 0, |
| | | DailyInboundQuantity = dailyInboundList.ContainsKey(date) ? dailyInboundList[date] : 0, |
| | | |
| | | |
| | | }).ToList(); |
| | | |
| | | return dailyInOutBoundList; |
| | |
| | | (int)t.TaskType >= 100 && (int)t.TaskType <= 299 ? "åºåº" : |
| | | (int)t.TaskType >= 500 && (int)t.TaskType <= 699 ? "å
¥åº" : "å
¶ä»" |
| | | ) |
| | | .Where(g => g.Key == "åºåº" || g.Key == "å
¥åº") |
| | | .Where(g => g.Key == "åºåº" || g.Key == "å
¥åº") |
| | | .Select(g => new SimpleStatisticsDTO |
| | | { |
| | | TaskType = g.Key, |
| | |
| | | public int FreeStockPallet { get; set; } |
| | | |
| | | public List<SimpleStatisticsDTO> CompleteTask { get; set; } |
| | | |
| | | public NearExpirationDTO NearExpirationList { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public int Count { get; set; } |
| | | } |
| | | |
| | | public class NearExpirationDTO |
| | | { |
| | | public int DaysToExpiration { get; set; } |
| | | |
| | | public List<Dt_StockInfoDetail> Details { get; set; } |
| | | |
| | | public string LocationCode { get; set; } |
| | | |
| | | public string PalletCode { get; set; } |
| | | } |
| | | |
| | | ///<summary> |
| | | ///è·åè¿30天è¦è¿æçç©æ |
| | | /// </summary> |
| | | public NearExpirationDTO GetMaterialsNearExpiration() |
| | | { |
| | | // åå§åè¿åDTO |
| | | var resultDTO = new NearExpirationDTO |
| | | { |
| | | Details = new List<Dt_StockInfoDetail>(), |
| | | LocationCode = string.Empty, |
| | | PalletCode = string.Empty, |
| | | DaysToExpiration = 0 // åå§åå¤©æ° |
| | | }; |
| | | |
| | | DateTime currentTime = DateTime.Now; |
| | | DateTime thirtyDaysLater = currentTime.AddDays(30); |
| | | |
| | | // çé30天å
è¿æçåºåæç» |
| | | var nearExpirationList = _stockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>() |
| | | .Where(x => (x.ValidDate.Value - x.CreateDate).TotalDays <= 30) |
| | | .ToList(); |
| | | |
| | | // æ ç¬¦åæ¡ä»¶çæç»ï¼ç´æ¥è¿å |
| | | if (!nearExpirationList.Any()) |
| | | { |
| | | return resultDTO; |
| | | } |
| | | |
| | | |
| | | var firstStockId = nearExpirationList.First().StockId; |
| | | |
| | | var stock = _stockInfoRepository.Db.Queryable<Dt_StockInfo>() |
| | | .First(x => x.Id == firstStockId); |
| | | |
| | | |
| | | if (stock == null) |
| | | { |
| | | return resultDTO; |
| | | } |
| | | |
| | | |
| | | resultDTO.LocationCode = stock.LocationCode; |
| | | resultDTO.PalletCode = stock.PalletCode; |
| | | |
| | | |
| | | int minDaysToExpiration = int.MaxValue; |
| | | foreach (var detail in nearExpirationList) |
| | | { |
| | | |
| | | TimeSpan totalDaysToExpiration = detail.ValidDate.Value - detail.CreateDate; |
| | | double remainingDays = totalDaysToExpiration.TotalDays; |
| | | int daysToExpiration = (int)Math.Ceiling(Math.Max(0, remainingDays)); |
| | | |
| | | |
| | | if (daysToExpiration < minDaysToExpiration) |
| | | { |
| | | minDaysToExpiration = daysToExpiration; |
| | | } |
| | | |
| | | |
| | | resultDTO.Details.Add(detail); |
| | | } |
| | | |
| | | |
| | | resultDTO.DaysToExpiration = minDaysToExpiration; |
| | | |
| | | return resultDTO; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | item.OrderStatus = _InboundOrder.OrderStatus; |
| | | item.OrderType = _InboundOrder.OrderType; |
| | | item.Modifier = _InboundOrder.Operator; |
| | | }else if (OutboundOrder!=null) |
| | | { |
| | | item.OrderStatus = OutboundOrder.OrderStatus; |
| | | item.OrderType = OutboundOrder.OrderType; |
| | | item.Modifier = OutboundOrder.Operator; |
| | | } |
| | | } |
| | | return new PageGridData<Dt_AllocateOrder>(totalCount, data); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IRecordService |
| | | { |
| | | public interface IMesReturnRecordService : IService<Dt_MesReturnRecord> |
| | | { |
| | | IRepository<Dt_MesReturnRecord> Repository { get; } |
| | | } |
| | | } |
| | |
| | | ILocationStatusChangeRecordService LocationStatusChangeRecordSetvice { get; } |
| | | |
| | | IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; } |
| | | |
| | | IMesReturnRecordService MesReturnRecordService { get; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_RecordService |
| | | { |
| | | public class MesReturnRecordService : ServiceBase<Dt_MesReturnRecord, IRepository<Dt_MesReturnRecord>>, IMesReturnRecordService |
| | | { |
| | | public MesReturnRecordService(IRepository<Dt_MesReturnRecord> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public IRepository<Dt_MesReturnRecord> Repository => BaseDal; |
| | | } |
| | | } |
| | |
| | | |
| | | public IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; } |
| | | |
| | | public IMesReturnRecordService MesReturnRecordService { get; } |
| | | |
| | | public RecordService(ILocationStatusChangeRecordService locationStatusChangeRecordSetvice, IStockQuantityChangeRecordService stockQuantityChangeRecordService) |
| | | { |
| | | LocationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Record |
| | | { |
| | | [Route("api/MesReturnRecord")] |
| | | [ApiController] |
| | | public class MesReturnRecordController : ApiBaseController<IMesReturnRecordService, Dt_MesReturnRecord> |
| | | { |
| | | public MesReturnRecordController(IMesReturnRecordService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |