chengsc
2024-11-03 5ce969ed34e91c931cce38e2feb5d2c208633a96
Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs
@@ -6,6 +6,7 @@
using Model.ModelDto.BllQualityDto;
using Model.ModelVm;
using SqlSugar;
using Utility.Tools;
using WMS.DAL;
using WMS.Entity.BllAsnEntity;
using WMS.Entity.BllQualityEntity;
@@ -193,23 +194,37 @@
            return isquality;
        }
        /// <summary>
        /// 质检复核信息
        /// </summary>
        /// <param name="model">质检信息实体模型</param>
        /// <param name="id"></param>
        /// <param name="userNo"></param>
        /// <param name="password"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public int FinshQuality(int id,string type,int userId)
        /// <exception cref="Exception"></exception>
        public int FinshQuality(int id,string userNo, string password, int userId)
        {
            //验证质检号是否为空
            if (string.IsNullOrEmpty(type))
            var loginPwd = Md5Tools.CalcMd5(password);
            var date = Db.Queryable<SysUserInfor>().First(m => m.IsDel == "0" && m.UserName == userNo && m.PassWord == loginPwd);
            if (date == null) //账号密码是否正确
            {
                throw new Exception("状态不能为空!");
                throw new Exception("账号密码不正确或没有此账号");
            }
            if (date.Status != "0") //当前账号是否正常启用
            {
                throw new Exception("当前账号非启用状态");
            }
            var model = Db.Queryable<BllQualityInspect>().First(m=>m.IsDel == "0" && m.Id == id);
            if (model == null)
            {
                throw new Exception("未查询到质检信息");
            }
            if (date.Id == model.CreateUser)
            {
                throw new Exception("复核失败,复核人员和关闭订单人员不能相同!");
            }
            int isTui = 0;
            //验证入库单号是否为空
@@ -233,8 +248,9 @@
            
          
            model.Status = type; //规格
            model.IsQualified = type;
            model.Status = "1"; //规格
            model.UpdateTime = DateTime.Now;
            model.UpdateUser = userId;
            //model.SupplierLot = arrivalDetail.SupplierLot; //供货批次
            //查找库存明细信息
@@ -247,7 +263,7 @@
            {
                List<DataBoxInfo> box = Db.Queryable<DataBoxInfo>().Where(a => a.IsDel == "0" && a.StockDetailId == item.Id && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList();
                //判断合格状态是否合格
                if (type == "1")
                if (model.IsQualified == "1")
                {
                    //合格 相同批次库存信息全部改为合格状态 且合格数量增加为同批次同单号该物料全部数量之和
                    model.PassQty += item.Qty;