Compare commits
2 Commits
4d26252cad
...
0ae94e65ef
Author | SHA1 | Date | |
---|---|---|---|
|
0ae94e65ef |
|
|
|
7fb942977a |
|
|
@ -362,3 +362,4 @@ MigrationBackup/
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
/readme.txt
|
/readme.txt
|
||||||
|
/DM_Weight/Port/PortUtil.cs
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -308,7 +308,7 @@ namespace DM_Weight.ViewModels
|
||||||
//.Includes(cl => cl.channelStocks, dr => dr.DrugInfo, d => d.DrugManuNos)
|
//.Includes(cl => cl.channelStocks, dr => dr.DrugInfo, d => d.DrugManuNos)
|
||||||
.Where(cl => cl.DrugId == invoices[i].DrugId && cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList();
|
.Where(cl => cl.DrugId == invoices[i].DrugId && cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList();
|
||||||
ChannelList channelLst = channelL.Count > 0 ? channelL[0] : null;
|
ChannelList channelLst = channelL.Count > 0 ? channelL[0] : null;
|
||||||
if (channelLst == null || channelLst.Id is null)
|
if (channelL.Count <= 0)
|
||||||
{
|
{
|
||||||
//药品未绑定库位,需要先绑药
|
//药品未绑定库位,需要先绑药
|
||||||
//AlertMsg alertMsg = new AlertMsg
|
//AlertMsg alertMsg = new AlertMsg
|
||||||
|
@ -343,19 +343,46 @@ namespace DM_Weight.ViewModels
|
||||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//没有根据药品绑定库位写入数据
|
||||||
|
for (int k = 0; k < channelL.Count; k++)
|
||||||
|
{
|
||||||
|
|
||||||
ChannelStock stock = new ChannelStock();
|
ChannelStock stock = new ChannelStock();
|
||||||
//没有库存写入一条数据
|
|
||||||
stock.MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1";
|
stock.MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1";
|
||||||
stock.DrawerNo = channelLst.DrawerNo;
|
stock.DrawerNo = channelL[k].DrawerNo;
|
||||||
stock.BoardType = channelLst.BoardType;
|
stock.BoardType = channelL[k].BoardType;
|
||||||
stock.DrawerType = channelLst.DrawerType;
|
stock.DrawerType = channelL[k].DrawerType;
|
||||||
stock.ColNo = channelLst.ColNo;
|
stock.ColNo = channelL[k].ColNo;
|
||||||
stock.DrugId = channelLst.DrugId;
|
stock.DrugId = channelL[k].DrugId;
|
||||||
stock.ManuNo = invoicesManuNo[j].DrugManuNo;
|
stock.ManuNo = invoicesManuNo[j].DrugManuNo;
|
||||||
stock.EffDate = manuNoList[0].EffDate;
|
stock.EffDate = manuNoList[0].EffDate;
|
||||||
stock.Chnguid = channelLst.Id;
|
stock.Chnguid = channelL[k].Id;
|
||||||
stockList.Add(stock);
|
stockList.Add(stock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//药品有库存,则除了将对应药品批次数据列出来外,还要将当前已绑定的药品下添加上该批次
|
||||||
|
for (int k = 0; k < channelL.Count; k++)
|
||||||
|
{
|
||||||
|
//有库存且批次抽屉库位与将要插入的批次抽屉库位一致则跳过
|
||||||
|
if(stockList.Where(t=>t.ManuNo== invoicesManuNo[j].DrugManuNo&&t.ColNo== channelL[k].ColNo&&t.DrawerNo== channelL[k].DrawerNo).FirstOrDefault()!=null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ChannelStock stock = new ChannelStock();
|
||||||
|
stock.MachineId = ConfigurationManager.AppSettings["machineId"] ?? "DM1";
|
||||||
|
stock.DrawerNo = channelL[k].DrawerNo;
|
||||||
|
stock.BoardType = channelL[k].BoardType;
|
||||||
|
stock.DrawerType = channelL[k].DrawerType;
|
||||||
|
stock.ColNo = channelL[k].ColNo;
|
||||||
|
stock.DrugId = channelL[k].DrugId;
|
||||||
|
stock.ManuNo = invoicesManuNo[j].DrugManuNo;
|
||||||
|
stock.EffDate = manuNoList[0].EffDate;
|
||||||
|
stock.Chnguid = channelL[k].Id;
|
||||||
|
stockList.Add(stock);
|
||||||
|
}
|
||||||
|
}
|
||||||
//stock.AddQuantity = invoicesManuNo[j].quantity;
|
//stock.AddQuantity = invoicesManuNo[j].quantity;
|
||||||
//stockList.ForEach(s => s.AddQuantity = invoicesManuNo[j].quantity);
|
//stockList.ForEach(s => s.AddQuantity = invoicesManuNo[j].quantity);
|
||||||
stockList.GroupBy(x => x.ManuNo)
|
stockList.GroupBy(x => x.ManuNo)
|
||||||
|
|
Loading…
Reference in New Issue