Administrator
2024-02-21 87d55df7b7446d7c4c3532a2dd2e78f72574e34b
Wms/WMS.BLL/BllAsnServer/AuditLogServer.cs
@@ -15,7 +15,7 @@
namespace WMS.BLL.BllAsnServer
{
    public class AuditLogServer: DbHelper<BllAuditLog>, IAuditLogServer
    public class AuditLogServer : DbHelper<BllAuditLog>, IAuditLogServer
    {
        private static readonly SqlSugarScope Db = DataContext.Db;
@@ -29,22 +29,22 @@
            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,
@@ -68,11 +68,11 @@
        }
        //编辑审核
        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("未查询到审核信息,请核实");
@@ -156,7 +156,7 @@
                                        .First(m => m.IsDel == "0" && m.LocatNo == item.LocatNo);
                                    if (item.Qty != null)
                                    {
                                        if (item.LockQty>0)
                                        if (item.LockQty > 0)
                                        {
                                            throw new Exception("当前物料批次已被分配,无法撤销");
                                        }
@@ -197,9 +197,12 @@
                                    {
                                        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";
@@ -246,7 +249,7 @@
                                        {
                                            Db.Updateable(stock).ExecuteCommand();
                                        }
                                    }
                                    Db.Deleteable(item).ExecuteCommand();
@@ -404,7 +407,7 @@
                            if (stockDetail.Qty != null)
                            {
                                stock.Qty -= (int)stockDetail.Qty;
                            }
                            if (stock.Qty == 0)
@@ -415,7 +418,7 @@
                            {
                                Db.Updateable(stock).ExecuteCommand();
                            }
                            Db.Deleteable(stockDetail).ExecuteCommand();
                            Db.Deleteable(stockInfo).ExecuteCommand();
                            if (locate != null)
@@ -435,14 +438,14 @@
                            bind.TaskNo = "";
                            bind.CompleteTime = null;
                            Db.Updateable(bind).ExecuteCommand();
                        }
                        else
                        {
                            throw new Exception("记录的功能编号异常");
                        }
                    }
                    log.Status = status;
                    log.Opinion = opinion;
                    log.AuditTime = DateTime.Now;