排查并修改取消出库任务问题,注释向wcs下发任务代码。修改因未选出库口导致重复点击问题。编写出库移库任务完成逻辑代码。
6个文件已修改
178 ■■■■ 已修改文件
HTML/views/SOSetting/ExportNotice.html 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/LogServer/TaskServer.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/ILogServer/ITaskServer.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BllSoController.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HTML/views/SOSetting/ExportNotice.html
@@ -1398,25 +1398,19 @@
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        isChongFu= true;
                                        return;
                                    }
                                    if(isNeedUnpack=='1'){
                                        if(pa==''){
                                            layer.msg("请选择出库口", {
                                                icon: 2,
                                                time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                            });
                                            return;
                                        }
                                    }
                                }else{
                                    if(pa==''){
                                        layer.msg("请选择出库口", {
                                            icon: 2,
                                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                        });
                                        return;
                                    }
                                }
                                console.log($("#PickingArea").val())
                                if($("#PickingArea").val() == '')
                                {
                                    layer.msg("请选择出库口", {
                                        icon: 2,
                                        time: 2000 //2秒关闭(如果不配置,默认是3秒)
                                    });
                                    isChongFu= true;
                                    return;
                                }
                                var param = {
                                    soNo: soNo, 
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -1466,11 +1466,11 @@
                                toLocation = outMode;//出库口
                            }
                        }
                        else
                        else
                        {
                            unstackingMode2 = "1";//非成品出库走PDA拆垛
                            toLocation = outMode;//出库口
                        }
                        }
                        #endregion
                        // 储位号
@@ -2087,6 +2087,86 @@
            }
        }
        /// <summary>
        /// wcs返回的成功信号(移库成功)
        /// </summary>
        /// <param name="taskNo">任务号</param>
        /// <param name="userId">操作人</param>
        /// <exception cref="Exception"></exception>
        public void RelocationSuccess(string taskNo, int userId)
        {
            try
            {
                //当前任务信息
                var task = Db.Queryable<LogTask>().First(m => m.TaskNo == taskNo && m.IsDel == "0");
                if (task == null)
                {
                    throw new Exception($"未查询到任务号为:‘{taskNo}’的任务信息");
                }
                if (task.Status == "2")
                {
                    throw new Exception("当前任务已完成");
                }
                Db.BeginTran();
                //库存中当前托盘的信息
                var stockDetail = Db.Queryable<DataStockDetail>().Where(m => m.PalletNo == task.PalletNo).ToList();
                //当前任务中的目标储位信息
                //当前任务中的原储位
                var locate = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == task.StartLocat);
                if (locate == null)
                {
                    throw new Exception($"WMS系统中没有该{task.StartLocat}储位对应的信息");
                }
                var locate2 = Db.Queryable<SysStorageLocat>().First(m => m.LocatNo == task.EndLocat);
                if (locate2 == null)
                {
                    throw new Exception($"WMS系统中没有该{task.EndLocat}储位对应的信息");
                }
                try
                {
                    task.Status = "2";//任务状态
                    task.IsSend = 0;
                    task.IsCancel = 0;
                    task.IsFinish = 0;
                    task.FinishDate = DateTime.Now;//完成时间
                    Db.Updateable(task).ExecuteCommand();
                    #region 修改储位状态
                    //原储位改为空储位 0
                    locate.Status = "0";
                    Db.Updateable(locate).ExecuteCommand();
                    //目标储位改为有货物 1
                    locate2.Status = "1";
                    Db.Updateable(locate2).ExecuteCommand();
                    foreach (var item in stockDetail)
                    {
                        item.WareHouseNo = locate2.WareHouseNo;
                        item.AreaNo = locate2.AreaNo;
                        item.RoadwayNo = locate2.RoadwayNo;
                        item.LocatNo = locate2.LocatNo;
                    }
                    Db.Updateable(stockDetail).ExecuteCommand();
                    #endregion
                    Db.CommitTran();
                }
                catch (Exception ex)
                {
                    Db.RollbackTran();
                    throw new Exception(ex.Message);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("完成反馈失败:" + ex.Message);
            }
        }
        //重新下发出库任务
        public OutCommandDto AgainSendSoTask(string taskNo, int userId, string url)
        {
@@ -2454,11 +2534,11 @@
                            {
                                stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo && m.LotNo == detail.LotNo && m.IsDel == "0").ToList();
                            }
                        }
                        else
                        {
                            stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo  && m.IsDel == "0").ToList(); //&& string.IsNullOrWhiteSpace(m.LotNo)
                            stockDetail = stockDetail.Where(m => m.SkuNo == detail.SkuNo && m.IsDel == "0").ToList(); //&& string.IsNullOrWhiteSpace(m.LotNo)
                        }
                        if (stockDetail.Count < 1)
