Compare commits

...

2 Commits

Author SHA1 Message Date
马巧 ba687a1dd0 中部战区修改更新 2025-08-27 08:38:00 +08:00
马巧 aafa20f7af 中部战区项目提交修改 2025-08-21 18:25:23 +08:00
67 changed files with 3847 additions and 871 deletions

View File

@ -33,6 +33,7 @@ namespace MasaBlazorApp3.DataAccess
public ITable<PlanDetails> PlanDetails => this.GetTable<PlanDetails>();
public ITable<AccountBookG2> AccountBookG2 => this.GetTable<AccountBookG2>();
public ITable<HkcChangeShifts> HkcChangeShifts => this.GetTable<HkcChangeShifts>();
public ITable<HkcChangeShiftsDetail> HkcChangeShiftsDetail => this.GetTable<HkcChangeShiftsDetail>();

View File

@ -32,54 +32,69 @@ namespace MasaBlazorApp3.DataAccess.Dao
public Task<bool> DrawerCheckFinish(List<ChannelStock> Stocks);
//抽屉获取库存数据--药品绑定
Task<ChannelStockWithDrawerCount<ChannelStock>> GetChannelStockByBiaoDing(int DrawerNo, int Quantity=0);
//手术室药获取绑定数据
//手术室药获取绑定数据
Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip);
/// <summary>
/// 手术室药箱绑定套餐
/// 手术室药盒绑定套餐
/// </summary>
/// <returns></returns>
Task<bool> BindBox(ChannelList list, Plan plan);
/// <summary>
/// 手术室药盒绑定套餐
/// </summary>
/// <returns></returns>
Task<bool> BindBox(ChannelList channelList);
/// <summary>
/// 手术室药箱解绑套餐
/// 手术室药解绑套餐
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
Task<bool> UnBindBox(ChannelList list);
//获取手术室药中所有要补药的数据
//获取手术室药中所有要补药的数据
Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip);
//手术室药补药获取毒麻柜中的药品信息
//手术室药补药获取毒麻柜中的药品信息
Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl);
//手术室药补药完成
//手术室药补药完成
Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList);
//手术室药入库
//手术室药入库
Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip);
//手术室药箱入库获取待入库明细
// 药盒入库弹窗页面获取要入库的药品明细信息
Task<List<ChannelStock>> GetBoxAddToBox(ChannelList cl);
//手术室药盒入库获取待入库明细
Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip);
// 手术室药箱待入库明细入库完成
// 手术室药待入库明细入库完成
Task<bool> BoxAddBoxFinish(ChannelList boxChannelList);
//手术室药箱获取药箱药品及库存信息
//手术室药盒获取药盒药品及库存信息
Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip);
//药箱移库时获取选中药箱号的药品信息
//药盒移库时获取选中药盒号的药品信息
Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip);
/// <summary>
/// 药箱交换药品获取所有除本药箱外的所有药箱
/// 药盒交换药品获取所有除本药盒外的所有药盒
/// </summary>
/// <param name="machineId"></param>
/// <returns></returns>
Task<int[]> GetDrawerNum(ChannelStock channelStock);
/// <summary>
/// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱
/// 药盒移除药品,获取所有除本药盒外的所有包含该药品的药盒
/// </summary>
/// <param name="machineId"></param>
/// <returns></returns>
Task<int[]> GetDrawerNumForRemove(ChannelStock channelStock);
//手术室药交换药品完成
//手术室药交换药品完成
Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> Stocks);
//手术室药移出药品完成
//手术室药移出药品完成
Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity);
Task<List<ChannelList>> GetAllBox();
//根据药盒查询药品信息
Task<List<ChannelStock>> GetChannelStockByBox(int BoxNum);
//根据套餐下无库存的药箱
Task<List<ChannelStock>> GetChannelStockByPlan(string plan);
//手术室药盒获取绑定数据
Task<List<ChannelList>> GetAllChannelList();
}
}

View File

@ -26,9 +26,11 @@ namespace MasaBlazorApp3.DataAccess.Dao
public Task<bool> OrderReturnFinish(List<OperationVo<MachineRecord>> datas, string OrderrNo);
public Task<List<OperationVo<MachineRecord>>> getReturnInfoByOrderNo(string OrderrNo);
//获取药中的用药信息
//获取药中的用药信息
public Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box,string OrderrNo, DateTime OrderDate, int? take, int? skip);
//获取所有药箱号
//获取待处理处方中的麻醉师
public Task<PageData<OrderInfo>> GetAllOrderInfo(string Name, string OrderrNo, DateTime? OrderDate, int? take, int? skip);
//获取所有药盒号
public Task<int[]> GetDrawerNum(string machineId);
//核对处方
public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo);

View File

@ -13,5 +13,9 @@ namespace MasaBlazorApp3.DataAccess.Dao
Task<PageData<ReportStockDateInfo>> GetStockExportData(string drugName);
//专用账册导出数据
Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName);
//手术室患者麻醉药品使用登记本
Task<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime? startDate);
//请领登记表导出
Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate);
}
}

View File

@ -11,6 +11,7 @@ using Microsoft.Extensions.Options;
using Mysqlx.Crud;
using System.Collections.Generic;
using System.Data;
using System.Linq;
namespace MasaBlazorApp3.DataAccess.Impl
{
@ -549,7 +550,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.ToListAsync();
return new ChannelStockWithDrawerCount<ChannelStock>() { DrawerArray = ints, ChannelStocks = channelStocks };
}
//手术室药获取绑定数据
//手术室药获取绑定数据
public async Task<PageMultiData<ChannelList, Plan>> GetAllChannelListWithPlan(int? take, int? skip)
{
@ -603,10 +604,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
};
}
/// <summary>
/// 手术室药绑定套餐
/// 手术室药绑定套餐
/// </summary>
/// <returns></returns>
public async Task<bool> BindBox(ChannelList list)
public async Task<bool> BindBox(ChannelList list,Plan plan)
{
try
{
@ -614,10 +615,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
bool bFlag = true;
var q = _connection.ChannelList
.Where(cs => cs.Id == list.Id).Set(cs => cs.DrugId, list.PlanInfo.Id.ToString());
.Where(cs => cs.Id == list.Id).Set(cs => cs.DrugId, plan.Id.ToString());
//将套餐中的药品信息写入channelStock
//查询套餐中药品信息
var query = _connection.PlanDetails.AsQueryable().Where(p => p.PlanId == list.PlanInfo.Id&&p.UseState==1);
var query = _connection.PlanDetails.AsQueryable().Where(p => p.PlanId == plan.Id && p.UseState == 1);
List<PlanDetails> planInfos = await query.ToListAsync();
if (planInfos != null && planInfos.Count > 0)
{
@ -631,7 +632,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
DrawerNo = list.DrawerNo,
DrugId = planInfos[i].DrugId.ToString(),
BaseQuantity = planInfos[i].BaseQuantity,
BoxState = 1
//BoxState = 1
});
if (mid > 0)
{
@ -647,6 +648,21 @@ namespace MasaBlazorApp3.DataAccess.Impl
var r = await q.UpdateAsync();
if (bFlag && r > 0)
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.machineId,
DrawerNo = list.DrawerNo,
ColNo = list.ColNo,
DrugId = list.DrugId,
OperationTime = DateTime.Now,
Type = 55,
Quantity = list.TotalQuantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"药盒{list.DrawerNo}绑定套餐{list.DrugId}",
//GetId = operationVo.data.Id
});
_connection.CommitTransaction();
return true;
}
@ -664,7 +680,83 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
}
/// <summary>
/// 手术室药箱解绑套餐
/// 手术室药盒绑定套餐
/// </summary>
/// <returns></returns>
public async Task<bool> BindBox(ChannelList list)
{
try
{
_connection.BeginTransaction();
bool bFlag = true;
var q = _connection.ChannelList
.Where(cs => cs.Id == list.Id).Set(cs => cs.DrugId, list.PlanInfo.Id.ToString());
//将套餐中的药品信息写入channelStock
//查询套餐中药品信息
var query = _connection.PlanDetails.AsQueryable().Where(p => p.PlanId == list.PlanInfo.Id && p.UseState == 1);
List<PlanDetails> planInfos = await query.ToListAsync();
if (planInfos != null && planInfos.Count > 0)
{
for (int i = 0; i < planInfos.Count; i++)
{
int mid = await _connection.InsertAsync(new ChannelStock()
{
Id = Guid.NewGuid().ToString(),
ListId = list.Id,
MachineId = list.MachineId,
DrawerNo = list.DrawerNo,
DrugId = planInfos[i].DrugId.ToString(),
BaseQuantity = planInfos[i].BaseQuantity,
//BoxState = 1
});
if (mid > 0)
{
bFlag = true;
}
else
{
bFlag = false;
break;
}
}
}
var r = await q.UpdateAsync();
if (bFlag && r > 0)
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.machineId,
DrawerNo = list.DrawerNo,
ColNo = list.ColNo,
DrugId = list.DrugId,
OperationTime = DateTime.Now,
Type = 55,
Quantity = list.TotalQuantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"药盒{list.DrawerNo}绑定套餐{list.DrugId}",
//GetId = operationVo.data.Id
});
_connection.CommitTransaction();
return true;
}
else
{
_connection.RollbackTransaction();
return false;
}
}
catch (Exception ex)
{
_connection.RollbackTransaction();
logger.Info($"绑定套餐异常{ex.Message}");
return false;
}
}
/// <summary>
/// 手术室药盒解绑套餐
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
@ -678,10 +770,29 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Where(cs => cs.Id == list.Id)
.Set(cs => cs.DrugId, String.Empty)
.UpdateAsync();
var cs = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).DeleteAsync();
if (r > 0 && cs > 0)
int iCount = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).CountAsync();
int cs = 0;
if (iCount > 0)
{
cs = await _connection.ChannelStock.Where(cs => cs.ListId == list.Id).DeleteAsync();
}
if (r > 0 && (iCount > 0 && cs > 0 || iCount <= 0))
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.machineId,
DrawerNo = list.DrawerNo,
ColNo = list.ColNo,
DrugId = list.DrugId,
OperationTime = DateTime.Now,
Type = 56,
Quantity = list.TotalQuantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"药盒{list.DrawerNo}解绑套餐{list.DrugId}",
//GetId = operationVo.data.Id
});
_connection.CommitTransaction();
return true;
}
@ -694,29 +805,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
catch (Exception ex)
{
_connection.RollbackTransaction();
logger.Info($"手术室药解绑异常:{ex.Message}");
logger.Info($"手术室药解绑异常:{ex.Message}");
return false;
}
}
//获取手术室药中所有要补药的数据
//获取手术室药中所有要补药的数据
public async Task<PageData<ChannelList>> GetAllBoxAddDrug(int? take, int? skip)
{
try
{
List<ChannelList> channelLists = new List<ChannelList>();
var query = _connection.ChannelStock//.AsQueryable()
.Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1)
.Where(cs => cs.MachineId == _setting.boxMachineId)
.GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
.Select(g => new
{
DrawerNo = g.Key.DrawerNo,
DrugId = g.Key.DrugId,
sumQuantity = g.Sum(cs => cs.Quantity)
})
sumQuantity = g.Sum(cs => cs.Quantity),
baseQuantity = g.Max(cs => cs.BaseQuantity),
sumAdd=g.Sum(cs=>cs.AddToQuantity)
}).Where(x => x.baseQuantity > x.sumQuantity+x.sumAdd)
.ToList();
var queryChannelStock = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1)
.Where(cs => cs.MachineId == _setting.boxMachineId)
.LoadWith(cs => cs.Drug).ToList();
@ -740,6 +853,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
channelLists.Add(queryList[i]);
}
}
//if (query != null && query.Count > 0)
//{
// var queryList = await _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId == _setting.boxMachineId).ToListAsync();
// for (int i = 0; i < queryList.Count; i++)
// {
// foreach (var item in query)
// {
// if (queryList[i].DrawerNo == item.DrawerNo)
// {
// ChannelStock? stock = _connection.ChannelStock.AsQueryable()
// .Where(cs => cs.MachineId == _setting.boxMachineId && cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId).LoadWith(cs => cs.Drug).FirstOrDefault();
// stock.NeedQuantity = item.baseQuantity - item.sumQuantity;
// queryList[i].ChannelStocks.Add(stock);
// }
// }
// if (queryList[i].ChannelStocks != null && queryList[i].ChannelStocks.Count > 0)
// {
// channelLists.Add(queryList[i]);
// }
// }
//}
int pagedData = channelLists.Count;
@ -754,12 +892,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"获取药中补药数据失败{ex.Message}");
logger.Info($"获取药中补药数据失败{ex.Message}");
return null;
}
}
//手术室药补药获取毒麻柜中的药品信息
//手术室药补药获取毒麻柜中的药品信息
public async Task<List<BoxTakeVo>> getTakeInfoByBox(ChannelList cl)
{
try
@ -848,7 +986,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
return null;
}
}
//手术室药补药完成
//手术室药补药完成
public async Task<bool> BoxTakeFinish(List<BoxTakeVo> datas, ChannelList boxChannelList)
{
@ -856,17 +994,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
_connection.BeginTransaction();
var flag = true;
// 更新处方状态
//int r1 = _connection.ChannelStock.Where(oi => oi.OrderNo == datas.First().OrderDetail.OrderNo)
// .Set(oi => oi.Status, 1)
// .Update();
//if (!(r1 > 0))
//{
// flag = false;
// logger.Error("处方取药完成更新处方状态失败");
// _connection.RollbackTransaction();
// return flag;
//}
for (var i = 0; i < datas.Count; i++)
{
var boxTakeVo = datas[i];
@ -921,7 +1048,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
int r = _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.ChannelStock.Id)
.Set(cs => cs.Quantity, boxTakeVo.ChannelStock.Quantity - boxTakeVo.GetQuantity)
.Update();
#region ,
#region ,
// 获取更新完库存之后的药品库存
//List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
// .InnerJoin(
@ -931,7 +1058,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
// )
// .Where(cs => cs.DrugId.Equals(boxTakeVo.ChannelStock.DrugId))
// .ToListAsync();
// 保存账册,给药补药不记录出库账册
// 保存账册,给药补药不记录出库账册
//int acid = _connection.InsertWithInt32Identity(new AccountBook()
//{
// MachineId = _setting.machineId,
@ -949,24 +1076,40 @@ namespace MasaBlazorApp3.DataAccess.Impl
// //InvoiceId = orderTakeVo.OrderDetail.Id.ToString()
//});
#endregion
//更新药箱中的药品数量
int boxID = _connection.Insert(new ChannelStock()
//查询药盒中是否有该批次药品有则把对应数量累加无则insert
ChannelStock? BoxChannelStock = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.MachineId == boxTakeVo.BoxDetail.MachineId && cs.DrawerNo == boxTakeVo.BoxDetail.DrawerNo && cs.DrugId == boxTakeVo.ChannelStock.DrugId && cs.ManuNo == boxTakeVo.ChannelStock.ManuNo && cs.EffDate == EffDate).FirstOrDefault();
int boxID = 0;
if (BoxChannelStock != null)
{
Id = Guid.NewGuid().ToString(),
ListId = boxTakeVo.BoxDetail.Id,
MachineId = _setting.boxMachineId,
DrawerNo = boxTakeVo.BoxDetail.DrawerNo,
AddToQuantity = boxTakeVo.GetQuantity,
NeedQuantity = 0,
DrugId = boxTakeVo.ChannelStock.DrugId,
ManuNo = boxTakeVo.ChannelStock.ManuNo,
EffDate = EffDate,
BaseQuantity = boxTakeVo.BoxDetail.BaseQuantity,
BoardType = boxTakeVo.BoxDetail.BoardType,
BoxState = 2 //补药完成
});
// 手术室药箱入库记录
//BoxChannelStock.AddToQuantity += boxTakeVo.GetQuantity;
//BoxChannelStock.BoxState = 2;
//改为直接加到药盒库存中
BoxChannelStock.Quantity += boxTakeVo.GetQuantity;
boxID = await _connection.UpdateAsync(BoxChannelStock);
}
else
{
//更新药盒中的药品数量
boxID = _connection.Insert(new ChannelStock()
{
Id = Guid.NewGuid().ToString(),
ListId = boxTakeVo.BoxDetail.ListId,
MachineId = _setting.boxMachineId,
DrawerNo = boxTakeVo.BoxDetail.DrawerNo,
//AddToQuantity = boxTakeVo.Quantity,//boxTakeVo.GetQuantity,
//NeedQuantity = 0,
Quantity = boxTakeVo.GetQuantity,
DrugId = boxTakeVo.ChannelStock.DrugId,
ManuNo = boxTakeVo.ChannelStock.ManuNo,
EffDate = EffDate,
BaseQuantity = boxTakeVo.BoxDetail.BaseQuantity,
BoardType = boxTakeVo.BoxDetail.BoardType,
//BoxState = 2, //补药完成
FillTime = DateTime.Now
});
}
// 手术室药盒入库记录
int boxMId = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.machineId,
@ -980,12 +1123,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = boxTakeVo.ChannelStock.Id.ToString(),
});
//int totalQuantity = _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId)&&p.DrugId== boxTakeVo.BoxDetail.DrugId).Sum(p => p.BaseQuantity);
//int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id)
// .Set(cl => cl.TotalQuantity, totalQuantity)
// .Update();
int delResutl = await _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.BoxDetail.Id).DeleteAsync();
});
int delResutl = await _connection.ChannelStock.Where(cs => cs.MachineId == boxTakeVo.BoxDetail.MachineId && cs.DrugId == boxTakeVo.BoxDetail.DrugId && cs.ManuNo == null).DeleteAsync();
if (mid > 0 && r > 0 && boxID > 0 && boxMId > 0)
{
if (boxTakeVo.ChannelStock.BoardType.ToString().Contains("5"))
@ -1002,6 +1141,10 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
if (flag)
{
int totalQuantity = boxChannelList.TotalQuantity + datas.Sum(it => it.GetQuantity);
int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id)
.Set(cl => cl.TotalQuantity, totalQuantity)
.Update();
_connection.CommitTransaction();
}
else
@ -1020,21 +1163,23 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
//手术室药入库
//手术室药入库
public async Task<PageData<ChannelList>> GetBoxWaitInfo(int? take, int? skip)
{
try
{
List<ChannelList> channelLists = new List<ChannelList>();
var query = _connection.ChannelStock//.AsQueryable()
.Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 2)
.Where(cs => cs.MachineId == _setting.boxMachineId)
.GroupBy(cs => new { cs.DrawerNo, cs.DrugId })
.Select(g => new
{
DrawerNo = g.Key.DrawerNo,
DrugId = g.Key.DrugId,
sumQuantity = g.Sum(cs => cs.Quantity)
})
sumQuantity = g.Sum(cs => cs.Quantity),
baseQuantity = g.Max(cs => cs.BaseQuantity),
AddToQuantity = g.Sum(cs => cs.AddToQuantity)
}).Where(x => x.baseQuantity > x.sumQuantity)
.ToList();
var queryChannelStock = _connection.ChannelStock.AsQueryable()
@ -1049,10 +1194,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
if (queryList[i].DrawerNo == item.DrawerNo)
{
ChannelStock stock = queryChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BaseQuantity > item.sumQuantity).FirstOrDefault();
ChannelStock? stock = queryChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BaseQuantity > item.sumQuantity).FirstOrDefault();
if (stock != null)
{
stock.NeedQuantity = stock.BaseQuantity - item.sumQuantity;
stock.AddToQuantity = item.AddToQuantity;
queryList[i].ChannelStocks.Add(stock);
}
}
@ -1076,11 +1222,43 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"获取药中补药数据失败{ex.Message}");
logger.Info($"获取药中补药数据失败{ex.Message}");
return null;
}
}
//手术室药箱入库获取待入库明细
// 药盒入库弹窗页面获取要入库的药品明细信息
public async Task<List<ChannelStock>> GetBoxAddToBox(ChannelList cl)
{
if (cl != null)
{
List<DrugManuNo> manuNosList = new List<DrugManuNo>();
foreach (var item in cl.ChannelStocks)
{
List<DrugManuNo> manuList = new List<DrugManuNo>();
List<ChannelStock> csList = _connection.ChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BoxState == 2).ToList();
for (int i = 0; i < csList.Count; i++)
{
var existingItem = manuList.FirstOrDefault(item => item.DrugId == csList[i].DrugId && item.ManuNo == csList[i].ManuNo&& item.EffDate.ToString() == csList[i].EffDate);
if (existingItem != null)
{
existingItem.Quantity += csList[i].AddToQuantity;
}
else
{
DrugManuNo manu = new DrugManuNo();
manu.DrugId = csList[i].DrugId;
manu.ManuNo = csList[i].ManuNo;
manu.EffDate = Convert.ToDateTime(csList[i].EffDate);
manu.Quantity = csList[i].AddToQuantity;
manuList.Add(manu);
}
}
item.drugManuNoList = manuList;
}
}
return cl.ChannelStocks;
}
//手术室药盒入库获取待入库明细
public async Task<List<BoxTakeVo>> getBoxWaitByBox(ChannelList cl, int? take, int? skip)
{
try
@ -1119,75 +1297,88 @@ namespace MasaBlazorApp3.DataAccess.Impl
return null;
}
}
// 手术室药待入库明细入库完成
// 手术室药待入库明细入库完成
public async Task<bool> BoxAddBoxFinish(ChannelList boxChannelList)
{
try
{
_connection.BeginTransaction();
bool flag = true;
int totalQuantity =0;
int totalQuantity = 0;
for (var i = 0; i < boxChannelList.ChannelStocks.Count; i++)
{
var EffDate = boxChannelList.ChannelStocks[i].EffDate;
//效期转换出错
if (boxChannelList.ChannelStocks[i].EffDate != null)
for (int j = 0; j < boxChannelList.ChannelStocks[i].drugManuNoList.Count; j++)
{
string[] idate = boxChannelList.ChannelStocks[i].EffDate.Split('/');
foreach (string iS in idate)
var EffDate = boxChannelList.ChannelStocks[i].drugManuNoList[j].EffDate?.ToString("yyyy-MM-dd");
//效期转换出错
//if (boxChannelList.ChannelStocks[i].EffDate != null)
//{
// string[] idate = boxChannelList.ChannelStocks[i].EffDate.Split('/');
// foreach (string iS in idate)
// {
// if (!string.IsNullOrEmpty(iS.Trim()))
// {
// switch (iS.Trim().Length)
// {
// case 4:
// EffDate = iS.Trim();
// break;
// case 2:
// EffDate += "-" + iS.Trim();
// break;
// case 1:
// EffDate += "-0" + iS.Trim();
// break;
// }
// }
// }
//}
// 手术室药盒入库记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
if (!string.IsNullOrEmpty(iS.Trim()))
{
switch (iS.Trim().Length)
{
case 4:
EffDate = iS.Trim();
break;
case 2:
EffDate += "-" + iS.Trim();
break;
case 1:
EffDate += "-0" + iS.Trim();
break;
}
}
}
}
// 手术室药箱入库记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.boxMachineId,
DrawerNo = boxChannelList.ChannelStocks[i].DrawerNo,
DrugId = boxChannelList.ChannelStocks[i].DrugId,
ManuNo = boxChannelList.ChannelStocks[i].ManuNo,
EffDate = !String.IsNullOrEmpty(EffDate) ? DateTime.ParseExact(EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
OperationTime = DateTime.Now,
Type = 1,
Quantity = boxChannelList.ChannelStocks[i].AddToQuantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = boxChannelList.ChannelStocks[i].Id.ToString(),
});
// 更新库存
boxChannelList.ChannelStocks[i].Quantity= boxChannelList.ChannelStocks[i].Quantity+ boxChannelList.ChannelStocks[i].AddToQuantity;
boxChannelList.ChannelStocks[i].AddToQuantity = 0;
boxChannelList.ChannelStocks[i].NeedQuantity = 0;
boxChannelList.ChannelStocks[i].BoxState=0;
boxChannelList.ChannelStocks[i].EffDate = EffDate;
int r = _connection.Update(boxChannelList.ChannelStocks[i]);
MachineId = _setting.boxMachineId,
DrawerNo = boxChannelList.ChannelStocks[i].DrawerNo,
DrugId = boxChannelList.ChannelStocks[i].DrugId,
ManuNo = boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo,
EffDate = boxChannelList.ChannelStocks[i].drugManuNoList[j].EffDate,//!String.IsNullOrEmpty(EffDate) ? DateTime.ParseExact(EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
OperationTime = DateTime.Now,
Type = 1,
Quantity = boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = boxChannelList.ChannelStocks[i].Id.ToString(),
});
// 更新库存
ChannelStock? updateChannelStock = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.DrawerNo == boxChannelList.ChannelStocks[i].DrawerNo && cs.DrugId == boxChannelList.ChannelStocks[i].drugManuNoList[j].DrugId&&cs.ManuNo== boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo&&cs.EffDate == EffDate)
.FirstOrDefault();
int r = 0;
if (updateChannelStock != null)
{
updateChannelStock.Quantity = updateChannelStock.Quantity+ boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity;
updateChannelStock.AddToQuantity = 0;
updateChannelStock.NeedQuantity = 0;
updateChannelStock.BoxState = 0;
//updateChannelStock.EffDate = EffDate?.ToString("yyyy-MM-dd");
//updateChannelStock.ManuNo = boxChannelList.ChannelStocks[i].drugManuNoList[j].ManuNo;
r = _connection.Update(updateChannelStock);
}
//totalQuantity += _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId) && p.DrugId == boxChannelList.ChannelStocks[i].DrugId).Sum(p => p.BaseQuantity);
totalQuantity += boxChannelList.ChannelStocks[i].drugManuNoList[j].Quantity;
if (!(mid > 0 && (updateChannelStock == null || r > 0)))
{
flag = false;
break;
}
totalQuantity += _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId) && p.DrugId == boxChannelList.ChannelStocks[i].DrugId).Sum(p => p.BaseQuantity);
if (!(mid > 0 && r > 0 ))
{
flag = false;
break;
}
}
if (flag)
{
boxChannelList.TotalQuantity+= totalQuantity;
boxChannelList.TotalQuantity += totalQuantity;
int updateResult = _connection
.Update(boxChannelList);
if (updateResult > 0)
@ -1195,7 +1386,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
_connection.CommitTransaction();
}
else
{ flag = false;
{
flag = false;
_connection.RollbackTransaction();
}
}
@ -1207,19 +1399,19 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"手术室药待入库明细入库完成操作异常:{ex.Message}");
logger.Info($"手术室药待入库明细入库完成操作异常:{ex.Message}");
return false;
}
}
//手术室药箱获取药箱药品及库存信息
//手术室药盒获取药盒药品及库存信息
public async Task<PageData<PlanDetails>> GetBoxDrugInfo(int DrawerNo, int? take, int? skip)
{
var query = _connection.PlanDetails.AsQueryable()
.InnerJoin(
_connection.ChannelList.Where(cl => cl.MachineId == _setting.boxMachineId && cl.DrawerNo.Equals(DrawerNo)),
(pd, cl) => pd.PlanId.ToString() == cl.DrugId,
(pd, cl) => pd).Where(pd=>pd.UseState==1);
(pd, cl) => pd).Where(pd => pd.UseState == 1);
@ -1264,7 +1456,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
};
}
//药箱移库时获取选中药箱号的药品信息
//药盒移库时获取选中药盒号的药品信息
public async Task<PageData<ChannelStock>> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip)
{
try
@ -1291,14 +1483,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"药箱移库时获取选中药箱号的药品信息异常:{ex.Message}");
logger.Info($"药盒移库时获取选中药盒号的药品信息异常:{ex.Message}");
return null;
}
}
/// <summary>
/// 药箱交换药品获取所有除本药箱外的所有药箱
/// 药盒交换药品获取所有除本药盒外的所有药盒
/// </summary>
/// <param name="machineId"></param>
/// <returns></returns>
@ -1309,7 +1501,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
return ints;
}
/// <summary>
/// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱
/// 药盒移除药品,获取所有除本药盒外的所有包含该药品的药盒
/// </summary>
/// <param name="machineId"></param>
/// <returns></returns>
@ -1318,7 +1510,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
int[] ints = _connection.ChannelStock.Where(cs => cs.MachineId == channelStock.MachineId && cs.DrugId == channelStock.DrugId && cs.DrawerNo != channelStock.DrawerNo).GroupBy(cs => cs.DrawerNo).Select(cs => cs.Key).ToArray();
return ints;
}
//手术室药交换药品完成
//手术室药交换药品完成
public async Task<bool> BoxReplaceFinish(ChannelStock stock, List<ChannelStock> stockList)
{
try
@ -1327,7 +1519,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
_connection.BeginTransaction();
for (int i = 0; i < stockList.Count; i++)
{
//查询出药的药是否有该批次的药品
//查询出药的药是否有该批次的药品
ChannelStock replace1ChannelStock = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stock.DrawerNo && cs.DrugId == stockList[i].DrugId && cs.ManuNo == stockList[i].ManuNo && cs.EffDate == stockList[i].EffDate)
.FirstOrDefault();
@ -1339,7 +1531,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Update();
if (r <= 0)
{
logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"更新药盒药品数量失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
}
}
else
@ -1355,11 +1547,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
EffDate = stockList[i].EffDate,
Quantity = stockList[i].AddToQuantity,
BaseQuantity = stockList[i].BaseQuantity,
BoxState = 1
//BoxState = 1
});
if (mid <= 0)
{
logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"新增药盒药品记录失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
flag = false;
break;
}
@ -1382,14 +1574,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
});
if (recordId <= 0)
{
logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
flag = false;
break;
}
//更新入药的药中的药品数量
//更新入药的药中的药品数量
ChannelStock replace2ChannelStock = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stockList[i].DrawerNo && cs.DrugId == stock.DrugId && cs.ManuNo == stock.ManuNo && cs.EffDate == stock.EffDate)
.FirstOrDefault();
@ -1401,7 +1593,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Update();
if (r <= 0)
{
logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"更新药盒药品数量失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
flag = false;
break;
}
@ -1419,11 +1611,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
EffDate = stock.EffDate,
Quantity = stockList[i].AddQuantity,
BaseQuantity = stock.BaseQuantity,
BoxState = 1
//BoxState = 1
});
if (mid <= 0)
{
logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"新增药盒药品记录失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
flag = false;
break;
}
@ -1446,27 +1638,27 @@ namespace MasaBlazorApp3.DataAccess.Impl
});
if (record2Id <= 0)
{
logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}");
flag = false;
break;
}
//出库药减数量
//出库药减数量
int updateQuantity = _connection.ChannelStock.Where(cs => cs.Id == stock.Id)
.Set(cs => cs.Quantity, stock.Quantity - stockList[i].AddQuantity)
.Update();
if (updateQuantity <= 0)
{
logger.Info($"更新出库药箱药品减数量失败,药箱号:{stock.DrawerNo}药品ID{stock.DrugId}");
logger.Info($"更新出库药盒药品减数量失败,药盒号:{stock.DrawerNo}药品ID{stock.DrugId}");
flag = false;
break;
}
//入库药减数量
//入库药减数量
int updateQuantity2 = _connection.ChannelStock.Where(cs => cs.Id == stockList[i].Id)
.Set(cs => cs.Quantity, stockList[i].Quantity - stockList[i].AddQuantity)
.Update();
if (updateQuantity2 <= 0)
{
logger.Info($"更新入库药箱药品减数量失败,药箱号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}"); flag = false;
logger.Info($"更新入库药盒药品减数量失败,药盒号:{stockList[i].DrawerNo}药品ID{stockList[i].DrugId}"); flag = false;
break;
}
}
@ -1484,12 +1676,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"手术室药交换药品完成异常:{ex.Message}");
logger.Info($"手术室药交换药品完成异常:{ex.Message}");
_connection.RollbackTransaction();
return false;
}
}
//手术室药移出药品完成
//手术室药移出药品完成
public async Task<bool> BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity)
{
try
@ -1508,7 +1700,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Update();
if (r <= 0)
{
logger.Info($"手术室药箱移出药品更新数量失败,药箱号:{SelectedDrawerNo}药品ID{stock.DrugId}");
logger.Info($"手术室药盒移出药品更新数量失败,药盒号:{SelectedDrawerNo}药品ID{stock.DrugId}");
}
}
else
@ -1526,7 +1718,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Update();
if (mid <= 0)
{
logger.Info($"更新药箱药品批次记录失败,药箱号:{stock.DrawerNo}药品ID{stock.DrugId}");
logger.Info($"更新药盒药品批次记录失败,药盒号:{stock.DrawerNo}药品ID{stock.DrugId}");
flag = false;
}
}
@ -1542,11 +1734,11 @@ namespace MasaBlazorApp3.DataAccess.Impl
EffDate = stock.EffDate,
Quantity = removeQuantity,
BaseQuantity = stock.BaseQuantity,
BoxState = 1
//BoxState = 1
});
if (mid <= 0)
{
logger.Info($"新增药箱药品记录失败,药箱号:{stock.DrawerNo}药品ID{stock.DrugId}");
logger.Info($"新增药盒药品记录失败,药盒号:{stock.DrawerNo}药品ID{stock.DrugId}");
flag = false;
}
}
@ -1559,7 +1751,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Update();
if (updateQuantity2 <= 0)
{
logger.Info($"更新入库药箱药品减数量失败,药箱号:{stock.DrawerNo}药品ID{stock.DrugId}");
logger.Info($"更新入库药盒药品减数量失败,药盒号:{stock.DrawerNo}药品ID{stock.DrugId}");
flag = false;
}
else
@ -1574,7 +1766,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Set(cl => cl.TotalQuantity, channelList.TotalQuantity - removeQuantity)
.Update();
}
//修改移入药的总库存数
//修改移入药的总库存数
ChannelList moveToChannelList = _connection.ChannelList.Where(cl => cl.MachineId == stock.MachineId && cl.DrawerNo == SelectedDrawerNo && cl.DrugId == stock.DrugId).FirstOrDefault();
if (moveToChannelList != null)
{
@ -1599,7 +1791,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
MachineId = stock.MachineId,
DrawerNo = stock.DrawerNo,
ColNo = SelectedDrawerNo,//移入的药
ColNo = SelectedDrawerNo,//移入的药
DrugId = stock.DrugId,
ManuNo = stock.ManuNo,
EffDate = !String.IsNullOrEmpty(stock.EffDate) ? DateTime.ParseExact(stock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
@ -1612,7 +1804,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
});
if (recordId <= 0)
{
logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stock.DrawerNo}药品ID{stock.DrugId}");
logger.Info($"药盒{stock.DrawerNo}交换药品新增操作记录失败,药盒号:{stock.DrawerNo}药品ID{stock.DrugId}");
flag = false;
}
}
@ -1631,11 +1823,63 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
catch (Exception ex)
{
logger.Info($"手术室药移出药品异常{ex.Message}");
logger.Info($"手术室药移出药品异常{ex.Message}");
_connection.RollbackTransaction();
return false;
}
}
public async Task<List<ChannelList>> GetAllBox()
{
var query = _connection.ChannelList.AsQueryable();
return await query
.Where(cl => cl.MachineId == _setting.boxMachineId)
.OrderBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.ColNo)
.ToListAsync();
}
//根据药盒查询药品信息
public async Task<List<ChannelStock>> GetChannelStockByBox(int BoxNum)
{
var query = _connection.ChannelStock.AsQueryable()
.Where(cl=>cl.MachineId==_setting.boxMachineId&&cl.DrawerNo==BoxNum&&cl.Quantity>0);
return await query
//.Where(cl=>cl.Quantity<=0)
.OrderBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.ColNo)
.ToListAsync();
}
//根据套餐下无库存的药箱
public async Task<List<ChannelStock>> GetChannelStockByPlan(string plan)
{
var query = await _connection.ChannelList.AsQueryable().Where(cl=>cl.MachineId==_setting.boxMachineId&&cl.DrugId== plan).Select(c=>c.DrawerNo).ToListAsync();
if(query!=null&& query.Count>0)
{
return await _connection.ChannelStock.Where(c => query.Contains(c.DrawerNo) && c.MachineId == _setting.boxMachineId&&c.Quantity<=0).ToListAsync();
}
return null;
}
//手术室药盒获取绑定数据
public async Task<List<ChannelList>> GetAllChannelList()
{
var query = _connection.ChannelList.AsQueryable()
.Where(cl => cl.MachineId == _setting.boxMachineId);
//.LoadWith(cl=>cl.PlanInfo);
int pagedData = await query.CountAsync();
List<ChannelList> list = await query
.OrderBy((cl) => cl.DrawerNo)
.ToListAsync();
return list;
}
}
}

View File

@ -8,6 +8,7 @@ using MasaBlazorApp3.Pojo.Vo;
using MasaBlazorApp3.Port;
using Microsoft.Extensions.Options;
using Mysqlx.Crud;
using System.Collections.Generic;
using static LinqToDB.Common.Configuration;
namespace MasaBlazorApp3.DataAccess.Impl
@ -20,15 +21,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
private readonly ILog logger = LogManager.GetLogger(typeof(MachineRecordDao));
private readonly PortUtil _portUtil;
private GlobalStateService _globalStateService;
//public UserDao(MyContext context)
//{
// Context = context;
//}
public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil)
public MachineRecordDao(AppDataConnection connection, IOptions<SettingConfig> setting, PortUtil portUtil, GlobalStateService globalStateService)
{
_connection = connection;
_setting = setting.Value;
_portUtil = portUtil;
_globalStateService = globalStateService;
}
public async Task<List<ChannelStock>> GetChannelStockByDrugId(string DrugId, String ManuNo)
@ -230,6 +233,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
_portUtil.SetNumCount(record.DrawerNo, record.ColNo, record.ReturnQuantity);
Thread.Sleep(80);
}
// 获取更新完库存之后的药品库存
List<ChannelStock> list = await _connection.ChannelStock.AsQueryable()
.InnerJoin(
_connection.ChannelList.Where(cl => cl.MachineId.Equals(_setting.machineId)).Where(cl => cl.DrawerType == 1),
(cs, cl) => cs.ListId == cl.Id,
(cs, cl) => cs
)
.Where(cs => cs.DrugId.Equals(record.DrugId))
.ToListAsync();
//账册添加入库记录
int accountID = _connection.InsertWithInt32Identity(new AccountBook()
{
MachineId = _setting.machineId,
DrugId = record.DrugId,
ManuNo = record.ManuNo,
EffDate = !String.IsNullOrEmpty(record.EffDate) ? DateTime.ParseExact(record.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
OperationTime = DateTime.Now,
Type = 31,
AddQuantity = record.ReturnQuantity,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
ManuStock = list.Where(it => it.ManuNo == record.ManuNo).Sum(it => it.Quantity),
TotalStock = list.Sum(it => it.Quantity),
InvoiceId = data.data.First().InvoiceId,
});
}
// 更新 取药记录 设置还药数量、状态

View File

@ -1,4 +1,5 @@
using LinqToDB;
using Google.Protobuf;
using LinqToDB;
using LinqToDB.SqlQuery;
using log4net;
using log4net.Util;
@ -10,10 +11,12 @@ using MasaBlazorApp3.Pojo.Vo;
using MasaBlazorApp3.Port;
using Microsoft.Extensions.Options;
using Mysqlx.Crud;
using Radzen;
using Radzen.Blazor.Rendering;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -28,13 +31,14 @@ namespace MasaBlazorApp3.DataAccess.Impl
private GlobalStateService _globalStateService;
private readonly ILog logger = LogManager.GetLogger(typeof(OrderInfoDao));
private readonly PortUtil _portUtil;
public OrderInfoDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService, PortUtil portUtil)
NotificationService _message;
public OrderInfoDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService, PortUtil portUtil, NotificationService message)
{
_connection = connection;
_setting = setting.Value;
_globalStateService = globalStateService;
_portUtil = portUtil;
_message = message;
}
public async Task<PageData<OrderInfo>> GetAllOrderInfo(string OrderrNo, DateTime OrderDate, int? take, int? skip)
@ -57,7 +61,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
if (OrderDate != null && OrderDate != DateTime.MinValue)
{
query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
}
query = query.Where(oi => oi.Status == 0);
@ -363,7 +367,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
if (OrderDate != null && OrderDate != DateTime.MinValue)
{
query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
}
query = query.Where(oi => oi.Status == 1);
@ -581,7 +585,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
/// <summary>
/// 获取药中的用药信息
/// 获取药中的用药信息
/// </summary>
/// <param name="OrderrNo"></param>
/// <param name="OrderDate"></param>
@ -591,11 +595,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
public async Task<PageData<OrderInfo>> GetAllOrderInfoByBox(int box, string OrderrNo, DateTime OrderDate, int? take, int? skip)
{
var query2 = from od in _connection.OrderDetail
from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.machineId).InnerJoin(c => c.DrugId == od.DrugId)
from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.boxMachineId).InnerJoin(c => c.DrugId == od.DrugId)
group od by od.OrderNo into temp
select new { temp.Key };
var query = from oi in _connection.OrderInfo
from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
where oi.Pharmacy == _setting.storage
select oi;
if (!String.IsNullOrEmpty(OrderrNo))
{
@ -603,7 +608,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
if (OrderDate != null && OrderDate != DateTime.MinValue)
{
query = query.Where(oi => oi.OrderDate.Date.Equals(OrderDate.Date));
query = query.Where(oi => oi.ChargeDate.Date.Equals(OrderDate.Date));
}
query = query.Where(oi => oi.Status == 0);
@ -614,7 +619,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
int pagedData = await query.CountAsync();
List<OrderInfo> list = await query
//.LoadWith(oi => oi.DetailList)
.LoadWith(oi => oi.DetailInfo)
.OrderBy((oi) => oi.RecvDate)
.ThenBy((oi => oi.OrderNo))
.Skip((int)skip)
@ -624,10 +629,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
for (int i = 0; i < list.Count; i++)
{
for (int j = 0; j < list[i].DetailList.Count; j++)
//for (int j = 0; j < list[i].DetailList.Count; j++)
//{
if (list[i].DetailInfo != null && list[i].DetailInfo.Id > 0)
{
list[i].DetailList[j].Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailList[j].DrugId).FirstOrDefaultAsync();
list[i].DetailInfo.Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailInfo.DrugId).FirstOrDefaultAsync();
if (list[i].DetailInfo.Drug != null)
{
list[i].DetailInfo.Drug.Manus = await _connection.DrugManuNo.AsQueryable().Where(m => m.DrugId == list[i].DetailInfo.DrugId).ToListAsync();
}
}
//}
}
}
@ -682,7 +694,71 @@ namespace MasaBlazorApp3.DataAccess.Impl
};
}
/// <summary>
/// 获取所有药箱号
/// 获取待处理处方中的麻醉师
/// </summary>
/// <param name="OrderrNo"></param>
/// <param name="OrderDate"></param>
/// <param name="take"></param>
/// <param name="skip"></param>
/// <returns></returns>
public async Task<PageData<OrderInfo>> GetAllOrderInfo(string Name, string OrderrNo, DateTime? OrderDate, int? take, int? skip)
{
var query2 = from od in _connection.OrderDetail
from cl in _connection.ChannelStock.Where(c => c.MachineId == _setting.boxMachineId).InnerJoin(c => c.DrugId == od.DrugId)
group od by od.OrderNo into temp
select new { temp.Key };
var query = from oi in _connection.OrderInfo
from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
where oi.Pharmacy == _setting.storage
select oi;
if (!string.IsNullOrEmpty(Name))
{
query = query.Where(oi => oi.anaesthetistName == Name);
}
if (!String.IsNullOrEmpty(OrderrNo))
{
query = query.Where(oi => oi.OrderNo.Equals(OrderrNo));
}
if (OrderDate != null && OrderDate != DateTime.MinValue)
{
query = query.Where(oi => oi.ChargeDate.Date.Equals(((DateTime)OrderDate).Date));
}
query = query.Where(oi => oi.Status == 0);
query = query.Where(oi => oi.HisDispFlag == 0);
query = query.Where(oi => oi.CancelFlag == 0);
int pagedData = await query.CountAsync();
List<OrderInfo> list = await query
.LoadWith(oi => oi.DetailInfo)
.OrderBy((oi) => oi.RecvDate)
.ThenBy((oi => oi.OrderNo))
//.Skip((int)skip)
//.Take((int)take)
.ToListAsync();
if (list != null && list.Count > 0)
{
for (int i = 0; i < list.Count; i++)
{
if (list[i].DetailInfo != null && list[i].DetailInfo.Id > 0)
{
list[i].DetailInfo.Drug = await _connection.DrugInfo.AsQueryable().Where(d => d.DrugId == list[i].DetailInfo.DrugId).FirstOrDefaultAsync();
if (list[i].DetailInfo.Drug != null)
{
list[i].DetailInfo.Drug.Manus = await _connection.DrugManuNo.AsQueryable().Where(m => m.DrugId == list[i].DetailInfo.DrugId).ToListAsync();
}
}
}
}
return new PageData<OrderInfo>()
{
TotalDesserts = pagedData,
Desserts = list
};
}
/// <summary>
/// 获取所有药盒号
/// </summary>
/// <param name="machineId"></param>
/// <returns></returns>
@ -707,185 +783,221 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
OrderInfo oi = selectedOrderInfos[i];
//更新处方状态
if (oi.Status == 1)
{
int iUpdate = _connection.OrderInfo.Where(o => o.OrderNo == oi.OrderNo).Set(o => o.Status, 2).Update();
_connection.Insert(new OrderFinish()
{
OrderNo = oi.OrderNo,
PatientId = oi.PatientId,
Pharmacy = oi.Pharmacy,
State = 2,
//WinNo = DrawerNo + 1 + "号手术间",
Operator = _globalStateService.Operator.NickName,
});
}
int drawerNo = DrawerNo;
if (oi.DetailList != null && oi.DetailList.Count > 0)
if (oi.DetailInfo != null && oi.DetailInfo.Id > 0)
{
for (int j = 0; j < oi.DetailList.Count; j++)
//ChannelStock? cs = _connection.ChannelStock.AsQueryable()
// .Where(cs => cs.DrugId == oi.DetailList[j].DrugId
// // && cs.ManuNo == oi.DetailList[j].SetManuNo
// // && cs.EffDate == oi._OrderDetail.SetEffDate
// && cs.MachineId.Equals(_setting.boxMachineId)
// && cs.DrawerNo == drawerNo
// && cs.Quantity >= oi.DetailList[j].Quantity).FirstOrDefault();
List<ChannelStock> cs = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.DrugId == oi.DetailInfo.DrugId
&& cs.ManuNo == oi.DetailInfo.drugManuNo.ManuNo
&& cs.EffDate == ((DateTime)oi.DetailInfo.drugManuNo.EffDate).ToString("yyyy-MM-dd")
&& cs.MachineId.Equals(_setting.boxMachineId)
&& cs.DrawerNo == drawerNo).OrderBy(cs => cs.EffDate).ToList();
if (cs.Count <= 0)
{
ChannelStock cs = _connection.ChannelStock.AsQueryable()
.Where(cs => cs.DrugId == oi.DetailList[j].DrugId
&& cs.ManuNo == oi.DetailList[j].SetManuNo
// && cs.EffDate == oi._OrderDetail.SetEffDate
&& cs.MachineId.Equals(_setting.boxMachineId)
&& cs.DrawerNo == drawerNo
&& cs.Quantity >= oi.DetailList[j].Quantity).First();
if (cs == null)
logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存");
empChannelStock += $"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存 ";
continue;
}
int csQuantity = cs.Sum(cs => cs.Quantity);
if (csQuantity < oi.DetailInfo.Quantity)
{
logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号库存不足,需要核对数{oi.DetailInfo.Quantity},库存总数{csQuantity}");
empChannelStock += $"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号库存不足,需要核对数{oi.DetailInfo.Quantity},库存总数{csQuantity} ";
continue;
}
//更新处方状态
if (oi.Status == 0)
{
int iUpdate = _connection.OrderInfo.Where(o => o.OrderNo == oi.OrderNo).Set(o => o.Status, 2).Update();
_connection.Insert(new OrderFinish()
{
logger.Info($"手麻单{oi.OrderNo}对药品批次{oi.DetailList[j].DrugId}-{oi.DetailList[j].SetManuNo}在{drawerNo}药箱无库存");
continue;
OrderNo = oi.OrderNo,
PatientId = oi.PatientId,
Pharmacy = oi.Pharmacy,
State = 1,
//WinNo = DrawerNo + 1 + "号手术间",
Operator = _globalStateService.Operator.NickName,
});
}
int Break = 0;
for (int k = 0; (k < cs.Count && Break == 0); k++)
{
int oldQuantity = cs[k].Quantity;
int useQuantity = 0; //实际使用数量
if (cs[k].Quantity >= oi.DetailInfo.Quantity)
{
cs[k].Quantity = cs[k].Quantity - oi.DetailInfo.Quantity;
Break = 1;//药品够取跳出循环
useQuantity = oi.DetailInfo.Quantity;
}
else
{
oi.DetailInfo.Quantity = oi.DetailInfo.Quantity - cs[k].Quantity;
useQuantity = cs[k].Quantity;
cs[k].Quantity = 0;
}
cs.Quantity = cs.Quantity - oi.DetailList[j].Quantity;
//cs.NeedNum = cs.NeedNum > 0 ? cs.NeedNum + oi._OrderDetail.Quantity : oi._OrderDetail.Quantity;
logger.Info($"更新手术间{cs.DrawerNo}药品{cs.DrugId}批次{cs.ManuNo}库存为{cs.Quantity},需补药数量为{oi.DetailList[j].Quantity}");
logger.Info($"更新药盒{cs[k].DrawerNo}药品{cs[k].DrugId}批次{cs[k].ManuNo}库存为{oldQuantity},处方用药数量为{oi.DetailInfo.Quantity}");
// 更新数据 库存信息
_connection.Update(cs);
_connection.Update(cs[k]);
//更新ChannelList对应的总库存
ChannelList channelList = _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId.Equals(cs.MachineId) && cl.Id.Equals(cs.ListId) && cl.DrawerNo.Equals(cs.DrawerNo)).FirstOrDefault();
channelList.TotalQuantity = channelList.TotalQuantity - oi.DetailList[j].Quantity;
_connection.Update(channelList);
ChannelList? channelList = _connection.ChannelList.AsQueryable().Where(cl => cl.MachineId.Equals(cs[k].MachineId) && cl.Id.Equals(cs[k].ListId) && cl.DrawerNo.Equals(cs[k].DrawerNo)).FirstOrDefault();
if (channelList != null)
{
channelList.TotalQuantity = channelList.TotalQuantity - useQuantity;// oi.DetailList[j].Quantity;
_connection.Update(channelList);
}
// 获取更新完库存后的药品库存
List<ChannelStock> nowChannels = _connection.ChannelStock.AsQueryable()
.Where(it => it.MachineId.Equals(cs.MachineId) || it.MachineId.Equals(_setting.machineId))
.Where(it => it.DrugId.Equals(cs.DrugId))
.Where(it => it.ManuNo.Equals(cs.ManuNo))
.Where(it => it.MachineId.Equals(cs[k].MachineId) || it.MachineId.Equals(_setting.machineId))
.Where(it => it.DrugId.Equals(cs[k].DrugId))
.Where(it => it.ManuNo.Equals(cs[k].ManuNo))
.Where(it => it.DrawerType == 1)
.ToList();
if (cs != null)
_connection.Insert(new MachineRecord()
{
_connection.Insert(new MachineRecord()
{
MachineId = _setting.machineId,
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 = _globalStateService.Operator?.Id,
Reviewer = _globalStateService.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = oi.DetailList[j].Quantity,
Type = 2,
InvoiceId = oi.OrderNo
//, StockQuantity = nowChannels.Sum(it => it.Quantity)
});
MachineId = _setting.machineId,
DrawerNo = cs[k].DrawerNo,
ColNo = cs[k].ColNo,
DrugId = cs[k].DrugId,
ManuNo = cs[k].ManuNo,
EffDate = !String.IsNullOrEmpty(cs[k].EffDate) ? DateTime.ParseExact(cs[k].EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
Operator = _globalStateService.Operator?.Id,
Reviewer = _globalStateService.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = useQuantity,// oi.DetailList[j].Quantity,
Type = 2,
InvoiceId = oi.OrderNo
//, StockQuantity = nowChannels.Sum(it => it.Quantity)
});
//查询上一条账册中的空瓶数
AccountBookG2 accountBookEmpty = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 1 || ab.Type == 2)
.Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
.Where(ab => ab.ManuNo == cs.ManuNo).OrderByDescending(ab => ab.Id).First();
//保存账册
int iInsertResult = _connection.Insert(new AccountBookG2()
//查询上一条账册中的空瓶数
AccountBookG2? accountBookEmpty = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 1 || ab.Type == 2)
.Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
.Where(ab => ab.ManuNo == cs[k].ManuNo).OrderByDescending(ab => ab.Id).FirstOrDefault();
//保存账册
int iInsertResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailInfo.DrugId,
Type = 2,
Department = oi.DeptName,
OrderNo = oi.OrderNo,
ManuNo = cs[k].ManuNo,
EffDate = cs[k].EffDate,
OutQuantity = useQuantity,// oi.DetailList[j].Quantity,
UserId1 = _globalStateService.Operator?.Id,
UserId2 = _globalStateService.Reviewer?.Id,
MachineId = _setting.machineId,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
InvoiceNo = oi.OrderNo,
ManuStock = nowChannels.Sum(it => it.Quantity),
TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi.DetailInfo.Quantity,
ShoushuJian = drawerNo.ToString()
});
//修改凌晨生成的日结存与总结存数据
AccountBookG2? accountBookG2Day = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 3)
.Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
.Where(ab => ab.ManuNo == cs[k].ManuNo)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
if (accountBookG2Day != null)
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - useQuantity;// oi.DetailList[j].Quantity;
_connection.Update(accountBookG2Day);
}
else
{
//生成日结存时可能没有该库位的绑定信息,需要写入日结存
int iDayResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailList[j].DrugId,
Type = 2,
Department = oi.DeptName,
OrderNo = oi.OrderNo,
ManuNo = cs.ManuNo,
EffDate = cs.EffDate,
OutQuantity = oi.DetailList[j].Quantity,
DrugId = oi.DetailInfo.DrugId,
Type = 3,
ManuNo = cs[k].ManuNo,
EffDate = cs[k].EffDate,
YQuantity = 0,
ManuStock = useQuantity,// oi.DetailList[j].Quantity,
TotalStock = useQuantity,// oi.DetailList[j].Quantity,
UserId1 = _globalStateService.Operator?.Id,
UserId2 = _globalStateService.Reviewer?.Id,
MachineId = _setting.machineId,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
CreateTime = DateTime.Now,
InvoiceNo = oi.OrderNo,
ManuStock = nowChannels.Sum(it => it.Quantity),
TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 ? accountBookEmpty.TotalStock : 0) : 0) + oi.DetailList[j].Quantity,
ShoushuJian = drawerNo.ToString()
InvoiceNo = "日结存"
});
//修改凌晨生成的日结存与总结存数据
AccountBookG2 accountBookG2Day = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 3)
.Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
.Where(ab => ab.ManuNo == cs.ManuNo)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
if (accountBookG2Day != null)
if (iDayResult <= 0)
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - oi.DetailList[j].Quantity;
_connection.Update(accountBookG2Day);
logger.Info($"未写入日结存数据{oi.DetailInfo.DrugId}-{cs[k].ManuNo}-{cs[k].EffDate}-{useQuantity}");
empChannelStock += $"未写入日结存数据{oi.DetailInfo.DrugId}-{cs[k].ManuNo}-{cs[k].EffDate}-{useQuantity} ";
}
}
//修改凌晨生成的日结存与总结存数据
AccountBookG2? accountBookG2Total = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 4)
.Where(ab => ab.DrugId == oi.DetailInfo.DrugId)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
if (accountBookG2Total != null)
{
accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - useQuantity;// oi.DetailList[j].Quantity;
_connection.Update(accountBookG2Total);
}
else
{
//生成总结存时可能没有该库位的绑定信息,需要写入总结存
int iTotalResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailInfo.DrugId,
Type = 4,
YQuantity = 0,
ManuStock = useQuantity,//oi.DetailList[j].Quantity,
TotalStock = useQuantity,// oi.DetailList[j].Quantity,
UserId1 = _globalStateService.Operator?.Id,
UserId2 = _globalStateService.Reviewer?.Id,
MachineId = _setting.machineId,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
InvoiceNo = "总结存"
});
if (iTotalResult <= 0)
{
logger.Info($"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity}");
empChannelStock += $"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity} ";
}
else
{
//生成日结存时可能没有该库位的绑定信息,需要写入日结存
int iDayResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailList[j].DrugId,
Type = 3,
ManuNo = cs.ManuNo,
EffDate = cs.EffDate,
YQuantity = 0,
ManuStock = oi.DetailList[j].Quantity,
TotalStock = oi.DetailList[j].Quantity,
UserId1 = _globalStateService.Operator?.Id,
UserId2 = _globalStateService.Reviewer?.Id,
MachineId = _setting.machineId,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
InvoiceNo = "日结存"
});
if (iDayResult <= 0)
{
logger.Info($"未写入日结存数据{oi.DetailList[j].DrugId}-{cs.ManuNo}-{cs.EffDate}-{cs.Quantity}");
}
}
//修改凌晨生成的日结存与总结存数据
AccountBookG2 accountBookG2Total = _connection.AccountBookG2.AsQueryable()
.Where(ab => ab.MachineId.Equals(_setting.machineId))
.Where(ab => ab.Type == 4)
.Where(ab => ab.DrugId == oi.DetailList[j].DrugId)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
if (accountBookG2Total != null)
{
accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - oi.DetailList[j].Quantity;
_connection.Update(accountBookG2Total);
}
else
{
//生成总结存时可能没有该库位的绑定信息,需要写入总结存
int iTotalResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailList[j].DrugId,
Type = 4,
YQuantity = 0,
ManuStock = oi.DetailList[j].Quantity,
TotalStock = oi.DetailList[j].Quantity,
UserId1 = _globalStateService.Operator?.Id,
UserId2 = _globalStateService.Reviewer?.Id,
MachineId = _setting.machineId,
CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
InvoiceNo = "总结存"
});
if (iTotalResult <= 0)
{
logger.Info($"未写入总结存数据{oi.DetailList[j].DrugId}-{oi.DetailList[j].Quantity}");
}
}
}
}
}
}
return true;
logger.Info($"管理员{_globalStateService.Operator.NickName}结束确认手麻单");
if(!string.IsNullOrEmpty(empChannelStock))
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"有未核对处方:{empChannelStock}", Duration = 4000 }
);
}
if (bFlag)
{
_connection.CommitTransaction();
return true;
}
else
{
_connection.RollbackTransaction();
logger.Info($"管理员{_globalStateService.Operator.NickName}确认手麻单失败");
return false;
}
}
catch (Exception ex)
{

View File

@ -1,10 +1,13 @@
using LinqToDB;
using Google.Protobuf;
using LinqToDB;
using log4net;
using MasaBlazorApp3.DataAccess.Dao;
using MasaBlazorApp3.Pojo;
using MasaBlazorApp3.Pojo.Config;
using MasaBlazorApp3.Pojo.Vo;
using Microsoft.Extensions.Options;
using Org.BouncyCastle.Crypto;
using Radzen;
using System;
using System.Collections.Generic;
using System.Data.Common;
@ -25,11 +28,13 @@ namespace MasaBlazorApp3.DataAccess.Impl
private readonly SettingConfig _setting;
private readonly ILog logger = LogManager.GetLogger(typeof(DrugInfoDao));
private GlobalStateService _globalStateService;
public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService)
private NotificationService _message;
public PlanDao(AppDataConnection connection, IOptions<SettingConfig> setting, GlobalStateService globalStateService,NotificationService message)
{
_connection = connection;
_setting = setting.Value;
_globalStateService = globalStateService;
_message = message;
}
/// <summary>
/// 获取所有套餐数据
@ -39,7 +44,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
var query = _connection.Plan.AsQueryable();
List<Plan> list = await query.Where(p => p.UseState == 1)
List<Plan> list = await query.Where(p => p.UseState == 1 && p.MachineId==_setting.boxMachineId)
.LoadWith(p => p._PlanDetails.Where(pd => pd.UseState == 1))
//.ThenLoad(p=>p._DrugInfo)
.OrderBy(r => r.Id)
@ -79,7 +84,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
/// <returns></returns>
public async Task<Plan> GetPlanById(int Id)
{
var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1);
var query = _connection.Plan.AsQueryable().Where(p => p.Id == Id && p.UseState == 1 && p.MachineId == _setting.boxMachineId);
List<Plan> list = await query
.LoadWith(p => p._PlanDetails)
//.ThenLoad(p=>p._DrugInfo)
@ -114,7 +119,27 @@ namespace MasaBlazorApp3.DataAccess.Impl
plan.OperatorUser = _globalStateService.Operator.Id;
plan.ReviewerUser = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id;
plan.UseState = 1;
return _connection.InsertWithInt32Identity(plan) > 0;
plan.MachineId = _setting.boxMachineId;
if(_connection.InsertWithInt32Identity(plan) > 0)
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.boxMachineId,
OperationTime = DateTime.Now,
Type = 50,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"新增套餐{plan.Name}",
});
return true;
}
else
{
return false;
}
}
catch (Exception ex)
{
@ -134,7 +159,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
try
{
var iResult = _connection.Plan
.Where(p => p.Id == plan.Id)
.Where(p => p.Id == plan.Id && p.MachineId == _setting.boxMachineId)
.Set(p => p.Name, plan.Name)
.Set(p => p.Description, plan.Description);
return iResult.Update() > 0;
@ -151,7 +176,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
try
{
//查询是否有绑定,没有绑定可以删除,有绑定则不允许删除
List<string> channelListsId =await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planId.ToString() && cl.MachineId == _setting.boxMachineId).Select(cl => cl.Id).ToListAsync();
List<string> channelListsId = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planId.ToString() && cl.MachineId == _setting.boxMachineId).Select(cl => cl.Id).ToListAsync();
if (channelListsId != null && channelListsId.Count > 0)
{
bool searchResult = _connection.ChannelStock.AsQueryable().Where(cs => channelListsId.Contains(cs.ListId)).Any(cs => cs.Quantity > 0);
@ -187,6 +212,20 @@ namespace MasaBlazorApp3.DataAccess.Impl
try
{
_connection.BeginTransaction();
//如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
List<string> listIds = await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
int iDelResult = 1;
int iDelChannelListResult = 1;
if (listIds != null && listIds.Count > 0)
{
//删除channelStock表中的绑定药品
iDelResult = _connection.ChannelStock.Where(cs => listIds.Contains(cs.ListId)).Delete();
_connection.ChannelList.Where(cl => listIds.Contains(cl.Id)).Set(cl => cl.DrugId, "").Update();
}
bool flag = false;
logger.Error($"删除套餐{planId}");
//查询该套餐下是否有药品,如果有则一并删除
@ -194,25 +233,25 @@ namespace MasaBlazorApp3.DataAccess.Impl
int pdResult = 1;
if (iHasPd > 0)
{
pdResult =await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
pdResult = await _connection.PlanDetails.Where(pd => pd.PlanId == planId).Set(pd => pd.UseState, 0).UpdateAsync();
}
int pResult = await _connection.Plan.Where(p => p.Id == planId).Set(pd => pd.UseState, 0).UpdateAsync();
//如果套餐下有绑药且库存为0的也将绑定药品信息一并删除
List<string> listIds =await _connection.ChannelList.Where(cl => cl.DrugId == planId.ToString()).Select(cl => cl.Id).ToListAsync();
int iDelResult = 1;
int iDelChannelListResult = 1;
if (listIds != null && listIds.Count > 0)
{
//删除channelStock表中的绑定药品
iDelResult = _connection.ChannelStock.Where(cs => listIds.Contains(cs.ListId)).Delete();
_connection.ChannelList.Where(cl => listIds.Contains(cl.Id)).Set(cl=>cl.DrugId,"").Update();
}
if (pdResult > 0 && pResult > 0 && iDelResult > 0 && iDelChannelListResult > 0)
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.boxMachineId,
OperationTime = DateTime.Now,
Type = 51,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"删除套餐{planId}",
});
flag = true;
}
@ -246,8 +285,18 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
if (!string.IsNullOrEmpty(details.DrugId))
{
int id =await _connection.InsertWithInt32IdentityAsync(details);
int id = await _connection.InsertWithInt32IdentityAsync(details);
details.Id = id;
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.boxMachineId,
OperationTime = DateTime.Now,
Type = 52,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"套餐{details.PlanId}添加药品{details.DrugId},基数{details.BaseQuantity}",
});
return id > 0;
}
else
@ -274,6 +323,17 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Where(p => p.Id == details.Id)
.Set(p => p.DrugId, details._DrugInfo.DrugId)
.Set(p => p.BaseQuantity, details.BaseQuantity);
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
MachineId = _setting.boxMachineId,
OperationTime = DateTime.Now,
Type = 53,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"修改套餐{details.PlanId},药品{details.DrugId}-{details._DrugInfo.DrugId},基数{details.BaseQuantity}",
});
return await iResult.UpdateAsync() > 0;
}
catch (Exception ex)
@ -289,7 +349,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
try
{
bool bFlag = true;
List<string> idList =await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planDetail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
List<string> idList = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == planDetail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
if (idList != null && idList.Count > 0)
{
bFlag = !(_connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == planDetail.DrugId).Any(cs => cs.Quantity > 0));
@ -319,26 +379,37 @@ namespace MasaBlazorApp3.DataAccess.Impl
List<string> idList = await _connection.ChannelList.AsQueryable().Where(cl => cl.DrugId == detail.PlanId.ToString()).Select(cl => cl.Id).ToListAsync();
if (idList != null && idList.Count > 0)
{
iDelResult= await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
iDelResult = await _connection.ChannelStock.AsQueryable().Where(cs => idList.Contains(cs.ListId) && cs.DrugId == detail.DrugId).DeleteAsync();
}
if (iDelResult > 0)
{
bool bUpdateResult= _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
if(bUpdateResult)
//if (iDelResult > 0)
//{
bool bUpdateResult = _connection.PlanDetails.Where(p => p.Id == detail.Id).Set(p => p.UseState, 0).Update() > 0;
if (bUpdateResult)
{
//保存操作记录
int mid = _connection.InsertWithInt32Identity(new MachineRecord()
{
_connection.CommitTransaction();
return true;
}
else
{
_connection.RollbackTransaction();
return false;
}
MachineId = _setting.boxMachineId,
OperationTime = DateTime.Now,
Type = 54,
Operator = _globalStateService.Operator.Id,
Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id,
InvoiceId = $"删除套餐{detail.PlanId},中的药品{detail._DrugInfo.DrugName}ID:{detail.DrugId}",
});
_connection.CommitTransaction();
return true;
}
else
{
_connection.RollbackTransaction();
return false;
}
//}
//else
//{
// logger.Error($"套餐中的药品{detail._DrugInfo.DrugName}无绑定");
// return false;
//}
}
catch (Exception ex)
{

View File

@ -38,7 +38,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
WHERE cl.`machine_id` = '{_setting.machineId}' AND cl.`drawer_type` = 1 ";
if (!string.IsNullOrEmpty(drugName))
{
SQL += " and di.drug_name = '{drugName}'";
SQL += $" and (di.drug_name like '%{drugName}%'|| di.py_code like '%{drugName}%'||di.drug_id like '%{drugName}%')";
}
SQL += " ORDER BY cl.`drug_id`";
// 加载模板文件
@ -49,12 +49,12 @@ namespace MasaBlazorApp3.DataAccess.Impl
{
foreach (var report in reportList)
{
reportStockList.Add(report);
reportStockList.Add(report);
}
pagedData = await reportList.CountAsync();
}
return new PageData<ReportStockDateInfo>()
return new PageData<ReportStockDateInfo>()
{
TotalDesserts = pagedData,
@ -67,32 +67,31 @@ namespace MasaBlazorApp3.DataAccess.Impl
return null;
}
}
//中部战区总医院麻醉药品、第一类精神药品进出专用账册
public async Task<PageData<ReportAccountDateInfo>> GetAccountExportData(DateTime? startDate, DateTime? endDate, string drugName)
{
List<ReportAccountDateInfo> accountList = new List<ReportAccountDateInfo>();
int pagedData = 0;
DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
string SQL = $@"SELECT mr.`stock_quantity` AS `stockQuantity`, IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0))
AS `inQuantity`, IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
mr.`operation_time` AS `operationTime`, mr.`invoice_id` AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
di.`drug_spec` AS `drugSpec`, di.`big_unit` AS `BigUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`,
mr.`manu_no` AS `manuNo`, mr.`eff_date` AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName` FROM
dm_machine_record mr LEFT JOIN drug_info di ON mr.`drug_id` = di.`drug_id` LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`
LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id` WHERE mr.`machine_id` = '{_setting.machineId}' AND mr.`operation_time` > '{p_startDate}'
AND mr.`operation_time` < '{p_endDate}'";
string SQL = $@"SELECT ab.`create_time` AS `OperationTime`,ab.manu_no AS ManuNo,ab.eff_date as EffDate, ab.add_quantity AS `inQuantity`,
ab.out_quantity AS `outQuantity`,ab.manu_quantity as ManuQuantity,ab.total_quantity as StockQuantity,
u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName`, ab.`drug_id` AS `drugId`,di.`drug_name` AS `drugName`,di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `BigUnit`, di.`dosage` AS `dosage`,
di.`manufactory` AS `manufactory`, ab.`invoice_id` AS `invoiceId`, ab.department as department,'' as Remarks FROM
account_book ab LEFT JOIN drug_info di ON ab.`drug_id` = di.`drug_id` LEFT JOIN user_list u1 ON ab.`operator` = u1.`id`
LEFT JOIN user_list u2 ON ab.`reviewer` = u2.`id` WHERE ab.`machine_id` = '{_setting.machineId}' AND ab.type in(1,2,31) DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') > '{p_startDate}'
AND DATE_FORMAT(ab.`create_time`,'%Y-%m-%d') < '{p_endDate}'";
if (!string.IsNullOrEmpty(drugName))
{
SQL += " AND di.drug_name= '{drugName}'";
SQL += $" AND (di.drug_name like '%{drugName}%' or di.drug_id like '%{drugName}%' or di.py_code like '%{drugName}%')";
}
SQL += " ORDER BY mr.`drug_id`, mr.`operation_time`, mr.`id`";
SQL += " ORDER BY ab.`create_time`, ab.`drug_id`";
var reportList = _connection.FromSql<ReportAccountDateInfo>(SQL);
if (reportList != null)
{
foreach (var report in reportList)
{
accountList.Add(report);
accountList.Add(report);
}
pagedData = await reportList.CountAsync();
@ -104,5 +103,67 @@ namespace MasaBlazorApp3.DataAccess.Impl
Desserts = accountList
};
}
//手术室患者麻醉药品使用登记本
public async Task<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime? searchDate)
{
List<ReportUsageDateInfo> accountList = new List<ReportUsageDateInfo>();
int pagedData = 0;
string SQL = $@"SELECT oi.Order_date as portdate, od.drug_id as DrugId,1 as ShouShuJian,'' as ZhuMa,'' as FuMa,oi.patient_id as IDNumber,oi.p_name as PName,oi.disease as Diagnose,
CONCAT(di.drug_name,' ',di.drug_spec) as DrugName,od.set_manu_No as ManuNo,od.use_dosage as UsageDosage,'' as CanYeLiang,'' as CanYeChuZhi,'' as UseUserName,'' as CheckUserName
from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id
WHERE DATE_FORMAT(oi.Order_date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1";
var reportList = _connection.FromSql<ReportUsageDateInfo>(SQL);
if (reportList != null)
{
foreach (var report in reportList)
{
accountList.Add(report);
}
pagedData = await reportList.CountAsync();
}
return new PageData<ReportUsageDateInfo>()
{
TotalDesserts = pagedData,
Desserts = accountList
};
}
//麻醉科毒麻药品请领登记表
public async Task<PageData<ReportApplyInfo>> GetApplyInfoDate(DateTime searchDate)
{
List<ReportApplyInfo> accountList = new List<ReportApplyInfo>();
int pagedData = 0;
string SQL = $@"SELECT Drawerno as BoxNum,Create_date AS applyinfo,userfirst,usersecond,drugid,doctor,manager
from applyinfo ap inner join drug_info di on ap.drugid=di.drug_id
WHERE machine_id='{_setting.boxMachineId}' and DATE_FORMAT(ap.Create_date,'%Y-%m-%d')='{searchDate.ToString("yyyy-MM-dd")}' ";
var reportList = _connection.FromSql<ReportApplyInfo>(SQL);
if (reportList != null&& reportList.Count()>0)
{
foreach (var report in reportList)
{
accountList.Add(report);
}
pagedData = await reportList.CountAsync();
}
return new PageData<ReportApplyInfo>()
{
TotalDesserts = pagedData,
Desserts = accountList
};
}
}
}

View File

@ -26,7 +26,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
}
public async Task<List<SettingManu>> GetMenuItemsAsync()
{
var query = _connection.SettingManu.AsQueryable();
var query = _connection.SettingManu.Where(s=>s.UseStatus==1).AsQueryable();
return await query

View File

@ -144,7 +144,39 @@ namespace MasaBlazorApp3.DataAccess.Impl
.Where(cs => cs.Id == changeShift.Id)
.Set(cs => cs.State, "1")
.Set(cs => cs.ToDate, DateTime.Now)
.Set(cs=>cs.ToOperator,changeShift.ToOperator).Update();
.Set(cs => cs.ToOperator, changeShift.ToOperator).Update();
//插入交接班时药品数据信息
var channelStockList = _connection.ChannelStock
.Where(cs => (cs.MachineId == _setting.machineId || cs.MachineId == _setting.boxMachineId) && cs.DrawerType == 1)
.GroupBy(cs => cs.DrugId)
.Select(g => new
{
drugId = g.Key,
sumQuantity = g.Sum(cs => cs.Quantity)
}).ToList();
if (channelStockList != null && channelStockList.Count > 0)
{
//将药品库存信息写入交接明细表
for (int i = 0; i < channelStockList.Count; i++)
{
//查询药品上次交接的明细,用于记录处方数
HkcChangeShiftsDetail? historyList = _connection.HkcChangeShiftsDetail
.Where(d => d.DrugId == channelStockList[i].drugId && d.ChangeshiftsId == changeShift.Id).FirstOrDefault();
HkcChangeShiftsDetail detail = new HkcChangeShiftsDetail()
{
ChangeshiftsId = insertResult,
DrugId = channelStockList[i].drugId,
RealNumber = channelStockList[i].sumQuantity,
OrderNumber = historyList != null ? historyList.OrderNumber + historyList.RealNumber - channelStockList[i].sumQuantity : 0
};
var insertDetailResult = _connection.InsertWithInt32Identity(detail);
}
}
if (insertResult <= 0 || updateResult <= 0)
{
_connection.RollbackTransaction();

View File

@ -93,5 +93,8 @@
<None Update="ReportTemp\stock_template.grf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="ReportTemp\Usage_Temp.grf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -70,9 +70,9 @@
</RadzenDataGrid>
</Template>
<Columns>
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药号" Property="DrawerNo">
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药号" Property="DrawerNo">
<Template Context="DrawerNo">
@DrawerNo.DrawerNo 号药
@DrawerNo.DrawerNo 号药
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
@ -124,7 +124,7 @@
async void OnRowSelect(ChannelList cl)
{
var b = await dialogService.OpenAsync<BoxAddBoxDetailDialog>(
$"{cl.DrawerNo}号药药品入库",
$"{cl.DrawerNo}号药药品入库",
new Dictionary<string, object>() { { "boxChannelList", cl } },
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
);

View File

@ -8,13 +8,39 @@
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" Style="height: 100%;">
<RadzenStack>
<RadzenDataGrid Data="@boxChannelList.ChannelStocks" AllowAlternatingRows="true"
<RadzenDataGrid Data="@channelStockList" AllowAlternatingRows="true" LoadData="@LoadData"
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Columns>
<RadzenDataGridColumn Property="ChannelStocks.Drug.DrugName" Title="药品" />
<RadzenDataGridColumn Property="ChannelStocks.Drug.DrugSpec" Title="规格" />
<RadzenDataGridColumn Property="AddToQuantity" Title="入药箱数量" />
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
<RadzenDataGridColumn Property="Quantity" Title="库存" />
<RadzenDataGridColumn Title="药品批次">
<Template Context="channelStockList">
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
{
DrugManuNo manu = channelStockList.drugManuNoList[i];
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.ManuNo</RadzenText>
}
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="效期">
<Template Context="channelStockList">
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
{
DrugManuNo manu = channelStockList.drugManuNoList[i];
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.EffDate?.ToString("yyyy-MM-dd")</RadzenText>
}
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="入药盒数量">
<Template Context="channelStockList">
@for (int i = 0; i < channelStockList.drugManuNoList.Count; i++)
{
DrugManuNo manu = channelStockList.drugManuNoList[i];
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@manu.Quantity</RadzenText>
}
</Template>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
</RadzenStack>
@ -38,6 +64,8 @@
int count;
[Parameter] public ChannelList boxChannelList { get; set; }
List<ChannelStock> channelStockList = new List<ChannelStock>();
public List<BoxTakeVo> data { get; set; }
//称重取药数量
int[] WeightFinnalQuantity { get; set; } = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@ -47,6 +75,7 @@
protected override async Task OnInitializedAsync()
{
channelStockList = await channelListDao.GetBoxAddToBox(boxChannelList);
base.OnInitializedAsync();
}
async Task LoadData(LoadDataArgs args)
@ -256,7 +285,7 @@
if (!b)
{
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
logger.Error($"手术室药取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
logger.Error($"手术室药取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
// 关闭弹窗
dialogService.Close(false);
}

View File

@ -192,7 +192,11 @@
}
});
orderTakeVo.Status = 2;
PortUtil.AllLightOff();
if (data.Any(it => it.ChannelStock.BoardType == 2))
{
//有单支抽屉则广播灭灯
PortUtil.AllLightOff();
}
if (options._data == drawerNos.Count - 1)
{
PortUtil.speechSynthesizer.SpeakAsyncCancelAll();
@ -311,7 +315,7 @@
if (!b)
{
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
logger.Error($"手术室药取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
logger.Error($"手术室药取药保存数据库失败,数据{JsonConvert.SerializeObject(data)}");
// 关闭弹窗
dialogService.Close(false);
}

View File

@ -1,52 +1,90 @@
@page "/Box/BoxAdd"
@using MasaBlazorApp3.Report
@using Radzen.Blazor.Rendering
<style>
@@keyframes shake {
0% {
opacity: 1;
color: red;
}
0% {
opacity: 1;
color: red;
}
25% {
opacity: 1;
color: orange;
}
25% {
opacity: 1;
color: orange;
}
50% {
opacity: 0;
color: yellow;
}
50% {
opacity: 0;
color: yellow;
}
75% {
opacity: 1;
color: crimson;
}
75% {
opacity: 1;
color: crimson;
}
100% {
opacity: 1;
color: red;
}
100% {
opacity: 1;
color: red;
}
}
.rz-custom-header {
width: 100%;
width: 100%;
}
.shaky-text {
animation: shake 2s infinite ease-in-out;
/* 你可以根据需要调整动画的持续时间和迭代次数 */
transition: color 0.5s linear,opacity 0.5s linear;
animation: shake 2s infinite ease-in-out;
/* 你可以根据需要调整动画的持续时间和迭代次数 */
transition: color 0.5s linear,opacity 0.5s linear;
}
.my-popup {
display: none;
position:absolute;
overflow: hidden;
/* height: 360px;
width: 600px; */
border: var(--rz-panel-border);
background-color: var(--rz-panel-background-color);
box-shadow: var(--rz-panel-shadow);
border-radius: var(--rz-border-radius);
}
</style>
<div class="container-fluid">
<RadzenFieldset Text="报表导出">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton @ref=button Icon="download" Text="请领登记表导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
<Popup @ref=popup Lazy=true class="my-popup">
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
<RadzenFieldset Text="条件选择">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="查询时间" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
</RadzenStack>
</Popup>
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
<RadzenDataGrid @ref="grid" RowSelect="@OnRowSelect" TItem="ChannelList"
RowRender="@RowRender"
EmptyText="无数据"
Data="@_forecasts" @bind-Value=@selectedChannelLists
AllowColumnResize="true" AllowAlternatingRows="false"
SelectionMode="DataGridSelectionMode.Single"
RowRender="@RowRender"
EmptyText="无数据"
Data="@_forecasts" @bind-Value=@selectedChannelLists
AllowColumnResize="true" AllowAlternatingRows="false"
SelectionMode="DataGridSelectionMode.Single"
ExpandMode="DataGridExpandMode.Multiple" LoadData="@LoadData" IsLoading="@isLoading" Count="@count"
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Template Context="cs">
@ -58,7 +96,7 @@
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="厂家" Property="Drug.Manufactory">
</RadzenDataGridColumn>
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
@* <RadzenDataGridColumn Title="批次" Property="ManuNo"></RadzenDataGridColumn>
<RadzenDataGridColumn Title="效期" Property="EffDate">
</RadzenDataGridColumn> *@
<RadzenDataGridColumn Title="基数" Property="BaseQuantity">
@ -69,9 +107,9 @@
</RadzenDataGrid>
</Template>
<Columns>
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药号" Property="DrawerNo">
<RadzenDataGridColumn Frozen="true" Width="200px" Title="药号" Property="DrawerNo">
<Template Context="DrawerNo">
@DrawerNo.DrawerNo 号药
@DrawerNo.DrawerNo 号药
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="总库存" Property="TotalQuantity"></RadzenDataGridColumn>
@ -82,19 +120,21 @@
@code {
@inject IChannelListDao channelStockDao;
@inject DialogService dialogService;
@inject IReportDataDao reportDataDao;
RadzenDataGrid<ChannelList> grid;
bool isLoading;
int count;
private IEnumerable<ChannelList>? _forecasts;
DateTime start;
DateTime end;
RadzenButton button;
Popup popup;
IList<ChannelList> selectedChannelLists;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
}
async Task LoadData(LoadDataArgs args)
{
@ -123,7 +163,7 @@
async void OnRowSelect(ChannelList cl)
{
var b = await dialogService.OpenAsync<BoxAddDetailDialog>(
$"{cl.DrawerNo}号药箱取药",
$"{cl.DrawerNo}号药盒加药",
new Dictionary<string, object>() { { "boxChannelList", cl } },
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
);
@ -134,14 +174,14 @@
}
async void StockExport()
//请领登记表导出
async Task AccountBookExport()
{
}
async void AccountBookExport()
{
// string drugId = drugName != null ? drugName.Split('/').Last().Trim():"";
// GridReportUtil gridReportUtil = new GridReportUtil();
PageData<ReportApplyInfo> pageData = await reportDataDao.GetApplyInfoDate(start);
GridReportUtil.PrintReport("account_book_temp.grf", pageData);
}

View File

@ -1,4 +1,4 @@
@page "/Box/BoxBindings"
@page "/Box/BoxBindings123"
<div class="container-fluid">
@ -12,7 +12,7 @@
<RadzenRow>
<RadzenColumn Size="8" Class="rz-text-truncate">
<b class="rz-pr-3">@(channel.DrawerNo)</b>
<b>号手术间</b>
<b>号药盒</b>
</RadzenColumn>
<RadzenColumn Size="4" Class="rz-text-align-end">
@ -105,7 +105,7 @@
async Task EditChannel(ChannelList list)
{
if (list.PlanInfo.Id > 0)
if (list.PlanInfo.Id > 0)
{
// 说明之前有绑定并且未改变,那么就是在进行解绑
if (list.DrugId != null && list.DrugId.Equals(list.PlanInfo.Id.ToString()))

View File

@ -0,0 +1,204 @@
@page "/Box/BoxBindings"
<div class="container-fluid">
<div class="row">
<RadzenFieldset class="col-12 mb-4 justify-content-around align-items-center" style="overflow:auto" Text="选择药盒">
<div class="col-12 row justify-content-center align-items-center text-center">
<div class="row justify-content-around align-items-center" style="overflow:auto">
@if (BoxList != null)
{
foreach (var item in BoxList)
{
<div class="col-2">
<RadzenCheckBox Style="width:40px;height:40px;margin:2px" TValue="bool" Disabled=@item.BoxDisabled @bind-Value=@item.IsChecked Name="@($"CheckBox_{item.DrawerNo}")" Change="@((bool isChecked) => OnCheckBoxChange(isChecked, item.DrawerNo))" />
<RadzenLabel Text=@item.DrawerNo.ToString() Component="@($"CheckBox_{item.DrawerNo}")" />
</div>
}
}
</div>
</div>
</RadzenFieldset>
<RadzenCard class="col-12 mb-4">
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Variant="Variant.Outlined" Size="ButtonSize.Small" Click="@EditChannel" Text="绑定/解绑" />
<hr style="border: none; background-color: rgba(0,0,0,.2); height: 1px; margin: 1rem 0;" />
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Overline" class="rz-display-flex rz-mt-2 rz-my-0">选择套餐</RadzenText>
<RadzenDropDownDataGrid AllowVirtualization="true" Name="planName" TValue="Plan" Data="@plans" Value="@selectedPlan" ValueChanged="@OnPlanSelected"
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
<Columns>
<RadzenDropDownDataGridColumn Property="Name" Title="套餐名称" Sortable="false" />
</Columns>
</RadzenDropDownDataGrid>
</RadzenStack>
</RadzenStack>
</RadzenCard>
</div>
</div>
@code {
@inject IChannelListDao channelListDao;
@inject IDrugInfoDao drugInfoDao;
@inject DialogService dialogService;
@inject NotificationService _message;
@inject IPlanDao planDao;
int count;
private List<ChannelList>? _forecasts;
private List<ChannelList>? BoxList;
List<DrugInfo> drugInfos;
List<DrugManuNo> drugManuNos;
DrugInfo drugInfo;
DrugManuNo drugManuNo;
int firstFlag = 0;
List<Plan> plans;
// 默认选中的项
private Plan selectedPlan = new();
protected override async Task OnInitializedAsync()
{
await LoadData();
await base.OnInitializedAsync();
//drugInfos = await drugInfoDao.GetAllDrug();
}
async Task LoadData()
{
BoxList = await channelListDao.GetAllBox();
var result = await planDao.GetAllPlanInfo();
plans = result.Desserts.Where(p=>p._PlanDetails.Count>0).ToList();
_forecasts = await channelListDao.GetAllChannelList();
firstFlag = 0;
}
// 处理选择变更(可选)
private void OnPlanSelected(Plan plan)
{
selectedPlan = plan;
}
//绑定
async Task EditChannel()
{
List<ChannelList> bindList = BoxList.Where(b => b.IsChecked).ToList();
if (bindList == null || bindList.Count <= 0)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
);
return;
}
if (!string.IsNullOrEmpty(bindList[0].DrugId))
{
//之前有绑定,在进行解绑
foreach (var item in bindList)
{
var b = await channelListDao.UnBindBox(item);
if (b)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"解除绑定成功", Duration = 4000 }
);
}
}
await LoadData();
}
else
{// 否则是进行绑定
if (selectedPlan != null && selectedPlan.Id > 0)
{
foreach (var item in bindList)
{
var b = await channelListDao.BindBox(item, selectedPlan);
if (b)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"绑定成功", Duration = 4000 }
);
}
}
await LoadData();
}
else
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择套餐", Duration = 4000 }
);
}
}
}
private async Task OnCheckBoxChange(bool isChecked, int DrawerNo)
{
//isChecked==true 1)当前选择的药箱已经绑药套餐且库存<=0如果有库存则提示不能选择如果无库存则列出与之绑定相同套餐且库存<=0的药箱号其他药箱号不可选择
// 2)当前选择的药箱未绑定套餐则将所有未绑定套餐的药箱号列出来,其他药箱不可操作
if (firstFlag == 0)
{
if (isChecked)
{
firstFlag = 1;
string drugId = BoxList.Where(b => b.DrawerNo == DrawerNo).Select(b => b.DrugId).FirstOrDefault();
//所选药箱已绑定套餐
if (!string.IsNullOrEmpty(drugId))
{
//查询该药箱下的药品库存是否存在不为0的存在则不让选择
List<ChannelStock> stockList = await channelListDao.GetChannelStockByBox(DrawerNo);
if (stockList != null && stockList.Count > 0)
{
//该药箱下存在库存不为0的药品
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒下的药品仍有库存,请清库存后再操作", Duration = 4000 }
);
BoxList.ForEach(it => it.IsChecked = false);
firstFlag = 0;
return;
}
else
{
//无库存则列出与之绑定相同套餐且库存 <= 0的药箱号其他药箱号不可选择
// BoxList.Where(b => string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
//1)查询套餐下无库存的药箱号
List<ChannelStock>? lists = await channelListDao.GetChannelStockByPlan(drugId);
if (lists != null && lists.Count > 0)
{
int[] boxNum = lists.Select(l => l.DrawerNo).ToArray();
//不在该lists下的药箱号不可选择
BoxList.Where(b => !boxNum.Contains(b.DrawerNo)).ToList().ForEach(b => b.BoxDisabled = true);
}
selectedPlan = await planDao.GetPlanById(Convert.ToInt32(drugId));
}
}
else
{
//未绑定套餐 ,列出所有未绑的药箱号,其他不可操作
BoxList.Where(b => !string.IsNullOrEmpty(b.DrugId)).ToList().ForEach(b => b.BoxDisabled = true);
}
}
}
else
{
if (!isChecked)
{
//isChecked==false 1)是否全部是false是则将所有isChecked==true不是则不做改变
if (!BoxList.Any(b => b.IsChecked == true))
{
BoxList.ForEach(b => b.BoxDisabled = false);
firstFlag = 0;
}
}
}
}
}

View File

@ -24,7 +24,7 @@
<RadzenStack style="align-content:center">
<RadzenStack class="rz-p-4 rz-border-radius-1" Style="border: var(--rz-grid-cell-border);align-content:center" Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入药:</RadzenText>
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">移入药:</RadzenText>
<RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Name="DropDownChangeEvent">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
</RadzenDropDown>
@ -109,14 +109,14 @@
}
if (SelectedDrawerNo<=0)
{
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药", Duration = 4000 });
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = "无可移入的药", Duration = 4000 });
return;
}
var b = await channelListDao.BoxRemoveFinish(channelStock, SelectedDrawerNo,removeQuantity);
if (!b)
{
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
logger.Error($"药移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
logger.Error($"药移出保存数据失败,数据{JsonConvert.SerializeObject(channelStock)}");
}
else
{

View File

@ -19,7 +19,7 @@
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.EffDate)</b></RadzenText>
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">库存:</RadzenText>
<RadzenText TextStyle="TextStyle.Body1" Class="rz-text-truncate"><b>@(channelStock.Quantity)</b></RadzenText>
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">交换药:</RadzenText>
<RadzenText Class="rz-mt-2 rz-my-0" Style="color: var(--rz-text-tertiary-color);">交换药:</RadzenText>
<RadzenDropDown @bind-Value="SelectedDrawerNo" Data="@DrawerNos" Style="display: block;" Change="@(args => SelectedDrawerChange(args))" Name="DropDownChangeEvent">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@(SelectedDrawerNo)</RadzenText>
@ -31,7 +31,7 @@
CellClick="@((DataGridCellMouseEventArgs<ChannelStock> args) => OnCellClick(args))"
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Columns>
<RadzenDataGridColumn Property="DrawerNo" Title="药号">
<RadzenDataGridColumn Property="DrawerNo" Title="药号">
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="Drug.DrugName" Title="药品" />
<RadzenDataGridColumn Property="Drug.DrugSpec" Title="规格" />
@ -134,7 +134,7 @@
if (!b)
{
_message.Notify(new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"数据保存失败", Duration = 4000 });
logger.Error($"药药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
logger.Error($"药药品替换保存数据库失败,数据{JsonConvert.SerializeObject(selectedDrawerData.Where(cl => cl.AddQuantity != 0).ToList())}");
}
else
{

View File

@ -2,132 +2,104 @@
@using MasaBlazorApp3.Pojo.Config
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
<div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
<div class="col-2 row justify-content-center align-items-center text-center" >
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
@foreach (int i in DrawerNos)
{
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
}
</div>
</div>
<div class="col-9 mb-4">
@* <RadzenFieldset Text="">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12">
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="替换药品" />
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="移出药品" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
</RadzenStack>
</RadzenFieldset> *@
@* <RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Columns>
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
<HeaderTemplate>
<RadzenCheckBox TabIndex="-1" TriState="false" TValue="bool?" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select all items" } })"
Value="@(selectedOrderInfos == null || selectedOrderInfos?.Any() != true ? false : !orderInfos.All(i => selectedOrderInfos.Contains(i)) ? null : orderInfos.Any(i => selectedOrderInfos.Contains(i)))"
Change="@(args => selectedOrderInfos = args == true ? orderInfos.ToList() : null)" />
</HeaderTemplate>
<Template Context="data">
<RadzenCheckBox TabIndex="-1" TriState="false" Value="@(selectedOrderInfos != null && selectedOrderInfos.Contains(data))" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "Select item" } })"
TValue="bool" Change="@(args => { if (!allowRowSelectOnRowClick) { grid.SelectRow(data); } })" />
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
<RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem" />
<RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem" />
<RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem" />
</Columns>
</RadzenDataGrid> *@
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading"
<div class="col-10">
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading" style="height:600px;overflow:auto"
Data="@_forecasts" PageSize="6" AllowPaging="true" PagerHorizontalAlign="HorizontalAlign.Left"
ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Template Context="pd">
<RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%; overflow: hidden;">
<RadzenCard Variant="Variant.Outlined" class="rz-p-0" Style="width: 100%;">
<RadzenRow Gap="0">
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
<RadzenColumn Size="2">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugName)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="3" class="rz-p-4 product-title">
<RadzenColumn Size="5">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.Manufactory)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4 product-title">
<RadzenColumn Size="3">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd._DrugInfo.DrugSpec)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="1" class="rz-p-4 product-title">
<RadzenColumn Size="1">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.BaseQuantity)</RadzenText>
</RadzenColumn>
@* <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
<RadzenColumn Size="1">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-color-on-secondary-lighter">@(pd.channelStocks.Sum(cs => cs.Quantity))</RadzenText>
</RadzenColumn>
</RadzenRow>
@* <RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
<RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(pd))" />
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
<RadzenButton Text="移出药品" Style="width: 100%" Click="@(()=>removeClick(pd))" />
</RadzenColumn> *@
@if (pd.channelStocks != null && pd.channelStocks.Count > 0)
@if (pd.channelStocks != null && pd.channelStocks.Count > 0)
{
for (int i = 0; i < pd.channelStocks.Count; i++)
{
for (int i = 0; i < pd.channelStocks.Count; i++)
var manuInfo = pd.channelStocks[i];
var manuNo = 1;
if (i == 0)
{
var manuInfo = pd.channelStocks[i];
var manuNo = 1;
if (i == 0)
{
manuNo = 0;
}
<RadzenColumn Size="12" SizeLG="7" class="rz-p-4">
manuNo = 0;
}
<RadzenRow Gap="0">
<RadzenColumn Size="12">
@if (manuInfo != null && manuInfo.ManuNo != null)
{
<RadzenRow Gap="0">
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
<RadzenColumn Size="3">
@if (manuNo == 0)
{
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">批次</RadzenText>
}
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.ManuNo)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
<RadzenColumn Size="3">
@if (manuNo == 0)
{
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">效期</RadzenText>
}
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.EffDate)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
<RadzenColumn Size="1">
@if (manuNo == 0)
{
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">库存</RadzenText>
}
<RadzenText TextStyle="TextStyle.Body2">@(manuInfo.Quantity)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
<RadzenButton Text="替换药品" Style="width: 100%" Click="@(() => replaceClick(manuInfo))" />
<RadzenColumn Size="2">
<RadzenText style="margin-top:5px;"></RadzenText>
<RadzenButton Text="替换药品" Style="margin:1px" Click="@(() => replaceClick(manuInfo))" />
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="2" class="rz-p-4">
<RadzenButton Text="移出药品" Style="width: 100%" Click="@(() => removeClick(manuInfo))" />
<RadzenColumn Size="2">
<RadzenText style="margin-top:5px;"></RadzenText>
<RadzenButton Text="移出药品" Click="@(() => removeClick(manuInfo))" />
</RadzenColumn>
</RadzenRow>
}
else
{
<RadzenRow Gap="0">
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
<RadzenColumn Size="5">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" class="rz-mb-0">未绑定批次</RadzenText>
</RadzenColumn>
</RadzenRow>
}
</RadzenColumn>
}
</RadzenRow>
}
</RadzenRow>
}
</RadzenCard>
</Template>
</RadzenDataList>
@ -196,7 +168,7 @@
if (cs.Quantity > 0)
{
var b = await dialogService.OpenAsync<BoxReplace>(
$"{cs.DrawerNo}号药替换药品详情",
$"{cs.DrawerNo}号药替换药品详情",
new Dictionary<string, object>() { { "channelStock", cs } },
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
);
@ -219,7 +191,7 @@
if (cs.Quantity > 0)
{
var b = await dialogService.OpenAsync<BoxRemoveDialog>(
$"{cs.DrawerNo}号药替换药品详情",
$"{cs.DrawerNo}号药替换药品详情",
new Dictionary<string, object>() { { "channelStock", cs } },
new DialogOptions() { Width = "85vw", Resizable = true, Draggable = true, ShowClose = false }
);

View File

@ -48,7 +48,7 @@
<RadzenColumn Size="12" SizeMD="7">
<RadzenCard Class="rz-shadow-0 rz-border-radius-0 rz-p-12" Style="width:100%;height:100%">
<RadzenText TextStyle="TextStyle.H5" TagName="TagName.H2" class="rz-mb-6">
登录
交接班登录验证
</RadzenText>
<RadzenTemplateForm Data="@loginModel" Submit="@((Pojo.User args) => { Submit(args); })" Style="width:100%;height:100%">
<div class="rz-form-row">
@ -66,10 +66,19 @@
<RadzenRequiredValidator Component="Password" Text="请填写密码" />
</div>
</div>
@if (userI > 2)
{
<div class="rz-form-row">
<label class="rz-label" for="remark">备注</label>
<div class="rz-form-input-wrapper">
<RadzenTextBox id="remark" @bind-Value="@remarks" Style="width:100%" />
</div>
</div>
}
<div class="rz-form-row">
<label class="rz-label"></label>
<div class="rz-form-input-wrapper rz-login-buttons">
<RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录" />
<RadzenButton Style="background:#255dd4;color:white;width:110px" ButtonType="ButtonType.Submit" Text="登录验证" />
<RadzenButton Style="border-color:#255dd4;width:110px" Variant="Variant.Outlined" Text="取消" Click="@Exit" />
</div>
@ -105,7 +114,7 @@
Pojo.User ToReviewer = new Pojo.User();
HkcChangeShifts hkcChange = new HkcChangeShifts();
string remarks = string.Empty;
bool isShow;
private Pojo.User loginModel = new();
@ -207,7 +216,8 @@
optDate = DateTime.Now,
ToDate = DateTime.Now,
State = "0", //状态为1表示交接班完成
MachineId = hkcChange.MachineId
MachineId = hkcChange.MachineId,
Remarks = remarks
};
hkcChange.ToOperator = ToOperator.Username;
bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
@ -247,7 +257,8 @@
FromRviewer = ToReviewer?.Username,
optDate = DateTime.Now,
State = "0", //状态为1表示交接班完成
MachineId = hkcChange.MachineId
MachineId = hkcChange.MachineId,
Remarks = remarks
};
bool bResult = await userDao.UpdateChangeShift(hkcChange, hkcChangeNew);
if (bResult)

View File

@ -12,7 +12,7 @@
<RadzenLabel Text="开始时间" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
@ -20,7 +20,7 @@
<RadzenLabel Text="结束时间" Component="End" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
</RadzenColumn>
</RadzenRow>

View File

@ -1,52 +1,113 @@
@page "/Box/Check"
@using MasaBlazorApp3.Pojo.Config
@using MasaBlazorApp3.Report
@using Radzen.Blazor.Rendering
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
<div class="col-12 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;">
<style>
.my-popup {
display: none;
position: absolute;
overflow: auto;
/* height: 360px; */
width: 900px;
border: var(--rz-panel-border);
background-color: var(--rz-panel-background-color);
box-shadow: var(--rz-panel-shadow);
border-radius: var(--rz-border-radius);
}
</style>
<RadzenStack Orientation="Orientation.Horizontal">
@* <div class="col-4 row justify-content-center align-items-center text-center" style="background: url('/images/box-16.jpg') no-repeat; background-size: 100% 100%; width: 380px; height:650px">
<div class="row justify-content-around align-items-center" style="margin-top: 220px; height: 430px;overflow:auto">
@foreach (int i in DrawerNos)
{
<RadzenButton class="col-5" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
<RadzenButton class="col-5" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
}
</div>
</div>
<div class="col-9 mb-4">
</div> *@
@* <div class="col-2 row justify-content-center align-items-center text-center">
<div class="row justify-content-around align-items-center" style="height:600px;overflow:auto">
@foreach (int i in DrawerNos)
{
<RadzenButton class="col-12" Style="margin-bottom:5px" Click="@(() => SelectDrawer(i))" Text="@i.ToString()" Disabled="@(status > 0)" Shade="Shade.Light" Variant="@(drawerNo != i ? Variant.Outlined : Variant.Flat)" />
}
</div>
</div> *@
<div class="col-12">
<form onsubmit="@(() => grid.Reload())">
<RadzenFieldset Text="查询">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="处方号" Component="OrderNo" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="处方时间" Component="OrderDate" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
</RadzenColumn>
</RadzenRow>
@* <RadzenStack Orientation="Orientation.Horizontal" Gap="1rem"> *@
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="6">
<RadzenLabel Text="麻醉师" Component="NamesList" />
<RadzenDropDownDataGrid AllowVirtualization="true" Name="NamesList" TValue="Anaesthetist" Data="@NamesList" @bind-Value="Name"
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="Name">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12">
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
</RadzenStack>
<Columns>
<RadzenDropDownDataGridColumn Property="Name" Title="麻醉师" Sortable="false" />
</Columns>
</RadzenDropDownDataGrid>
</RadzenColumn>
<RadzenColumn Size="6">
<RadzenLabel Text="处方号" Component="OrderNo" />
<RadzenTextBox @bind-Value="OrderNo" Style="width: 100%;" Name="OrderNo"></RadzenTextBox>
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="6">
<RadzenLabel Text="处方时间" Component="OrderDate" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged" AllowClear @bind-Value="OrderDate" Style="width: 100%;" Name="OrderDate" />
</RadzenColumn>
<RadzenColumn Size="6" Style="margin-top:0.5rem">
<RadzenButton Size="ButtonSize.Medium" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
<RadzenButton Size="ButtonSize.Medium" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
@* </RadzenStack> *@
</RadzenFieldset>
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" Style="margin:0.5rem" />
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" Style="margin:0.5rem">
<RadzenLabel Text="核对药箱" Component="BoxList" Style="margin:0.5rem" />
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum"
AllowFilteringByAllStringColumns="true" TextProperty="BoxName">
<Columns>
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
</Columns>
</RadzenDropDownDataGrid>
<RadzenButton Size="ButtonSize.Medium" Click="Confirm" ButtonType="ButtonType.Button" IsBusy="isLoading" Icon="check_circle" Text="确认" />
<RadzenButton Icon="download" @ref=button Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" />
<Popup @ref=popup Lazy=true class="my-popup">
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
<RadzenFieldset Text="条件选择">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="6">
<RadzenLabel Text="处方时间" Component="PortOrderDate" />
</RadzenColumn>
<RadzenColumn Size="6">
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentPortDateChanged" @bind-Value="PortOrderDate" Style="width: 100%;" Name="PortOrderDate" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
</RadzenStack>
</Popup>
</RadzenStack>
</form>
<RadzenDataGrid @ref="grid" AllowRowSelectOnRowClick="@allowRowSelectOnRowClick" AllowFiltering="true" LoadData="@LoadData"
FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
Data="@orderInfos" ColumnWidth="200px" IsLoading="@isLoading" Count="@count" EmptyText="无数据"
SelectionMode="DataGridSelectionMode.Multiple" @bind-Value=@selectedOrderInfos
CellClick="@((DataGridCellMouseEventArgs<OrderInfo> args) => OnCellClick(args))"
AllowPaging="true" PageSize="10" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} 共{2}条数据">
<Columns>
<RadzenDataGridColumn Sortable="false" Filterable="false" Width="4rem">
@ -63,16 +124,16 @@
<RadzenDataGridColumn Property="PatientName" Title="姓名" Sortable="false" Filterable="false" Width="4rem" />
<RadzenDataGridColumn Property="Sex" Title="性别" Sortable="false" Filterable="false" Width="2rem" />
<RadzenDataGridColumn Property="OrderNo" Title="单号" Sortable="false" Filterable="false" Width="8rem" />
<RadzenDataGridColumn Property="Detail.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem">
<Template Context="DetailList">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
<RadzenDataGridColumn Property="DetailInfo.Drug.DrugName" Title="药品名称" FormatString="{0:d}" Sortable="false" Filterable="false" Width="8rem" />
@* <Template Context="DetailInfo">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
{
OrderDetail orderDetail = DetailList.DetailList[i];
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Drug.DrugName</RadzenText>
}
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
OrderDetail orderDetail = DetailList.DetailList[i]; *@
@* <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
}
</Template>
</RadzenDataGridColumn>*@
@* <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
<Template Context="DetailList">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
{
@ -80,16 +141,61 @@
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.SetManuNo</RadzenText>
}
</Template>
</RadzenDataGridColumn> *@
<RadzenDataGridColumn Width="110px" Title="批次" Property="DetailInfo.SetManuNo">
@* <Template Context="DetailInfo">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@DetailInfo.DetailInfo.SetManuNo</RadzenText>
@if (DetailInfo.DetailInfo.SetManuNo != null )
{
<RadzenText TextStyle="TextStyle.Caption">
@DetailInfo.DetailInfo.SetManuNo
</RadzenText>
}
</Template> *@
<EditTemplate Context="DetailInfo">
<RadzenDropDown TValue="DrugManuNo" Name="ManuNo" @bind-Value="DetailInfo.DetailInfo.drugManuNo" Data="DetailInfo.DetailInfo.Drug.Manus" Style="width:100%; display: block;">
<Template>
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
{
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
}
else
{
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
}
</Template>
<ValueTemplate>
<RadzenStack Orientation="Orientation.Horizontal">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@((context as DrugManuNo)?.ManuNo)</RadzenText>
@if ((context as DrugManuNo).EffDate != null && (context as DrugManuNo).EffDate.ToString().Length > 10)
{
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo).EffDate.ToString().Substring(0, 10))</RadzenText>
}
else
{
<RadzenText TextStyle="TextStyle.Caption">@((context as DrugManuNo)?.EffDate)</RadzenText>
}
</RadzenStack>
</ValueTemplate>
</RadzenDropDown>
<RadzenRequiredValidator Text="请选择批次" Component="ManuNo" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="Detail.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem">
<Template Context="DetailList">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
<RadzenDataGridColumn Property="DetailInfo.Quantity" Title="数量" Sortable="false" Filterable="false" Width="2rem" />
@* <Template Context="DetailInfo">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
{
OrderDetail orderDetail = DetailList.DetailList[i];
<RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@orderDetail.Quantity</RadzenText>
}
</Template>
</RadzenDataGridColumn>
</RadzenDataGridColumn> *@
</Columns>
</RadzenDataGrid>
</div>
@ -98,27 +204,36 @@
@inject IOrderInfoDao orderInfoDao;
@inject DialogService dialogService;
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
@inject NotificationService _message;
@inject IReportDataDao reportDataDao;
bool allowRowSelectOnRowClick = true;
IEnumerable<OrderInfo> orderInfos;
IList<OrderInfo> selectedOrderInfos;
RadzenDataGrid<OrderInfo> grid;
//麻醉师集合
List<Anaesthetist> NamesList = new List<Anaesthetist>();
Anaesthetist Name;
//麻醉师集合
List<BoxModel> BoxList = new List<BoxModel>();
BoxModel BoxNum;
bool isLoading;
int count;
int[] DrawerNos = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
int status = 0;
int drawerNo = 1;
string OrderNo;
DateTime OrderDate;
void SelectDrawer(int drawerNo)
{
this.drawerNo = drawerNo;
grid.Reload();
}
DateTime? OrderDate = null;
DateTime PortOrderDate = DateTime.Now;
Popup popup;
RadzenButton button;
void OnCurrentDateChanged(DateTime args)
{
OrderDate = new DateTime(args.Year, args.Month, args.Day);
}
void OnCurrentPortDateChanged(DateTime args)
{
PortOrderDate = new DateTime(args.Year, args.Month, args.Day);
}
//重置
async Task reloadGrid()
{
@ -126,25 +241,113 @@
OrderDate = DateTime.MinValue;
await grid.Reload();
}
void OnCellClick(DataGridCellMouseEventArgs<OrderInfo> args)
{
if (args.Data.DetailInfo.SetManuNo != null)
{
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.Where(m => m.ManuNo == args.Data.DetailInfo.SetManuNo).FirstOrDefault();
}
if (args.Data.DetailInfo.drugManuNo==null)
{
args.Data.DetailInfo.drugManuNo = args.Data.DetailInfo.Drug.Manus.FirstOrDefault();
}
grid.EditRow(args.Data);
}
//确认
async Task Confirm()
{
orderInfoDao.CheckOrderInfo(selectedOrderInfos, drawerNo);
if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null))
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择批次信息", Duration = 4000 }
);
return;
}
bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum.BoxNo);
if (bResult)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
);
await GetInitialDate();
await grid.Reload();
}
else
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
);
}
}
PageData<OrderInfo> result;
protected override async Task OnInitializedAsync()
{
await GetInitialDate();
await base.OnInitializedAsync();
}
async Task GetInitialDate()
{
result = await orderInfoDao.GetAllOrderInfo(null, null, null, null, null);
List<string> nameList = result.Desserts.Select(it => it.anaesthetistName).Distinct().ToList();
NamesList = nameList.Select(it => new Anaesthetist { Name = it }).ToList();
Name = NamesList.FirstOrDefault();
}
async Task LoadData(LoadDataArgs args)
{
isLoading = true;
if (result != null)
{
isLoading = true;
orderInfos = result.Desserts;
// Update the count
count = result.TotalDesserts;
// Update the Data property
if (Name != null)
{
orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name);
count = orderInfos.Count();
}
if(OrderDate != null && OrderDate != DateTime.MinValue)
{
orderInfos = orderInfos.Where(it => it.OrderDate.Date == OrderDate.Value.Date);
// Update the count
count = orderInfos.Count();
}
if(!string.IsNullOrEmpty(OrderNo))
{
orderInfos = orderInfos.Where(it => it.OrderNo.Contains(OrderNo));
// Update the count
count = orderInfos.Count();
}
if (Name != null && OrderDate != null && OrderDate != DateTime.MinValue && !string.IsNullOrEmpty(OrderNo))
{
orderInfos = orderInfos.Where(it => it.anaesthetistName == Name.Name && it.OrderDate.Date == OrderDate.Value.Date && it.OrderNo.Contains(OrderNo));
// Update the count
count = orderInfos.Count();
}
orderInfos = orderInfos.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
var result = await orderInfoDao.GetAllOrderInfoByBox(drawerNo, OrderNo, OrderDate, args.Top, args.Skip);
// Update the Data property
orderInfos = result.Desserts;
// Update the count
count = result.TotalDesserts;
//查找该麻醉师对应的手术室
List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList();
BoxList = roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
isLoading = false;
BoxNum = BoxList.FirstOrDefault();
DrawerNos = await orderInfoDao.GetDrawerNum(setting.Value.boxMachineId);
isLoading = false;
}
}
//麻醉药品使用登记本导出
async Task StockExport()
{
if (OrderDate == DateTime.MinValue)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方时间再导出", Duration = 4000 }
);
return;
}
PageData<ReportUsageDateInfo> pageData = await reportDataDao.GetOrderInfoData(OrderDate);
GridReportUtil.PrintReport("Usage_Temp.grf", pageData);
}
// protected override async Task OnInitializedAsync()
// {

View File

@ -36,7 +36,7 @@
</div>
}
</div>
<RadzenDataGrid @ref="grid"
<RadzenDataGrid @ref="grid" Style="overflow:auto"
LoadData="@LoadData"
IsLoading="@isLoading"
Count="@count"
@ -63,13 +63,13 @@
</HeaderTemplate>
<Columns>
<RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
<RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
<RadzenDataGridColumn Width="130px" Title="药品名称" Property="Drug.DrugName">
<Template Context="channel">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug?.DrugName</RadzenText>
<RadzenText TextStyle="TextStyle.Caption">@channel.Drug?.DrugSpec</RadzenText>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="批次" Property="ManuNo">
<RadzenDataGridColumn Width="110px" Title="批次" Property="ManuNo">
<Template Context="channel">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.drugManuNo?.ManuNo</RadzenText>
@ -130,7 +130,7 @@
}
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="库存" Property="Quantity">
<RadzenDataGridColumn Title="库存" Width="60px" Property="Quantity">
<Template Context="cs">
<RadzenButton ButtonStyle="ButtonStyle.Info" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@cs.Quantity.ToString()" />
</Template>
@ -301,6 +301,7 @@
{
cl.AddQuantity = this.AfterQuantity[cl.ColNo - 1] - this.BeforeQuantity[cl.ColNo - 1];
});
await InvokeAsync(StateHasChanged);
}
// 判断是否为称重抽屉
if (setting.Value.weigh != null && setting.Value.weigh.Contains(this.drawerNo))
@ -480,7 +481,7 @@
{
// if (args.Data.BoardType.ToString().Contains("3"))
// {
// //是药盒抽屉则点击行,打开对应行的药
// //是药盒抽屉则点击行,打开对应行的药
// if (!ColNos.Contains(args.Data.ColNo))
// {
// ColNos.Add(args.Data.ColNo);

View File

@ -36,7 +36,7 @@
</div>
}
</div>
<RadzenDataGrid @ref="grid"
<RadzenDataGrid @ref="grid" Style="overflow:auto"
LoadData="@LoadData"
IsLoading="@isLoading"
Count="@count"
@ -62,25 +62,25 @@
</RadzenRow>
</HeaderTemplate>
<Columns>
<RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
<RadzenDataGridColumn Title="药品名称" Property="Drug.DrugName">
<RadzenDataGridColumn Width="70px" Title="库位" Property="ColNo"></RadzenDataGridColumn>
<RadzenDataGridColumn Width="130px" Title="药品名称" Property="Drug.DrugName">
<Template Context="channel">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.Drug.DrugName</RadzenText>
<RadzenText TextStyle="TextStyle.Caption">@channel.Drug.DrugSpec</RadzenText>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="批次" Property="ManuNo">
<RadzenDataGridColumn Width="110px" Title="批次" Property="ManuNo">
<Template Context="channel">
<RadzenText TextStyle="TextStyle.Subtitle2" class="mb-0">@channel.ManuNo</RadzenText>
<RadzenText TextStyle="TextStyle.Caption">@channel.EffDate</RadzenText>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="库存" Property="Quantity">
<RadzenDataGridColumn Title="库存" Width="60px" Property="Quantity">
<Template Context="channel">
<RadzenButton ButtonStyle="ButtonStyle.Info" Size="ButtonSize.Medium" Variant="Variant.Flat" Shade="Shade.Lighter" class="m-1" Text="@channel.Quantity.ToString()" />
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn MinWidth="120px" Title="取药数量" Property="TakeQuantity">
<RadzenDataGridColumn MinWidth="100px" Title="取药数量" Property="TakeQuantity">
<EditTemplate Context="channel">
@if (channel.BoardType.ToString().Contains("2") || channel.BoardType.ToString().Contains("3"))
{
@ -434,7 +434,7 @@
{
// if (args.Data.BoardType.ToString().Contains("3"))
// {
// //是药盒抽屉则点击行,打开对应行的药
// //是药盒抽屉则点击行,打开对应行的药
// if (!ColNos.Contains(args.Data.ColNo))
// {
// ColNos.Add(args.Data.ColNo);

View File

@ -45,7 +45,7 @@
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenRow Style="height: 100%;width:100%" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenColumn Size="2">
<RadzenColumn Size="6">
@if (globalStateService.Operator != null)
{
//<RadzenText Style="" class="rz-color-white" TextStyle="TextStyle.H5" TextAlign="TextAlign.Center">操作人:@globalStateService.Operator.NickName</RadzenText>
@ -120,7 +120,8 @@
}
</RadzenStack>
<RadzenStack class="home-menu rz-background-color-danger-lighter rz-text-white rz-ripple" JustifyContent="JustifyContent.Center" @onclick="@(() => jump2Page(6))" Style="height: 100%;width:50%">
<RadzenText class="rz-color-white" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">药箱管理</RadzenText>
<RadzenText class="rz-color-white" Style="margin-top:10px;margin-bottom:-10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">药盒</RadzenText>
<RadzenText class="rz-color-white" Style="margin-top:-10px;margin-bottom:10px" TextStyle="TextStyle.H2" TextAlign="TextAlign.Center">管理</RadzenText>
@if (globalStateService.Operator != null)
{
@if (!globalStateService.Operator.role.permissionIds.Any(id => id - 60 > 0 && id - 60 < 10))

View File

@ -46,7 +46,7 @@
InvokeAsync(StateHasChanged);
try
{
bool flag=await FingerprintUtil.ConnectionMain();
bool flag = await FingerprintUtil.ConnectionMain();
if (flag)
{
msg = "指纹模块连接成功";
@ -56,10 +56,12 @@
msg = "指纹模块连接失败";
}
InvokeAsync(StateHasChanged);
} catch (Exception e)
}
catch (Exception e)
{
msg = "指纹模块连接失败";
errMsg += "【指纹模块连接失败】";
logger.Info($"指纹模块连接失败【{e.Message}】");
InvokeAsync(StateHasChanged);
}
await Task.Delay(500);
@ -71,10 +73,12 @@
logger.Info($"抽屉串口打开结果【{PortUtil.drawerSerial.IsOpen}】");
msg = "抽屉串口连接成功";
InvokeAsync(StateHasChanged);
} catch (Exception e)
}
catch (Exception e)
{
msg = "抽屉串口连接失败";
errMsg += "【抽屉串口连接失败】";
logger.Info($"抽屉串口连接失败【{e.Message}】");
InvokeAsync(StateHasChanged);
}
await Task.Delay(500);
@ -86,10 +90,29 @@
logger.Info($"CanBus模块打开结果【{PortUtil.canBusSerial.IsOpen}】");
msg = "CanBus模块连接成功";
InvokeAsync(StateHasChanged);
} catch (Exception e)
}
catch (Exception e)
{
msg = "CanBus模块连接失败";
errMsg += "【CanBus模块连接失败】";
logger.Info($"模块连接失败【{e.Message}】");
InvokeAsync(StateHasChanged);
}
await Task.Delay(500);
msg = "开始连接第二个CanBus模块";
InvokeAsync(StateHasChanged);
try
{
PortUtil.canBusSerialTwo.Open();
logger.Info($"第二个CanBus模块打开结果【{PortUtil.canBusSerialTwo.IsOpen}】");
msg = "CanBus模块连接成功";
InvokeAsync(StateHasChanged);
}
catch (Exception e)
{
msg = "第二个CanBus模块连接失败";
logger.Info($"模块连接失败【{e.Message}】");
errMsg += "【第二个CanBus模块连接失败】";
InvokeAsync(StateHasChanged);
}
await Task.Delay(500);
@ -101,10 +124,12 @@
logger.Info($"条码扫描模块打开结果【{PortUtil.scanCodeSerial.IsOpen}】");
msg = "条码扫描模块连接成功";
InvokeAsync(StateHasChanged);
} catch (Exception e)
}
catch (Exception e)
{
msg = "条码扫描模块连接失败";
errMsg += "【条码扫描模块连接失败】";
errMsg += "【条码扫描模块连接失败】";
logger.Info($"条码扫描模块打开结果【{e.Message}】");
InvokeAsync(StateHasChanged);
}
if (portSetting.Value.fridgePortExist)
@ -116,10 +141,11 @@
msg = "冰箱串口连接成功";
InvokeAsync(StateHasChanged);
}
catch (Exception)
catch (Exception e)
{
msg = "冰箱串口打开失败";
errMsg += "【冰箱串口打开失败】";
logger.Info($"冰箱串口打开失败【{e.Message}】");
InvokeAsync(StateHasChanged);
}
}

View File

@ -18,7 +18,7 @@
<RadzenLabel Text="开始时间" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
@ -26,7 +26,7 @@
<RadzenLabel Text="结束时间" Component="End" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
</RadzenColumn>
</RadzenRow>
@ -36,10 +36,10 @@
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
@* <RadzenRow AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
<RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
</RadzenRow>
</RadzenRow> *@
</RadzenStack>
</RadzenFieldset>
</form>

View File

@ -19,7 +19,7 @@
</RadzenStack>
</RadzenFieldset>
</div>
<div class="col-6 mb-4">
<div class="col-4 mb-4">
<RadzenDataGrid @ref="grid"
LoadData="@LoadData"
@bind-Value="@SelectedPlan"
@ -37,14 +37,14 @@
<RadzenRequiredValidator Text="请填写套餐名称" Component="Name" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
@* <RadzenDataGridColumn Width="200px" Title="套餐描述" Property="Description">
<EditTemplate Context="planInfo">
<RadzenTextBox Name="Description" @bind-Value="planInfo.Description" Style="width:100%;display:block;" />
<RadzenRequiredValidator Text="请填写套餐描述" Component="Description" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
</RadzenDataGridColumn> *@
<RadzenDataGridColumn Context="planInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
<RadzenDataGridColumn Context="planInfo" Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="5rem">
<Template Context="planInfo">
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditPlanRow(planInfo))" @onclick:stopPropagation="true">
</RadzenButton>
@ -56,14 +56,14 @@
</RadzenButton>
<RadzenButton Icon="close" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@((args) => CancelPlanEdit(planInfo))" aria-label="Cancel">
</RadzenButton>
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeletePlanRow(planInfo))" aria-label="Delete">
<RadzenButton ButtonStyle="ButtonStyle.Danger" Icon="delete" Variant="Variant.Flat" Shade="Shade.Lighter" Size="ButtonSize.Medium" class="my-1 ms-1" Click="@(args => DeletePlanRow(planInfo))" aria-label="Delete">
</RadzenButton>
</EditTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
</div>
<div class="col-6 mb-4">
<div class="col-8 mb-4">
<RadzenDataGrid @ref="PlanDetailsGrid" EmptyText="无数据"
Data="@(SelectedPlan?.FirstOrDefault()?._PlanDetails)"
RowUpdate="@((PlanDetails pd) => { OnUpdateRow(pd); })"
@ -76,12 +76,12 @@
</RadzenRow>
</HeaderTemplate> *@
<Columns>
<RadzenDataGridColumn Title="序号" Property="index" Width="5rem">
<RadzenDataGridColumn Title="序号" Property="index" Width="3rem">
<Template Context="data">
@(SelectedPlan.FirstOrDefault()?._PlanDetails.IndexOf(data) + 1)
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="药品" Property="_DrugInfo.DrugName" Width="25rem">
<RadzenDataGridColumn Title="药品" Property="_DrugInfo.DrugName" Width="15rem">
<Template Context="data">
<RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugName)</b></RadzenText>
<RadzenText TextStyle="TextStyle.Body1"><b>@(data._DrugInfo?.DrugSpec)</b></RadzenText>
@ -92,7 +92,7 @@
Style="width:100%; display: block;" AllowFilteringByAllStringColumns="true" TextProperty="DrugName">
<Columns>
<RadzenDropDownDataGridColumn Property="DrugId" Title="药品编码" />
<RadzenDropDownDataGridColumn Property="DrugName" Width="120px" Title="名称" />
<RadzenDropDownDataGridColumn Property="DrugName" Title="名称" />
<RadzenDropDownDataGridColumn Property="DrugSpec" Title="规格" />
</Columns>
</RadzenDropDownDataGrid>
@ -101,13 +101,13 @@
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="5rem">
<RadzenDataGridColumn Title="基数" Property="BaseQuantity" Width="7rem">
<EditTemplate Context="planDetails">
<RadzenNumeric Name="BaseQuantity" @bind-Value="planDetails.BaseQuantity" Style="width:100%; display: block;" />
<RadzenNumericRangeValidator Style="position: absolute;z-index: 9999;" Min="0" Text="请填写正确的添加数量" Component="BaseQuantity" Popup="true" />
</EditTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="8rem">
<RadzenDataGridColumn Title="操作" Filterable="false" Sortable="false" TextAlign="TextAlign.Left" Frozen="true" FrozenPosition="FrozenColumnPosition.Right" Width="9rem">
<Template Context="planDetails">
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Light" Variant="Variant.Flat" Size="ButtonSize.Medium" Click="@(args => EditRow(planDetails))" @onclick:stopPropagation="true">
</RadzenButton>
@ -126,7 +126,7 @@
</Columns>
</RadzenDataGrid>
<div style="margin-top:5px">
<RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增药品" />
<RadzenButton Size="ButtonSize.Medium" ButtonStyle="ButtonStyle.Success" Icon="add_circle_outline" Click="@InsertRow" Text="新增药品" />
</div>
</div>
</div>
@ -146,8 +146,7 @@
IList<Plan>? SelectedPlan { get; set; } = new List<Plan>();
List<PlanDetails> SelectedPlanDetails = new List<PlanDetails>();
List<DrugInfo> drugInfos;
async Task LoadData(LoadDataArgs args)
{
@ -178,11 +177,14 @@
planDao.UpdatePlanInfo(dl);
grid.Reload();
}
void OnCreatePlanRow(Plan dl)
async Task OnCreatePlanRow(Plan dl)
{
// 数据库添加套餐
planDao.InsertPlanInfo(dl);
SelectedPlan.Remove(dl);
bool bFlag = await planDao.InsertPlanInfo(dl);
if (!bFlag)
{
SelectedPlan.Remove(dl);
}
grid.Reload();
}
//新增套餐
@ -406,6 +408,7 @@
{
if (SelectedPlan.FirstOrDefault() != null)
{
planDetail.PlanId = SelectedPlan.FirstOrDefault().Id;
planDetail.DrugId = planDetail.DrugId == null ? planDetail._DrugInfo.DrugId : planDetail.DrugId;
planDetail.UseState = 1;
@ -444,6 +447,21 @@
//新增药品
async Task InsertRow()
{
//查询要删除的套餐下是否有绑定,且绑定有库存
if (SelectedPlan.FirstOrDefault()!=null)
{
if (!(await planDao.CheckPlanBind((int)SelectedPlan.FirstOrDefault().Id)))
{
_message.Notify(new NotificationMessage
{
Severity = NotificationSeverity.Error,
Summary = "提示",
Detail = "该药品有绑定且库存不为0请先清库存",
Duration = 4000
});
return;
}
}
var detail = new Pojo.PlanDetails()
{
PlanId = SelectedPlan.FirstOrDefault().Id

View File

@ -18,7 +18,7 @@
<RadzenLabel Text="¿ªÊ¼Ê±¼ä" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
@ -26,7 +26,7 @@
<RadzenLabel Text="½áÊøÊ±¼ä" Component="End" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
</RadzenColumn>
</RadzenRow>

View File

@ -13,7 +13,7 @@
<RadzenLabel Text="¿ªÊ¼Ê±¼ä" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
@ -21,7 +21,7 @@
<RadzenLabel Text="½áÊøÊ±¼ä" Component="End" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" @bind-Value="end" Style="width: 100%;" Name="End" />
</RadzenColumn>
</RadzenRow>

View File

@ -23,9 +23,9 @@
<RadzenLabel Text="处方时间" Component="OrderDate" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" CurrentDateChanged="@OnCurrentDateChanged"
ShowTime="true" ShowSeconds="true"
@bind-Value="orderInfo.OrderDate" Style="width: 100%;" Name="OrderDate" />
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged"
ShowSeconds="true"
@bind-Value="orderInfo.ChargeDate" Style="width: 100%;" Name="OrderDate" />
<RadzenRequiredValidator Text="请输入处方时间" Component="OrderDate" />
</RadzenColumn>
</RadzenRow>
@ -289,6 +289,6 @@
void OnCurrentDateChanged(DateTime args)
{
orderInfo.OrderDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
orderInfo.ChargeDate = new DateTime(args.Year, args.Month, args.Day, args.Hour, args.Minute, args.Second);
}
}

View File

@ -215,6 +215,7 @@
{
cl.CheckQuantity = this.AfterQuantity[cl.ColNo - 1];// - this.BeforeQuantity[cl.ColNo - 1];
});
await InvokeAsync(StateHasChanged);
}
next(); // continue iteration
}

View File

@ -1,5 +1,6 @@
@page "/stock/list"
@using MasaBlazorApp3.Report
@using Radzen.Blazor.Rendering
<style>
@@keyframes shake {
0% {
@ -37,14 +38,24 @@
/* 你可以根据需要调整动画的持续时间和迭代次数 */
transition: color 0.5s linear,opacity 0.5s linear;
}
.my-popup {
display: none;
position:absolute;
overflow: auto;
/* height: 360px; */
width: 900px;
border: var(--rz-panel-border);
background-color: var(--rz-panel-background-color);
box-shadow: var(--rz-panel-shadow);
border-radius: var(--rz-border-radius);
}
</style>
<div class="col-12 mb-4">
<form onsubmit="@(() => grid.Reload())">
<RadzenFieldset Text="查询">
<RadzenFieldset Text="报表导出">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
@*<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="开始时间" Component="Start" />
</RadzenColumn>
@ -72,13 +83,90 @@
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12">
@* <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" /> *@
<RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="查询" />
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="StockExport" />
<RadzenButton Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="AccountBookExport" />
</RadzenRow>*@
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
@* <RadzenButton @ref=button Icon="download" Text="库存导出" Variant="Variant.Outlined" Click="@(args => popup.ToggleAsync(button.Element))" /> *@
<RadzenButton @ref=button Icon="download" Text="专用账册导出" Variant="Variant.Outlined" Click="@(args => popup2.ToggleAsync(button.Element))" />
@* <Popup @ref=popup Lazy=true class="my-popup">
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
<RadzenFieldset Text="条件选择" >
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" >
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="6">
<RadzenLabel Text="药品名称/拼音码/编码" Component="drug" />
</RadzenColumn>
<RadzenColumn Size="6">
<RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12">
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="StockExport" />
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
</RadzenStack>
</Popup> *@
<Popup @ref=popup2 Lazy=true class="my-popup">
<RadzenStack Orientation="Orientation.Vertical" Gap="1rem" class="rz-h-100 rz-p-4">
<RadzenFieldset Text="条件选择">
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="开始" Component="Start" />
<RadzenLabel Text="时间" Component="Start" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="结束" Component="End" />
<RadzenLabel Text="时间" Component="End" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="5">
<RadzenLabel Text="药品名称" Component="drug" />
<RadzenLabel Text="拼音码" Component="drug" />
<RadzenLabel Text="编码" Component="drug" />
</RadzenColumn>
<RadzenColumn Size="6">
<RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
</RadzenColumn>
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn>
<RadzenButton Click="reloadGrid" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="导出" Variant="Variant.Outlined" Click="AccountBookExport" />
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
</RadzenStack>
</Popup>
</RadzenRow>
</RadzenStack>
</RadzenFieldset>
@ -166,7 +254,9 @@
DateTime? end;
string drugName;
RadzenButton button;
Popup popup2;
IEnumerable<DrugInfo> drugInfo;
protected override async Task OnInitializedAsync()
@ -199,12 +289,12 @@
}
//库存导出
async Task StockExport()
{
PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
GridReportUtil.PrintReport("stock_template.grf", pageData);
}
// //库存导出
// async Task StockExport()
// {
// PageData<ReportStockDateInfo> pageData = await reportDataDao.GetStockExportData(drugName);
// GridReportUtil.PrintReport("stock_template.grf", pageData);
// }
//专用账册导出
async Task AccountBookExport()
{

View File

@ -7,7 +7,7 @@ namespace MasaBlazorApp3.Pojo
/// <summary>
/// 主键
/// </summary>
[Column("id")]
[Column("id", IsPrimaryKey = true)]
public int Id { get; set; }
/// <summary>

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MasaBlazorApp3.Pojo
{
public class Anaesthetist
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MasaBlazorApp3.Pojo
{
public class BoxModel
{
public int BoxNo { get; set; }
public string BoxName { get; set; }
}
}

View File

@ -29,7 +29,7 @@ namespace MasaBlazorApp3.Pojo
public string DrugId { get; set; }
[Column("chn_type")]
public int DrawerType { get; set; }
public int DrawerType { get; set; }
[Column("col_no1")]
public int IsBox { get; set; }
@ -45,12 +45,18 @@ namespace MasaBlazorApp3.Pojo
public DrugInfo Drug { get; set; } = new();
//关联药品中的套餐信息表
[Association(ThisKey =nameof(DrugId),OtherKey = nameof(Plan.Id))]
public Plan PlanInfo { get; set; }=new();
//手术室药中的库存总数
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(Plan.Id))]
public Plan PlanInfo { get; set; } = new();
//手术室药中的库存总数
[Column("stock_quantity")]
public int TotalQuantity { get; set; }
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(PlanDetails.PlanId))]
public List<PlanDetails> _PlanDetails { get; set; } = new();
//手术室药盒中的库存总数
[Column(IsColumn = false)]
public bool IsChecked{get;set;} = false;
//手术室药盒中的库存总数
[Column(IsColumn = false)]
public bool BoxDisabled {get;set;} = false;
}
}

View File

@ -1,4 +1,5 @@
using LinqToDB.Mapping;
using Mysqlx.Crud;
namespace MasaBlazorApp3.Pojo
{
@ -27,7 +28,7 @@ namespace MasaBlazorApp3.Pojo
[Column("quantity")]
public int Quantity { get; set; }
//药盒DrawerType为非1时表示不在库
[Column("drawer_type")]
public int DrawerType { get; set; }
@ -61,6 +62,8 @@ namespace MasaBlazorApp3.Pojo
[LinqToDB.Mapping.Association(ThisKey = nameof(Dmnguid), OtherKey = nameof(DrugManuNo.Id))]
public DrugManuNo? drugManuNo { get; set; }
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugManuNo.DrugId))]
public List<DrugManuNo> drugManuNoList { get; set; }=new List<DrugManuNo>();
[Column(IsColumn = false)]
public string Location
@ -77,17 +80,19 @@ namespace MasaBlazorApp3.Pojo
[Column("Pos_No")]
public int BiaoDingStatus { get; set; }
//手术室药中的药品基数
//手术室药中的药品基数
[Column("Check_Quantity")]
public int BaseQuantity { get; set; }
//手术室药中某药品全部批次的需要加药数
//手术室药中某药品全部批次的需要加药数
[Column("col_no2")]
public int NeedQuantity { get; set; }
//手术室药中某药品全部批次的已取药待入库数
//手术室药中某药品全部批次的已取药待入库数
[Column("col_no1")]
public int AddToQuantity { get; set; }
//手术室药中药品补药状态(1需补药2已补药待入库0满库状态)
//手术室药中药品补药状态(1需补药2已补药待入库0满库状态)
[Column("state")]
public int BoxState { get; set; }
[Column("fill_time")]
public DateTime FillTime { get; set; }
}
}

View File

@ -17,6 +17,11 @@ namespace MasaBlazorApp3.Pojo.Config
public string canBusPortPath { get; set; }
public bool canBusExsit { get; set; }
//抽屉总数量8个抽屉与16个抽屉对应发单支指令不同开抽屉指令也不同
public int totalDrawerCount { get; set; }
public bool canBusTwoExsit { get; set; }
public string canBusPortPathTwo { get; set; }
public int doorAddr { get; set; }
public int storageBoxAddr { get; set; }
//存在冰箱串口

View File

@ -32,6 +32,9 @@ namespace MasaBlazorApp3.Pojo
public string PackUnit { get; set; }
[Column("py_code")]
public string PyCode { get; set; }
//用于标识“手术室患者麻醉药品使用登记本”报表中是否导出该药品 1导出0不导
//[Column("pack_h")]
//public int ReportType { get; set; }
[Column(IsColumn =false)]
public string DrugNameSpecManufactory
{

View File

@ -36,5 +36,7 @@ namespace MasaBlazorApp3.Pojo
return other?.DrugId == DrugId && other?.ManuNo == ManuNo;
}
[Column(IsColumn =false)]
public int Quantity { get; set; }
}
}

View File

@ -39,5 +39,7 @@ namespace MasaBlazorApp3.Pojo
public string optState { get; set; }
[Column("machine_id")]
public string MachineId { get; set; }
[Column("Remarks")]
public string Remarks { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using LinqToDB.Mapping;
namespace MasaBlazorApp3.Pojo
{
[Table("hkc_changeshifts_drug")]
public class HkcChangeShiftsDetail
{
[Column("Id")]
public int Id { get; set; }
//交接班ID
[Column("changeshifts_id")]
public int ChangeshiftsId { get; set; }
//药品ID
[Column("drug_id")]
public string DrugId { get; set; }
//实物数
[Column("RealNumber")]
public int RealNumber { get; set; }
//处方数
[Column("orderNumber")]
public int OrderNumber { get; set; }
}
}

View File

@ -72,7 +72,8 @@ namespace MasaBlazorApp3.Pojo
[Column("eff_date")]
public DateTime? EffDate { get; set; }
/// <summary>
/// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药箱移出移入69药箱药品替换55药箱套餐绑定解绑)
/// 出库入库类型(1入库2出库4盘点31还药32还空瓶,21药盒移出移入69药盒药品替换)
/// 50添加套餐;51删除套餐52向套餐中添加药品53修改套餐中的药品54删除套餐中的药品;55药盒套餐绑定;56药盒套餐解绑,
///</summary>
[Column("type")]
public int Type { get; set; }

View File

@ -31,6 +31,11 @@ namespace MasaBlazorApp3.Pojo
/// <summary>
///
///</summary>
[Column("order_id")]
public string OrderId { get; set; }
/// <summary>
///
///</summary>
[Column("order_no")]
public string OrderNo { get; set; }
/// <summary>
@ -52,6 +57,7 @@ namespace MasaBlazorApp3.Pojo
[Association(ThisKey = nameof(DrugId), OtherKey = nameof(DrugInfo.DrugId))]
public DrugInfo Drug { get; set; } = new();
/// <summary>
///
///</summary>
@ -129,5 +135,8 @@ namespace MasaBlazorApp3.Pojo
///</summary>
[Column("use_dosage")]
public string UseDosage { get; set; }
[LinqToDB.Mapping.Association(ThisKey = nameof(SetManuNo), OtherKey = nameof(DrugManuNo.ManuNo))]
public DrugManuNo? drugManuNo { get; set; }
}
}

View File

@ -147,15 +147,19 @@ namespace MasaBlazorApp3.Pojo
///</summary>
[Column("win_no")]
public int WinNo { get; set; } = 0;
///// <summary>
/////
///// 默认值: 0
/////</summary>
//[Column("state")]
//public int state { get; set; } = 0;
/// <summary>
///
/// 默认值: 0
///</summary>
[Column("state")]
public int state { get; set; } = 0;
//[Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
//public List<OrderDetail> DetailList { get; set; } = new();
[Association(ThisKey = nameof(OrderNo), OtherKey = nameof(OrderDetail.OrderNo))]
public List<OrderDetail> DetailList { get; set; } = new();
public OrderDetail DetailInfo { get; set; } = new();
/// <summary>
/// 是否选中
@ -163,5 +167,15 @@ namespace MasaBlazorApp3.Pojo
[Column(IsColumn =false)]
public bool ItemIsChecked { get; set; }
/// <summary>
/// 麻醉师
///</summary>
[Column("anaesthetist_name")]
public string anaesthetistName { get; set; }
/// <summary>
/// 手术室
///</summary>
[Column("op_room_name")]
public string RoomName { get; set; }
}
}

View File

@ -33,5 +33,8 @@ namespace MasaBlazorApp3.Pojo
//审核人
[Column("reviewerUser")]
public int ReviewerUser { get; set; }
[Column("machine_id")]
public string MachineId { get; set; }
}
}

View File

@ -102,12 +102,12 @@ namespace MasaBlazorApp3.Pojo
PremissionPath = "return"
};
h.AddChild(new Premission()
{
Id = 31,
PremissionName = "归还药品(处方)",
PremissionPath = "/return/order"
});
//h.AddChild(new Premission()
//{
// Id = 31,
// PremissionName = "归还药品(处方)",
// PremissionPath = "/return/order"
//});
h.AddChild(new Premission()
{
Id = 32,
@ -171,12 +171,12 @@ namespace MasaBlazorApp3.Pojo
PremissionName = "药品信息",
PremissionPath = "/stock/drug"
});
k.AddChild(new Premission()
{
Id = 46,
PremissionName = "药品标定",
PremissionPath = "/stock/biaoDing"
});
//k.AddChild(new Premission()
//{
// Id = 46,
// PremissionName = "药品标定",
// PremissionPath = "/stock/biaoDing"
//});
k.AddChild(new Premission()
{
Id = 47,
@ -231,31 +231,31 @@ namespace MasaBlazorApp3.Pojo
//x.AddChild(new Premission()
//{
// Id = 55,
// PremissionName = "绑定药",
// PremissionName = "绑定药",
// PremissionPath = "/Box/BoxBindings"
//});
//x.AddChild(new Premission()
//{
// Id = 56,
// PremissionName = "药核对",
// PremissionName = "药核对",
// PremissionPath = "/Box/Check"
//});
//x.AddChild(new Premission()
//{
// Id = 57,
// PremissionName = "药加药",
// PremissionName = "药加药",
// PremissionPath = "/Box/BoxAdd"
//});
//x.AddChild(new Premission()
//{
// Id = 58,
// PremissionName = "药入库",
// PremissionName = "药入库",
// PremissionPath = "/Box/BoxAddBox"
//});
//x.AddChild(new Premission()
//{
// Id = 59,
// PremissionName = "药库存",
// PremissionName = "药库存",
// PremissionPath = "/Box/BoxStock"
//});
@ -263,7 +263,7 @@ namespace MasaBlazorApp3.Pojo
Premission b = new Premission
{
Id = 6,
PremissionName = "药管理",
PremissionName = "药管理",
PremissionPath = "Box"
};
b.AddChild(new Premission()
@ -275,33 +275,33 @@ namespace MasaBlazorApp3.Pojo
b.AddChild(new Premission()
{
Id = 62,
PremissionName = "绑定药",
PremissionName = "绑定药",
PremissionPath = "/Box/BoxBindings"
});
b.AddChild(new Premission()
{
Id = 63,
PremissionName = "药核对",
PremissionName = "药核对",
//PremissionName = "盘点交接",
PremissionPath = "/Box/Check"
});
b.AddChild(new Premission()
{
Id = 66,
PremissionName = "药加药",
PremissionName = "药加药",
//PremissionPath = "/stock/checkRecord"
PremissionPath = "/Box/BoxAdd"
});
b.AddChild(new Premission()
{
Id = 65,
PremissionName = "药箱入库",
PremissionPath = "/Box/BoxAddBox"
});
//b.AddChild(new Premission()
//{
// Id = 65,
// PremissionName = "药盒入库",
// PremissionPath = "/Box/BoxAddBox"
//});
b.AddChild(new Premission()
{
Id = 66,
PremissionName = "药库存",
PremissionName = "药库存",
PremissionPath = "/Box/BoxStock"
});
list.Add(q);

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
@ -25,7 +26,7 @@ namespace MasaBlazorApp3.Pojo
// 出库数量
public int OutQuantity { get; set; } = 0;
//批号结存
//public int ManuQuantity { get; set; } = 0;
public int ManuQuantity { get; set; } = 0;
//总结存
public int StockQuantity { get; set; } = 0;
@ -48,10 +49,16 @@ namespace MasaBlazorApp3.Pojo
public string Manufactory { get; set; } = string.Empty;
//凭证号
public string InvoiceId { get; set; } = string.Empty;
////供应单位
//////供应单位
//public string SupplierDept { get;set; } = string.Empty;
////领用部门
//public string ReceiveDept { get; set; } = string.Empty;
//////领用部门
//public string ReceiveDept { get; set; } = string.Empty;
/// <summary>
///供应单位(领用部门)
/// </summary>
public string department { get; set; } = string.Empty;
//备注
public string Remarks { get; set; } = string.Empty;
}
public class ReportStockDateInfo
@ -83,4 +90,56 @@ namespace MasaBlazorApp3.Pojo
//数量
public int Quantity { get; set; }
}
//手术室患者麻醉药品使用登记本
public class ReportUsageDateInfo
{
//日期
public DateTime portdate { get; set; }
//手术间
public int ShouShuJian { get; set; }
//主麻
public string ZhuMa { get; set; }
//副麻
public string FuMa { get; set; }
//ID号
public string IDNumber { get; set; }
//患者姓名
public string PName { get; set; }
public string Diagnose { get; set; }
//药品ID
public string DrugId { get; set; }
//药品名称
public string DrugName { get; set; }
//批次
public string ManuNo { get; set; }
//使用量
public string UsageDosage { get; set; }
//残液量
public string CanYeLiang { get; set; }
//残液处置方式
public string CanYeChuZhi { get; set; }
//使用人姓名
public string UseUserName { get; set; }
//核对人姓名
public string CheckUserName { get; set; }
}
//请领报表信息
public class ReportApplyInfo
{
//手术间
public int BoxNum { get; set; }
//请领时间
public DateTime ApplyDate { get; set; }
//麻醉医生 一线
public string UserFirst { get; set; }
//麻醉医生 二线
public string UserSecond { get; set; }
//药品ID
public string DrugId { get; set; }
//医生签名
public string Doctor { get; set; }
//管理者签名
public string Manager { get; set; }
}
}

View File

@ -15,6 +15,9 @@ namespace MasaBlazorApp3.Pojo
public string Icon { get; set; }
[Column("Path")]
public string Path { get; set; }
//使用状态1在用0不在用
[Column("UseStatus")]
public int UseStatus { get; set; }
[Column(IsColumn = false)]
public List<SettingManu> Children { get; set; } = new();
}

View File

@ -29,6 +29,8 @@ namespace MasaBlazorApp3.Port
public SerialPort drawerSerial;
// can总线串口
public SerialPort canBusSerial;
// can总线串口
public SerialPort canBusSerialTwo;
// 条码枪串口
public SerialPort scanCodeSerial;
@ -67,14 +69,15 @@ namespace MasaBlazorApp3.Port
logger.Error("抽屉串口打开错误" + e.Message);
}
try {
string ScanCodePortPath = _portConfig.scanCodePortPath;
try
{
string ScanCodePortPath = _portConfig.scanCodePortPath;
logger.Info($"打开条码枪串口【{ScanCodePortPath}】");
scanCodeSerial = new SerialPort(ScanCodePortPath, 9600, Parity.None, 8);
scanCodeSerial.DataReceived += (object sender, System.IO.Ports.SerialDataReceivedEventArgs e) =>
{
string code = scanCodeSerial.ReadExisting();
};
//scanCodeSerial.Open();
//logger.Info($"条码枪串口打开结果【{scanCodeSerial.IsOpen}】");
@ -85,7 +88,7 @@ namespace MasaBlazorApp3.Port
}
if (_portConfig.canBusExsit)
{
try
try
{
string CanBusPortPath = _portConfig.canBusPortPath;
logger.Info($"打开can总线串口【{CanBusPortPath}】");
@ -97,7 +100,22 @@ namespace MasaBlazorApp3.Port
{
logger.Error("can总线串口打开错误" + e.Message);
}
}
//打开第二个can总线串口
if (_portConfig.canBusTwoExsit)
{
try
{
string CanBusPortPath = _portConfig.canBusPortPathTwo;
logger.Info($"打开第二个can总线串口【{CanBusPortPath}】");
canBusSerialTwo = new SerialPort(CanBusPortPath, 57600, Parity.None, 8);
}
catch (Exception e)
{
logger.Error("第二个can总线串口打开错误" + e.Message);
}
}
if (_portConfig.fridgePortExist)
{
@ -122,12 +140,13 @@ namespace MasaBlazorApp3.Port
int _length = 0;
DateTime start = DateTime.Now;
DateTime end = DateTime.Now;
while(_length != length && end.Subtract(start).TotalMilliseconds < timeout)
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
{
_length = serialPort.BytesToRead;
end = DateTime.Now;
//logger.Error($"_length{_length};length:{length}");
}
if(_length != length)
if (_length != length)
{
throw new TimeoutException($"串口【{serialPort.PortName}】交互超时");
}
@ -137,10 +156,10 @@ namespace MasaBlazorApp3.Port
}
private Task<byte[]> GetBufferByPort(SerialPort serialPort, int length)
{
return Task.Run(() => GetBufferByPort(serialPort, length, 3000));
}
public static SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
public void SpeakAsync(string textinfo)
@ -148,7 +167,7 @@ namespace MasaBlazorApp3.Port
speechSynthesizer.SpeakAsync(textinfo);
}
#region
// 打开抽屉
@ -158,9 +177,16 @@ namespace MasaBlazorApp3.Port
byte[] buffer = new byte[] { 0xaa, 0x41, (byte)DrawerNo, 0xee };
if (_portConfig.drawerProtocol == 485)
{
if (DrawerNo > 8)
if (_portConfig.totalDrawerCount > 8)
{
buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo - 8), 0xee };
if (DrawerNo % 2 == 0)
{
buffer = new byte[] { 0xaa, 0x21, (byte)(DrawerNo / 2), 0xee };
}
else
{
buffer = new byte[] { 0xaa, 0x11, (byte)(DrawerNo / 2 + DrawerNo % 2), 0xee };
}
}
else
{
@ -178,7 +204,17 @@ namespace MasaBlazorApp3.Port
{
byte[] buffer = await OpenDrawer(DrawerNo);
int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
//int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
//int index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
int index = 1;
if (_portConfig.totalDrawerCount > 8)
{
index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
}
else
{
index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
}
return r[index] == 0;
}
@ -191,15 +227,28 @@ namespace MasaBlazorApp3.Port
byte[] buffer = new byte[] { 0xaa, 0x42, 0xee };
if (_portConfig.drawerProtocol == 485)
{
if (DrawerNo > 8)
if (_portConfig.totalDrawerCount > 8)
{
buffer = new byte[] { 0xaa, 0x22, 0xee };
//if (DrawerNo > 8)
//{
if (DrawerNo % 2 == 0)
{
buffer = new byte[] { 0xaa, 0x22, 0xee };
}
else
{
buffer = new byte[] { 0xaa, 0x12, 0xee };
}
//}
//else
//{
// buffer = new byte[] { 0xaa, 0x12, 0xee };
//}
}
else
{
buffer = new byte[] { 0xaa, 0x12, 0xee };
}
}
logger.Info($"查询抽屉状态,串口数据:{Convert.ToHexString(buffer)}");
@ -211,8 +260,18 @@ namespace MasaBlazorApp3.Port
public async Task<bool> CheckDrawerStatus2(int DrawerNo)
{
byte[] buffer = await CheckDrawerStatus(DrawerNo);
logger.Info($"查询抽屉状态,返回:{Convert.ToHexString(buffer)}");
int[] r = buffer.Select(it => Convert.ToInt32(it)).ToArray();
int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
//int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
int index = 1;
if (_portConfig.totalDrawerCount > 8)
{
index = DrawerNo % 2 > 0 ? ((DrawerNo + 1) / 2) + 1 : (DrawerNo / 2) + 1;
}
else
{
index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1;
}
return r[index] != 0;
}
@ -288,14 +347,30 @@ namespace MasaBlazorApp3.Port
// 以抽屉为单位获取抽屉内所有库位的药品数量
public async Task<byte[]> CheckQuantityByDrawer(int DrawerNo)
{
canBusSerial.DiscardInBuffer();
SerialPort serialCanPort = canBusSerial;
int channel = DrawerNo;
if (_portConfig.totalDrawerCount > 8)
{
if (DrawerNo % 2 == 0)
{
channel = DrawerNo / 2;
}
else
{
serialCanPort = canBusSerialTwo;
channel = (DrawerNo + 1) / 2;
}
}
byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + DrawerNo), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】");
canBusSerial.Write(buffer, 0, 8);
serialCanPort.DiscardInBuffer();
return await GetBufferByPort(canBusSerial, 13);
byte[] buffer = new byte[] { 0xaa, (byte)(0xf0 + channel), 0x01, 0x00, 0x00, 0x00, 0x00, 0xee };
logger.Info($"单支板发送库位数量查询【{string.Join(",", buffer)}】,调用串口{serialCanPort.PortName}");
serialCanPort.Write(buffer, 0, 8);
return await GetBufferByPort(serialCanPort, 13);
}
// 获取单个单支板药品数量
public async Task<byte[]> CheckQuantityByCol(int DrawerNo, int colNo)
@ -330,11 +405,24 @@ namespace MasaBlazorApp3.Port
// 以单支板为单位有药位置亮灯
public async Task HasLightOnByCol(int DrawerNo, int[] ColNos)
{
SerialPort serialPort = canBusSerial;
int channelDrawerNo = DrawerNo;
if (_portConfig.totalDrawerCount > 8)
{
if (DrawerNo % 2 == 0)
{
channelDrawerNo = DrawerNo / 2;
}
else
{
serialPort = canBusSerialTwo;
channelDrawerNo = (DrawerNo + 1) / 2;
}
}
for (int i = 0; i < ColNos.Length; i++)
{
var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xee };
canBusSerial.Write(buffer, 0, 8);
await Task.Delay(TimeSpan.FromMilliseconds(20));
@ -344,9 +432,23 @@ namespace MasaBlazorApp3.Port
// 以单支板为单位无药位置亮灯
public async Task NoLightOnByCol(int DrawerNo, int[] ColNos)
{
SerialPort serialPort = canBusSerial;
int channelDrawerNo = DrawerNo;
if (_portConfig.totalDrawerCount > 8)
{
if (DrawerNo % 2 == 0)
{
channelDrawerNo = DrawerNo / 2;
}
else
{
serialPort = canBusSerialTwo;
channelDrawerNo = (DrawerNo + 1) / 2;
}
}
for (int i = 0; i < ColNos.Length; i++)
{
var channel = Convert.ToInt32((DrawerNo * 10 + ColNos[i]).ToString(), 16);
var channel = Convert.ToInt32((channelDrawerNo * 10 + ColNos[i]).ToString(), 16);
byte[] buffer = new byte[] { 0xaa, (byte)channel, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xee };
canBusSerial.Write(buffer, 0, 8);
await Task.Delay(TimeSpan.FromMilliseconds(20));
@ -490,7 +592,7 @@ namespace MasaBlazorApp3.Port
private string trim(string text)
{
//此处使用了转义字符如:\',\",\\,分别表示单引号,双引号,反斜杠
char[] TrimChar = { ' ', '-', '\'', '\"', '\\','(', ')','', '', '①', '②' };
char[] TrimChar = { ' ', '-', '\'', '\"', '\\', '(', ')', '', '', '①', '②' };
return text.Trim(TrimChar);
}

View File

@ -0,0 +1,334 @@
{
"Version":"6.8.1.1",
"Font":{
"Name":"宋体",
"Size":105000,
"Weight":400,
"Charset":134
},
"Printer":{
"LeftMargin":0.3175,
"TopMargin":0.899583,
"RightMargin":0.396875
},
"DetailGrid":{
"CenterView":true,
"IsCrossTab":true,
"AppendBlankRow":true,
"Recordset":{
"Field":[
{
"Name":"手术间",
"DBFieldName":"DrawerNo"
},
{
"Name":"请领时间",
"DBFieldName":"TTime"
},
{
"Name":"二线",
"DBFieldName":"LineTwo"
},
{
"Name":"一线",
"DBFieldName":"LineOne"
},
{
"Name":"操作人",
"DBFieldName":"Nickname"
},
{
"Name":"时间",
"Type":"DateTime",
"Format":"yyyy年MM月dd日",
"DBFieldName":"operationTime"
},
{
"Name":"药品名称",
"DBFieldName":"DrugName"
},
{
"Name":"数量",
"DBFieldName":"quantity"
},
{
"Name":"批次",
"DBFieldName":"manuNo"
},
{
"Name":"效期",
"Type":"DateTime",
"Format":"yyyy/MM/dd",
"DBFieldName":"effDate"
},
{
"Name":"库位",
"DBFieldName":"drawerNo"
},
{
"Name":"colNo"
},
{
"Name":"type2",
"Type":"Integer",
"DBFieldName":"type"
},
{
"Name":"医生签名",
"DBFieldName":"Doctor"
},
{
"Name":"管理者签名",
"DBFieldName":"Manager"
}
]
},
"Column":[
{
"Name":"手术间",
"Width":0.978958
},
{
"Name":"请领时间",
"Width":2.19604
},
{
"Name":"二线",
"Width":2.01083
},
{
"Name":"一线",
"Width":1.98438
},
{
"Name":"药品名称",
"Width":3.81
},
{
"Name":"医生签名",
"Width":2.01083
},
{
"Name":"管理者签名",
"Width":1.61396
},
{
"Name":"数量",
"Width":1.19063
}
],
"ColumnContent":{
"Height":1.00542,
"ColumnContentCell":[
{
"Column":"手术间",
"TextAlign":"MiddleCenter",
"DataField":"操作人"
},
{
"Column":"请领时间",
"TextAlign":"MiddleCenter",
"DataField":"请领时间"
},
{
"Column":"二线",
"TextAlign":"MiddleCenter",
"DataField":"二线"
},
{
"Column":"一线",
"TextAlign":"MiddleCenter",
"DataField":"一线"
},
{
"Column":"药品名称",
"TextAlign":"MiddleCenter",
"DataField":"数量"
},
{
"Column":"医生签名",
"TextAlign":"MiddleCenter",
"DataField":"医生签名"
},
{
"Column":"管理者签名",
"TextAlign":"MiddleCenter",
"DataField":"管理者签名"
},
{
"Column":"数量",
"TextAlign":"MiddleCenter",
"DataField":"数量"
}
]
},
"ColumnTitle":{
"Height":1.79917,
"RepeatStyle":"OnPage",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"手术间",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"手\r\n术\r\n间"
},
{
"GroupTitle":false,
"Column":"请领时间",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"请领时间"
},
{
"GroupTitle":true,
"Name":"麻醉医生",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"二线",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"二线"
},
{
"GroupTitle":false,
"Column":"一线",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"一线"
}
],
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"麻醉医生"
},
{
"GroupTitle":false,
"Column":"药品名称",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"[#药品名称#]"
},
{
"GroupTitle":false,
"Column":"医生签名",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"医生\r\n签名"
},
{
"GroupTitle":false,
"Column":"管理者签名",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"管理者\r\n签名"
},
{
"GroupTitle":false,
"Column":"数量",
"Font":{
"Name":"宋体",
"Size":120000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"数量"
}
]
},
"CrossTab":{
"PercentFormat":"0.##%",
"HCrossFields":"药品名称",
"VCrossFields":"手术间",
"ListCols":4,
"TotalCols":3
}
},
"Parameter":[
{
"Name":"startDate",
"DataType":"DateTime",
"Format":"yyyy-MM-dd hh:mm:ss",
"Value":"2023/1/1"
},
{
"Name":"endDate",
"DataType":"DateTime",
"Format":"yyyy-MM-dd hh:mm:ss",
"Value":"2023/4/28 23:59:59"
},
{
"Name":"machine_id",
"Value":"DM1"
}
],
"ReportHeader":[
{
"Name":"ReportHeader1",
"Height":1.19063,
"Control":[
{
"Type":"MemoBox",
"Name":"MemoBox2",
"Anchor":"[Left|Top|Right|Bottom]",
"Dock":"Fill",
"Center":"Both",
"Border":{
"Styles":"[DrawLeft|DrawTop|DrawRight]"
},
"Font":{
"Name":"宋体",
"Size":217500,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"[#时间#]麻醉科毒麻药品请领登记表"
}
],
"RepeatOnPage":true
}
]
}

View File

@ -0,0 +1,275 @@
{
"Version":"6.8.1.1",
"Font":{
"Name":"宋体",
"Size":105000,
"Weight":400,
"Charset":134
},
"Printer":{
"Oriention":"Landscape",
"LeftMargin":1,
"TopMargin":1.42875,
"RightMargin":1,
"BottomMargin":1.8
},
"DetailGrid":{
"CenterView":true,
"IsCrossTab":true,
"FixCols":2,
"AppendBlankRow":true,
"Recordset":{
"Field":[
{
"Name":"日期",
"Type":"DateTime",
"Format":"yyyy年MM月dd日",
"DBFieldName":"Ddate"
},
{
"Name":"药品名称",
"DBFieldName":"DrugName"
},
{
"Name":"DrugId"
},
{
"Name":"时间",
"DBFieldName":"TDateTime"
},
{
"Name":"实物",
"DBFieldName":"Quantity"
},
{
"Name":"处方",
"DBFieldName":"OrderQuantity"
},
{
"Name":"备注",
"DBFieldName":"Remarks"
},
{
"Name":"交班人",
"DBFieldName":"FromUser"
},
{
"Name":"接班人",
"DBFieldName":"ToUser"
},
{
"Name":"规格",
"DBFieldName":"Spec"
},
{
"Name":"基数",
"DBFieldName":"BaseQuantity"
}
]
},
"Column":[
{
"Name":"日期"
},
{
"Name":"时间"
},
{
"Name":"实物"
},
{
"Name":"处方"
},
{
"Name":"备注"
},
{
"Name":"交班人"
},
{
"Name":"接班人"
}
],
"ColumnContent":{
"Height":0.79375,
"ColumnContentCell":[
{
"Column":"日期",
"TextAlign":"MiddleCenter",
"DataField":"日期"
},
{
"Column":"时间",
"TextAlign":"MiddleCenter",
"DataField":"时间"
},
{
"Column":"实物",
"TextAlign":"MiddleCenter",
"DataField":"实物"
},
{
"Column":"处方",
"TextAlign":"MiddleCenter",
"DataField":"处方"
},
{
"Column":"备注",
"TextAlign":"MiddleCenter",
"DataField":"备注"
},
{
"Column":"交班人",
"TextAlign":"MiddleCenter",
"DataField":"交班人"
},
{
"Column":"接班人",
"TextAlign":"MiddleCenter",
"DataField":"接班人"
}
]
},
"ColumnTitle":{
"Height":1.5875,
"RepeatStyle":"OnPage",
"ColumnTitleCell":[
{
"GroupTitle":true,
"Name":"药品名称",
"ColumnTitleCell":[
{
"GroupTitle":true,
"Name":"药品规格",
"ColumnTitleCell":[
{
"GroupTitle":true,
"Name":"固定基数",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"日期",
"TextAlign":"MiddleCenter",
"Text":"日期"
},
{
"GroupTitle":false,
"Column":"时间",
"TextAlign":"MiddleCenter",
"Text":"时间"
}
],
"TextAlign":"MiddleCenter",
"Text":"固定基数"
}
],
"TextAlign":"MiddleCenter",
"Text":"药品规格"
}
],
"TextAlign":"MiddleCenter",
"Text":"药品名称"
},
{
"GroupTitle":true,
"Name":"绑定的药名",
"ColumnTitleCell":[
{
"GroupTitle":true,
"Name":"规格",
"ColumnTitleCell":[
{
"GroupTitle":true,
"Name":"基数",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"实物",
"TextAlign":"MiddleCenter",
"Text":"实物"
},
{
"GroupTitle":false,
"Column":"处方",
"TextAlign":"MiddleCenter",
"Text":"处方"
}
],
"TextAlign":"MiddleCenter",
"Text":"[#规格#]"
}
],
"TextAlign":"MiddleCenter",
"Text":"[#规格#]"
}
],
"TextAlign":"MiddleCenter",
"Text":"[#药品名称#]"
},
{
"GroupTitle":false,
"Column":"备注",
"TextAlign":"MiddleCenter",
"Text":"备注"
},
{
"GroupTitle":false,
"Column":"交班人",
"TextAlign":"MiddleCenter",
"Text":"交班人"
},
{
"GroupTitle":false,
"Column":"接班人",
"TextAlign":"MiddleCenter",
"Text":"接班人"
}
]
},
"CrossTab":{
"PercentFormat":"0.##%",
"GroupAutoSum":false,
"HCrossFields":"DrugId",
"VCrossFields":"日期;时间",
"ListCols":2,
"TotalCols":3
}
},
"Parameter":[
{
"Name":"machine_id"
},
{
"Name":"startDate",
"DataType":"DateTime"
},
{
"Name":"endDate",
"DataType":"DateTime"
}
],
"ReportHeader":[
{
"Name":"ReportHeader1",
"Height":1.00542,
"Control":[
{
"Type":"MemoBox",
"Name":"MemoBox1",
"Dock":"Fill",
"Center":"Both",
"Font":{
"Name":"宋体",
"Size":217500,
"Bold":true,
"Charset":134
},
"ShrinkFontToFit":true,
"TextAlign":"MiddleCenter",
"Text":"中部战区总医院麻醉科特殊管理药品交接班记录"
}
],
"RepeatOnPage":true
}
]
}

View File

@ -0,0 +1,373 @@
{
"Version":"6.8.1.1",
"Font":{
"Name":"宋体",
"Size":105000,
"Weight":400,
"Charset":134
},
"Printer":{
"Oriention":"Landscape",
"LeftMargin":1,
"TopMargin":1.42875,
"RightMargin":1,
"BottomMargin":1.8
},
"DetailGrid":{
"CenterView":true,
"IsCrossTab":true,
"FixCols":2,
"AppendBlankRow":true,
"Recordset":{
"Field":[
{
"Name":"日期",
"Type":"DateTime",
"Format":"yyyy年MM月dd日",
"DBFieldName":"portdate"
},
{
"Name":"手术间",
"DBFieldName":"ShouShuJian"
},
{
"Name":"主麻",
"DBFieldName":"ZhuMa"
},
{
"Name":"副麻",
"DBFieldName":"FuMa"
},
{
"Name":"ID号",
"DBFieldName":"IDNumber"
},
{
"Name":"姓名",
"DBFieldName":"PName"
},
{
"Name":"诊断",
"DBFieldName":"Diagnose"
},
{
"Name":"药品名称",
"DBFieldName":"DrugName"
},
{
"Name":"批号",
"DBFieldName":"ManuNo"
},
{
"Name":"用量",
"DBFieldName":"UsageDosage"
},
{
"Name":"残液量",
"DBFieldName":"CanYeLiang"
},
{
"Name":"残液处置方式",
"DBFieldName":"CanYeChuZhi"
},
{
"Name":"使用人签名",
"DBFieldName":"UseUserName"
},
{
"Name":"复核人签名",
"DBFieldName":"CheckUserName"
},
{
"Name":"DrugId"
}
]
},
"Column":[
{
"Name":"手术间",
"Width":1.56104
},
{
"Name":"主麻",
"Width":1.82563
},
{
"Name":"副麻",
"Width":1.79917
},
{
"Name":"ID号"
},
{
"Name":"姓名",
"Width":1.79917
},
{
"Name":"诊断",
"Width":4.39208
},
{
"Name":"批号"
},
{
"Name":"用量",
"Width":2.2225
},
{
"Name":"残液量",
"Width":2.01083
},
{
"Name":"残液处置方式",
"Width":0.978958
},
{
"Name":"使用人签名",
"Width":1.61396
},
{
"Name":"复核人签名",
"Width":1.5875
}
],
"ColumnContent":{
"Height":0.79375,
"ColumnContentCell":[
{
"Column":"手术间",
"TextAlign":"MiddleCenter",
"DataField":"手术间"
},
{
"Column":"主麻",
"TextAlign":"MiddleCenter",
"DataField":"主麻"
},
{
"Column":"副麻",
"TextAlign":"MiddleCenter",
"DataField":"副麻"
},
{
"Column":"ID号",
"TextAlign":"MiddleCenter",
"DataField":"ID号"
},
{
"Column":"姓名",
"TextAlign":"MiddleCenter",
"DataField":"姓名"
},
{
"Column":"诊断",
"TextAlign":"MiddleCenter",
"DataField":"诊断"
},
{
"Column":"批号",
"TextAlign":"MiddleCenter",
"DataField":"批号"
},
{
"Column":"用量",
"TextAlign":"MiddleCenter",
"DataField":"用量"
},
{
"Column":"残液量",
"TextAlign":"MiddleCenter",
"DataField":"残液量"
},
{
"Column":"残液处置方式",
"TextAlign":"MiddleCenter",
"DataField":"残液处置方式"
},
{
"Column":"使用人签名",
"TextAlign":"MiddleCenter",
"DataField":"使用人签名"
},
{
"Column":"复核人签名",
"TextAlign":"MiddleCenter",
"DataField":"复核人签名"
}
]
},
"ColumnTitle":{
"Height":1.37583,
"RepeatStyle":"OnPage",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"手术间",
"TextAlign":"MiddleCenter",
"Text":"手\r\n术\r\n间"
},
{
"GroupTitle":true,
"Name":"麻醉医师",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"主麻",
"TextAlign":"MiddleCenter",
"Text":"主麻"
},
{
"GroupTitle":false,
"Column":"副麻",
"TextAlign":"MiddleCenter",
"Text":"副麻"
}
],
"TextAlign":"MiddleCenter",
"Text":"麻醉医师"
},
{
"GroupTitle":true,
"Name":"患者基本信息",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"ID号",
"TextAlign":"MiddleCenter",
"Text":"ID号"
},
{
"GroupTitle":false,
"Column":"姓名",
"TextAlign":"MiddleCenter",
"Text":"姓名"
},
{
"GroupTitle":false,
"Column":"诊断",
"TextAlign":"MiddleCenter",
"Text":"诊断"
}
],
"TextAlign":"MiddleCenter",
"Text":"患者基本信息"
},
{
"GroupTitle":true,
"Name":"药品名称",
"ColumnTitleCell":[
{
"GroupTitle":false,
"Column":"批号",
"TextAlign":"MiddleCenter",
"Text":"批号"
},
{
"GroupTitle":false,
"Column":"用量",
"TextAlign":"MiddleCenter",
"Text":"用量"
},
{
"GroupTitle":false,
"Column":"残液量",
"TextAlign":"MiddleCenter",
"Text":"残液量"
}
],
"TextAlign":"MiddleCenter",
"Text":"[#药品名称#]"
},
{
"GroupTitle":false,
"Column":"残液处置方式",
"TextAlign":"MiddleCenter",
"Text":"残液\r\n处置\r\n方式"
},
{
"GroupTitle":false,
"Column":"使用人签名",
"TextAlign":"MiddleCenter",
"Text":"使用人\r\n签名"
},
{
"GroupTitle":false,
"Column":"复核人签名",
"TextAlign":"MiddleCenter",
"Text":"复核人\r\n签名"
}
]
},
"CrossTab":{
"PercentFormat":"0.##%",
"GroupAutoSum":false,
"HCrossFields":"DrugId",
"VCrossFields":"ID号",
"ListCols":6,
"TotalCols":3
}
},
"Parameter":[
{
"Name":"machine_id"
},
{
"Name":"startDate",
"DataType":"DateTime"
},
{
"Name":"endDate",
"DataType":"DateTime"
}
],
"ReportHeader":[
{
"Name":"ReportHeader1",
"Height":3.81,
"Control":[
{
"Type":"MemoBox",
"Name":"MemoBox12",
"Anchor":"[Right|Bottom]",
"AlignColumnSide":"Right",
"Left":19.4469,
"Top":2.98979,
"Width":3.46604,
"Height":0.582083,
"ShrinkFontToFit":true,
"Text":"日期:[#日期#]"
},
{
"Type":"MemoBox",
"Name":"MemoBox1",
"Center":"Both",
"Left":2.93688,
"Top":1.00542,
"Width":21.8017,
"Height":1.79917,
"Font":{
"Name":"宋体",
"Size":217500,
"Bold":true,
"Charset":134
},
"ShrinkFontToFit":true,
"TextAlign":"MiddleCenter",
"Text":"中国人民解放军中部战区总医院手术患者麻醉药品使用登记本"
},
{
"Type":"MemoBox",
"Name":"MemoBox13",
"Anchor":"[Right|Bottom]",
"Left":23.2569,
"Top":3.01625,
"Width":3.01625,
"Height":0.582083,
"ShrinkFontToFit":true,
"Text":"手术室:武昌院区"
}
],
"RepeatOnPage":true
}
]
}

View File

