修改凌晨生成的日期时间为当天的23:59:59

This commit is contained in:
maqiao 2025-10-29 11:45:48 +08:00
parent b86b292c16
commit 63d19eb790
10 changed files with 22 additions and 12 deletions

View File

@ -671,6 +671,7 @@ namespace DM_Weight.ViewModels
if (accountBookG2Day != null)
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + it.AddQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
}
else
@ -688,7 +689,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存"
}).ExecuteCommand();
if (iDayResult <= 0)

View File

@ -251,6 +251,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + it.AddQuantity;
accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + it.AddQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -270,7 +271,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime=DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
AddQuantity=it.AddQuantity
}).ExecuteCommand();

View File

@ -249,6 +249,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - it.TakeQuantity;
accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + accountBookG2Day.OutQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -267,8 +268,8 @@ namespace DM_Weight.ViewModels
UserId1 = HomeWindowViewModel.Operator?.Id,
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime =new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
OutQuantity=it.TakeQuantity
}).ExecuteCommand();

View File

@ -304,7 +304,8 @@ namespace DM_Weight.ViewModels
accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + it.AddQuantity;
//负数直接记0
accountBookG2Day.TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 && accountBookEmpty.TotalStock > it.AddQuantity ? accountBookEmpty.TotalStock - it.AddQuantity : 0) : 0);
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock= accountBookG2Day.ManuStock;
}
@ -324,7 +325,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime=DateTime.Now,
CreateTime=new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
AddQuantity=it.AddQuantity
}).ExecuteCommand();

View File

@ -373,6 +373,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - it.TakeQuantity;
accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + it.TakeQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
}
else
@ -391,7 +392,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
OutQuantity=it.TakeQuantity
}).ExecuteCommand();

View File

@ -350,6 +350,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + it.ReturnQuantity;
accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + it.ReturnQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -369,7 +370,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
AddQuantity= it.ReturnQuantity
}).ExecuteCommand();

View File

@ -392,6 +392,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - it.TakeQuantity;
accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + it.TakeQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
}
else
@ -410,7 +411,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
OutQuantity=it.TakeQuantity
}).ExecuteCommand();

View File

@ -281,6 +281,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + ChannelStock.ReturnQuantity;
accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + ChannelStock.ReturnQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -300,7 +301,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
AddQuantity=ChannelStock.ReturnQuantity
}).ExecuteCommand();

View File

@ -285,6 +285,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + it.AddQuantity;
accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + it.AddQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -304,7 +305,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
AddQuantity=it.AddQuantity
}).ExecuteCommand();

View File

@ -258,6 +258,7 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - it.TakeQuantity;
accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + it.TakeQuantity;
accountBookG2Day.CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59);
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
@ -277,7 +278,7 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
CreateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59),
InvoiceNo = "日结存",
OutQuantity=it.TakeQuantity
}).ExecuteCommand();