From f0e2d9d2c7c41b311217bdb2c4d114ff53f6a146 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期二, 16 四月 2024 07:47:17 +0800 Subject: [PATCH] 优化空托逻辑 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs | 28 + 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs | 3 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/新文件夹/GetLocation.cs | 61 +++ 代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs | 2 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs | 66 ++- 代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs | 51 +- 代码管理/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs | 1 代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue | 5 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs | 14 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs | 163 ++++++++ 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs | 1 代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs | 12 代码管理/PCS/WCS_Client/config/buttons.js | 9 代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs | 12 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs | 108 +++-- 代码管理/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs | 242 ++++++------ 代码管理/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js | 31 + 代码管理/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs | 6 代码管理/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs | 5 代码管理/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue | 21 代码管理/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs | 264 +++++++------ 代码管理/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs | 6 代码管理/WMS/WMS_Client/src/api/http.js | 2 23 files changed, 745 insertions(+), 368 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/config/buttons.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/config/buttons.js" index 1062dd4..f6a4529 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/config/buttons.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/config/buttons.js" @@ -89,6 +89,15 @@ onClick: function () { // this.FinishWorkOrder(); } +}, { + name: "鍑哄簱澶栧崗", + icon: 'el-icon-check', + type: 'danger', + plain: true, + value: 'OutsorcingBtn', + onClick: function () { + // this.FinishWorkOrder(); + } } // , { // name: "鏁版嵁缁撴瀯", diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js" index b6fa96e..2609539 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/extension/widesea_wcs/tomes/dt_mes_head.js" @@ -40,6 +40,37 @@ // x.icon= 'el-icon-check' // } // }); + let OutsorcingBtn = this.buttons.find(r => r.name == "鍑哄簱澶栧崗"); + if(null!=OutsorcingBtn){ + OutsorcingBtn.onClick = function (){ + let rows = this.$refs.table.getSelected(); + if (rows.length == 0) return this.$error("璇烽�夋嫨宸ュ崟!"); + let addkeys = rows.map(x => { + return x[this.table.key]; + }); + if (!addkeys || addkeys.Length == 0) return this.$error("鏈幏鍙栧埌宸ュ崟!"); + this.$confirm("鏄惁纭瑕佸嚭搴撳鍗忥紵","鎻愮ず",{ + // iconClass:"el-icon-success",//el-icon-remove鑷畾涔夊浘鏍囨牱寮� + confirmButtonText:"纭",//纭鎸夐挳鏂囧瓧鏇存崲 + cancelButtonText:"鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲 + // cancelBtn:"鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲 + showClose: true,//鏄惁鏄剧ず鍙充笂瑙掑叧闂寜閽� + type: "warning",//鎻愮ず绫诲瀷 success:鎴愬姛/info:淇℃伅/warning:璀﹀憡/error:鎶ラ敊 + }).then(()=>{ + let params = { + MainData: null, + DetailData: null, + DelKeys: addkeys + } + this.http.post("/api/dt_mes_head/OutsorcingWorkOrder", params, "姝e湪澶勭悊宸ュ崟....").then(x => { + if (!x.status) return this.$error(x.message); + this.$success("澶勭悊宸ュ崟鎴愬姛!"); + this.refresh(); + }); + }) + + } + } let CompleteBtn = this.buttons.find(r => r.name == "瀹屾垚宸ュ崟"); if(null!=CompleteBtn){ CompleteBtn.onClick = function (){ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue" index c410b72..79fcd81 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Client/src/views/widesea_wcs/tomes/dt_mes_head.vue" @@ -31,13 +31,24 @@ }); const editFormFields = ref({"skip_op_1":"","skip_op_2":"","skip_op_3":""}); const editFormOptions = ref([ - [{ "dataKey": "skip_op_Status", "data": [], "title": "瑙嗚妫�娴�1", "required": true, "field": "skip_op_1", "type": "select" }], - [{ "dataKey": "skip_op_Status", "data": [], "title": "瑙嗚妫�娴�2", "required": true, "field": "skip_op_2", "type": "select" }], - [{ "dataKey": "skip_op_Status", "data": [], "title": "鍠烽槻閿堟恫", "required": true, "field": "skip_op_3", "type": "select" }] + [{ "dataKey": "skip_op_Status", "data": [], "title": "瑙嗚妫�娴�1", "required": true, "field": "skip_op_1", "type": "radio" }], + [{ "dataKey": "skip_op_Status", "data": [], "title": "瑙嗚妫�娴�2", "required": true, "field": "skip_op_2", "type": "radio" }], + [{ "dataKey": "skip_op_Status", "data": [], "title": "鍠烽槻閿堟恫", "required": true, "field": "skip_op_3", "type": "radio" }], + // [{ + // title: "鎸囧畾搴撳尯", field: "area", + // data: [ + // { key: 9, value: "澶栧崗鍖�" }, + // { key: 2, value: "搴撳尯2" }, + // { key: 3, value: "搴撳尯3" }, + // { key: 4, value: "搴撳尯4" }, + // //{ key: 3, value: "涓嶅厑璁�" }, + // ] + // , type: "radio"//type: "select" + // }], ]); const searchFormFields = ref({"jobID":"","processCode":"","CreateTime":""}); const searchFormOptions = ref([ - [{"title":"宸ュ崟缂栧彿","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"宸ュ崟绫诲瀷","field":"processCode","type":"select"}], + [{"title":"宸ヤ綔浠ゅ彿","field":"workOrder","type":"like"},{"title":"宸ュ崟缂栧彿","field":"jobID","type":"like"},{"dataKey":"WorkTypes","data":[],"title":"宸ュ崟绫诲瀷","field":"processCode","type":"select"}], [{"title":"鍥惧彿","field":"drawingNo","type":"like"},{"title":"鍒涘缓鏃堕棿","field":"CreateTime","type":"datetime"}] ]); const columns = ref([{field:'mes_id',title:'mes_id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'}, @@ -55,7 +66,7 @@ {field:'skip_op_1',title:'瑙嗚妫�娴�1',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'}, {field:'skip_op_2',title:'瑙嗚妫�娴�2',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'}, {field:'skip_op_3',title:'鍠烽槻閿堟恫',type:'bool',bind:{ key:'skip_op_Status',data:[]},width:110,require:true,align:'left'}, - // {field:'area',title:'鍏ュ簱搴撳尯',type:'string',width:110,align:'left'}, + {field:'area',title:'鎸囧畾搴撳尯',type:'string',width:110,align:'left'}, {field:'typeID',title:'杞瀷浠g爜',type:'string',width:110,align:'left'}, {field:'stackNoRange',title:'鎵撳寘鏁伴噺',type:'int',width:110,align:'left'}, {field:'maxDiameterDiff',title:'杞緞鍋忓樊',type:'decimal',width:110,align:'left'}, diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" index 3acc2fa..d0f63e8 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" @@ -140,8 +140,8 @@ ///鐐夊彿 /// </summary> [Display(Name = "鐐夊彿")] - [MaxLength(50)] - [Column(TypeName = "nvarchar(50)")] + [MaxLength(255)] + [Column(TypeName = "nvarchar(255)")] public string heatNumber { get; set; } /// <summary> @@ -151,5 +151,13 @@ [MaxLength(100)] [Column(TypeName = "nvarchar(100)")] public string tray_type { get; set; } + + /// <summary> + ///閽㈠澂鍙� + /// </summary> + [Display(Name = "閽㈠澂鍙�")] + [MaxLength(255)] + [Column(TypeName = "nvarchar(255)")] + public string billetID { get; set; } } } \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" index f1dc241..6cbd09d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" @@ -13,151 +13,159 @@ namespace WIDESEA_Entity.DomainModels { - [Entity(TableCnName = "宸ュ崟瑙嗗浘",TableName = "VV_Mes_Workinfo")] - public partial class VV_Mes_Workinfo:BaseEntity + [Entity(TableCnName = "宸ュ崟瑙嗗浘", TableName = "VV_Mes_Workinfo")] + public partial class VV_Mes_Workinfo : BaseEntity { /// <summary> - /// - /// </summary> - [Display(Name ="jobID")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string jobID { get; set; } + /// + /// </summary> + [Display(Name = "jobID")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string jobID { get; set; } - /// <summary> - ///鐐夊彿 - /// </summary> - [Display(Name ="heatID")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string heatID { get; set; } + /// <summary> + ///鐐夊彿 + /// </summary> + [Display(Name = "heatID")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string heatID { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="billetID")] - [Column(TypeName="int")] - [Editable(true)] - public int? billetID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "billetID")] + [Column(TypeName = "int")] + [Editable(true)] + public int? billetID { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="SN")] - [MaxLength(50)] - [Column(TypeName="nvarchar(50)")] - [Editable(true)] - public string SN { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "SN")] + [MaxLength(50)] + [Column(TypeName = "nvarchar(50)")] + [Editable(true)] + public string SN { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="heatBatchID")] - [MaxLength(30)] - [Column(TypeName="nvarchar(30)")] - [Editable(true)] - public string heatBatchID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "heatBatchID")] + [MaxLength(30)] + [Column(TypeName = "nvarchar(30)")] + [Editable(true)] + public string heatBatchID { get; set; } - /// <summary> - ///宸ヤ綔浠ゅ彿 - /// </summary> - [Display(Name ="workOrder")] - [MaxLength(50)] - [Column(TypeName="nvarchar(50)")] - [Editable(true)] - public string workOrder { get; set; } + /// <summary> + ///宸ヤ綔浠ゅ彿 + /// </summary> + [Display(Name = "workOrder")] + [MaxLength(50)] + [Column(TypeName = "nvarchar(50)")] + [Editable(true)] + public string workOrder { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="reqID")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string reqID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "reqID")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string reqID { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="reqIDLineNo")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string reqIDLineNo { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "reqIDLineNo")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string reqIDLineNo { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="materialCode")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string materialCode { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "materialCode")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string materialCode { get; set; } - /// <summary> - ///鍥惧彿 - /// </summary> - [Display(Name ="drawingNo")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string drawingNo { get; set; } + /// <summary> + ///鍥惧彿 + /// </summary> + [Display(Name = "drawingNo")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string drawingNo { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="drawingNoVer")] - [MaxLength(10)] - [Column(TypeName="nvarchar(10)")] - [Editable(true)] - public string drawingNoVer { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "drawingNoVer")] + [MaxLength(10)] + [Column(TypeName = "nvarchar(10)")] + [Editable(true)] + public string drawingNoVer { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="productName")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string productName { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "productName")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string productName { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="quantity")] - [Column(TypeName="int")] - [Editable(true)] - public int quantity { get; set; } + /// <summary> + ///搴撳尯 + /// </summary> + [Display(Name = "搴撳尯")] + [MaxLength(15)] + [Column(TypeName = "nvarchar(15)")] + public string area { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="typeID")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string typeID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "quantity")] + [Column(TypeName = "int")] + [Editable(true)] + public int quantity { get; set; } - /// <summary> - /// - /// </summary> - [Key] - [Display(Name ="stackNoRange")] - [Column(TypeName="int")] - [Editable(true)] - [Required(AllowEmptyStrings=false)] - public int stackNoRange { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "typeID")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string typeID { get; set; } - /// <summary> - ///宸ュ崟绫诲瀷 (17-鏈哄姞宸� 28-妫�娴嬬嚎 101绉诲簱澶栧崗) - /// </summary> - [Display(Name ="processCode")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string processCode { get; set; } + /// <summary> + /// + /// </summary> + [Key] + [Display(Name = "stackNoRange")] + [Column(TypeName = "int")] + [Editable(true)] + [Required(AllowEmptyStrings = false)] + public int stackNoRange { get; set; } + + /// <summary> + ///宸ュ崟绫诲瀷 (17-鏈哄姞宸� 28-妫�娴嬬嚎 101绉诲簱澶栧崗) + /// </summary> + [Display(Name = "processCode")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string processCode { get; set; } /// <summary> ///瀹屾垚鏁伴噺 diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" index 95d9cba..c21cc86 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" @@ -384,6 +384,9 @@ { var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); + var NGStation = "X01001003"; + if (name == "2鍗曞厓涓嬫枡鍖�") NGStation = "X02001003"; + if (name == "3鍗曞厓涓嬫枡鍖�") NGStation = "X03001002"; #region MyRegion //var Wheel_Type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_Type").First(), client);//杞﹁疆绫诲瀷 //var Wheel_id = client.ReadByOrder<string>("R_Wheel_id", name);//杞﹁疆SN鍙� @@ -485,6 +488,7 @@ } station.bindSN = string.IsNullOrEmpty(station.bindSN) ? Wheel_SN : station.bindSN + "," + Wheel_SN; + station.billetID = string.IsNullOrEmpty(station.billetID) ? Mes_Work.billetID.ToString() : station.billetID + "," + Mes_Work.billetID; station.quantity++; if (station.quantity == 1) { @@ -493,6 +497,10 @@ station.heatNumber = Mes_Work.heatID; station.tray_status = "StrogeTray"; } + //else if (station.stationCode == NGStation) + //{ + // station.heatNumber = string.IsNullOrEmpty(station.heatNumber) ? Mes_Work.heatID : station.heatNumber + "," + Mes_Work.heatID; + //} var count = stationinfoRepository.Update(station, true); if (count < 1) @@ -547,10 +555,9 @@ var Request = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Request_Load").First(), client); if (!Request) continue; - var Area = client.ReadByOrder<Int16>("W_AreaNr", name);//璇诲彇璐т綅鍙蜂俊鎭� - if (Area != 0) continue; + //var Area = client.ReadByOrder<Int16>("W_AreaNr", name);//璇诲彇璐т綅鍙蜂俊鎭� + //if (Area != 0) continue; - var load_zone = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_zone").First(), client); #region 璇诲彇妗佹灦淇℃伅 var Wheel_Type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_Type").First(), client);//杞﹁疆绫诲瀷 var Wheel_id = client.ReadByOrder<string>("R_Wheel_id", name);//杞﹁疆SN鍙� @@ -589,9 +596,7 @@ var Stations = stationinfoRepository.Find(x => x.area == PipelineJob.area_code(name)).OrderBy(x => x.lastUpdateTime).ToList(); - var NGStation = "X01001003"; - if (name == "2鍗曞厓涓嬫枡鍖�") NGStation = "X02001003"; - if (name == "3鍗曞厓涓嬫枡鍖�") NGStation = "X03001002"; + //foreach (var station in Stations) //浠讳綍涓�涓笅鏂欎綅涓虹┖鎴栫鐢ㄦ椂,閮戒細鍋滄妗佹灦 //{ @@ -620,6 +625,8 @@ } var PartStatus = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PartStatus").First(), client);//1:ok;2:nok + + var load_zone = (bool)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_load_zone").First(), client); #region 鏃ュ織璁板綍 WriteDBLog.Success(name + "鐢宠鏀炬枡", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿Wheel_id}\n杞瀷ID锛歿Wheel_Type}\n杞﹁疆鐘舵�侊細{PartStatus}\n鏄惁杩涘叆涓嬫枡鍖猴細{load_zone}", "PCS"); if (load_zone) continue; @@ -635,7 +642,7 @@ && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity < 5 && x.stationType == Work.drawingNo - && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") + //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") && x.Number == Work.workOrder && x.heatNumber == Work.heatID) .OrderByDescending(x => x.quantity) @@ -649,7 +656,7 @@ && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity < 5 && x.stationType == Work.drawingNo - && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") + //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") && x.Number == Work.workOrder) .OrderByDescending(x => x.quantity) .FirstOrDefault(); @@ -688,8 +695,22 @@ if (Stationinfo != null) { + #region 鎵樼洏杞﹁疆鍫嗗灈绗洓涓椂涓嬪彂鍙﹀涓�涓倝鍙风殑鍏ュ簱浠诲姟 + if (Stationinfo.quantity + 1 >= 4) + { + var stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.stationCode != Stationinfo.stationCode && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); + //foreach (var stationinfo in stationinfos) + //{ + if (stationinfo != null) + agvtask(stationinfoRepository, stationinfo, Work, name == "3鍗曞厓涓嬫枡鍖�" ? "TaskType_OutsourceInbound" : "TaskType_Inbound"); + //} + } + + #endregion + #region 鎵樼洏绫诲瀷涓嶄竴鑷撮渶鏇存崲鎵樼洏 - if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")) + //if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")) + if (Stationinfo.tray_type != "LargeTray" && (wheel == null ? wheel1.e : wheel.e) > 1100) { client.WriteByOrder("W_Enabl_Load", false, name);//淇″彿涓篺alse妗佹灦鍋滄杩涘叆 Stationinfo.location_state = LocationStateEnum.Abnormal.ToString(); @@ -765,16 +786,16 @@ continue; } } - else - { - #region 娌℃墭鐩樺彲鐢�,瑙﹀彂鍏ュ簱浠诲姟 - var stationinfos = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).ToList(); - foreach (var stationinfo in stationinfos) - { - agvtask(stationinfoRepository, stationinfo, Work, name == "3鍗曞厓涓嬫枡鍖�" ? "TaskType_OutsourceInbound" : "TaskType_Inbound"); - } - #endregion - } + //else + //{ + // #region 娌℃墭鐩樺彲鐢�,瑙﹀彂鍏ュ簱浠诲姟 + // var stationinfos = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).ToList(); + // foreach (var stationinfo in stationinfos) + // { + // agvtask(stationinfoRepository, stationinfo, Work, name == "3鍗曞厓涓嬫枡鍖�" ? "TaskType_OutsourceInbound" : "TaskType_Inbound"); + // } + // #endregion + //} } else if ((Int16)PartStatus == 2) @@ -802,7 +823,7 @@ && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity < 5 && x.stationType == Work.drawingNo - && x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") + //&& x.tray_type == ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray") /*&& x.Number == mes_Detail.jobID*/).FirstOrDefault(); //} @@ -818,7 +839,8 @@ if (Stationinfo != null) { #region 鎵樼洏绫诲瀷涓嶄竴鑷撮渶鏇存崲鎵樼洏 - if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")) + //if (Stationinfo.tray_type != ((wheel == null ? wheel1.e : wheel.e) < 1100 ? "SmallTray" : "LargeTray")) + if (Stationinfo.tray_type != "LargeTray" && (wheel == null ? wheel1.e : wheel.e) > 1100) { Stationinfo.location_state = LocationStateEnum.Abnormal.ToString(); Stationinfo.tray_type = Stationinfo.tray_type == "SmallTray" ? "SmallTray/LargeTray" : "LargeTray/SmallTray"; @@ -984,7 +1006,7 @@ //int CompeletedNum = Convert.ToInt32(mes_Head.quantity) - Convert.ToInt32(mes_Head.finishNum); //if (mes_Head.quantity <= 50) tasktype = "TaskType_OutsourceInbound"; - if (tasktype == "TaskType_OutsourceInbound") + if (tasktype == "TaskType_OutsourceInbound" || !string.IsNullOrEmpty(Work.area)) TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository); else if (tasktype == "TaskType_Inbound") TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, Work, stationinfo); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs" index 323e385..beefb52 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/IServices/ToMES/Partial/Idt_mes_headService.cs" @@ -15,5 +15,6 @@ /// <param name="saveModel"></param> /// <returns></returns> WebResponseContent FinishWorkOrder(SaveModel saveModel); + WebResponseContent OutsorcingWorkOrder(SaveModel saveModel); } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" index 8a8bfcc..a7325f0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" @@ -18,6 +18,7 @@ using WIDESEA_Entity.DomainModels; using WIDESEA_WCS.IRepositories; using WIDESEA_WCS.Jobs; +using WIDESEA_WCS.JobsPart.Common; using WIDESEA_WCS.Repositories; using WIDESEA_WCS.WCSClient; using WIDESEA_WMS.IRepositories; @@ -244,7 +245,8 @@ var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == stationCode).ToList(); var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//璇诲彇鎵樼洏淇″彿:1:鏈�,2鏃� var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//璇诲彇璐х墿淇″彿:1:鏈�,2鏃� - var station = stationinfoRepository.Find(x => x.stationCode == stationCode).FirstOrDefault(); + var station = stationinfoRepository.Find(x => x.stationCode == stationCode && x.enable).FirstOrDefault(); + if (station == null) continue; if (PalletSignal == 1 && MaterialSignal == 2 && (station.stationCode.Contains("S0100100") ? station.tray_status == "EmptyTray" : true)) { var area = station.tray_type == "SmallTray" ? "11" : "10"; @@ -262,31 +264,34 @@ continue; } + var EmptyStation = GetStation.EmptyPalletStation(area); + #region 鏌ユ壘搴撳尯涓�绌烘墭鐩樼┖璐т綅 - var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) - .OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//鏌ユ壘娌℃湁浠诲姟鐨勭┖鎵樼洏璐т綅 + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) + //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//鏌ユ壘娌℃湁浠诲姟鐨勭┖鎵樼洏璐т綅 - if (EmptyStation != null) - { - if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) - { - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//鎺掗櫎褰撳垪瀛樺湪浠诲姟鐨勮揣浣� - } - if (EmptyStation != null && EmptyStation.line == 2)//濡傛灉浠诲姟瀛樺湪绗簩琛�,鎺掓煡绗竴琛屾槸鍚︽湁璐� - { - if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; - } - } + // if (EmptyStation != null) + // { + // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) + // { + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//鎺掗櫎褰撳垪瀛樺湪浠诲姟鐨勮揣浣� + // } + // if (EmptyStation != null && EmptyStation.line == 2)//濡傛灉浠诲姟瀛樺湪绗簩琛�,鎺掓煡绗竴琛屾槸鍚︽湁璐� + // { + // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; + // } + // } + + // if (EmptyStation == null) + // { + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//鏈�鍚庝竴涓揣浣嶆湁浠诲姟鍒欎笉鑳界敓鎴愬叆搴撲换鍔� + // if (EmptyStation != null) continue; + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//鎵炬渶澶栭潰娌″爢婊�5涓殑璐т綅 + // if (EmptyStation == null) + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); + // } + #endregion - - if (EmptyStation == null) - { - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//鏈�鍚庝竴涓揣浣嶆湁浠诲姟鍒欎笉鑳界敓鎴愬叆搴撲换鍔� - if (EmptyStation != null) continue; - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//鎵炬渶澶栭潰娌″爢婊�5涓殑璐т綅 - if (EmptyStation == null) - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); - } if (EmptyStation != null) { diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs" new file mode 100644 index 0000000..7a22c19 --- /dev/null +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/GetStation/EmptyPalletStation.cs" @@ -0,0 +1,163 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WIDESEA_Comm; +using WIDESEA_Comm.LogInfo; +using WIDESEA_Core.EFDbContext; +using WIDESEA_Entity.DomainModels; +using WIDESEA_WCS.IRepositories; +using WIDESEA_WCS.Repositories; +using WIDESEA_WCS.WCSClient; +using WIDESEA_WMS.IRepositories; +using WIDESEA_WMS.Repositories; + +namespace WIDESEA_WCS.JobsPart.Common +{ + public class GetStation + { + /// <summary> + /// 鑾峰彇绌烘墭鐩樿揣浣� + /// </summary> + /// <returns></returns> + public static void EmptyPalletStation(dt_agvtask task) + { + dt_stationinfo EmptyStation = null; + try + { + VOLContext Context = new VOLContext(); + Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); + Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context); + var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "閾炬潯鏈�"); + if (Pipeline_client == null) throw new Exception("閾炬潯鏈鸿皟搴︽湇鍔℃湭寮�鍚紒"); + if (!Pipeline_client.IsConnected) throw new Exception("涓庨摼鏉℃満杩炴帴瓒呮椂锛�"); + var area = task.agv_Traytype == "SmallTray" ? "11" : "10"; + + #region 浼樺厛鍑�3搴撳尯鍐呯┖鎵樼洏 + if (area == "11") + { + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01004001" /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault(); + if (EmptyStation == null) + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001"/* && x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault(); + if (EmptyStation != null) + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == EmptyStation.area && x.line == EmptyStation.line /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + if (EmptyStation != null) + if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; + } + #endregion + if (EmptyStation == null) + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == area /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderBy(x => x.column).FirstOrDefault(); + if (EmptyStation != null) + if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; + if (EmptyStation != null) + { + var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//璇诲彇鎵樼洏淇″彿:1:鏈�,2鏃� + var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//璇诲彇璐х墿淇″彿:1:鏈�,2鏃� + if (PalletSignal == 2 && MaterialSignal == 2) + { + task.agv_fromaddress = EmptyStation.stationCode; + task.StarQuantity = EmptyStation.quantity - 1; + task.agv_taskstate = "Create"; + agvtaskService.Update(task, true); + EmptyStation.location_state = LocationStateEnum.Busy.ToString(); + stationinfoRepository.Update(EmptyStation, true); + WriteDBLog.Success("鏇存柊绌虹洏闃熷垪浠诲姟", $"浠诲姟缂栧彿锛歿task.agv_tasknum}", "PCS"); + } + } + } + catch (Exception ex) + { + throw; + } + } + public static dt_stationinfo Station(dt_stationinfo EmptyStation, Idt_stationinfoRepository stationinfoRepository) + { + dt_stationinfo stationinfo = null; + try + { + if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state.Contains("Busy")).Any()) return null; + + + stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.quantity > 0 && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + if (stationinfo != null) + { + if (stationinfo.quantity < 5) return stationinfo; + else + stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); + } + //if (stationinfo == null) + // stationinfo = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.quantity < 5 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); + } + catch (Exception ex) + { + + } + return stationinfo; + } + /// <summary> + /// 绌烘墭鍙叆搴撹揣浣� + /// </summary> + /// <param name="area"></param> + /// <returns></returns> + public static dt_stationinfo EmptyPalletStation(string area) + { + dt_stationinfo stationinfo = null; + try + { + VOLContext Context = new VOLContext(); + Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context); + Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); + + #region 鏌ユ壘绌烘墭鐩樺簱鍖� + if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any()) + { + var EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01005001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault(); + if (EmptyStation != null) + { + if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any()) + return EmptyStation; + } + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault(); + + + if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository); + if (stationinfo != null) return stationinfo; + + EmptyStation = stationinfoRepository.Find(x => x.area == EmptyStation.area && x.line == EmptyStation.line && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + + if (EmptyStation.quantity == 5) + { + EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01004001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault(); + if (EmptyStation != null) + { + if (!stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state != LocationStateEnum.Empty.ToString()).Any()) + return EmptyStation; + } + + EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01004001" && x.location_state == "Stroge" && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault(); + if (EmptyStation != null) stationinfo = Station(EmptyStation, stationinfoRepository); + } + + } + else + { + stationinfo = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 /*&& x.location_state == LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).FirstOrDefault(); + if (stationinfo != null) + { + if (stationinfo.quantity < 5) return stationinfo; + else + stationinfo = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + } + + } + #endregion + } + catch (Exception ex) + { + throw; + } + return stationinfo; + } + } +} diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs" index 79a3d97..b3837d0 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/ReplaceTray.cs" @@ -63,12 +63,12 @@ var types = station.tray_type.Split('/'); var area = types[0] == "SmallTray" ? "11" : "10"; //鎵�1搴撳尯鐨勭┖鎵樹綅 - - var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable) - .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault(); - if (EmptyStation == null) - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable) - .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); + var EmptyStation = GetStation.EmptyPalletStation(area); + //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") /*&& x.location_state == "Empty"*/ && x.enable) + // .OrderBy(x => x.column).OrderBy(x => x.line).FirstOrDefault(); + //if (EmptyStation == null) + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") /*&& x.location_state == "Empty"*/ && x.enable) + // .OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); if (EmptyStation != null) { dt_agvtask agvtask = new dt_agvtask() @@ -93,6 +93,8 @@ agv_Traytype = types[0] }; agvtaskRepository.Add(agvtask, true); + EmptyStation.location_state = LocationStateEnum.Busy.ToString(); + stationinfoRepository.Update(EmptyStation, true); WriteDBLog.Success("鍒涘缓鏇存崲绌虹洏浠诲姟", $"浠诲姟缂栧彿锛歿agvtask.agv_tasknum}", "PCS"); CreatePartQueue(agvtaskRepository, agvtask, types[1]); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" index 410a9c6..8680c72 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" @@ -36,58 +36,68 @@ { if (task.agv_tasktype == "TaskType_EmptyPallet")//绌烘墭浠诲姟 { - if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(5)) + if (task.agv_fromaddress == "" && DateTime.Now - task.agv_createtime >= TimeSpan.FromMinutes(1)) { - var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "閾炬潯鏈�"); - if (Pipeline_client == null) throw new Exception("閾炬潯鏈鸿皟搴︽湇鍔℃湭寮�鍚紒"); - if (!Pipeline_client.IsConnected) throw new Exception("涓庨摼鏉℃満杩炴帴瓒呮椂锛�"); - var area = task.agv_Traytype == "SmallTray" ? "11" : "10"; - //鎵�1搴撳尯鐨勭┖鎵樹綅 - var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains("A") /*&& x.location_state == "Stroge"*//*LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).ThenBy(x => x.line).FirstOrDefault(); - if (EmptyStation != null) - if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; - #region 涓�涓尯鍩熷彧鑳芥湁涓�涓┖鎵樹换鍔� - //bool ok = false; - //if (EmptyStation != null) - // ok = agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any(); - //if (EmptyStation == null || ok) - // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" /*LocationStateEnum.Stroge.ToString()*/ && x.enable) - // .OrderBy(x => x.line).OrderByDescending(x => x.column).FirstOrDefault(); - #endregion - if (EmptyStation == null) - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); - if (EmptyStation == null) continue; - #region 搴撳唴瀛樺湪浠诲姟鍗犵敤 - if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) - continue; - #endregion - - if (EmptyStation == null) - EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); - if (EmptyStation != null) + if (task.agv_tasknum.Contains("_")) { - #region 搴撳唴瀛樺湪浠诲姟鍗犵敤 - //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) - // continue; - #endregion - - //if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any()) - // return; - #region 琛ュ簱鍐呯┖鎵樼洏锛屼笉闇�瑕佸厜鐢靛垽鏂� - var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//璇诲彇鎵樼洏淇″彿:1:鏈�,2鏃� - var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//璇诲彇璐х墿淇″彿:1:鏈�,2鏃� - if (PalletSignal == 2 && MaterialSignal == 2) - { - task.agv_fromaddress = EmptyStation.stationCode; - task.StarQuantity = EmptyStation.quantity - 1; - task.agv_taskstate = "Create"; - agvtaskService.Update(task, true); - EmptyStation.location_state = LocationStateEnum.Busy.ToString(); - stationinfoRepository.Update(EmptyStation, true); - WriteDBLog.Success("鏇存柊绌虹洏闃熷垪浠诲姟", $"浠诲姟缂栧彿锛歿task.agv_tasknum}", "PCS"); - } - #endregion + string mainTaskNum = task.agv_tasknum.Split('_')[0]; + if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && (task.agv_taskstate == "Executing1" || task.agv_taskstate == "Complete1")).Any()) + GetStation.EmptyPalletStation(task); } + else + GetStation.EmptyPalletStation(task); + #region + //var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "閾炬潯鏈�"); + //if (Pipeline_client == null) throw new Exception("閾炬潯鏈鸿皟搴︽湇鍔℃湭寮�鍚紒"); + //if (!Pipeline_client.IsConnected) throw new Exception("涓庨摼鏉℃満杩炴帴瓒呮椂锛�"); + //var area = task.agv_Traytype == "SmallTray" ? "11" : "10"; + ////鎵�1搴撳尯鐨勭┖鎵樹綅 + //var EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains("A") /*&& x.location_state == "Stroge"*//*LocationStateEnum.Stroge.ToString()*/ && x.enable).OrderBy(x => x.column).ThenBy(x => x.line).FirstOrDefault(); + //if (EmptyStation != null) + // if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; + //#region 涓�涓尯鍩熷彧鑳芥湁涓�涓┖鎵樹换鍔� + ////bool ok = false; + ////if (EmptyStation != null) + //// ok = agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any(); + ////if (EmptyStation == null || ok) + //// EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" /*LocationStateEnum.Stroge.ToString()*/ && x.enable) + //// .OrderBy(x => x.line).OrderByDescending(x => x.column).FirstOrDefault(); + //#endregion + //if (EmptyStation == null) + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + //if (EmptyStation == null) continue; + //#region 搴撳唴瀛樺湪浠诲姟鍗犵敤 + //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) + // continue; + //#endregion + + //if (EmptyStation == null) + // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity > 0 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == "Stroge" && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); + //if (EmptyStation != null) + //{ + // #region 搴撳唴瀛樺湪浠诲姟鍗犵敤 + // //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) + // // continue; + // #endregion + + // //if (agvtaskService.Find(x => x.agv_fromaddress == EmptyStation.stationCode || x.agv_toaddress == EmptyStation.stationCode).Any()) + // // return; + // #region 琛ュ簱鍐呯┖鎵樼洏锛屼笉闇�瑕佸厜鐢靛垽鏂� + // var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//璇诲彇鎵樼洏淇″彿:1:鏈�,2鏃� + // var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", task.agv_toaddress);//璇诲彇璐х墿淇″彿:1:鏈�,2鏃� + // if (PalletSignal == 2 && MaterialSignal == 2) + // { + // task.agv_fromaddress = EmptyStation.stationCode; + // task.StarQuantity = EmptyStation.quantity - 1; + // task.agv_taskstate = "Create"; + // agvtaskService.Update(task, true); + // EmptyStation.location_state = LocationStateEnum.Busy.ToString(); + // stationinfoRepository.Update(EmptyStation, true); + // WriteDBLog.Success("鏇存柊绌虹洏闃熷垪浠诲姟", $"浠诲姟缂栧彿锛歿task.agv_tasknum}", "PCS"); + // } + // #endregion + //} + #endregion } } else if (task.agv_tasktype == "TaskType_OutsourceOutbound" || task.agv_tasktype == "TaskType_Outbound")//澶栧崗搴撳嚭搴�/AB搴撳嚭搴� diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs" index 8880cd9..abb0244 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/StationTask.cs" @@ -85,7 +85,7 @@ { - if (/*(mesinfo.quantity <= 50 && string.IsNullOrEmpty(mesinfo.area)) ||*/ item.stationCode.Contains("3")) //灏忎簬50浠剁洿鎺ュ嚭搴� + if (/*(mesinfo.quantity <= 50 &&*/ !string.IsNullOrEmpty(work.area) || item.stationCode.Contains("3")) //灏忎簬50浠剁洿鎺ュ嚭搴� { //todo 瀵绘壘鍙斁璐у鍗忔斁璐у彴 tasktype = "TaskType_OutsourceInbound"; @@ -129,6 +129,7 @@ TargetLocation.location_state = LocationStateEnum.InBusy.ToString(); TargetLocation.stationType = agvtask.agv_materielid; TargetLocation.heatNumber = item.heatNumber; + TargetLocation.billetID = item.billetID; TargetLocation.Number = agvtask.jobID; stationinfoRepository.Update(TargetLocation, true); WriteDBLog.Success("鍒涘缓鍏ュ簱浠诲姟", $"浠诲姟缂栧彿锛歿agvtask.agv_tasknum}", "PCS"); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" index 9474e1d..9365f38 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/\346\226\260\346\226\207\344\273\266\345\244\271/GetLocation.cs" @@ -41,6 +41,10 @@ // stationinfoRepository.Update(stationinfo, true); // return null; //} + string area1 = ""; + if (stationinfo.tray_type == "LargeTray") + area1 = "4"; + #region 鏌ユ壘搴撳瓨 dt_inventory inventory = null; inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo).OrderByDescending(x => x.OnlineTime).FirstOrDefault(); @@ -64,6 +68,57 @@ if (inventory != null) { var station = stationinfoRepository.FindFirst(x => x.stationCode == inventory.stationCode); + if (!string.IsNullOrEmpty(area1) && station.area != area1)//鍏ュぇ鎵樼洏搴撳尯 + { + #region 瀵绘壘宸插垎閰嶅悓鍥惧彿鍏ュ簱浠诲姟搴撲綅 + TargetLocation = stationinfoRepository.Find(x => x.stationType == stationinfo.stationType && x.location_state == LocationStateEnum.InBusy.ToString() && x.area == area1).FirstOrDefault(); + if (TargetLocation != null) + { + //if (TargetLocation.area == "1") + //{ + // //TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderByDescending(x => x.line).FirstOrDefault(); + + // TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderBy(x => x.column).FirstOrDefault();//鎸夎瀛樻斁 + + // if (TargetLocation != null) + // { + // if (!stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area /*&& x.enable*/ && x.location_state == LocationStateEnum.OutBusy.ToString()).Any()) + // return TargetLocation; + // } + //} + //else + //{ + TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == TargetLocation.area).OrderBy(x => x.column).FirstOrDefault(); + if (TargetLocation != null) + { + if (!stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any()) + return TargetLocation; + } + //} + } + #endregion + + #region 瀵绘壘绌鸿揣浣� + var TargetLocations1 = stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == area1).OrderBy(x => x.line).ThenBy(x => x.column).ToList(); + foreach (var Location in TargetLocations1) + { + //if (Location.area == "1") + //{ + // if (stationinfoRepository.Find(x => x.column == Location.column && x.area == Location.area && x.stationType == stationinfo.stationType && x.location_state != LocationStateEnum.OutBusy.ToString()).Any()) return Location; + //} + //else + //{ + if (stationinfoRepository.Find(x => x.line == Location.line && x.area == Location.area && x.stationType == stationinfo.stationType && x.location_state != LocationStateEnum.OutBusy.ToString()).Any()) return Location; + //} + } + //if (TargetLocation != null) + //{ + // if (stationinfoRepository.Find(x => x.line == TargetLocation.line && x.column == 1 && x.stationType == stationinfo.stationType).Any()) return TargetLocation; + //} + #endregion + + + } if (station.area == "1") { //TargetLocation = stationinfoRepository.Find(x => x.column == station.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.area).OrderByDescending(x => x.line).FirstOrDefault(); @@ -137,17 +192,17 @@ #endregion #region 鏈壘鍒板簱瀛樻垨褰撳墠搴撳瓨琛屽凡婊�,瀵绘壘鏂扮殑涓�琛� - //var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area; + //var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area;(area == "2" ? 1 : 10) //var area = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, stationinfo.tray_type) : mesinfo.area; var area = GetArea(mesinfo.quantity, stationinfo.tray_type); - TargetLocation = stationinfoRepository.Find(x => x.column == (area == "2" ? 1 : 10) && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault(); + TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault(); if (TargetLocation == null && area != "4") { if (area == "2") area = "3"; else if (area == "3") area = "2"; - TargetLocation = stationinfoRepository.Find(x => x.column == (area == "2" ? 1 : 10) && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault(); + TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).ThenBy(x => x.column).FirstOrDefault(); if (TargetLocation == null) TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault(); } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs" index 1c3ae9d..4d73059 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Services/ToMES/Partial/dt_mes_headService.cs" @@ -20,6 +20,7 @@ using WIDESEA_Core.EFDbContext; using WIDESEA_WCS.JobsPart.Common; using WIDESEA_Core.ManageUser; +using WIDESEA_Comm.LogInfo; namespace WIDESEA_WCS.Services { @@ -40,10 +41,35 @@ //澶氱鎴蜂細鐢ㄥ埌杩檌nit浠g爜锛屽叾浠栨儏鍐靛彲浠ヤ笉鐢� //base.Init(dbRepository); } + public WebResponseContent OutsorcingWorkOrder(SaveModel model) + { + WebResponseContent content = new WebResponseContent(); + string compeletor = UserContext.Current.UserName; + try + { + List<string> list = new List<string>(); + foreach (var Key in model.DelKeys) + { + var mes_head = _repository.Find(x => x.mes_id.ToString() == Key.ToString()).FirstOrDefault(); + if (mes_head != null) + { + mes_head.area = "澶栧崗"; + _repository.Update(mes_head, true); + list.Add(mes_head.jobID); + } + } + content.OK(); + WriteDBLog.Success("鎸囧畾宸ュ崟鍑哄簱澶栧崗", $"宸ュ崟缂栧彿锛歿list}", "PCS", compeletor); + } + catch (Exception ex) + { + WriteDBLog.Error("鎸囧畾宸ュ崟鍑哄簱澶栧崗", $"閿欒淇℃伅锛歿ex.Message}", "PCS", compeletor); + } + return content; + } public WebResponseContent FinishWorkOrder(SaveModel model) { WebResponseContent content = new WebResponseContent(); - VOLContext context = new VOLContext(); try { string compeletor = UserContext.Current.UserName; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs" index 7e6c2b6..8f03fc6 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/ToMES/ToMesServer.cs" @@ -92,9 +92,9 @@ workOrder = workInfo.workOrder, processCode = workInfo.processCode, finishNum = 0, - skip_op_1 = true, - skip_op_2 = true, - skip_op_3 = true, + skip_op_1 = false, + skip_op_2 = false, + skip_op_3 = false, }; freeDB.Add(mes_Head); diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs" index d71e0d2..95f0b4f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WCS/Partial/dt_mes_headController.cs" @@ -43,5 +43,11 @@ { return Service.FinishWorkOrder(saveModel); } + + [HttpPost, Authorize, Route("OutsorcingWorkOrder"), AllowAnonymous] + public WebResponseContent OutsorcingWorkOrder([FromBody] SaveModel saveModel) + { + return Service.OutsorcingWorkOrder(saveModel); + } } } diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js" index 0af90a4..eb0a016 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js" @@ -12,7 +12,7 @@ let loadingInstance; let loadingStatus = false; if (process.env.NODE_ENV == 'development') { - axios.defaults.baseURL = 'http://127.0.0.1:8098/'; + axios.defaults.baseURL = 'http://192.168.12.101:8098/'; } else if (process.env.NODE_ENV == 'debug') { axios.defaults.baseURL = 'http://192.168.12.101:8098/'; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue" index ffbbaa2..eb9fe36 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue" @@ -29,11 +29,12 @@ url: "/dt_stationinfo/", sortName: "id" }); - const editFormFields = ref({"stationCode":"","stationType":"","location_state":"","bindSN":"","tray_status":"","Number":"","heatNumber":"","remark":""}); + const editFormFields = ref({"stationCode":"","stationType":"","location_state":"","bindSN":"","billetID":"","tray_status":"","Number":"","heatNumber":"","remark":""}); const editFormOptions = ref([[{"title":"缂撳瓨鏋剁紪鍙�","field":"stationCode","disabled": true}], [{"title":"鍥惧彿","field":"stationType"}], [{"dataKey":"location_states","data":[],"title":"璐т綅鐘舵��","field":"location_state","type":"select"}], [{"title":"杞﹁疆SN鍙�","field":"bindSN"}], + [{"title":"閽㈠澂鍙�","field":"billetID"}], [{"dataKey":"tray_types","data":[],"title":"鎵樼洏绫诲瀷","field":"tray_type","type":"select"}], [{"title":"宸ヤ綔浠ゅ彿","field":"Number"}], [{"title":"鐐夊彿","field":"heatNumber","type":"text"}], @@ -54,7 +55,7 @@ // {field:'line',title:'琛�',type:'int',width:80,align:'left'}, // {field:'column',title:'鍒�',type:'int',width:80,align:'left'}, {field:'heatNumber',title:'鐐夊彿',type:'string',width:80,align:'left'}, - // {field:'zj',title:'涓婚敭',type:'int',width:80,hidden:true,require:true,align:'left'}, + {field:'billetID',title:'閽㈠澂鍙�',type:'string',width:160,align:'left'}, {field:'Number',title:'宸ヤ綔浠ゅ彿',type:'string',width:160,align:'left'}, {field:'remark',title:'澶囨敞',type:'string',width:220,align:'left'}]); const detail = ref({ diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" index 82ff0c0..8acfd0a 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/System/dt_stationinfo.cs" @@ -139,8 +139,8 @@ ///鐐夊彿 /// </summary> [Display(Name = "鐐夊彿")] - [MaxLength(50)] - [Column(TypeName = "nvarchar(50)")] + [MaxLength(255)] + [Column(TypeName = "nvarchar(255)")] public string heatNumber { get; set; } /// <summary> @@ -150,5 +150,13 @@ [MaxLength(100)] [Column(TypeName = "nvarchar(100)")] public string tray_type { get; set; } + + /// <summary> + ///閽㈠澂鍙� + /// </summary> + [Display(Name = "閽㈠澂鍙�")] + [MaxLength(255)] + [Column(TypeName = "nvarchar(255)")] + public string billetID { get; set; } } } \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" index 9710d82..cd1a356 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_Entity/DomainModels/ToMES/VV_Mes_Workinfo.cs" @@ -13,152 +13,160 @@ namespace WIDESEA_Entity.DomainModels { - [Entity(TableCnName = "宸ュ崟瑙嗗浘",TableName = "VV_Mes_Workinfo")] - public partial class VV_Mes_Workinfo:BaseEntity + [Entity(TableCnName = "宸ュ崟瑙嗗浘", TableName = "VV_Mes_Workinfo")] + public partial class VV_Mes_Workinfo : BaseEntity { /// <summary> - ///宸ュ崟缂栧彿 - /// </summary> - [Display(Name ="jobID")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string jobID { get; set; } + ///宸ュ崟缂栧彿 + /// </summary> + [Display(Name = "jobID")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string jobID { get; set; } /// <summary> ///鐐変唬鍙� /// </summary> - [Display(Name ="heatID")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string heatID { get; set; } + [Display(Name = "heatID")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string heatID { get; set; } /// <summary> ///閽㈠澂鍙� /// </summary> - [Display(Name ="billetID")] - [Column(TypeName="int")] - [Editable(true)] - public int? billetID { get; set; } + [Display(Name = "billetID")] + [Column(TypeName = "int")] + [Editable(true)] + public int? billetID { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="SN")] - [MaxLength(50)] - [Column(TypeName="nvarchar(50)")] - [Editable(true)] - public string SN { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "SN")] + [MaxLength(50)] + [Column(TypeName = "nvarchar(50)")] + [Editable(true)] + public string SN { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="heatBatchID")] - [MaxLength(30)] - [Column(TypeName="nvarchar(30)")] - [Editable(true)] - public string heatBatchID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "heatBatchID")] + [MaxLength(30)] + [Column(TypeName = "nvarchar(30)")] + [Editable(true)] + public string heatBatchID { get; set; } - /// <summary> - ///宸ヤ綔浠ゅ彿 - /// </summary> - [Display(Name ="workOrder")] - [MaxLength(50)] - [Column(TypeName="nvarchar(50)")] - [Editable(true)] - public string workOrder { get; set; } + /// <summary> + ///宸ヤ綔浠ゅ彿 + /// </summary> + [Display(Name = "workOrder")] + [MaxLength(50)] + [Column(TypeName = "nvarchar(50)")] + [Editable(true)] + public string workOrder { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="reqID")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string reqID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "reqID")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string reqID { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="reqIDLineNo")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string reqIDLineNo { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "reqIDLineNo")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string reqIDLineNo { get; set; } - /// <summary> - ///鐗╂枡缂栫爜 - /// </summary> - [Display(Name ="materialCode")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string materialCode { get; set; } + /// <summary> + ///鐗╂枡缂栫爜 + /// </summary> + [Display(Name = "materialCode")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string materialCode { get; set; } - /// <summary> - ///鍥惧彿 - /// </summary> - [Display(Name ="drawingNo")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string drawingNo { get; set; } + /// <summary> + ///鍥惧彿 + /// </summary> + [Display(Name = "drawingNo")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string drawingNo { get; set; } - /// <summary> - ///鎶�鏈姸鎬� - /// </summary> - [Display(Name ="drawingNoVer")] - [MaxLength(10)] - [Column(TypeName="nvarchar(10)")] - [Editable(true)] - public string drawingNoVer { get; set; } + /// <summary> + ///鎶�鏈姸鎬� + /// </summary> + [Display(Name = "drawingNoVer")] + [MaxLength(10)] + [Column(TypeName = "nvarchar(10)")] + [Editable(true)] + public string drawingNoVer { get; set; } /// <summary> ///浜у搧鍚嶇О /// </summary> - [Display(Name ="productName")] - [MaxLength(40)] - [Column(TypeName="nvarchar(40)")] - [Editable(true)] - public string productName { get; set; } + [Display(Name = "productName")] + [MaxLength(40)] + [Column(TypeName = "nvarchar(40)")] + [Editable(true)] + public string productName { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="quantity")] - [Column(TypeName="int")] - [Editable(true)] - public int? quantity { get; set; } + /// <summary> + ///搴撳尯 + /// </summary> + [Display(Name = "搴撳尯")] + [MaxLength(15)] + [Column(TypeName = "nvarchar(15)")] + public string area { get; set; } - /// <summary> - /// - /// </summary> - [Display(Name ="typeID")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string typeID { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "quantity")] + [Column(TypeName = "int")] + [Editable(true)] + public int? quantity { get; set; } - /// <summary> - /// - /// </summary> - [Key] - [Display(Name ="stackNoRange")] - [Column(TypeName="int")] - [Editable(true)] - [Required(AllowEmptyStrings=false)] - public int stackNoRange { get; set; } + /// <summary> + /// + /// </summary> + [Display(Name = "typeID")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string typeID { get; set; } + + /// <summary> + /// + /// </summary> + [Key] + [Display(Name = "stackNoRange")] + [Column(TypeName = "int")] + [Editable(true)] + [Required(AllowEmptyStrings = false)] + public int stackNoRange { get; set; } /// <summary> ///宸ュ崟绫诲瀷 (17-鏈哄姞宸� 28-妫�娴嬬嚎 101-绉诲簱澶栧崗) /// </summary> - [Display(Name ="processCode")] - [MaxLength(20)] - [Column(TypeName="nvarchar(20)")] - [Editable(true)] - public string processCode { get; set; } + [Display(Name = "processCode")] + [MaxLength(20)] + [Column(TypeName = "nvarchar(20)")] + [Editable(true)] + public string processCode { get; set; } - + } } \ No newline at end of file diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs" index b1824b5..d2a3af3 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Common/AGVTask/HandleTask.cs" @@ -171,7 +171,7 @@ ////绌烘墭浠诲姟闇�淇敼閫昏緫 if (station2.stationCode.Contains("X")) station2.quantity = 0;// task.agv_tasktype.Contains("TaskType_EmptyPallet") ? 0 : task.agv_qty; //task.agv_qty; - else if (station2.area == "10" || station2.area == "11") //鍏ュ簱绌烘墭浠诲姟 + else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //鍏ュ簱绌烘墭浠诲姟 station2.quantity = station2.quantity + task.agv_qty; else station2.quantity = task.agv_qty; @@ -199,7 +199,7 @@ // station1.quantity = 0; #endregion - if (station1.area == "10" || station1.area == "11") //鍑哄簱绌烘墭浠诲姟 + if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //鍑哄簱绌烘墭浠诲姟 { station1.location_state = LocationStateEnum.Stroge.ToString(); station1.quantity = station1.quantity - 1; @@ -212,6 +212,7 @@ { station1.location_state = LocationStateEnum.Empty.ToString(); station1.Number = string.Empty; + station1.billetID = string.Empty; station1.heatNumber = string.Empty; station1.stationType = string.Empty; station1.tray_status = string.Empty; diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" index dc51536..ca5afa7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" @@ -119,6 +119,7 @@ station.stationType = saveModel.MainData["stationType"].ToString(); station.heatNumber = saveModel.MainData["heatNumber"].ToString(); station.Number = saveModel.MainData["Number"].ToString(); + station.billetID = saveModel.MainData["billetID"].ToString(); station.remark = saveModel.MainData["remark"].ToString(); station.tray_type = saveModel.MainData["tray_type"].ToString(); if (list.Count == 0) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs" index 16b2404..371f541 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/JobTask.cs" @@ -12,7 +12,7 @@ [Invoke(Begin = "2024-01-01 00:00", Interval = 1000 * 5, /*IsEnabled = true,*/ SkipWhileExecuting = true)] public void TaskTime() { - //AGVServer.SendAgvTask(); + AGVServer.SendAgvTask(); } } } -- Gitblit v1.9.3