药箱入库页面完成按钮添加事务,channelList中state字段不用忽略数据库。管理核对单子页面完成添加提示

This commit is contained in:
maqiao 2024-11-29 14:25:47 +08:00
parent 175013ae84
commit c333cd9e5d
3 changed files with 72 additions and 47 deletions

View File

@ -94,7 +94,8 @@ namespace DM_Weight.Models
///
/// 默认值: 1
///</summary>
[SugarColumn(IsIgnore = true)]
//[SugarColumn(IsIgnore = true)]
[SugarColumn(ColumnName = "state")]
public int? State { get; set; }
[SugarColumn(IsIgnore = true)]

View File

@ -33,7 +33,7 @@ namespace DM_Weight.ViewModels
get => channelStocks;
set => SetProperty(ref channelStocks, value);
}
List<ChannelStock> selectedStock=new List<ChannelStock>();
List<ChannelStock> selectedStock = new List<ChannelStock>();
private object _finishStatus = Visibility.Collapsed;
public object FinishStatus
{
@ -106,6 +106,8 @@ namespace DM_Weight.ViewModels
public DelegateCommand AddFinish
{
get => new DelegateCommand(() =>
{
var f = SqlSugarHelper.Db.UseTran(() =>
{
//更新 交接柜 库存信息
if (selectedStock != null && selectedStock.Count > 0)
@ -129,14 +131,34 @@ namespace DM_Weight.ViewModels
for (int j = 0; j < jiaojie.Count; j++)
{
ChannelStock jiaojie_it = jiaojie[j];
ChannelList jiaojieList = new ChannelList();
jiaojieList.State = 0;
jiaojieList.Id = jiaojie_it.ChannelLst.Id;
//更新交接柜状态为 已取药未入库
SqlSugarHelper.Db.Updateable(new ChannelList()
var result = SqlSugarHelper.Db.Updateable(jiaojieList)
.UpdateColumns(it => new { it.State, it.Id }).ExecuteCommand();
}
}
}
});
if (f.Data)
{
State = 0,
Id = jiaojie_it.ChannelLst.Id
}).UpdateColumns(it => it.State).ExecuteCommand();
}
RequestData();
AlertMsg alertMsg = new AlertMsg
{
Message = "操作完成",
Type = MsgType.SUCCESS,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}
if (!f.IsSuccess)
{
AlertMsg alertMsg = new AlertMsg
{
Message = "操作失败!",
Type = MsgType.ERROR,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
}
});
}

View File

@ -536,7 +536,7 @@ namespace DM_Weight.ViewModels
OrderNo = oi.OrderNo,
PatientId = oi.PatientId,
Pharmacy = oi.Pharmacy,
State = 1,
State = 2,
Operator = HomeWindowViewModel.Operator?.Nickname,
});
}
@ -591,7 +591,8 @@ namespace DM_Weight.ViewModels
//.Select(cl => cl.BelongUser).First();
RejectionReport rejectionReport = SqlSugarHelper.Db.Queryable<RejectionReport>().Where(rp => rp.DrugId == cs.DrugId && rp.DrawerNo == cs.DrawerNo).OrderByDescending(rp => rp.SendDate).First();
if (rejectionReport != null)
{
//发药信息
//RejectionReport rejectionReport = new RejectionReport();
//rejectionReport.SendDate = SendMachineRecord.OperationTime;
@ -612,7 +613,7 @@ namespace DM_Weight.ViewModels
rejectionReport.OperationTime = DateTime.Now;
int iRejectionReport = SqlSugarHelper.Db.Updateable(rejectionReport).ExecuteCommand();
}
#endregion
}
@ -726,6 +727,7 @@ namespace DM_Weight.ViewModels
Type = MsgType.SUCCESS,
};
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
RequestData();
}
if (!f.IsSuccess)
{