|
|
@ -48,6 +48,7 @@ using DS.WMS.Core.Code.Method;
|
|
|
|
using DS.WMS.Core.Map.Method;
|
|
|
|
using DS.WMS.Core.Map.Method;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.Module.Core.Constants;
|
|
|
|
using DS.Module.Core.Constants;
|
|
|
|
|
|
|
|
using Microsoft.Owin.Security.Provider;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1465,7 +1466,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 开始请求比对结果");
|
|
|
|
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)}");
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"批次={batchNo} slotId={slotId} 请求比对结果完成,结果={JsonConvert.SerializeObject(compareResult)}");
|
|
|
|
|
|
|
|
|
|
|
@ -1536,71 +1538,6 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#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;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
1、读取配置文件中的规则引擎URL
|
|
|
|
|
|
|
|
2、填充请求的类,并生成JSON报文
|
|
|
|
|
|
|
|
3、POST请求接口,并记录回执。
|
|
|
|
|
|
|
|
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 获取合票详情(生成合票需要先调此方法)
|
|
|
|
#region 获取合票详情(生成合票需要先调此方法)
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -2705,32 +2642,141 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
return data;
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var compareInfo = await tenantDb.Queryable<BookingSlotCompare>()
|
|
|
|
|
|
|
|
.FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (compareInfo == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//舱位变更比对结果不存在
|
|
|
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultNull)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Task<List<CompareResultDetailInfo>> IBookingSlotService.GetSlotCompareResult(long id, string batchNo)
|
|
|
|
if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
//获取舱位变更比对结果错误,比对内容不存在
|
|
|
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingCompareResultJSONNull)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Task<TaskManageOrderResultDto> IBookingSlotService.CreateBookingOrder(BookingGenerateDto model)
|
|
|
|
if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
var json = JsonConvert.DeserializeObject<List<CompareResultDetailInfo>>(compareInfo.CompareRlt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (json != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return DataResult<List<CompareResultDetailInfo>>.Success(json);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult<List<CompareResultDetailInfo>>.FailedData(json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Task<string> IBookingSlotService.ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto)
|
|
|
|
return DataResult<List<CompareResultDetailInfo>>.FailedData(new List<CompareResultDetailInfo>());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Task<List<BookingSlotBaseSaveOutput>> IBookingSlotService.GetSlotList(long[] ids)
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
1、读取配置文件中的规则引擎URL
|
|
|
|
|
|
|
|
2、填充请求的类,并生成JSON报文
|
|
|
|
|
|
|
|
3、POST请求接口,并记录回执。
|
|
|
|
|
|
|
|
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
|
|
|
|
public static class LetterIndexUtil
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|