Compare commits
No commits in common. "2ac87cd83e33aab688f5a2ff3159a7bb752cc1db" and "c858bbff7d43891c827156556ce751ccf8660f8d" have entirely different histories.
2ac87cd83e
...
c858bbff7d
|
@ -1,37 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Data;
|
|
||||||
|
|
||||||
namespace DM_Weight.Converter
|
|
||||||
{
|
|
||||||
internal class DrawerAuthorityConverter : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
if (value != null && value.ToString().Equals("1"))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
bool isTrue;
|
|
||||||
if (bool.TryParse(value.ToString(), out isTrue))
|
|
||||||
{
|
|
||||||
if(isTrue)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -87,7 +87,7 @@ namespace DM_Weight.Models
|
||||||
///
|
///
|
||||||
/// 默认值: 1
|
/// 默认值: 1
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName = "dm_state")]
|
[SugarColumn(ColumnName = "state")]
|
||||||
public int? State { get; set; }
|
public int? State { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
|
|
@ -36,22 +36,5 @@ namespace DM_Weight.Models
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(ColumnName="machine_id" )]
|
[SugarColumn(ColumnName="machine_id" )]
|
||||||
public string MachineId { get; set; }
|
public string MachineId { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 1-8号抽屉
|
|
||||||
///</summary>
|
|
||||||
[SugarColumn(ColumnName = "FirstEightChecked")]
|
|
||||||
public string FirstEightChecked { get; set; } = "0";
|
|
||||||
/// <summary>
|
|
||||||
/// 9-16号抽屉
|
|
||||||
///</summary>
|
|
||||||
[SugarColumn(ColumnName= "LastEightChecked")]
|
|
||||||
public string LastEightChecked { get; set; } = "0";
|
|
||||||
/// <summary>
|
|
||||||
/// 17号抽屉
|
|
||||||
///</summary>
|
|
||||||
[SugarColumn(ColumnName= "StorageBoxChecked")]
|
|
||||||
public string StorageBoxChecked { get; set; } = "0";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,53 +185,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
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;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace DM_Weight.ViewModels
|
||||||
public class CheckStockNewWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
public class CheckStockNewWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
|
||||||
{
|
{
|
||||||
//public static CheckStockNewWindowViewModel vm;
|
//public static CheckStockNewWindowViewModel vm;
|
||||||
private readonly ILog logger = LogManager.GetLogger(typeof(CheckStockNewWindowViewModel));
|
private readonly ILog logger = LogManager.GetLogger(typeof(CheckStockWindowViewModel));
|
||||||
public string drugId;
|
public string drugId;
|
||||||
//public string Stock;
|
//public string Stock;
|
||||||
private static readonly DateTime Jan1st1970 = new DateTime
|
private static readonly DateTime Jan1st1970 = new DateTime
|
||||||
|
@ -317,28 +317,6 @@ namespace DM_Weight.ViewModels
|
||||||
IGrouping<int, ChannelStock> grouping = enumerator.Current;
|
IGrouping<int, ChannelStock> grouping = enumerator.Current;
|
||||||
//int DrawerNo =Convert.ToInt32(grouping.Key.Substring(0,grouping.Key.IndexOf('-')));
|
//int DrawerNo =Convert.ToInt32(grouping.Key.Substring(0,grouping.Key.IndexOf('-')));
|
||||||
int DrawerNo = grouping.Key;
|
int DrawerNo = grouping.Key;
|
||||||
|
|
||||||
if (DrawerNo <= 8)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
|
|
||||||
{
|
|
||||||
NoAuthority();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DrawerNo > 8 && DrawerNo != 17)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
|
|
||||||
{
|
|
||||||
NoAuthority();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DrawerNo == 17)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
|
|
||||||
{
|
|
||||||
NoAuthority();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<ChannelStock> Stocks = grouping.ToList();
|
List<ChannelStock> Stocks = grouping.ToList();
|
||||||
Stocks.ForEach(it => it.process = 1);
|
Stocks.ForEach(it => it.process = 1);
|
||||||
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
@ -740,42 +718,5 @@ namespace DM_Weight.ViewModels
|
||||||
// 取消消息订阅
|
// 取消消息订阅
|
||||||
_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
|
_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//无权限,进入下一个抽屉
|
|
||||||
private void NoAuthority()
|
|
||||||
{
|
|
||||||
|
|
||||||
IGrouping<int, ChannelStock> groupingBefore = enumerator.Current;
|
|
||||||
int DrawerNoBefore = groupingBefore.Key; //Convert.ToInt32(groupingBefore.Key.Substring(0, groupingBefore.Key.IndexOf('-')));
|
|
||||||
if (enumerator.MoveNext())
|
|
||||||
{
|
|
||||||
IGrouping<int, ChannelStock> groupingAfter = enumerator.Current;
|
|
||||||
int DrawerNoAfter = groupingAfter.Key;//Convert.ToInt32(groupingAfter.Key.Substring(0, groupingAfter.Key.IndexOf('-')));
|
|
||||||
//if (DrawerNoBefore < 9 && DrawerNoAfter > 8)
|
|
||||||
//{
|
|
||||||
// Thread.Sleep(50);
|
|
||||||
//}
|
|
||||||
|
|
||||||
logger.Info($"抽屉号DrawerNoBefore【{DrawerNoBefore}】抽屉号DrawerNoAfter【{DrawerNoAfter}】");
|
|
||||||
if (DrawerNoAfter == 17 || DrawerNoBefore == 17)
|
|
||||||
{
|
|
||||||
//if (DrawerNoBefore == 17)
|
|
||||||
{
|
|
||||||
int sleepMilliseconds = Convert.ToInt32(ConfigurationManager.AppSettings["CheckSleepMilliseconds"] ?? "500");
|
|
||||||
Thread.Sleep(sleepMilliseconds);
|
|
||||||
}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// Thread.Sleep(500);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Thread.Sleep(80);
|
|
||||||
Thread.Sleep(500);
|
|
||||||
}
|
|
||||||
OpenOneByOne();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,55 +121,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Status = 1;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
|
@ -138,54 +138,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = 1;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ namespace DM_Weight.ViewModels
|
||||||
get => _channelStocks;
|
get => _channelStocks;
|
||||||
set => SetProperty(ref _channelStocks, value);
|
set => SetProperty(ref _channelStocks, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly DateTime Jan1st1970 = new DateTime
|
private static readonly DateTime Jan1st1970 = new DateTime
|
||||||
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private PortUtil _portUtil;
|
private PortUtil _portUtil;
|
||||||
IEventAggregator _eventAggregator;
|
IEventAggregator _eventAggregator;
|
||||||
|
@ -93,7 +93,7 @@ namespace DM_Weight.ViewModels
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _status;
|
private int _status;
|
||||||
|
@ -129,7 +129,7 @@ namespace DM_Weight.ViewModels
|
||||||
}, (DrawerNo) => Status == 0
|
}, (DrawerNo) => Status == 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DelegateCommand OpenDrawer
|
public DelegateCommand OpenDrawer
|
||||||
{
|
{
|
||||||
|
@ -137,48 +137,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
if (App.CurrentFaUserList.Role != null)
|
|
||||||
{
|
|
||||||
if (DrawerNo <= 8)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.FirstEightChecked == "0")
|
|
||||||
{
|
|
||||||
AlertMsg alertMsg = new AlertMsg
|
|
||||||
{
|
|
||||||
Message = "当前用户没有打开抽屉的权限!",
|
|
||||||
Type = MsgType.ERROR,
|
|
||||||
};
|
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DrawerNo > 8)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.LastEightChecked == "0")
|
|
||||||
{
|
|
||||||
AlertMsg alertMsg = new AlertMsg
|
|
||||||
{
|
|
||||||
Message = "当前用户没有打开抽屉的权限!",
|
|
||||||
Type = MsgType.ERROR,
|
|
||||||
};
|
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (DrawerNo == 17)
|
|
||||||
{
|
|
||||||
if (App.CurrentFaUserList.Role.StorageBoxChecked == "0")
|
|
||||||
{
|
|
||||||
AlertMsg alertMsg = new AlertMsg
|
|
||||||
{
|
|
||||||
Message = "当前用户没有打开抽屉的权限!",
|
|
||||||
Type = MsgType.ERROR,
|
|
||||||
};
|
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Status = 1;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
@ -186,7 +144,7 @@ namespace DM_Weight.ViewModels
|
||||||
// group t by new { t.ColNo, t.BoardType }
|
// group t by new { t.ColNo, t.BoardType }
|
||||||
// into grp
|
// into grp
|
||||||
// select new { grp.Key.ColNo, grp.Key.BoardType, quantity = grp.Sum(t => t.Quantity) }).ToList();
|
// select new { grp.Key.ColNo, grp.Key.BoardType, quantity = grp.Sum(t => t.Quantity) }).ToList();
|
||||||
|
|
||||||
List<ChannelStock> singleChannels = ChannelStocks.FindAll(it => it.BoardType != 1);
|
List<ChannelStock> singleChannels = ChannelStocks.FindAll(it => it.BoardType != 1);
|
||||||
|
|
||||||
_portUtil.WindowName = "DrawerTakeDrugWindow";
|
_portUtil.WindowName = "DrawerTakeDrugWindow";
|
||||||
|
@ -248,7 +206,7 @@ namespace DM_Weight.ViewModels
|
||||||
ColNo = it.ColNo,
|
ColNo = it.ColNo,
|
||||||
DrugId = it.DrugId,
|
DrugId = it.DrugId,
|
||||||
ManuNo = it.ManuNo,
|
ManuNo = it.ManuNo,
|
||||||
EffDate = !String.IsNullOrEmpty(it.EffDate) ? DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
|
EffDate = !String.IsNullOrEmpty(it.EffDate) ?DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture):null,
|
||||||
Operator = HomeWindowViewModel.Operator?.Id,
|
Operator = HomeWindowViewModel.Operator?.Id,
|
||||||
Reviewer = HomeWindowViewModel.Reviewer?.Id,
|
Reviewer = HomeWindowViewModel.Reviewer?.Id,
|
||||||
OperationTime = DateTime.Now,
|
OperationTime = DateTime.Now,
|
||||||
|
@ -266,7 +224,7 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
if (f.Data)
|
if (f.Data)
|
||||||
{
|
{
|
||||||
logger.Info("更新屏显库存singleChannels");
|
logger.Info("更新屏显库存singleChannels");
|
||||||
// 更新屏显库存
|
// 更新屏显库存
|
||||||
|
@ -324,7 +282,7 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -177,54 +177,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -743,8 +743,8 @@ namespace DM_Weight.ViewModels
|
||||||
sb.Append(" (SELECT drug_id,in_pharmacy_id,out_pharmacy_id, invoice_no as InvoiceNo, DATE_FORMAT(Invoice_Date,'%Y-%m-%d') as InvoiceDate, SUM(quantity) as quantity ");
|
sb.Append(" (SELECT drug_id,in_pharmacy_id,out_pharmacy_id, invoice_no as InvoiceNo, DATE_FORMAT(Invoice_Date,'%Y-%m-%d') as InvoiceDate, SUM(quantity) as quantity ");
|
||||||
sb.Append(" FROM in_out_invoice where status=@Status and type!=@type and cancel_flag=@CancelFlag GROUP BY invoice_no,drug_id) i ");
|
sb.Append(" FROM in_out_invoice where status=@Status and type!=@type and cancel_flag=@CancelFlag GROUP BY invoice_no,drug_id) i ");
|
||||||
sb.Append(" inner join ( select c.drug_id as drug_id from channel_list c where c.machine_id = '" + (ConfigurationManager.AppSettings["machineId"] ?? "DM1") + "' group by c.drug_id ) di on di.drug_id = i.drug_id");
|
sb.Append(" inner join ( select c.drug_id as drug_id from channel_list c where c.machine_id = '" + (ConfigurationManager.AppSettings["machineId"] ?? "DM1") + "' group by c.drug_id ) di on di.drug_id = i.drug_id");
|
||||||
sb.Append(" left join pharmacy_info p1 on p1.pharmacy = i.in_pharmacy_id");
|
sb.Append(" left join pharmacy_info p1 on p1.pharmacy_id = i.in_pharmacy_id");
|
||||||
sb.Append(" left join pharmacy_info p2 on p2.pharmacy = i.out_pharmacy_id where 1=1");
|
sb.Append(" left join pharmacy_info p2 on p2.pharmacy_id = i.out_pharmacy_id where 1=1");
|
||||||
//sb.Append(" where i.status=@Status ");
|
//sb.Append(" where i.status=@Status ");
|
||||||
//sb.Append(" and i.type!=@type ");
|
//sb.Append(" and i.type!=@type ");
|
||||||
//sb.Append(" and i.cancel_flag=@CancelFlag ");
|
//sb.Append(" and i.cancel_flag=@CancelFlag ");
|
||||||
|
|
|
@ -214,8 +214,8 @@ namespace DM_Weight.ViewModels
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
sb.Append("select i.invoice_no as InvoiceNo, i.invoice_date as InvoiceDate, COUNT(i.id) as `Count`, SUM(i.quantity) as quantity, p1.pharmacy_name as PharmacyName1, p2.pharmacy_name as PharmacyName2 from in_out_invoice i");
|
sb.Append("select i.invoice_no as InvoiceNo, i.invoice_date as InvoiceDate, COUNT(i.id) as `Count`, SUM(i.quantity) as quantity, p1.pharmacy_name as PharmacyName1, p2.pharmacy_name as PharmacyName2 from in_out_invoice i");
|
||||||
sb.Append(" inner join ( select c.drug_id as drug_id from channel_stock c where c.machine_id = '" + (ConfigurationManager.AppSettings["machineId"] ?? "DM1") + "' group by c.drug_id ) di on di.drug_id = i.drug_id");
|
sb.Append(" inner join ( select c.drug_id as drug_id from channel_stock c where c.machine_id = '" + (ConfigurationManager.AppSettings["machineId"] ?? "DM1") + "' group by c.drug_id ) di on di.drug_id = i.drug_id");
|
||||||
sb.Append(" left join pharmacy_info p1 on p1.pharmacy = i.in_pharmacy_id");
|
sb.Append(" left join pharmacy_info p1 on p1.pharmacy_id = i.in_pharmacy_id");
|
||||||
sb.Append(" left join pharmacy_info p2 on p2.pharmacy = i.out_pharmacy_id");
|
sb.Append(" left join pharmacy_info p2 on p2.pharmacy_id = i.out_pharmacy_id");
|
||||||
sb.Append(" where i.status=@Status ");
|
sb.Append(" where i.status=@Status ");
|
||||||
sb.Append(" and i.type!=@type ");
|
sb.Append(" and i.type!=@type ");
|
||||||
sb.Append(" and i.cancel_flag=@CancelFlag ");
|
sb.Append(" and i.cancel_flag=@CancelFlag ");
|
||||||
|
|
|
@ -252,54 +252,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -247,53 +247,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
private PortUtil _portUtil;
|
private PortUtil _portUtil;
|
||||||
IEventAggregator _eventAggregator;
|
IEventAggregator _eventAggregator;
|
||||||
IDialogService _dialogService;
|
IDialogService _dialogService;
|
||||||
//private SqlSugarScope SqlSugarHelper.Db;
|
//private SqlSugarScope SqlSugarHelper.Db;
|
||||||
public OrderTakeDialogViewModel(PortUtil portUtil, IEventAggregator eventAggregator, IDialogService DialogService, SqlSugarScope sqlSugarScope)
|
public OrderTakeDialogViewModel(PortUtil portUtil, IEventAggregator eventAggregator, IDialogService DialogService, SqlSugarScope sqlSugarScope)
|
||||||
{
|
{
|
||||||
|
@ -171,11 +171,11 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
public void RequestData()
|
public void RequestData()
|
||||||
{
|
{
|
||||||
orderDetails = SqlSugarHelper.Db.Queryable<OrderDetail>()
|
orderDetails = SqlSugarHelper.Db.Queryable<OrderDetail>()
|
||||||
.Includes<DrugInfo>(od => od.DrugInfo)
|
.Includes<DrugInfo>(od => od.DrugInfo)
|
||||||
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (od, t) => od.DrugId == t.DrugId)
|
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (od, t) => od.DrugId == t.DrugId)
|
||||||
.Where(od => od.OrderNo == OrderInfo.OrderNo)
|
.Where(od => od.OrderNo == OrderInfo.OrderNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
List<ChannelStock> channelStocks = new List<ChannelStock>();
|
List<ChannelStock> channelStocks = new List<ChannelStock>();
|
||||||
List<string> msg = new List<string>();
|
List<string> msg = new List<string>();
|
||||||
|
@ -194,7 +194,7 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(cs => cs.DrugId == orderDetail.DrugId)
|
.Where(cs => cs.DrugId == orderDetail.DrugId)
|
||||||
.OrderBy(cs => cs.EffDate)
|
.OrderBy(cs => cs.EffDate)
|
||||||
.OrderBy(cs => cs.DrawerNo)
|
.OrderBy(cs => cs.DrawerNo)
|
||||||
.OrderBy(cs => cs.ManuNo)
|
.OrderBy(cs=> cs.ManuNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
int total = HasQChannels.Sum(it => it.Quantity);
|
int total = HasQChannels.Sum(it => it.Quantity);
|
||||||
int TakeQ = orderDetail.Quantity;
|
int TakeQ = orderDetail.Quantity;
|
||||||
|
@ -230,7 +230,7 @@ namespace DM_Weight.ViewModels
|
||||||
DialogParameters dialogParameters = new DialogParameters();
|
DialogParameters dialogParameters = new DialogParameters();
|
||||||
dialogParameters.Add("msgInfo", msg);
|
dialogParameters.Add("msgInfo", msg);
|
||||||
DialogServiceExtensions.ShowDialogHost(_dialogService, "ShowMessageDialog", dialogParameters, "RootDialog");
|
DialogServiceExtensions.ShowDialogHost(_dialogService, "ShowMessageDialog", dialogParameters, "RootDialog");
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -253,53 +253,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
@ -325,7 +278,7 @@ namespace DM_Weight.ViewModels
|
||||||
ChannelStock copy = TransExpV2<ChannelStock, ChannelStock>.Trans(channelStocks[i]);
|
ChannelStock copy = TransExpV2<ChannelStock, ChannelStock>.Trans(channelStocks[i]);
|
||||||
singleChannels.Add(copy);
|
singleChannels.Add(copy);
|
||||||
}
|
}
|
||||||
singleChannels = singleChannels
|
singleChannels=singleChannels
|
||||||
.GroupBy(it => new { it.DrawerNo, it.ColNo })
|
.GroupBy(it => new { it.DrawerNo, it.ColNo })
|
||||||
.Select(it =>
|
.Select(it =>
|
||||||
{
|
{
|
||||||
|
@ -449,12 +402,12 @@ namespace DM_Weight.ViewModels
|
||||||
}).ToList();
|
}).ToList();
|
||||||
//if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
|
//if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 5)
|
||||||
//{
|
//{
|
||||||
//singleChannels.ForEach(it =>
|
//singleChannels.ForEach(it =>
|
||||||
//{
|
//{
|
||||||
// _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
|
// _portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.Quantity - it.TakeQuantity);
|
||||||
//});
|
//});
|
||||||
//}
|
//}
|
||||||
if (singleChannels.Count > 0)
|
if(singleChannels.Count > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < singleChannels.Count; i++)
|
for (int i = 0; i < singleChannels.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -477,7 +430,7 @@ namespace DM_Weight.ViewModels
|
||||||
};
|
};
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
}
|
}
|
||||||
if (!f.IsSuccess)
|
if(!f.IsSuccess)
|
||||||
{
|
{
|
||||||
AlertMsg alertMsg = new AlertMsg
|
AlertMsg alertMsg = new AlertMsg
|
||||||
{
|
{
|
||||||
|
|
|
@ -193,53 +193,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
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 (ChannelStock != null)
|
if (ChannelStock != null)
|
||||||
{
|
{
|
||||||
Status = 1;
|
Status = 1;
|
||||||
|
|
|
@ -199,7 +199,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ChannelStock != null)
|
if (ChannelStock != null)
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
|
@ -210,54 +209,6 @@ namespace DM_Weight.ViewModels
|
||||||
}
|
}
|
||||||
else
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Status = 1;
|
Status = 1;
|
||||||
_portUtil.SpeakAsync("正在打开" + ChannelStock.DrawerNo + "号抽屉");
|
_portUtil.SpeakAsync("正在打开" + ChannelStock.DrawerNo + "号抽屉");
|
||||||
_portUtil.WindowName = WindowName;
|
_portUtil.WindowName = WindowName;
|
||||||
|
|
|
@ -30,8 +30,6 @@ namespace DM_Weight.ViewModels
|
||||||
get { return _roleList; }
|
get { return _roleList; }
|
||||||
set { SetProperty(ref _roleList, value); }
|
set { SetProperty(ref _roleList, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//private SqlSugarScope SqlSugarHelper.Db;
|
//private SqlSugarScope SqlSugarHelper.Db;
|
||||||
public RoleManagerWindowViewModel(SqlSugarScope sqlSugarScope)
|
public RoleManagerWindowViewModel(SqlSugarScope sqlSugarScope)
|
||||||
{
|
{
|
||||||
|
@ -249,7 +247,7 @@ namespace DM_Weight.ViewModels
|
||||||
PremissionDm jiayao5 = new PremissionDm
|
PremissionDm jiayao5 = new PremissionDm
|
||||||
{
|
{
|
||||||
Id = 24,
|
Id = 24,
|
||||||
PremissionName = "批次抽屉加药",
|
PremissionName = "多批次抽屉加药",
|
||||||
PremissionPath = "AddDrugControl",
|
PremissionPath = "AddDrugControl",
|
||||||
};
|
};
|
||||||
jiayaoChild.Add(jiayao1);
|
jiayaoChild.Add(jiayao1);
|
||||||
|
@ -699,7 +697,6 @@ namespace DM_Weight.ViewModels
|
||||||
Role.Id = 0;
|
Role.Id = 0;
|
||||||
Role.MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1";
|
Role.MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1";
|
||||||
Role.Permissions = RightPremissions.ToList();
|
Role.Permissions = RightPremissions.ToList();
|
||||||
|
|
||||||
List<RoleDm> roleList = SqlSugarHelper.Db.Queryable<RoleDm>().Where(r => r.RoleName == Role.RoleName).ToList();
|
List<RoleDm> roleList = SqlSugarHelper.Db.Queryable<RoleDm>().Where(r => r.RoleName == Role.RoleName).ToList();
|
||||||
if(roleList.Count>0)
|
if(roleList.Count>0)
|
||||||
{
|
{
|
||||||
|
@ -746,7 +743,8 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(di => di.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
.Where(di => di.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1"))
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue), (di) => di.RoleName.Contains(SearchValue??""))
|
.WhereIF(!String.IsNullOrEmpty(SearchValue), (di) => di.RoleName.Contains(SearchValue??""))
|
||||||
.Select(r => r)
|
.Select(r => r)
|
||||||
.ToList();
|
.ToList()
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
//每次导航的时候,该实列用不用重新创建,true是不重新创建,false是重新创建
|
||||||
|
|
|
@ -176,53 +176,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -168,53 +168,6 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
xmlns:prism="http://prismlibrary.com/"
|
xmlns:prism="http://prismlibrary.com/"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<convert:DrawerAuthorityConverter x:Key="DrawerAuthorityConverter" />
|
|
||||||
<Style x:Key="st" TargetType="GridViewColumnHeader">
|
<Style x:Key="st" TargetType="GridViewColumnHeader">
|
||||||
<Style.Setters>
|
<Style.Setters>
|
||||||
<Setter Property="Height">
|
<Setter Property="Height">
|
||||||
|
@ -96,7 +95,6 @@
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition Height="0.2*" />
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="0">
|
<Grid Grid.Row="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
@ -192,18 +190,6 @@
|
||||||
MessageQueue="{Binding SnackbarMessageQueue}"/>
|
MessageQueue="{Binding SnackbarMessageQueue}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Row="2">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition />
|
|
||||||
<ColumnDefinition />
|
|
||||||
<ColumnDefinition />
|
|
||||||
<ColumnDefinition />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="抽屉权限" FontWeight="Bold" FontSize="14" Grid.Column="0" Margin="10"></TextBlock>
|
|
||||||
<CheckBox Content="1-8号抽屉" IsChecked="{Binding Role.FirstEightChecked, Converter={StaticResource DrawerAuthorityConverter}}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="1"/>
|
|
||||||
<CheckBox Content="9-16号抽屉" IsChecked="{Binding Role.LastEightChecked, Converter={StaticResource DrawerAuthorityConverter}}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="2"/>
|
|
||||||
<CheckBox Content="17号抽屉" IsChecked="{Binding Role.StorageBoxChecked, Converter={StaticResource DrawerAuthorityConverter}}" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="3"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in New Issue