| | |
| | | "fastq": "^1.6.0" |
| | | } |
| | | }, |
| | | "@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==" |
| | | }, |
| | | "@sideway/address": { |
| | | "version": "4.1.5", |
| | | "resolved": "https://registry.npmmirror.com/@sideway/address/-/address-4.1.5.tgz", |
| | |
| | | "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": { |
| | |
| | | // è¿ä¸ªæ¶axiosçé
ç½® |
| | | import axios from 'axios'; |
| | | // import { config } from 'vue/types/umd'; |
| | | axios.defaults.baseURL = 'http://192.168.2.155:8099'; //'http://192.168.2.155:8099'; |
| | | |
| | | //axios.defaults.baseURL = 'http://127.0.0.1:9293'; |
| | | axios.defaults.baseURL = 'http://192.168.35.3:9283'; |
| | | // é误信æ¯å¤ç |
| | | const errorHandle = (status, other) => { |
| | | switch (status) { |
| | |
| | | Vue.use(VueRouter) |
| | | |
| | | const routes = [{ |
| | | path: '/line', |
| | | path: '/', |
| | | name: 'indexLine', |
| | | component: () => import('../views/indexLine.vue') |
| | | }, |
| | |
| | | font-size: 50px; |
| | | font-weight: bold; |
| | | color: #90EE90; |
| | | ">ç«åºè¾é轨éå纸信æ¯ï¼å
± å·ï¼</span> |
| | | ">ç«åºè¾é轨éå纸信æ¯ï¼å
±{{showMsg}}å·ï¼</span> |
| | | //æ¶é´ |
| | | <div style="position: absolute; right: 20px;"> |
| | | <p style=" |
| | |
| | | data() { |
| | | return { |
| | | timing: null, |
| | | timeRequest: null, |
| | | loading: true, |
| | | dateDay: null, |
| | | dateYear: null, |
| | |
| | | ], |
| | | data: [ |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">1</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:60px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">3</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">4</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">5</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">6</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">7</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">8</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">9</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">10</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">11</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">12</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">13</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">14</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | ], |
| | | [ |
| | | '<span style="color:#FF4500; font-size:75px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">15</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:75px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:75px;">180</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">705010</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">015004</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">X2</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">2</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">1200</span>', |
| | | '<span style="color:#FF4500; font-size:60px;;">4798</span>', |
| | | '<span style="color:#FF4500; font-size:60px;">180</span>', |
| | | ], |
| | | ], |
| | | headerHeight: 60, |
| | |
| | | evenRowBGC: "rgba(0, 0, 0, 0.6)", |
| | | headerBGC: "rgba(0, 0, 0, 0.6)", |
| | | waitTime: 5000, |
| | | columnWidth: [350, 350, 200, 200, 250, 250, 350], |
| | | columnWidth: [380, 380, 180, 200, 200, 250, 250], |
| | | rowNum: 10, |
| | | align: ["center", "center", "center", "center", "center", "center", "center"], |
| | | }, |
| | | IsDetail: true, |
| | | OrderCreator: {}, |
| | | showMsg:"" |
| | | }; |
| | | }, |
| | | components: { |
| | |
| | | this.updateTime(); // æ¯ç§æ´æ°æ¶é´ |
| | | }, 1000); |
| | | this.cancelLoading(); |
| | | // this.GetOrderDetail(); |
| | | this.GetOrderDetail(); |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(this.timing); |
| | | clearInterval(this.timeRequest); |
| | | }, |
| | | methods: { |
| | | // æ´æ°å京æ¶é´ |
| | |
| | | }, 1000); |
| | | }, |
| | | GetOrderDetail() { |
| | | axios.post("/api/dt_WorkOrder/getWorkOrderInfo", null, "").then((res) => { |
| | | axios.post("/api/OutLineView/GetOutLineView", null, "").then((res) => { |
| | | if (res.data.status) { |
| | | if (res.data.data == null) { |
| | | return; |
| | | } |
| | | var sp = '</span>'; |
| | | this.showMsg=res.data.message |
| | | var arr = []; |
| | | res.data.data.dt_WorkOrderDetail.forEach((x) => { |
| | | res.data.data.forEach((x) => { |
| | | var item = [ |
| | | '<span style="color:#67e0e3;">' + x.layer + 'å±' + sp, |
| | | '<span style="color:#9fe6b8;">' + (x.lj_hight == null ? 'æ éæµé' : x.lj_hight + 'mm') + sp, |
| | | '<span style="color:#fb7503;">' + (x.measure_hight == null ? 'æ éæµé' : x.measure_hight + 'mm') + sp, |
| | | '<span style="color:#fb7503;">' + x.lj_is_tolerance + sp, |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.palletCode+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.orderNo+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.materielCode+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.machineName+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.materialWide+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;;">'+x.originalQuantity+'</span>', |
| | | '<span style="color:#FF4500; font-size:55px;">'+x.orderQuantity+'</span>', |
| | | ]; |
| | | arr.push(item); |
| | | }); |
| | | this.OrderCreator = res.data.data; |
| | | if (this.IsDetail) { |
| | | this.config = { |
| | | header: [ |
| | | '<span style="font-size:18px;">屿°</span>', |
| | | '<span style="font-size:18px;">累计æ å饼å</span>', |
| | | '<span style="font-size:18px;">累计饼å</span>', |
| | | '<span style="font-size:18px;">æµé«ç»æ</span>' |
| | | '<span style="font-size:50px;">çº¸å·æ¡ç </span>', |
| | | '<span style="font-size:50px;">å·¥åå·</span>', |
| | | '<span style="font-size:50px;">代ç </span>', |
| | | '<span style="font-size:50px;">䏿ºä½</span>', |
| | | '<span style="font-size:50px;">宽å¹
</span>', |
| | | '<span style="font-size:50px;">纸å·é¿</span>', |
| | | '<span style="font-size:50px;">éç¨çº¸é¿</span>' |
| | | ], |
| | | data: arr, |
| | | waitTime: 10000, |
| | | rowNum: 15, |
| | | columnWidth: [75, 150, 110, 110], |
| | | align: ["center", "center", "center", "center"] |
| | | headerHeight: 60, |
| | | oddRowBGC: "rgba(0, 0, 0, 0.6)", |
| | | evenRowBGC: "rgba(0, 0, 0, 0.6)", |
| | | headerBGC: "rgba(0, 0, 0, 0.6)", |
| | | waitTime: 5000, |
| | | columnWidth: [380, 380, 180, 200, 200, 250, 250], |
| | | rowNum: 10, |
| | | align: ["center", "center", "center", "center", "center", "center", "center"], |
| | | }; |
| | | } else { |
| | | this.$refs["scrollBoard"].updateRows(arr) |
| | | } |
| | | if (this.IsDetail) { |
| | | setInterval(() => { |
| | | this.timeRequest = setInterval(() => { |
| | | this.GetOrderDetail(); |
| | | }, 10000); |
| | | this.IsDetail = false; |
| | |
| | | /// é¢è°åº¦æ¥å£ |
| | | /// </summary> |
| | | [Description("é¢è°åº¦æ¥å£")] |
| | | AGV_CTUScheduleTaskTask |
| | | AGV_CTUScheduleTaskTask, |
| | | /// <summary> |
| | | /// MESå°è½¦å°è¾¾éç¥ |
| | | /// </summary> |
| | | [Description("MESå°è½¦å°è¾¾éç¥")] |
| | | MESAvgArriveNotice |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// MESè¿å |
| | | /// </summary> |
| | | public class MESResponse |
| | | { |
| | | /// <summary> |
| | | /// æåç»æ |
| | | /// </summary> |
| | | public bool Result { get; set; } |
| | | /// <summary> |
| | | /// è¿åä¿¡æ¯ |
| | | /// </summary> |
| | | public string Msg { get; set; } |
| | | /// <summary> |
| | | /// è¿å对象 |
| | | /// </summary> |
| | | public bool Obj { get; set; } |
| | | } |
| | | } |
| | |
| | | public string AGVArea { get; set; } |
| | | |
| | | public int PalletType { get; set; } |
| | | /// <summary> |
| | | /// MES计åId |
| | | /// </summary> |
| | | public int DispatchPlanId { get; set; } |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ |
| | | /// </summary> |
| | | public string WorkCentreCode { get; set; } |
| | | } |
| | | } |
| | |
| | | //ä¸ä¼ æ¡ç |
| | | |
| | | WebResponseContent MESBoxCodeNotice(string boxCode); |
| | | WebResponseContent MESAvgArriveNotice(RequestAGVArriveDTO requestAGVArriveDTO); |
| | | /// <summary> |
| | | /// 夿å
许æ¾è´§ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | string MESAvgArriveNotice(RequestAGVArriveDTO requestAGVArriveDTO); |
| | | |
| | | /// <summary> |
| | | /// å çæºç³è¯·ç©ºæå
¥æååº |
| | |
| | | [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 WorkCentreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MES计åId")] |
| | | [ExporterHeader(DisplayName = "MES计åId")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "MES计åId")] |
| | | public int DispatchPlanId { get; set; } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_DTO.Agv; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Enums; |
| | |
| | | } |
| | | else//åºåºæ¾è´§è¯·æ± |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.PalletType); |
| | | var content = PutRequest(task.NextAddress, task); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | |
| | | } |
| | | else//å
¥åºæ¾è´§è¯·æ± |
| | | { |
| | | var content = PutRequest(task.NextAddress, task.TaskNum); |
| | | var content = PutRequest(task.NextAddress, task); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | |
| | | /// <param name="palletType"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("PutRequest"), AllowAnonymous] |
| | | public WebResponseContent PutRequest(string code, int taskNum) |
| | | public WebResponseContent PutRequest(string code, Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | { |
| | | SD_WorkCentreAgvArriveNoticeInfo=new List<AgvArriveNotice> { new AgvArriveNotice() |
| | | { |
| | | DispatchPlanMaterialId=409, |
| | | WorkCentreCode="66", |
| | | LocationCode="3-ZD-ZJZZ", |
| | | CallId="4534c242-27a7-4fb6-86f5-460b09db303d" |
| | | DispatchPlanMaterialId=task.DispatchPlanId, |
| | | WorkCentreCode=task.WorkCentreCode, |
| | | LocationCode=code, |
| | | CallId=Guid.NewGuid().ToString().Replace("-","") |
| | | } } |
| | | }; |
| | | WebResponseContent webResponse= _taskService.MESAvgArriveNotice(requestAGVArriveDTO); |
| | | if (webResponse.Message.Contains("\"obj\": true")) |
| | | MESResponse response = _taskService.MESAvgArriveNotice(requestAGVArriveDTO).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!response.Result) |
| | | { |
| | | throw new Exception($"è°ç¨MESå°è½¦å
许æ¾è´§æ¥é,MESè¿åä¿¡æ¯"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match => { |
| | | return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString(); |
| | | })); |
| | | } |
| | | if (response.Obj) |
| | | { |
| | | return content.Error($"å
许åæ"); |
| | | } |
| | |
| | | bool RequestPut = otherDevice.GetValue<CoveryorDB, bool>(CoveryorDB.C_RequestPut, stationManger.StationDeviceCode); |
| | | if (!RequestPut) |
| | | { |
| | | otherDevice.SetValue(CoveryorDB.C_InTaskNum, taskNum, stationManger.StationDeviceCode); |
| | | otherDevice.SetValue(CoveryorDB.C_InTaskNum, task.TaskNum, stationManger.StationDeviceCode); |
| | | otherDevice.SetValue(CoveryorDB.C_RequestPut, true, stationManger.StationDeviceCode); |
| | | Thread.Sleep(1000); |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.Agv; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.APIEnum; |
| | |
| | | } |
| | | return content; |
| | | } |
| | | public WebResponseContent MESAvgArriveNotice(RequestAGVArriveDTO requestAGVArriveDTO) |
| | | /// <summary> |
| | | /// 夿å
许æ¾è´§ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string MESAvgArriveNotice(RequestAGVArriveDTO requestAGVArriveDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.MESAvgArriveNotice.ToString()); |
| | | |
| | | string response = Post(apiInfo.ApiAddress, JsonConvert.SerializeObject(requestAGVArriveDTO)); |
| | | |
| | | return response; |
| | | } |
| | | public static string Post(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | using (HttpContent httpContent = new StringContent(requestJson)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); |
| | | |
| | | using HttpClient httpClient = new HttpClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 30); |
| | | string LoginToken = AppSettings.Get("MESLoginToken"); |
| | | headers = new Dictionary<string, string> |
| | | { |
| | | //æ£å¼ |
| | | { "LoginToken", LoginToken } |
| | | }; |
| | | if (headers != null) |
| | | { |
| | | foreach (var header in headers) |
| | | httpClient.DefaultRequestHeaders.Add(header.Key, header.Value); |
| | | } |
| | | HttpResponseMessage responseMessage = httpClient.PostAsync(serviceAddress, httpContent).Result; |
| | | result = responseMessage.Content.ReadAsStringAsync().Result; |
| | | } |
| | | string responseStr = HttpHelper.Post($"{address}/api/Mes/MESAvgArriveNotice", requestAGVArriveDTO.Serialize()); |
| | | return content.OK(responseStr); |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | catch (Exception e) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | throw new Exception(e.Message); |
| | | } |
| | | return content; |
| | | finally |
| | | { |
| | | Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate); |
| | | } |
| | | } |
| | | public WebResponseContent CPEmptyInbound(string palletCode,string SourceAddress) |
| | | { |
| | |
| | | WriteInfo(item.StationCode, $"ä»»å¡å·:{task.TaskNum}ï¼RIFD{task.RfidCode}䏿¥¼åºåºè³èåæ¿å®æ"); |
| | | } |
| | | } |
| | | else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && conveyorLineInfoRead.WR_Task <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID) && conveyorLineInfoRead.WR_Request == 98) //䏿¥¼èååºåºå£å®æ |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => (x.RfidCode == conveyorLineInfoRead.WR_TMID || x.PalletCode== conveyorLineInfoRead.WR_TMID) && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //ä»»å¡åå¤ |
| | | device.SetValue(WR_CLineYLDB.WR_Reresult, 98, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: "CL3_YL"); |
| | | WriteInfo(item.StationCode, $"ä»»å¡å·:{task.TaskNum}ï¼RIFD{task.RfidCode}䏿¥¼åºåºè³èåæ¿å®æ"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | using SqlSugar.Extensions; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | { |
| | | commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | } |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | //commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | //è·åå½åå åæºç¶æ |
| | | if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.WorkCompleted) |
| | | { |
| | | StackerCraneTaskCompletedEventArgs e = new StackerCraneTaskCompletedEventArgs(commonStackerCrane.CurrentTaskNum); |
| | | CommonStackerCrane_StackerCraneTaskCompletedEventHandler(commonStackerCrane, e); |
| | | } |
| | | else if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)//夿ä¸å |
| | | { |
| | | short stackerError = commonStackerCrane.Communicator.Read<short>("DB1000.54.0"); |
| | | if (stackerError==0) |
| | |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | //夿æ¯å¦ææ£æ§è¡çä»»å¡ï¼å¦ææåä¸ä¸å |
| | | Dt_Task? taskOld = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.Roadway == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()); |
| | | if (taskOld != null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | Dt_Task? task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | using WIDESEAWCS_Core.Helper; |
| | | using HslCommunication.WebSocket; |
| | | using WIDESEAWCS_DTO.Equipment; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | } |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | |
| | | //è·åå½åå åæºç¶æ |
| | | if (commonStackerCrane.CurrentTaskNum>0 && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.WorkCompleted) |
| | | { |
| | | StackerCraneTaskCompletedEventArgs e = new StackerCraneTaskCompletedEventArgs(commonStackerCrane.CurrentTaskNum); |
| | | CommonStackerCrane_StackerCraneTaskCompletedEventHandler(commonStackerCrane, e); |
| | | } |
| | | else if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)//夿ä¸å |
| | | { |
| | | short stackerError = commonStackerCrane.Communicator.Read<short>("DB1000.54.0"); |
| | | if (stackerError == 0) |
| | |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender,StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | //夿æ¯å¦ææ£æ§è¡çä»»å¡ï¼å¦ææåä¸ä¸å |
| | | Dt_Task? taskOld = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.Roadway == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()); |
| | | if (taskOld != null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | Dt_Task? task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private static object lockObj = 0;// |
| | | private static List<string> strings = new List<string>(); |
| | | |
| | | public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | string boxCodes = AppSettings.Get("BoxCodes"); |
| | | if (!string.IsNullOrEmpty(boxCodes) && strings.Count<=0) |
| | | { |
| | | foreach (string s in boxCodes.Split(",")) |
| | | { |
| | | strings.Add(s); |
| | | } |
| | | } |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | | { |
| | |
| | | if (lockObj.ToString()=="0") |
| | | { |
| | | lockObj = 1; |
| | | Task task = Task.Run(() => |
| | | Task task = Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | while (true) |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | //è·åå½åè®¾å¤ |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()); |
| | | while (true) |
| | | { |
| | | //è·åå½åè®¾å¤ |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()); |
| | | if (RequestIn != null) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == RequestIn.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | |
| | | //ç åç¯çº¿è¯·æ±ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1) |
| | | { |
| | | //WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | ////åWMS请æ±ä»»å¡ |
| | | //if (true) |
| | | //{ |
| | | |
| | | //} |
| | | //string[] strings = conveyorLineInfoRead.R_BoxCode.Split("-"); |
| | | //if (strings.Length==2) |
| | | //{ |
| | | #region todo:临æ¶é»è¾ |
| | | //åå
¥æ§è¡æ°æ® |
| | | if (strings.FirstOrDefault(x=>x == conveyorLineInfoRead.R_BoxCode)!=null) |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 100 + 5, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, 14, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Long, 485, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 460, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 420, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode); |
| | | WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | if (content.Status) |
| | | { |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 100 + 5, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, 5, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Long, 450, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 360, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 400, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode); |
| | | WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | if (content.Message.Contains("true")) |
| | | { |
| | | strings.Remove(conveyorLineInfoRead.R_BoxCode); |
| | | WriteInfo(RequestIn.StationName, content.Message); |
| | | } |
| | | else |
| | | { |
| | | WriteError(RequestIn.StationName, content.Message); |
| | | } |
| | | WriteInfo(RequestIn.StationName, content.Message); |
| | | } |
| | | else |
| | | { |
| | | WriteError(RequestIn.StationName, $"æªæ¾å°æ¡ç {conveyorLineInfoRead.R_BoxCode}æ°æ®"); |
| | | WriteError(RequestIn.StationName, content.Message); |
| | | } |
| | | #endregion |
| | | //} |
| | | //else |
| | | //{ |
| | | // WriteError(RequestIn.StationName, $"æ°æ®æªåé误ï¼{strings}"); |
| | | //} |
| | | } |
| | | } |
| | | else |
| | |
| | | WriteError(RequestIn.StationName, $"æªæ¾å°è®¾å¤åç¼å·{RequestIn.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | foreach (var item in stationMangers.Where(x=>x.StationType==StationTypeEnum.StationType_OnlyOutbound.ObjToInt())) |
| | | foreach (var item in stationMangers.Where(x => x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (deviceProRead != null) |
| | |
| | | } |
| | | } |
| | | } |
| | | Thread.Sleep(100); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | lockObj = 0; |
| | | WriteError(nameof(ConveyorLineJob_CPH), $"é误信æ¯ï¼{ex.Message}"); |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress && x.StackerCraneCode==deviceCode); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode==deviceCode); |
| | | if (stationManger == null) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | //夿æ¯å¦ææ£æ§è¡çä»»å¡ï¼å¦ææåä¸ä¸å |
| | | Dt_Task? taskOld = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.Roadway == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()); |
| | | if (taskOld!=null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | |
| | | short command = client.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode); |
| | | if (command==3)//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | //task.NextAddress = stationManger.StackerCraneStationCode; |
| | | //_taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | else |
| | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//夿æ¯å¦æ¯åºåºä»»å¡ |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode == task.DeviceCode); |
| | | string[] targetCodes = stationManger.StackerCraneStationCode.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | |
| | | { |
| | | bool RequestTake = device.GetValue<CoveryorDB, bool>(CoveryorDB.C_RequestTake, item.StationDeviceCode); |
| | | int OutTaskNum = device.GetValue<CoveryorDB, int>(CoveryorDB.C_OutTaskNum, item.StationDeviceCode); |
| | | if (RequestTake && OutTaskNum>0) //䏿¥¼åºåºç³è¯· |
| | | if (RequestTake && OutTaskNum>0) //åºåºç³è¯· |
| | | { |
| | | //è·åå½åä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum ==OutTaskNum && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | if (true) |
| | | { |
| | | |
| | | } |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | |
| | | foreach (var item in stationMangers) |
| | | { |
| | | //ç åç¶æ |
| | | bool Call = device.GetValue<R_TrussCartonDB, bool>(GetCartonCall(item.StackerCraneStationCode), item.StackerCraneCode); |
| | | bool Call = device.GetValue<R_TrussCartonDB, bool>(GetCartonCall(item.StackerCraneStationCode), device.DeviceCode); |
| | | |
| | | if (Call && item.IsOccupied == 0) |
| | | { |
| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "æ ç¨ åº åº", |
| | | icon: '', |
| | | class: '', |
| | | value: 'CreateSGManualTasks', |
| | | type: 'success', |
| | | onClick: function () { |
| | | } |
| | | } |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | window.webConfig = { |
| | | //"webApiBaseUrl": "http://192.168.35.3:9283/", |
| | | // "webApiBaseUrl": "http://192.168.35.3:9283/", |
| | | "webApiBaseUrl": "http://127.0.0.1:9293/", |
| | | "webApiProduction":"http://192.168.35.3:9283/" |
| | | } |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | prop: "materialWide", |
| | | title: "ç©æå¹
宽", |
| | | type: "string", |
| | | width: 100, |
| | | }, |
| | | { |
| | | prop: "materialWeight", |
| | | title: "ç©æéé", |
| | | type: "string", |
| | | width: 100, |
| | | }, |
| | | { |
| | | prop: "stockId", |
| | | title: "åºå主é®", |
| | | type: "string", |
| | |
| | | }, |
| | | { |
| | | prop: "taskNum", |
| | | title: "åºåºä»»å¡å·", |
| | | title: "åºåºä»»å¡", |
| | | type: "string", |
| | | width: 100, |
| | | }, |
| | |
| | | prop: "palletCode", |
| | | title: "æ¡ç ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 130, |
| | | }, |
| | | { |
| | | prop: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 180, |
| | | width: 200, |
| | | }, |
| | | { |
| | | prop: "status", |
| | |
| | | this.$refs.child.open(row); |
| | | } else { |
| | | //ç¹å»æå¼åºåºè¯¦æ
|
| | | this.$refs.selectedStock.open(row,this.row.outSGOrderNo); |
| | | this.$refs.selectedStock.open(row,this.row.orderId); |
| | | } |
| | | }, |
| | | outbound() { |
| | |
| | | onInit() { |
| | | //æ©å±é¡µé¢åå§åæä½ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | //å建æç¨åºåº |
| | | let OutOrder = this.buttons.find(x => x.value == 'CreateSGManualTasks'); |
| | | if (OutOrder) { |
| | | OutOrder.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | this.$confirm("确认è¦éæ©çæ°æ®åºåºåå?", "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | var keys = rows.map((x) => x.id); |
| | | this.http |
| | | .post("api/Task/CreateSGManualTasks?", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.refresh(); |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | }); |
| | | }; |
| | | |
| | | const createSocket = (url) => { |
| | | // å建WebSocketè¿æ¥ |
| | | //"ws://127.0.0.1:9295/admin" |
| | | client = new WebSocket(url); |
| | | // const createSocket = (url) => { |
| | | // // å建WebSocketè¿æ¥ |
| | | // //"ws://127.0.0.1:9295/admin" |
| | | // client = new WebSocket(url); |
| | | |
| | | client.onopen = function () { |
| | | client.onmessage = handleMessage; |
| | | store.commit("setWebsocket", client); |
| | | console.log("WebSocket è¿æ¥æå"); |
| | | }; |
| | | // client.onopen = function () { |
| | | // client.onmessage = handleMessage; |
| | | // store.commit("setWebsocket", client); |
| | | // console.log("WebSocket è¿æ¥æå"); |
| | | // }; |
| | | |
| | | client.onclose = function () { |
| | | console.log("WebSocket è¿æ¥å
³é"); |
| | | setTimeout(createSocket, 10000); |
| | | }; |
| | | //çå¬socketéè¯¯ä¿¡æ¯ |
| | | client.onerror = function () {}; |
| | | }; |
| | | // client.onclose = function () { |
| | | // console.log("WebSocket è¿æ¥å
³é"); |
| | | // setTimeout(createSocket, 10000); |
| | | // }; |
| | | // //çå¬socketéè¯¯ä¿¡æ¯ |
| | | // client.onerror = function () {}; |
| | | // }; |
| | | |
| | | const changeTheme = (name) => { |
| | | if (theme.value != name) { |
| | |
| | | } |
| | | } |
| | | |
| | | createSocket("ws://127.0.0.1:9296/" + _userInfo.userName); |
| | | // createSocket("ws://127.0.0.1:9296/" + _userInfo.userName); |
| | | |
| | | Object.assign(_config.$tabs, { open: open, close: close }); |
| | | |
| | |
| | | /// 䏿çç®¡é¢æ |
| | | /// </summary> |
| | | [Description("䏿çç®¡é¢æ")] |
| | | OutSGPick=1 |
| | | OutSGPick = 1, |
| | | /// <summary> |
| | | /// äºæMES颿 |
| | | /// </summary> |
| | | [Description("äºæMES颿")] |
| | | OutMESPick = 2 |
| | | } |
| | | } |
| | |
| | | public void UpdateToke(string token, int userId) |
| | | { |
| | | if (MenuType == 0) |
| | | _cacheService.AddOrUpdate(userId.ToString(), token, 21600); |
| | | _cacheService.AddOrUpdate(userId.ToString(), token); |
| | | else |
| | | _cacheService.AddOrUpdate(userId.ToString() + "-App", token, 21600); |
| | | _cacheService.AddOrUpdate(userId.ToString() + "-App", token); |
| | | } |
| | | |
| | | public bool IsSuperAdmin => IsRoleIdSuperAdmin(RoleId); |
| | |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 计éåä½ï¼Kgï¼åå
ï¼ |
| | | /// 计éåä½ |
| | | /// </summary> |
| | | [PropertyValidate("计éåä½ï¼Kg:å
¬æ¤ãMï¼ç±³ãPcsï¼ä¸ª(åª)", NotNullAndEmpty = true)] |
| | | public string Unit { get; set; } |
| | | /// <summary> |
| | | /// 计éåä½ |
| | | /// </summary> |
| | | [PropertyValidate("计éåä½ï¼Kg:å
¬æ¤ãMï¼ç±³ãPcsï¼ä¸ª(åª)", NotNullAndEmpty = true)] |
| | | public string AssistUnitCode { get; set; } |
| | | } |
| | | } |
| | |
| | | public List<PaperMattakeDetailItem> PaperMattakeDetails { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// ç产æç¨æç» |
| | | /// ç产æç¨é¢ç¨æç» |
| | | /// </summary> |
| | | public class PaperMattakeDetailItem |
| | | { |
| | |
| | | /// </summary> |
| | | public string ReceiptDate { get; set; } |
| | | /// <summary> |
| | | /// é¾å©å¾150gç½å¡ |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterialName { get; set; } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [PropertyValidate("ç产工åå·", NotNullAndEmpty = true)] |
| | | public string OrderId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç¨çº¸åºå·(䏿¸¸) |
| | | /// </summary> |
| | | [PropertyValidate("å·¥åç¨çº¸åºå·", NotNullAndEmpty = true)] |
| | | public int Number { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨(䏿¸¸) |
| | | /// </summary> |
| | | [PropertyValidate("å·¥åç¨çº¸åºå·", NotNullAndEmpty = true)] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | public class MESReturnIssueDTO |
| | | { |
| | | /// <summary> |
| | | /// åºåºæ¥æºæç»ID |
| | | /// </summary> |
| | | [PropertyValidate("åºåºæ¥æºæç»ID", NotNullAndEmpty = true)] |
| | | public int OutDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å«Id |
| | | /// </summary> |
| | | [PropertyValidate("å¼å«Id", NotNullAndEmpty = true)] |
| | | public string IssueId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ |
| | | /// </summary> |
| | | [PropertyValidate("å å·¥ä¸å¿", NotNullAndEmpty = true)] |
| | | public string MakeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¨è½¬ä½ç½®ç¼å· |
| | | /// </summary> |
| | | [PropertyValidate("å¨è½¬ä½ç½®ç¼å·", NotNullAndEmpty = true)] |
| | | public string PointCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä½æä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | [PropertyValidate("éææ°é", NotNullAndEmpty = true)] |
| | | public decimal ReturnQuantity { get; set; } |
| | | /// <summary> |
| | | /// æ¯å¦é¢æï¼1æªé¢æ 0已临æï¼ |
| | | /// æ¯å¦é¢æï¼1æªé¢æ 0å·²é¢æï¼ |
| | | /// </summary> |
| | | [PropertyValidate("æ¯å¦é¢æï¼1æªé¢æ 0已临æï¼", NotNullAndEmpty = true)] |
| | | public string Whether { get; set; } |
| | | [PropertyValidate("æ¯å¦é¢æï¼1æªé¢æ 0已颿ï¼", NotNullAndEmpty = true)] |
| | | public int Whether { get; set; } |
| | | /// <summary> |
| | | /// éæå·¥åå·(ERPç¸å
³) |
| | | /// </summary> |
| | |
| | | /// ç´å¾ |
| | | /// </summary> |
| | | [PropertyValidate("ç´å¾", NotNullAndEmpty = true)] |
| | | public string Thickness { get; set; } |
| | | public decimal Thickness { get; set; } |
| | | /// <summary> |
| | | /// å¹
宽 |
| | | /// </summary> |
| | |
| | | /// |
| | | /// </summary> |
| | | public int PalletType { get; set; } |
| | | /// <summary> |
| | | /// MES计åId |
| | | /// </summary> |
| | | public int DispatchPlanId { get; set; } |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ |
| | | /// </summary> |
| | | public string WorkCentreCode { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | public int MainQuantity { get; set; } |
| | | public decimal MainQuantity { get; set; } |
| | | /// <summary> |
| | | /// è¾
åä½ç¼ç |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | public string StockInfoCode { get; set; } |
| | | public string StockInfoCode { get; set; } = "CKDA003"; |
| | | /// <summary> |
| | | /// æ¹å· |
| | | /// </summary> |
| | |
| | | { |
| | | IMESProInOrderInfoRepository Repository { get; } |
| | | /// <summary> |
| | | /// æå/åæåä¿¡æ¯åæ¥æ¥å£ |
| | | /// </summary> |
| | | WebResponseContent ReceiveProCodeInfo(List<MESProInDTO> proInDTOs); |
| | | /// <summary> |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// </summary> |
| | | WebResponseContent ReceiveProOrderStop(MESOrderStopDTO orderStopDTO); |
| | | |
| | | WebResponseContent MESBoxCode(string boxCode); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// èååºåºçº¿ä½ç¼åä»å¨æ¥å£å± |
| | | /// </summary> |
| | | public interface IOutLineViewRepository : IRepository<Dt_OutLineView> |
| | | { |
| | | } |
| | | } |
| | |
| | | /// æåéå®åºåºæç»ä»å¨æ¥å£å± |
| | | /// </summary> |
| | | IProDeliveryOrderDetailRepository ProDeliveryOrderDetailRepository { get; } |
| | | |
| | | /// <summary> |
| | | /// èå线ä½ç¼åä»å¨æ¥å£å± |
| | | /// </summary> |
| | | IOutLineViewRepository OutLineViewRepository { get; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface IOutLineViewService : IService<Dt_OutLineView> |
| | | { |
| | | IOutLineViewRepository Repository { get; } |
| | | /// <summary> |
| | | /// åå
¥ææ°çåºåºçº¸å·ä¿¡æ¯ |
| | | /// </summary> |
| | | WebResponseContent SaveLineView(List<Dt_OutStockLockInfo> outStockLockInfos); |
| | | /// <summary> |
| | | /// è·å线ä½å纸 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent GetOutLineView(); |
| | | } |
| | | } |
| | |
| | | /// åºåºè¯¦æ
ä¸å¡æ¥å£å± |
| | | /// </summary> |
| | | IOutStockLockInfoService OutStockLockInfoService { get; } |
| | | /// <summary> |
| | | /// èå线ä½ç¼åä¸å¡æ¥å£å± |
| | | /// </summary> |
| | | IOutLineViewService OutLineViewService { get; } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Operators; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | /// </summary> |
| | | WebResponseContent ManualMaterielGroup(SaveModel saveModel); |
| | | /// <summary> |
| | | /// æ´æ°èåæ®å·åºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent UpBSTStock(int operate); |
| | | /// <summary> |
| | | /// è·åå¯ä½¿ç¨åºå |
| | | /// </summary> |
| | | List<Dt_StockInfo> GetUseableStocks(int materielId,decimal width, int warehoseId); |
| | |
| | | /// åé
å®é
åºå |
| | | /// </summary> |
| | | List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, decimal needQuantity); |
| | | |
| | | /// <summary> |
| | | /// åé
èååºå |
| | | /// </summary> |
| | | List<Dt_StockInfo> GetOutOldStocks(List<Dt_StockInfo> stockInfos, decimal needQuantity); |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="bSTPickInfoDTO"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent ReceivePicking(BSTPickInfoDTO bSTPickInfoDTO); |
| | | WebResponseContent ReceivePicking(List<BSTPickInfoDTO> bSTPickInfoDTOs); |
| | | |
| | | /// <summary> |
| | | /// å建ç管æå¨åºåº |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent CreateSGManualTasks(List<int> ids); |
| | | } |
| | | } |
| | |
| | | { |
| | | return content.Error($"å
¥åºæ¡ç {nameof(inboundDetailItem.BarCode)}:{inboundDetailItem.BarCode}ç©æ:{inboundDetailItem.MaterialCode}ä¸åå¨"); |
| | | } |
| | | //è·åææéè´ä¿¡æ¯ |
| | | //è·åææå
¥åºä¿¡æ¯ |
| | | List<Dt_InboundOrder> inboundOrdersOld = BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).ToList(); |
| | | |
| | | //è·åææå
¥åºæç»ä¿¡æ¯ |
| | | List<Dt_InboundOrderDetail> inboundOrderDetailsOld = inboundOrdersOld.SelectMany(x=>x.Details).ToList(); |
| | | if (eRPInboundOrderDTO.OperateType == 1) |
| | | { |
| | | //夿é夿å
¥ |
| | |
| | | { |
| | | throw new Exception($"ç©æ{x.MaterialCode}æ¡ç {x.BarCode}ç´å¾é大äº0"); |
| | | } |
| | | if (inboundOrderDetailsOld.FirstOrDefault(t=>t.BarCode==x.BarCode)!=null) |
| | | { |
| | | throw new Exception($"å
¥åºå{inboundOrder.UpperOrderNo}{x.MaterialCode}æ¡ç {x.BarCode}å·²åå¨"); |
| | | } |
| | | x.MaterialName = materielInfo?.MaterielName; |
| | | x.Unit = materielInfo?.MaterielUnit; |
| | | x.MaterialSpec = materielInfo.MaterielSpec; |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_External.MESService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly IAGVStationInfoRepository _agvStationInfoRepository; |
| | | private readonly IMapper _mapper; |
| | | public MESProInOrderInfoService(IMESProInOrderInfoRepository BaseDal,IBasicRepository basicRepository,IMapper mapper, IAGVStationInfoRepository agvStationInfoRepository) : base(BaseDal) |
| | | private readonly IInvokeMESService _invokeMESService; |
| | | public MESProInOrderInfoService(IMESProInOrderInfoRepository BaseDal,IBasicRepository basicRepository,IMapper mapper, IAGVStationInfoRepository agvStationInfoRepository,IInvokeMESService invokeMESService) : base(BaseDal) |
| | | { |
| | | _basicRepository = basicRepository; |
| | | _mapper = mapper; |
| | | _agvStationInfoRepository = agvStationInfoRepository; |
| | | _invokeMESService = invokeMESService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æå/åæåä¿¡æ¯åæ¥æ¥å£ |
| | | /// </summary> |
| | | public WebResponseContent ReceiveProCodeInfo(List<MESProInDTO> proInDTOs) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (proInDTOs==null || proInDTOs.Count<=0) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | //è·åæææåï¼åæåä¿¡æ¯ |
| | | List<Dt_MESProInOrderInfo> proInOrderInfos = BaseDal.QueryData(); |
| | | //è·åææç©æä¿¡æ¯ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.MaterielInvOrgId == MaterielInvOrgEnum.æ°å.ObjToInt()); |
| | | |
| | | MESProInDTO? CheckMaterialCode = proInDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialCode)); |
| | | if (CheckMaterialCode != null) |
| | | { |
| | | return content.Error($"ç©æç¼ç {nameof(MESProInDTO.MaterialCode)}:{CheckMaterialCode.MaterialCode}ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | //è·åææAGVç¹ä½ |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _agvStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | |
| | | //夿æ¯å¦åå¨éå¤ |
| | | MESProInDTO? proInDTO = proInDTOs.FirstOrDefault(x=>x.IsMantissa==false && proInOrderInfos.Select(x=>x.BarCode).Contains(x.BarCode)); |
| | | if (proInDTO!=null) |
| | | { |
| | | return content.Error($"{proInDTO.ProductOrderNo}ç产工å{proInDTO.BarCode}æ¡ç å·²åå¨"); |
| | | } |
| | | Dt_MESProInOrderInfo? proInOrderInfo = proInOrderInfos.FirstOrDefault(x=>x.MESProInStatus==InOrderStatusEnum.å
³é.ObjToInt() && proInDTOs.Select(x=>x.ProductOrderNo).Distinct().Contains(x.ProductOrderNo)); |
| | | if (proInOrderInfo != null) |
| | | { |
| | | return content.Error($"{proInOrderInfo.ProductOrderNo}ç产工åå·²å
³é"); |
| | | } |
| | | List<Dt_MESProInOrderInfo> AddMESProInOrders = new List<Dt_MESProInOrderInfo>(); |
| | | foreach (var item in proInDTOs) |
| | | { |
| | | Dt_MaterielInfo materielInfo = materielInfos.FirstOrDefault(x=>x.MaterielCode== item.MaterialCode); |
| | | if (materielInfo.MaterielSourceType!=MaterielTypeEnum.æå.ObjToInt()) |
| | | { |
| | | Dt_AGVStationInfo? CheckPointCode = aGVStationInfos.FirstOrDefault(x=>x.MESPointCode==item?.PointCode); |
| | | if (CheckPointCode == null) |
| | | { |
| | | return content.Error($"å¨è½¬ä½{nameof(MESReturnIssueDTO.PointCode)}{item?.PointCode}ä¸åå¨,ä»
æåç©æå¯ä¸ä¼ "); |
| | | } |
| | | } |
| | | Dt_MESProInOrderInfo AddproInOrderInfo = _mapper.Map<Dt_MESProInOrderInfo>(item); |
| | | AddproInOrderInfo.WarehouseId = materielInfo.WarehouseId; |
| | | AddproInOrderInfo.MESProOrderType = materielInfo.MaterielSourceType; |
| | | AddMESProInOrders.Add(AddproInOrderInfo); |
| | | } |
| | | BaseDal.AddData(AddMESProInOrders); |
| | | content.OK("æ¥æ¶æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// </summary> |
| | |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | } |
| | | //è·å对åºåæ® |
| | | List<Dt_MESProInOrderInfo>? mESProInOrderInfos = BaseDal.QueryData(x => x.ProductOrderNo == orderStopDTO.ProductOrderNo && x.MESProInStatus != OutOrderStatusEnum.å
³é.ObjToInt()); |
| | | List<Dt_MESProInOrderInfo>? mESProInOrderInfos = BaseDal.QueryData(x => x.ProductOrderNo == orderStopDTO.ProductOrderNo && x.MESProInStatus != InOrderStatusEnum.å
³é.ObjToInt()); |
| | | if (mESProInOrderInfos == null || mESProInOrderInfos.Count <= 0) |
| | | { |
| | | return content.Error($"æåæåæåå·¥å{nameof(MESOrderStopDTO.ProductOrderNo)}{orderStopDTO.ProductOrderNo}ä¸å卿已å
³é"); |
| | | } |
| | | mESProInOrderInfos.ForEach(x => |
| | | { |
| | | x.MESProInStatus = OutOrderStatusEnum.å
³é.ObjToInt(); |
| | | x.MESProInStatus = InOrderStatusEnum.å
³é.ObjToInt(); |
| | | }); |
| | | BaseDal.UpdateData(mESProInOrderInfos); |
| | | content.OK($"å·¥å{nameof(MESOrderStopDTO.ProductOrderNo)}{orderStopDTO.ProductOrderNo}忢æå"); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// </summary> |
| | | /// <summary> |
| | | public WebResponseContent MESBoxCode(string boxCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (boxCode.IsNullOrEmpty()) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | } |
| | | //è·å对åºåæ® |
| | | Dt_MESProInOrderInfo mESProInOrderInfo = BaseDal.QueryFirst(x => x.BarCode == boxCode); |
| | | if (mESProInOrderInfo == null) |
| | | { |
| | | return content.Error($"æåæ¡ç {boxCode}ä¸åå¨"); |
| | | } |
| | | if (mESProInOrderInfo.MESProInStatus==InOrderStatusEnum.å
¥åºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error($"æåæ¡ç {boxCode}å·²å
¥åº"); |
| | | } |
| | | mESProInOrderInfo.MESProInStatus = InOrderStatusEnum.å
¥åºå®æ.ObjToInt(); |
| | | MESResponse response = _invokeMESService.MESBoxCodeNotice(boxCode).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°MESè¿åä¿¡æ¯"); |
| | | if (!response.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(response.Msg)}"); |
| | | } |
| | | BaseDal.UpdateData(mESProInOrderInfo); |
| | | content.OK($"æåæ¡ç {boxCode}æ«ç å
¥åº"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | public static string DecodeUnicode(string input) |
| | | { |
| | | return Regex.Replace(input, @"\\u([0-9a-fA-F]{4})", match => { |
| | | return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | //è·åææéè´ä¿¡æ¯ |
| | | List<Dt_PurchaseOrder> purchaseOrdersOld = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Includes(x=>x.Details).ToList(); |
| | | |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetailsOld = purchaseOrdersOld.SelectMany(x => x.Details).ToList(); |
| | | if (eRPPurchaseOrderDTO.OperateType == 1) |
| | | { |
| | | //夿é夿å
¥ |
| | |
| | | purchaseOrderDetails.ForEach(x => |
| | | { |
| | | Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(t => t.MaterielCode == x.MaterialCode); |
| | | if (materielInfo != null) |
| | | { |
| | | |
| | | } |
| | | x.MaterielName = materielInfo?.MaterielName; |
| | | x.Unit = materielInfo?.MaterielUnit; |
| | | x.MaterielSpec= materielInfo?.MaterielSpec; |
| | |
| | | public string MaterielUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¾
åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "è¾
åä½")] |
| | | public string AssistUnitCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¶æ(0:ç¦ç¨ã1:å¯ç¨) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç©æç¶æ(0:ç¦ç¨ã1:å¯ç¨)")] |
| | |
| | | /// <summary> |
| | | /// ä½ç½®ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ä½ç½®ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ä½ç½®ç¼å·")] |
| | | public string PointCode { get; set; } |
| | | |
| | | /// <summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// èååºåºçº¿ä½ç¼å |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_OutLineView), "èååºåºçº¿ä½ç¼å"), ModelValidate] |
| | | public class Dt_OutLineView : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®æç»ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®æç»ä¸»é®")] |
| | | public int OrderDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®æ°é")] |
| | | public decimal OrderQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå§åºåé |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åå§åºåé")] |
| | | public decimal OriginalQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åé
åºåºé |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åé
åºåºé")] |
| | | public decimal AssignQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¡ç ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¡ç ç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå°ä½ç½® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æºå°ä½ç½®")] |
| | | public string MachineName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æå¹
宽 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æå¹
宽")] |
| | | public decimal? MaterialWide { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æéé |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æéé")] |
| | | public decimal? MaterialWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åä½")] |
| | | public string Unit { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡å·")] |
| | | public int? TaskNum { get; set; } |
| | | } |
| | | } |
| | |
| | | public decimal OutTotalUsage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¬åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åºæ¬åä½")] |
| | | public string MaterielUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¾
åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "è¾
åä½")] |
| | | public string AssistUnitCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | |
| | | public string ShortName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åç¨çº¸åºå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å·¥åç¨çº¸åºå·")] |
| | | public int Number { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºåç¶æ")] |
| | |
| | | public string MaterialName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨(䏿¸¸) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨(䏿¸¸)")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºåæç»ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºåæç»ç¶æ")] |
| | |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¾
åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "è¾
åä½")] |
| | | public string AssistUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå°ä½ç½® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æºå°ä½ç½®")] |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å å·¥ä¸å¿")] |
| | | public string MakeCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æå¹
宽 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æå¹
宽")] |
| | | public decimal? MaterialWide { get; set; } |
| | | /// <summary> |
| | | /// ç©æéé |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æéé")] |
| | | public decimal? MaterialWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | |
| | | using SqlSugar; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [ImporterHeader(Name = "主é®")] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¡ç ç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ¡ç ç¼å·")] |
| | | [ImporterHeader(Name = "æ¡ç ç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¡ç ç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// RFIDä¿¡æ¯ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "RFIDä¿¡æ¯")] |
| | | [ImporterHeader(Name = "RFIDä¿¡æ¯")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "RFIDä¿¡æ¯")] |
| | | public string RfidCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æçç±»å")] |
| | | [ImporterHeader(Name = "æçç±»å")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å")] |
| | | public int PalletType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "è´§ä½ç¼å·")] |
| | | [ImporterHeader(Name = "è´§ä½ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 30, ColumnDescription = "è´§ä½ç¼å·")] |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä¸»é® |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ä»åºä¸»é®")] |
| | | [ImporterHeader(Name = "ä»åºä¸»é®")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºä¸»é®")] |
| | | public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç»ç» |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºåç»ç»")] |
| | | [ImporterHeader(Name = "åºåç»ç»")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåç»ç»")] |
| | | public int MaterielInvOrgId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºå屿§(å纸,åæ...) |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºå屿§")] |
| | | [ImporterHeader(Name = "åºå屿§")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºå屿§")] |
| | | public int StockAttribute { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç¶æ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºåç¶æ")] |
| | | [ImporterHeader(Name = "åºåç¶æ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåç¶æ")] |
| | | public int StockStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æId |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æId")] |
| | | [ImporterHeader(Name = "ç©æId")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æId")] |
| | | public int MaterielId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æç¼å·")] |
| | | [ImporterHeader(Name = "ç©æç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æåç§°")] |
| | | [ImporterHeader(Name = "ç©æåç§°")] |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æè§æ ¼ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æè§æ ¼")] |
| | | [ImporterHeader(Name = "ç©æè§æ ¼")] |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æè§æ ¼")] |
| | | public string MaterielSpec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ¹æ¬¡å·")] |
| | | [ImporterHeader(Name = "æ¹æ¬¡å·")] |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "订åå·")] |
| | | [ImporterHeader(Name = "订åå·")] |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "订åå·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç©ææ»é¿(m) |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºåç©ææ»é¿")] |
| | | [ImporterHeader(Name = "åºåç©ææ»é¿")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç©ææ»é¿(m)")] |
| | | public decimal StockLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æéé |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æéé")] |
| | | [ImporterHeader(Name = "ç©æéé")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æéé")] |
| | | public decimal? MaterielWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµéé |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ£æµéé")] |
| | | [ImporterHeader(Name = "æ£æµéé")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµéé")] |
| | | public decimal? CheckWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç´å¾/é«åº¦ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æç´å¾")] |
| | | [ImporterHeader(Name = "ç©æç´å¾")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æç´å¾/é«åº¦")] |
| | | public decimal? MaterielThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµç´å¾ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ£æµç´å¾")] |
| | | [ImporterHeader(Name = "æ£æµç´å¾")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµç´å¾")] |
| | | public decimal? CheckThickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä¾§é¢å¹
宽(m) |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æä¾§é¢å¹
宽")] |
| | | [ImporterHeader(Name = "ç©æä¾§é¢å¹
宽")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç©æä¾§é¢å¹
宽(m)")] |
| | | public decimal? MaterielWide { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æµå¹
宽 |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ£æµå¹
宽")] |
| | | [ImporterHeader(Name = "æ£æµå¹
宽")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£æµå¹
宽")] |
| | | public decimal? CheckWide { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºç©ææ°é |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åºåºç©ææ°é")] |
| | | [ImporterHeader(Name = "åºåºç©ææ°é")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºç©ææ°é", DefaultValue = "0")] |
| | | public decimal StockOutLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´å·/æ®å· |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ´å·/æ®å·")] |
| | | [ImporterHeader(Name = "æ´å·/æ®å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ´å·/æ®å·", DefaultValue = "0")] |
| | | public int IsFull { get; set; } |
| | | |
| | |
| | | /// 0 å¦<br/> |
| | | /// 1 æ¯<br/> |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "æ¯å¦é¢æ(1æ¯0å¦)")] |
| | | [ImporterHeader(Name = "æ¯å¦é¢æ(1æ¯0å¦)")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¯å¦é¢æ", DefaultValue = "0")] |
| | | public int IsPick { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åä½")] |
| | | [ImporterHeader(Name = "åä½")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åä½")] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [ImporterHeader(Name = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åæ®ç¼å·")] |
| | | [ExporterHeader(DisplayName = "åæ®ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "åæ®ç¼å·")] |
| | | public string? OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | [ExporterHeader(DisplayName = "ä»»å¡ä¸åæ¶é´")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ä¸åæ¶é´")] |
| | | public DateTime? Dispatchertime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç» |
| | | /// </summary> |
| | |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç»")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç»")] |
| | | public string GroupId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç©æé¿åº¦")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç©æé¿åº¦")] |
| | | public int TaskLength { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | |
| | | [ExporterHeader(DisplayName = "ç©æç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ç¼ç |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å å·¥ä¸å¿ç¼ç ")] |
| | | [ExporterHeader(DisplayName = "å å·¥ä¸å¿ç¼ç ")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "å å·¥ä¸å¿ç¼ç ")] |
| | | public string WorkCentreCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MES计åId")] |
| | | [ExporterHeader(DisplayName = "MES计åId")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "MES计åId")] |
| | | public int DispatchPlanId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ°é |
| | | /// </summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// èååºåºçº¿ä½ç¼åä»å¨å®ç°å± |
| | | /// </summary> |
| | | public class OutLineViewRepository : RepositoryBase<Dt_OutLineView>, IOutLineViewRepository |
| | | { |
| | | public OutLineViewRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | public IOutBSTPickInfoRepository OutBSTPickInfoRepository { get; } |
| | | public IProDeliveryOrderRepository ProDeliveryOrderRepository { get; } |
| | | public IProDeliveryOrderDetailRepository ProDeliveryOrderDetailRepository { get; } |
| | | public OutboundRepository(IOutMESOrderRepository outMESOrderRepository, IOutSGOrderRepository outSGOrderRepository, IOutSGOrderDetailRepository outSGOrderDetailRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutBSTPickInfoRepository outBSTPickInfoRepository, IProDeliveryOrderRepository proDeliveryOrderRepository, IProDeliveryOrderDetailRepository proDeliveryOrderDetailRepository) |
| | | public IOutLineViewRepository OutLineViewRepository { get; } |
| | | public OutboundRepository(IOutMESOrderRepository outMESOrderRepository, IOutSGOrderRepository outSGOrderRepository, IOutSGOrderDetailRepository outSGOrderDetailRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutBSTPickInfoRepository outBSTPickInfoRepository, IProDeliveryOrderRepository proDeliveryOrderRepository, IProDeliveryOrderDetailRepository proDeliveryOrderDetailRepository, IOutLineViewRepository outLineViewRepository) |
| | | { |
| | | OutMESOrderRepository = outMESOrderRepository; |
| | | OutSGOrderRepository = outSGOrderRepository; |
| | |
| | | OutBSTPickInfoRepository = outBSTPickInfoRepository; |
| | | ProDeliveryOrderRepository = proDeliveryOrderRepository; |
| | | ProDeliveryOrderDetailRepository = proDeliveryOrderDetailRepository; |
| | | OutLineViewRepository = outLineViewRepository; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public class OutLineViewService : ServiceBase<Dt_OutLineView, IOutLineViewRepository>, IOutLineViewService |
| | | { |
| | | public IOutLineViewRepository Repository => BaseDal; |
| | | private IBasicRepository _basicRepository; |
| | | private readonly IMapper _mapper; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public OutLineViewService(IOutLineViewRepository BaseDal, IBasicRepository basicRepository, IMapper mapper, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _basicRepository = basicRepository; |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | /// <summary> |
| | | /// è·å线ä½å纸 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetOutLineView() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åæ°æ® |
| | | List<Dt_OutLineView> lineViews = BaseDal.QueryData().OrderBy(x=>x.CreateDate).ToList(); |
| | | int taskCount = BaseDal.Db.Queryable<Dt_Task>().Where(x=>x.TaskType==TaskTypeEnum.OldYLOutbound.ObjToInt() && x.TaskStatus==TaskStatusEnum.Line_Executing.ObjToInt()).Count(); |
| | | content.OK($"{taskCount}", lineViews); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// åå
¥ææ°çåºåºçº¸å·ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="outStockLockInfos"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent SaveLineView(List<Dt_OutStockLockInfo> outStockLockInfos) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åå½åèåç¼åææçº¸å·ä¿¡æ¯ |
| | | List<Dt_OutLineView> outLineViews = BaseDal.QueryData(); |
| | | //è·åå½å纸å·ä¸ªæ° |
| | | int? outLineCount = outLineViews?.Select(x => x.PalletCode).Distinct().Count(); |
| | | if (outLineViews==null || outLineViews.Count<=0 || outLineCount<=2) |
| | | { |
| | | List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | BaseDal.AddData(outLineViewsAdd); |
| | | } |
| | | else |
| | | { |
| | | //è·åææ©ç纸å·ä¿¡æ¯ |
| | | string? code= outLineViews.FirstOrDefault()?.PalletCode; |
| | | List<Dt_OutLineView> outLineViewsDel = outLineViews.Where(x=>x.PalletCode==code).ToList(); |
| | | List<Dt_OutLineView> outLineViewsAdd = outStockLockInfos.Select(x => _mapper.Map<Dt_OutLineView>(x)).ToList(); |
| | | BaseDal.DeleteData(outLineViewsDel); |
| | | BaseDal.AddData(outLineViewsAdd); |
| | | } |
| | | content.OK("æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialNo, item.Width, outBSTOrders.FirstOrDefault().WarehouseId).Where(x=>!outStocks.Select(x=>x.PalletCode).Contains(x.PalletCode)).ToList(); |
| | | if (!stockInfos.Any()) |
| | | { |
| | | throw new Exception($"æªæ¾å°å¯åé
åºå"); |
| | | continue; |
| | | } |
| | | //åé
å®é
åºå |
| | | List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, needQuantity).ToList(); |
| | | List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutOldStocks(stockInfos, needQuantity).ToList(); |
| | | //æ·»å åºååé
|
| | | outStocks.AddRange(autoAssignStocks); |
| | | //è·åææè¯¥ç©æåæ® |
| | |
| | | |
| | | decimal orderDetailNeedQuantity = details[i].XqLen - detailAssignQuantity; |
| | | |
| | | if (autoAssignStocks.Count==0) |
| | | { |
| | | break; |
| | | } |
| | | |
| | | decimal useStockLength = autoAssignStocks[0].StockLength- autoAssignStocks[0].StockOutLength; |
| | | Dt_OutSGOrder? sGOrder = outBSTOrders.FirstOrDefault(x => x.Id == details[i].OutSGOrderId); |
| | | if (orderDetailNeedQuantity > useStockLength) |
| | |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using System.Reflection; |
| | | using System.Text.RegularExpressions; |
| | | using Microsoft.AspNetCore.Http; |
| | | using HslCommunication; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | |
| | | |
| | | public WebResponseContent AddOutSGOrder(List<SGOutOrderDTO> outOrderDTOs) |
| | | { |
| | | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åæææç¨å |
| | | List<Dt_OutSGOrder> outSGOrders = BaseDal.Db.Queryable<Dt_OutSGOrder>().Includes(x => x.Details).ToList(); |
| | | List<Dt_OutSGOrderDetail> outSGOrderDetails= outSGOrders.SelectMany(x=>x.Details).ToList(); |
| | | ////夿忮 |
| | | //Dt_OutSGOrderDetail? ExistAddOutOrderDetail = outSGOrderDetails.FirstOrDefault(x => outOrderDTOs.Select(t => t.BoardMpsDetailId).Distinct().Contains(x.BoardMpsDetailId)); |
| | | //if (ExistAddOutOrderDetail != null) |
| | | //{ |
| | | // return content.Error($"åºåºæç¨æç»{nameof(SGOutOrderDTO.BoardMpsDetailId)}:{ExistAddOutOrderDetail.BoardMpsDetailId}å·²åå¨"); |
| | | //} |
| | | //è·åææç©æ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt() && x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && x.MaterialSourceId != 0); |
| | | SGOutOrderDTO? sGOutOrderDTO = outOrderDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialNo)); |
| | | //SGOutOrderDTO? sGOutOrderDTO = outOrderDTOs.FirstOrDefault(x => materielInfos.FirstOrDefault(t=>t.MaterielCode.StartsWith(x.MaterialNo))==null); |
| | | if (sGOutOrderDTO != null) |
| | | { |
| | | //è·åæææç¨å |
| | | List<Dt_OutSGOrder> outSGOrders = BaseDal.Db.Queryable<Dt_OutSGOrder>().Includes(x => x.Details).ToList(); |
| | | //夿忮 |
| | | Dt_OutSGOrder? ExistAddOutOrder = outSGOrders.FirstOrDefault(x => outOrderDTOs.Select(x => x.OrderId).Distinct().Contains(x.OrderId)); |
| | | if (ExistAddOutOrder != null) |
| | | return content.Error($"ç产æç¨{sGOutOrderDTO.OrderId}ç©æ:{sGOutOrderDTO.MaterialNo}ä¸åå¨"); |
| | | } |
| | | List<Dt_OutSGOrder> AddOutSGOrders = new List<Dt_OutSGOrder>(); |
| | | foreach (var item in outOrderDTOs.OrderBy(x=>x.Number)) |
| | | { |
| | | //è·åå·¥å |
| | | Dt_OutSGOrder? ExistOutSGOrder = AddOutSGOrders.FirstOrDefault(x => x.OrderId == item.OrderId); |
| | | |
| | | //æç»æåè½¬æ¢ |
| | | Dt_OutSGOrderDetail outSGOrderDetail = _mapper.Map<Dt_OutSGOrderDetail>(item); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialNo); |
| | | string code = ExtractFirstPercentContent(outSGOrderDetail.Remark); |
| | | //å¤çç¹æ®æå®æç¨å¤æ |
| | | if (!code.IsNullOrEmpty() && code.StartsWith(outSGOrderDetail.MaterialNo)) |
| | | { |
| | | return content.Error($"åºåºæç¨åå·{nameof(SGOutOrderDTO.OrderId)}:{ExistAddOutOrder.OrderId}å·²åå¨"); |
| | | } |
| | | //è·åææç©æ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt() && x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && x.MaterialSourceId != 0); |
| | | SGOutOrderDTO? sGOutOrderDTO = outOrderDTOs.FirstOrDefault(x => !materielInfos.Select(x => x.MaterielCode).Contains(x.MaterialNo)); |
| | | if (sGOutOrderDTO != null) |
| | | { |
| | | return content.Error($"ç产æç¨{sGOutOrderDTO.OrderId}ç©æ:{sGOutOrderDTO.MaterialNo}ä¸åå¨"); |
| | | } |
| | | List<Dt_OutSGOrder> AddOutSGOrders = new List<Dt_OutSGOrder>(); |
| | | foreach (var item in outOrderDTOs) |
| | | { |
| | | //è·åå·¥å |
| | | Dt_OutSGOrder? ExistOutSGOrder = AddOutSGOrders.FirstOrDefault(x => x.OrderId == item.OrderId); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialNo); |
| | | //æç»æåè½¬æ¢ |
| | | Dt_OutSGOrderDetail outSGOrderDetail = _mapper.Map<Dt_OutSGOrderDetail>(item); |
| | | outSGOrderDetail.MaterialName = materielInfo.MaterielName; |
| | | //夿工忝å¦å·²ç»åå¨ |
| | | if (ExistOutSGOrder != null) |
| | | materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == code); |
| | | if (materielInfo==null) |
| | | { |
| | | ExistOutSGOrder.Details.Add(outSGOrderDetail); |
| | | return content.Error($"ç产æç¨{item.OrderId}æå®æç¨ç©æ:{code}ä¸åå¨"); |
| | | } |
| | | else |
| | | { |
| | | outSGOrderDetail.MaterialNo = code; |
| | | } |
| | | outSGOrderDetail.MaterialName = materielInfo.MaterielName; |
| | | |
| | | //夿工忝å¦å·²ç»åå¨ |
| | | if (ExistOutSGOrder != null) |
| | | { |
| | | ExistOutSGOrder.Details.Add(outSGOrderDetail); |
| | | } |
| | | else |
| | | { |
| | | Dt_OutSGOrder outSGOrder = _mapper.Map<Dt_OutSGOrder>(item); |
| | | outSGOrder.Details = new List<Dt_OutSGOrderDetail>() { outSGOrderDetail }; |
| | | AddOutSGOrders.Add(outSGOrder); |
| | | } |
| | | } |
| | | BaseDal.Db.InsertNav(AddOutSGOrders).Include(x => x.Details).ExecuteCommand(); |
| | | content.OK("æ¥æ¶æç¨æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | public static string ExtractFirstPercentContent(string input) |
| | | { |
| | | if (string.IsNullOrEmpty(input)) |
| | | return null; |
| | | |
| | | Dt_OutSGOrder outSGOrder = _mapper.Map<Dt_OutSGOrder>(item); |
| | | outSGOrder.Details = new List<Dt_OutSGOrderDetail>() { outSGOrderDetail }; |
| | | AddOutSGOrders.Add(outSGOrder); |
| | | } |
| | | } |
| | | BaseDal.Db.InsertNav(AddOutSGOrders).Include(x => x.Details).ExecuteCommand(); |
| | | content.OK("æ¥æ¶æç¨æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | Regex regex = new Regex(@"%(.*?)%"); |
| | | Match match = regex.Match(input); |
| | | |
| | | if (match.Success && match.Groups[1].Success) |
| | | { |
| | | return match.Groups[1].Value.Trim(); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | PalletCode = outStock.PalletCode, |
| | | AssignQuantity = assignQuantity, |
| | | MaterielCode = ouMESOrder.MaterialCode, |
| | | BatchNo = ouMESOrder.MaterialLot, |
| | | BatchNo = outStock.BatchNo, |
| | | LocationCode = outStock.LocationCode, |
| | | MaterielName = outStock.MaterielName, |
| | | OrderDetailId = ouMESOrder.OutDetailId, |
| | | OrderNo = ouMESOrder.OutMESOrderNo, |
| | | MakeCode = ouMESOrder.MakeCode, |
| | | MachineName=ouMESOrder.MakeArea.ToString(), |
| | | OrderType=OutOrderTypeEnum.OutMESPick.ObjToInt(), |
| | | MaterielId = outStock.MaterielId, |
| | | OriginalQuantity = outStock.StockLength, |
| | | Status = taskNum == null ? OutLockStockStatusEnum.å·²åé
.ObjToInt() : OutLockStockStatusEnum.åºåºä¸.ObjToInt(), |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = ouMESOrder.ReqQuantity, |
| | | Unit = outStock.Unit |
| | | Unit = outStock.Unit, |
| | | AssistUnit= ouMESOrder.AssistUnitCode |
| | | }; |
| | | |
| | | return outStockLockInfo; |
| | |
| | | StockId = outStock.Id, |
| | | TaskNum = taskNum, |
| | | OrderQuantity = outSGOrderDetail.XqLen, |
| | | MaterialWeight=outStock.MaterielWeight, |
| | | MaterialWide=outStock.MaterielWide, |
| | | Unit = outStock.Unit, |
| | | MachineName=outSGOrderDetail.MachineName, |
| | | }; |
| | |
| | | /// åºåºè¯¦æ
ä¸å¡æ¥å£å± |
| | | /// </summary> |
| | | public IOutStockLockInfoService OutStockLockInfoService { get; } |
| | | public OutboundService(IOutMESOrderService outMESOrderService, IOutSGOrderService outSGOrderService, IOutSGOrderDetailService outSGOrderDetailService, IOutStockLockInfoService outStockLockInfoService) |
| | | /// <summary> |
| | | /// èå线ä½ç¼åä¸å¡æ¥å£å± |
| | | /// </summary> |
| | | public IOutLineViewService OutLineViewService { get; } |
| | | public OutboundService(IOutMESOrderService outMESOrderService, IOutSGOrderService outSGOrderService, IOutSGOrderDetailService outSGOrderDetailService, IOutStockLockInfoService outStockLockInfoService, IOutLineViewService outLineViewService) |
| | | { |
| | | OutMESOrderService = outMESOrderService; |
| | | OutSGOrderService = outSGOrderService; |
| | | OutSGOrderDetailService = outSGOrderDetailService; |
| | | OutStockLockInfoService = outStockLockInfoService; |
| | | OutLineViewService = outLineViewService; |
| | | } |
| | | } |
| | | } |
| | |
| | | using AutoMapper; |
| | | using MailKit.Search; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Operators; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_External.ERPService; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IRecordRepository; |
| | | using WIDESEA_IRecordService; |
| | |
| | | private readonly IMapper _mapper; |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IInvokeERPService _invokeERPService; |
| | | public IStockInfoRepository Repository => BaseDal; |
| | | |
| | | public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IBasicRepository basicRepository, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IBasicRepository basicRepository, IUnitOfWorkManage unitOfWorkManage,IInvokeERPService invokeERPService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _basicRepository = basicRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _invokeERPService = invokeERPService; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°èåç«åºæ®å·åºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpBSTStock(int operate) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | DateTime dateTime = Convert.ToDateTime("2025-11-01 00:00:00"); |
| | | //è·åææçæ®å·ç«åºåºå |
| | | List<Dt_StockInfo> stockInfos = BaseDal.QueryData(x => x.IsFull == WhetherEnum.True.ObjToInt() && x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.ModifyDate> dateTime); |
| | | if (operate>0) |
| | | { |
| | | //è·åææçèåç¼ååºåºå |
| | | stockInfos = BaseDal.QueryData(x => x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && x.WarehouseId==WarehouseEnum.LLDOldCache.ObjToInt()); |
| | | } |
| | | List<Dt_StockInfo> stockInfosUp = new List<Dt_StockInfo>(); |
| | | List<Dt_StockInfo> stockInfosDel = new List<Dt_StockInfo>(); |
| | | foreach (var item in stockInfos) |
| | | { |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(item.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | content.Message += $"æ¡ç {item.PalletCode}䏿ERPåºåä¸åå¨,"; |
| | | continue; |
| | | } |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{item.PalletCode}çåºåä¿¡æ¯"); |
| | | if (item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter>0) |
| | | { |
| | | item.MaterielThickness = bSTStockInfoDTO.Thick; |
| | | item.MaterielWeight = bSTStockInfoDTO.Qty; |
| | | item.MaterielWide = bSTStockInfoDTO.W; |
| | | item.Remark = $"{item.StockLength}-{bSTStockInfoDTO.StockMeter}"; |
| | | item.StockLength = bSTStockInfoDTO.StockMeter; |
| | | stockInfosUp.Add(item); |
| | | } |
| | | else if(item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter == 0) |
| | | { |
| | | stockInfosDel.Add(item); |
| | | } |
| | | } |
| | | //æ°æ®åºæä½ |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.UpdateData(stockInfosUp); |
| | | if (stockInfosDel.Count>0) |
| | | { |
| | | BaseDal.DeleteAndMoveIntoHty(stockInfosDel, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetUseableStocks(int materielId,decimal width, int warehoseId) |
| | | { |
| | |
| | | } |
| | | return outStocks; |
| | | } |
| | | /// <summary> |
| | | /// åé
èååºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<Dt_StockInfo> GetOutOldStocks(List<Dt_StockInfo> stockInfos, decimal needQuantity) |
| | | { |
| | | List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>(); |
| | | //è·ååºåå¯ç¨æ°é |
| | | decimal stockTotalQuantity = stockInfos.Sum(x => x.StockLength - x.StockOutLength); |
| | | int index = 0; |
| | | while (needQuantity > 0 && (index + 1 <= stockInfos.Count)) |
| | | { |
| | | Dt_StockInfo stockInfo = stockInfos[index]; |
| | | decimal useableStockQuantity = stockInfo.StockLength - stockInfo.StockOutLength; |
| | | if (useableStockQuantity < needQuantity && useableStockQuantity > 0) |
| | | { |
| | | stockInfo.StockOutLength = stockInfo.StockLength; |
| | | needQuantity -= useableStockQuantity; |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockOutLength += needQuantity; |
| | | needQuantity = 0; |
| | | } |
| | | outStocks.Add(stockInfo); |
| | | index++; |
| | | } |
| | | return outStocks; |
| | | } |
| | | } |
| | | } |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_External\WIDESEA_External.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IBasicRepository\WIDESEA_IBasicRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IOutboundRepository\WIDESEA_IOutboundRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordRepository\WIDESEA_IRecordRepository.csproj" /> |
| | |
| | | using WIDESEA_External.Model; |
| | | using System.Text.Json; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using MailKit.Search; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | static object lock_out = new object(); |
| | | static object lock_autoIssue = new object(); |
| | | static object lock_manualIssue = new object(); |
| | | static object lock_returnIssue = new object(); |
| | | /// <summary> |
| | | /// MESèªå¨å«ææ¥å£ |
| | | /// </summary> |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (autoIssueDTO == null) |
| | | lock (lock_autoIssue) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | if (autoIssueDTO == null) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | } |
| | | //è·å对åºåæ® |
| | | Dt_OutMESOrder? outMESOrder = _outboundRepository.OutMESOrderRepository.QueryFirst(x => x.OutDetailId == autoIssueDTO.OutDetailId); |
| | | if (outMESOrder == null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{autoIssueDTO.OutDetailId}ä¸åå¨"); |
| | | } |
| | | if (outMESOrder.OutMESOrderStatus == OutOrderStatusEnum.åºåºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{outMESOrder.ProductOrderNo}å·¥åå·²åºåºå®æ"); |
| | | } |
| | | //è·åå¨è½¬ä½ç½®ç¼å· |
| | | Dt_AGVStationInfo? stationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.MESPointCode == autoIssueDTO.PointCode); |
| | | if (stationInfo == null) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | if (autoIssueDTO.IsEmptyPallet > 0) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}åå¨ç©ºæ"); |
| | | } |
| | | Dt_Task? task = BaseDal.QueryData(x => x.OrderNo == outMESOrder.OutMESOrderNo && x.TaskStatus == TaskStatusEnum.CallPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).FirstOrDefault(); |
| | | //è·åä»»å¡ |
| | | if (task == null) |
| | | { |
| | | return content.Error($"æªæ¾å°é¢æè®¡åç¼å·{outMESOrder.ProductOrderNo}å¯é
éä»»å¡"); |
| | | } |
| | | //è·åä»»å¡åºåºè¯¦æ
|
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundRepository.OutStockLockInfoRepository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | //è°ç¨MESé
éåºåæä»¤ |
| | | PlanDistributionInfo planDistribution = new PlanDistributionInfo() |
| | | { |
| | | DispatchPlanMaterialId = autoIssueDTO.OutDetailId, |
| | | InvItemCode = task.MaterielCode, |
| | | Quantity = outStockLockInfo.AssignQuantity, |
| | | SendOutTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | ArrivalTime = DateTime.Now.AddMinutes(15).ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | MESDispatchModel dispatchModel = new MESDispatchModel() |
| | | { |
| | | PRO_DispachPlanDistributionInfos = new List<PlanDistributionInfo>() { planDistribution } |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = autoIssueDTO.PointCode.StartsWith("YS") ? stationInfo.AGVStationCode : autoIssueDTO.PointCode; |
| | | BaseDal.UpdateData(task); |
| | | MESResponse mESResponse = _invokeMESService.MESDispatchUp(dispatchModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!mESResponse.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(mESResponse.Msg)}"); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | //è·å对åºåæ® |
| | | Dt_OutMESOrder? outMESOrder = _outboundRepository.OutMESOrderRepository.QueryFirst(x=>x.OutDetailId==autoIssueDTO.OutDetailId); |
| | | if (outMESOrder==null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{autoIssueDTO.OutDetailId}ä¸åå¨"); |
| | | } |
| | | if (outMESOrder.OutMESOrderStatus==OutOrderStatusEnum.åºåºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{outMESOrder.ProductOrderNo}å·¥åå·²åºåºå®æ"); |
| | | } |
| | | //è·åå¨è½¬ä½ç½®ç¼å· |
| | | Dt_AGVStationInfo? stationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.MESPointCode==autoIssueDTO.PointCode); |
| | | if (stationInfo == null) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | if (autoIssueDTO.IsEmptyPallet>0) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}åå¨ç©ºæ"); |
| | | } |
| | | Dt_Task? task = BaseDal.QueryData(x => x.OrderNo == outMESOrder.OutMESOrderNo && x.TaskStatus == TaskStatusEnum.CallPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).FirstOrDefault(); |
| | | //è·åä»»å¡ |
| | | if (task == null) |
| | | { |
| | | return content.Error($"æªæ¾å°é¢æè®¡åç¼å·{outMESOrder.ProductOrderNo}å¯é
éä»»å¡"); |
| | | } |
| | | //è·åä»»å¡åºåºè¯¦æ
|
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundRepository.OutStockLockInfoRepository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | //è°ç¨MESé
éåºåæä»¤ |
| | | PlanDistributionInfo planDistribution = new PlanDistributionInfo() |
| | | { |
| | | DispatchPlanMaterialId = autoIssueDTO.OutDetailId, |
| | | InvItemCode = task.MaterielCode, |
| | | Quantity = outStockLockInfo.AssignQuantity, |
| | | SendOutTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), |
| | | ArrivalTime = DateTime.Now.AddMinutes(10).ToString("yyyy-MM-dd hh:mm:ss") |
| | | }; |
| | | MESDispatchModel dispatchModel= new MESDispatchModel() |
| | | { |
| | | PRO_DispachPlanDistributionInfos=new List<PlanDistributionInfo> (){ planDistribution } |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = stationInfo.AGVStationCode; |
| | | BaseDal.UpdateData(task); |
| | | MESResponse mESResponse = _invokeMESService.MESDispatchUp(dispatchModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!mESResponse.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(mESResponse.Msg)}"); |
| | | } |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (manualIssueDTO == null) |
| | | lock (lock_manualIssue) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | if (manualIssueDTO == null) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | } |
| | | //è·å对åºåæ® |
| | | Dt_OutMESOrder? outMESOrder = _outboundRepository.OutMESOrderRepository.QueryFirst(x => x.OutDetailId == manualIssueDTO.OutDetailId); |
| | | if (outMESOrder == null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{manualIssueDTO.OutDetailId}ä¸åå¨"); |
| | | } |
| | | if (outMESOrder.OutMESOrderStatus == OutOrderStatusEnum.å
³é.ObjToInt()) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{outMESOrder.ProductOrderNo}å·¥åå·²å
³é"); |
| | | } |
| | | //è·åå¨è½¬ä½ç½®ç¼å· |
| | | Dt_AGVStationInfo? stationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.MESPointCode == manualIssueDTO.PointCode); |
| | | if (stationInfo == null) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{manualIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | Dt_Task? task = BaseDal.QueryData(x => x.OrderNo == outMESOrder.OutMESOrderNo && x.TaskStatus == TaskStatusEnum.CallPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).FirstOrDefault(); |
| | | //è·åä»»å¡ |
| | | if (task == null) |
| | | { |
| | | return content.Error($"æªæ¾å°é¢æè®¡åç¼å·{outMESOrder.ProductOrderNo}å¯é
éä»»å¡"); |
| | | } |
| | | //è·åä»»å¡åºåºè¯¦æ
|
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundRepository.OutStockLockInfoRepository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | //è°ç¨MESé
éåºåæä»¤ |
| | | PlanDistributionInfo planDistribution = new PlanDistributionInfo() |
| | | { |
| | | DispatchPlanMaterialId = manualIssueDTO.OutDetailId, |
| | | InvItemCode = task.MaterielCode, |
| | | Quantity = outStockLockInfo.AssignQuantity, |
| | | SendOutTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | ArrivalTime = DateTime.Now.AddMinutes(15).ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | MESDispatchModel dispatchModel = new MESDispatchModel() |
| | | { |
| | | PRO_DispachPlanDistributionInfos = new List<PlanDistributionInfo>() { planDistribution } |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = manualIssueDTO.PointCode.StartsWith("YS") ? stationInfo.AGVStationCode : manualIssueDTO.PointCode; |
| | | BaseDal.UpdateData(task); |
| | | MESResponse mESResponse = _invokeMESService.MESDispatchUp(dispatchModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!mESResponse.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(mESResponse.Msg)}"); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | //è·å对åºåæ® |
| | | Dt_OutMESOrder? outMESOrder = _outboundRepository.OutMESOrderRepository.QueryFirst(x => x.OutDetailId == manualIssueDTO.OutDetailId); |
| | | if (outMESOrder == null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{manualIssueDTO.OutDetailId}ä¸åå¨"); |
| | | } |
| | | if (outMESOrder.OutMESOrderStatus == OutOrderStatusEnum.å
³é.ObjToInt()) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{outMESOrder.ProductOrderNo}å·¥åå·²å
³é"); |
| | | } |
| | | //è·åå¨è½¬ä½ç½®ç¼å· |
| | | Dt_AGVStationInfo? stationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.MESPointCode == manualIssueDTO.PointCode); |
| | | if (stationInfo == null) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{manualIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | Dt_Task? task = BaseDal.QueryData(x => x.OrderNo == outMESOrder.OutMESOrderNo && x.TaskStatus == TaskStatusEnum.CallPending.ObjToInt()).OrderByDescending(x => x.Grade).ThenBy(x => x.TaskNum).FirstOrDefault(); |
| | | //è·åä»»å¡ |
| | | if (task == null) |
| | | { |
| | | return content.Error($"æªæ¾å°é¢æè®¡åç¼å·{outMESOrder.ProductOrderNo}å¯é
éä»»å¡"); |
| | | } |
| | | //è·åä»»å¡åºåºè¯¦æ
|
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundRepository.OutStockLockInfoRepository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | //è°ç¨MESé
éåºåæä»¤ |
| | | PlanDistributionInfo planDistribution = new PlanDistributionInfo() |
| | | { |
| | | DispatchPlanMaterialId = manualIssueDTO.OutDetailId, |
| | | InvItemCode = task.MaterielCode, |
| | | Quantity = outStockLockInfo.AssignQuantity, |
| | | SendOutTime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), |
| | | ArrivalTime = DateTime.Now.AddMinutes(10).ToString("yyyy-MM-dd hh:mm:ss") |
| | | }; |
| | | MESDispatchModel dispatchModel = new MESDispatchModel() |
| | | { |
| | | PRO_DispachPlanDistributionInfos = new List<PlanDistributionInfo>() { planDistribution } |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = stationInfo.AGVStationCode; |
| | | BaseDal.UpdateData(task); |
| | | MESResponse mESResponse = _invokeMESService.MESDispatchUp(dispatchModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!mESResponse.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(mESResponse.Msg)}"); |
| | | } |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MES空æ/使å¼å«æ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReceiveReturnIssue(List<MESReturnIssueDTO> returnIssueDTOs) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (returnIssueDTOs==null || returnIssueDTOs.Count<=0) |
| | | lock (lock_returnIssue) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | if (returnIssueDTOs == null || returnIssueDTOs.Count <= 0) |
| | | { |
| | | return content.Error("ä¼ å
¥ä¿¡æ¯ä¸è½ä¸ºç©º"); |
| | | } |
| | | //è·åææAGVç¹ä½ |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _basicRepository.AGVStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | MESReturnIssueDTO? returnIssueDTO = returnIssueDTOs.FirstOrDefault(x => !aGVStationInfos.Select(x => x.MESPointCode).Contains(x.PointCode)); |
| | | if (returnIssueDTO != null) |
| | | { |
| | | return content.Error($"å¨è½¬ä½{nameof(MESReturnIssueDTO.PointCode)}{returnIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | //è·åææåºå |
| | | List<Dt_StockInfo> stockInfosOld = _stockRepository.StockInfoRepository.QueryData(); |
| | | ////空æ |
| | | //foreach (var item in returnIssueDTOs.Where(x=>x.ReturnMaterial==null)) |
| | | //{ |
| | | |
| | | //} |
| | | //éæ |
| | | List<Dt_StockInfo> stockInfos=new List<Dt_StockInfo>(); |
| | | List<Dt_Task> tasksNew = new List<Dt_Task>(); |
| | | foreach (var item in returnIssueDTOs.Where(x => x.ReturnMaterial != null)) |
| | | { |
| | | MESReturnMaterial? returnMaterial = item.ReturnMaterial; |
| | | if (returnMaterial.BarCode.IsNullOrEmpty()) |
| | | { |
| | | return content.Error($"éæä¼ å
¥æ¡ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | Dt_AGVStationInfo aGVStationInfo = aGVStationInfos.FirstOrDefault(x => x.MESPointCode == item.PointCode); |
| | | Dt_MaterielInfo? materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == returnMaterial.MaterialCode); |
| | | if (materielInfo == null) |
| | | { |
| | | return content.Error($"æªæ¾å°æ¡ç {returnMaterial.BarCode}ç©æä¿¡æ¯"); |
| | | } |
| | | //夿 |
| | | if (returnMaterial.Thickness <= 0 && materielInfo.WarehouseId==WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | return content.Error($"ç©æ{returnMaterial.MaterialCode}æ¡ç {returnMaterial.BarCode}ç´å¾ä¸è½å°äº0"); |
| | | } |
| | | if (returnMaterial.Wide <= 0 && materielInfo.WarehouseId == WarehouseEnum.LLDYL.ObjToInt()) |
| | | { |
| | | return content.Error($"ç©æ{returnMaterial.MaterialCode}æ¡ç {returnMaterial.BarCode}ç´å¾ä¸è½å°äº0"); |
| | | } |
| | | Dt_StockInfo? stockInfoOld = stockInfosOld.FirstOrDefault(x => x.PalletCode == returnMaterial.BarCode); |
| | | if (stockInfoOld != null) |
| | | { |
| | | return content.Error($"æ¡ç {returnMaterial.BarCode}ä¿¡æ¯å·²åå¨"); |
| | | } |
| | | //çæåºåç»çä¿¡æ¯ |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | MaterielInvOrgId = materielInfo.MaterielInvOrgId, |
| | | PalletCode = returnMaterial.BarCode, |
| | | LocationCode = "", |
| | | PalletType = 1, |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockAttribute = materielInfo.MaterielSourceType, |
| | | StockStatus = StockStatusEmun.MES使éåº.ObjToInt(), |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | BatchNo = returnMaterial.MaterialLot, |
| | | Unit = materielInfo.MaterielUnit, |
| | | MaterielThickness = returnMaterial.Thickness, |
| | | MaterielWide = returnMaterial.Wide, |
| | | MaterielWeight = returnMaterial.Weight, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | StockLength = returnMaterial.ReturnQuantity, |
| | | OrderNo = returnMaterial.ReturnOrderNo, |
| | | MaterielName = materielInfo.MaterielName, |
| | | IsFull = WhetherEnum.True.ObjToInt(), |
| | | IsPick = returnMaterial.Whether == 0 ? WhetherEnum.True.ObjToInt() : WhetherEnum.False.ObjToInt(), |
| | | Remark = StockStatusEmun.MES使éåº.ToString() |
| | | }; |
| | | if (stockInfo.MaterielWide > 1200) |
| | | { |
| | | stockInfo.PalletType = 2; |
| | | } |
| | | stockInfos.Add(stockInfo); |
| | | //çæä½æéæä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = item.PointCode.StartsWith("YS") ? aGVStationInfo.AGVStationCode : item.PointCode, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = stockInfo.PalletCode, |
| | | Roadway = "", |
| | | SourceAddress = item.PointCode.StartsWith("YS") ? aGVStationInfo.AGVStationCode : item.PointCode, |
| | | TargetAddress = "", |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | MaterielCode=stockInfo.MaterielCode, |
| | | Quantity=stockInfo.StockLength, |
| | | OrderNo=stockInfo.OrderNo, |
| | | TaskLength = (int)stockInfo.MaterielWide, |
| | | GroupId= item.IssueId, |
| | | WorkCentreCode=item.MakeCode |
| | | }; |
| | | TaskTypeEnum taskTypeEnum = aGVStationInfo.StationArea switch |
| | | { |
| | | nameof(StationAreaEnum.䏿¥¼å°å·) => TaskTypeEnum.PrintYLBackInbound, |
| | | _ => throw new Exception("æªæ¾å°å¯¹åºä»»å¡") |
| | | }; |
| | | newTask.TaskType = taskTypeEnum.ObjToInt(); |
| | | tasksNew.Add(newTask); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.AddData(tasksNew); |
| | | _stockRepository.StockInfoRepository.AddData(stockInfos); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(tasksNew); |
| | | content.OK("å¼å«æå"); |
| | | } |
| | | //è·åææAGVç¹ä½ |
| | | List<Dt_AGVStationInfo> aGVStationInfos= _basicRepository.AGVStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode)); |
| | | MESReturnIssueDTO? returnIssueDTO = returnIssueDTOs.FirstOrDefault(x=> !aGVStationInfos.Select(x=>x.MESPointCode).Contains(x.PointCode)); |
| | | if (returnIssueDTO != null) |
| | | { |
| | | return content.Error($"å¨è½¬ä½{nameof(MESReturnIssueDTO.PointCode)}{returnIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | content.OK("å¼å«æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | TaskLength = (int)stockInfo.MaterielWide |
| | | TaskLength = (int)stockInfo.MaterielWide, |
| | | MaterielCode=stockInfo.MaterielCode, |
| | | Quantity=stockInfo.StockLength |
| | | }; |
| | | //æ´æ°ç¶æ |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.åºåºå®æ.ObjToInt() && stockInfoOld.IsPick==WhetherEnum.False.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | { |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | decimal oldQty = stockInfoOld.StockLength; |
| | | //è°ç¨æ´æ°éæåºå |
| | | stockInfoOld = ReturnStockUp(stockInfoOld, thickness); |
| | | //æ´æ°æ°æ® |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"èåæªé¢æéåº{stockInfoOld.RfidCode}"); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoOld, oldQty, oldQty < stockInfoOld.StockLength ? stockInfoOld.StockLength - oldQty : oldQty - stockInfoOld.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK($"èåæªé¢æéåºRFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.èåéææå.ObjToInt() && stationCode.IsNotEmptyOrNull()) |
| | | { |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | decimal oldQty = stockInfoOld.StockLength; |
| | | //è°ç¨æ´æ°éæåºå |
| | | stockInfoOld = ReturnStockUp(stockInfoOld, thickness); |
| | | //æ´æ°æ°æ® |
| | | UpdateStock(stockInfoOld, weight, thickness, wide); |
| | | return content.OK($"èå颿éåº{stockInfoOld.RfidCode}"); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoOld, oldQty, oldQty < stockInfoOld.StockLength ? stockInfoOld.StockLength- oldQty: oldQty- stockInfoOld.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK($"èå颿éåºRFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null) |
| | | { |
| | |
| | | UpdateStock(ExistStockInfo, weight, thickness, wide); |
| | | _inboundRepository.YLInboundCacheRepository.UpdateData(yLInboundCache); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK($"éè´å
¥åº{ExistStockInfo.RfidCode}"); |
| | | return content.OK($"éè´å
¥åºRFID{ExistStockInfo.RfidCode}ç»å®{ExistStockInfo.PalletCode}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°éæåºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dt_StockInfo ReturnStockUp(Dt_StockInfo stockInfoOld,decimal thickness) |
| | | { |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(stockInfoOld.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {stockInfoOld.PalletCode}䏿ERPåºåä¸åå¨"); |
| | | } |
| | | |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{stockInfoOld.PalletCode}çåºåä¿¡æ¯"); |
| | | if (stockInfoOld.StockStatus == StockStatusEmun.èåéææå.ObjToInt()) |
| | | { |
| | | stockInfoOld.IsPick = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | stockInfoOld.StockStatus = StockStatusEmun.èåéåº.ObjToInt(); |
| | | stockInfoOld.MaterielThickness = bSTStockInfoDTO.Thick; |
| | | stockInfoOld.MaterielWeight = bSTStockInfoDTO.Qty; |
| | | stockInfoOld.MaterielWide = bSTStockInfoDTO.W; |
| | | stockInfoOld.StockLength = bSTStockInfoDTO.StockMeter; |
| | | stockInfoOld.IsFull = WhetherEnum.True.ObjToInt(); |
| | | stockInfoOld.StockOutLength = 0; |
| | | stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt(); |
| | | if (thickness < 800) |
| | | { |
| | | throw new Exception($"RFID{stockInfoOld.RfidCode}æ¡ç {stockInfoOld.PalletCode}ç´å¾å°äº800mm"); |
| | | } |
| | | return stockInfoOld; |
| | | } |
| | | public void UpdateStock(Dt_StockInfo stockInfo, decimal weight = 0, decimal thickness = 0, decimal wide = 0) |
| | | { |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | Dt_StockInfo stockInfoAdd = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == stockInfo.PalletCode); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoAdd, 0, stockInfoAdd.StockLength, StockChangeTypeEnum.MaterielGroup); |
| | | return content.OK("æå", yLInboundCache); |
| | | } |
| | |
| | | if (stockInfo.MaterielThickness >= 300 && stockInfo.MaterielThickness <= 1300 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2700) |
| | | { |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt(): x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt(): x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | | } |
| | |
| | | else |
| | | { |
| | | //éå¶ |
| | | if (stockInfo.MaterielThickness >= 800 && stockInfo.MaterielThickness <= 1500 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) |
| | | if ((stockInfo.MaterielThickness >= 800 || (stockInfo.CheckThickness >= 800 && stockInfo.StockStatus==StockStatusEmun.èåéåº.ObjToInt())) && stockInfo.MaterielThickness <= 1500 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) |
| | | { |
| | | bool LayerLimit = false; |
| | | if (stockInfo.MaterielThickness>1300) |
| | |
| | | LayerLimit = true; |
| | | } |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | if (stockInfo.MaterielWide > 2200) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); |
| | | } |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.MaterielGroup); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.Inbound); |
| | | } |
| | | else |
| | | { |
| | |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //è®°å½åºååå¨ |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum); |
| | | //䏿¥èåERP |
| | | if (stockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && task.TaskType==TaskTypeEnum.Inbound.ObjToInt()) |
| | | if (stockInfo.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && task.TaskType == TaskTypeEnum.Inbound.ObjToInt()) |
| | | { |
| | | int Qty = Convert.ToInt32(stockInfo.MaterielWeight); |
| | | BSTPurchaseUpModel bSTPurchaseUpModel = new BSTPurchaseUpModel() |
| | |
| | | RfidUpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | BSTResponse<object> bSTResponse = _invokeERPService.BSTPurchaseUp(bSTPurchaseUpModel).DeserializeObject<BSTResponse<object>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"BST䏿ERP忥å
¥åºä¿¡æ¯å¤±è´¥,é误信æ¯ï¼{bSTResponse.Msg}"); |
| | | } |
| | | content.Message = bSTResponse.Msg; |
| | | content.Message = bSTResponse?.Msg; |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.StockLength, 0, StockChangeTypeEnum.Inbound,taskNum:task.TaskNum); |
| | | } |
| | | return content.OK(); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·å主å |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.OrderType == orderType).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | if (inboundOrder == null) |
| | | InOrderTypeEnum inOrderTypeEnum = (InOrderTypeEnum)orderType; |
| | | if (inOrderTypeEnum == InOrderTypeEnum.InventoryIn) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BarCode == bindCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.UpperOrderNo}æ¡ç {bindCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.OrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {bindCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == startPoint); |
| | | if (agvstation == null) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.AGV_Executing.ObjToInt())); |
| | | if (taskOldPoint != null) |
| | | { |
| | | return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | } |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x =>x.WarehouseId==inboundOrder.WarehouseId && x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail() |
| | | { |
| | | ProductCode = materielInfo.MaterielCode, |
| | | ProductNo=bindCode, |
| | | ProductName = materielInfo.MaterielName, |
| | | ProductSpec = materielInfo.MaterielSpec, |
| | | LotNumber = inboundOrderDetail.MaterialLot, |
| | | ProductUnit = materielInfo.MaterielUnit, |
| | | StockQty = inboundOrderDetail.OrderQuantity, |
| | | ProStockDetailStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() |
| | | }; |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | //è·å主å |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | PalletType = 1, |
| | | Remark="åæå
¥åº" |
| | | }; |
| | | inboundOrderDetail.OrderDetailStatus=InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrder.InboundOrderStatus==InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.InboundOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | if (inboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BarCode == bindCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.UpperOrderNo}æ¡ç {bindCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.OrderDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {bindCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == startPoint); |
| | | if (agvstation == null) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.AGV_Executing.ObjToInt())); |
| | | if (taskOldPoint != null) |
| | | { |
| | | return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | } |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId && x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail() |
| | | { |
| | | ProductCode = materielInfo.MaterielCode, |
| | | ProductNo = bindCode, |
| | | ProductName = materielInfo.MaterielName, |
| | | ProductSpec = materielInfo.MaterielSpec, |
| | | LotNumber = inboundOrderDetail.MaterialLot, |
| | | ProductUnit = materielInfo.MaterielUnit, |
| | | StockQty = inboundOrderDetail.OrderQuantity, |
| | | ProStockDetailStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() |
| | | }; |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProInOrderNo = inboundOrder.UpperOrderNo, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | //çæä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | OrderNo = inboundOrder.UpperOrderNo, |
| | | MaterielCode = inboundOrderDetail.MaterialCode, |
| | | Quantity = inboundOrderDetail.OrderQuantity, |
| | | PalletType = 1 |
| | | }; |
| | | inboundOrderDetail.OrderDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrder.InboundOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.InboundOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | } |
| | | _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | else if (inOrderTypeEnum == InOrderTypeEnum.PurchaseIn) |
| | | { |
| | | //è·å主å |
| | | Dt_PurchaseOrder inboundOrder = BaseDal.Db.Queryable<Dt_PurchaseOrder>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.BarCode == bindCode)).First(); |
| | | |
| | | if (inboundOrder == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {bindCode}éè´å
¥åºåæ®ä¿¡æ¯"); |
| | | } |
| | | Dt_PurchaseOrderDetail inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BarCode == bindCode); |
| | | if (inboundOrderDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å
¥åºåå·ä¸º{inboundOrder.PurchaseOrderNo}æ¡ç {bindCode}åæ®ä¿¡æ¯"); |
| | | } |
| | | if (inboundOrderDetail.PurchaseDetailStatus != InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | throw new Exception($"æ¡ç {bindCode}ä¿¡æ¯å·²å
¥åºæå
¥åºä¸"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.AGVStationCode == startPoint); |
| | | if (agvstation == null) |
| | | { |
| | | return content.Error($"èµ·ç¹é误{startPoint}"); |
| | | } |
| | | //夿å½åç¹ä½æ¯å¦éå¤ |
| | | Dt_Task taskOldPoint = BaseDal.QueryFirst(x => x.SourceAddress == startPoint && (x.TaskStatus == TaskStatusEnum.New.ObjToInt() || x.TaskStatus == TaskStatusEnum.AGV_Executing.ObjToInt())); |
| | | if (taskOldPoint != null) |
| | | { |
| | | return content.Error($"ç«ç¹{startPoint}å·²åå¨ä»»å¡"); |
| | | } |
| | | Dt_Task taskOld = BaseDal.QueryFirst(x => x.PalletCode == barCode); |
| | | if (taskOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}ä»»å¡å·²åå¨"); |
| | | } |
| | | Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == barCode); |
| | | if (proStockInfoOld != null) |
| | | { |
| | | return content.Error($"æç{barCode}å·²åå¨"); |
| | | } |
| | | //åé
å··é |
| | | string roadWay = AssignCPRoadwayNo(); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId && x.MaterielCode == inboundOrderDetail.MaterialCode); |
| | | Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail() |
| | | { |
| | | ProductCode = materielInfo.MaterielCode, |
| | | ProductNo = bindCode, |
| | | ProductName = materielInfo.MaterielName, |
| | | ProductSpec = materielInfo.MaterielSpec, |
| | | LotNumber = inboundOrderDetail.MaterialLot, |
| | | ProductUnit = materielInfo.MaterielUnit, |
| | | StockQty = inboundOrderDetail.PurchaseDetailQuantity, |
| | | ProStockDetailStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt() |
| | | }; |
| | | Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo() |
| | | { |
| | | PalletCode = barCode, |
| | | ProInOrderNo = inboundOrder.PurchaseOrderNo, |
| | | ProStockAttribute = materielInfo.MaterielSourceType, |
| | | PalletType = 1, |
| | | LocationCode = "", |
| | | WarehouseId = materielInfo.WarehouseId, |
| | | StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(), |
| | | proStockInfoDetails = new List<Dt_ProStockInfoDetail> { proStockInfoDetail } |
| | | }; |
| | | //çæä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = barCode, |
| | | Roadway = roadWay, |
| | | SourceAddress = startPoint, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | OrderNo = inboundOrder.PurchaseOrderNo, |
| | | MaterielCode=inboundOrderDetail.MaterialCode, |
| | | Quantity=inboundOrderDetail.PurchaseDetailQuantity, |
| | | PalletType = 1 |
| | | }; |
| | | inboundOrderDetail.PurchaseDetailStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (inboundOrder.PurchaseOrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) |
| | | { |
| | | inboundOrder.PurchaseOrderStatus = InOrderStatusEnum.å
¥åºä¸.ObjToInt(); |
| | | _inboundRepository.PurchaseOrderRepository.UpdateData(inboundOrder); |
| | | } |
| | | _inboundRepository.PurchaseOrderDetailRepository.UpdateData(inboundOrderDetail); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand(); |
| | | newTask.TaskId = taskId; |
| | | _unitOfWorkManage.CommitTran(); |
| | | //æ¨éä»»å¡ |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }, "AGV"); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºåæ®ç±»å"); |
| | | } |
| | | |
| | | content.OK("åéæå"); |
| | | |
| | | } |
| | |
| | | return content.Error($"å¨è½¬ä½{nameof(MESReturnIssueDTO.PointCode)}{item?.PointCode}ä¸åå¨,ä»
æåç©æå¯ä¸ä¼ "); |
| | | } |
| | | } |
| | | if (materielInfo.MaterielSourceType == MaterielTypeEnum.æå.ObjToInt() && (item.Length <= 0 || item.Width <= 0 || item.Height<=0)) |
| | | { |
| | | return content.Error($"ç®±ç {item.ProPackCode}ï¼é¿åº¦/宽度/é«åº¦ä¸è½ä¸º0"); |
| | | } |
| | | Dt_MESProInOrderInfo AddproInOrderInfo = _mapper.Map<Dt_MESProInOrderInfo>(item); |
| | | AddproInOrderInfo.WarehouseId = materielInfo.WarehouseId; |
| | | AddproInOrderInfo.MESProOrderType = materielInfo.MaterielSourceType; |
| | |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Outbound; |
| | | using Microsoft.IdentityModel.Tokens; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | proStockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockRepository.ProStockInfoRepository.DeleteAndMoveIntoHty(proStockInfo,App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _stockRepository.ProStockInfoRepository.DeleteAndMoveIntoHty(proStockInfo,App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | if (proStockInfo.proStockInfoDetails!=null && proStockInfo.proStockInfoDetails.Count>0) |
| | | { |
| | | _stockRepository.ProStockInfoDetailRepository.DeleteAndMoveIntoHty(proStockInfo.proStockInfoDetails, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _stockRepository.ProStockInfoDetailRepository.DeleteAndMoveIntoHty(proStockInfo.proStockInfoDetails, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | } |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | } |
| | | if (outStockLockInfos!=null && outStockLockInfos.Count>0) |
| | | { |
| | |
| | | x.Status=OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | }); |
| | | _outboundRepository.OutStockLockInfoRepository.UpdateData(outStockLockInfos); |
| | | List<Dt_OutStockLockInfo> outStockLockInfosSG = outStockLockInfos.Where(x => x.OrderType == OutOrderTypeEnum.OutSGPick.ObjToInt()).ToList(); |
| | | List<Dt_OutStockLockInfo> outStockLockInfosMES = outStockLockInfos.Where(x => x.OrderType == OutOrderTypeEnum.OutMESPick.ObjToInt()).ToList(); |
| | | if (outStockLockInfosSG !=null && outStockLockInfosSG.Count()>0) |
| | | { |
| | | _outboundService.OutLineViewService.SaveLineView(outStockLockInfosSG); |
| | | } |
| | | if (outStockLockInfosMES != null && outStockLockInfosMES.Count() > 0) |
| | | { |
| | | Dt_AGVStationInfo aGVStationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.AGVStationCode==task.TargetAddress); |
| | | MESDeliveryModel mESDeliveryModel = MESDeliveryUp(outStockLockInfosMES, aGVStationInfo.MESPointCode); |
| | | MESResponse response = _invokeMESService.MESDelivery(mESDeliveryModel).DeserializeObject<MESResponse>() ?? throw new Exception("æªè·åå°è¿åä¿¡æ¯"); |
| | | if (!response.Result) |
| | | { |
| | | throw new Exception($"MESé
éåºåæ¥å£è°ç¨æ¥é,MESè¿åä¿¡æ¯{DecodeUnicode(response.Msg)}"); |
| | | } |
| | | } |
| | | } |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// é
ééè¾¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public MESDeliveryModel MESDeliveryUp(List<Dt_OutStockLockInfo> outStockLockInfos,string address) |
| | | { |
| | | MESDeliveryModel mESDeliveryModel = new MESDeliveryModel() |
| | | { |
| | | PRO_DispatchPlanMaterialsInfoNew= new List<MESDeliveryInfo>() |
| | | }; |
| | | foreach (var item in outStockLockInfos) |
| | | { |
| | | MESDeliveryInfo mESDeliveryInfo = new MESDeliveryInfo() |
| | | { |
| | | InvItemCode=item.MaterielCode, |
| | | DispatchPlanMaterialId=item.OrderDetailId, |
| | | UnitCode=item.Unit, |
| | | GradeCode="001", |
| | | MainQuantity=item.AssignQuantity, |
| | | AssistUnitCode=item.AssistUnit, |
| | | LocationCode= address, |
| | | LotNumber=item.BatchNo, |
| | | MaterialBarCode=item.PalletCode |
| | | }; |
| | | mESDeliveryModel.PRO_DispatchPlanMaterialsInfoNew.Add(mESDeliveryInfo); |
| | | } |
| | | return mESDeliveryModel; |
| | | } |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡(åæ/åæå) |
| | |
| | | /// </summary> |
| | | /// <param name="stockInfos"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos,List<Dt_OutStockLockInfo> outStockLockInfos, TaskTypeEnum taskType) |
| | | public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos,List<Dt_OutStockLockInfo> outStockLockInfos, TaskTypeEnum taskType=new TaskTypeEnum()) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | for (int i = 0; i < stockInfos.Count; i++) |
| | |
| | | MaterielCode = stockInfo.MaterielCode, |
| | | RfidCode = stockInfo.RfidCode, |
| | | Quantity = stockInfo.StockLength, |
| | | OrderNo= outStockLockInfo.OrderNo |
| | | OrderNo= outStockLockInfo.OrderNo, |
| | | DispatchPlanId=outStockLockInfo.OrderDetailId, |
| | | WorkCentreCode=outStockLockInfo.MakeCode |
| | | }; |
| | | if (stockInfo.MaterielWide > 0) |
| | | { |
| | |
| | | { |
| | | //è·åä»»å¡ |
| | | tasks = GetTasks(result.Item1, TaskTypeEnum.OldYLOutbound); |
| | | |
| | | result.Item2.ForEach(x => |
| | | { |
| | | x.OutSGOrderDetailStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | if (result.Item3.FirstOrDefault(t=>t.OrderDetailId==x.Id)!=null) |
| | | { |
| | | x.OutSGOrderDetailStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | } |
| | | }); |
| | | result.Item3.ForEach(x => |
| | | { |
| | |
| | | { |
| | | tasks.ForEach(x => |
| | | { |
| | | string orderNos = string.Join(",", outStockLockInfos.Where(x => x.PalletCode == x.PalletCode).Select(x => x.OrderNo).Distinct()); |
| | | string orderNos = string.Join(",", outStockLockInfos.Where(t => t.PalletCode == x.PalletCode).Select(x => x.OrderNo).Distinct()); |
| | | x.OrderNo = orderNos; |
| | | }); |
| | | } |
| | |
| | | { |
| | | x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | }); |
| | | outboundOrderDetails.ForEach(x => |
| | | { |
| | | x.OutSGOrderDetailStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | }); |
| | | List<Dt_OutSGOrder> outSGOrders = _outboundRepository.OutSGOrderRepository.QueryData(x => outboundOrderDetails.Select(x=>x.OutSGOrderId).Distinct().Contains(x.Id)); |
| | | List<Dt_OutSGOrder> outSGOrders = _outboundRepository.OutSGOrderRepository.QueryData(x => outStockLockInfos.Select(x=>x.OrderNo).Distinct().Contains(x.OrderId)); |
| | | if (outSGOrders.Count<=0) |
| | | { |
| | | throw new Exception("æªæ¾å°åæ®ä¿¡æ¯"); |
| | |
| | | /// </summary> |
| | | /// <param name="bSTPickInfoDTO"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReceivePicking(BSTPickInfoDTO bSTPickInfoDTO) |
| | | public WebResponseContent ReceivePicking(List<BSTPickInfoDTO> bSTPickInfoDTOs) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //æ°å¢ |
| | | List<BSTPickInfoDTO> bSTPickInfosAdd = bSTPickInfoDTOs.Where(x => x.Way == 1).ToList(); |
| | | //è·åæ°å¢æç»é¢æ |
| | | List<PaperMattakeDetailItem>? paperMattakeDetailItemsAdd = null; |
| | | //ä¿®æ¹ |
| | | List<BSTPickInfoDTO> bSTPickInfosUp = bSTPickInfoDTOs.Where(x => x.Way == 2).ToList(); |
| | | //è·åæ°å¢æç»é¢æ |
| | | List<PaperMattakeDetailItem>? paperMattakeDetailItemsUp = null; |
| | | if (bSTPickInfosAdd != null && bSTPickInfosAdd.Count > 0) |
| | | { |
| | | paperMattakeDetailItemsAdd = bSTPickInfosAdd.SelectMany(x => x.PaperMattakeDetails).ToList(); |
| | | } |
| | | if (bSTPickInfosUp != null && bSTPickInfosUp.Count > 0) |
| | | { |
| | | paperMattakeDetailItemsUp = bSTPickInfosUp.SelectMany(x => x.PaperMattakeDetails).ToList(); |
| | | } |
| | | //è·åææå¾
颿çåºåºè¯¦æ
|
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outboundRepository.OutStockLockInfoRepository.QueryData(x=>x.OrderType==OutOrderTypeEnum.OutSGPick.ObjToInt()); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outboundRepository.OutStockLockInfoRepository.QueryData(x => x.OrderType == OutOrderTypeEnum.OutSGPick.ObjToInt() && x.Status==OutLockStockStatusEnum.åºåºå®æ.ObjToInt()); |
| | | #region 颿é»è¾ |
| | | if (paperMattakeDetailItemsAdd != null && paperMattakeDetailItemsAdd.Count > 0) |
| | | { |
| | | foreach (var item in paperMattakeDetailItemsAdd) |
| | | { |
| | | //è·å对åºç |
| | | } |
| | | } |
| | | |
| | | if (paperMattakeDetailItemsUp != null && paperMattakeDetailItemsUp.Count > 0) |
| | | { |
| | | foreach (var item in paperMattakeDetailItemsUp) |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// å建ç管æå¨åºåº |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CreateSGManualTasks(List<int> ids) |
| | | { |
| | | WebResponseContent content=new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åæææç» |
| | | List<Dt_OutSGOrder> outSGOrders = BaseDal.Db.Queryable<Dt_OutSGOrder>().Where(x=>ids.Contains(x.Id)).Includes(x=>x.Details).ToList(); |
| | | List<Dt_OutSGOrderDetail> outSGOrderDetails = outSGOrders.SelectMany(x=>x.Details.Where(t=>t.OutSGOrderDetailStatus==OutOrderStatusEnum.æªå¼å§.ObjToInt())).ToList(); |
| | | List<int> ints = outSGOrderDetails.Select(x => x.Id).ToList(); |
| | | int[] reseponse = new int[ints.Count]; |
| | | for (int i = 0; i < ints.Count; i++) |
| | | { |
| | | reseponse[i] = ints[i]; |
| | | } |
| | | content = CreateSGOutboundTasks(reseponse); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | |
| | | { |
| | | return content.Error("é¢æè®¡åä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | outMESOrderDTOs.Select(x => x.OutDetailId); |
| | | List<Dt_Warehouse> warehouses = _basicRepository.WarehouseRepository.QueryData(); |
| | | OutMESOrderDTO? CheckGradeCode = outMESOrderDTOs.FirstOrDefault(x => !GradeCodes.Contains(x.GradeCode)); |
| | | if (CheckGradeCode != null) |
| | | { |
| | | return content.Error($"é¢æè®¡ååºåº{nameof(OutMESOrderDTO.GradeCode)}:{CheckGradeCode.GradeCode}ä¸åå¨"); |
| | | return content.Error($"é¢æè®¡åç级{nameof(OutMESOrderDTO.GradeCode)}:{CheckGradeCode.GradeCode}ä¸åå¨"); |
| | | } |
| | | OutMESOrderDTO? CheckOutDetailId = outMESOrderDTOs.FirstOrDefault(x => x.OutDetailId <= 0); |
| | | if (CheckOutDetailId != null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.OutDetailId)}:{CheckOutDetailId.ProductOrderNo}éè¦å¤§äº0"); |
| | | return content.Error($"é¢æè®¡åID:{CheckOutDetailId.OutDetailId}é大äº0"); |
| | | } |
| | | OutMESOrderDTO? CheckReqQuantity = outMESOrderDTOs.FirstOrDefault(x => x.ReqQuantity <= 0); |
| | | if (CheckReqQuantity != null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.ReqQuantity)}:{CheckReqQuantity.ProductOrderNo}éè¦å¤§äº0"); |
| | | return content.Error($"é¢æè®¡åID:{CheckReqQuantity.OutDetailId},{CheckReqQuantity.ProductOrderNo}ç©æéæ±éè¦å¤§äº0"); |
| | | } |
| | | //è·åææç©æä¿¡æ¯ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.MaterielInvOrgId == MaterielInvOrgEnum.æ°å.ObjToInt()); |
| | |
| | | Dt_MakeCenterInfo makeCenterInfo=makeCenterInfos.FirstOrDefault(x => x.MakeCode == item.MakeCode); |
| | | item.MakeArea = makeCenterInfo.MakeArea; |
| | | item.WarehouseId = materielInfo.WarehouseId; |
| | | item.MaterielUnit = materielInfo.MaterielUnit; |
| | | item.AssistUnitCode = materielInfo.AssistUnitCode; |
| | | } |
| | | |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | //æä½æ°æ®ï¼å¹¶åé
éæ±åºå |
| | | _outboundRepository.OutMESOrderRepository.AddData(AddoutMESOrders); |
| | | List<Dt_OutMESOrder> mESOrders = _outboundRepository.OutMESOrderRepository.QueryData(x => AddoutMESOrders.Select(x => x.OutDetailId).Contains(x.OutDetailId)); |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | //åå»ºä»»å¡ |
| | | tasks = GetTasks(result.Item1, result.Item3, TaskTypeEnum.PrintYLOutbound); |
| | | tasks = GetTasks(result.Item1, result.Item3); |
| | | result.Item2.ForEach(x => |
| | | { |
| | | OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("ReceivePicking"), AllowAnonymous] |
| | | public WebResponseContent ReceivePicking(BSTPickInfoDTO bSTPickInfoDTO) |
| | | public WebResponseContent ReceivePicking([FromBody] List<BSTPickInfoDTO> bSTPickInfoDTOs) |
| | | { |
| | | return _taskService.ReceivePicking(bSTPickInfoDTO); |
| | | return _taskService.ReceivePicking(bSTPickInfoDTOs); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="boxCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost,HttpGet, Route("MESBoxCodeNotice"), AllowAnonymous] |
| | | public string MESBoxCodeNotice(string boxCode) |
| | | public WebResponseContent MESBoxCodeNotice(string boxCode) |
| | | { |
| | | return _invokeMESService.MESBoxCodeNotice(boxCode); |
| | | return _proInOrderInfoService.MESBoxCode(boxCode); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// åºåºçº¿ä½ç¼å |
| | | /// </summary> |
| | | [Route("api/OutLineView")] |
| | | [ApiController] |
| | | public class OutLineViewController : ApiBaseController<IOutLineViewService, Dt_OutLineView> |
| | | { |
| | | public OutLineViewController(IOutLineViewService service) : base(service) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// è·å线ä½å纸 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetOutLineView"), AllowAnonymous] |
| | | public WebResponseContent GetOutLineView() |
| | | { |
| | | return Service.GetOutLineView(); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.ManualMaterielGroup(saveModel); |
| | | } |
| | | /// <summary> |
| | | /// æ´æ°èåæ®å·åºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("UpBSTStock"),AllowAnonymous] |
| | | public WebResponseContent UpBSTStock(int operate) |
| | | { |
| | | return Service.UpBSTStock(operate); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("EmptyBackTask"), AllowAnonymous] |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint) |
| | | public WebResponseContent EmptyBackTask(string barCode, string startPoint,int target) |
| | | { |
| | | return Service.EmptyBackTask(barCode, startPoint); |
| | | } |
| | |
| | | { |
| | | return Service.InboundFLOrCPTask(barCode, startPoint, matCode, matCount,oneCount); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¾
æ(æå)éè´/æåå
¥åº |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å建ç管æå¨åºåº |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("CreateSGManualTasks"), AllowAnonymous] |
| | | public WebResponseContent CreateSGManualTasks([FromBody] List<int> ids) |
| | | { |
| | | return Service.CreateSGManualTasks(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | |
| | | CreateMap<InboundDetailItem, Dt_InboundOrderDetail>().ForMember(x => x.OrderQuantity, b => b.MapFrom(b => b.MaterialQty)).ForMember(x => x.OrderDetailStatus, b => b.MapFrom(b => InOrderStatusEnum.æªå¼å§.ObjToInt())).ForMember(x => x.MaterialThick, b => b.MapFrom(b => b.Thickness)).ForMember(x => x.MaterialWide, b => b.MapFrom(b => b.Wide)).ForMember(x => x.MaterialWeight, b => b.MapFrom(b => b.Weight)).ForMember(x => x.OrderQuantity, b => b.MapFrom(b => b.MaterialQty)); |
| | | //åæéç¼åéè´è½¬æ¢ |
| | | CreateMap<Dt_InboundOrderDetail, Dt_YLInboundCache>().ForMember(x => x.Id, b => b.MapFrom(b => 0)).ForMember(x => x.BindStatus, b => b.MapFrom(b => WhetherEnum.False.ObjToInt())).ForMember(x => x.RfidCode, b => b.MapFrom(b => "")).ForMember(x => x.MaterialNo, b => b.MapFrom(b => b.MaterialCode)).ForMember(x => x.InvOrg, b => b.MapFrom(b => MaterielInvOrgEnum.æ°å.ToString())); |
| | | //åæéåºåºè¯¦æ
èååºåºçº¿ä½ç¼åè½¬æ¢ |
| | | CreateMap<Dt_OutStockLockInfo, Dt_OutLineView>().ForMember(x => x.Id, b => b.MapFrom(b => 0)); |
| | | } |
| | | } |
| | | } |
| | |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSLLD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WMSLLD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.35.3;Initial Catalog=WIDESEA_WMSLLD;User ID=sa;Password=Sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //æ§WMSæ°æ®åºè¿æ¥ |
| | | //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | |
| | | "LogAopEnable": false, |
| | | "PrintSql": true, //æå°SQLè¯å¥ |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "ExpMinutes": 360, |
| | | "QuartzJobAutoStart": true, |
| | | "PDAVersion": "4", |
| | | "WebSocketPort": 9296 |
| | |
| | | let config = { |
| | | baseUrl: 'http://192.168.35.3:9283', |
| | | //baseUrl: 'http://127.0.0.1:9293', |
| | | //baseUrl: 'http://192.168.35.3:9283', |
| | | baseUrl: 'http://127.0.0.1:9293', |
| | | urls: [ |
| | | 'http://192.168.35.3:9283', |
| | | 'http://192.168.35.3:9283' |
| | |
| | | <uni-easyinput type="text" v-model="addressEmpty" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' |
| | | :focus="addressEmptyFocus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å ç/ç«åº"> |
| | | <uni-data-checkbox v-model="target" :localdata="targetAddress" style="margin-top: 5px;"/> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="inEmpty" type="primary" size="default" style="margin-top: 2%;">å
¥åºç¡®è®¤</button> |
| | | <button @click="inEmpty" type="primary" size="default" style="margin-top: 2%;">å¼å«ç¡®è®¤</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | </view> |
| | |
| | | bindCode: "", |
| | | rfidCode: "", |
| | | rfid:"", |
| | | targetAddress: [{ |
| | | text: 'å ç', |
| | | value: 0 |
| | | }, { |
| | | text: 'ç«åº', |
| | | value: 1 |
| | | }], |
| | | target: 0, |
| | | outCount: 0, |
| | | addressEmptyFocus: false, |
| | | startPointRange: [] |
| | |
| | | } else { |
| | | this.addressEmptyFocus = false; |
| | | } |
| | | |
| | | if (this.inboundCode) { |
| | | this.addressEmptyFocus = true; |
| | | } else { |
| | | this.addressEmptyFocus = false; |
| | | } |
| | | }, |
| | | inEmpty() { |
| | | if (this.emptyCode == "") { |
| | |
| | | }) |
| | | return; |
| | | } |
| | | var url = "?barCode=" + this.emptyCode + "&startPoint=" + this.addressEmpty; |
| | | var url = "?barCode=" + this.emptyCode + "&startPoint=" + this.addressEmpty + "&target=" + this.target; |
| | | this.$u.post('/api/Task/EmptyBackTask' + url, {}).then(res => { |
| | | if (res.status) { |
| | | this.emptyCode = ""; |
| | | this.addressEmpty = ""; |
| | | this.target=0; |
| | | this.addressEmptyFocus=false; |
| | | //è·åæ»æ°é |
| | | setTimeout(() => { |
| | | this.addressEmptyFocus = false; |