所有出、入库页面均保存账册

This commit is contained in:
maqiao 2025-06-19 14:25:21 +08:00
parent d783b9c631
commit 02c626d829
11 changed files with 55 additions and 26 deletions

View File

@ -37,7 +37,7 @@
<!-- 按处方还药或者按取药记录还药 1:处方ReturnDrugWindow22药品ReturnDrugWindow--> <!-- 按处方还药或者按取药记录还药 1:处方ReturnDrugWindow22药品ReturnDrugWindow-->
<add key="returnDrugMode" value="1" /> <add key="returnDrugMode" value="1" />
<!-- 自动退出时间单位秒为0时不自动退出 --> <!-- 自动退出时间单位秒为0时不自动退出 -->
<add key="autoExit" value="5"/> <add key="autoExit" value="0"/>
<!-- 无操作退出录像时间单位秒为0时不退出录像 --> <!-- 无操作退出录像时间单位秒为0时不退出录像 -->
<add key="stopRecord" value="180"/> <add key="stopRecord" value="180"/>

View File

@ -459,7 +459,7 @@ namespace DM_Weight.ViewModels
//不够取 //不够取
ChannelStock newStock = new ChannelStock(); ChannelStock newStock = new ChannelStock();
//newStock.Chnguid = jiaoStock.Chnguid; //newStock.Chnguid = jiaoStock.Chnguid;
//newStock.BaseQuantity = jiaoStock.BaseQuantity; newStock.BaseQuantity = jiaoStock.BaseQuantity;
newStock.ManuNo = Jiaojie_ChannelStocks[i].ManuNo; newStock.ManuNo = Jiaojie_ChannelStocks[i].ManuNo;
newStock.EffDate = Jiaojie_ChannelStocks[i].EffDate; newStock.EffDate = Jiaojie_ChannelStocks[i].EffDate;
newStock.DrawerNo = Jiaojie_ChannelStocks[i].DrawerNo; newStock.DrawerNo = Jiaojie_ChannelStocks[i].DrawerNo;
@ -485,7 +485,7 @@ namespace DM_Weight.ViewModels
ChannelStock newStock = new ChannelStock(); ChannelStock newStock = new ChannelStock();
//newStock.Chnguid = jiaoStock.Chnguid; //newStock.Chnguid = jiaoStock.Chnguid;
//newStock.BaseQuantity = jiaoStock.BaseQuantity; newStock.BaseQuantity = jiaoStock.BaseQuantity;
newStock.ManuNo = Jiaojie_ChannelStocks[i].ManuNo; newStock.ManuNo = Jiaojie_ChannelStocks[i].ManuNo;
newStock.EffDate = Jiaojie_ChannelStocks[i].EffDate; newStock.EffDate = Jiaojie_ChannelStocks[i].EffDate;
newStock.DrawerNo = Jiaojie_ChannelStocks[i].DrawerNo; newStock.DrawerNo = Jiaojie_ChannelStocks[i].DrawerNo;

View File

@ -125,7 +125,7 @@ namespace DM_Weight.ViewModels
ChannelStocks = SqlSugarHelper.Db.Queryable<ChannelStock>() ChannelStocks = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Includes<ChannelList>(cs => cs.ChannelLst) .Includes<ChannelList>(cs => cs.ChannelLst)
.Includes<DrugInfo>(cs => cs.DrugInfo) .Includes<DrugInfo>(cs => cs.DrugInfo)
.Where(cs => cs.MachineId == (ConfigurationManager.AppSettings["jj_machineId"] ?? "DM5") && cs.NeedNum > 0) .Where(cs => cs.MachineId == (ConfigurationManager.AppSettings["jj_machineId"] ?? "DM5") && (cs.NeedNum > 0 || cs.AddToJJNum > 0))
.OrderBy(cs => cs.Chnguid) .OrderBy(cs => cs.Chnguid)
.OrderBy(cs => cs.DrawerNo) .OrderBy(cs => cs.DrawerNo)
.ToList(); .ToList();
@ -159,6 +159,8 @@ namespace DM_Weight.ViewModels
channelList.channelStocks.AddRange(ChannelStocks.Where(cs => cs.DrawerNo == DrawerNoList[i]&&(cs.NeedNum>0||cs.AddToJJNum>0)).ToList()); channelList.channelStocks.AddRange(ChannelStocks.Where(cs => cs.DrawerNo == DrawerNoList[i]&&(cs.NeedNum>0||cs.AddToJJNum>0)).ToList());
if (channelList != null) if (channelList != null)
{ {
if (channelList.channelStocks[0].AddToJJNum>0)
channelList.State=1; //表示有补药
channelLists.Add(channelList); channelLists.Add(channelList);
} }
} }
@ -534,7 +536,7 @@ namespace DM_Weight.ViewModels
{ {
AlertMsg alertMsg = new AlertMsg AlertMsg alertMsg = new AlertMsg
{ {
Message = $"未选择药品,请先勾选要药箱号", Message = $"未选择药品,请先点选药箱号",
Type = MsgType.ERROR, Type = MsgType.ERROR,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
@ -606,7 +608,15 @@ namespace DM_Weight.ViewModels
DialogServiceExtensions.ShowDialogHost(_dialogService, "AddToJiaoJieDialog", dialogParameters, DoDialogResult, "RootDialog"); DialogServiceExtensions.ShowDialogHost(_dialogService, "AddToJiaoJieDialog", dialogParameters, DoDialogResult, "RootDialog");
} }
if(_ChannelList!=null&& _ChannelList.State == 1)
{
AlertMsg alertMsg = new AlertMsg
{
Message = $"药品已取出,待入库",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}
} }
} }
} }

