diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/DataResult.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs
similarity index 95%
rename from WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/DataResult.cs
rename to WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs
index 8b4643ba..1941562b 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/DataResult.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Outputs/Result.cs
@@ -7,7 +7,7 @@ using JNPF.Common.Enums;
namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
{
- public class DataResult
+ public class Result
{
///
/// 响应状态码
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.cs
index b1e3ed17..b6ef7fb4 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsDistaskH.cs
@@ -44,6 +44,27 @@ public partial class WmsDistaskH : BaseEntity
///
public string? end_floor { get; set; }
+ ///
+ /// 起始点位ID
+ ///
+ public string startpoint_id { get; set; } = string.Empty;
+
+ ///
+ /// 起始点位编号
+ ///
+ public string startpoint_code { get; set; } = string.Empty;
+
+ ///
+ /// 终止点位ID
+ ///
+ public string endpoint_id { get; set; } = string.Empty;
+
+ ///
+ /// 终止点位编号
+ ///
+ public string endpoint_code { get; set; } = string.Empty;
+
+
///
/// 单号
///
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.cs
index cd3050ee..8ca958c1 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsPretaskH.cs
@@ -44,6 +44,26 @@ public partial class WmsPretaskH : BaseEntity
///
public string? end_floor { get; set; }
+ ///
+ /// 起始点位ID
+ ///
+ public string startpoint_id { get; set; } = string.Empty;
+
+ ///
+ /// 起始点位编号
+ ///
+ public string startpoint_code { get; set; } = string.Empty;
+
+ ///
+ /// 终止点位ID
+ ///
+ public string endpoint_id { get; set; } = string.Empty;
+
+ ///
+ /// 终止点位编号
+ ///
+ public string endpoint_code { get; set; } = string.Empty;
+
///
/// 单号
///
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs
index aad43cdd..9fdd5303 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs
@@ -90,9 +90,9 @@ namespace Tnb.WarehouseMgr
///
///
[NonAction]
- protected Task ToApiResult()
+ protected Task ToApiResult()
{
- DataResult result = new();
+ Result result = new();
return Task.FromResult(result);
}
@@ -101,9 +101,9 @@ namespace Tnb.WarehouseMgr
///
///
[NonAction]
- protected Task ToApiResult(HttpStatusCode statusCode, object data)
+ protected Task ToApiResult(HttpStatusCode statusCode, object data)
{
- DataResult result = new()
+ Result result = new()
{
code = statusCode,
data = data
@@ -118,9 +118,9 @@ namespace Tnb.WarehouseMgr
///
///
[NonAction]
- protected Task ToApiResult(object data)
+ protected Task ToApiResult(object data)
{
- DataResult result = new()
+ Result result = new()
{
data = data
};
@@ -131,9 +131,9 @@ namespace Tnb.WarehouseMgr
///
///
[NonAction]
- protected Task ToApiResult(HttpStatusCode statusCode, string msg)
+ protected Task ToApiResult(HttpStatusCode statusCode, string msg)
{
- DataResult result = new()
+ Result result = new()
{
code = statusCode,
msg = msg
@@ -145,9 +145,9 @@ namespace Tnb.WarehouseMgr
///
///
[NonAction]
- protected Task ToApiResult(HttpStatusCode statusCode, string msg, object data)
+ protected Task ToApiResult(HttpStatusCode statusCode, string msg, object data)
{
- DataResult result = new()
+ Result result = new()
{
code = statusCode,
msg = msg,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs
new file mode 100644
index 00000000..2fa07bb8
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr/DeviceProviderService.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Senparc.NeuChar.ApiHandlers;
+using Tnb.WarehouseMgr.Entities.Dto.Outputs;
+
+namespace Tnb.WarehouseMgr
+{
+ ///
+ /// Wms设备接口提供程序服务类
+ ///
+
+ public class DeviceProviderService : BaseWareHouseService
+ {
+ ///
+ /// 创建任务链
+ ///
+ ///
+ [HttpPost]
+ public async Task CreateTaskChain()
+ {
+ return await Task.FromResult(null);
+ }
+ }
+}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
index c0bef6f3..a8a61455 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs
@@ -698,7 +698,7 @@ namespace Tnb.WarehouseMgr
List results = new() { startObj };
if (points?.Count > 0)
{
- points.Where(it => result.Contains(it.id));
+ //points.Where(it => result.Contains(it.id));
foreach (var i in result)
{
WmsPointH? point = points?.Find(x => x.id == i);
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
index eb71689f..189f6847 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveInStockService.cs
@@ -109,6 +109,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_CARRYMOVEINSTOCK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
index 744025d6..3b7f9ecc 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryMoveOutStockService.cs
@@ -106,6 +106,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSMOOUTSTK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
index 57aec1a7..6a3eb7fc 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs
@@ -110,6 +110,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
index 3c345233..ab1034ab 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs
@@ -77,7 +77,7 @@ namespace Tnb.WarehouseMgr
//判断目标库位是否自动签收
var loc = await _db.Queryable().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
//出库取起点,获取所有符合输入的载具规格的载具
- var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString()};
+ var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString() };
var outStkCarrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
// 判断最终目标库位是否可以放置当前载具
@@ -128,6 +128,10 @@ namespace Tnb.WarehouseMgr
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
+ startpoint_id = sPoint?.id!,
+ startpoint_code = sPoint?.point_code!,
+ endpoint_id = ePoint?.id!,
+ endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
@@ -152,7 +156,7 @@ namespace Tnb.WarehouseMgr
}
isOk = await _wareHouseService.GenPreTask(preTasks, null!);
}
- if(isOk)
+ if (isOk)
{
GenPreTaskUpInput preTaskUpInput = new()
{
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
index 0a37f8c1..108a2dde 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsKittingInStkService.cs
@@ -108,6 +108,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSKITTINGINSTK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
index 89de62ce..f63fcc9d 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutBaleService.cs
@@ -106,6 +106,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTBALE_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
index 3173ffbb..06a008b2 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutStockService.cs
@@ -219,6 +219,10 @@ namespace Tnb.WarehouseMgr
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
+ startpoint_id = sPoint?.id!,
+ startpoint_code = sPoint?.point_code!,
+ endpoint_id = ePoint?.id!,
+ endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTSTOCK_ID,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
index d89d3c80..f9251001 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveInStockService.cs
@@ -107,6 +107,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_CARRYMOVEINSTOCK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
index 1eb351ca..73c4274e 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDACarryMoveOutStockService.cs
@@ -102,6 +102,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSMOOUTSTK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
index c2abfc96..335f1de7 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDADeliveryService.cs
@@ -137,6 +137,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService!.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
index ad2de004..fda743f8 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyInstockService.cs
@@ -106,6 +106,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
index cae51fdc..1081258c 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAEmptyOutstockService .cs
@@ -116,6 +116,10 @@ namespace Tnb.WarehouseMgr
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
+ startpoint_id = sPoint?.id!,
+ startpoint_code = sPoint?.point_code!,
+ endpoint_id = ePoint?.id!,
+ endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID,
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
index d18391c3..08b138ae 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs
@@ -120,6 +120,10 @@ namespace Tnb.WarehouseMgr
endlocation_code = ePoint?.location_code ?? "",
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
+ startpoint_id = sPoint?.id!,
+ startpoint_code = sPoint?.point_code!,
+ endpoint_id = ePoint?.id!,
+ endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = input.data[nameof(WmsPretaskH.biz_type)]?.ToString() ?? "",
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
index 6e4c6ca2..741cc632 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInbaleService.cs
@@ -107,6 +107,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSINBALE_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
index 32c5d512..7fd8a1e7 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAOutBaleServiceService.cs
@@ -99,6 +99,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSOUTBALE_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
index 85a8f39c..9c75d48e 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDATransferService.cs
@@ -99,6 +99,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSTRANSFER_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
index 3c4b2012..7a34163e 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSetSortingService.cs
@@ -77,19 +77,18 @@ namespace Tnb.WarehouseMgr
List carryCodes = new();
List carryIds = new();
-
-
foreach (var os in setSortingDList)
{
- var OutStockStrategyInput = new OutStockStrategyQuery {
- carry_id = carryMat.carry_id,
- material_id = os.material_id,
- warehouse_id = os.warehouse_id,
- code_batch = os.code_batch,
+ var OutStockStrategyInput = new OutStockStrategyQuery
+ {
+ carry_id = carryMat.carry_id,
+ material_id = os.material_id,
+ warehouse_id = os.warehouse_id,
+ code_batch = os.code_batch,
};
var outStkCarrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
var carryCodesPart = await _db.Queryable().InnerJoin((a, b) => a.id == b.carry_id).InnerJoin((a, b, c) => a.location_id == c.id)
- .Where((a, b) => outStkCarrys.Select(x=>x.id).Contains(b.carry_id))
+ .Where((a, b) => outStkCarrys.Select(x => x.id).Contains(b.carry_id))
.Select()
.ToListAsync();
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
index c02ba155..fc30e89c 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsTransferService.cs
@@ -99,6 +99,10 @@ namespace Tnb.WarehouseMgr
preTask.endlocation_code = ePoint?.location_code!;
preTask.start_floor = sPoint?.floor.ToString();
preTask.end_floor = ePoint?.floor.ToString();
+ preTask.startpoint_id = sPoint?.id!;
+ preTask.startpoint_code = sPoint?.point_code!;
+ preTask.endpoint_id = ePoint?.id!;
+ preTask.endpoint_code = ePoint?.point_code!;
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSTRANSFER_ID;
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
index 632d7a22..8e1c0279 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs
@@ -191,6 +191,10 @@ namespace Tnb.WarehouseMgr
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
+ startpoint_id = sPoint?.id!,
+ startpoint_code = sPoint?.point_code!,
+ endpoint_id = ePoint?.id!,
+ endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = ko.biz_type,
diff --git a/common/Tnb.Common/Utils/HttpClientHelper.cs b/common/Tnb.Common/Utils/HttpClientHelper.cs
new file mode 100644
index 00000000..274ece91
--- /dev/null
+++ b/common/Tnb.Common/Utils/HttpClientHelper.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Reflection;
+using System.Security.Policy;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using JNPF.Logging;
+using Microsoft.AspNetCore.WebUtilities;
+using Newtonsoft.Json;
+
+namespace Tnb.Common.Utils
+{
+ public class ApiException : Exception
+ {
+ public int StatusCode { get; set; }
+
+ public string Content { get; set; }
+ }
+ ///
+ /// Http请求帮助类
+ /// added by ly on 20230801
+ ///
+ public class HttpClientHelper
+ {
+ private static readonly HttpClient HttpClient = new HttpClient();
+ private static Dictionary HttpClientDict = new Dictionary(StringComparer.OrdinalIgnoreCase);
+ public static string Url { get; private set; }
+
+ public static async Task HttpPostAsync(string url, string clientKey, string postData = null, Dictionary headers = null, string contentType = "application/json", int timeOut = 30)
+ {
+ using var client = HttpClientDict[clientKey];
+ if (headers != null)
+ {
+ foreach (var header in headers)
+ client.DefaultRequestHeaders.Add(header.Key, header.Value);
+ }
+ using HttpContent httpContent = new StringContent(postData, Encoding.UTF8);
+ if (contentType != null)
+ httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType);
+
+ var response = await client.PostAsync(url, httpContent);
+ return await response.Content.ReadAsStringAsync();
+ }
+
+
+ ///
+ /// 发起POST异步请求
+ ///
+ ///
+ ///
+ /// application/xml、application/json、application/text、application/x-www-form-urlencoded
+ /// 填充消息头
+ ///
+ public static async Task HttpPostAsync(string url, string postData = null, Dictionary headers = null, string contentType = "application/json", int timeOut = 30)
+ {
+ postData ??= "";
+ HttpResponseMessage response = null;
+ HttpClient client = null;
+ try
+ {
+
+ if (client == null)
+ client = new HttpClient();
+
+ //HttpClient.Timeout = new TimeSpan(0, 0, timeOut);
+ if (headers != null)
+ {
+ foreach (var header in headers)
+ client.DefaultRequestHeaders.Add(header.Key, header.Value);
+ }
+ //var request = new HttpRequestMessage(HttpMethod.Post, url);
+ //request.Headers.Accept.Clear();
+ //request.Headers.
+
+
+ using HttpContent httpContent = new StringContent(postData, Encoding.UTF8);
+ if (contentType != null)
+ httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType);
+
+ response = await client.PostAsync(url, httpContent);
+ }
+ catch (Exception ex)
+ {
+ client = new HttpClient();
+ }
+
+ return await response.Content.ReadAsStringAsync();
+ }
+
+ public static async Task PostFormDataAsync(string url, Dictionary pars)
+ {
+ var respJson = "";
+ try
+ {
+ var content = new FormUrlEncodedContent(pars);
+ var respBody = await HttpClient.PostAsync(url, content);
+ respJson = await respBody.Content.ReadAsStringAsync();
+ }
+ catch (Exception ex)
+ {
+ Log.Error("调用PostFormDataAsync时出错", ex);
+ }
+ return respJson;
+ }
+
+
+ public static async Task GetAsync(string url, Dictionary headers = null, Dictionary pars = null)
+ {
+ var reqUri = url;
+ if (pars?.Count > 0)
+ {
+ reqUri = QueryHelpers.AddQueryString(url, pars);
+ }
+ if (headers?.Count > 0)
+ {
+ foreach (var (k, v) in headers)
+ {
+ HttpClient.DefaultRequestHeaders.Add(k, v);
+ }
+ }
+ HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
+ var respBody = await HttpClient.GetAsync(reqUri);
+ var result = await respBody.Content.ReadAsStringAsync();
+ return result;
+ }
+
+
+ private static async Task PostStreamAsync(object content, CancellationToken cancellationToken)
+ {
+ using (var client = new HttpClient())
+ using (var request = new HttpRequestMessage(HttpMethod.Post, Url))
+ using (var httpContent = CreateHttpContent(content))
+ {
+ request.Content = httpContent;
+
+ using (var response = await client
+ .SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken)
+ .ConfigureAwait(false))
+ {
+ response.EnsureSuccessStatusCode();
+ }
+ }
+ }
+
+
+ private static HttpContent CreateHttpContent(object content)
+ {
+ HttpContent httpContent = null;
+
+ if (content != null)
+ {
+ var ms = new MemoryStream();
+ SerializeJsonIntoStream(content, ms);
+ ms.Seek(0, SeekOrigin.Begin);
+ httpContent = new StreamContent(ms);
+ httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
+ }
+
+ return httpContent;
+ }
+
+
+ public static void SerializeJsonIntoStream(object value, Stream stream)
+ {
+ using (var sw = new StreamWriter(stream, new UTF8Encoding(false), 1024, true))
+ using (var jtw = new JsonTextWriter(sw) { Formatting = Formatting.None })
+ {
+ var js = new JsonSerializer();
+ js.Serialize(jtw, value);
+ jtw.Flush();
+ }
+ }
+
+
+ private static T DeserializeJsonFromStream(Stream stream)
+ {
+ if (stream == null || stream.CanRead == false)
+ return default(T);
+
+ using (var sr = new StreamReader(stream))
+ using (var jtr = new JsonTextReader(sr))
+ {
+ var js = new JsonSerializer();
+ var searchResult = js.Deserialize(jtr);
+ return searchResult;
+ }
+ }
+ private static async Task StreamToStringAsync(Stream stream)
+ {
+ string content = null;
+
+ if (stream != null)
+ using (var sr = new StreamReader(stream))
+ content = await sr.ReadToEndAsync();
+
+ return content;
+ }
+
+ private static async Task> DeserializeFromStreamCallAsync(CancellationToken cancellationToken)
+ {
+ using (var client = new HttpClient())
+ using (var request = new HttpRequestMessage(HttpMethod.Get, Url))
+ using (var response = await client.SendAsync(request, cancellationToken))
+ {
+ var stream = await response.Content.ReadAsStreamAsync();
+
+ if (response.IsSuccessStatusCode)
+ return DeserializeJsonFromStream>(stream);
+
+ var content = await StreamToStringAsync(stream);
+ throw new ApiException
+ {
+ StatusCode = (int)response.StatusCode,
+ Content = content
+ };
+ }
+ }
+
+ private static async Task> DeserializeOptimizedFromStreamCallAsync(CancellationToken cancellationToken)
+ {
+ using (var client = new HttpClient())
+ using (var request = new HttpRequestMessage(HttpMethod.Get, Url))
+ using (var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken))
+ {
+ var stream = await response.Content.ReadAsStreamAsync();
+
+ if (response.IsSuccessStatusCode)
+ return DeserializeJsonFromStream>(stream);
+
+ var content = await StreamToStringAsync(stream);
+ throw new ApiException
+ {
+ StatusCode = (int)response.StatusCode,
+ Content = content
+ };
+ }
+ }
+
+ }
+}