| | |
| | | |
| | | namespace WMS.BLL.BllAsnServer |
| | | { |
| | | public class AuditLogServer: DbHelper<BllAuditLog>, IAuditLogServer |
| | | public class AuditLogServer : DbHelper<BllAuditLog>, IAuditLogServer |
| | | { |
| | | private static readonly SqlSugarScope Db = DataContext.Db; |
| | | |
| | |
| | | try |
| | | { |
| | | Expression<Func<BllAuditLog, bool>> item = Expressionable.Create<BllAuditLog>() |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.AsnNo),it=>it.OrderNo.Contains(model.AsnNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.Status),it=>it.Status == model.Status) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.StartTime),it=> it.CreateTime >= Convert.ToDateTime(model.StartTime)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.EndTime),it=> it.CreateTime <= Convert.ToDateTime(model.EndTime).AddDays(1)) |
| | | .And(it=>it.IsDel=="0") |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.AsnNo), it => it.OrderNo.Contains(model.AsnNo.Trim())) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.Status), it => it.Status == model.Status) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.StartTime), it => it.CreateTime >= Convert.ToDateTime(model.StartTime)) |
| | | .AndIF(!string.IsNullOrWhiteSpace(model.EndTime), it => it.CreateTime <= Convert.ToDateTime(model.EndTime).AddDays(1)) |
| | | .And(it => it.IsDel == "0") |
| | | .ToExpression(); |
| | | var total = 0; |
| | | var data = GetAllWhereAsync(item) |
| | | .LeftJoin<SysUserInfor>((a, b ) => a.CreateUser == b.Id) |
| | | .LeftJoin<SysUserInfor>((a, b) => a.CreateUser == b.Id) |
| | | .LeftJoin<SysUserInfor>((a, b, c) => a.AuditUser == c.Id) |
| | | .Select((a, b, c) => new AuditLogDto() |
| | | { |
| | | Id = a.Id, |
| | | OrderNo = a.OrderNo, |
| | | PalletNo = a.PalletNo, |
| | | |
| | | |
| | | Msg = a.Msg, |
| | | Status = a.Status, |
| | | Reason = a.Reason, |
| | |
| | | } |
| | | |
| | | //编辑审核 |
| | | public void EditAudit(int id, string status,string opinion,int userId) |
| | | public void EditAudit(int id, string status, string opinion, int userId) |
| | | { |
| | | try |
| | | { |
| | | var log = Db.Queryable<BllAuditLog>().First(m => m.Id == id && m.IsDel =="0"); |
| | | var log = Db.Queryable<BllAuditLog>().First(m => m.Id == id && m.IsDel == "0"); |
| | | if (log == null) |
| | | { |
| | | throw new Exception("未查询到审核信息,请核实"); |
| | |
| | | .First(m => m.IsDel == "0" && m.LocatNo == item.LocatNo); |
| | | if (item.Qty != null) |
| | | { |
| | | if (item.LockQty>0) |
| | | if (item.LockQty > 0) |
| | | { |
| | | throw new Exception("当前物料批次已被分配,无法撤销"); |
| | | } |
| | |
| | | { |
| | | if (demo2.Origin != "WMS") |
| | | { |
| | | demo2.ASNNo = null; |
| | | demo2.ASNDetailNo = null; |
| | | } |
| | | if (notice.Type != "1" && notice.Type != "4") |
| | | { |
| | | demo2.ASNNo = null; |
| | | demo2.ASNDetailNo = null; |
| | | } |
| | | } |
| | | demo2.BindNo = null; |
| | | demo2.PalletNo = null; |
| | | demo2.Status = "0"; |
| | |
| | | { |
| | | Db.Updateable(stock).ExecuteCommand(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | Db.Deleteable(item).ExecuteCommand(); |
| | |
| | | if (stockDetail.Qty != null) |
| | | { |
| | | stock.Qty -= (int)stockDetail.Qty; |
| | | |
| | | |
| | | } |
| | | |
| | | if (stock.Qty == 0) |
| | |
| | | { |
| | | Db.Updateable(stock).ExecuteCommand(); |
| | | } |
| | | |
| | | |
| | | Db.Deleteable(stockDetail).ExecuteCommand(); |
| | | Db.Deleteable(stockInfo).ExecuteCommand(); |
| | | if (locate != null) |
| | |
| | | bind.TaskNo = ""; |
| | | bind.CompleteTime = null; |
| | | Db.Updateable(bind).ExecuteCommand(); |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | throw new Exception("记录的功能编号异常"); |
| | | } |
| | | } |
| | | |
| | | |
| | | log.Status = status; |
| | | log.Opinion = opinion; |
| | | log.AuditTime = DateTime.Now; |