Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
@@ -52,7 +52,7 @@ namespace WMS.Web.Api.Controllers
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// 改箱保存-PDA
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace WMS.Web.Api.Controllers
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// 移箱保存-PDA
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace WMS.Web.Api.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存(出库)
|
||||
/// 出库保存(出库)-PDA
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace WMS.Web.Api.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据出库单任务编号搜索
|
||||
/// 根据出库单任务编号搜索-PDA出库
|
||||
/// </summary>
|
||||
/// <param name="billNo"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace WMS.Web.Api.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// 盘点保存-PDA
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -9,5 +9,44 @@ namespace WMS.Web.Core.Dto
|
||||
/// </summary>
|
||||
public class OpsBoxResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 对应老OPS的箱ID
|
||||
/// </summary>
|
||||
public int OpsBoxId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 箱编号(老OPS生成的箱号)
|
||||
/// </summary>
|
||||
public string BoxBillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 供应商Id
|
||||
/// </summary>
|
||||
public int? SupplierId { get; set; }
|
||||
/// <summary>
|
||||
/// 组织Id
|
||||
/// </summary>
|
||||
public int? OrgId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间(对应老OPS的创建时间)
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; } = DateTime.Now;
|
||||
/// <summary>
|
||||
/// 明细
|
||||
/// </summary>
|
||||
public List<OpsBoxDetailsResponse> Details = new List<OpsBoxDetailsResponse>();
|
||||
}
|
||||
public class OpsBoxDetailsResponse {
|
||||
/// <summary>
|
||||
/// 物料ID
|
||||
/// </summary>
|
||||
public int MaterialId { get; set; }
|
||||
/// <summary>
|
||||
/// 数量(装箱数量)
|
||||
/// </summary>
|
||||
public decimal Qty { get; set; }
|
||||
/// <summary>
|
||||
/// 序列号集
|
||||
/// </summary>
|
||||
public List<string> SerialNumbers { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
15
src/WMS.Web.Domain/IService/IBoxService.cs
Normal file
15
src/WMS.Web.Domain/IService/IBoxService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
|
||||
namespace WMS.Web.Domain.IService
|
||||
{
|
||||
public interface IBoxService
|
||||
{
|
||||
// 同步老Ops箱信息
|
||||
Task<Result> Sync();
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,6 @@ namespace WMS.Web.Domain.IService.Public
|
||||
{
|
||||
public interface IOpsService
|
||||
{
|
||||
Task GetBox(OpsBoxRequest request);
|
||||
Task<List<OpsBoxResponse>> GetBox(OpsBoxRequest request);
|
||||
}
|
||||
}
|
||||
|
||||
39
src/WMS.Web.Domain/Services/BoxService.cs
Normal file
39
src/WMS.Web.Domain/Services/BoxService.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
|
||||
namespace WMS.Web.Domain.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 箱服务信息
|
||||
/// </summary>
|
||||
public class BoxService: IBoxService
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ILoginService _loginService;
|
||||
public readonly IBasicsRepositories _transactionRepositories;
|
||||
private readonly IBoxRepositories _boxRepositories;
|
||||
private readonly IOpsService _opsService;
|
||||
public BoxService(IMapper mapper, ILoginService loginService,
|
||||
IBasicsRepositories transactionRepositories,
|
||||
IBoxRepositories boxRepositories, IOpsService opsService)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_loginService = loginService;
|
||||
_transactionRepositories = transactionRepositories;
|
||||
_boxRepositories = boxRepositories;
|
||||
_opsService = opsService;
|
||||
}
|
||||
|
||||
public Task<Result> Sync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,13 +32,15 @@ namespace WMS.Web.Domain.Services.Public
|
||||
_option = option?.Value;
|
||||
}
|
||||
|
||||
public async Task GetBox(OpsBoxRequest request)
|
||||
public async Task<List<OpsBoxResponse>> GetBox(OpsBoxRequest request)
|
||||
{
|
||||
var token = await GetToken();
|
||||
Dictionary<string, string> dicHeaders = new Dictionary<string, string>();
|
||||
dicHeaders.Add("Authorization", "Bearer " + token);
|
||||
//_httpClientService.BuildHttpClient(contentHeaders);
|
||||
var res= await _httpClientService.PostAsync<OpsReponse>(_option.Url + "BarCode/carton-box_api/carton-box", JsonConvert.SerializeObject(request), dicHeaders);
|
||||
var res = await _httpClientService.PostAsync<OpsReponse>(_option.Url + "BarCode/carton-box_api/carton-box", JsonConvert.SerializeObject(request), dicHeaders);
|
||||
if (!res.succeeded) return new List<OpsBoxResponse>();
|
||||
return JsonConvert.DeserializeObject<List<OpsBoxResponse>>(res.data.date);
|
||||
}
|
||||
|
||||
private async Task<string> GetToken()
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
x.UseJsonSerializer();
|
||||
});
|
||||
//用于注入
|
||||
q.UseMicrosoftDependencyInjectionJobFactory();
|
||||
q.UseMicrosoftDependencyInjectionJobFactory();
|
||||
});
|
||||
//.net core核心托管-添加Quartz服务器
|
||||
Services.AddQuartzServer(options =>
|
||||
@@ -237,19 +237,19 @@ namespace WMS.Web.Repositories.DependencyInjection
|
||||
Services.AddTransient<IErpService, ErpService>();
|
||||
Services.AddTransient<IBackRecordService, BackRecordService>();
|
||||
Services.AddTransient<IOpsService, OpsService>();
|
||||
|
||||
|
||||
Services.AddTransient<IErpBasicDataExtendService, ErpBasicDataExtendService>();
|
||||
|
||||
|
||||
|
||||
|
||||
Services.AddTransient<IBoxService, BoxService>();
|
||||
Services.AddTransient<IChangeMoveBoxService, ChangeMoveBoxService>();
|
||||
Services.AddTransient<ITakeStockService, TakeStockService>();
|
||||
Services.AddTransient<IOutStockService, OutStockService>();
|
||||
Services.AddTransient<IInStockService, InStockService>();
|
||||
Services.AddTransient<IInStockTaskService, InStockTaskService>();
|
||||
Services.AddTransient<IOutStockTaskService, OutStockTaskService>();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user