|
|
@@ -58,11 +58,11 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
{ |
|
|
|
service.Connecting += (client, e) => |
|
|
|
{ |
|
|
|
Log($"{client.ID}正在建立连接"); |
|
|
|
Log($"{client.IP}:{client.Port.ToString()}正在建立连接"); |
|
|
|
};//有客户端正在连接 |
|
|
|
service.Connected += (client, e) => |
|
|
|
{ |
|
|
|
Log($"已从{client.ID}建立连接"); |
|
|
|
Log($"已从{client.IP}:{client.Port.ToString()}建立连接"); |
|
|
|
Application.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
ListClients.Add(new TimeFlagModel<SocketClient>(client)); |
|
|
@@ -70,7 +70,7 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
};//有客户端连接 |
|
|
|
service.Disconnected += (client, e) => |
|
|
|
{ |
|
|
|
Log($"已从{client.ID}断开连接"); |
|
|
|
Log($"已从{client.IP}:{client.Port.ToString()}断开连接"); |
|
|
|
Application.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
|
lock (ListClients) |
|
|
@@ -158,7 +158,7 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
{ |
|
|
|
Application.Current.Dispatcher.BeginInvoke(new Action(() => |
|
|
|
{ |
|
|
|
Log($"Received from:{client.IP}"); |
|
|
|
Log($"Received from:{client.IP}:{client.Port.ToString()}"); |
|
|
|
EleMedKitData? data = requestInfo as EleMedKitData; |
|
|
|
if (data == null) |
|
|
|
{ |
|
|
@@ -512,12 +512,6 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
|| d.UsageCode == DrugUsageCodes.LastUsed) |
|
|
|
{ |
|
|
|
PortableStorageItemLot inventoryLot = portableStorageItemLotBLL.GetByItemBarcode(d.Barcode); |
|
|
|
//if (inventoryLot == null) |
|
|
|
//{ |
|
|
|
// Log("未找到药品条码标签:" + d.Barcode, -1); |
|
|
|
// drugHandleFlag = false; |
|
|
|
// break; |
|
|
|
//} |
|
|
|
//if (inventoryLot.PortableStorageItem.Item.Key.ToString() != d.DrugKey) |
|
|
|
//{ |
|
|
|
// Log("上传的药品ID与数据库不符:" + d.DrugKey, -1); |
|
|
@@ -538,6 +532,12 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
} |
|
|
|
usageWithInventory.Add(new Tuple<PortableStorageItemLot, int>(inventoryLot, (Int32)usageState)); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Log("未找到药品条码标签:" + d.Barcode, -1); |
|
|
|
//drugHandleFlag = false; |
|
|
|
// break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -711,6 +711,31 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
ItemTransaction itemTransaction = transactions.First().ItemTransaction; |
|
|
|
itemTransaction.Ext10 = "1"; |
|
|
|
itemTransactionBLL.Update(itemTransaction); |
|
|
|
#region 更新药箱库存 |
|
|
|
PortableStorageItemBLL portableStorageItemBLL = new PortableStorageItemBLL(); |
|
|
|
PortableStorageItemLotBLL portableStorageItemLotBLL = new PortableStorageItemLotBLL(); |
|
|
|
foreach (SPILItemTransaction t in transactions) |
|
|
|
{ |
|
|
|
PortableStorageItem inventoryItem = portableStorageItemBLL.GetByStorageAndItem( |
|
|
|
requestStorageLink.PortableStorage.Code, |
|
|
|
t.ItemTransaction.ItemKey.GetValueOrDefault()); |
|
|
|
if (inventoryItem != null) |
|
|
|
{ |
|
|
|
inventoryItem.CurrentQuantity = inventoryItem.CurrentQuantity.GetValueOrDefault() + 1; |
|
|
|
portableStorageItemBLL.Update(inventoryItem); |
|
|
|
PortableStorageItemLot inventoryItemLot = new PortableStorageItemLot(); |
|
|
|
inventoryItemLot.Quantity = 1; |
|
|
|
inventoryItemLot.Key = Guid.NewGuid(); |
|
|
|
inventoryItemLot.ItemKey = t.ItemTransaction.ItemKey; |
|
|
|
inventoryItemLot.LotKey = t.ItemLotKey; |
|
|
|
inventoryItemLot.CreateTime = DateTime.Now; |
|
|
|
inventoryItemLot.PortableStorageItemkey = inventoryItem.Key; |
|
|
|
inventoryItemLot.Ext01 = t.Ext06; |
|
|
|
portableStorageItemLotBLL.Save(inventoryItemLot); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#region 测试 |
|
|
|
//ResponseLendDrugProtocol response = new ResponseLendDrugProtocol(); |
|
|
|
//response.EleMedKitCode = requestLendProtocol.EleMedKitCode; |
|
|
|
//response.ListLendResult = new List<SimpleDrugLotProtocol>(); |
|
|
@@ -726,7 +751,8 @@ namespace Rdh.SocketServer.Client.ViewModels |
|
|
|
// DrugKey = "39383086-f0aa-4ed0-bbe8-e1bf7fba719f", |
|
|
|
// DrugLotCode = "20230817", |
|
|
|
//}); |
|
|
|
//responseData = response; |
|
|
|
//responseData = response; |
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |