退货红单功能实现,以及出入库记录内容调整
This commit is contained in:
@@ -56,12 +56,12 @@ namespace ZR.Admin.WebApi.Controllers.mes.wms
|
|||||||
bool data = this.Exitwarehouse.IsExistedWarehouse(originalCode);
|
bool data = this.Exitwarehouse.IsExistedWarehouse(originalCode);
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
msg = "存在";
|
msg = "货物存在";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = "不存在";
|
msg = "货物不存在";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ToResponse(new ApiResult(200, msg, data));
|
return ToResponse(new ApiResult(200, msg, data));
|
||||||
|
|||||||
@@ -89,18 +89,20 @@ namespace ZR.Service.mes.wms_u8
|
|||||||
#region 异步方法
|
#region 异步方法
|
||||||
public async Task<ERP_WMS_interactiveModelResult> InboundedAsync(
|
public async Task<ERP_WMS_interactiveModelResult> InboundedAsync(
|
||||||
string urlBase,
|
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(
|
public async Task<ERP_WMS_interactiveModelResult> OutboundedAsync(
|
||||||
string urlBase,
|
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
|
#endregion
|
||||||
|
|
||||||
@@ -154,10 +156,15 @@ namespace ZR.Service.mes.wms_u8
|
|||||||
string urlBase,
|
string urlBase,
|
||||||
List<ERP_WMS_interactiveModelQuery> models,
|
List<ERP_WMS_interactiveModelQuery> models,
|
||||||
string action,
|
string action,
|
||||||
bool isInbound
|
bool isInbound,
|
||||||
|
bool isRedSingle = false
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
var operation = isInbound ? "异步入库" : "异步出库";
|
var operation = isInbound ? "异步入库" : "异步出库";
|
||||||
|
if(isRedSingle)
|
||||||
|
{
|
||||||
|
operation += "红单";
|
||||||
|
}
|
||||||
_logger.Info($"开始处理{operation}请求 - URL基础: {urlBase}, 记录数: {models?.Count ?? 0}");
|
_logger.Info($"开始处理{operation}请求 - URL基础: {urlBase}, 记录数: {models?.Count ?? 0}");
|
||||||
|
|
||||||
// 1. 基础参数校验
|
// 1. 基础参数校验
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Aliyun.OSS;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using ZR.Model.MES.wms;
|
using ZR.Model.MES.wms;
|
||||||
@@ -128,7 +129,6 @@ namespace ZR.Service.mes.wms
|
|||||||
// 插入操作日志
|
// 插入操作日志
|
||||||
var record = new WmGoodsRecord
|
var record = new WmGoodsRecord
|
||||||
{
|
{
|
||||||
// 日志属性初始化(同原逻辑)
|
|
||||||
Id = SnowFlakeSingle.Instance.NextId().ToString(),
|
Id = SnowFlakeSingle.Instance.NextId().ToString(),
|
||||||
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
|
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
|
||||||
Code = "IntoProductwarehouse",
|
Code = "IntoProductwarehouse",
|
||||||
@@ -136,10 +136,20 @@ namespace ZR.Service.mes.wms
|
|||||||
ChangeType = 1,
|
ChangeType = 1,
|
||||||
ChangePackage = totalPackage,
|
ChangePackage = totalPackage,
|
||||||
ChangeQuantity = totalPartnumber,
|
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,
|
CreatedBy = createName,
|
||||||
CreatedTime = DateTime.Now
|
CreatedTime = DateTime.Now
|
||||||
// 其他属性省略
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Context.Insertable(record).ExecuteCommand() == 0)
|
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)
|
if (wmgoods == null || wmgoods.packagelist == null || wmgoods.packagelist.Length == 0)
|
||||||
throw new Exception("无传入箱,请检查传入数据!");
|
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;
|
string[] packageArray = wmgoods.packagelist;
|
||||||
|
|
||||||
// 去重校验
|
// 去重校验
|
||||||
@@ -576,7 +586,18 @@ namespace ZR.Service.mes.wms
|
|||||||
ChangeType = 4, // 4表示成品库退货操作
|
ChangeType = 4, // 4表示成品库退货操作
|
||||||
ChangePackage = totalPackage,
|
ChangePackage = totalPackage,
|
||||||
ChangeQuantity = -totalPartnumber, // 负数表示减少
|
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,
|
CreatedBy = createName,
|
||||||
CreatedTime = DateTime.Now
|
CreatedTime = DateTime.Now
|
||||||
};
|
};
|
||||||
@@ -626,8 +647,8 @@ namespace ZR.Service.mes.wms
|
|||||||
lineno = "涂装生产线"
|
lineno = "涂装生产线"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//入库红单
|
||||||
var u8ErpResult = await _eRP_WMS_InteractiveService.InboundedAsync(urlBase, u8PackageList);
|
var u8ErpResult = await _eRP_WMS_InteractiveService.InboundedAsync(urlBase, u8PackageList,true);
|
||||||
logger.Warn(u8ErpResult);
|
logger.Warn(u8ErpResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Aliyun.OSS;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using ZR.Model.MES.wms;
|
using ZR.Model.MES.wms;
|
||||||
@@ -151,7 +152,18 @@ namespace ZR.Service.mes.wms
|
|||||||
ChangeType = 2,
|
ChangeType = 2,
|
||||||
ChangePackage = 1,
|
ChangePackage = 1,
|
||||||
ChangeQuantity = model.GoodsNumLogic - model.GoodsNumAction,
|
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,
|
CreatedBy = model.CreatedBy,
|
||||||
CreatedTime = DateTime.Now
|
CreatedTime = DateTime.Now
|
||||||
// 其他属性省略
|
// 其他属性省略
|
||||||
|
|||||||
@@ -659,7 +659,19 @@ namespace ZR.Service.mes.wms
|
|||||||
ChangeQuantity = totalPartCount,
|
ChangeQuantity = totalPartCount,
|
||||||
ActionTime = DateTime.Now,
|
ActionTime = DateTime.Now,
|
||||||
Status = 1,
|
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,
|
CreatedBy = createBy,
|
||||||
CreatedTime = DateTime.Now
|
CreatedTime = DateTime.Now
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user