药箱入库页面完成按钮添加事务,channelList中state字段不用忽略数据库。管理核对单子页面完成添加提示
This commit is contained in:
parent
175013ae84
commit
c333cd9e5d
|
@ -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)]
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
@ -107,40 +107,62 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
get => new DelegateCommand(() =>
|
||||
{
|
||||
//更新 交接柜 库存信息
|
||||
if (selectedStock != null && selectedStock.Count > 0)
|
||||
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||
{
|
||||
for (int j = 0; j < selectedStock.Count; j++)
|
||||
//更新 交接柜 库存信息
|
||||
if (selectedStock != null && selectedStock.Count > 0)
|
||||
{
|
||||
// 更新数据 交接柜 库存信息
|
||||
ChannelStock jiaojie_it = selectedStock[j];
|
||||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||
for (int j = 0; j < selectedStock.Count; j++)
|
||||
{
|
||||
Quantity = jiaojie_it.BaseQuantity,
|
||||
//ManuNo = it.ManuNo,
|
||||
//EffDate = it.EffDate,
|
||||
Id = jiaojie_it.Id,
|
||||
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).ExecuteCommand();
|
||||
}
|
||||
|
||||
List<ChannelStock> jiaojie = selectedStock.GroupBy(cs => cs.DrawerNo).Select(cs => cs.FirstOrDefault()).ToList();
|
||||
if (jiaojie != null && jiaojie.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < jiaojie.Count; j++)
|
||||
{
|
||||
ChannelStock jiaojie_it = jiaojie[j];
|
||||
//更新交接柜状态为 已取药未入库
|
||||
SqlSugarHelper.Db.Updateable(new ChannelList()
|
||||
// 更新数据 交接柜 库存信息
|
||||
ChannelStock jiaojie_it = selectedStock[j];
|
||||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||
{
|
||||
State = 0,
|
||||
Id = jiaojie_it.ChannelLst.Id
|
||||
}).UpdateColumns(it => it.State).ExecuteCommand();
|
||||
Quantity = jiaojie_it.BaseQuantity,
|
||||
//ManuNo = it.ManuNo,
|
||||
//EffDate = it.EffDate,
|
||||
Id = jiaojie_it.Id,
|
||||
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).ExecuteCommand();
|
||||
}
|
||||
|
||||
List<ChannelStock> jiaojie = selectedStock.GroupBy(cs => cs.DrawerNo).Select(cs => cs.FirstOrDefault()).ToList();
|
||||
if (jiaojie != null && jiaojie.Count > 0)
|
||||
{
|
||||
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;
|
||||
//更新交接柜状态为 已取药未入库
|
||||
var result = SqlSugarHelper.Db.Updateable(jiaojieList)
|
||||
.UpdateColumns(it => new { it.State, it.Id }).ExecuteCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (f.Data)
|
||||
{
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//刷新
|
||||
public DelegateCommand QueryCommand
|
||||
{
|
||||
|
|
|
@ -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,28 +591,29 @@ 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;
|
||||
//rejectionReport.SendUser = SendMachineRecord.Operator.ToString();
|
||||
//rejectionReport.ReceiveUser = retUser;
|
||||
rejectionReport.RealNum = cs.BaseQuantity;
|
||||
|
||||
//发药信息
|
||||
//RejectionReport rejectionReport = new RejectionReport();
|
||||
//rejectionReport.SendDate = SendMachineRecord.OperationTime;
|
||||
//rejectionReport.SendUser = SendMachineRecord.Operator.ToString();
|
||||
//rejectionReport.ReceiveUser = retUser;
|
||||
rejectionReport.RealNum = cs.BaseQuantity;
|
||||
//还药信息
|
||||
rejectionReport.InfactNum = cs.BaseQuantity - oi._OrderDetail.Quantity;
|
||||
rejectionReport.EmptyNum = oi._OrderDetail.Quantity;
|
||||
rejectionReport.ReturnTime = DateTime.Now.ToString();
|
||||
rejectionReport.ReturnUser = rejectionReport.SendUser;
|
||||
rejectionReport.ReturnReceiveUser = rejectionReport.ReceiveUser;// SendMachineRecord.Operator.ToString();
|
||||
rejectionReport.DrugId = oi._OrderDetail.DrugId;
|
||||
rejectionReport.DrugName = oi._OrderDetail.DrugInfo.DrugName;
|
||||
rejectionReport.DrugSpec = oi._OrderDetail.DrugInfo.DrugSpec;
|
||||
|
||||
//还药信息
|
||||
rejectionReport.InfactNum = cs.BaseQuantity - oi._OrderDetail.Quantity;
|
||||
rejectionReport.EmptyNum = oi._OrderDetail.Quantity;
|
||||
rejectionReport.ReturnTime = DateTime.Now.ToString();
|
||||
rejectionReport.ReturnUser = rejectionReport.SendUser;
|
||||
rejectionReport.ReturnReceiveUser = rejectionReport.ReceiveUser;// SendMachineRecord.Operator.ToString();
|
||||
rejectionReport.DrugId = oi._OrderDetail.DrugId;
|
||||
rejectionReport.DrugName = oi._OrderDetail.DrugInfo.DrugName;
|
||||
rejectionReport.DrugSpec = oi._OrderDetail.DrugInfo.DrugSpec;
|
||||
|
||||
rejectionReport.OperationTime = DateTime.Now;
|
||||
|
||||
int iRejectionReport = SqlSugarHelper.Db.Updateable(rejectionReport).ExecuteCommand();
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue