中部战区修改更新

This commit is contained in:
马巧 2025-08-27 08:38:00 +08:00
parent aafa20f7af
commit ba687a1dd0
30 changed files with 723 additions and 316 deletions

View File

@ -28,6 +28,8 @@ namespace MasaBlazorApp3.DataAccess.Dao
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);
//核对处方

View File

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

View File

@ -1124,11 +1124,6 @@ namespace MasaBlazorApp3.DataAccess.Impl
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 totalQuantity= boxChannelList.TotalQuantity+ boxTakeVo.GetQuantity;
int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id)
.Set(cl => cl.TotalQuantity, totalQuantity)
.Update();
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)
{
@ -1146,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
@ -1849,7 +1848,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
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)
//.Where(cl=>cl.Quantity<=0)
.OrderBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.DrawerNo)
.ThenBy((cl) => cl.ColNo)

View File

@ -1,4 +1,5 @@
using LinqToDB;
using Google.Protobuf;
using LinqToDB;
using LinqToDB.SqlQuery;
using log4net;
using log4net.Util;
@ -10,6 +11,7 @@ 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;
@ -29,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)
@ -596,7 +599,8 @@ namespace MasaBlazorApp3.DataAccess.Impl
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
from od in query2.InnerJoin(od => od.Key == oi.OrderNo)
where oi.Pharmacy == _setting.storage
select oi;
if (!String.IsNullOrEmpty(OrderrNo))
{
@ -615,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)
@ -625,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();
}
}
//}
}
}
@ -683,6 +694,70 @@ 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>
@ -710,201 +785,208 @@ namespace MasaBlazorApp3.DataAccess.Impl
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).FirstOrDefault();
List<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).OrderBy(cs => cs.EffDate).ToList();
if (cs.Count <= 0)
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}在{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;
}
int csQuantity = cs.Sum(cs => cs.Quantity);
if (csQuantity < oi.DetailList[j].Quantity)
else
{
logger.Info($"处方{oi.OrderNo}中药品{oi.DetailList[j].DrugId}在{drawerNo}号库存不足,需要核对数{oi.DetailList[j].Quantity},库存总数{csQuantity}");
continue;
oi.DetailInfo.Quantity = oi.DetailInfo.Quantity - cs[k].Quantity;
useQuantity = cs[k].Quantity;
cs[k].Quantity = 0;
}
//更新处方状态
if (oi.Status == 0)
{
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 = 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.DetailList[j].Quantity)
{
cs[k].Quantity = cs[k].Quantity - oi.DetailList[j].Quantity;
Break = 1;//药品够取跳出循环
useQuantity = oi.DetailList[j].Quantity;
}
else
{
oi.DetailList[j].Quantity = oi.DetailList[j].Quantity - cs[k].Quantity;
useQuantity = cs[k].Quantity;
cs[k].Quantity = 0;
}
//cs.NeedNum = cs.NeedNum > 0 ? cs.NeedNum + oi._OrderDetail.Quantity : oi._OrderDetail.Quantity;
logger.Info($"更新药盒{cs[k].DrawerNo}药品{cs[k].DrugId}批次{cs[k].ManuNo}库存为{oldQuantity},处方用药数量为{oi.DetailList[j].Quantity}");
// 更新数据 库存信息
_connection.Update(cs[k]);
//cs.NeedNum = cs.NeedNum > 0 ? cs.NeedNum + oi._OrderDetail.Quantity : oi._OrderDetail.Quantity;
logger.Info($"更新药盒{cs[k].DrawerNo}药品{cs[k].DrugId}批次{cs[k].ManuNo}库存为{oldQuantity},处方用药数量为{oi.DetailInfo.Quantity}");
// 更新数据 库存信息
_connection.Update(cs[k]);
//更新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[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();
_connection.Insert(new MachineRecord()
{
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)
});
//更新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[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();
_connection.Insert(new MachineRecord()
{
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[k].ManuNo).OrderByDescending(ab => ab.Id).FirstOrDefault();
//保存账册
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,
DrugId = oi.DetailInfo.DrugId,
Type = 3,
ManuNo = cs[k].ManuNo,
EffDate = cs[k].EffDate,
OutQuantity = useQuantity,// oi.DetailList[j].Quantity,
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[k].ManuNo)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
if (accountBookG2Day != null)
if (iDayResult <= 0)
{
accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - useQuantity;// 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} ";
}
else
}
//修改凌晨生成的日结存与总结存数据
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()
{
//生成日结存时可能没有该库位的绑定信息,需要写入日结存
int iDayResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailList[j].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"),
InvoiceNo = "日结存"
});
if (iDayResult <= 0)
{
logger.Info($"未写入日结存数据{oi.DetailList[j].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.DetailList[j].DrugId)
.Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).FirstOrDefault();
if (accountBookG2Total != null)
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)
{
accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - useQuantity;// oi.DetailList[j].Quantity;
_connection.Update(accountBookG2Total);
}
else
{
//生成总结存时可能没有该库位的绑定信息,需要写入总结存
int iTotalResult = _connection.Insert(new AccountBookG2()
{
DrugId = oi.DetailList[j].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.DetailList[j].DrugId}-{useQuantity}");
}
logger.Info($"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity}");
empChannelStock += $"未写入总结存数据{oi.DetailInfo.DrugId}-{useQuantity} ";
}
}
}
}
}
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();

View File

@ -119,7 +119,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
plan.OperatorUser = _globalStateService.Operator.Id;
plan.ReviewerUser = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id;
plan.UseState = 1;
plan.MachineId = _setting.machineId;
plan.MachineId = _setting.boxMachineId;
if(_connection.InsertWithInt32Identity(plan) > 0)
{
//保存操作记录

View File

@ -104,7 +104,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
};
}
//手术室患者麻醉药品使用登记本
public async Task<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime searchDate)
public async Task<PageData<ReportUsageDateInfo>> GetOrderInfoData(DateTime? searchDate)
{
List<ReportUsageDateInfo> accountList = new List<ReportUsageDateInfo>();
int pagedData = 0;
@ -112,7 +112,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
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";
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";
@ -149,7 +149,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
var reportList = _connection.FromSql<ReportApplyInfo>(SQL);
if (reportList != null)
if (reportList != null&& reportList.Count()>0)
{
foreach (var report in reportList)
{

View File

@ -41,7 +41,7 @@
.my-popup {
display: none;
/* position:absolute; */
position:absolute;
overflow: hidden;
/* height: 360px;
width: 600px; */
@ -66,7 +66,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 JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">

View File

@ -11,8 +11,8 @@
foreach (var item in BoxList)
{
<div class="col-2">
<RadzenCheckBox 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="CheckBox1" />
<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>
}
}
@ -91,7 +91,7 @@
if (bindList == null || bindList.Count <= 0)
{
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请先选择药箱号再点击按钮", Duration = 4000 }
);
return;
}
@ -157,6 +157,8 @@
_message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"该药盒下的药品仍有库存,请清库存后再操作", Duration = 4000 }
);
BoxList.ForEach(it => it.IsChecked = false);
firstFlag = 0;
return;
}
else

View File

@ -3,7 +3,7 @@
<RadzenStack Orientation="Orientation.Horizontal" class="col-12 mb-4">
<div class="col-2 row justify-content-center align-items-center text-center" >
<div class="row justify-content-around align-items-center" style="height:450px;overflow:auto">
<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)" />
@ -12,7 +12,7 @@
</div>
</div>
<div class="col-10">
<RadzenDataList @ref="grid" LoadData="@LoadData" WrapItems="true" Count="@count" IsLoading="@isLoading"
<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">

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,9 +1,24 @@
@page "/Box/Check"
@using MasaBlazorApp3.Pojo.Config
@using MasaBlazorApp3.Report
@using Radzen.Blazor.Rendering
<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">
<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)
{
@ -12,54 +27,87 @@
}
</div>
</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:450px;overflow:auto">
@* <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-10">
</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" AllowClear @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>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
<RadzenButton Icon="download" Text="麻醉药品使用登记本导出" Variant="Variant.Outlined" Click="StockExport" />
</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">
@ -76,15 +124,15 @@
<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>
}
OrderDetail orderDetail = DetailList.DetailList[i]; *@
@* <RadzenText TextStyle="TextStyle.Subtitle2" class="rz-mb-0">@DetailInfo.Drug.DrugName</RadzenText>
}
</Template>
</RadzenDataGridColumn>
</RadzenDataGridColumn>*@
@* <RadzenDataGridColumn Property="Detail.SetManuNo" Title="药品批次" Sortable="false" Filterable="false" Width="8rem">
<Template Context="DetailList">
@for (int i = 0; i < DetailList.DetailList.Count; i++)
@ -94,15 +142,60 @@
}
</Template>
</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 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="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>
@ -118,22 +211,29 @@
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 = DateTime.Now;
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()
{
@ -141,15 +241,35 @@
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()
{
bool bResult = await 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
@ -159,20 +279,62 @@
);
}
}
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()

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

@ -37,7 +37,7 @@
<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" />
@ -56,7 +56,7 @@
</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>
@ -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>
@ -148,7 +148,6 @@
List<DrugInfo> drugInfos;
async Task LoadData(LoadDataArgs args)
{
isLoading = true;
@ -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,8 +23,8 @@
<RadzenLabel Text="处方时间" Component="OrderDate" />
</RadzenColumn>
<RadzenColumn Size="8">
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" CurrentDateChanged="@OnCurrentDateChanged"
ShowTime="true" ShowSeconds="true"
<RadzenDatePicker DateFormat="yyyy-MM-dd" CurrentDateChanged="@OnCurrentDateChanged"
ShowSeconds="true"
@bind-Value="orderInfo.ChargeDate" Style="width: 100%;" Name="OrderDate" />
<RadzenRequiredValidator Text="请输入处方时间" Component="OrderDate" />
</RadzenColumn>

View File

@ -40,10 +40,10 @@
}
.my-popup {
display: none;
/* position:absolute; */
overflow: hidden;
/* height: 360px;
width: 600px; */
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);
@ -127,7 +127,8 @@
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="开始时间" Component="Start" />
<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" />
@ -135,15 +136,18 @@
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="4">
<RadzenLabel Text="结束时间" Component="End" />
<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="6">
<RadzenLabel Text="药品名称/拼音码/编码" Component="drug" />
<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)"
@ -152,8 +156,8 @@
</RadzenRow>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12">
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
<RadzenColumn>
<RadzenButton Click="reloadGrid" Icon="refresh" Text="重置" ButtonStyle="ButtonStyle.Warning" />
</RadzenColumn>
</RadzenRow>
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
@ -251,7 +255,7 @@
string drugName;
RadzenButton button;
Popup popup;
Popup popup2;
IEnumerable<DrugInfo> drugInfo;

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

@ -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

@ -154,8 +154,12 @@ namespace MasaBlazorApp3.Pojo
[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

@ -8,7 +8,9 @@
"setting": {
"machineId": "DM1",
//,
"storage": 249,
//. 07010323 8
// "07010363" "麻醉科 16个抽屉",
"storage": "07010323",
"loginMode": 1,
"opFirst": true,
//退,0退
@ -20,11 +22,11 @@
"drawerProtocol": 485,
"scanCodePortPath": "COM1",
"canBusExsit": true,
"canBusPortPath": "COM31",
"canBusPortPath": "COM5",
"totalDrawerCount": 16,
"canBusTwoExsit": true,
//can线
"canBusPortPathTwo": "COM5",
"canBusPortPathTwo": "COM31",
"doorAddr": 0,
"storageBoxAddr": 0,
"fridgePortExist": false,

View File

@ -11,7 +11,7 @@
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 19/08/2025 15:38:41
Date: 25/08/2025 17:06:04
*/
SET NAMES utf8mb4;
@ -45,6 +45,6 @@ CREATE TABLE `account_book` (
`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 = 22 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
) 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;

View File

@ -5,13 +5,13 @@
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : hkcdb
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 20/08/2025 14:00:45
Date: 25/08/2025 17:05:17
*/
SET NAMES utf8mb4;

View File

@ -5,13 +5,13 @@
Source Server Type : MySQL
Source Server Version : 50740 (5.7.40-log)
Source Host : localhost:3306
Source Schema : hkcdb
Source Schema : zhongbuzhanqu
Target Server Type : MySQL
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 20/08/2025 14:00:53
Date: 25/08/2025 17:05:31
*/
SET NAMES utf8mb4;
@ -28,6 +28,10 @@ CREATE TABLE `hkc_changeshifts_drug` (
`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;
) 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;

View File

@ -11,7 +11,7 @@
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 19/08/2025 15:16:52
Date: 25/08/2025 17:04:19
*/
SET NAMES utf8mb4;
@ -32,12 +32,6 @@ CREATE TABLE `plan` (
`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 = 35 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of plan
-- ----------------------------
INSERT INTO `plan` VALUES (33, '常规药品', NULL, '2025-08-18 15:00:57', 1, 1, 1, '2025-08-19 09:35:40', 'DM5');
INSERT INTO `plan` VALUES (34, '神外药品', NULL, '2025-08-18 15:03:58', 1, 1, 1, '2025-08-19 09:35:44', 'DM5');
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -11,7 +11,7 @@
Target Server Version : 50740 (5.7.40-log)
File Encoding : 65001
Date: 19/08/2025 15:17:02
Date: 25/08/2025 17:04:29
*/
SET NAMES utf8mb4;
@ -32,13 +32,6 @@ CREATE TABLE `plan_details` (
`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 = 143 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of plan_details
-- ----------------------------
INSERT INTO `plan_details` VALUES (140, 33, 5, 'MZ02MDZLI1', '0001-01-01 00:00:00', 1, 'admin', NULL, '2025-08-18 15:56:40');
INSERT INTO `plan_details` VALUES (141, 34, 3, 'TG01QMFTI1', '0001-01-01 00:00:00', 1, 'admin', NULL, '2025-08-19 14:16:24');
INSERT INTO `plan_details` VALUES (142, 34, 5, 'TG02RMZLI0', '0001-01-01 00:00:00', 1, 'admin', NULL, '2025-08-19 14:16:44');
) 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

@ -1,4 +1,5 @@
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表
@ -227,3 +228,7 @@ create_date datetime 0 0 True False False 0 0 False False False False Fa
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