退货红单功能实现,以及出入库记录内容调整

This commit is contained in:
2025-10-09 23:21:03 +08:00
parent ec35781c1b
commit a669664fcc
5 changed files with 68 additions and 16 deletions

View File

@@ -89,18 +89,20 @@ namespace ZR.Service.mes.wms_u8
#region
public async Task<ERP_WMS_interactiveModelResult> InboundedAsync(
string urlBase,
List<ERP_WMS_interactiveModelQuery> models
List<ERP_WMS_interactiveModelQuery> models,
bool isRedSingle = false
)
{
return await ProcessAsyncRequest(urlBase, models, "inbounded", isInbound: true);
return await ProcessAsyncRequest(urlBase, models, "inbounded", isInbound: true, isRedSingle);
}
public async Task<ERP_WMS_interactiveModelResult> OutboundedAsync(
string urlBase,
List<ERP_WMS_interactiveModelQuery> models
List<ERP_WMS_interactiveModelQuery> models,
bool isRedSingle = false
)
{
return await ProcessAsyncRequest(urlBase, models, "outbounded", isInbound: false);
return await ProcessAsyncRequest(urlBase, models, "outbounded", isInbound: false, isRedSingle);
}
#endregion
@@ -154,10 +156,15 @@ namespace ZR.Service.mes.wms_u8
string urlBase,
List<ERP_WMS_interactiveModelQuery> models,
string action,
bool isInbound
bool isInbound,
bool isRedSingle = false
)
{
var operation = isInbound ? "异步入库" : "异步出库";
if(isRedSingle)
{
operation += "红单";
}
_logger.Info($"开始处理{operation}请求 - URL基础: {urlBase}, 记录数: {models?.Count ?? 0}");
// 1. 基础参数校验

View File

@@ -2,6 +2,7 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Aliyun.OSS;
using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model.MES.wms;
@@ -128,7 +129,6 @@ namespace ZR.Service.mes.wms
// 插入操作日志
var record = new WmGoodsRecord
{
// 日志属性初始化(同原逻辑)
Id = SnowFlakeSingle.Instance.NextId().ToString(),
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
Code = "IntoProductwarehouse",
@@ -136,10 +136,20 @@ namespace ZR.Service.mes.wms
ChangeType = 1,
ChangePackage = totalPackage,
ChangeQuantity = totalPartnumber,
Remark = $"货物入库\n仓库号:{location}\n零件号:{string.Join(',', partnumbers)}\n总箱数:{totalPackage}",
ActionTime = DateTime.Now,
Status = 1,
Remark =
"货物入库"
+ "\n零件号:"
+ string.Join(',', partnumbers)
+ "\n总箱数:"
+ totalPackage
+ "\n总零件数:"
+ totalPartnumber
+ "\n涉及批次号:\n"
+ string.Join(',', allPatchCodes),
CreatedBy = createName,
CreatedTime = DateTime.Now
// 其他属性省略
};
if (Context.Insertable(record).ExecuteCommand() == 0)
@@ -511,7 +521,7 @@ namespace ZR.Service.mes.wms
if (wmgoods == null || wmgoods.packagelist == null || wmgoods.packagelist.Length == 0)
throw new Exception("无传入箱,请检查传入数据!");
string location = string.IsNullOrEmpty(wmgoods.location) ? "LS" : wmgoods.location;
//string location = string.IsNullOrEmpty(wmgoods.location) ? "LS" : wmgoods.location;
string[] packageArray = wmgoods.packagelist;
// 去重校验
@@ -576,7 +586,18 @@ namespace ZR.Service.mes.wms
ChangeType = 4, // 4表示成品库退货操作
ChangePackage = totalPackage,
ChangeQuantity = -totalPartnumber, // 负数表示减少
Remark = $"货物从成品库退货\n仓库号:{location}\n零件号:{string.Join(',', partnumbers)}\n总箱数:{totalPackage}",
ActionTime = DateTime.Now,
Status = 1,
Remark =
"货物从成品库退货"
+ "\n零件号:"
+ string.Join(',', partnumbers)
+ "\n总箱数:"
+ totalPackage
+ "\n总零件数:"
+ totalPartnumber
+ "\n涉及批次号:\n"
+ string.Join(',', allPatchCodes),
CreatedBy = createName,
CreatedTime = DateTime.Now
};
@@ -626,8 +647,8 @@ namespace ZR.Service.mes.wms
lineno = "涂装生产线"
});
}
var u8ErpResult = await _eRP_WMS_InteractiveService.InboundedAsync(urlBase, u8PackageList);
//入库红单
var u8ErpResult = await _eRP_WMS_InteractiveService.InboundedAsync(urlBase, u8PackageList,true);
logger.Warn(u8ErpResult);
});

View File

@@ -1,6 +1,7 @@
using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Aliyun.OSS;
using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model.MES.wms;
@@ -151,7 +152,18 @@ namespace ZR.Service.mes.wms
ChangeType = 2,
ChangePackage = 1,
ChangeQuantity = model.GoodsNumLogic - model.GoodsNumAction,
Remark = $"网页单次货物出库\n仓库号:{model.LocationCode}\n零件号:{model.Partnumber}\n总箱数:{1}",
Remark =
"网页单次货物出库"
+ "\n出库单:"
+ "无"
+ "\n零件号:"
+ model.Partnumber
+ "\n总箱数:"
+ 1
+ "\n变动零件数:"
+ (model.GoodsNumLogic - model.GoodsNumAction)
+ "\n涉及批次号:\n"
+ string.Join(',', model.PackageCodeClient),
CreatedBy = model.CreatedBy,
CreatedTime = DateTime.Now
// 其他属性省略

View File

@@ -659,7 +659,19 @@ namespace ZR.Service.mes.wms
ChangeQuantity = totalPartCount,
ActionTime = DateTime.Now,
Status = 1,
Remark = $"货物出库,出库单号:{shipmentNum}\n客户{customerCode}\n零件号{string.Join(',', partNumbers)}\n处理插入{finalInsertCount}条,删除{finalDeleteCount}条",
Remark =
"货物出库"
+ "\n出库单:"
+ shipmentNum
+ "\n零件号:"
+ string.Join(',', partNumbers)
+ "\n总箱数:"
+ totalPackage
+ "\n总零件数:"
+ totalPartCount
+ "\n涉及批次号:\n"
+ string.Join(',', uniquePatchCodes)
+ $"\n处理插入{ finalInsertCount }条,删除{ finalDeleteCount }条",
CreatedBy = createBy,
CreatedTime = DateTime.Now
};