Wms/Model/InterFaceModel/HttpModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.BLL/BllTransServer/NoticeServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.BLL/BllTransServer/RcsServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/WMS.IBLL/IBllTransServer/IRcsServer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Wms/Wms/Controllers/DownApiController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Wms/Model/InterFaceModel/HttpModel.cs
@@ -850,6 +850,7 @@ { public string code { get; set; } public string message { get; set; } public string data { get; set; } public string reqCode { get; set; } } #endregion Wms/WMS.BLL/BllTransServer/NoticeServer.cs
@@ -175,25 +175,7 @@ { #region 入库完成 case "0": //入库单明细信息 var noticeDetail = Db.Queryable<BllArrivalNoticeDetail>().First(w => w.Id == taskInfo.NoticeDetailNo); if (noticeDetail == null) { resultModel.Message = "该任务对应的入库单明细不存在!"; return resultModel; } //入库单信息 var notice = Db.Queryable<BllArrivalNotice>().First(w => w.ASNNo == noticeDetail.ASNNo); if (notice == null) { resultModel.Message = "该任务对应的入库单不存在!"; return resultModel; } if (notice.Status == "3" || notice.Status == "4") { resultModel.Message = "该任务对应的入库单已执行完成!"; return resultModel; } //目标储位信息 var locatInfo = Db.Queryable<SysStorageLocat>().First(w => w.LocatNo == taskInfo.EndLocat && w.IsDel == "0"); if (locatInfo == null) @@ -201,51 +183,13 @@ resultModel.Message = "目标储位信息不存在!"; return resultModel; } //库存明细 var sd1 = Db.Queryable<DataStockDetail>().First(w => w.PalletNo == taskInfo.PalletNo); if (sd1 == null) { sd1 = new DataStockDetail() { LotNo = noticeDetail.LotNo, LotText = noticeDetail.LotText, SupplierLot = noticeDetail.SupplierLot, SkuNo = noticeDetail.SkuNo, SkuName = noticeDetail.SkuName, Standard = noticeDetail.Standard, Qty = 1, LockQty = 0, FrozenQty = 0, InspectQty = 0, ASNNo = noticeDetail.ASNNo, ASNDetailNo = noticeDetail.Id, WareHouseNo = locatInfo.WareHouseNo,//所属仓库 RoadwayNo = locatInfo.RoadwayNo,//所属巷道 AreaNo = locatInfo.AreaNo,//所属区域 LocatNo = locatInfo.LocatNo,//储位地址 PalletNo = taskInfo.PalletNo, PalletNo2 = "", PalletNo3 = "", PalletTags = "0", CompleteTime = comTime, ProductionTime = null, ExpirationTime = null, Status = "0", InspectMark = "0", InspectStatus = "0",//待检验 BitPalletMark = "0", PackagNo = "", IsBale = "0", IsBelt = "0", PalletStatus = "2", IsDel = "0", CreateUser = 0, CreateTime = comTime }; //插入库存明细 Db.Insertable(sd1).ExecuteCommand(); resultModel.Message = $"该桶对应的库存信息不存在,桶号:{taskInfo.PalletNo}!"; return resultModel; } else { @@ -253,8 +197,6 @@ sd1.LockQty = 0; sd1.FrozenQty = 0; sd1.InspectQty = 0; sd1.ASNNo = noticeDetail.ASNNo; sd1.ASNDetailNo = noticeDetail.Id; sd1.WareHouseNo = locatInfo.WareHouseNo;//所属仓库 sd1.RoadwayNo = locatInfo.RoadwayNo;//所属巷道 sd1.AreaNo = locatInfo.AreaNo;//所属区域 @@ -266,37 +208,53 @@ //修改库存明细 Db.Updateable(sd1).ExecuteCommand(); } noticeDetail.CompleteQty += 1;//完成数量 noticeDetail.Status = "1";//0:等待执行 1:正在执行 2:执行完成 if (noticeDetail.CompleteQty >= noticeDetail.Qty) { noticeDetail.Status = "2"; noticeDetail.CompleteTime = comTime; } noticeDetail.UpdateUser = 0; noticeDetail.UpdateTime = comTime; //更新入库单明细 Db.Updateable(noticeDetail).ExecuteCommand(); notice.UpdateUser = 0; notice.UpdateTime = comTime; if (notice.Status == "0") { notice.Status = "1"; } var asnDetailNum = Db.Queryable<BllArrivalNoticeDetail>().Count(m => m.IsDel == "0" && m.ASNNo == noticeDetail.ASNNo && m.Status != "2"); if (asnDetailNum == 0) { notice.Status = "2"; notice.CompleteTime = comTime;//完成时间 } //更新入库单 Db.Updateable(notice).ExecuteCommand(); locatInfo.Status = "1";//有物品 //更新储位状态 Db.Updateable(locatInfo).ExecuteCommand(); //入库单明细信息 var noticeDetail = Db.Queryable<BllArrivalNoticeDetail>().First(w => w.Id == taskInfo.NoticeDetailNo); if (noticeDetail != null) { //入库单信息 var notice = Db.Queryable<BllArrivalNotice>().First(w => w.ASNNo == noticeDetail.ASNNo); if (notice == null) { resultModel.Message = "该任务对应的入库单不存在!"; return resultModel; } if (notice.Status == "3" || notice.Status == "4") { resultModel.Message = "该任务对应的入库单已执行完成!"; return resultModel; } noticeDetail.CompleteQty += 1;//完成数量 noticeDetail.Status = "1";//0:等待执行 1:正在执行 2:执行完成 if (noticeDetail.CompleteQty >= noticeDetail.Qty) { noticeDetail.Status = "2"; noticeDetail.CompleteTime = comTime; } noticeDetail.UpdateUser = 0; noticeDetail.UpdateTime = comTime; //更新入库单明细 Db.Updateable(noticeDetail).ExecuteCommand(); notice.UpdateUser = 0; notice.UpdateTime = comTime; if (notice.Status == "0") { notice.Status = "1"; } var asnDetailNum = Db.Queryable<BllArrivalNoticeDetail>().Count(m => m.IsDel == "0" && m.ASNNo == noticeDetail.ASNNo && m.Status != "2"); if (asnDetailNum == 0) { notice.Status = "2"; notice.CompleteTime = comTime;//完成时间 } //更新入库单 Db.Updateable(notice).ExecuteCommand(); } #region 质检请验,去掉MES //var qualityRequest = Db.Queryable<BllQualityInspectionRequest>().First(m => m.IsDel == "0" && m.SkuNo == noticeDetail.SkuNo && m.LotNo == noticeDetail.LotNo && m.SupplierLot == noticeDetail.SupplierLot); @@ -394,25 +352,7 @@ #region 出库完成 case "1": //出库单明细信息 var exNoticeDetail = Db.Queryable<BllExportNoticeDetail>().First(w => w.Id == taskInfo.NoticeDetailNo); if (exNoticeDetail == null) { resultModel.Message = "该任务对应的出库单明细不存在!"; return resultModel; } //出库单信息 var exNotice = Db.Queryable<BllExportNotice>().First(w => w.SONo == exNoticeDetail.SONo); if (exNotice == null) { resultModel.Message = "该任务对应的出库单不存在!"; return resultModel; } if (exNotice.Status == "4" || exNotice.Status == "5") { resultModel.Message = "该任务对应的出库单已执行完成!"; return resultModel; } //起始储位信息 var startLocatInfo = Db.Queryable<SysStorageLocat>().First(w => w.LocatNo == taskInfo.StartLocat && w.IsDel == "0"); if (startLocatInfo == null) @@ -427,24 +367,6 @@ resultModel.Message = "库存信息不存在!"; return resultModel; } //修改出库单明细拣货数量 exNoticeDetail.CompleteQty += sd2.Qty; Db.Updateable(exNoticeDetail).ExecuteCommand(); exNotice.UpdateUser = 0; exNotice.UpdateTime = comTime; if (exNotice.Status == "0" || exNotice.Status == "1" || exNotice.Status == "2") { exNotice.Status = "3";//更改为正在执行 } var num = Db.Queryable<BllExportNoticeDetail>().Count(m => m.IsDel == "0" && m.SONo == exNoticeDetail.SONo && m.CompleteQty < m.Qty); if (num <= 0) { exNotice.Status = "4"; //更改为执行完成 } //修改出库单信息 Db.Updateable(exNotice).ExecuteCommand(); sd2.Qty = 0; sd2.LockQty = 0; sd2.FrozenQty = 0; @@ -462,7 +384,40 @@ startLocatInfo.Status = "0";//空储位 //修改起始储位状态 Db.Updateable(startLocatInfo).ExecuteCommand(); //出库单明细信息 var exNoticeDetail = Db.Queryable<BllExportNoticeDetail>().First(w => w.Id == taskInfo.NoticeDetailNo); if (exNoticeDetail != null) { //出库单信息 var exNotice = Db.Queryable<BllExportNotice>().First(w => w.SONo == exNoticeDetail.SONo); if (exNotice == null) { resultModel.Message = "该任务对应的出库单不存在!"; return resultModel; } if (exNotice.Status == "4" || exNotice.Status == "5") { resultModel.Message = "该任务对应的出库单已执行完成!"; return resultModel; } exNotice.UpdateUser = 0; exNotice.UpdateTime = comTime; if (exNotice.Status == "0" || exNotice.Status == "1" || exNotice.Status == "2") { exNotice.Status = "3";//更改为正在执行 } var num = Db.Queryable<BllExportNoticeDetail>().Count(m => m.IsDel == "0" && m.SONo == exNoticeDetail.SONo && m.CompleteQty < m.Qty); if (num <= 0) { exNotice.Status = "4"; //更改为执行完成 } //修改出库单信息 Db.Updateable(exNotice).ExecuteCommand(); //修改出库单明细拣货数量 exNoticeDetail.CompleteQty += sd2.Qty; Db.Updateable(exNoticeDetail).ExecuteCommand(); } break; #endregion @@ -492,7 +447,7 @@ sd3.RoadwayNo = endLocatInfo2.RoadwayNo;//所属巷道 sd3.AreaNo = endLocatInfo2.AreaNo;//所属区域 sd3.LocatNo = endLocatInfo2.LocatNo;//储位地址 if (endLocatInfo2.AreaNo.Contains("01"))//洁净区 if (endLocatInfo2.AreaNo.Contains("01"))//净桶区 { sd3.PalletStatus = "0"; } Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -28,7 +28,7 @@ /// <param name="warehouseno">库区</param> /// <param name="type">叫料类型</param> /// <returns></returns> public void GetPalletNo(Pallnetmsg model,string url) public void GetPalletNo(Pallnetmsg model,string url,out string taskNo) { DataStockDetail pallet = new DataStockDetail(); try @@ -63,15 +63,6 @@ { throw new Exception("批次号为空!"); } /*BllArrivalNoticeDetail ArriveMes = new BllArrivalNoticeDetail(); //判断该批次是否有对应入库单 sql = $"select * from BllArrivalNoticeDetail where LotNo = '{pallnetmsg.LotNo}' order by CreateTime desc"; ArriveMes = Db.Ado.SqlQuery<BllArrivalNoticeDetail>(sql).FirstOrDefault(); if (ArriveMes == null) { throw new Exception("该批次没有对应的入库单"); } noticeno = ArriveMes.Id.ToString();*/ //查找库存中是否有可用的此批次的混料桶 sql= $@"select PalletNo,LocatNo from DataStockDetail where LotNo = '{model.LotNo}'and (AreaNo like '%02' or AreaNo like '%12' or AreaNo like '%22' or AreaNo like '%32') and WareHouseNo = '{house}' and status = '0' and PalletStatus = '1' order by CompleteTime desc"; @@ -160,7 +151,7 @@ Crtype = "1", Noticedetailno = int.Parse(noticeno), }; CreateLotTask(task2, url); CreateLotTask(task2, url, out taskNo); return; } break; @@ -178,7 +169,7 @@ Noticedetailno = int.Parse(noticeno), LotNo = model.LotNo, }; CreateLotTask(task, url); CreateLotTask(task, url, out taskNo); return; } catch (Exception ex) @@ -232,7 +223,8 @@ Crtype = "2", Noticedetailno = 0, }; CreateLotTask(ztask,url); string taskNo = ""; CreateLotTask(ztask, url, out taskNo); statrtLocat.Status = "3";//出库中 //修改起始储位状态 @@ -276,7 +268,8 @@ Noticedetailno = 0, LotNo = "", }; CreateLotTask(task,url); string taskNo = ""; CreateLotTask(task,url, out taskNo); } catch (Exception ex) { @@ -289,7 +282,7 @@ /// </summary> /// <param name="PalletNo"></param> /// <returns></returns> public void ApplyLocatNo(Pallnetmsg model,string url) public void ApplyLocatNo(Pallnetmsg model,string url, out string taskNo) { var sql = $"select LocatNo from SysStorageLocat where status = '0'"; var sql2 = ""; @@ -369,7 +362,7 @@ Noticedetailno = int.Parse(noticeno), LotNo = model.LotNo, }; CreateLotTask(task,url); CreateLotTask(task, url, out taskNo); } catch (Exception ex) { @@ -382,7 +375,7 @@ /// </summary> /// <param name="req"></param> /// <returns></returns> public void CreateLotTask(TaskDetial taskDetial,string url) public void CreateLotTask(TaskDetial taskDetial,string url,out string taskNo) { try { @@ -422,6 +415,20 @@ msg = "脏桶" + typeDesc + "任务"; break; } #region 储位信息 //起始储位地址信息 var startLoction = Db.Queryable<SysStorageLocat>().First(w => w.IsDel=="0" && w.LocatNo == taskDetial.Startport); if (startLoction == null) { throw new Exception($"起始目标储位信息不存在,桶号:{taskDetial.Startport}"); } //目标储位地址信息 var endLoction = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == taskDetial.Endport); if (endLoction == null) { throw new Exception($"目标目标储位信息不存在,桶号:{taskDetial.Endport}"); } #endregion var sql = ""; var sql2 = ""; var ordertype = "3"; @@ -477,6 +484,7 @@ NoticeDetailNo = int.Parse(taskDetial.Noticedetailno.ToString()), Msg = msg, //关键信息 }; taskNo = logTaskEntry.TaskNo; #region 呼叫小车代码 List<AgvSchedulingTask> agvTaskList = new List<AgvSchedulingTask>(); @@ -487,14 +495,12 @@ path1.positionCode = taskDetial.Startport; if (taskDetial.Crtype == "1")//叫桶(桶出库) { path1.type = "00"; path1.type = "05"; } else//申请储位(桶入库) { path1.type = "05"; } pahtList.Add(path1); //目标位置 @@ -506,10 +512,10 @@ } else//申请储位(桶入库) { path2.type = "00"; path2.type = "05"; } pahtList.Add(path2); //下车任务单 AgvSchedulingTask agvTask = new AgvSchedulingTask(); agvTask.reqCode = logTaskEntry.TaskNo;//任务号 @@ -518,7 +524,7 @@ agvTask.wbCode = ""; agvTask.positionCodePath = pahtList;//小车路径 agvTask.podCode = ""; agvTask.userCallCode = taskDetial.Endport;//目标位置 agvTask.userCallCode = "";//taskDetial.Endport;//目标位置 if (taskDetial.Crtype == "1")//叫桶(桶出库) { agvTask.taskTyp = "Z3";//任务类型 线边到托盘收集器 Z1, 托盘垛申请入库 Z2 @@ -550,23 +556,14 @@ //请求成功修改任务表相应字段状态 logTaskEntry.IsSuccess = 1; logTaskEntry.BackDate = DateTime.Now; logTaskEntry.Status = "1"; if (taskDetial.Crtype == "0" || taskDetial.Crtype == "2") { sql = $"UPDATE SysStorageLocat SET Status = '2' where LocatNo = '{taskDetial.Endport}'"; if (taskDetial.Type == "2") { sql2 = $"UPDATE DataStockDetail SET PalletStatus = '{taskDetial.Type}'" + $"where PalletNo = '{taskDetial.Pallno}'"; Db.Ado.ExecuteCommand(sql2); } } else { sql = $"UPDATE SysStorageLocat SET Status = '3' where LocatNo = '{taskDetial.Startport}' "; } logTaskEntry.Status = "1"; Db.Insertable(logTaskEntry).ExecuteCommand(); Db.Ado.ExecuteCommand(sql); startLoction.Status = "3";//出库中 Db.Updateable(startLoction).ExecuteCommand(); endLoction.Status = "2";//入库中 Db.Updateable(endLoction).ExecuteCommand(); } if (agvModel.Code == "1") { Wms/WMS.IBLL/IBllTransServer/IRcsServer.cs
@@ -14,7 +14,7 @@ /// <param name="warehouseno">库区</param> /// <param name="type">叫料类型</param> /// <returns></returns> public void GetPalletNo(Pallnetmsg pallnetmsg, string url); public void GetPalletNo(Pallnetmsg pallnetmsg, string url, out string taskNo); /// <summary> /// 将净桶改为脏桶并拉到脏桶区 @@ -34,6 +34,6 @@ /// </summary> /// <param name="PalletNo"></param> /// <returns></returns> public void ApplyLocatNo(Pallnetmsg pallnetmsg, string url); public void ApplyLocatNo(Pallnetmsg pallnetmsg, string url ,out string taskNo); } } Wms/Wms/Controllers/DownApiController.cs
@@ -658,7 +658,6 @@ public IActionResult GetPalletNo(Pallnetmsg pallmsg) { var logStr = $@".\log\AGV\AGV申请叫桶" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; var result = new ErpModel { Success = -1, Message = "", }; try { var jsonData = JsonConvert.SerializeObject(pallmsg); @@ -666,25 +665,21 @@ if (string.IsNullOrWhiteSpace(pallmsg.Location)) { result.Message = "叫料位置为空!"; return Ok(result); return Ok(new AgvResultModel { code = "1", message = "叫料位置为空!", data = "", reqCode = "" }); } if (string.IsNullOrWhiteSpace(pallmsg.Type)) { result.Message = "任务类型为空!"; return Ok(result); return Ok(new AgvResultModel { code = "1", message = "任务类型为空!", data = "", reqCode = "" }); } _rcsserver.GetPalletNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask); result.Success = 0; result.Message = "叫桶成功!"; return Ok(result); string taskNo = ""; _rcsserver.GetPalletNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask, out taskNo); return Ok(new AgvResultModel { code = "0", message = "叫桶成功", data = taskNo, reqCode = "" }); } catch (Exception e) { LogFile.SaveLogToFile($"AGV申请叫桶异常:( {e.Message} ),", logStr); result.Message = e.Message; return Ok(result); return Ok(new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" }); } } /// <summary> @@ -758,7 +753,6 @@ { var logStr = $@".\log\AGV\AGV申请储位" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; var result = new ErpModel { Success = -1, Message = "" }; try { var jsonData = JsonConvert.SerializeObject(pallmsg); @@ -766,30 +760,26 @@ if (string.IsNullOrWhiteSpace(pallmsg.Location)) { result.Message = "申请位置为空!"; return Ok(result); return Ok(new AgvResultModel { code = "1", message = "申请位置为空!", data = "", reqCode = "" }); } if (string.IsNullOrWhiteSpace(pallmsg.Type)) { result.Message = "任务类型为空!"; return Ok(result); return Ok(new AgvResultModel { code = "1", message = "任务类型为空!", data = "", reqCode = "" }); } if (string.IsNullOrWhiteSpace(pallmsg.PalletNo)) { result.Message = "申请托盘号为空!"; return Ok(result); return Ok(new AgvResultModel { code = "1", message = "申请托盘号为空!", data = "", reqCode = "" }); } _rcsserver.ApplyLocatNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask); result.Success = 0; result.Message = "申请储位成功!"; return Ok(result); string taskNo = ""; _rcsserver.ApplyLocatNo(pallmsg, _config.AgvHost + _config.GenAgvSchedulingTask, out taskNo); return Ok(new AgvResultModel { code = "0", message = "申请储位成功!", data = taskNo, reqCode = "" }); } catch (Exception e) { LogFile.SaveLogToFile($"AGV申请储位异常:( {e.Message} ),", logStr); result.Message = e.Message; return Ok(result); return Ok(new AgvResultModel { code = "1", message = e.Message, data = "", reqCode = "" }); } }