写标签添加写批次效期
This commit is contained in:
parent
db6eb0c339
commit
d58b9967a9
|
@ -1036,6 +1036,7 @@ namespace DM_Weight.Port
|
|||
|
||||
#region 2.4寸汉显屏
|
||||
// 基础数据写入方法
|
||||
//三色灯写标签type:1药品名称;2规格;5批次;6效期;8厂家
|
||||
public void WriteChannelInfo(int type, string content, int drawerNo, int colNo)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -565,6 +565,8 @@ namespace DM_Weight.ViewModels
|
|||
}
|
||||
else
|
||||
{
|
||||
//查询绑定库位的最近效期绑定到标签
|
||||
ChannelStock cs = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerNo == item.DrawerNo && cs.ColNo == item.ColNo&&cs.Quantity>0).OrderBy(cs => cs.EffDate).First();
|
||||
DrugInfo drugSelected = item.Drug ?? new DrugInfo();
|
||||
_portUtil.WindowName = "BindingChannelDialog";
|
||||
// 向显示屏写入库位信息
|
||||
|
@ -574,6 +576,10 @@ namespace DM_Weight.ViewModels
|
|||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(8, drugSelected.Manufactory == null ? "" : drugSelected.Manufactory.Length > 10 ? drugSelected.Manufactory.Substring(0, 10) : drugSelected.Manufactory, item.DrawerNo, item.ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(5, (cs==null||cs.EffDate == null) ? "" : cs.EffDate, item.DrawerNo, item.ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(6, (cs == null || cs.ManuNo == null) ? "" : cs.ManuNo, item.DrawerNo, item.ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(item.DrawerNo, item.ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteQuantity(item.DrawerNo, item.ColNo, item.totalCount);
|
||||
|
|
|
@ -531,7 +531,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
// 更新屏显库存
|
||||
//List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType != 1);
|
||||
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType == 5)
|
||||
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType == 5&&it.CheckQuantity>0).OrderBy(it => it.EffDate)
|
||||
.GroupBy(it => new
|
||||
{
|
||||
it.DrawerNo,
|
||||
|
@ -547,9 +547,16 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
singleChannels.ForEach(it =>
|
||||
{
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteChannelInfo(6, it.EffDate == null ? "" : it.EffDate, it.DrawerNo, it.ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(5, it.ManuNo, it.DrawerNo, it.ColNo);
|
||||
Thread.Sleep(200);
|
||||
// 将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.CheckQuantity);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(it.DrawerNo, it.ColNo);
|
||||
Thread.Sleep(200);
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -722,7 +729,7 @@ namespace DM_Weight.ViewModels
|
|||
List<ChannelStock> q = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Includes<DrugInfo>(cs => cs.DrugInfo)
|
||||
.InnerJoin<ChannelList>((cs, cl) => cs.Chnguid == cl.Id && cs.DrugId == cl.DrugId)
|
||||
.Where(cs => cs.DrawerType == 1)
|
||||
.Where(cs => cs.DrawerType == 1&&cs.DrawerNo==11)
|
||||
.Where(cs => cs.DrugId != null)
|
||||
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉
|
||||
|
|
|
@ -646,7 +646,7 @@ namespace DM_Weight.ViewModels
|
|||
List<ChannelStock> channelStockEffDate = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
.Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo&&cs.Quantity>0)
|
||||
.OrderBy(cs => cs.EffDate).ToList();
|
||||
int totalQuantity = channelStockEffDate.Sum(it => it.Quantity);
|
||||
|
||||
|
|
|
@ -159,6 +159,8 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
// .First(u => u.UserName == username && ConfigurationManager.AppSettings["machineId"].ToString().Equals(u.MachineId));
|
||||
|
||||
if (userList == null)
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -166,10 +168,13 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
Username = "";
|
||||
Password = "";
|
||||
}
|
||||
else if (userList.Role == null)
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -177,6 +182,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
Username = "";
|
||||
Password = "";
|
||||
}
|
||||
|
@ -188,6 +194,8 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
SetUser(userList);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -195,12 +203,15 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
Password = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -208,6 +219,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
}
|
||||
LoginBtnEnable = true;
|
||||
}
|
||||
|
@ -252,6 +264,8 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -259,6 +273,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
}
|
||||
}
|
||||
// 如果已经录入了审核人, 已经有一个用户登录
|
||||
|
@ -281,6 +296,8 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -288,6 +305,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
}
|
||||
}
|
||||
// 第一个用户登录
|
||||
|
@ -349,6 +367,8 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
|
||||
logger.Info($"userList是空?{userList == null}");
|
||||
if (userList == null)
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -356,10 +376,13 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
Username = "";
|
||||
Password = "";
|
||||
}
|
||||
else if (userList.Role == null)
|
||||
{
|
||||
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
|
||||
{
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
@ -367,6 +390,7 @@ _exitCommand ??= new DelegateCommand(Exit);
|
|||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}));
|
||||
Username = "";
|
||||
Password = "";
|
||||
}
|
||||
|
|
|
@ -526,14 +526,36 @@ namespace DM_Weight.ViewModels
|
|||
|
||||
//});
|
||||
// 更新屏显库存
|
||||
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType != 1);
|
||||
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
|
||||
List<ChannelStock> singleChannels = record.FindAll(it => it.BoardType == 5);
|
||||
if (singleChannels.Count > 0)
|
||||
{
|
||||
singleChannels.ForEach(it =>
|
||||
for (int i = 0; i < singleChannels.Count; i++)
|
||||
{
|
||||
_portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
|
||||
|
||||
|
||||
List<ChannelStock> csList = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
.Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo && cs.Quantity > 0).OrderBy(cs => cs.EffDate).ToList();
|
||||
|
||||
if (csList != null && csList.Count > 0)
|
||||
{
|
||||
int totalQuantity = csList.Sum(c => c.Quantity);
|
||||
_portUtil.WriteChannelInfo(5, csList[0].EffDate == null ? "" : csList[0].EffDate, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
});
|
||||
_portUtil.WriteChannelInfo(6, csList[0].ManuNo == null ? "" : csList[0].ManuNo, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteQuantity(csList[0].DrawerNo, csList[0].ColNo, totalQuantity);
|
||||
Thread.Sleep(200);
|
||||
}
|
||||
// singleChannels.ForEach(it =>
|
||||
//{
|
||||
// _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
|
||||
// Thread.Sleep(200);
|
||||
//});
|
||||
}
|
||||
}
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
|
|
|
@ -433,14 +433,32 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
if (singleChannels[i].BoardType == 5)
|
||||
{
|
||||
int totalQuantity = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
List<ChannelStock> csList = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
.Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
.Sum(it => it.Quantity);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(singleChannels[i].DrawerNo, singleChannels[i].ColNo, totalQuantity);
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo && cs.Quantity > 0).OrderBy(cs => cs.EffDate).ToList();
|
||||
|
||||
if (csList != null && csList.Count > 0)
|
||||
{
|
||||
int totalQuantity = csList.Sum(c => c.Quantity);
|
||||
_portUtil.WriteChannelInfo(5, csList[0].EffDate == null ? "" : csList[0].EffDate, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(6, csList[0].ManuNo == null ? "" : csList[0].ManuNo, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(csList[i].DrawerNo, csList[i].ColNo, totalQuantity);
|
||||
Thread.Sleep(200);
|
||||
}
|
||||
// int totalQuantity = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
// .Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
// .Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
// .Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
// .Sum(it => it.Quantity);
|
||||
////将库位多批次的总库存数更新标签
|
||||
//_portUtil.WriteQuantity(singleChannels[i].DrawerNo, singleChannels[i].ColNo, totalQuantity);
|
||||
//Thread.Sleep(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,14 +453,31 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
if (singleChannels[i].BoardType == 5)
|
||||
{
|
||||
int totalQuantity = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
List<ChannelStock> csList = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
.Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
.Sum(it => it.Quantity);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(singleChannels[i].DrawerNo, singleChannels[i].ColNo, totalQuantity);
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo&&cs.Quantity>0).OrderBy(cs => cs.EffDate).ToList();
|
||||
|
||||
if (csList != null && csList.Count > 0)
|
||||
{
|
||||
int totalQuantity = csList.Sum(c => c.Quantity);
|
||||
|
||||
//SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
// .Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
// .Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
// .Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
// .Sum(it => it.Quantity);
|
||||
|
||||
_portUtil.WriteChannelInfo(5, csList[0].EffDate == null ? "" : csList[0].EffDate, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(6, csList[0].ManuNo == null ? "" : csList[0].ManuNo, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(csList[i].DrawerNo, csList[i].ColNo, totalQuantity);
|
||||
Thread.Sleep(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,14 +375,25 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
if (singleChannels[i].BoardType == 5)
|
||||
{
|
||||
int totalQuantity = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
List<ChannelStock> csList = SqlSugarHelper.Db.Queryable<ChannelStock>()
|
||||
.Where(cs => cs.MachineId == singleChannels[i].MachineId)
|
||||
.Where(cs => cs.DrawerNo == singleChannels[i].DrawerNo)
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo)
|
||||
.Sum(it => it.Quantity);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(singleChannels[i].DrawerNo, singleChannels[i].ColNo, totalQuantity);
|
||||
.Where(cs => cs.ColNo == singleChannels[i].ColNo && cs.Quantity > 0).OrderBy(cs => cs.EffDate).ToList();
|
||||
|
||||
if (csList != null && csList.Count > 0)
|
||||
{
|
||||
int totalQuantity = csList.Sum(c => c.Quantity);
|
||||
|
||||
_portUtil.WriteChannelInfo(5, csList[0].EffDate == null ? "" : csList[0].EffDate, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.WriteChannelInfo(6, csList[0].ManuNo == null ? "" : csList[0].ManuNo, csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
_portUtil.ShowContent(csList[0].DrawerNo, csList[0].ColNo);
|
||||
Thread.Sleep(200);
|
||||
//将库位多批次的总库存数更新标签
|
||||
_portUtil.WriteQuantity(csList[i].DrawerNo, csList[i].ColNo, totalQuantity);
|
||||
Thread.Sleep(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue