From 6b6c66cd99a4e73eea9bc68c8d7c63fd08180fb9 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期二, 18 十一月 2025 16:12:46 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
index e41ddf5..328c761 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
@@ -43,7 +43,10 @@
public async Task<ResponseModel> FeedbackInbound(FeedbackInboundRequestModel model)
{
- string json = JsonConvert.SerializeObject(model);
+ string json =JsonConvert.SerializeObject(model, new JsonSerializerSettings
+ {
+ ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
+ });
var content = new StringContent(json, Encoding.UTF8, "application/json");
var _client = _httpClientFactory.CreateClient("MESUrl");
_client.DefaultRequestHeaders.Clear();
@@ -61,13 +64,18 @@
return JsonConvert.DeserializeObject<ResponseModel>(body);
}
- public async Task FeedbackOutbound(FeedbackOutboundRequestModel model)
+ public async Task<ResponseModel> FeedbackOutbound(FeedbackOutboundRequestModel model)
{
- string json = JsonConvert.SerializeObject(model);
+ string json = JsonConvert.SerializeObject(model, new JsonSerializerSettings
+ {
+ ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
+ });
var content = new StringContent(json, Encoding.UTF8, "application/json");
var _client = _httpClientFactory.CreateClient("MESUrl");
_client.DefaultRequestHeaders.Clear();
_client.DefaultRequestHeaders.Add("Accept", "application/json");
+
+ _logger.LogInformation("InvokeMESService FeedbackOutbound : " + json);
var response = await _client.PostAsync("AldMaterialOutbound/MaterialOutbound", content);
string body = await response.Content.ReadAsStringAsync();
@@ -78,12 +86,16 @@
throw new HttpRequestException(body);
}
- // JsonConvert.DeserializeObject<ResponseModel>(body);
+
+ return JsonConvert.DeserializeObject<ResponseModel>(body);
}
public async Task<ResponseModel> NewMaterielToMes(MaterielToMesDTO model)
{
- string json = JsonConvert.SerializeObject(model);
+ string json = JsonConvert.SerializeObject(model, new JsonSerializerSettings
+ {
+ ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
+ });
//string userDataEncoded = Uri.EscapeDataString(json);
@@ -104,7 +116,9 @@
var content = new StringContent(json, Encoding.UTF8, "application/json");
- using var response = await client.PostAsync("", content);
+ _logger.LogInformation("InvokeMESService FeedbackInbound : " + json);
+
+ using var response = await client.PostAsync("AldBarcodeInformation/BarcodeInformation", content);
var responseText = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
@@ -190,27 +204,29 @@
reqTime = DateTime.Now.ToString(),
business_type = inboundOrder.BusinessType,
factoryArea = inboundOrder.FactoryArea,
- operationType = 1,
+ operationType=1,
+ Operator= inboundOrder.Operator,
orderNo = inboundOrder.UpperOrderNo,
status = inboundOrder.OrderStatus,
details = new List<FeedbackInboundDetailsModel>()
};
- var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.Unit, item.WarehouseCode })
+ var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode })
.Select(group => new FeedbackInboundDetailsModel
{
materialCode = group.Key.MaterielCode,
supplyCode = group.Key.SupplyCode,
batchNo = group.Key.BatchNo,
lineNo = group.Key.InboundOrderRowNo,
+ qty = group.Sum(x=>x.BarcodeQty),
// warehouseCode = group.Key.WarehouseCode=="0"?"1072": group.Key.WarehouseCode,
- warehouseCode = "1072",
- unit = group.Key.Unit,
+ warehouseCode =group.Key.WarehouseCode,
+ unit = group.Key.BarcodeUnit,
barcodes = group.Select(row => new FeedbackBarcodesModel
{
barcode = row.Barcode,
- qty = row.StockQuantity
+ qty = row.BarcodeQty
}).ToList()
}).ToList();
feedmodel.details = groupedData;
--
Gitblit v1.9.3