u8出入库日志调整

This commit is contained in:
2025-09-09 13:16:51 +08:00
parent 8115615648
commit cc6dd177bd
4 changed files with 33 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ namespace ZR.Admin.WebApi.Controllers
/// <param name="parm"></param> /// <param name="parm"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("list")] [HttpGet("list")]
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:list")] [AllowAnonymous]
public IActionResult QueryWmGoodsRecord([FromQuery] WmGoodsRecordQueryDto parm) public IActionResult QueryWmGoodsRecord([FromQuery] WmGoodsRecordQueryDto parm)
{ {
var response = _WmGoodsRecordService.GetList(parm); var response = _WmGoodsRecordService.GetList(parm);
@@ -44,7 +44,7 @@ namespace ZR.Admin.WebApi.Controllers
/// <param name="Id"></param> /// <param name="Id"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("{Id}")] [HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:query")] [AllowAnonymous]
public IActionResult GetWmGoodsRecord(string Id) public IActionResult GetWmGoodsRecord(string Id)
{ {
var response = _WmGoodsRecordService.GetInfo(Id); var response = _WmGoodsRecordService.GetInfo(Id);
@@ -58,7 +58,7 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:add")] [AllowAnonymous]
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.INSERT)] [Log(Title = "成品库数据变动表", BusinessType = BusinessType.INSERT)]
public IActionResult AddWmGoodsRecord([FromBody] WmGoodsRecordDto parm) public IActionResult AddWmGoodsRecord([FromBody] WmGoodsRecordDto parm)
{ {
@@ -74,7 +74,7 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPut] [HttpPut]
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:edit")] [AllowAnonymous]
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.UPDATE)] [Log(Title = "成品库数据变动表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateWmGoodsRecord([FromBody] WmGoodsRecordDto parm) public IActionResult UpdateWmGoodsRecord([FromBody] WmGoodsRecordDto parm)
{ {
@@ -89,7 +89,7 @@ namespace ZR.Admin.WebApi.Controllers
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpDelete("{ids}")] [HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:wmgoodsrecord:delete")] [AllowAnonymous]
[Log(Title = "成品库数据变动表", BusinessType = BusinessType.DELETE)] [Log(Title = "成品库数据变动表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteWmGoodsRecord(string ids) public IActionResult DeleteWmGoodsRecord(string ids)
{ {

View File

@@ -133,6 +133,7 @@ namespace ZR.Service.mes.wms
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
Code = "IntoProductwarehouse", Code = "IntoProductwarehouse",
Partnumber = partnumbers.FirstOrDefault() ?? "无零件号", Partnumber = partnumbers.FirstOrDefault() ?? "无零件号",
ChangeType = 1,
ChangePackage = totalPackage, ChangePackage = totalPackage,
ChangeQuantity = totalPartnumber, ChangeQuantity = totalPartnumber,
Remark = $"货物入库\n仓库号:{location}\n零件号:{string.Join(',', partnumbers)}\n总箱数:{totalPackage}", Remark = $"货物入库\n仓库号:{location}\n零件号:{string.Join(',', partnumbers)}\n总箱数:{totalPackage}",
@@ -177,7 +178,7 @@ namespace ZR.Service.mes.wms
{ {
materialCode = item.Partnumber, materialCode = item.Partnumber,
location = item.LocationCode, location = item.LocationCode,
Qty = item.GoodsNumLogic.ToString(), Qty = item.GoodsNumAction.ToString(),
LotNo = dateString, LotNo = dateString,
createTime = DateTime.Now, createTime = DateTime.Now,
userID = createName, userID = createName,

View File

@@ -1,8 +1,8 @@
using Infrastructure.Attribute;
using SqlSugar;
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model.MES.wms; using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto; using ZR.Model.MES.wms.Dto;
using ZR.Service.mes.wms.IService; using ZR.Service.mes.wms.IService;
@@ -140,7 +140,25 @@ namespace ZR.Service.mes.wms
.IgnoreColumns(ignoreAllNullColumns: true) .IgnoreColumns(ignoreAllNullColumns: true)
.ExecuteCommand(); .ExecuteCommand();
} }
// 插入操作日志
var record = new WmGoodsRecord
{
// 日志属性初始化(同原逻辑)
Id = SnowFlakeSingle.Instance.NextId().ToString(),
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
Code = "AddWmGoodsOutProduction",
Partnumber = model.Partnumber ?? "无零件号",
ChangeType = 2,
ChangePackage = 1,
ChangeQuantity = model.GoodsNumLogic - model.GoodsNumAction,
Remark = $"网页单次货物出库\n仓库号:{model.LocationCode}\n零件号:{model.Partnumber}\n总箱数:{1}",
CreatedBy = model.CreatedBy,
CreatedTime = DateTime.Now
// 其他属性省略
};
if (Context.Insertable(record).ExecuteCommand() == 0)
throw new Exception("操作记录插入失败");
// 出库信息转发U8 // 出库信息转发U8
//1.构建信息 //1.构建信息
@@ -185,7 +203,7 @@ namespace ZR.Service.mes.wms
customerCode = _customerCode, customerCode = _customerCode,
materialCode = item.Partnumber, materialCode = item.Partnumber,
location = item.LocationCode, location = item.LocationCode,
Qty = item.GoodsNumLogic.ToString(), Qty = item.GoodsNumAction.ToString(),
// 批次号 // 批次号
LotNo = dateString, LotNo = dateString,
createTime = DateTime.Now, createTime = DateTime.Now,
@@ -428,7 +446,7 @@ namespace ZR.Service.mes.wms
customerCode = _customerCode, customerCode = _customerCode,
materialCode = item.Partnumber, materialCode = item.Partnumber,
location = item.LocationCode, location = item.LocationCode,
Qty = item.GoodsNumLogic.ToString(), Qty = item.GoodsNumAction.ToString(),
// 批次号 // 批次号
LotNo = dateString, LotNo = dateString,
createTime = DateTime.Now, createTime = DateTime.Now,

View File

@@ -652,14 +652,14 @@ namespace ZR.Service.mes.wms
{ {
Id = SnowFlakeSingle.Instance.NextId().ToString(), Id = SnowFlakeSingle.Instance.NextId().ToString(),
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
Code = "DoMaterialOut出库", Code = "DoMaterialOut",
Partnumber = partNumbers.FirstOrDefault() ?? "无零件号", Partnumber = partNumbers.FirstOrDefault() ?? "无零件号",
ChangeType = 2, ChangeType = 2,
ChangePackage = totalPackage, ChangePackage = totalPackage,
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 = $"货物出库,出库单号:{shipmentNum}\n客户{customerCode}\n零件号{string.Join(',', partNumbers)}\n处理插入{finalInsertCount}条,删除{finalDeleteCount}条",
CreatedBy = createBy, CreatedBy = createBy,
CreatedTime = DateTime.Now CreatedTime = DateTime.Now
}; };
@@ -1411,7 +1411,7 @@ namespace ZR.Service.mes.wms
{ {
Id = SnowFlakeSingle.Instance.NextId().ToString(), Id = SnowFlakeSingle.Instance.NextId().ToString(),
FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(), FkInventoryId = SnowFlakeSingle.Instance.NextId().ToString(),
Code = "PDA出库", Code = "PdaOutboundByOutOrderPlan",
Partnumber = partnumbers.FirstOrDefault() ?? "无零件号", Partnumber = partnumbers.FirstOrDefault() ?? "无零件号",
BlankNum = "", BlankNum = "",
ChangeType = 2, ChangeType = 2,
@@ -1488,7 +1488,7 @@ namespace ZR.Service.mes.wms
customerCode = _customerCode, customerCode = _customerCode,
materialCode = item.Partnumber, materialCode = item.Partnumber,
location = item.LocationCode, location = item.LocationCode,
Qty = item.GoodsNumLogic.ToString(), Qty = item.GoodsNumAction.ToString(),
LotNo = dateString, LotNo = dateString,
createTime = DateTime.Now, createTime = DateTime.Now,
userID = parm.Operator, userID = parm.Operator,