添加值班柜、周转柜登录,绑定页面药品添加药品厂家信息,调拨保存时添加保存中

This commit is contained in:
maqiao 2024-09-29 16:58:56 +08:00
parent a716c3543e
commit d31b7016a7
36 changed files with 849 additions and 635 deletions

View File

@ -3,7 +3,7 @@
<connectionStrings>
<!-- 数据库连接字符串 -->
<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
<add name="database" connectionString="server=127.0.0.1;port=3306;database=sanya_xianchang;userid=root;password=root" />
<add name="database" connectionString="server=127.0.0.1;port=3306;database=sanya_xianchang2;userid=root;password=root" />
</connectionStrings>
<!--<runtime>
--><!--配置之后Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
@ -18,7 +18,7 @@
<!-- 领用部门 -->
<add key="receiveDept" value="麻精药房" />
<!--2023/7/13 药房代码 有则写无则空 -->
<add key="storage" value="" />
<add key="storage" value="009902" />
<!-- 登录模式 1单人登录2双人登录 -->
<add key="loginMode" value="1" />
<!-- 登录顺序,指定先登录的人的名称有效值只有在登录模式等于2时才会生效 发药人【operator】审核人【reviewer】 -->
@ -28,7 +28,7 @@
<!-- 自动退出时间单位秒为0时不自动退出 -->
<add key="autoExit" value="0"/>
<!--报表数据库连接-->
<add key="gridConnectionString" value="MYSQL; Database=sanya_xianchang; Password=root; Port=3306; Server=127.0.0.1; User=root;"/>
<add key="gridConnectionString" value="MYSQL; Database=sanya_xianchang2; Password=root; Port=3306; Server=127.0.0.1; User=root;"/>
<!-- 查询处方是orderNo还是orderGroupNo -->
<add key="OrderNoName" value="orderNo" />
<!-- 后门耗材板地址 没有则填写0-->

View File

@ -55,6 +55,15 @@ namespace DM_Weight
set => _currentShenUserList = value;
}
#endregion
#region SingleModel=true则为单人登录
private static bool _singleModel;
public static bool SingleModel
{
get => _singleModel;
set=>_singleModel = value;
}
#endregion
private readonly ILog logger = LogManager.GetLogger(typeof(App));
public App()
@ -133,6 +142,8 @@ namespace DM_Weight
// 登录页面
containerRegistry.RegisterForNavigation<LoginWindow, LoginWindowViewModel>();
//值班柜、周转柜选择
containerRegistry.RegisterForNavigation<BeforeLogin, BeforeLoginViewModel>();
// 布局页面
containerRegistry.RegisterForNavigation<HomeWindow, HomeWindowViewModel>();

View File

@ -76,6 +76,29 @@ namespace DM_Weight.Converter
return Visibility.Collapsed;
}
}
//显示样式
if (para.Equals("TakeFinishLoading"))
{
if (status ==4)
{
return true;
}
else
{
return false;
}
}
if(para.Equals("TakeFinishEnable"))
{
if (status ==4)
{
return false;
}
else
{
return true;
}
}
return Visibility.Collapsed;
}

View File

@ -75,7 +75,7 @@ namespace DM_Weight.Models
[SugarColumn(ColumnName = "eff_date")]
public DateTime? EffDate { get; set; }
/// <summary>
/// 出库入库类型(1入库2出库31还药32还空瓶)
/// 出库入库类型(1入库 2出库 31还药 32还空瓶 4盘点 5日结存)
///</summary>
[SugarColumn(ColumnName = "type")]
public int Type { get; set; }

View File

@ -49,7 +49,17 @@ namespace DM_Weight.Report
string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
string SQL = $@"SELECT cl.`row_no` AS drawerNo,cl.`col_no` AS colNo,cl.`quantity` AS quantity,cl.`manu_no` AS manuNo,cl.`eff_date` AS effDate,
di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,
cl.`drug_id` AS drugId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 ORDER BY cl.`drug_id`";
cl.`drug_id` AS drugId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` = '{machine_id}' AND cl.`drawer_type` = 1 ";
if(App.SingleModel)
{
SQL += " and cl.row_no<=8";
}
else
{
SQL += " and cl.row_no>8";
}
SQL += " ORDER BY cl.`drug_id`";
// 加载模板文件
Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "stock_template.grf");
Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
@ -359,50 +369,6 @@ namespace DM_Weight.Report
string SQL = string.Empty;
string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
#region MyRegion
//string strINSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(totalInQuantity) AS StrTotalQuantity FROM
//(
//SELECT
// DISTINCT Manu_No ,sum(IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0))) as totalInQuantity
//from dm_machine_record mr
// INNER JOIN drug_info di ON mr.`drug_id` = di.`drug_id` where mr.machine_id='{machine_id}'
// and IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) >0
// and DATE_FORMAT(operation_time,'%Y-%m')= '{strDate}' and type in('1,31,4')
//GROUP BY mr.drug_id,mr.manu_no
//) as t";
//AccountTotalQuantity InQuantityList = SqlSugarHelper.Db.SqlQueryable<dynamic>(strINSql)
// .Select(it => new AccountTotalQuantity()).First();
//string strOutSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(TotalOutQuantity) AS StrTotalQuantity FROM
//(
//SELECT
// DISTINCT Manu_No ,SUM(IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0))) AS TotalOutQuantity
//from dm_machine_record mr
// INNER JOIN drug_info di ON mr.`drug_id` = di.`drug_id` where mr.machine_id='{machine_id}'
// and IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) >0
// and DATE_FORMAT(operation_time,'%Y-%m')= '{strDate}' and type in('2,4')
//GROUP BY mr.drug_id,mr.manu_no
//) as t";
//AccountTotalQuantity OutQuantityList = SqlSugarHelper.Db.SqlQueryable<dynamic>(strOutSql)
// .Select(it => new AccountTotalQuantity()).First();
//string strStockSql = $@"SELECT GROUP_CONCAT(Manu_No) AS StrTotalManuNo,GROUP_CONCAT(stock_quantity) AS StrTotalQuantity FROM
// (SELECT a.Manu_No,a.stock_quantity from dm_machine_record a inner join
// (select drug_id,manu_no,max(operation_time) as latest_date,stock_quantity from dm_machine_record
// WHERE DATE_FORMAT(operation_time,'%Y-%m')='{strDate}' and machine_id='{machine_id}' GROUP BY drug_id,manu_no ) b on a.drug_id=b.drug_id and a.manu_no=b.manu_no
// and a.operation_time=b.latest_date and machine_id='{machine_id}' WHERE DATE_FORMAT(operation_time,'%Y-%m')='{strDate}') as t ";
//AccountTotalQuantity StockQuantityList = SqlSugarHelper.Db.SqlQueryable<dynamic>(strStockSql)
// .Select(it => new AccountTotalQuantity()).First();
//string str1 = "本月领药数量" + ":" + InQuantityList.StrTotalQuantity + " 批号:" + InQuantityList.StrTotalManuNo;
//string str2 = "本月发药数量" + ":" + OutQuantityList.StrTotalQuantity + " 批号:" + OutQuantityList.StrTotalManuNo;
//string str3 = "本月结存数量" + ":" + StockQuantityList.StrTotalQuantity + " 批号:" + StockQuantityList.StrTotalManuNo;
//Report.ControlByName("StaticBox24").AsStaticBox.Text = str1;
//Report.ControlByName("StaticBox26").AsStaticBox.Text = str2;
//Report.ControlByName("StaticBox28").AsStaticBox.Text = str3;
#endregion
//Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
SQL = $@"SELECT mr.drug_id as drugId,'test' InTotal,YEAR(mr.`operation_time`) as DMYear,MONTH(mr.`operation_time`) as DMMonth,
DAY(mr.`operation_time`) as DMDay,manu_no as manuNo,operation_time as operationTime,return_quantity1 as inQuantity,return_quantity2 as outQuantity,
manunoQuantity as stockQuantity,u1.user_name as operatorName,u2.user_name as reviewerName,di.`drug_name` AS `drugName`,
@ -410,8 +376,6 @@ namespace DM_Weight.Report
FROM dm_machine_record mr INNER 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` = '{machine_id}' and type=5 and DATE_FORMAT(operation_time,'%Y-%m')='{strDate}' ORDER BY mr.drug_id,operation_time";
//Report.DetailGrid.Recordset.QuerySQL = SQL;
List<Dictionary<string, object>> tableList = SqlSugarHelper.Db.SqlQueryable<dynamic>(SQL).ToDictionaryList();
for (int i = 0; i < tableList.Count; i++)
{

View File

@ -30,13 +30,18 @@ namespace DM_Weight.Services
string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
string SQL = $@"SELECT TYPE, stockQuantity,inQuantity,outQuantity,operationTime,invoiceId,drugName,drugId,drugSpec,packUnit,dosage,manufactory,manuNo,effDate,
operatorName,reviewerName,supplierDept,receiveDept FROM
(SELECT mr.type,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`,
(SELECT mr.type,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`,
if(mr.drawer_no>8 and mr.`type` IN (1, 31),quantity,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`,0)) AS `inQuantity`,
if(OI.ORDER_NO is not null,mr.quantity,IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
DATE_FORMAT(mr.`operation_time`,'%m/%d') AS `operationTime`,IF(mr.`type`=1,mr.`invoice_id`,NULL) AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `packUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`,
mr.`manu_no` AS `manuNo`, DATE_FORMAT(mr.`eff_date`,'%y/%m/%d') AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName`,mr.supplierDept,mr.receiveDept 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` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}'
LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id`
LEFT JOIN ORDER_INFO OI ON OI.ORDER_NO=mr.invoice_id
WHERE mr.`machine_id` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}'
AND mr.`operation_time` < '{p_endDate}' and IF(mr.`type` = 4 AND mr.`quantity` = 0, 99999, mr.`quantity`) <>99999 ";
if (!string.IsNullOrEmpty(drug_id))
{

View File

@ -148,7 +148,18 @@ namespace DM_Weight.ViewModels
private int _status;
public int Status { get => _status; set => SetProperty(ref _status, value); }
/// <summary>
/// 操作状态
/// </summary>
private int _OptionStatus = -1;
public int OptionStatus { get => _OptionStatus; set => SetProperty(ref _OptionStatus, value); }
/// <summary>
/// 完成按钮绑定文本(完成;保存中)
/// </summary>
private string _FinishContent = "完成";
public string FinishContent
{ get => _FinishContent; set => SetProperty(ref _FinishContent, value); }
private int _drawerNo = 1;
public int DrawerNo
@ -185,53 +196,6 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelLsts.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
}
Status = 1;
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
@ -262,7 +226,17 @@ namespace DM_Weight.ViewModels
// 完成按钮
public DelegateCommand TakeFinish
{
get => new DelegateCommand(() =>
get => new DelegateCommand(TakeFinishAction);
}
private void TakeFinishAction()
{
OptionStatus = 4;
FinishContent = "保存中";
Task.Factory.StartNew(() => TakeFinishMethod());
}
private async void TakeFinishMethod()
{
try
{
if (!_isFinishClick)
{
@ -295,9 +269,13 @@ namespace DM_Weight.ViewModels
Quantity = it.Quantity + it.AddQuantity,
ManuNo = it.ManuNo,
EffDate = it.EffDate,
DrugId=it.DrugId,
DrugId = it.DrugId,
Id = it.Id,
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate,it.DrugId }).ExecuteCommand();
DrawerNo = it.DrawerNo,
ColNo = it.ColNo,
DrawerType = it.DrawerType,
BoardType = it.BoardType
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.DrugId }).ExecuteCommand();
}
else
{
@ -343,7 +321,7 @@ namespace DM_Weight.ViewModels
ManuNo = it.ManuNo,
EffDate = !String.IsNullOrEmpty(it.EffDate) ? DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
Operator = HomeWindowViewModel.Operator?.Id,
Reviewer= HomeWindowViewModel.Reviewer?.Id,
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.AddQuantity,
Type = 1,
@ -359,10 +337,14 @@ namespace DM_Weight.ViewModels
{
AlertMsg alertMsg = new AlertMsg
{
Message = $"该抽屉已存在此药品批次{string.Join(',', stockRepeats.Select(r=>r.ManuNo).ToArray())},请选择其他批次",
Message = $"该抽屉已存在此药品批次{string.Join(',', stockRepeats.Select(r => r.ManuNo).ToArray())},请选择其他批次",
Type = MsgType.ERROR
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}));
}
else
{
@ -374,7 +356,7 @@ namespace DM_Weight.ViewModels
if (stockRepeats.Count > 0)
{
msg = $"该抽屉下批次{string.Join(',', stockRepeats.Select(r => r.ManuNo).ToArray())}已存在,不可重复添加,其他批次加药完成,库存已更新";
foreach(var stockRpt in stockRepeats)
foreach (var stockRpt in stockRepeats)
{
//移除重复的信息,以免更新屏显库存时更新了重复数据
record.Remove(stockRpt);
@ -396,20 +378,20 @@ namespace DM_Weight.ViewModels
ret.Quantity = it.Sum(itx => itx.Quantity);
ret.AddQuantity = it.Sum(itx => itx.AddQuantity);
ret.EffDate = it.Min(it => it.EffDate);
ret.ManuNo = it.OrderBy(it=>it.ManuNo).Select(it=>it.ManuNo).First().ToString();
ret.ManuNo = it.OrderBy(it => it.ManuNo).Select(it => it.ManuNo).First().ToString();
return ret;
})
.OrderBy(it=>it.EffDate)
.OrderBy(it => it.EffDate)
.ToList();
singleChannels = singleChannels.Where(it => it.AddQuantity > 0).ToList();
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
{
//将库位多批次的总库存数更新标签
//_portUtil.WriteQuantity(singleChannels[0].DrawerNo, singleChannels[0].ColNo, singleChannels.Sum(it => it.Quantity) + singleChannels.Sum(it => it.AddQuantity));
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);
@ -429,7 +411,11 @@ namespace DM_Weight.ViewModels
Message = msg,
Type = type,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}));
}
else
{
@ -438,7 +424,11 @@ namespace DM_Weight.ViewModels
Message = "更新库存失败",
Type = MsgType.SUCCESS,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}));
}
}
Status = 0;
@ -456,14 +446,31 @@ namespace DM_Weight.ViewModels
Message = "没有填写加药数量",
Type = MsgType.ERROR
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}));
}
}
});
OptionStatus = -1;
}
catch (Exception ex)
{
logger.Info($"AddDrugControlViewModel异常{ex.Message}");
_isFinishClick = false;
AlertMsg alertMsg = new AlertMsg
{
Message = $"异常:{ex.Message}",
Type = MsgType.ERROR
};
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}));
}
}
// 取消按钮
public DelegateCommand CancleTake
{
@ -531,11 +538,11 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is8Drawer = count < 9;
Is16Drawer = count >= 16;
Is17Drawer = count > 16;
//int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
// .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is8Drawer = App.SingleModel; //count < 9;
Is16Drawer = !App.SingleModel; //count >= 16;
Is17Drawer = false;//count > 16;
}
//这个方法用于拦截请求,continuationCallback(true)就是不拦截continuationCallback(false)拦截本次操作

View File

@ -0,0 +1,87 @@
using DM_Weight.Finger;
using DM_Weight.Port;
using Prism.Commands;
using Prism.Events;
using Prism.Mvvm;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace DM_Weight.ViewModels
{
public class BeforeLoginViewModel : BindableBase, IRegionMemberLifetime, IConfirmNavigationRequest
{
public bool KeepAlive => false;
IRegionManager _regionManager;
IEventAggregator _eventAggregator;
public BeforeLoginViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil)
{
_regionManager = regionManager;
_eventAggregator = eventAggregator;
}
private NavigationParameters keys = new NavigationParameters();
/// <summary>
/// 值班柜柜登录
/// </summary>
public DelegateCommand DutyCommand
{
get => new DelegateCommand(() =>
{
//_loginWindowViewModel.SingleLogin = true;
//_loginWindowViewModel.MultiLogin = false;
keys.Add("SingleLogin", true);
App.SingleModel = true;
_regionManager.RequestNavigate("MainRegion", "LoginWindow",keys);
});
}
/// <summary>
/// 周转柜登录
/// </summary>
public DelegateCommand OtherCommand
{
get => new DelegateCommand(() =>
{
//_loginWindowViewModel.SingleLogin = false;
//_loginWindowViewModel.MultiLogin = true;
keys.Add("SingleLogin", false);
App.SingleModel = false;
_regionManager.RequestNavigate("MainRegion", "LoginWindow", keys);
});
}
public void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
{
continuationCallback(true);
}
public bool IsNavigationTarget(NavigationContext navigationContext)
{
return true;
}
public void OnNavigatedFrom(NavigationContext navigationContext)
{
}
public void OnNavigatedTo(NavigationContext navigationContext)
{
}
//手动实现调用配置的逻辑 规避修改配置文件后不起作用的问题
public string ReadAppSetting(string key)
{
string xPath = $"/configuration/appSettings//add[@key='{key}']";
XmlDocument doc = new XmlDocument();
string exeFileName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
doc.Load(exeFileName + ".dll.config");
XmlNode node = doc.SelectSingleNode(xPath);
return node.Attributes["value"].Value.ToString();
}
}
}

