| | |
| | | "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.Net.Http.Headers; |
| | | 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) |
| | | { |
| | |
| | | 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, 465, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 375, RequestIn.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 690, 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); |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // WriteError(RequestIn.StationName, $"æªæ¾å°æ¡ç {conveyorLineInfoRead.R_BoxCode}æ°æ®"); |
| | | //} |
| | | //åå
¥æ§è¡æ°æ® |
| | | 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) |
| | | { |
| | | WriteInfo(RequestIn.StationName, content.Message); |
| | | } |
| | | else |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | |
| | | /// 䏿çç®¡é¢æ |
| | | /// </summary> |
| | | [Description("䏿çç®¡é¢æ")] |
| | | OutSGPick=1 |
| | | OutSGPick = 1, |
| | | /// <summary> |
| | | /// äºæMES颿 |
| | | /// </summary> |
| | | [Description("äºæMES颿")] |
| | | OutMESPick = 2 |
| | | } |
| | | } |
| | |
| | | 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; } |
| | | } |
| | | } |
| | |
| | | /// </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.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(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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:å¯ç¨)")] |
| | |
| | | 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 = "æºå°ä½ç½®")] |
| | |
| | | [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.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; |
| | |
| | | try |
| | | { |
| | | //è·åæ°æ® |
| | | List<Dt_OutLineView> lineViews = BaseDal.QueryData(); |
| | | |
| | | 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) |
| | | { |
| | |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using System.Reflection; |
| | | using System.Text.RegularExpressions; |
| | | using Microsoft.AspNetCore.Http; |
| | | using HslCommunication; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | |
| | | //è·åæææç¨å |
| | | 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}å·²åå¨"); |
| | | } |
| | | ////夿忮 |
| | | //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)); |
| | |
| | | return content.Error($"ç产æç¨{sGOutOrderDTO.OrderId}ç©æ:{sGOutOrderDTO.MaterialNo}ä¸åå¨"); |
| | | } |
| | | List<Dt_OutSGOrder> AddOutSGOrders = new List<Dt_OutSGOrder>(); |
| | | foreach (var item in outOrderDTOs) |
| | | foreach (var item in outOrderDTOs.OrderBy(x=>x.Number)) |
| | | { |
| | | //è·åå·¥å |
| | | 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); |
| | | //è·åç©æ |
| | | Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialNo); |
| | | string code = ExtractFirstPercentContent(outSGOrderDetail.Remark); |
| | | //å¤çç¹æ®æå®æç¨å¤æ |
| | | if (!code.IsNullOrEmpty() && code.StartsWith(outSGOrderDetail.MaterialNo)) |
| | | { |
| | | materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == code); |
| | | if (materielInfo==null) |
| | | { |
| | | return content.Error($"ç产æç¨{item.OrderId}æå®æç¨ç©æ:{code}ä¸åå¨"); |
| | | } |
| | | outSGOrderDetail.MaterialNo = code; |
| | | } |
| | | outSGOrderDetail.MaterialName = materielInfo.MaterielName; |
| | | |
| | | //夿工忝å¦å·²ç»åå¨ |
| | | if (ExistOutSGOrder != null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | Dt_OutSGOrder outSGOrder = _mapper.Map<Dt_OutSGOrder>(item); |
| | | outSGOrder.Details = new List<Dt_OutSGOrderDetail>() { outSGOrderDetail }; |
| | | AddOutSGOrders.Add(outSGOrder); |
| | |
| | | } |
| | | return content; |
| | | } |
| | | public static string ExtractFirstPercentContent(string input) |
| | | { |
| | | if (string.IsNullOrEmpty(input)) |
| | | return null; |
| | | |
| | | 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; |
| | |
| | | BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(item.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>(); |
| | | if (bSTResponse.Code == 500) |
| | | { |
| | | throw new Exception($"æªæ¾å°æ¡ç {item.PalletCode}䏿ERPåºåä¸åå¨"); |
| | | content.Message += $"æ¡ç {item.PalletCode}䏿ERPåºåä¸åå¨,"; |
| | | continue; |
| | | } |
| | | BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"䏿ERPæªè¿å{item.PalletCode}çåºåä¿¡æ¯"); |
| | | if (item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter>0) |
| | |
| | | BaseDal.DeleteAndMoveIntoHty(stockInfosDel, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK("æ´æ°æå"); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using WIDESEA_External.Model; |
| | | using System.Text.Json; |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using MailKit.Search; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | 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") |
| | | 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() |
| | | { |
| | |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = stationInfo.AGVStationCode; |
| | | 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)}"); |
| | | } |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | } |
| | |
| | | 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") |
| | | 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() |
| | | { |
| | |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress = stationInfo.AGVStationCode; |
| | | 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)}"); |
| | | } |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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("å¼å«æå"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | 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 |
| | | { |
| | |
| | | x.Status=OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | }); |
| | | _outboundRepository.OutStockLockInfoRepository.UpdateData(outStockLockInfos); |
| | | _outboundService.OutLineViewService.SaveLineView(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 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | |
| | | _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> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡(åæ/åæå) |
| | |
| | | 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) |
| | | { |
| | |
| | | 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(); |
| | |
| | | /// <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.Mvc; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// åæéé¢æä¿¡æ¯ |
| | | /// åºåºçº¿ä½ç¼å |
| | | /// </summary> |
| | | [Route("api/OutLineView")] |
| | | [ApiController] |
| | |
| | | /// è·å线ä½å纸 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetOutLineView"), AllowAnonymous] |
| | | public WebResponseContent GetOutLineView() |
| | | { |
| | | return Service.GetOutLineView(); |
| | |
| | | "LogAopEnable": false, |
| | | "PrintSql": true, //æå°SQLè¯å¥ |
| | | "ApiName": "WIDESEA", |
| | | "ExpMinutes": 120, |
| | | "ExpMinutes": 360, |
| | | "QuartzJobAutoStart": true, |
| | | "PDAVersion": "4", |
| | | "WebSocketPort": 9296 |