@@ -2478,7 +2558,7 @@
                        {
                            stockDetail = stockDetail.Where(m => m.InspectStatus == "2").ToList();
                        }
                        #region 包装信息
                        var pack = packList.FirstOrDefault(p => p.PackagNo == detail.PackagNo);
@@ -2575,17 +2655,17 @@
                                if (string.IsNullOrWhiteSpace(detail.LotNo))
                                {
                                    detail.LotNo = s.LotNo;
                                }
                                else
                                {
                                    if (!detail.LotNo.Contains(s.LotNo))
                                    {
                                        detail.LotNo += ";" + s.LotNo;
                                        detail.LotNo += ";" + s.LotNo;
                                    }
                                }
                            }
                        }
                        detail.AllotQty += qty;
                        detail.UpdateUser = userId;
@@ -2594,7 +2674,7 @@
                        {
                            detail.Status = "1";
                        }
                        //库存总表
                        //var stock = Db.Queryable<DataStock>().First(d => d.IsDel == "0" && d.SkuNo == detail.SkuNo && d.LotNo == detail.LotNo);
                        //stock.LockQty += qty;
@@ -3071,10 +3151,7 @@
            var lie = int.Parse(oldAddress.Substring(2, 2));
            var ceng = int.Parse(oldAddress.Substring(4, 2));
            var sqlString = $@"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng}))  as distNum
                                from SysStorageLocat
                                where Flag = '0' and Status = '0' and Depth = '02' and RoadwayNo = '{roadWay}' and AreaNo in '{category}'
                                order by distNum;";
            var sqlString = $@"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng}))  as distNum from SysStorageLocat where Flag = '0' and Status = '0' and Depth = '02' and RoadwayNo = '{roadWay}' and AreaNo in ('{category.AreaNo}') order by distNum;";
            var addressModels = Db.Ado.SqlQuery<AddressCls>(sqlString).ToList();
            if (addressModels.Count > 0)   // 判断同巷道内排空库位
Wms/WMS.BLL/LogServer/TaskServer.cs
@@ -136,5 +136,23 @@
                throw new Exception(e.Message);
            }
        }
        public string GetTaskType(string taskNo)
        {
            try
            {
                var task = Db.Queryable<LogTask>().First(m => m.TaskNo == taskNo);
                if (task == null)
                {
                    throw new Exception($"未查询到{taskNo}任务号的任务信息");
                }
                return task.Type;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
    }
}
Wms/WMS.IBLL/IBllSoServer/IExportNoticeServer.cs
@@ -136,6 +136,13 @@
        void ExportSuccess(string taskNo,int userId);
        /// <summary>
        /// wcs返回的成功信号或手动完成(移库成功)
        /// </summary>
        /// <param name="taskNo"></param>
        /// <param name="userId"></param>
        void RelocationSuccess(string taskNo, int userId);
        /// <summary>
        /// 重新下发出库任务
        /// </summary>
        /// <param name="taskNo">任务号</param> 
Wms/WMS.IBLL/ILogServer/ITaskServer.cs
@@ -44,5 +44,12 @@
        /// <param name="taskNo">任务号</param>
        /// <returns>0 入库单 1 出库单  2 盘点单  3 移库单</returns>
        string GetTaskOrderType(string taskNo);
        /// <summary>
        /// 获取任务的类型
        /// </summary>
        /// <param name="taskNo">任务号</param>
        /// <returns>0 入库任务 1 出库任务  2移库任务</returns>
        public string GetTaskType(string taskNo);
    }
}
Wms/Wms/Controllers/BllSoController.cs
@@ -697,8 +697,19 @@
                {
                    return Ok(new { code = 1, msg = "未获取到当前操作人信息" });
                }
                _exNoticeSvc.ExportSuccess(taskNo, int.Parse(userId));
                var type = _taskSvc.GetTaskType(taskNo);
                if (type == "1")//出库完成
                {
                    _exNoticeSvc.ExportSuccess(taskNo, int.Parse(userId));
                }
                else if (type == "2")//出库时产生的移库任务完成
                {
                    _exNoticeSvc.RelocationSuccess(taskNo, int.Parse(userId));
                }
                else
                {
                    return Ok(new { code = 1, msg = "任务类型错误,请核实!" });
                }
                return Ok(new { code = 0, msg = "成功完成任务", data = "" });