View File

@ -142,7 +142,7 @@ namespace DM_Weight.ViewModels
public void UpdateComboBoxItems(string text)
{
string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
d.manufactory,d.max_stock,CONCAT(drug_name,';',drug_spec,';',manufactory)as drug_name_spec FROM `drug_info` d";
if (string.IsNullOrEmpty(text))
{
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
@ -247,7 +247,7 @@ namespace DM_Weight.ViewModels
//var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
//DrugInfos = list;
//DrugInfos_PY = list;
string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' ',drug_spec)as drug_name_spec FROM `drug_info` d";
string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,';',drug_spec,';',manufactory) as drug_name_spec FROM `drug_info` d";
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
}
@ -258,6 +258,8 @@ namespace DM_Weight.ViewModels
int totalCount = 0;
var list = SqlSugarHelper.Db.Queryable<ChannelList>()
.Includes<DrugInfo>(cl => cl.Drug)
.WhereIF(App.SingleModel, cl => cl.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cl => cl.DrawerNo > 8)
.Includes<ChannelStock>(cs => cs.channelStocks)
.WhereIF(DrawerNo > 0, cl => cl.DrawerNo == DrawerNo)
.Where(cl => cl.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))

View File

@ -574,7 +574,8 @@ namespace DM_Weight.ViewModels
.Where(cs => cs.DrawerType == 1)
.Where(cs => cs.DrugId != null)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue)
.OrderBy(cs => cs.DrawerNo)
.OrderBy(cs => cs.ColNo)

View File

@ -706,7 +706,8 @@ namespace DM_Weight.ViewModels
.Where(cs => cs.DrawerType == 1)
.Where(cs => cs.DrugId != null)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue)
.OrderBy(cs => cs.DrawerNo)
//.OrderByDescending(cs => cs.DrawerNo)

View File

@ -121,53 +121,53 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
Status = 1;

View File

@ -138,53 +138,53 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8&&n<17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
Status = 1;
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");

View File

@ -38,7 +38,7 @@ namespace DM_Weight.ViewModels
private int loginMode = Convert.ToInt32(ConfigurationManager.AppSettings["loginMode"]?.ToString() ?? "1");
public bool MultiLogin
{
get => loginMode == 2;
get => !App.SingleModel;// loginMode == 2;
}
private PremissionDm? _selectedMenu;
@ -206,7 +206,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@ -358,7 +358,7 @@ namespace DM_Weight.ViewModels
Reviewer = null;
Application.Current.Dispatcher.Invoke(() =>
{
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
});
AlertMsg alertMsg = new AlertMsg
{
@ -394,7 +394,7 @@ namespace DM_Weight.ViewModels
Reviewer = null;
Application.Current.Dispatcher.Invoke(() =>
{
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
timer.Stop();
});
}
@ -433,7 +433,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@ -453,7 +453,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@ -474,7 +474,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@ -493,7 +493,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{
@ -512,7 +512,7 @@ namespace DM_Weight.ViewModels
logger.Info($"用户【{Operator?.Nickname}】退出登录");
Operator = null;
Reviewer = null;
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}
else
{

View File

@ -177,53 +177,53 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
enumerator.MoveNext();
Status = 1;

View File

@ -253,53 +253,53 @@ namespace DM_Weight.ViewModels
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
enumerator = enumerable.GetEnumerator();
enumerator.MoveNext();

View File

@ -46,13 +46,15 @@ namespace DM_Weight.ViewModels
public bool SingleLogin
{
get => ReadAppSetting("loginMode") == "1";
//get => ReadAppSetting("loginMode") == "1";
//get => loginMode == 1;
get;set;
}
public bool MultiLogin
{
//get => loginMode == 2;
get => ReadAppSetting("loginMode") == "2";
//get => ReadAppSetting("loginMode") == "2";
get;set;
}
private FingerprintUtil _fingerprintUtil;
@ -393,6 +395,9 @@ _exitCommand ??= new DelegateCommand(Exit);
//接收导航传过来的参数 现在是在此处初始化了表格数据
public void OnNavigatedTo(NavigationContext navigationContext)
{
SingleLogin = navigationContext.Parameters.GetValue<bool>("SingleLogin");
MultiLogin = !SingleLogin;
FingerMsg = !_fingerprintUtil.bIsConnected;//false;
_eventAggregator.GetEvent<FingerprintEvent>().Subscribe(LoginEvent);
}

View File

@ -80,8 +80,11 @@ namespace DM_Weight.ViewModels
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{
_container.RegisterType<object, LoginWindow>("LoginWindow");
_regionManager.RequestNavigate("MainRegion", "LoginWindow");
//_container.RegisterType<object, LoginWindow>("LoginWindow");
//_regionManager.RequestNavigate("MainRegion", "LoginWindow");
_container.RegisterType<object, BeforeLogin>("BeforeLogin");
_regionManager.RequestNavigate("MainRegion", "BeforeLogin");
}));

View File

@ -247,53 +247,53 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
enumerator = enumerable.GetEnumerator();
enumerator.MoveNext();

View File

@ -192,6 +192,12 @@ namespace DM_Weight.ViewModels
{
OrderDetail orderDetail = orderDetails[i];
//bool bAdmin=false;
////有开后8个抽屉的权限
//if(App.CurrentFaUserList.Role.LastEightChecked=="1")
//{
// bAdmin = true;
//}
List<ChannelStock> HasQChannels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.Includes<DrugInfo>(cs => cs.DrugInfo)
.InnerJoin<ChannelList>((cs, cl) => cs.Chnguid == cl.Id && cs.DrugId == cl.DrugId)
@ -201,6 +207,8 @@ namespace DM_Weight.ViewModels
.WhereIF(!string.IsNullOrEmpty(orderDetail.SetEffDate), cs => cs.EffDate.Equals(orderDetail.SetEffDate))
.WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo))
.Where(cs => cs.DrugId == orderDetail.DrugId)
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.OrderBy(cs => cs.EffDate)
.OrderBy(cs => cs.DrawerNo)
.OrderBy(cs => cs.ManuNo)
@ -262,53 +270,6 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
}
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
enumerator = enumerable.GetEnumerator();
enumerator.MoveNext();

View File

@ -193,53 +193,53 @@ namespace DM_Weight.ViewModels
{
get => new DelegateCommand(() =>
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
if (ChannelStock != null)
{
Status = 1;

View File

@ -218,7 +218,10 @@ namespace DM_Weight.ViewModels
int totalCount = 0;
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1)
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
.WhereIF(OrderDate != null, oi => oi.OrderDate.ToString("yyyy-MM-dd") == OrderDate)
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue)
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)

View File

@ -184,6 +184,8 @@ namespace DM_Weight.ViewModels
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (mr) => mr.DrugInfo.DrugName.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (mr) => mr.DrugInfo.PyCode.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (mr) => mr.DrugInfo.DrugBarcode.Contains(SearchValue))
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.OrderBy(mr => mr.OperationTime)
.ToList();
MachineRecords = queryData;

View File

@ -235,53 +235,53 @@ namespace DM_Weight.ViewModels
else
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStock.DrawerNo <= 8;
bool bMoreEight = ChannelStock.DrawerNo > 8;
bool bEqualEight = ChannelStock.DrawerNo == 17;
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStock.DrawerNo <= 8;
// bool bMoreEight = ChannelStock.DrawerNo > 8;
// bool bEqualEight = ChannelStock.DrawerNo == 17;
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
Status = 1;
_portUtil.SpeakAsync("正在打开" + ChannelStock.DrawerNo + "号抽屉");
_portUtil.WindowName = WindowName;

View File

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using DM_Weight.Models;
using DM_Weight.util;
using DM_Weight.Report;
using System.Configuration;
namespace DM_Weight.ViewModels
{
@ -104,6 +105,9 @@ namespace DM_Weight.ViewModels
Channels = SqlSugarHelper.Db.Queryable<ChannelStock>()
.LeftJoin<DrugInfo>((cs,di) => cs.DrugId == di.DrugId.ToString())
.Where((cs) => cs.DrawerType != 1)
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
.Select((cs, di) => new ChannelStock{
CanReturnQuantity = SqlFunc.Subqueryable<MachineRecord>().Where(mr => mr.DrugId == cs.DrugId).Where(mr => mr.Type == 2).Where(mr => mr.Status != 2).Select(mr => SqlFunc.IsNull(SqlFunc.AggregateSumNoNull(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2), 0)) ,
DrugInfo = new DrugInfo

View File

@ -343,15 +343,15 @@ namespace DM_Weight.ViewModels
PremissionName = "交接班记录",
PremissionPath = "ChangeShiftsListWindow",
};
//PremissionDm kuguan6 = new PremissionDm
//{
// Id = 46,
// PremissionName = "账册",
// PremissionPath = "AccountWindow",
//};
PremissionDm kuguan6 = new PremissionDm
{
Id = 46,
PremissionName = "账册",
PremissionPath = "AccountWindow",
};
PremissionDm kuguan66 = new PremissionDm
{
Id = 466,
PremissionName = "专用账册",
PremissionPath = "SpecialAccountWindow",
};
@ -367,7 +367,7 @@ namespace DM_Weight.ViewModels
kuguanChild.Add(kuguan4);
kuguanChild.Add(kuguan5);
kuguanChild.Add(kuguan6);
kuguanChild.Add(kuguan66);
//kuguanChild.Add(kuguan66);
//kuguanChild.Add(kuguan7);
kuguan.Children = kuguanChild;
defaultAll.Add(kuguan);

View File

@ -176,53 +176,53 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
enumerator.MoveNext();
Status = 1;
OpenOneByOne();

View File

@ -211,7 +211,10 @@ namespace DM_Weight.ViewModels
// .ToList();
//ChannelStocks = queryData;
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1)
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (cs) => cs.PyCode.Contains(SearchValue))

View File

@ -168,53 +168,53 @@ namespace DM_Weight.ViewModels
{
if (Status == 0)
{
if (App.CurrentFaUserList.Role != null)
{
//查看当前用户是否有所在药品抽屉的权限
bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
if (bLessEight)
{
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bMoreEight)
{
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
if (bEqualEight)
{
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
{
AlertMsg alertMsg = new AlertMsg
{
Message = "当前用户没有打开抽屉的权限!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
return;
}
}
//if (App.CurrentFaUserList.Role != null)
//{
// //查看当前用户是否有所在药品抽屉的权限
// bool bLessEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n <= 8).Any();
// bool bMoreEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 8 && n < 17).Any();
// bool bEqualEight = ChannelStocks.Select(it => it.DrawerNo).Where(n => n == 17).Any();
// if (bLessEight)
// {
// if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bMoreEight)
// {
// if (App.CurrentFaUserList.Role.LastEightChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
// if (bEqualEight)
// {
// if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
// {
// AlertMsg alertMsg = new AlertMsg
// {
// Message = "当前用户没有打开抽屉的权限!",
// Type = MsgType.ERROR,
// };
// _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
// return;
// }
// }
}
//}
enumerator.MoveNext();
Status = 1;
OpenOneByOne();

View File

@ -197,6 +197,8 @@ namespace DM_Weight.ViewModels
//ChannelStocks = queryData;
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1)
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8 ) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8 )
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null&&cs.Quantity>0).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue))

View File

@ -243,12 +243,15 @@ namespace DM_Weight.ViewModels
List<DrugInfo> q = SqlSugarHelper.Db.Queryable<DrugInfo>()
.Includes<ChannelStock>(di => di.channelStocks.Where(cs => cs.DrawerType == 1)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
.WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉双人登录开后8个抽屉
.WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList())
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (cs) => cs.PyCode.Contains(SearchValue))
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (cs) => cs.DrugBarcode.Contains(SearchValue))
.Where(di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null))
.WhereIF(App.SingleModel, di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null&&cs.DrawerNo <= 8&& cs.DrawerType == 1))
.WhereIF(!(App.SingleModel), di => di.channelStocks.Any(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null&&cs.DrawerNo > 8&& cs.DrawerType == 1))
.OrderBy(cs => cs.DrugId)
.ToList();
Drugs = q;

View File

@ -141,23 +141,22 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="0" Width="120" Content="1" Command="{Binding UpdateDrawerNo}" CommandParameter="1" />
<Button Grid.Row="1" Grid.Column="0" Width="120" Content="2" Command="{Binding UpdateDrawerNo}" CommandParameter="2" />
<Button Grid.Row="2" Grid.Column="0" Width="120" Content="3" Command="{Binding UpdateDrawerNo}" CommandParameter="3" />
<Button Grid.Row="3" Grid.Column="0" Width="120" Content="4" Command="{Binding UpdateDrawerNo}" CommandParameter="4" />
<Button Grid.Row="4" Grid.Column="0" Width="120" Content="5" Command="{Binding UpdateDrawerNo}" CommandParameter="5" />
<Button Grid.Row="5" Grid.Column="0" Width="120" Content="6" Command="{Binding UpdateDrawerNo}" CommandParameter="6" />
<Button Grid.Row="6" Grid.Column="0" Width="120" Content="7" Command="{Binding UpdateDrawerNo}" CommandParameter="7" />
<Button Grid.Row="7" Grid.Column="0" Width="120" Content="8" Command="{Binding UpdateDrawerNo}" CommandParameter="8" />
<Button Grid.Row="0" Grid.Column="1" Width="120" Content="9" Command="{Binding UpdateDrawerNo}" CommandParameter="9" />
<Button Grid.Row="1" Grid.Column="1" Width="120" Content="10" Command="{Binding UpdateDrawerNo}" CommandParameter="10" />
<Button Grid.Row="2" Grid.Column="1" Width="120" Content="11" Command="{Binding UpdateDrawerNo}" CommandParameter="11" />
<Button Grid.Row="3" Grid.Column="1" Width="120" Content="12" Command="{Binding UpdateDrawerNo}" CommandParameter="12" />
<Button Grid.Row="4" Grid.Column="1" Width="120" Content="13" Command="{Binding UpdateDrawerNo}" CommandParameter="13" />
<Button Grid.Row="5" Grid.Column="1" Width="120" Content="14" Command="{Binding UpdateDrawerNo}" CommandParameter="14" />
<Button Grid.Row="6" Grid.Column="1" Width="120" Content="15" Command="{Binding UpdateDrawerNo}" CommandParameter="15" />
<Button Grid.Row="7" Grid.Column="1" Width="120" Content="16" Command="{Binding UpdateDrawerNo}" CommandParameter="16" />
<Button Grid.Row="0" Grid.Column="0" Width="120" Content="1" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="1" />
<Button Grid.Row="1" Grid.Column="0" Width="120" Content="2" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="2" />
<Button Grid.Row="2" Grid.Column="0" Width="120" Content="3" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="3" />
<Button Grid.Row="3" Grid.Column="0" Width="120" Content="4" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="4" />
<Button Grid.Row="4" Grid.Column="0" Width="120" Content="5" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="5" />
<Button Grid.Row="5" Grid.Column="0" Width="120" Content="6" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="6" />
<Button Grid.Row="6" Grid.Column="0" Width="120" Content="7" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="7" />
<Button Grid.Row="7" Grid.Column="0" Width="120" Content="8" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is8Drawer}" CommandParameter="8" />
<Button Grid.Row="0" Grid.Column="1" Width="120" Content="9" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="9" />
<Button Grid.Row="1" Grid.Column="1" Width="120" Content="10" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="10" />
<Button Grid.Row="2" Grid.Column="1" Width="120" Content="11" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="11" />
<Button Grid.Row="3" Grid.Column="1" Width="120" Content="12" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="12" />
<Button Grid.Row="4" Grid.Column="1" Width="120" Content="13" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="13" />
<Button Grid.Row="5" Grid.Column="1" Width="120" Content="14" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="14" />
<Button Grid.Row="6" Grid.Column="1" Width="120" Content="15" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="15" />
<Button Grid.Row="7" Grid.Column="1" Width="120" Content="16" Command="{Binding UpdateDrawerNo}" IsEnabled="{Binding Is16Drawer}" CommandParameter="16" />
</Grid>
</Grid>
@ -187,10 +186,21 @@
Margin="0 0 3 0"
VerticalAlignment="Center"
Command="{Binding TakeFinish}"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding OptionStatus,Converter={StaticResource StatusConverter},ConverterParameter=TakeFinishLoading}"
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding OptionStatus,Converter={StaticResource StatusConverter},ConverterParameter=TakeFinishLoading}"
IsEnabled="{Binding OptionStatus,Converter={StaticResource StatusConverter},ConverterParameter=TakeFinishEnable}"
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="完成" />
Content="{Binding FinishContent}" />
<!--<Button
Margin="0 0 3 0"
VerticalAlignment="Center"
Command="{Binding OpenDrawer}"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding Status,Converter={StaticResource BiaoDingStatusConverter},ConverterParameter=BiaoDingLoading}"
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status,Converter={StaticResource BiaoDingStatusConverter},ConverterParameter=BiaoDingLoading}"
IsEnabled="{Binding Status,Converter={StaticResource BiaoDingStatusConverter},ConverterParameter=BiaoDingBtnFlag}" Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="标定" />-->
<Button
Margin="0 0 6 0"
VerticalAlignment="Center"

View File

@ -0,0 +1,88 @@
<UserControl x:Class="DM_Weight.Views.BeforeLogin"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DM_Weight.Views"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FontFamily="{DynamicResource MaterialDesignFont}"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Background>
<ImageBrush ImageSource="/Images/body-bg.jpg" Stretch="Fill"/>
</UserControl.Background>
<Grid>
<Grid.RowDefinitions >
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="6*"></RowDefinition>
<RowDefinition Height="3*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<materialDesign:Card Margin="16" Grid.Row="2" Grid.Column="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="6*"/>
</Grid.RowDefinitions>
<TextBlock Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="28"
Foreground="#31ccec"
FontWeight="Bold"
Text="欢迎登录麻精药品管理系统">
</TextBlock>
<Grid Grid.Column="0" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Style="{StaticResource MaterialDesignRaisedButton}"
materialDesign:ButtonAssist.CornerRadius="5"
Command="{ Binding DutyCommand }"
Background="#42a5f5"
BorderBrush="#42a5f5" Cursor="Hand" IsDefault="True" Content="值班柜登录"/>
</Grid>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Style="{StaticResource MaterialDesignRaisedLightButton}"
Background="#7986cb"
BorderBrush="#7986cb"
materialDesign:ButtonAssist.CornerRadius="5" Cursor="Hand" IsCancel="true"
Command="{ Binding OtherCommand }" >
<TextBlock Foreground="{DynamicResource MaterialDesignPaper}" Text="周转柜登录" />
</Button>
</Grid>
</Grid>
</materialDesign:Card>
<!--<StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="2">
<TextBlock Visibility="{Binding DrawerPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="抽屉串口连接失败" />
<TextBlock Visibility="{Binding CanBusPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="can总线串口连接失败" />
<TextBlock Visibility="{Binding FingerMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="指纹机连接失败" />
</StackPanel>-->
</Grid>
</UserControl>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DM_Weight.Views
{
/// <summary>
/// BeforeLogin.xaml 的交互逻辑
/// </summary>
public partial class BeforeLogin : UserControl
{
public BeforeLogin()
{
InitializeComponent();
}
}
}

View File

@ -21,7 +21,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="50" />
<RowDefinition Height="Auto" />
<RowDefinition Height="300" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Background="#03a9f4" Grid.Row="0">
@ -107,6 +107,7 @@
Text="{Binding OrderInfo.Age}" />
</Grid>
<DataGrid Grid.Row="2" ItemsSource="{Binding ChannelStocks}" AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.Resources>
<Style TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource MaterialDesignDataGridColumnHeader}">
<Setter Property="HorizontalContentAlignment" Value="Center" />
@ -119,7 +120,7 @@
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource MaterialDesignDataGridCell}">
<Setter Property="HorizontalAlignment" Value="left" />
<Setter Property="Padding" Value="13" />
</Style>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>

View File

@ -56,7 +56,7 @@
FontSize="28"
Foreground="#31ccec"
FontWeight="Bold"
Text="欢迎登录麻药品管理系统">
Text="欢迎登录麻药品管理系统">
</TextBlock>
<TextBlock
Grid.Row="2"