chengsc
2024-10-20 f8957ba7f0ade842553bd37254cf31da639a1925
Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -262,10 +262,22 @@
        }
        //回传出库单
        public bool FinishSo(int id, string url, int userId)
        public bool FinishSo(int id, string url, string userNo, string pwd, int userId)
        {
            try
            {
                var loginPwd = Md5Tools.CalcMd5(pwd);
                var date = Db.Queryable<SysUserInfor>().First(m => m.IsDel == "0" && m.UserName == userNo && m.PassWord == loginPwd);
                if (date == null) //账号密码是否正确
                {
                    throw new Exception("账号密码不正确或没有此账号");
                }
                if (date.Status != "0") //当前账号是否正常启用
                {
                    throw new Exception("当前账号非启用状态");
                }
                var notice = Db.Queryable<BllExportNotice>().First(m => m.Id == id && m.IsDel == "0");
                if (notice == null)
                {
@@ -280,7 +292,7 @@
                {
                    throw new Exception("未查询到单据明细信息");
                }
                if (userId == notice.UpdateUser)
                if (date.Id == notice.UpdateUser)
                {
                    throw new Exception("复核失败,复核人员和关闭订单人员不能相同!");
                }
@@ -315,10 +327,10 @@
                notice.Status = "6";
                notice.CheckTime = DateTime.Now;
                notice.CheckUser = userId;
                notice.CheckUser = date.Id;
                Db.Updateable(notice).ExecuteCommand();
                new OperationSOServer().AddLogOperationSo("出库作业", "出库单据", notice.SONo, "复核", $"复核了单据号为{notice.SONo}的单据信息", userId);
                new OperationSOServer().AddLogOperationSo("出库作业", "出库单据", notice.SONo, "复核", $"{date.RealName}复核了单据号为{notice.SONo}的单据信息", userId);
                return true;
            }
            catch (Exception e)
@@ -3239,10 +3251,41 @@
                        throw new Exception("获取失败,出库单状态不允许!");
                    }
                }
                string inspectStatus = string.Empty;
                switch (notice.Type)//0:原料 1:包材 2:成品 3:耗材 4:半成品
                {
                    case "0"://成品出库
                        inspectStatus = "1";
                        break;
                    case "1"://领料出库
                        inspectStatus = "1";
                        break;
                    case "2"://抽检出库
                        inspectStatus = "0,1,2";
                        break;
                    case "3"://物料取样出库
                        inspectStatus = "0";
                        break;
                    case "4"://不合格品出库
                        inspectStatus = "2";
                        break;
                    case "5"://中间品出库
                        inspectStatus = "1";
                        break;
                    case "6"://代储出库
                        inspectStatus = "0,1,2";
                        break;
                    case "8"://寄存出库
                        inspectStatus = "0,1";
                        break;
                    default: //其它出库
                        inspectStatus = "0,1";
                        break;
                }
                #endregion
                Expression<Func<DataStockDetail, bool>> item = Expressionable.Create<DataStockDetail>()
                    .AndIF(!string.IsNullOrWhiteSpace(inspectStatus), m => inspectStatus.Contains(m.InspectStatus))
                    .AndIF(!string.IsNullOrWhiteSpace(houseNo), m => m.WareHouseNo == houseNo)
                    .AndIF(!string.IsNullOrWhiteSpace(roadwayNo), m => m.RoadwayNo == roadwayNo)
                    .AndIF(!string.IsNullOrWhiteSpace(locateNo), m => m.LocatNo == locateNo)