添加RejectionReport实体,并在完成补药时写表数据
This commit is contained in:
parent
44e12e8873
commit
0fedeb7f47
|
@ -196,5 +196,12 @@ namespace DM_Weight.Models
|
||||||
private string _drugSpec;
|
private string _drugSpec;
|
||||||
[SugarColumn(ColumnName = "drug_manu_no")]
|
[SugarColumn(ColumnName = "drug_manu_no")]
|
||||||
public string DrugSpec { get=> _drugSpec;set=>SetProperty(ref _drugSpec, value); }
|
public string DrugSpec { get=> _drugSpec;set=>SetProperty(ref _drugSpec, value); }
|
||||||
|
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "yh_no")]
|
||||||
|
public string BelongUser
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DM_Weight.Models
|
||||||
|
{
|
||||||
|
[SugarTable("rejection_report")]
|
||||||
|
public class RejectionReport
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 发药时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "SendDate")]
|
||||||
|
public DateTime SendDate { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 发药者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "SendUser")]
|
||||||
|
public string SendUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 领药者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ReceiveUser")]
|
||||||
|
public string ReceiveUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 实发数
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "RealNum")]
|
||||||
|
public int RealNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 实物数
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "InfactNum")]
|
||||||
|
public int InfactNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 空安瓿
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "EmptyNum")]
|
||||||
|
public int EmptyNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 还药时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ReturnTime")]
|
||||||
|
public DateTime ReturnTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 还药者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ReturnUser")]
|
||||||
|
public string ReturnUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 接收者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "ReturnReceiveUser")]
|
||||||
|
public string ReturnReceiveUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 补充者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "AddUser")]
|
||||||
|
public string AddUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 核对者
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "AddCheckUser")]
|
||||||
|
public string AddCheckUser { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 操作时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "OperationTime")]
|
||||||
|
public DateTime OperationTime { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "DrugId")]
|
||||||
|
public string DrugId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 药品名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DrugName")]
|
||||||
|
public string DrugName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 药品规格
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DrugSpec")]
|
||||||
|
public string DrugSpec { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 总基数
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "BaseNum")]
|
||||||
|
public string BaseNum { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 药箱号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DrawerNo")]
|
||||||
|
public int DrawerNo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ namespace DM_Weight.ViewModels
|
||||||
private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDialogViewModel));
|
private readonly ILog logger = LogManager.GetLogger(typeof(OrderTakeDialogViewModel));
|
||||||
|
|
||||||
|
|
||||||
private List<ChannelStock> _channelStocks=new List<ChannelStock>();
|
private List<ChannelStock> _channelStocks = new List<ChannelStock>();
|
||||||
|
|
||||||
public List<ChannelStock> ChannelStocks
|
public List<ChannelStock> ChannelStocks
|
||||||
{
|
{
|
||||||
|
@ -198,7 +198,7 @@ namespace DM_Weight.ViewModels
|
||||||
.OrderBy(cs => cs.EffDate)
|
.OrderBy(cs => cs.EffDate)
|
||||||
.OrderBy(cs => cs.DrawerNo)
|
.OrderBy(cs => cs.DrawerNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
if(HasQChannels==null|| HasQChannels.Count <= 0)
|
if (HasQChannels == null || HasQChannels.Count <= 0)
|
||||||
{
|
{
|
||||||
msg.Add($"有药品未绑定,请先绑定");
|
msg.Add($"有药品未绑定,请先绑定");
|
||||||
continue;
|
continue;
|
||||||
|
@ -352,8 +352,8 @@ namespace DM_Weight.ViewModels
|
||||||
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
|
}).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate }).ExecuteCommand();
|
||||||
|
|
||||||
//更新 交接柜 库存信息
|
//更新 交接柜 库存信息
|
||||||
List<ChannelStock> jiaojie = Jiaojie_ChannelStocks.Where(cs=>cs.DrugId== it.DrugId).ToList();
|
List<ChannelStock> jiaojie = Jiaojie_ChannelStocks.Where(cs => cs.DrugId == it.DrugId).ToList();
|
||||||
if(jiaojie!=null&&jiaojie.Count>0)
|
if (jiaojie != null && jiaojie.Count > 0)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < jiaojie.Count; j++)
|
for (int j = 0; j < jiaojie.Count; j++)
|
||||||
{
|
{
|
||||||
|
@ -365,7 +365,7 @@ namespace DM_Weight.ViewModels
|
||||||
//ManuNo = it.ManuNo,
|
//ManuNo = it.ManuNo,
|
||||||
//EffDate = it.EffDate,
|
//EffDate = it.EffDate,
|
||||||
Id = jiaojie_it.Id,
|
Id = jiaojie_it.Id,
|
||||||
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity}).ExecuteCommand();
|
}).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).ExecuteCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,10 +384,30 @@ namespace DM_Weight.ViewModels
|
||||||
OperationTime = DateTime.Now,
|
OperationTime = DateTime.Now,
|
||||||
Quantity = it.TakeQuantity,
|
Quantity = it.TakeQuantity,
|
||||||
Type = 2,
|
Type = 2,
|
||||||
Status= 2,//给交接柜补药不用还空瓶,等真正用了以后再还空瓶,所以先把状态置为2
|
Status = 2,//给交接柜补药不用还空瓶,等真正用了以后再还空瓶,所以先把状态置为2
|
||||||
InvoiceId = InvoiceId
|
InvoiceId = InvoiceId
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
//保存注射剂报表信息
|
||||||
|
for (int j = 0; j < Jiaojie_ChannelStocks.Count; j++)
|
||||||
|
{
|
||||||
|
ChannelStock jStock = Jiaojie_ChannelStocks[j];
|
||||||
|
int totalBaseNum = SqlSugarHelper.Db.Queryable<DrugBase>().
|
||||||
|
Where(db => db.DrugId == jStock.DrugId && db.MachineId == jStock.MachineId).Select(db => db.BaseQuantity).First();
|
||||||
|
|
||||||
|
string belognUser = SqlSugarHelper.Db.Queryable<ChannelList>().
|
||||||
|
Where(cl => cl.DrawerNo == jStock.DrawerNo && cl.MachineId == jStock.MachineId).Select(cl => cl.BelongUser).First();
|
||||||
|
|
||||||
|
SqlSugarHelper.Db.Insertable(new RejectionReport()
|
||||||
|
{
|
||||||
|
SendDate = System.DateTime.Now,
|
||||||
|
SendUser = HomeWindowViewModel.Operator?.Nickname,
|
||||||
|
ReceiveUser = belognUser,//Jiaojie_ChannelStocks
|
||||||
|
DrugId = jStock.DrugId,
|
||||||
|
BaseNum = totalBaseNum + "支",//总基数
|
||||||
|
DrawerNo = jStock.DrawerNo,
|
||||||
|
}).ExecuteCommand();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
if (f.Data)
|
if (f.Data)
|
||||||
|
|
Loading…
Reference in New Issue