药箱入库页面完成按钮添加事务,channelList中state字段不用忽略数据库。管理核对单子页面完成添加提示
This commit is contained in:
parent
175013ae84
commit
c333cd9e5d
|
@ -94,7 +94,8 @@ namespace DM_Weight.Models
|
||||||
///
|
///
|
||||||
/// 默认值: 1
|
/// 默认值: 1
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarColumn(IsIgnore = true)]
|
//[SugarColumn(IsIgnore = true)]
|
||||||
|
[SugarColumn(ColumnName = "state")]
|
||||||
public int? State { get; set; }
|
public int? State { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace DM_Weight.ViewModels
|
||||||
get => channelStocks;
|
get => channelStocks;
|
||||||
set => SetProperty(ref channelStocks, value);
|
set => SetProperty(ref channelStocks, value);
|
||||||
}
|
}
|
||||||
List<ChannelStock> selectedStock=new List<ChannelStock>();
|
List<ChannelStock> selectedStock = new List<ChannelStock>();
|
||||||
private object _finishStatus = Visibility.Collapsed;
|
private object _finishStatus = Visibility.Collapsed;
|
||||||
public object FinishStatus
|
public object FinishStatus
|
||||||
{
|
{
|
||||||
|
@ -107,36 +107,58 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
//更新 交接柜 库存信息
|
var f = SqlSugarHelper.Db.UseTran(() =>
|
||||||
if (selectedStock != null && selectedStock.Count > 0)
|
|
||||||
{
|
{
|
||||||
for (int j = 0; j < selectedStock.Count; j++)
|
//更新 交接柜 库存信息
|
||||||
|
if (selectedStock != null && selectedStock.Count > 0)
|
||||||
{
|
{
|
||||||
// 更新数据 交接柜 库存信息
|
for (int j = 0; j < selectedStock.Count; j++)
|
||||||
ChannelStock jiaojie_it = selectedStock[j];
|
|
||||||
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
|
||||||
{
|
{
|
||||||
Quantity = jiaojie_it.BaseQuantity,
|
// 更新数据 交接柜 库存信息
|
||||||
//ManuNo = it.ManuNo,
|
ChannelStock jiaojie_it = selectedStock[j];
|
||||||
//EffDate = it.EffDate,
|
SqlSugarHelper.Db.Updateable(new ChannelStock()
|
||||||
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()
|
|
||||||
{
|
{
|
||||||
State = 0,
|
Quantity = jiaojie_it.BaseQuantity,
|
||||||
Id = jiaojie_it.ChannelLst.Id
|
//ManuNo = it.ManuNo,
|
||||||
}).UpdateColumns(it => it.State).ExecuteCommand();
|
//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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -536,7 +536,7 @@ namespace DM_Weight.ViewModels
|
||||||
OrderNo = oi.OrderNo,
|
OrderNo = oi.OrderNo,
|
||||||
PatientId = oi.PatientId,
|
PatientId = oi.PatientId,
|
||||||
Pharmacy = oi.Pharmacy,
|
Pharmacy = oi.Pharmacy,
|
||||||
State = 1,
|
State = 2,
|
||||||
Operator = HomeWindowViewModel.Operator?.Nickname,
|
Operator = HomeWindowViewModel.Operator?.Nickname,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -591,28 +591,29 @@ namespace DM_Weight.ViewModels
|
||||||
//.Select(cl => cl.BelongUser).First();
|
//.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();
|
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.InfactNum = cs.BaseQuantity - oi._OrderDetail.Quantity;
|
||||||
//rejectionReport.SendDate = SendMachineRecord.OperationTime;
|
rejectionReport.EmptyNum = oi._OrderDetail.Quantity;
|
||||||
//rejectionReport.SendUser = SendMachineRecord.Operator.ToString();
|
rejectionReport.ReturnTime = DateTime.Now.ToString();
|
||||||
//rejectionReport.ReceiveUser = retUser;
|
rejectionReport.ReturnUser = rejectionReport.SendUser;
|
||||||
rejectionReport.RealNum = cs.BaseQuantity;
|
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;
|
||||||
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();
|
|
||||||
|
|
||||||
|
int iRejectionReport = SqlSugarHelper.Db.Updateable(rejectionReport).ExecuteCommand();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -726,6 +727,7 @@ namespace DM_Weight.ViewModels
|
||||||
Type = MsgType.SUCCESS,
|
Type = MsgType.SUCCESS,
|
||||||
};
|
};
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
RequestData();
|
||||||
}
|
}
|
||||||
if (!f.IsSuccess)
|
if (!f.IsSuccess)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue