出药时按先入先出规则
This commit is contained in:
parent
96b3918d4c
commit
a105928315
|
@ -91,6 +91,12 @@ namespace DM_Weight.Models
|
|||
///</summary>
|
||||
[SugarColumn(ColumnName = "state")]
|
||||
public int? State { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// 入库时间:用于先入先出
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fill_time")]
|
||||
public DateTime? FillTime { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool IsSelected { get; set; }
|
||||
|
|
|
@ -301,7 +301,8 @@ namespace DM_Weight.ViewModels
|
|||
DrawerNo = it.DrawerNo,
|
||||
ColNo = it.ColNo,
|
||||
DrawerType = it.DrawerType,
|
||||
BoardType = it.BoardType
|
||||
BoardType = it.BoardType,
|
||||
FillTime=it.Quantity<=0?DateTime.Now:it.FillTime
|
||||
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.DrugId }).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
|
@ -328,7 +329,8 @@ namespace DM_Weight.ViewModels
|
|||
DrawerType = it.DrawerType,
|
||||
BoardType = it.BoardType,
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1"
|
||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
||||
FillTime=DateTime.Now
|
||||
}).ExecuteCommand();
|
||||
}
|
||||
// 获取更新完库存后的药品库存
|
||||
|
|
|
@ -317,6 +317,7 @@ namespace DM_Weight.ViewModels
|
|||
ManuNo = it.ManuNo,
|
||||
EffDate = it.EffDate,
|
||||
Id = it.Id,
|
||||
FillTime=it.Quantity<=0?DateTime.Now:it.FillTime
|
||||
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
|
@ -347,6 +348,7 @@ namespace DM_Weight.ViewModels
|
|||
ManuNo = recordList[0].ManuNo,
|
||||
EffDate = recordList[0].EffDate,
|
||||
Id = recordList[0].Id,
|
||||
FillTime = recordList[0].Quantity<=0?DateTime.Now: recordList[0].FillTime
|
||||
}).Where(item => item.Id == item.Id).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
|
@ -364,7 +366,8 @@ namespace DM_Weight.ViewModels
|
|||
DrawerType = it.DrawerType,
|
||||
BoardType = it.BoardType,
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1"
|
||||
MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1",
|
||||
FillTime=DateTime.Now
|
||||
}).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,7 +198,8 @@ namespace DM_Weight.ViewModels
|
|||
.WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo))
|
||||
.Where(cs => cs.DrugId == orderDetail.DrugId)
|
||||
.OrderBy(cs => cs.EffDate)
|
||||
.OrderBy(cs => cs.DrawerNo)
|
||||
//.OrderBy(cs => cs.DrawerNo)
|
||||
.OrderBy(cs => cs.FillTime)
|
||||
.ToList();
|
||||
int total = HasQChannels.Sum(it => it.Quantity);
|
||||
int TakeQ = orderDetail.Quantity;
|
||||
|
|
|
@ -219,8 +219,9 @@ namespace DM_Weight.ViewModels
|
|||
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉
|
||||
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
|
||||
.OrderBy(cs => cs.EffDate)
|
||||
.OrderBy(cs => cs.DrawerNo)
|
||||
.OrderBy(cs => cs.ManuNo)
|
||||
//.OrderBy(cs => cs.DrawerNo)
|
||||
//.OrderBy(cs => cs.ManuNo)
|
||||
.OrderBy(cs=>cs.FillTime)
|
||||
.ToList();
|
||||
int total = HasQChannels.Sum(it => it.Quantity);
|
||||
int TakeQ = orderDetail.Quantity;
|
||||
|
|
|
@ -284,6 +284,7 @@ namespace DM_Weight.ViewModels
|
|||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||
{
|
||||
Quantity = ChannelStock.Quantity + ReturnQuantity,
|
||||
FillTime= ChannelStock.Quantity<=0 ? DateTime.Now : ChannelStock.FillTime,
|
||||
Id = ChannelStock.Id,
|
||||
}).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
|
||||
|
||||
|
|
Loading…
Reference in New Issue