去掉用户实体中药箱号字段

This commit is contained in:
maqiao 2025-10-24 09:19:15 +08:00
parent acdecc8700
commit 52769b3030
2 changed files with 23 additions and 21 deletions

View File

@ -74,7 +74,7 @@ namespace DM_Weight.Models
return "userList = [UserName:" + Nickname + ", UserId:" + UserName + "]";
}
//保存用户已取药箱的药箱号
[SugarColumn(ColumnName = "Box_Num")]
public string BoxNumber { get; set; }
//[SugarColumn(ColumnName = "Box_Num")]
//public string BoxNumber { get; set; }
}
}

View File

@ -524,23 +524,6 @@ namespace DM_Weight.ViewModels
.Where(it => it.DrawerType == 1)
.ToList();
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
DrawerNo = cs.DrawerNo,
ColNo = cs.ColNo,
DrugId = cs.DrugId,
ManuNo = cs.ManuNo,
EffDate = !String.IsNullOrEmpty(cs.EffDate) ? DateTime.ParseExact(cs.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
Operator = HomeWindowViewModel.Operator?.Id,
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = oi._OrderDetail.Quantity,
Type = 2,
InvoiceId = oi.OrderNo
//, StockQuantity = nowChannels.Sum(it => it.Quantity)
}).ExecuteCommand();
#region 使
//查询发药时间
//MachineRecord SendMachineRecord = SqlSugarHelper.Db.Queryable<MachineRecord>().Where(mr => mr.DrawerNo == cs.DrawerNo && mr.Type == 2)
@ -594,10 +577,10 @@ namespace DM_Weight.ViewModels
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - oi._OrderDetail.Quantity;
accountBookG2Day.OutQuantity = accountBookG2Day.OutQuantity + oi._OrderDetail.Quantity;
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
accountBookG2Day.UseDose = (Convert.ToInt32(accountBookG2Day.UseDose) + Convert.ToInt32(oi._OrderDetail.surgicalResidual.UseDose)).ToString();
accountBookG2Day.ResidualDose = (Convert.ToInt32(accountBookG2Day.ResidualDose) + Convert.ToInt32(oi._OrderDetail.surgicalResidual.ResidualDose)).ToString();
accountBookG2Day.TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi._OrderDetail.Quantity;
SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
manuStock = accountBookG2Day.ManuStock;
}
else
@ -610,7 +593,7 @@ namespace DM_Weight.ViewModels
ManuNo = cs.ManuNo,
EffDate = cs.EffDate,
YQuantity = 0,
ManuStock = nowChannels.Sum(it => it.Quantity), //oi._OrderDetail.Quantity,
ManuStock = manuStock > 0 ? manuStock :nowChannels.Sum(it => it.Quantity), //oi._OrderDetail.Quantity,
TotalStock = oi._OrderDetail.Quantity,
UserId1 = HomeWindowViewModel.Operator?.Id,
UserId2 = HomeWindowViewModel.Reviewer?.Id,
@ -686,6 +669,25 @@ namespace DM_Weight.ViewModels
logger.Info($"未写入总结存数据{oi._OrderDetail.DrugId}-{oi._OrderDetail.Quantity}");
}
}
SqlSugarHelper.Db.Insertable(new MachineRecord()
{
MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
DrawerNo = cs.DrawerNo,
ColNo = cs.ColNo,
DrugId = cs.DrugId,
ManuNo = cs.ManuNo,
EffDate = !String.IsNullOrEmpty(cs.EffDate) ? DateTime.ParseExact(cs.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
Operator = HomeWindowViewModel.Operator?.Id,
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = oi._OrderDetail.Quantity,
Type = 2,
InvoiceId = oi.OrderNo,
GetId= manuStock,
DepartmentId=$"当前库存:{nowChannels.Sum(it => it.Quantity)},空瓶数:{(accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi._OrderDetail.Quantity}"
//, StockQuantity = nowChannels.Sum(it => it.Quantity)
}).ExecuteCommand();
}
if (!string.IsNullOrEmpty(empChannelStock))
{