@ -31,11 +31,6 @@
"Name":"批号",
"DBFieldName":"manuNo"
},
{
"Name":"上次批次结存",
"Type":"Integer",
"DBFieldName":"beforeManuQuan"
},
{
"Name":"入库数量",
"Type":"Integer",
@ -90,14 +85,6 @@
"Format":"yy/M/d",
"DBFieldName":"effDate"
},
{
"Name":"sign1",
"Type":"Binary"
},
{
"Name":"sign2",
"Type":"Binary"
},
{
"Name":"drugId"
},
@ -112,6 +99,10 @@
{
"Name":"领用部门",
"DBFieldName":"receiveDept"
},
{
"Name":"备注",
"DBFieldName":"Remarks"
}
]
},
@ -125,12 +116,7 @@
"Width":2.19604
},
{
"Name":"批号",
"Width":3.99521
},
{
"Name":"有效期",
"Width":2.43417
"Name":"供货单位"
},
{
"Name":"入库数量",
@ -141,11 +127,18 @@
"Width":1.79917
},
{
"Name":"Column4",
"Width":1.98438
"Name":"结存数量"
},
{
"Name":"收/发药人",
"Name":"批号",
"Width":3.99521
},
{
"Name":"有效期",
"Width":2.43417
},
{
"Name":"接收(发药人)",
"Width":2.80458
},
{
@ -153,12 +146,7 @@
"Width":2.80458
},
{
"Name":"Column2",
"Width":2.35479
},
{
"Name":"Column3",
"Width":2.38125
"Name":"备注"
}
],
"ColumnContent":{
@ -173,17 +161,13 @@
},
{
"Column":"凭证号",
"TextAlign":"MiddleCenter",
"DataField":"凭证号"
},
{
"Column":"批号",
"Column":"供货单位",
"TextAlign":"MiddleCenter",
"DataField":"批号"
},
{
"Column":"有效期",
"TextAlign":"MiddleCenter",
"DataField":"有效期"
"DataField":"供应单位"
},
{
"Column":"入库数量",
@ -196,12 +180,22 @@
"DataField":"出库数量"
},
{
"Column":"Column4",
"Column":"结存数量",
"TextAlign":"MiddleCenter",
"DataField":"结存"
"DataField":"批号结存"
},
{
"Column":"收/发药人",
"Column":"批号",
"TextAlign":"MiddleCenter",
"DataField":"批号"
},
{
"Column":"有效期",
"TextAlign":"MiddleCenter",
"DataField":"有效期"
},
{
"Column":"接收(发药人)",
"FreeCell":true,
"Control":[
{
@ -227,30 +221,9 @@
]
},
{
"Column":"Column2",
"FreeCell":true,
"Control":[
{
"Type":"FieldBox",
"Name":"FieldBox14",
"Dock":"Fill",
"TextAlign":"MiddleCenter",
"DataField":"供应单位"
}
]
},
{
"Column":"Column3",
"FreeCell":true,
"Control":[
{
"Type":"FieldBox",
"Name":"FieldBox15",
"Dock":"Fill",
"TextAlign":"MiddleCenter",
"DataField":"领用部门"
}
]
"Column":"备注",
"TextAlign":"MiddleCenter",
"DataField":"备注"
}
]
},
@ -282,6 +255,54 @@
"TextAlign":"MiddleCenter",
"Text":"凭证号"
},
{
"GroupTitle":false,
"Column":"供货单位",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"供货单位\r\n领用部门"
},
{
"GroupTitle":false,
"Column":"入库数量",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"入库\r\n数量"
},
{
"GroupTitle":false,
"Column":"出库数量",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"出库\r\n数量"
},
{
"GroupTitle":false,
"Column":"结存数量",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"结存数量"
},
{
"GroupTitle":false,
"Column":"批号",
@ -308,7 +329,7 @@
},
{
"GroupTitle":false,
"Column":"入库数量",
"Column":"接收(发药人)",
"Font":{
"Name":"宋体",
"Size":105000,
@ -316,43 +337,7 @@
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"入库\r\n数量"
},
{
"GroupTitle":false,
"Column":"出库数量",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"发出\r\n数量"
},
{
"GroupTitle":false,
"Column":"Column4",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"总结存"
},
{
"GroupTitle":false,
"Column":"收/发药人",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"发药人"
"Text":"接收人\r\n发药人"
},
{
"GroupTitle":false,
@ -368,7 +353,7 @@
},
{
"GroupTitle":false,
"Column":"Column2",
"Column":"备注",
"Font":{
"Name":"宋体",
"Size":105000,
@ -376,19 +361,7 @@
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"供应单位"
},
{
"GroupTitle":false,
"Column":"Column3",
"Font":{
"Name":"宋体",
"Size":105000,
"Bold":true,
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"领用部门"
"Text":"备注"
}
]
},
@ -400,15 +373,6 @@
"PrintGridBorder":false,
"RepeatOnPage":true,
"Control":[
{
"Type":"StaticBox",
"Name":"StaticBox15",
"Left":28.3898,
"Top":0.238125,
"Width":2.01083,
"Height":0.79375,
"Text":"生产厂家:"
},
{
"Type":"MemoBox",
"Name":"MemoBox11",
@ -430,7 +394,7 @@
"Bold":true,
"Charset":134
},
"Text":"品名:"
"Text":"品名"
},
{
"Type":"FieldBox",
@ -550,7 +514,7 @@
"Bold":true,
"Charset":134
},
"Text":"生产厂家"
"Text":"生产企业"
},
{
"Type":"FieldBox",
@ -606,7 +570,7 @@
"Charset":134
},
"TextAlign":"MiddleCenter",
"Text":"麻醉、精神药品逐笔专用账册"
"Text":"中部战区总医院麻醉药品、第一类精神药品进出专用账册"
}
],
"RepeatOnPage":true

View File

@ -5,19 +5,21 @@
@inherits LayoutComponentBase
<style>
.my-tab-menu{
padding: 10px 20px;
.my-tab-menu {
padding: 10px 20px;
flex-shrink: 0;
}
.my-tab-menu:hover{
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); /* 阴影效果 */
text-decoration: none !important;
background: #255dd6;
border-radius: 20px;
}
.my-tab-menu:hover {
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); /* 阴影效果 */
text-decoration: none !important;
background: #255dd6;
border-radius: 20px;
}
a.active {
background: #255dd4;
border-radius: 20px;
background: #255dd4;
border-radius: 20px;
}
</style>
@ -25,25 +27,50 @@
<RadzenLayout>
<RadzenHeader Style="height: 75px;">
<RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Style="height: 100%;">
<RadzenColumn Size="2">
<RadzenColumn Size="1">
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
<RadzenIcon Icon="chevron_left" Style="font-size:3rem;cursor: pointer;padding: 0 10px;" @onclick="@(() => { backHome(); })" />
</RadzenStack>
</RadzenColumn>
<RadzenColumn Size="8" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End">
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
@foreach (Premission p in children)
{
if (childrenIds.Any(id => id == p.Id))
<RadzenColumn Size="10" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Start">
@if (children.Count > 5)
{
<RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center">
@foreach (Premission p in children)
{
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
if (childrenIds.Any(id => id == p.Id))
{
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
}
}
}
</RadzenStack>
@if (children.Any(c => c.PremissionPath.Contains("Box")))
{
<RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
}
</RadzenStack>
}
else
{
<RadzenStack Style="width: 100%; overflow-x: auto; white-space: nowrap; display: flex;" Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center">
@foreach (Premission p in children)
{
if (childrenIds.Any(id => id == p.Id))
{
<RadzenLink Match="NavLinkMatch.All" class="my-tab-menu" Path="@p.PremissionPath">@p.PremissionName</RadzenLink>
}
}
@if (children.Any(c => c.PremissionPath.Contains("Box")))
{
<RadzenIcon Icon="card_travel" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { OpenStorage(); })" />
}
</RadzenStack>
}
</RadzenColumn>
<RadzenColumn Size="2">
<RadzenColumn Size="1">
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center">
@* <RadzenText TextAlign="TextAlign.Center" class="rz-color-white">退出</RadzenText> *@
<RadzenIcon Icon="exit_to_app" Style="font-size:2rem;cursor: pointer;" class="rz-ripple" IconColor="white" @onclick="@(() => { logout(); })" />
</RadzenStack>
</RadzenColumn>
@ -70,6 +97,7 @@
List<Premission> children;
@inject Microsoft.Extensions.Options.IOptions<Pojo.Config.SettingConfig> setting;
@inject PortUtil _portUtil;
@inject NotificationService _message
private readonly ILog logger = LogManager.GetLogger(typeof(MainLayout));
bool currentPage = true;
@ -80,19 +108,19 @@
Operator = globalStateService.Operator;
Premission parent = new Premission().getAdminPremission().Find(p => p.PremissionPath == s[3]);
childrenIds = Operator.role.permissionIds.Where(id => id - (parent .Id* 10) < 10).ToList();
childrenIds = Operator.role.permissionIds.Where(id => id - (parent.Id * 10) < 10).ToList();
children = parent.Items.ToList();
if(setting.Value.autoOutLog>0)
if (setting.Value.autoOutLog > 0)
{
// 是否需要自动退出
var promiseUtil = new PromiseUtil<object>();
promiseUtil.taskAsyncLoop(500, null, async (data, next, stop) =>
{
if (globalStateService.Operator == null||!currentPage)
if (globalStateService.Operator == null || !currentPage)
{
logger.Info($"MainLayout页自动退出循环停止{globalStateService.Operator==null},{!currentPage}");
logger.Info($"MainLayout页自动退出循环停止{globalStateService.Operator == null},{!currentPage}");
stop();
}
else
@ -100,10 +128,10 @@
try
{
//没有在操作抽屉
if(!_portUtil.Operate)
if (!_portUtil.Operate)
{
// 无人操作鼠标键盘
if((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog)
{
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}");
globalStateService.Operator = null;
@ -149,6 +177,20 @@
globalStateService.Reviewer = null;
na.NavigateTo("");
}
async Task OpenStorage()
{
try
{
var b = await _portUtil.OpenStorage();
}
catch (Exception ex)
{
logger.Info($"开储物箱发生错误,{ex.Message}");
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"开储物箱发生错误,{ex.Message}", Duration = 4000 }
);
}
}
}
@code

View File

@ -1,5 +1,5 @@
{
"connectionStrings": "server=127.0.0.1;port=3306;database=hkcdb;userid=root;password=qq1223;Charset=utf8mb4;",
"connectionStrings": "server=127.0.0.1;port=3306;database=zhongbuzhanqu;userid=root;password=qq1223;Charset=utf8mb4;",
"finger": {
"ip": "192.168.50.59",
"port": 4370,
@ -7,7 +7,10 @@
},
"setting": {
"machineId": "DM1",
"storage": 1,
//,
//. 07010323 8
// "07010363" "麻醉科 16个抽屉",
"storage": "07010323",
"loginMode": 1,
"opFirst": true,
//退,0退
@ -18,15 +21,19 @@
"drawerPortPath": "COM2",
"drawerProtocol": 485,
"scanCodePortPath": "COM1",
"canBusPortPath": "COM31",
"canBusExsit": true,
"canBusPortPath": "COM5",
"totalDrawerCount": 16,
"canBusTwoExsit": true,
//can线
"canBusPortPathTwo": "COM31",
"doorAddr": 0,
"storageBoxAddr": 0,
"fridgePortExist": false,
"fridgePortPath": "COM3"
},
"drawer": {
"single": [ 3 ],
"single": [ 1 ],
"weigh": [ 4 ],
"box": [ 4 ],
"label": [ 4 ]

50
sql/account_book.sql Normal file
View File

@ -0,0 +1,50 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 25/08/2025 17:06:04
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account_book
-- ----------------------------
DROP TABLE IF EXISTS `account_book`;
CREATE TABLE `account_book` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`operator` int(11) NULL DEFAULT NULL COMMENT '操作人',
`reviewer` int(11) NULL DEFAULT NULL COMMENT '审核人',
`date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
`drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品id',
`eff_date` date NULL DEFAULT NULL COMMENT '效期',
`manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
`invoice_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号',
`manu_quantity` int(11) NULL DEFAULT NULL COMMENT '批次数量',
`total_quantity` int(11) NULL DEFAULT NULL COMMENT '药品总数量',
`opera_quantity` int(11) NULL DEFAULT NULL COMMENT '操作数量',
`type` int(2) NULL DEFAULT NULL COMMENT '操作类型1入库2出库3还药4盘点',
`machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
`insert_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`add_quantity` int(11) NULL DEFAULT NULL COMMENT '数量',
`out_quantity` int(11) NULL DEFAULT NULL COMMENT '出库数量',
`create_time` datetime NULL DEFAULT NULL,
`yesterday_quantity` int(11) NULL DEFAULT NULL,
`manu_stock` int(11) NULL DEFAULT NULL COMMENT '抽屉号',
`total_stock` int(11) NULL DEFAULT NULL,
`department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '取药科室',
`create_date` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

47
sql/account_book_g2.sql Normal file
View File

@ -0,0 +1,47 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : hkcdb
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 26/08/2025 14:39:02
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for account_book_g2
-- ----------------------------
DROP TABLE IF EXISTS `account_book_g2`;
CREATE TABLE `account_book_g2` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`drug_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`type` int(1) NULL DEFAULT 1 COMMENT '1领入2发出3日结4总结5转结',
`department` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '科室',
`invoice_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备内记录凭证',
`order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处方号或凭证号',
`manu_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次',
`eff_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '效期',
`yesterday_quantity` int(11) NULL DEFAULT NULL COMMENT '上日结存',
`add_quantity` int(11) NULL DEFAULT NULL COMMENT '收入',
`out_quantity` int(11) NULL DEFAULT NULL COMMENT '发出',
`manu_stock` int(11) NULL DEFAULT NULL COMMENT '批次结存',
`total_stock` int(11) NULL DEFAULT NULL COMMENT '总结村',
`user_id1` int(11) NULL DEFAULT NULL COMMENT '发药领药人id',
`user_id2` int(11) NULL DEFAULT NULL COMMENT '复核人id',
`machine_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备id',
`create_date` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期',
`create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '插入更新时间',
`shoushuJian` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手术间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 33034 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

59
sql/hkc_changeshifts.sql Normal file
View File

@ -0,0 +1,59 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 25/08/2025 17:05:17
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for hkc_changeshifts
-- ----------------------------
DROP TABLE IF EXISTS `hkc_changeshifts`;
CREATE TABLE `hkc_changeshifts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`optDate` datetime NULL DEFAULT NULL COMMENT '操作时间',
`FromOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班操作人',
`FromRviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交班审核人',
`ToOperator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班操作人',
`ToReviewer` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '接班审核人',
`ToDate` datetime NULL DEFAULT NULL COMMENT '接班时间',
`State` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '当班状态0当前值班1已交班',
`optState` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作状态0新增1修改',
`machine_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`Remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE,
INDEX `index_optdate`(`optDate`) USING BTREE,
INDEX `index_fromOperator`(`FromOperator`) USING BTREE,
INDEX `index_fromReviewer`(`FromRviewer`) USING BTREE,
INDEX `index_ToDate`(`ToDate`) USING BTREE,
INDEX `index_toOperator`(`ToOperator`) USING BTREE,
INDEX `index_toreviewer`(`ToReviewer`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of hkc_changeshifts
-- ----------------------------
INSERT INTO `hkc_changeshifts` VALUES (1, '2025-06-30 14:36:25', 'admin', NULL, '', NULL, '2025-07-01 09:21:57', '1', '0', 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (2, '2025-07-01 09:21:32', 'admin', NULL, NULL, NULL, '2025-07-01 09:30:17', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (3, '2025-07-01 09:29:57', 'test3', NULL, NULL, NULL, '2025-07-01 09:36:06', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (4, '2025-07-01 09:36:06', 'admin', NULL, NULL, NULL, '2025-07-01 09:39:27', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (5, '2025-07-01 09:39:27', 'test3', NULL, 'admin', NULL, '2025-07-01 10:26:19', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (6, '2025-07-01 10:26:19', 'admin', NULL, 'test3', NULL, '2025-08-15 10:12:01', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (7, '2025-08-15 10:12:01', 'test3', NULL, 'admin', NULL, '2025-08-15 10:21:54', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (8, '2025-08-15 10:21:54', 'admin', NULL, 'test3', NULL, '2025-08-16 16:38:35', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (9, '2025-08-16 16:38:35', 'test3', NULL, 'admin', NULL, '2025-08-16 18:37:06', '1', NULL, 'DM1', NULL);
INSERT INTO `hkc_changeshifts` VALUES (23, '2025-08-16 18:37:06', 'admin', NULL, NULL, NULL, '2025-08-16 18:37:06', '0', NULL, 'DM1', '备注');
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -0,0 +1,37 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 25/08/2025 17:05:31
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for hkc_changeshifts_drug
-- ----------------------------
DROP TABLE IF EXISTS `hkc_changeshifts_drug`;
CREATE TABLE `hkc_changeshifts_drug` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`changeShifts_id` int(11) NULL DEFAULT NULL COMMENT '交接班表主键',
`drug_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`RealNumber` int(11) NULL DEFAULT NULL COMMENT '实物数',
`orderNumber` int(11) NULL DEFAULT NULL COMMENT '处方数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of hkc_changeshifts_drug
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

37
sql/plan.sql Normal file
View File

@ -0,0 +1,37 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 25/08/2025 17:04:19
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for plan
-- ----------------------------
DROP TABLE IF EXISTS `plan`;
CREATE TABLE `plan` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '套餐名',
`Description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '套餐描述',
`AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
`useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
`operatorUser` int(11) NULL DEFAULT NULL COMMENT '操作人',
`reviewerUser` int(11) NULL DEFAULT NULL COMMENT '审核人',
`updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`machine_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

37
sql/plan_details.sql Normal file
View File

@ -0,0 +1,37 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 25/08/2025 17:04:29
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for plan_details
-- ----------------------------
DROP TABLE IF EXISTS `plan_details`;
CREATE TABLE `plan_details` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Plan_Id` int(11) NULL DEFAULT NULL COMMENT '外键',
`Base_Quantity` int(11) NULL DEFAULT NULL COMMENT '基数',
`Drug_Id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药品ID',
`AddTime` datetime NULL DEFAULT CURRENT_TIMESTAMP,
`useState` int(11) NULL DEFAULT 1 COMMENT '可用状态',
`operatorUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作人',
`reviewerUser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核人',
`updateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 146 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

42
sql/settingmanu.sql Normal file
View File

@ -0,0 +1,42 @@
/*
Navicat MySQL Data Transfer
Source Server :
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : hkcdb
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 26/08/2025 09:01:46
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for settingmanu
-- ----------------------------
DROP TABLE IF EXISTS `settingmanu`;
CREATE TABLE `settingmanu` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Manu_Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单名',
`Manu_Icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单图标',
`Path` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '菜单页面地址',
`Culture` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '中文zh-CN;英文en',
`UseStatus` int(11) NULL DEFAULT NULL COMMENT '可用状态0不用1在用',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of settingmanu
-- ----------------------------
INSERT INTO `settingmanu` VALUES (1, '登录设置', 'lock', '/manage/setting/login', 'zh-CN', 1);
INSERT INTO `settingmanu` VALUES (2, '冰箱设置', 'build', '/manage/setting/Fridge', 'zh-CN', 0);
INSERT INTO `settingmanu` VALUES (3, 'Login Setting', 'lock', '/manage/setting/login', 'en', 0);
INSERT INTO `settingmanu` VALUES (4, 'Fridge Setting', 'build', '/manage/setting/Fridge', 'en', 0);
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -0,0 +1,234 @@
1修改Role表里对应的角色permissions字段值
UPDATE `role` set permissions='11,12,13,14,23,24,32,33,34,40,41,42,43,44,50,51,52,53,21,35,45,61,62,63,66,46,47,36,37,48,49,15' WHERE machine_id='DM1'
2chan_stock表
DELETE from channel_stock where machine_id='DM1'
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_1','DM1',1,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_2','DM1',1,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_3','DM1',1,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_4','DM1',1,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_5','DM1',1,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_6','DM1',1,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_7','DM1',1,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_8','DM1',1,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_9','DM1',1,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_10','DM1',2,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_11','DM1',2,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_12','DM1',2,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_13','DM1',2,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_14','DM1',2,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_15','DM1',2,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_16','DM1',2,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_17','DM1',2,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_18','DM1',2,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_19','DM1',3,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_20','DM1',3,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_21','DM1',3,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_22','DM1',3,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_23','DM1',3,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_24','DM1',3,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_25','DM1',3,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_26','DM1',3,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_27','DM1',3,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_28','DM1',4,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_29','DM1',4,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_30','DM1',4,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_31','DM1',4,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_32','DM1',4,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_33','DM1',4,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_34','DM1',4,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_35','DM1',4,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_36','DM1',4,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_37','DM1',5,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_38','DM1',5,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_39','DM1',5,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_40','DM1',5,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_41','DM1',5,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_42','DM1',5,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_43','DM1',5,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_44','DM1',5,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_45','DM1',5,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_46','DM1',6,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_47','DM1',6,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_48','DM1',6,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_49','DM1',6,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_50','DM1',6,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_51','DM1',6,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_52','DM1',6,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_53','DM1',6,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_54','DM1',6,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_55','DM1',7,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_56','DM1',7,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_57','DM1',7,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_58','DM1',7,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_59','DM1',7,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_60','DM1',7,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_61','DM1',7,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_62','DM1',7,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_63','DM1',7,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_64','DM1',8,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_65','DM1',8,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_66','DM1',8,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_67','DM1',8,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_68','DM1',8,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_69','DM1',8,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_70','DM1',8,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_71','DM1',8,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_72','DM1',8,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_73','DM1',9,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_74','DM1',9,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_75','DM1',9,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_76','DM1',9,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_77','DM1',9,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_78','DM1',9,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_79','DM1',9,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_80','DM1',9,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_81','DM1',9,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_82','DM1',10,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_83','DM1',10,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_84','DM1',10,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_85','DM1',10,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_86','DM1',10,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_87','DM1',10,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_88','DM1',10,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_89','DM1',10,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_90','DM1',10,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_91','DM1',11,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_92','DM1',11,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_93','DM1',11,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_94','DM1',11,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_95','DM1',11,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_96','DM1',11,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_97','DM1',11,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_98','DM1',11,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_99','DM1',11,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_100','DM1',12,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_101','DM1',12,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_102','DM1',12,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_103','DM1',12,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_104','DM1',12,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_105','DM1',12,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_106','DM1',12,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_107','DM1',12,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_108','DM1',12,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_109','DM1',13,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_110','DM1',13,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_111','DM1',13,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_112','DM1',13,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_113','DM1',13,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_114','DM1',13,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_115','DM1',13,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_116','DM1',13,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_117','DM1',13,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_118','DM1',14,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_119','DM1',14,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_120','DM1',14,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_121','DM1',14,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_122','DM1',14,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_123','DM1',14,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_124','DM1',14,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_125','DM1',14,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_126','DM1',14,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_127','DM1',15,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_128','DM1',15,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_129','DM1',15,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_130','DM1',15,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_131','DM1',15,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_132','DM1',15,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_133','DM1',15,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_134','DM1',15,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_135','DM1',15,9);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_136','DM1',16,1);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_137','DM1',16,2);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_138','DM1',16,3);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_139','DM1',16,4);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_140','DM1',16,5);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_141','DM1',16,6);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_142','DM1',16,7);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_143','DM1',16,8);
INSERT into channel_stock(chsguid,machine_id,row_no,col_no) VALUES('DM_CHANNEL_144','DM1',16,9);
UPDATE channel_stock set board_type=2 where machine_id='DM1' and row_no<12;
UPDATE channel_stock set drawer_type=2 WHERE machine_id='DM1' and row_no<12 and row_no%2=0
delete from channel_list where machine_id='DM5';
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_1','DM5',1);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_2','DM5',2);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_3','DM5',3);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_4','DM5',4);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_5','DM5',5);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_6','DM5',6);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_7','DM5',7);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_8','DM5',8);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_9','DM5',9);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_10','DM5',10);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_11','DM5',11);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_12','DM5',12);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_13','DM5',13);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_14','DM5',14);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_15','DM5',15);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_16','DM5',16);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_17','DM5',17);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_18','DM5',18);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_19','DM5',19);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_20','DM5',20);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_21','DM5',21);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_22','DM5',22);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_23','DM5',23);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_24','DM5',24);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_25','DM5',25);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_26','DM5',26);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_27','DM5',27);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_28','DM5',28);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_29','DM5',29);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_30','DM5',30);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_31','DM5',31);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_32','DM5',32);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_33','DM5',33);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_34','DM5',34);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_35','DM5',35);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_36','DM5',36);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_37','DM5',37);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_38','DM5',38);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_39','DM5',39);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_40','DM5',40);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_41','DM5',41);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_42','DM5',42);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_43','DM5',43);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_44','DM5',44);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_45','DM5',45);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_46','DM5',46);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_47','DM5',47);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_48','DM5',48);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_49','DM5',49);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_50','DM5',50);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_51','DM5',51);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_52','DM5',52);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_53','DM5',53);
INSERT into channel_list(chnguid,machine_id,row_no) values('DM5_CHANNEL_54','DM5',54);
3修改drug_manu_no表中eff_date字段长度为20
4account_book表添加字段
add_quantity int 11 0 True False False 0 数量 0 False False False False False False
out_quantity int 11 0 True False False 0 出库数量 0 False False False False False False
create_time datetime 0 0 True False False 0 0 False False False False False False
yesterday_quantity int 11 0 True False False 0 0 False False False False False False
manu_stock int 11 0 True False False 0 抽屉号 0 False False False False False False
total_stock int 11 0 True False False 0 0 False False False False False False
department varchar 255 0 True False False 0 取药科室 utf8mb4 utf8mb4_general_ci 0 False False False False False False
create_date datetime 0 0 True False False 0 0 False False False False False False
5)dm_machine_record表添加字段
stock_quantity float 0 0 True False False 0 操作后的库存 0 False False False False False False
check_quantity float 0 0 True False False 0 盘点库存 0 False False False False False False
manunoQuantity float 0 0 True False False 0 批号库存 0 False False False False False False
6hkc_order_finish表添加字段
operator varchar 50 0 True False False 0