View File

@ -194,7 +194,7 @@ namespace DM_Weight.ViewModels
List<ChannelStock> record = ChannelStocks.FindAll(it => it.AddQuantity != 0).ToList(); List<ChannelStock> record = ChannelStocks.FindAll(it => it.AddQuantity != 0).ToList();
if (record.Count > 0) if (record.Count > 0)
{ {
string InvoiceId = "DRAWER_" + CurrentTimeMillis(); string InvoiceId = "DRAWER_Add_" + CurrentTimeMillis();
var f = SqlSugarHelper.Db.UseTran(() => var f = SqlSugarHelper.Db.UseTran(() =>
{ {
@ -215,7 +215,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -253,8 +253,9 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据
AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable<AccountBookG2>() AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable<AccountBookG2>()

View File

@ -194,7 +194,7 @@ namespace DM_Weight.ViewModels
logger.Info("点击完成按钮,库位数据:" + JsonConvert.SerializeObject(record)); logger.Info("点击完成按钮,库位数据:" + JsonConvert.SerializeObject(record));
if (record.Count > 0) if (record.Count > 0)
{ {
string InvoiceId = "DRAWER_" + CurrentTimeMillis(); string InvoiceId = "DRAWER_Take_" + CurrentTimeMillis();
var f = SqlSugarHelper.Db.UseTran(() => var f = SqlSugarHelper.Db.UseTran(() =>
{ {
@ -213,7 +213,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -251,7 +251,9 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据

View File

@ -318,7 +318,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -357,7 +357,9 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据

View File

@ -314,7 +314,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -352,7 +352,10 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据

View File

@ -337,7 +337,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -375,7 +375,10 @@ namespace DM_Weight.ViewModels
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
InvoiceNo = OrderInfo.OrderNo InvoiceNo = OrderInfo.OrderNo,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存与总结存数据 //修改凌晨生成的日结存与总结存数据

View File

@ -240,7 +240,7 @@ namespace DM_Weight.ViewModels
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(ChannelStock.MachineId)) .Where(cs => cs.MachineId.Equals(ChannelStock.MachineId)|| cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(ChannelStock.DrugId)) .Where(cs => cs.DrugId.Equals(ChannelStock.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -284,7 +284,10 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == ChannelStock.ManuNo && itx.EffDate == ChannelStock.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据

View File

@ -245,7 +245,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -283,7 +283,9 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据

View File

@ -221,7 +221,7 @@ namespace DM_Weight.ViewModels
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand(); }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
// 获取更新完库存后的药品库存 // 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>() List<ChannelStock> nowChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Where(cs => cs.MachineId.Equals(it.MachineId)) .Where(cs => cs.MachineId.Equals(it.MachineId) || cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"]))
.Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs => cs.DrugId.Equals(it.DrugId))
.Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrawerType == 1)
.ToList(); .ToList();
@ -260,7 +260,10 @@ namespace DM_Weight.ViewModels
UserId2 = HomeWindowViewModel.Reviewer?.Id, UserId2 = HomeWindowViewModel.Reviewer?.Id,
MachineId = ConfigurationManager.AppSettings["machineId"].ToString(), MachineId = ConfigurationManager.AppSettings["machineId"].ToString(),
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"), CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now CreateTime = DateTime.Now,
TotalStock = nowChannels.Sum(itx => itx.Quantity),
ManuStock = nowChannels.Where(itx => itx.ManuNo == it.ManuNo && itx.EffDate == it.EffDate).Sum(itx => itx.Quantity)
}).ExecuteCommand(); }).ExecuteCommand();
//修改凌晨生成的日结存数据 //修改凌晨生成的日结存数据
@ -343,7 +346,7 @@ namespace DM_Weight.ViewModels
{ {
singleChannels.ForEach(it => singleChannels.ForEach(it =>
{ {
_portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity); _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
Thread.Sleep(150); Thread.Sleep(150);
}); });
} }