修改舱位

usertest
jianghaiqing 4 months ago
parent 117ae32d0d
commit cb023c6e9b

@ -1400,7 +1400,20 @@ public static class MultiLanguageConst
/// </summary>
[Description("作废成功")]
public const string BookingSlotDeleteSucc = "BookingSlot_DeleteSucc";
/// <summary>
/// 舱位变更比对结果不存在
/// </summary>
[Description("舱位变更比对结果不存在")]
public const string BookingSlotCompareNull = "BookingSlot_CompareNull";
/// <summary>
/// 获取舱位变更比对结果错误,比对内容不存在
/// </summary>
[Description("获取舱位变更比对结果错误,比对内容不存在")]
public const string BookingSlotCompareJsonNull = "BookingSlot_CompareJsonNull";
#endregion

@ -121,7 +121,7 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
Task<List<CompareResultDetailInfo>> GetSlotCompareResult(long id, string batchNo);
Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult(long id, string batchNo);
/// <summary>
/// 导入舱位

@ -978,7 +978,7 @@ namespace DS.WMS.Core.Op.Method
dto.DataObj.CtnList.ForEach(t =>
{
if (!string.IsNullOrWhiteSpace(t.CtnAll) && string.IsNullOrWhiteSpace(t.CtnCode))
if ((!string.IsNullOrWhiteSpace(t.CtnAll) && string.IsNullOrWhiteSpace(t.CtnCode)) || (!string.IsNullOrWhiteSpace(t.CtnAll) && t.CtnAll == t.CtnCode))
{
var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.CtnName) &&
a.CtnName.Equals(t.CtnAll, StringComparison.OrdinalIgnoreCase));
@ -1799,7 +1799,8 @@ namespace DS.WMS.Core.Op.Method
}
}
var list = await GetAvailableSlots(null, model.MergeList, null);
var getRlt = await GetAvailableSlots(null, model.MergeList, null);
var list = getRlt.Data;
//舱位合票失败,校验库存为不可用,请确认正确的库存
if (list.Count == 0)
@ -1853,14 +1854,14 @@ namespace DS.WMS.Core.Op.Method
/// <param name="pageInfo">可选:分页信息</param>
public async Task<DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto input,PageWithTotal pageInfo)
{
var result = await GetAvailableSlots(input, null, pageInfo);
var rlt = await GetAvailableSlots(input, null, pageInfo);
SqlSugarPagedList<BookingSlotBaseWithCtnDto> pageResult = new()
{
PageIndex = pageInfo.PageNo,
PageSize = pageInfo.PageSize,
TotalCount = pageInfo.Total,
Items = result,
Items = rlt.Data,
};
return DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>.Success(pageResult);
}
@ -1874,7 +1875,7 @@ namespace DS.WMS.Core.Op.Method
/// <param name="slotIdListInput">筛选条件2舱位主键列表</param>
/// <param name="pageInfo">筛选条件3分页</param>
/// <returns>可用的舱位列表(含可用的箱子列表)</returns>
public async Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
List<long> slotIdListInput = null,
PageWithTotal pageInfo = null)
{
@ -1985,7 +1986,7 @@ namespace DS.WMS.Core.Op.Method
}
}
return result;
return DataResult<List<BookingSlotBaseWithCtnDto>>.Success(result);
}
#endregion
@ -2022,8 +2023,9 @@ namespace DS.WMS.Core.Op.Method
}
var slotIdList = slots.Select(s => s.Id).ToList();
var lsRlt = await GetAvailableSlots(null, slotIdList);
// 查询可用舱位及箱子列表
var latestSlotList = await GetAvailableSlots(null, slotIdList);
var latestSlotList = lsRlt.Data;
// 判断余量是否满足需求
foreach (var inSlotItem in slots)
@ -3469,10 +3471,6 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> IBookingSlotService.GetAvailableSlots(BookingSlotBaseDto slotInput, List<long> slotIdListInput, PageWithTotal pageInfo)
{
throw new NotImplementedException();
}
/// <summary>
/// 舱位台账查询
@ -3662,10 +3660,42 @@ namespace DS.WMS.Core.Op.Method
throw new NotImplementedException();
}
Task<List<CompareResultDetailInfo>> IBookingSlotService.GetSlotCompareResult(long id, string batchNo)
#region 获取舱位变更比对结果
/// <summary>
/// 获取舱位变更比对结果
/// </summary>
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult(long id, string batchNo)
{
throw new NotImplementedException();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var compareInfo = await tenantDb.Queryable<BookingSlotCompare>()
.FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo);
if (compareInfo == null)
{
//舱位变更比对结果不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotCompareNull)));
}
if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
//获取舱位变更比对结果错误,比对内容不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotCompareJsonNull)));
}
if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
var data = JsonConvert.DeserializeObject<List<CompareResultDetailInfo>>(compareInfo.CompareRlt);
return DataResult<List<CompareResultDetailInfo>>.Success(data);
}
return DataResult<List<CompareResultDetailInfo>>.FailedData(new List<CompareResultDetailInfo>());
}
#endregion
#region 获取舱位详情列表
/// <summary>

@ -182,7 +182,7 @@ namespace DS.WMS.OpApi.Controllers
[Route("GetSlotCompareResult")]
public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult([FromQuery] long id, [FromQuery] string batchNo)
{
return null;//await _bookingSlotService.GetSlotCompareResult(id, batchNo);
return await _bookingSlotService.GetSlotCompareResult(id, batchNo);
}
#endregion
@ -208,9 +208,9 @@ namespace DS.WMS.OpApi.Controllers
/// <returns>返回回执</returns>
[HttpPost]
[Route("CreateBookingOrder")]
public async Task<DataResult> CreateBookingOrder([FromBody] BookingGenerateDto model)
public async Task<DataResult<long>> CreateBookingOrder([FromBody] BookingGenerateDto model)
{
return null;// await _bookingSlotService.CreateBookingOrder(model);
return await _bookingSlotService.CreateBookingOrder(model);
}
#endregion

@ -810,3 +810,17 @@
2024-07-25 16:11:06.6047 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:11:06.6047 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:11:06.6305 Info Configuration initialized.
2024-07-25 16:35:26.1612 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 16:35:26.1790 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 16:35:26.1790 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 16:35:26.1968 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 16:35:26.2067 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:35:26.2067 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:35:26.2203 Info Configuration initialized.
2024-07-25 17:01:27.4675 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 17:01:27.4868 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 17:01:27.4868 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 17:01:27.5029 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 17:01:27.5029 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\bin\Debug\net8.0\nlog.config
2024-07-25 17:01:27.5133 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 17:01:27.5133 Info Configuration initialized.

Loading…
Cancel
Save