| | |
| | | using System.Collections.Generic; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Model.ModelDto.BllCheckDto; |
| | | using SqlSugar; |
| | | using WMS.DAL; |
| | |
| | | |
| | | namespace WMS.BLL.BllCheckServer |
| | | { |
| | | public class StockCheckLogServer:DbHelper<BllStockCheckLog>,IStockCheckLogServer |
| | | public class StockCheckLogServer : DbHelper<BllStockCheckLog>, IStockCheckLogServer |
| | | { |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | public StockCheckLogServer() : base(Db) |
| | |
| | | } |
| | | |
| | | //获取盘点记录 |
| | | public List<StockCheckLogDto> GetStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, string lotNo, int page, int limit, out int count) |
| | | public async Task<List<StockCheckLogDto>> GetStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, string lotNo, int page, int limit, RefAsync<int> count) |
| | | { |
| | | try |
| | | { |
| | | Expression<Func<BllStockCheckLog, bool>> item = Expressionable.Create<BllStockCheckLog>() |
| | | .AndIF(!string.IsNullOrWhiteSpace(crNo), m => m.CRNo.Contains(crNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(status), m => m.CheckResult == int.Parse(status)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(palletNo), m => m.PalletNo.Contains(palletNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(boxNo), m => m.BoxNo.Contains(boxNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(skuNo), m => m.SkuNo.Contains(skuName.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(skuName), m => m.SkuName.Contains(lotNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(lotNo), m => m.LotNo.Contains(lotNo.Trim())) |
| | | .And(m => m.IsDel == "0") |
| | | .ToExpression();//注意 这一句 不能少 |
| | | var total = 0; |
| | | var list = GetAllWhereAsync(item) |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CheckUserId == b.Id) |
| | | .LeftJoin<SysUserInfor>((a, b,c) => a.CreateUser == c.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c,d) => a.UpdateUser == d.Id) |
| | | .Select((a, b, c,d) => new StockCheckLogDto() |
| | | { |
| | | Id = a.Id, |
| | | CrNo = a.CRNo, |
| | | PalletNo = a.PalletNo, |
| | | BoxNo = a.BoxNo, |
| | | BoxNo2 = a.BoxNo2, |
| | | BoxNo3 = a.BoxNo3, |
| | | Qty = a.Qty, |
| | | RealQty = a.RealQty, |
| | | CheckDate = a.CheckDate, |
| | | CheckResult = a.CheckResult, |
| | | CheckUserName = b.RealName, |
| | | SkuNo = a.SkuNo, |
| | | SkuName = a.SkuName, |
| | | Standard = a.Standard, |
| | | LotNo = a.LotNo, |
| | | LotText = a.LotText, |
| | | SupplierLot = a.SupplierLot, |
| | | |
| | | CreateUserName = c.RealName, |
| | | UpdateUserName = d.RealName, |
| | | CreateTime = a.CreateTime, |
| | | UpdateTime = a.UpdateTime, |
| | | Expression<Func<BllStockCheckLog, bool>> item = Expressionable.Create<BllStockCheckLog>() |
| | | .AndIF(!string.IsNullOrWhiteSpace(crNo), m => m.CRNo.Contains(crNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(status), m => m.CheckResult == int.Parse(status)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(palletNo), m => m.PalletNo.Contains(palletNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(boxNo), m => m.BoxNo.Contains(boxNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(skuNo), m => m.SkuNo.Contains(skuName.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(skuName), m => m.SkuName.Contains(lotNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(lotNo), m => m.LotNo.Contains(lotNo.Trim())) |
| | | .And(m => m.IsDel == "0") |
| | | .ToExpression();//注意 这一句 不能少 |
| | | var list = await GetAllWhereAsync(item) |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CheckUserId == b.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c, d) => a.UpdateUser == d.Id) |
| | | .Select((a, b, c, d) => new StockCheckLogDto() |
| | | { |
| | | Id = a.Id, |
| | | CrNo = a.CRNo, |
| | | PalletNo = a.PalletNo, |
| | | BoxNo = a.BoxNo, |
| | | BoxNo2 = a.BoxNo2, |
| | | BoxNo3 = a.BoxNo3, |
| | | Qty = a.Qty, |
| | | RealQty = a.RealQty, |
| | | CheckDate = a.CheckDate, |
| | | CheckResult = a.CheckResult, |
| | | CheckUserName = b.RealName, |
| | | SkuNo = a.SkuNo, |
| | | SkuName = a.SkuName, |
| | | Standard = a.Standard, |
| | | LotNo = a.LotNo, |
| | | LotText = a.LotText, |
| | | SupplierLot = a.SupplierLot, |
| | | |
| | | }).OrderByDescending(a=>a.CreateTime).ToOffsetPage(page, limit, ref total); |
| | | count = total; |
| | | CreateUserName = c.RealName, |
| | | UpdateUserName = d.RealName, |
| | | CreateTime = a.CreateTime, |
| | | UpdateTime = a.UpdateTime, |
| | | |
| | | return list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception(e.Message); |
| | | } |
| | | }).OrderByDescending(a => a.CreateTime).ToPageListAsync(page, limit, count); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | #region 数据归档 |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Utility; |
| | | using WMS.DAL; |
| | | using WMS.Entity.BllCheckEntity; |
| | | using WMS.Entity.Context; |
| | |
| | | |
| | | #region 冻结\解冻 |
| | | |
| | | public List<DataStock> ByTypeGetDataStockType(string SkuNo, int type) |
| | | public async Task<List<DataStock>> ByTypeGetDataStockType(string SkuNo, int type) |
| | | { |
| | | try |
| | | { |
| | | var list = Db.Queryable<DataStock>().Where(a => a.IsDel == "0" && a.SkuNo != "100099" && type == 1 ? (a.Qty - a.LockQty - a.FrozenQty) > 0 : type == 2 ? a.FrozenQty > 0 : a.Id < 0).ToList(); |
| | | //var sku = Db.Queryable<SysMaterials>().WhereIF(!string.IsNullOrWhiteSpace(SkuNo), a => a.SkuNo.Contains(SkuNo)).Where(a => list.Contains(a.SkuNo)).ToList(); |
| | | var list = await Db.Queryable<DataStock>().Where(a => a.IsDel == "0" && a.SkuNo != "100099" && type == 1 ? (a.Qty - a.LockQty - a.FrozenQty) > 0 : type == 2 ? a.FrozenQty > 0 : a.Id < 0).ToListAsync(); |
| | | //var sku = Db.Queryable<SysMaterials>().WhereIF(!string.IsNullOrWhiteSpace(SkuNo), a => a.SkuNo.Contains(SkuNo)).Where(a => list.Contains(a.SkuNo)).ToList(); |
| | | |
| | | return list; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw ex; |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public List<FreezeUnfreezeInfoDto> GetDataFreezeList(FreezeUnfreezeInfoDto model) |
| | | public async Task<List<FreezeUnfreezeInfoDto>> GetDataFreezeList(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | | string str = "select info.SkuNo,info.SkuName,info.LotNo,info.LotText,info.SupplierLot,info.Qty,info.FrozenQty,info.Demo,info.status,info.Standard,info.Type,info.CreateTime,users.UserName from DataFreezeUnfreezeInfo info left join SysUserInfor users on info.CreateUser = users.Id where info.IsDel = '0' and users.IsDel = '0' and info.Status = 1"; |
| | | #region 验证条件 |
| | | //验证物料号是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.SkuNo)) |
| | | { |
| | | str += $" and info.SkuNo like '%{model.SkuNo}%'"; |
| | | } |
| | | //验证物料名称是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.SkuName)) |
| | | { |
| | | str += $" and info.SkuName like '%{model.SkuName}%'"; |
| | | } |
| | | //验证批次是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.LotNo)) |
| | | { |
| | | str += $" and info.LotNo like '%{model.LotNo}%'"; |
| | | } |
| | | // 验证类型是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.Type)) |
| | | { |
| | | str += $" and info.Type = '{model.Type}'"; |
| | | } |
| | | // 验证原因是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.Demo)) |
| | | { |
| | | str += $" and info.Demo = '{model.Demo}'"; |
| | | } |
| | | //验证结束时间是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.StartTime)) |
| | | { |
| | | str += $" and info.CreateTime < '{model.StartTime}'"; |
| | | } |
| | | //验证结束时间是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.EndTime)) |
| | | { |
| | | model.EndTime = (DateTime.Parse(model.EndTime).AddDays(1)).ToString(); |
| | | str += $" and info.CreateTime < '{model.EndTime}'"; |
| | | } |
| | | #endregion |
| | | |
| | | List<FreezeUnfreezeInfoDto> list = Db.Ado.SqlQuery<FreezeUnfreezeInfoDto>(str); |
| | | return list; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw ex; |
| | | } |
| | | return await Db.Queryable<DataFreezeUnfreezeInfo>() |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id) |
| | | .Where(a => a.IsDel == "0" && a.Status == 1) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.SkuNo), a => a.SkuNo.Contains(model.SkuNo)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.SkuName), a => a.SkuName.Contains(model.SkuName)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.LotNo), a => a.LotNo.Contains(model.LotNo)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.Type), a => a.Type == model.Type) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.Demo), a => a.Demo == model.Demo) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.StartTime), a => SqlFunc.GreaterThanOrEqual(a.CreateTime, model.StartTime)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.EndTime), a => SqlFunc.LessThanOrEqual(a.CreateTime, model.EndTime)) |
| | | .Select<FreezeUnfreezeInfoDto>((a, b) => new FreezeUnfreezeInfoDto() |
| | | { |
| | | UserName = b.RealName |
| | | }, true) |
| | | .ToListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public List<FreezeUnfreezeInfoDto> GetDataUnFreezeList(FreezeUnfreezeInfoDto model) |
| | | public async Task<List<FreezeUnfreezeInfoDto>> GetDataUnFreezeList(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | | string str = "select info.SkuNo,info.SkuName,info.LotNo,info.LotText,info.SupplierLot,info.Qty,info.FrozenQty,info.Demo,info.status,info.Standard,info.Type,info.CreateTime,users.UserName from DataFreezeUnfreezeInfo info left join SysUserInfor users on info.CreateUser = users.Id where info.IsDel = '0' and users.IsDel = '0' and info.Status = 2"; |
| | | |
| | | #region 验证条件 |
| | | //验证物料号是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.SkuNo)) |
| | | { |
| | | str += $" and info.SkuNo like '%{model.SkuNo}%'"; |
| | | } |
| | | //验证物料名称是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.SkuName)) |
| | | { |
| | | str += $" and info.SkuName like '%{model.SkuName}%'"; |
| | | } |
| | | //验证批次是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.LotNo)) |
| | | { |
| | | str += $" and info.LotNo like '%{model.LotNo}%'"; |
| | | } |
| | | // 验证类型是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.Type)) |
| | | { |
| | | str += $" and info.Type = '{model.Type}'"; |
| | | } |
| | | // 验证原因是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.Demo)) |
| | | { |
| | | str += $" and info.Demo = '{model.Demo}'"; |
| | | } |
| | | //验证结束时间是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.StartTime)) |
| | | { |
| | | str += $" and info.CreateTime < '{model.StartTime}'"; |
| | | } |
| | | //验证结束时间是否为空 |
| | | if (!string.IsNullOrWhiteSpace(model.EndTime)) |
| | | { |
| | | model.EndTime = (DateTime.Parse(model.EndTime).AddDays(1)).ToString(); |
| | | str += $" and info.CreateTime < '{model.EndTime}'"; |
| | | } |
| | | #endregion |
| | | |
| | | var list = Db.Ado.SqlQuery<FreezeUnfreezeInfoDto>(str); |
| | | return list; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw ex; |
| | | } |
| | | return await Db.Queryable<DataFreezeUnfreezeInfo>() |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id) |
| | | .Where(a => a.IsDel == "0" && a.Status == 2) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.SkuNo), a => a.SkuNo.Contains(model.SkuNo)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.SkuName), a => a.SkuName.Contains(model.SkuName)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.LotNo), a => a.LotNo.Contains(model.LotNo)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.Type), a => a.Type == model.Type) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.Demo), a => a.Demo == model.Demo) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.StartTime), a => SqlFunc.GreaterThanOrEqual(a.CreateTime, model.StartTime)) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(model.EndTime), a => SqlFunc.LessThanOrEqual(a.CreateTime, model.EndTime)) |
| | | .Select<FreezeUnfreezeInfoDto>((a, b) => new FreezeUnfreezeInfoDto() |
| | | { |
| | | UserName = b.RealName |
| | | }, true) |
| | | .ToListAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public string InsertDataFreezeInfo(FreezeUnfreezeInfoDto model) |
| | | public async Task<string> InsertDataFreezeInfo(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | | string errStr = ""; |
| | | var TimeStr = Db.GetDate(); |
| | | //验证批次与物料是否为异常 |
| | | var stock = Db.Queryable<DataStock>().First(a => a.IsDel == "0" && a.LotNo == model.LotNo && a.SkuNo == model.SkuNo); |
| | | var stock = await Db.Queryable<DataStock>().FirstAsync(a => a.IsDel == "0" && a.LotNo == model.LotNo && a.SkuNo == model.SkuNo); |
| | | //当前物料或批次存在异常 |
| | | if (stock == null) |
| | | { |
| | | errStr = "-1:当前物料或批次存在异常!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前物料或批次存在异常!"); |
| | | } |
| | | //验证物料信息是否存在异常 |
| | | var sku = Db.Queryable<SysMaterials>().First(a => a.IsDel == "0" && a.SkuNo == model.SkuNo); |
| | | if (sku == null) |
| | | { |
| | | errStr = "-1:当前物料信息存在异常!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前物料信息存在异常!"); |
| | | } |
| | | //冻结 |
| | | if (model.Status == 1) |
| | |
| | | //验证冻结数量是否小于当前库存-锁定-冻结数量 |
| | | if (model.FrozenQty <= 0) |
| | | { |
| | | errStr = "-1:当前想要冻结的数量不可为0!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前想要冻结的数量不可为0!"); |
| | | } |
| | | //验证冻结数量是否小于当前库存-锁定-冻结数量 |
| | | if (model.FrozenQty > (stock.Qty - stock.LockQty - stock.FrozenQty)) |
| | | { |
| | | errStr = "-1:当前想要冻结的数量大于库存可冻结数量!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前想要冻结的数量大于库存可冻结数量!"); |
| | | } |
| | | //验证原因是否为空 |
| | | if (string.IsNullOrWhiteSpace(model.Demo)) |
| | | { |
| | | errStr = "-1:冻结原因不可为空!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:冻结原因不可为空!"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | // 解冻 |
| | |
| | | //验证冻结数量是否小于当前库存-锁定-冻结数量 |
| | | if (model.FrozenQty <= 0) |
| | | { |
| | | errStr = "-1:当前想要冻结的数量不可为0!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前想要冻结的数量不可为0!"); |
| | | } |
| | | //验证冻结数量是否小于当前库存冻结数量 |
| | | if (model.FrozenQty > model.Qty) |
| | | { |
| | | errStr = "-1:当前想要解冻的数量必须小于库存冻结数量!"; |
| | | return errStr; |
| | | throw Oops.Bah("-1:当前想要解冻的数量必须小于库存冻结数量!"); |
| | | } |
| | | |
| | | } |
| | |
| | | stock.FrozenQty -= (decimal)model.FrozenQty; |
| | | } |
| | | |
| | | Db.Insertable(list).ExecuteCommand(); |
| | | Db.Updateable(stock).ExecuteCommand(); |
| | | await Db.Insertable(list).ExecuteCommandAsync(); |
| | | await Db.Updateable(stock).ExecuteCommandAsync(); |
| | | |
| | | |
| | | Db.CommitTran(); //提交 |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Utility; |
| | | using WMS.BLL.LogServer; |
| | | using WMS.DAL; |
| | | using WMS.Entity.BllAsnEntity; |
| | |
| | | public class WarehouseOutsidePalletsServer : DbHelper<DataStockDetail>, IWarehouseOutsidePalletsServer |
| | | { |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | public WarehouseOutsidePalletsServer() : base(Db) |
| | | private readonly UserManager _userManager; |
| | | public WarehouseOutsidePalletsServer(UserManager userManager) : base(Db) |
| | | { |
| | | _userManager = userManager; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="lotNo">批次</param> |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | public List<MateDataStockDto> GetPalletsOutside(string skuNo, string skuName, string lotNo, string palletNo, int page, int limit, out int count) |
| | | public async Task<List<MateDataStockDto>> GetPalletsOutside(string skuNo, string skuName, string lotNo, string palletNo, int page, int limit, RefAsync<int> count) |
| | | { |
| | | string sqlCount = "SELECT DISTINCT COUNT(DataStockDetail.ID) " + |
| | | "FROM DataStockDetail " + |
| | | "where IsDel = 0 and isnull(LocatNo,'') = '' and isnull(WareHouseNo,'') = '' "; |
| | | |
| | | string str = "select Id,LotNo,LotText,SupplierLot,SkuNo,SkuName,Standard,Qty,LockQty,FrozenQty,PalletNo," + |
| | | "Status,InspectMark,BitPalletMark,InspectStatus " + |
| | | "from DataStockDetail " + |
| | | "where IsDel = 0 and isnull(LocatNo,'') = '' and isnull(WareHouseNo,'') = ''"; |
| | | //判断物料号是否为空 |
| | | if (!string.IsNullOrEmpty(skuNo)) |
| | | { |
| | | str += $" and SkuNo like '%{skuNo}%'"; |
| | | } |
| | | //判断物料名称是否为空 |
| | | if (!string.IsNullOrEmpty(skuName)) |
| | | { |
| | | str += $" and SkuName like '%{skuName}%'"; |
| | | } |
| | | //判断批次是否为空 |
| | | if (!string.IsNullOrEmpty(lotNo)) |
| | | { |
| | | str += $" and LotNo like '%{lotNo}%'"; |
| | | } |
| | | //判断托盘号是否为空 |
| | | if (!string.IsNullOrEmpty(palletNo)) |
| | | { |
| | | str += $" and PalletNo like '%{palletNo}%'"; |
| | | } |
| | | //排序 |
| | | str += " order by LotNo,SkuNo,PalletNo"; |
| | | if (page == 0) |
| | | { |
| | | page = 1; |
| | | } |
| | | str += $" offset {((page - 1) * limit)} rows fetch next {limit} rows only;"; |
| | | List<MateDataStockDto> mateDataStockDtos = Db.Ado.SqlQuery<MateDataStockDto>(str); |
| | | var com = new Common(); |
| | | count = com.GetRowCount(sqlCount); |
| | | return mateDataStockDtos; |
| | | var list = await Db.Queryable<DataStockDetail>() |
| | | .Where(a => a.IsDel == "0" && SqlFunc.IsNullOrEmpty(a.LocatNo) && SqlFunc.IsNullOrEmpty(a.WareHouseNo)) |
| | | .WhereIF(!string.IsNullOrEmpty(skuNo), a => a.SkuNo.Contains(skuNo)) |
| | | .WhereIF(!string.IsNullOrEmpty(skuName), a => a.SkuName.Contains(skuName)) |
| | | .WhereIF(!string.IsNullOrEmpty(lotNo), a => a.LotNo.Contains(lotNo)) |
| | | .WhereIF(!string.IsNullOrEmpty(palletNo), a => a.PalletNo.Contains(palletNo)) |
| | | .OrderBy(a => new { a.LotNo, a.SkuNo, a.PalletNo }) |
| | | .Select<MateDataStockDto>() |
| | | .ToPageListAsync(page, limit, count); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | //保存指定的储位 |
| | | public void SaveAppointSlot(int stockDetailId, int locateId, int userId) |
| | | public async Task SaveAppointSlot(int stockDetailId, int locateId) |
| | | { |
| | | //库存明细信息 |
| | | var stockDetail = await Db.Queryable<DataStockDetail>().FirstAsync(m => m.IsDel == "0" && m.Id == stockDetailId); |
| | | if (stockDetail == null) |
| | | { |
| | | throw Oops.Bah("未查询到库存库外托盘的信息"); |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(stockDetail.LocatNo)) |
| | | { |
| | | throw Oops.Bah("该托盘已在储位上,不能指定储位,请核实!"); |
| | | } |
| | | //储位 |
| | | var locate = await Db.Queryable<SysStorageLocat>().FirstAsync(m => m.IsDel == "0" && m.Id == locateId); |
| | | if (locate == null) |
| | | { |
| | | throw Oops.Bah("未查询到储位的信息"); |
| | | } |
| | | if (locate.Status != "0" || locate.Flag != "0") |
| | | { |
| | | throw Oops.Bah("该储位状态不是空储位或标志不是正常的"); |
| | | } |
| | | |
| | | var logTask = await Db.Queryable<LogTask>().FirstAsync(m => m.IsDel == "0" && m.Type == "0" && m.PalletNo == stockDetail.PalletNo && m.Status == "1"); |
| | | if (logTask != null) |
| | | { |
| | | throw Oops.Bah("当前托盘已有正在执行的任务,请核实查看"); |
| | | } |
| | | |
| | | |
| | | //若是深度1的 则判断深度2是否为空储位 |
| | | if (locate.Depth == "01") |
| | | { |
| | | var locateDepth = await Db.Queryable<SysStorageLocat>().FirstAsync(a => a.IsDel == "0" && a.Row == locate.Row && a.Column == locate.Column && a.Layer == locate.Layer && a.Depth == "02"); |
| | | if (locateDepth != null) |
| | | { |
| | | if (locateDepth.Status != "1") |
| | | { |
| | | throw Oops.Bah("该储位深度2不是有物品,不可绑定"); |
| | | } |
| | | } |
| | | } |
| | | //判断是否为深度2的 若为深度2 则获取深度1储位 判断是否为空储位 |
| | | if (locate.Depth == "02") |
| | | { |
| | | var locateDepth = await Db.Queryable<SysStorageLocat>().FirstAsync(a => a.IsDel == "0" && a.Row == locate.Row && a.Column == locate.Column && a.Layer == locate.Layer && a.Depth == "01"); |
| | | if (locateDepth.Status != "0" || locateDepth.Flag == "2") |
| | | { |
| | | throw Oops.Bah("该储位深度1不是空储位或标志不是正常的"); |
| | | } |
| | | } |
| | | |
| | | // 获取此托盘的任务号 |
| | | var taskModel = await Db.Queryable<LogTask>().FirstAsync(m => m.IsDel == "0" && m.PalletNo == stockDetail.PalletNo && m.IsSuccess == 0 && m.Status == "0"); |
| | | |
| | | Db.BeginTran(); |
| | | try |
| | | { |
| | | |
| | | //库存明细信息 |
| | | var stockDetail = Db.Queryable<DataStockDetail>().First(m => m.IsDel == "0" && m.Id == stockDetailId); |
| | | if (stockDetail == null) |
| | | var time = DateTime.Now; |
| | | var taskNo = string.Empty; |
| | | if (taskModel == null) // 之前未指定托盘 |
| | | { |
| | | throw new Exception("未查询到库存库外托盘的信息"); |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(stockDetail.LocatNo)) |
| | | { |
| | | throw new Exception("该托盘已在储位上,不能指定储位,请核实!"); |
| | | } |
| | | //储位 |
| | | var locate = Db.Queryable<SysStorageLocat>().First(m => m.IsDel == "0" && m.Id == locateId); |
| | | if (locate == null) |
| | | { |
| | | throw new Exception("未查询到储位的信息"); |
| | | } |
| | | if (locate.Status != "0" || locate.Flag != "0") |
| | | { |
| | | throw new Exception("该储位状态不是空储位或标志不是正常的"); |
| | | } |
| | | |
| | | var logTask = Db.Queryable<LogTask>().First(m => m.IsDel == "0" && m.Type == "0" && m.PalletNo == stockDetail.PalletNo && m.Status == "1"); |
| | | if (logTask != null) |
| | | { |
| | | throw new Exception("当前托盘已有正在执行的任务,请核实查看"); |
| | | } |
| | | |
| | | |
| | | //若是深度1的 则判断深度2是否为空储位 |
| | | if (locate.Depth == "01") |
| | | { |
| | | var locateDepth = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.Row == locate.Row && a.Column == locate.Column && a.Layer == locate.Layer && a.Depth == "02"); |
| | | if (locateDepth != null) |
| | | // 添加入库日志记录 |
| | | taskNo = new Common().GetMaxNo("TK"); |
| | | var task = new LogTask //入库任务 |
| | | { |
| | | if (locateDepth.Status != "1") |
| | | TaskNo = taskNo, |
| | | Sender = "WMS", |
| | | Receiver = "WCS", |
| | | IsSuccess = 0, //是否下发成功 0失败 1成功 |
| | | SendDate = time, //发送时间 |
| | | BackDate = time, //返回时间 |
| | | StartRoadway = "", // 起始巷道 |
| | | StartLocat = "",//起始位置 |
| | | EndLocat = locate.LocatNo,//目标位置 |
| | | EndRoadway = locate.RoadwayNo, // 目标巷道 |
| | | PalletNo = stockDetail.PalletNo,//托盘码 |
| | | IsSend = 1,//是否可再次下发 |
| | | IsCancel = 1,//是否可取消 |
| | | IsFinish = 1,//是否可完成 |
| | | Type = "0",//任务类型 0 入库任务 1 出库任务 2 移库任务 |
| | | Status = "0",//任务状态0:等待执行1正在执行2执行完成 |
| | | OrderType = "0",//0 入库单 1 出库单 2 盘点单 3 移库单 |
| | | Msg = "入库口到=>>" + locate.LocatNo + "储位的入库任务", //关键信息 |
| | | |
| | | }; |
| | | await Db.Insertable(task).ExecuteCommandAsync(); |
| | | |
| | | locate.Status = "2"; |
| | | await Db.Updateable(locate).ExecuteCommandAsync(); |
| | | } |
| | | else // 已指定过托盘需变更 |
| | | { |
| | | // 获取上次指定的储位地址 |
| | | var locateOld = await Db.Queryable<SysStorageLocat>().FirstAsync(m => m.IsDel == "0" && m.LocatNo == taskModel.EndLocat); |
| | | if (locateOld != null) |
| | | { |
| | | if (locateOld.LocatNo == locate.LocatNo) // 判断当前指定的地址和上次的是否一致,若一致不做更改 |
| | | { |
| | | throw new Exception("该储位深度2不是有物品,不可绑定"); |
| | | throw new Exception("已指定相同储位地址"); |
| | | } |
| | | else // 若不一致 释放上次指定的储位地址 |
| | | { |
| | | locateOld.Status = "0"; |
| | | await Db.Updateable(locateOld).ExecuteCommandAsync(); |
| | | } |
| | | } |
| | | locate.Status = "2"; |
| | | await Db.Updateable(locate).ExecuteCommandAsync(); |
| | | // 更新任务号指定地址信息 |
| | | taskModel.EndLocat = locate.LocatNo;//目标储位 |
| | | taskModel.EndRoadway = locate.RoadwayNo;//目标巷道 |
| | | await Db.Updateable(taskModel).ExecuteCommandAsync(); |
| | | |
| | | taskNo = taskModel.TaskNo; |
| | | } |
| | | //判断是否为深度2的 若为深度2 则获取深度1储位 判断是否为空储位 |
| | | if (locate.Depth == "02") |
| | | // 更新组盘表巷道地址和储位地址 |
| | | var bindModel = await Db.Queryable<BllPalletBind>().FirstAsync(m => m.IsDel == "0" |
| | | && m.PalletNo == stockDetail.PalletNo && m.ASNDetailNo == stockDetail.ASNDetailNo && m.ASNNo == stockDetail.ASNNo); |
| | | if (string.IsNullOrWhiteSpace(bindModel.TaskNo) || bindModel.TaskNo == taskNo) |
| | | { |
| | | var locateDepth = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.Row == locate.Row && a.Column == locate.Column && a.Layer == locate.Layer && a.Depth == "01"); |
| | | if (locateDepth.Status != "0" || locateDepth.Flag == "2") |
| | | { |
| | | throw new Exception("该储位深度1不是空储位或标志不是正常的"); |
| | | } |
| | | bindModel.TaskNo = taskNo; |
| | | bindModel.WareHouseNo = locate.WareHouseNo; |
| | | bindModel.RoadwayNo = locate.RoadwayNo; |
| | | bindModel.LocatNo = locate.LocatNo; |
| | | await Db.Updateable(bindModel).ExecuteCommandAsync(); |
| | | } |
| | | |
| | | // 获取此托盘的任务号 |
| | | var taskModel = Db.Queryable<LogTask>().First(m=>m.IsDel=="0" && m.PalletNo == stockDetail.PalletNo && m.IsSuccess ==0 && m.Status =="0"); |
| | | |
| | | Db.BeginTran(); |
| | | try |
| | | { |
| | | var time = DateTime.Now; |
| | | var taskNo = string.Empty; |
| | | if (taskModel == null) // 之前未指定托盘 |
| | | { |
| | | // 添加入库日志记录 |
| | | taskNo = new Common().GetMaxNo("TK"); |
| | | var task = new LogTask //入库任务 |
| | | { |
| | | TaskNo = taskNo, |
| | | Sender = "WMS", |
| | | Receiver = "WCS", |
| | | IsSuccess = 0, //是否下发成功 0失败 1成功 |
| | | SendDate = time, //发送时间 |
| | | BackDate = time, //返回时间 |
| | | StartRoadway = "", // 起始巷道 |
| | | StartLocat = "",//起始位置 |
| | | EndLocat = locate.LocatNo,//目标位置 |
| | | EndRoadway = locate.RoadwayNo, // 目标巷道 |
| | | PalletNo = stockDetail.PalletNo,//托盘码 |
| | | IsSend = 1,//是否可再次下发 |
| | | IsCancel = 1,//是否可取消 |
| | | IsFinish = 1,//是否可完成 |
| | | Type = "0",//任务类型 0 入库任务 1 出库任务 2 移库任务 |
| | | Status = "0",//任务状态0:等待执行1正在执行2执行完成 |
| | | OrderType = "0",//0 入库单 1 出库单 2 盘点单 3 移库单 |
| | | Msg = "入库口到=>>" + locate.LocatNo + "储位的入库任务", //关键信息 |
| | | |
| | | }; |
| | | Db.Insertable(task).ExecuteCommand(); |
| | | |
| | | locate.Status = "2"; |
| | | Db.Updateable(locate).ExecuteCommand(); |
| | | } |
| | | else // 已指定过托盘需变更 |
| | | { |
| | | // 获取上次指定的储位地址 |
| | | var locateOld = Db.Queryable<SysStorageLocat>().First(m => m.IsDel == "0" && m.LocatNo == taskModel.EndLocat); |
| | | if (locateOld != null) |
| | | { |
| | | if (locateOld.LocatNo == locate.LocatNo) // 判断当前指定的地址和上次的是否一致,若一致不做更改 |
| | | { |
| | | throw new Exception("已指定相同储位地址"); |
| | | } |
| | | else // 若不一致 释放上次指定的储位地址 |
| | | { |
| | | locateOld.Status = "0"; |
| | | Db.Updateable(locateOld).ExecuteCommand(); |
| | | } |
| | | } |
| | | locate.Status = "2"; |
| | | Db.Updateable(locate).ExecuteCommand(); |
| | | // 更新任务号指定地址信息 |
| | | taskModel.EndLocat = locate.LocatNo;//目标储位 |
| | | taskModel.EndRoadway = locate.RoadwayNo;//目标巷道 |
| | | Db.Updateable(taskModel).ExecuteCommand(); |
| | | |
| | | taskNo = taskModel.TaskNo; |
| | | } |
| | | // 更新组盘表巷道地址和储位地址 |
| | | var bindModel = Db.Queryable<BllPalletBind>().First(m => m.IsDel == "0" |
| | | && m.PalletNo == stockDetail.PalletNo && m.ASNDetailNo == stockDetail.ASNDetailNo && m.ASNNo == stockDetail.ASNNo); |
| | | if (string.IsNullOrWhiteSpace(bindModel.TaskNo) || bindModel.TaskNo == taskNo) |
| | | { |
| | | bindModel.TaskNo = taskNo; |
| | | bindModel.WareHouseNo = locate.WareHouseNo; |
| | | bindModel.RoadwayNo = locate.RoadwayNo; |
| | | bindModel.LocatNo = locate.LocatNo; |
| | | Db.Updateable(bindModel).ExecuteCommand(); |
| | | } |
| | | // 插入操作日志 |
| | | new OperationASNServer().AddLogOperationAsn("库内作业", "库外托盘", stockDetail.PalletNo, "编辑", |
| | | $"指定了储位:{locate.LocatNo}、单据号:{stockDetail.ASNNo}、托盘码:{stockDetail.PalletNo}的信息", userId); |
| | | //提交事务 |
| | | Db.CommitTran(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Db.RollbackTran(); |
| | | throw new Exception(e.Message); |
| | | } |
| | | |
| | | // 插入操作日志 |
| | | new OperationASNServer().AddLogOperationAsn("库内作业", "库外托盘", stockDetail.PalletNo, "编辑", |
| | | $"指定了储位:{locate.LocatNo}、单据号:{stockDetail.ASNNo}、托盘码:{stockDetail.PalletNo}的信息", _userManager.UserId); |
| | | //提交事务 |
| | | Db.CommitTran(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Db.RollbackTran(); |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | |
| | | { |
| | | _userManager = userManager; |
| | | } |
| | | public List<OperationDto> GetLogOperationCrList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count) |
| | | public async Task<List<OperationDto>> GetLogOperationCrList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, RefAsync<int> count) |
| | | { |
| | | try |
| | | { |
| | |
| | | .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(endTime).AddDays(1)) |
| | | .ToExpression();//注意 这一句 不能少 |
| | | var total = 0; |
| | | var list = GetAllWhereAsync(item) |
| | | var list = await GetAllWhereAsync(item) |
| | | .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) |
| | | .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) |
| | | .Select((it, dic, users) => new OperationDto() |
| | |
| | | CreateUserName = users.RealName, |
| | | }) |
| | | .OrderByDescending(it => it.CreateTime) |
| | | .ToOffsetPage(page, limit, ref total); |
| | | |
| | | count = total; |
| | | return list.OrderByDescending(m => m.CreateTime).ToList(); |
| | | .ToPageListAsync(page, limit, count); |
| | | return list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Model.ModelDto.BllSoDto; |
| | | using Model.ModelDto.LogDto; |
| | | using SqlSugar; |
| | |
| | | } |
| | | |
| | | |
| | | public List<TaskDto> GetTaskList(List<string> orderType, string type, string status, string taskNo, int isSuccess, string palletNo, string msg, int page, int limit, out int count) |
| | | public async Task<List<TaskDto>> GetTaskList(List<string> orderType, string type, string status, string taskNo, int isSuccess, string palletNo, string msg, int page, int limit, RefAsync<int> count) |
| | | { |
| | | try |
| | | { |
| | |
| | | .AndIF(!string.IsNullOrWhiteSpace(palletNo), it => it.PalletNo.Contains(palletNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) |
| | | .ToExpression();//注意 这一句 不能少 |
| | | var total = 0; |
| | | var data = GetAllWhereAsync(item) |
| | | var data = await GetAllWhereAsync(item) |
| | | .LeftJoin<SysUserInfor>((a,b)=>a.CreateUser == b.Id). |
| | | Select((a,b) => new TaskDto() |
| | | { |
| | |
| | | CreateTime = a.CreateTime |
| | | }) |
| | | .OrderByDescending(a => a.TaskNo) |
| | | .ToOffsetPage(page,limit,ref total); |
| | | count = total; |
| | | .ToPageListAsync(page,limit, count); |
| | | |
| | | return data.OrderByDescending(m=>m.TaskNo).ToList(); |
| | | return data; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Model.ModelDto.BllCheckDto; |
| | | using SqlSugar; |
| | | |
| | | namespace WMS.IBLL.IBllCheckServer |
| | | { |
| | |
| | | /// <param name="limit"></param> |
| | | /// <param name="count"></param> |
| | | /// <returns></returns> |
| | | List<StockCheckLogDto> GetStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, |
| | | string lotNo, int page, int limit, out int count); |
| | | Task<List<StockCheckLogDto>> GetStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, |
| | | string lotNo, int page, int limit, RefAsync<int> count); |
| | | |
| | | /// <summary> |
| | | /// 获取盘点记录-数据归档 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<StockCheckLogDto> GetArchivingStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, |
| | | List<StockCheckLogDto> GetArchivingStockCheckLogList(string crNo, string status, string palletNo, string boxNo, string skuNo, string skuName, |
| | | string lotNo, int page, int limit, out int count); |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WMS.Entity.DataEntity; |
| | | using WMS.Entity.SysEntity; |
| | | |
| | |
| | | /// <param name="SkuNo">物料编码</param> |
| | | /// <param name="type">0:获取可冻结库存 1:获取可解冻数据</param> |
| | | /// <returns></returns> |
| | | List<DataStock> ByTypeGetDataStockType(string SkuNo,int type); |
| | | Task<List<DataStock>> ByTypeGetDataStockType(string SkuNo,int type); |
| | | |
| | | /// <summary> |
| | | /// 获取库存冻结信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | List<FreezeUnfreezeInfoDto> GetDataFreezeList(FreezeUnfreezeInfoDto model); |
| | | Task<List<FreezeUnfreezeInfoDto>> GetDataFreezeList(FreezeUnfreezeInfoDto model); |
| | | |
| | | /// <summary> |
| | | /// 获取库存解冻信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | List<FreezeUnfreezeInfoDto> GetDataUnFreezeList(FreezeUnfreezeInfoDto model); |
| | | Task<List<FreezeUnfreezeInfoDto>> GetDataUnFreezeList(FreezeUnfreezeInfoDto model); |
| | | |
| | | /// <summary> |
| | | /// 添加冻结\解冻信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | string InsertDataFreezeInfo(FreezeUnfreezeInfoDto model); |
| | | Task<string> InsertDataFreezeInfo(FreezeUnfreezeInfoDto model); |
| | | |
| | | #endregion |
| | | } |
| | |
| | | using Model.ModelDto.DataDto; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WMS.IBLL.IBllCheckServer |
| | | { |
| | |
| | | /// <param name="lotNo">批次</param> |
| | | /// <param name="palletNo">托盘号</param> |
| | | /// <returns></returns> |
| | | List<MateDataStockDto> GetPalletsOutside(string skuNo, string skuName, string lotNo, string palletNo, int page, int limit, out int count); |
| | | Task<List<MateDataStockDto>> GetPalletsOutside(string skuNo, string skuName, string lotNo, string palletNo, int page, int limit, RefAsync<int> count); |
| | | |
| | | /// <summary> |
| | | /// 库外托盘指定储位信息 |
| | |
| | | /// <param name="stockDetailId">库存明细ID</param> |
| | | /// <param name="locateId">储位信息ID</param> |
| | | /// <param name="userId">操作人</param> |
| | | void SaveAppointSlot(int stockDetailId, int locateId, int userId); |
| | | Task SaveAppointSlot(int stockDetailId, int locateId); |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using Model.ModelDto.LogDto; |
| | | using Model.ModelVm.LogVm; |
| | | using SqlSugar; |
| | | |
| | | namespace WMS.IBLL.ILogServer |
| | | { |
| | |
| | | /// <param name="limit"></param> |
| | | /// <param name="count"></param> |
| | | /// <returns></returns> |
| | | List<OperationDto> GetLogOperationCrList(string menuName, string type, string msg, string startTime, |
| | | string endTime, int page, int limit, out int count); |
| | | Task<List<OperationDto>> GetLogOperationCrList(string menuName, string type, string msg, string startTime, |
| | | string endTime, int page, int limit, RefAsync<int> count); |
| | | /// <summary> |
| | | /// 添加库内(盘库、移库)操作日志 |
| | | /// </summary> |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Model.ModelDto.LogDto; |
| | | using SqlSugar; |
| | | using WMS.Entity.LogEntity; |
| | | |
| | | namespace WMS.IBLL.ILogServer |
| | |
| | | /// <param name="limit"></param> |
| | | /// <param name="count"></param> |
| | | /// <returns></returns> |
| | | List<TaskDto> GetTaskList(List<string> orderType, string type, string status, string taskNo, int isSuccess, string palletNo,string msg, int page, int limit, out int count); |
| | | Task<List<TaskDto>> GetTaskList(List<string> orderType, string type, string status, string taskNo, int isSuccess, string palletNo,string msg, int page, int limit, RefAsync<int> count); |
| | | |
| | | /// <summary> |
| | | /// 修改任务下发成功 |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalTaskList(GetTaskVm model) |
| | | public async Task<IActionResult> GetArrivalTaskList(GetTaskVm model) |
| | | { |
| | | try |
| | | { |
| | | var type = new List<string>() { "0" }; |
| | | var bolls = _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库任务信息", data = bolls }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetStockCheckLogList(GetCheckLogVm model) |
| | | public async Task<IActionResult> GetStockCheckLogList(GetCheckLogVm model) |
| | | { |
| | | try |
| | | { |
| | | var list = _stockCheckLogSvc.GetStockCheckLogList(model.CrNo, model.Status, model.PalletNo, model.BoxNo, model.SkuNo, model.SkuName, model.LotNo, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var list = await _stockCheckLogSvc.GetStockCheckLogList(model.CrNo, model.Status, model.PalletNo, model.BoxNo, model.SkuNo, model.SkuName, model.LotNo, model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "盘点记录", data = list }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetCrTaskList(GetTaskVm model) |
| | | public async Task<IActionResult> GetCrTaskList(GetTaskVm model) |
| | | { |
| | | try |
| | | { |
| | | var type = new List<string>() { "2", "3", "4" }; |
| | | var bolls = _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "库内任务信息", data = bolls }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetLogOperationCrList(GetOperationVm model) |
| | | public async Task<IActionResult> GetLogOperationCrList(GetOperationVm model) |
| | | { |
| | | try |
| | | { |
| | | var bolls = _logSvc.GetLogOperationCrList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _logSvc.GetLogOperationCrList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "出库操作日志信息", data = bolls }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetPalletsOutside(PalletsOutVm model) |
| | | public async Task<IActionResult> GetPalletsOutside(PalletsOutVm model) |
| | | { |
| | | List<MateDataStockDto> mateDataStockDtos = _stockPallet.GetPalletsOutside(model.SkuNo, model.SkuName, model.LotNo, model.PalletNo, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | List<MateDataStockDto> mateDataStockDtos = await _stockPallet.GetPalletsOutside(model.SkuNo, model.SkuName, model.LotNo, model.PalletNo, model.Page, model.Limit, count); |
| | | return Ok(new { code = 0, count, msg = "获取库外托盘信息成功", data = mateDataStockDtos }); |
| | | } |
| | | |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult SaveAppointSlot(SaveAppointSlotVm model) |
| | | public async Task<IActionResult> SaveAppointSlot(SaveAppointSlotVm model) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | _stockPallet.SaveAppointSlot(model.StockDetailId, model.LocateId, int.Parse(userId)); |
| | | await _stockPallet.SaveAppointSlot(model.StockDetailId, model.LocateId); |
| | | |
| | | return Ok(new { code = 0, count = 0, msg = "指定储位成功", data = "" }); |
| | | } |
| | |
| | | /// <param name="type">0:获取可冻结库存 1:获取可解冻数据</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult ByTypeGetDataStockType(string SkuNo, int type) |
| | | public async Task<IActionResult> ByTypeGetDataStockType(string SkuNo, int type) |
| | | { |
| | | try |
| | | { |
| | | var models = _freect.ByTypeGetDataStockType(SkuNo, type); |
| | | var models = await _freect.ByTypeGetDataStockType(SkuNo, type); |
| | | |
| | | return Ok(new |
| | | { |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetDataFreezeList(FreezeUnfreezeInfoDto model) |
| | | public async Task<IActionResult> GetDataFreezeList(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | | var models = _freect.GetDataFreezeList(model); |
| | | var models = await _freect.GetDataFreezeList(model); |
| | | |
| | | return Ok(new |
| | | { |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetDataUnFreezeList(FreezeUnfreezeInfoDto model) |
| | | public async Task<IActionResult> GetDataUnFreezeList(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | | var models = _freect.GetDataUnFreezeList(model); |
| | | var models = await _freect.GetDataUnFreezeList(model); |
| | | |
| | | return Ok(new |
| | | { |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult InsertDataFreezeInfo(FreezeUnfreezeInfoDto model) |
| | | public async Task<IActionResult> InsertDataFreezeInfo(FreezeUnfreezeInfoDto model) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | model.CreateUser = int.Parse(UserId); |
| | | string strMesage = _freect.InsertDataFreezeInfo(model); |
| | | string strMesage = await _freect.InsertDataFreezeInfo(model); |
| | | //var arr = strMesage.Split(':'); |
| | | if (!strMesage.Contains("-1")) |
| | | { |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetExportTaskList(GetTaskVm model) |
| | | public async Task<IActionResult> GetExportTaskList(GetTaskVm model) |
| | | { |
| | | try |
| | | { |
| | | var type = new List<string>(){"1","4"}; |
| | | var bolls = _taskSvc.GetTaskList( type, model.Type,model.Status,model.TaskNo,model.IsSuccess,model.PalletNo,model.Msg,model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _taskSvc.GetTaskList( type, model.Type,model.Status,model.TaskNo,model.IsSuccess,model.PalletNo,model.Msg,model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "出库任务信息", data = bolls }); |
| | | } |