出入库回退增加备注
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.Entitys
|
||||
@@ -10,7 +13,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// wms出入库回退记录表
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[Table("t_wms_back_record")]
|
||||
[Table("t_wms_back_record")]
|
||||
public class BackRecord
|
||||
{
|
||||
/// <summary>
|
||||
@@ -89,5 +92,18 @@ namespace WMS.Web.Domain.Entitys
|
||||
}
|
||||
this.BillNo = "CR" + idStr;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改备注
|
||||
/// </summary>
|
||||
/// <param name="detailId"></param>
|
||||
/// <param name="remark"></param>
|
||||
/// <returns></returns>
|
||||
public Result UpdateRemark(int detailId, string remark)
|
||||
{
|
||||
var detail = this.Details.Where(w => w.Id == detailId).FirstOrDefault();
|
||||
if (detail == null) return Result.ReFailure(ResultCodes.NoDateError);
|
||||
detail.Remark = remark;
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using WMS.Web.Core;
|
||||
|
||||
namespace WMS.Web.Domain.Entitys
|
||||
{
|
||||
@@ -10,12 +11,12 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[Table("t_wms_back_record_details")]
|
||||
public class BackRecordDetails
|
||||
public class BackRecordDetails : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
public override int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 回退记录表ID
|
||||
/// </summary>
|
||||
@@ -39,5 +40,9 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 序列号集
|
||||
/// </summary>
|
||||
public List<string> SerialNumbers { get; set; } = new List<string>();
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,13 @@ namespace WMS.Web.Domain.IService
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> BackShelf(BackRecordOnOffRequest dto, BackRecordType type, LoginInDto loginInfo);
|
||||
|
||||
/// <summary>
|
||||
/// 修改备注
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> UpdateRemark(UpdateRemarkRequest dto, LoginInDto loginInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,5 +28,9 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
Task<BackRecord> Add(BackRecord entity, bool isTransaction = true);
|
||||
//修改
|
||||
Task<BackRecord> Edit(BackRecord entity, bool isTransaction = true);
|
||||
//获取
|
||||
Task<BackRecord> GetEntity(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace WMS.Web.Domain.Services
|
||||
else
|
||||
_logger.LogInformation($"回退上架:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId + loginInfo.UserInfo.Nickname}");
|
||||
//回退上下架:不能扫同样的箱,按箱入库时候
|
||||
if (dto.Details != null && dto.Details.Count != 0 && dto.Method== (int)InventoryInOutMethod.Box)
|
||||
if (dto.Details != null && dto.Details.Count != 0 && dto.Method == (int)InventoryInOutMethod.Box)
|
||||
{
|
||||
var mIds = dto.Details.GroupBy(g => g.MaterialNumber).Select(s => s.Key).ToList();
|
||||
foreach (var m in mIds)
|
||||
@@ -113,11 +113,11 @@ namespace WMS.Web.Domain.Services
|
||||
return boxInventoryResult;
|
||||
|
||||
//下架:需要解绑收货过的箱子
|
||||
if (entity.Type == BackRecordType.InstockOff)
|
||||
if (entity.Type == BackRecordType.InstockOff)
|
||||
{
|
||||
_logger.LogInformation("入库回退下架:" + entity.BillNo);
|
||||
var boxIds= entity.Details.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
|
||||
var unBindResult= await _inStockTaskBoxService.UnBind(boxIds, isTransaction);
|
||||
var boxIds = entity.Details.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
|
||||
var unBindResult = await _inStockTaskBoxService.UnBind(boxIds, isTransaction);
|
||||
_logger.LogInformation("入库回退下架-BOXID:" + JsonConvert.SerializeObject(boxIds));
|
||||
if (!unBindResult.IsSuccess)
|
||||
return unBindResult;
|
||||
@@ -132,5 +132,24 @@ namespace WMS.Web.Domain.Services
|
||||
return Result.ReSuccess();
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改备注
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<Result> UpdateRemark(UpdateRemarkRequest dto, LoginInDto loginInfo)
|
||||
{
|
||||
var entity = await _backRecordRepositories.GetEntity(dto.Id);
|
||||
if (entity == null) return Result.ReFailure(ResultCodes.NoDateError);
|
||||
|
||||
var res = entity.UpdateRemark(dto.DetailsId, dto.Remark);
|
||||
if (!res.IsSuccess) return res;
|
||||
|
||||
entity = await _backRecordRepositories.Edit(entity, true);
|
||||
if (entity == null) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user