修改舱位

usertest
jianghaiqing 4 months ago
parent cf4d370ec6
commit a0efae3abc

@ -1344,5 +1344,19 @@ public static class MultiLanguageConst
/// </summary>
[Description("预订舱数据已发送成功,不能修改")]
public const string SpaceBookingBeSendNotModify = "SpaceBooking_BeSend_NotModify";
/// <summary>
/// 舱位变更比对结果不存在
/// </summary>
[Description("舱位变更比对结果不存在")]
public const string SpaceBookingCompareResultNull = "SpaceBooking_CompareResultNull";
/// <summary>
/// 获取舱位变更比对结果错误,比对内容不存在
/// </summary>
[Description("获取舱位变更比对结果错误,比对内容不存在")]
public const string SpaceBookingCompareResultJSONNull = "SpaceBooking_CompareResult_JSONNull";
#endregion
}

@ -34,6 +34,11 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public class BookingSlotBaseDto
{
/// <summary>
/// Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 舱位提单号
/// </summary>
@ -313,6 +318,60 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
[Description("舱保类型名称")]
public string LoadGuaranteeFlagName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public long CreateBy { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
/// 修改人
/// </summary>
public long UpdateBy { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
public string UpdateUserName { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
public bool Deleted { get; set; } = false;
/// <summary>
/// 删除人名称
/// </summary>
public string DeleteUserName { get; set; }
/// <summary>
/// 删除时间
/// </summary>
public DateTime DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
public long DeleteBy { get; set; }
}
/// <summary>

@ -98,7 +98,7 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="file"></param>
/// <param name="modifyFile"></param>
/// <returns></returns>
Task<long> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null);
Task<DataResult<long>> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null);
/// <summary>
/// 获取舱位变更比对结果
@ -106,7 +106,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>
/// 导入舱位
@ -120,7 +120,7 @@ namespace DS.WMS.Core.Op.Interface
/// </summary>
/// <param name="model">生成订舱订单请求</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CreateBookingOrder(BookingGenerateDto model);
Task<DataResult<long>> CreateBookingOrder(BookingGenerateDto model);
/// <summary>
/// 检索舱位对应的订舱订单(BY 舱位主键)
@ -145,7 +145,7 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="bcSrcDto">BC详情</param>
/// <param name="bcTargetDto">BC变更后详情</param>
/// <returns>返回回执</returns>
Task<string> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto);
Task<DataResult<TaskManageExcuteResultDto>> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto);
/// <summary>
/// 推送BC变更比对
@ -179,7 +179,7 @@ namespace DS.WMS.Core.Op.Interface
/// </summary>
/// <param name="ids">舱位ID组</param>
/// <returns>返回舱位详情</returns>
Task<List<BookingSlotBaseSaveOutput>> GetSlotList(long[] ids);
Task<DataResult<List<BookingSlotBaseSaveOutput>>> GetSlotList(long[] ids);
/// <summary>
/// 获取合票详情(生成合票需要先调此方法)

@ -48,6 +48,7 @@ using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Map.Method;
using DS.Module.Core.Extensions;
using DS.Module.Core.Constants;
using Microsoft.Owin.Security.Provider;
namespace DS.WMS.Core.Op.Method
{
@ -1465,7 +1466,8 @@ namespace DS.WMS.Core.Op.Method
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 开始请求比对结果");
var compareResult = await ExcuteCompare(bcSrcDto, bcTargetDto);
var rlt = await ExcuteCompare(bcSrcDto, bcTargetDto);
var compareResult = rlt.Data;
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 请求比对结果完成,结果={JsonConvert.SerializeObject(compareResult)}");
@ -1536,71 +1538,6 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
#region 请求BC比对
/// <summary>
/// 请求BC比对
/// </summary>
/// <param name="bcSrcDto">BC详情</param>
/// <param name="bcTargetDto">BC变更后详情</param>
/// <returns>返回回执</returns>
[NonAction]
public async Task<TaskManageExcuteResultDto> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto)
{
TaskManageExcuteResultDto model = null;
/*
1URL
2JSON
3POST
4
*/
var url = bcCompareUrl; //App.Configuration["BCCompareUrl"];
using (var httpClient = new HttpClient())
{
try
{
using (var reduceAttach = new MultipartFormDataContent())
{
var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto)));
dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data")
{
Name = "srcJson"
};
reduceAttach.Add(dataContent);
var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto)));
dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data")
{
Name = "destJson"
};
reduceAttach.Add(dataContent2);
//请求
var response = httpClient.PostAsync(url, reduceAttach).Result;
var result = response.Content.ReadAsStringAsync().Result;
model = JsonConvert.DeserializeObject<TaskManageExcuteResultDto>(result);
Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果{JsonConvert.SerializeObject(model)}");
}
}
catch (Exception ex)
{
Logger.Log(NLog.LogLevel.Error, "推送BC比对异常原因{error}", ex.Message);
// throw Oops.Oh($"推送BC比对异常原因{ex.Message}");
}
}
return model;
}
#endregion
#region 获取合票详情(生成合票需要先调此方法)
/// <summary>
@ -2705,30 +2642,139 @@ namespace DS.WMS.Core.Op.Method
return data;
}
Task<long> IBookingSlotService.InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file, DynameFileInfo modifyFile)
#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);
Task<List<CompareResultDetailInfo>> IBookingSlotService.GetSlotCompareResult(long id, string batchNo)
{
throw new NotImplementedException();
}
var compareInfo = await tenantDb.Queryable<BookingSlotCompare>()
.FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo);
Task<TaskManageOrderResultDto> IBookingSlotService.CreateBookingOrder(BookingGenerateDto model)
{
throw new NotImplementedException();
if (compareInfo == null)
{
//舱位变更比对结果不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultNull)));
}
if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
//获取舱位变更比对结果错误,比对内容不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultJSONNull)));
}
if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
var json = JsonConvert.DeserializeObject<List<CompareResultDetailInfo>>(compareInfo.CompareRlt);
if (json != null)
{
return DataResult<List<CompareResultDetailInfo>>.Success(json);
}
return DataResult<List<CompareResultDetailInfo>>.FailedData(json);
}
return DataResult<List<CompareResultDetailInfo>>.FailedData(new List<CompareResultDetailInfo>());
}
#endregion
Task<string> IBookingSlotService.ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto)
#region 获取舱位详情列表
/// <summary>
/// 获取舱位详情列表
/// </summary>
/// <param name="ids">舱位ID组</param>
/// <returns>返回舱位详情</returns>
public async Task<DataResult<List<BookingSlotBaseSaveOutput>>> GetSlotList(long[] ids)
{
throw new NotImplementedException();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var slotList = await tenantDb.Queryable<BookingSlotBase>().Where(u => ids.Contains(u.Id) && u.Deleted == false).ToListAsync();
if (slotList.Count == 0)
{
//未查询到此舱位信息,可能已被删除,请重新查询后重试
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotBaseInfoNull)));
}
var data = slotList.Select(a => a.Adapt<BookingSlotBaseSaveOutput>()).ToList();
if (data != null)
return DataResult<List<BookingSlotBaseSaveOutput>>.Success(data);
return DataResult<List<BookingSlotBaseSaveOutput>>.FailedData(data);
}
#endregion
Task<List<BookingSlotBaseSaveOutput>> IBookingSlotService.GetSlotList(long[] ids)
#region 请求BC比对
/// <summary>
/// 请求BC比对
/// </summary>
/// <param name="bcSrcDto">BC详情</param>
/// <param name="bcTargetDto">BC变更后详情</param>
/// <returns>返回回执</returns>
public async Task<DataResult<TaskManageExcuteResultDto>> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto)
{
throw new NotImplementedException();
TaskManageExcuteResultDto model = null;
/*
1URL
2JSON
3POST
4
*/
using (var httpClient = new HttpClient())
{
try
{
using (var reduceAttach = new MultipartFormDataContent())
{
var dataContent = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcSrcDto)));
dataContent.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data")
{
Name = "srcJson"
};
reduceAttach.Add(dataContent);
var dataContent2 = new ByteArrayContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(bcTargetDto)));
dataContent2.Headers.ContentDisposition = new ContentDispositionHeaderValue($"form-data")
{
Name = "destJson"
};
reduceAttach.Add(dataContent2);
//请求
var response = httpClient.PostAsync(bcCompareUrl, reduceAttach).Result;
var result = response.Content.ReadAsStringAsync().Result;
model = JsonConvert.DeserializeObject<TaskManageExcuteResultDto>(result);
Logger.Log(NLog.LogLevel.Info, $"推送BC比返回结果{JsonConvert.SerializeObject(model)}");
}
}
catch (Exception ex)
{
Logger.Log(NLog.LogLevel.Info, "推送BC比对异常原因{error}", ex.Message);
// throw Oops.Oh($"推送BC比对异常原因{ex.Message}");
}
}
if (model != null)
return DataResult<TaskManageExcuteResultDto>.Success(model);
return DataResult<TaskManageExcuteResultDto>.FailedData(model);
}
#endregion
}
public static class LetterIndexUtil

@ -705,3 +705,10 @@
2024-07-22 18:36:53.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-22 18:36:53.5029 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-22 18:36:53.5029 Info Configuration initialized.
2024-07-23 11:25:15.5508 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-23 11:25:15.5655 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-23 11:25:15.5804 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-23 11:25:15.5871 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-23 11:25:15.5871 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-23 11:25:15.5871 Info Configuration initialized.

@ -6,7 +6,7 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl>
<History>True|2024-07-22T08:42:12.1933090Z||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History>
<History>True|2024-07-22T10:48:00.9436699Z||;True|2024-07-22T18:38:58.5618888+08:00||;True|2024-07-22T16:42:12.1933090+08:00||;True|2024-07-19T18:28:29.1420269+08:00||;True|2024-07-19T15:45:49.1068004+08:00||;True|2024-07-19T15:33:45.3242155+08:00||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
Loading…
Cancel
Save