| | |
| | | |
| | | if (Stationinfo == null) |
| | | { |
| | | //var stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); |
| | | //if (stationinfo != null) |
| | | //{ |
| | | // agvtask(stationinfoRepository, stationinfo, (wheel == null ? wheel1.e : wheel.e), "TaskType_OutsourceInbound"); |
| | | //} |
| | | Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault(); |
| | | #region 触åNGä»»å¡ |
| | | var NG = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); |
| | | if (NG != null) |
| | | agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound"); |
| | | #endregion |
| | | } |
| | | if (Stationinfo != null) |
| | | { |
| | |
| | | using WIDESEA_Core.BaseProvider; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_WCS.WCSClient; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.IServices; |
| | | using WIDESEA_WMS.Repositories; |
| | | using static FreeSql.Internal.GlobalFilter; |
| | | |
| | | namespace WIDESEA_WCS.JobsPart.Common |
| | | { |
| | |
| | | #endregion |
| | | } |
| | | } |
| | | else if (task.agv_tasktype == "TaskType_OutsourceInbound")//䏿å»å¤åå£ |
| | | { |
| | | if (task.agv_toaddress == "") |
| | | { |
| | | var TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository); |
| | | if (TargetLocation != null) |
| | | { |
| | | if (agvtaskService.Find(x => x.agv_toaddress == TargetLocation.stationCode).Any()) continue; |
| | | var stationinfo = stationinfoRepository.Find(x => x.stationCode == task.agv_fromaddress).FirstOrDefault(); |
| | | task.agv_taskstate = "Create"; |
| | | task.agv_toaddress = TargetLocation.stationCode; |
| | | TargetLocation.location_state = LocationStateEnum.InBusy.ToString(); |
| | | TargetLocation.billetID = stationinfo.billetID; |
| | | TargetLocation.stationType = task.agv_materielid; |
| | | TargetLocation.heatNumber = stationinfo.heatNumber; |
| | | TargetLocation.Number = task.jobID; |
| | | stationinfoRepository.Update(TargetLocation, true); |
| | | agvtaskService.Update(task, true); |
| | | } |
| | | } |
| | | } |
| | | else if (task.agv_tasktype == "TaskType_OutsourceOutbound" || task.agv_tasktype == "TaskType_Outbound")//å¤ååºåºåº/ABåºåºåº |
| | | { |
| | | if (task.agv_toaddress == "") |
| | |
| | | }); |
| | | } |
| | | }) |
| | | this.buttons.splice(1, 0, { |
| | | name: "ç§»åº", |
| | | icon: 'el-icon-document', |
| | | type: 'danger', |
| | | onClick: function () { |
| | | this.$refs.gridHeader.detialBox = true; |
| | | } |
| | | }) |
| | | // this.buttons.splice(1, 0, { |
| | | // name: "ç§»åº", |
| | | // icon: 'el-icon-document', |
| | | // type: 'danger', |
| | | // onClick: function () { |
| | | // this.$refs.gridHeader.detialBox = true; |
| | | // } |
| | | // }) |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | sortName: "ID" |
| | | }); |
| | | const editFormFields = ref({"agv_fromaddress":"","agv_toaddress":"","agv_tasktype":"","agv_grades":"","agv_code":""}); |
| | | const editFormOptions = ref([[{"title":"èµ·ç¹å°å","field":"agv_fromaddress","type":"text","required":true}], |
| | | [{"title":"ç»ç¹å°å","field":"agv_toaddress","type":"text","required":true}], |
| | | [{"dataKey":"task_grade","data":[],"title":"ä»»å¡ç级","required":true,"field":"agv_grade","type":"select"}], |
| | | [{"dataKey":"agv_tasktypes","data":[],"title":"ä»»å¡ç±»å","required":true,"field":"agv_tasktype","type":"select"}] |
| | | const editFormOptions = ref([[{ |
| | | title: "NG䏿ä½", |
| | | required: false, |
| | | field: "agv_fromaddress", |
| | | type: "select", |
| | | data: [ |
| | | { key: "X01001003", value: "1åå
NG䏿ä½" }, |
| | | { key: "X02001003", value: "2åå
NG䏿ä½" }, |
| | | { key: "X03001002", value: "3åå
NG䏿ä½" } |
| | | ] |
| | | }, |
| | | // {"title":"NG䏿ä½","field":"agv_fromaddress","type":"text","required":true} |
| | | ], |
| | | |
| | | // [{"title":"ç»ç¹å°å","field":"agv_toaddress","type":"text","required":true}], |
| | | // [{"dataKey":"task_grade","data":[],"title":"ä»»å¡ç级","required":true,"field":"agv_grade","type":"select"}], |
| | | // [{"dataKey":"agv_tasktypes","data":[],"title":"ä»»å¡ç±»å","required":true,"field":"agv_tasktype","type":"select"}] |
| | | // [{"dataKey":"agv_code","data":[],"title":"AGVç¼å·","required":true,"field":"agv_code","type":"select"}] |
| | | ]); |
| | | const searchFormFields = ref({"agv_tasknum":"","agv_fromaddress":"","agv_toaddress":"","agv_tasktype":[],"agv_taskstate":[],"agv_materielid":"","agv_createtime":"","agv_barcode":"","agv_materbarcode":""}); |
| | |
| | | detialBox: false, |
| | | inType: "handle", |
| | | rules: { |
| | | from_address: [{ required: true, message: 'è¯·éæ©èµ·å§å°å', trigger: 'blur' }], |
| | | to_address: [{ required: true, message: 'è¯·éæ©ç®çå°å', trigger: 'blur' }] |
| | | from_address: [{ required: true, message: 'è¯·éæ©NG䏿ä½', trigger: 'blur' }], |
| | | // from_address: [{ required: true, message: 'è¯·éæ©èµ·å§å°å', trigger: 'blur' }], |
| | | // to_address: [{ required: true, message: 'è¯·éæ©ç®çå°å', trigger: 'blur' }] |
| | | }, |
| | | formdata: { |
| | | from_address: "", |
| | |
| | | var _this = this; |
| | | this.$refs.ruleFormRef.validate((valid) => { |
| | | if (valid) { |
| | | _this.http.post("/api/ToMes/AddToFloat3", _this.formdata, "æ£å¨ç§»åº....").then(x => { |
| | | _this.http.post("/api/ToMes/AddToFloat3", _this.formdata, "æ£å¨æ·»å ....").then(x => { |
| | | if (!x.status) return _this.$Message.error(x.message); |
| | | _this.$Message.success("ç§»åºæå!"); |
| | | _this.$Message.success("æ·»å æå!"); |
| | | _this.refresh(); |
| | | }); |
| | | } |
| | |
| | | this.buttons.forEach(x => { |
| | | if(x.value == 'Add') |
| | | { |
| | | x.name = 'æ·»å ä»»å¡' |
| | | x.name = 'NGä»»å¡' |
| | | } |
| | | }); |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | |
| | | [{"title":"çå·","field":"heatNumber","type":"text"}], |
| | | [{"title":"夿³¨","field":"remark"}]]); |
| | | const searchFormFields = ref({"stationCode":"","stationType":"","area":"","enable":"","location_state":[],"bindSN":""}); |
| | | const searchFormOptions = ref([[{"title":"ç¼åæ¶ç¼å·","field":"stationCode","type":"like"},{"title":"车轮SNå·","field":"bindSN","type":"like"},{"dataKey":"materielinfos","data":[],"title":"ç©æç±»å","field":"stationType","type":"select"}],[{"dataKey":"area_name","data":[],"title":"åºå","field":"area","type":"select"},{"dataKey":"location_states","data":[],"title":"è´§ä½ç¶æ","field":"location_state","type":"selectList"},{"dataKey":"status","data":[],"title":"æ¯å¦å¯ç¨","field":"enable","type":"select"}]]); |
| | | const searchFormOptions = ref([[{"title":"ç¼åæ¶ç¼å·","field":"stationCode","type":"like"},{"title":"车轮SNå·","field":"bindSN","type":"like"},{"dataKey":"materielinfos","data":[],"title":"ç©æç±»å","field":"stationType","type":"select"}],[{"dataKey":"area_name","data":[],"title":"åºå","field":"area","type":"selectList"},{"dataKey":"location_states","data":[],"title":"è´§ä½ç¶æ","field":"location_state","type":"selectList"},{"dataKey":"status","data":[],"title":"æ¯å¦å¯ç¨","field":"enable","type":"select"}]]); |
| | | const columns = ref([{field:'id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'}, |
| | | {field:'stationCode',title:'ç¼åæ¶ç¼å·',type:'string',width:110,align:'left',sort:true}, |
| | | {field:'stationType',title:'å¾å·',type:'string',bind:{ key:'materielinfos',data:[]},width:110,align:'left'}, |
| | |
| | | public partial interface Idt_stationinfoService |
| | | { |
| | | WebResponseContent SetStationEnable(object parm); |
| | | WebResponseContent SendAGVTask(object parm); |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.ManageUser; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using StackExchange.Redis; |
| | | using WIDESEA_Comm; |
| | | |
| | | namespace WIDESEA_WMS.Services |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | /// <summary> |
| | | /// æ·»å ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="saveDataModel"></param> |
| | | /// <returns></returns> |
| | | |
| | | #region æ·»å NGä»»å¡ |
| | | public override WebResponseContent Add(SaveModel saveDataModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString(); |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString(); |
| | | var toaddress = saveDataModel.MainData["agv_toaddress"].ToString(); |
| | | var tasktype = saveDataModel.MainData["agv_tasktype"].ToString(); |
| | | var grade = saveDataModel.MainData["agv_grade"].ToInt(); |
| | | var worktype = saveDataModel.MainData["agv_worktype"].ToInt(); |
| | | var station1 = stationinfoRepository.FindFirst(x => x.stationCode == fromaddress); |
| | | var station2 = stationinfoRepository.FindFirst(x => x.stationCode == toaddress); |
| | | if (station1 == null || station2 == null) |
| | | throw new Exception($"èµ·ç¹å°å{fromaddress}æç»ç¹å°å{toaddress}ä¸åå¨ï¼"); |
| | | if (string.IsNullOrEmpty(station1.stationType)) |
| | | throw new Exception($"èµ·ç¹{fromaddress}æªç»å®ç©æç±»åï¼"); |
| | | var task = _repository.Find(t => t.agv_fromaddress == fromaddress |
| | | || t.agv_fromaddress == toaddress |
| | | || t.agv_toaddress == fromaddress |
| | | || t.agv_toaddress == toaddress |
| | | ).Any(); |
| | | if (task) |
| | | throw new Exception("èµ·å§æç®çå°åï¼å·²åå¨ä»»å¡ä¸ï¼"); |
| | | dt_agvtask agvtask = new dt_agvtask(); |
| | | agvtask.agv_id = Guid.NewGuid(); |
| | | agvtask.agv_fromaddress = fromaddress; |
| | | agvtask.agv_toaddress = toaddress; |
| | | agvtask.agv_tasknum = IdenxManager.GetTaskNo("KH-"); |
| | | agvtask.agv_TrayStatus = station1.tray_status; |
| | | agvtask.agv_Traytype = station1.tray_type; |
| | | agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString(); |
| | | agvtask.agv_tasktype = tasktype; |
| | | agvtask.agv_worktype = worktype;//å·¥ä½ç±»å |
| | | agvtask.bindSN = station1.bindSN; |
| | | agvtask.agv_materielid = station1.stationType;//ç©æç±»å |
| | | agvtask.agv_qty = station1.quantity; |
| | | agvtask.agv_createtime = DateTime.Now; |
| | | agvtask.agv_grade = grade;//ä»»å¡ä¼å
级 |
| | | agvtask.agv_userid = UserContext.Current.UserName; |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | var station = stationinfoRepository.Find(x => x.stationCode == fromaddress).FirstOrDefault(); |
| | | if (_repository.Find(x => x.agv_fromaddress == fromaddress || x.agv_toaddress == fromaddress).Any()) |
| | | throw new Exception($"è´§ä½{fromaddress}å·²åå¨ä»»å¡ï¼"); |
| | | if (station == null) throw new Exception($"æªæ¾å°è´§ä½{fromaddress}ï¼"); |
| | | if (!station.enable) throw new Exception($"è´§ä½{fromaddress}æªå¯ç¨ï¼"); |
| | | if (station.quantity < 1) throw new Exception($"è´§ä½{fromaddress}æ 车轮ï¼"); |
| | | var Work = workinfoRepository.Find(x => x.workOrder == station.Number && x.processCode == "17").FirstOrDefault(); |
| | | if (Work == null) throw new Exception($"æªæ¾å°è´§ä½{fromaddress}çæºå 工工åä¿¡æ¯"); |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | | agv_fromaddress = station.stationCode, |
| | | agv_id = Guid.NewGuid(), |
| | | agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"), |
| | | agv_grade = 1, |
| | | agv_createtime = DateTime.Now, |
| | | agv_taskstate = "Queue", |
| | | agv_materielid = station.stationType, |
| | | agv_qty = station.quantity, |
| | | agv_tasktype = "TaskType_OutsourceInbound", |
| | | agv_toaddress = "", |
| | | agv_userid = UserContext.Current.UserName, |
| | | bindSN = station.bindSN, |
| | | agv_worktype = Convert.ToInt32(Work.processCode), |
| | | agv_materbarcode = Work.materialCode, |
| | | agv_Traytype = station.tray_type, |
| | | jobID = station.Number, |
| | | agv_TrayStatus = station.tray_status |
| | | }; |
| | | _repository.Add(agvtask, true); |
| | | station.location_state = LocationStateEnum.InBusy.ToString(); |
| | | stationinfoRepository.Update(station, true); |
| | | content.OK(); |
| | | WriteDBLog.Success($"æå¨æ·»å ä»»å¡", new { æ°æ® = saveDataModel }, "WMS", UserContext.Current.UserName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteDBLog.Error($"æå¨æ·»å ä»»å¡", new { æ°æ® = saveDataModel, å¼å¸¸ä¿¡æ¯ = ex.Message }, "WMS", UserContext.Current.UserName); |
| | | content.Error(ex.Message); |
| | | content.Message = ex.Message; |
| | | } |
| | | |
| | | return content; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ·»å ä»»å¡ |
| | | /// <summary> |
| | | /// æ·»å ä»»å¡ |
| | | /// </summary> |
| | | /// <param name="saveDataModel"></param> |
| | | /// <returns></returns> |
| | | //public override WebResponseContent Add(SaveModel saveDataModel) |
| | | //{ |
| | | // WebResponseContent content = new WebResponseContent(); |
| | | // try |
| | | // { |
| | | // VOLContext context = new VOLContext(); |
| | | // Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | // var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString(); |
| | | // var toaddress = saveDataModel.MainData["agv_toaddress"].ToString(); |
| | | // var tasktype = saveDataModel.MainData["agv_tasktype"].ToString(); |
| | | // var grade = saveDataModel.MainData["agv_grade"].ToInt(); |
| | | // var worktype = saveDataModel.MainData["agv_worktype"].ToInt(); |
| | | // var station1 = stationinfoRepository.FindFirst(x => x.stationCode == fromaddress); |
| | | // var station2 = stationinfoRepository.FindFirst(x => x.stationCode == toaddress); |
| | | // if (station1 == null || station2 == null) |
| | | // throw new Exception($"èµ·ç¹å°å{fromaddress}æç»ç¹å°å{toaddress}ä¸åå¨ï¼"); |
| | | // if (string.IsNullOrEmpty(station1.stationType)) |
| | | // throw new Exception($"èµ·ç¹{fromaddress}æªç»å®ç©æç±»åï¼"); |
| | | // var task = _repository.Find(t => t.agv_fromaddress == fromaddress |
| | | // || t.agv_fromaddress == toaddress |
| | | // || t.agv_toaddress == fromaddress |
| | | // || t.agv_toaddress == toaddress |
| | | // ).Any(); |
| | | // if (task) |
| | | // throw new Exception("èµ·å§æç®çå°åï¼å·²åå¨ä»»å¡ä¸ï¼"); |
| | | // dt_agvtask agvtask = new dt_agvtask(); |
| | | // agvtask.agv_id = Guid.NewGuid(); |
| | | // agvtask.agv_fromaddress = fromaddress; |
| | | // agvtask.agv_toaddress = toaddress; |
| | | // agvtask.agv_tasknum = IdenxManager.GetTaskNo("KH-"); |
| | | // agvtask.agv_TrayStatus = station1.tray_status; |
| | | // agvtask.agv_Traytype = station1.tray_type; |
| | | // agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString(); |
| | | // agvtask.agv_tasktype = tasktype; |
| | | // agvtask.agv_worktype = worktype;//å·¥ä½ç±»å |
| | | // agvtask.bindSN = station1.bindSN; |
| | | // agvtask.agv_materielid = station1.stationType;//ç©æç±»å |
| | | // agvtask.agv_qty = station1.quantity; |
| | | // agvtask.agv_createtime = DateTime.Now; |
| | | // agvtask.agv_grade = grade;//ä»»å¡ä¼å
级 |
| | | // agvtask.agv_userid = UserContext.Current.UserName; |
| | | // _repository.Add(agvtask, true); |
| | | // content.OK(); |
| | | // WriteDBLog.Success($"æå¨æ·»å ä»»å¡", new { æ°æ® = saveDataModel }, "WMS", UserContext.Current.UserName); |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // WriteDBLog.Error($"æå¨æ·»å ä»»å¡", new { æ°æ® = saveDataModel, å¼å¸¸ä¿¡æ¯ = ex.Message }, "WMS", UserContext.Current.UserName); |
| | | // content.Error(ex.Message); |
| | | // } |
| | | |
| | | // return content; |
| | | //} |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.AspNetCore.Http; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using System.Configuration; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Core.ManageUser; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | |
| | | namespace WIDESEA_WMS.Services |
| | | { |
| | |
| | | //å¤ç§æ·ä¼ç¨å°è¿init代ç ï¼å
¶ä»æ
åµå¯ä»¥ä¸ç¨ |
| | | //base.Init(dbRepository); |
| | | } |
| | | |
| | | public override WebResponseContent Del(object[] keys, bool delList = true) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | string str = ""; |
| | | try |
| | | { |
| | | List<string> KeyList = new List<string>(); |
| | | foreach ( string key in keys ) |
| | | { |
| | | KeyList.Add(key); |
| | | } |
| | | var inventoryList= _repository.Find(x=>KeyList.Contains(x.ID.ToString())).ToList(); |
| | | str = $"{string.Join('ã', inventoryList.Select(t => t.SN).ToArray())}"; |
| | | content = base.Del(keys, delList); |
| | | WriteDBLog.Write($"æå¨å é¤åºå ", str, LogState.Sucess, "WMS", UserContext.Current.UserName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteDBLog.Write($"æå¨å é¤åºå ", new { éè¯¯ä¿¡æ¯ = ex.Message, æ°æ® = str }, LogState.Error, "WMS", UserContext.Current.UserName); |
| | | } |
| | | |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | var Tel = UserContext.Current.UserInfo.Tel;//ç¼åæ¶æé |
| | | var Tel = UserContext.Current.UserInfo.Tel; |
| | | var data = JsonConvert.DeserializeObject<Parm>(json.ToString()); |
| | | //var updateList = FreeDB.DB.Select<dt_stationinfo>().Where(t => data.data.Contains(t.id.ToString())).ToList(); |
| | | var updateList = _repository.Find(x => data.data.Contains(x.id.ToString())).ToList(); |
| | |
| | | } |
| | | return webResponse; |
| | | } |
| | | |
| | | public WebResponseContent SendAGVTask(object json) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | return webResponse; |
| | | } |
| | | |
| | | public override WebResponseContent Add(SaveModel saveDataModel) |
| | | { |
| | | |
| | | return base.Add(saveDataModel); |
| | | } |
| | | |
| | | |
| | | |
| | | public override WebResponseContent Update(SaveModel saveModel) |
| | | { |
| | |
| | | station.stationType = string.Empty; |
| | | station.heatNumber = string.Empty; |
| | | station.Number = string.Empty; |
| | | station.billetID = string.Empty; |
| | | station.tray_status = string.Empty; |
| | | station.bindSN = string.Empty; |
| | | station.quantity = 0; |
| | |
| | | { |
| | | return dt_stationinfoService.Instance.SetStationEnable(parm); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸åNGä»»å¡ |
| | | /// </summary> |
| | | /// <param name="parm"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("SendAGVTask")] |
| | | public WebResponseContent SendAGVTask([FromBody] object parm) |
| | | { |
| | | return dt_stationinfoService.Instance.SendAGVTask(parm); |
| | | } |
| | | } |
| | | } |