54 changed files with 39889 additions and 794 deletions
@ -0,0 +1,19 @@ |
|||
using System; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; |
|||
|
|||
public class BaererToken |
|||
{ |
|||
public string access_token { get; set; } |
|||
public long expires_in { get; set; } = 3600; |
|||
public string token_type { get; set; } |
|||
public string refresh_token { get; set; } |
|||
public string scope { get; set; } |
|||
} |
|||
|
|||
public class TokenInfo |
|||
{ |
|||
public BaererToken BaererToken { get; set; } = new(); |
|||
public DateTimeOffset GetTime { get; set; } = DateTimeOffset.Now; |
|||
public DateTimeOffset ExpireTime => GetTime.AddSeconds(BaererToken.expires_in); |
|||
} |
@ -0,0 +1,9 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; |
|||
|
|||
public interface ITokenService : ITransientDependency |
|||
{ |
|||
Task<BaererToken> GetTokenAsync(); |
|||
} |
@ -0,0 +1,57 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Net.Http; |
|||
using System.Net.Http.Headers; |
|||
using System.Net.Http.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Volo.Abp; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; |
|||
|
|||
public class TokenService : ITokenService |
|||
{ |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
public TokenService(IConfiguration configuration) |
|||
{ |
|||
_configuration = configuration; |
|||
} |
|||
|
|||
public virtual async Task<BaererToken> GetTokenAsync() |
|||
{ |
|||
const string routeString = "connect/token"; |
|||
|
|||
var baseUrl = _configuration["AuthServer:Authority"]; |
|||
var client_id = _configuration["Authentication:client_id"]; |
|||
var client_secret = _configuration["Authentication:client_secret"]; |
|||
var grant_type = _configuration["Authentication:grant_type"]; |
|||
var username = _configuration["Authentication:username"]; |
|||
var password = _configuration["Authentication:password"]; |
|||
var client = new HttpClient(); |
|||
client.BaseAddress = new Uri(baseUrl); |
|||
client.DefaultRequestHeaders.Accept.Clear(); |
|||
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); |
|||
|
|||
var content = new FormUrlEncodedContent(new[] |
|||
{ |
|||
new KeyValuePair<string, string>("client_id",client_id), |
|||
new KeyValuePair<string, string>("client_secret",client_secret), |
|||
new KeyValuePair<string, string>("grant_type",grant_type), |
|||
new KeyValuePair<string, string>("username",username), |
|||
new KeyValuePair<string, string>("password",password), |
|||
}); |
|||
|
|||
var response = await client.PostAsync(routeString, content).ConfigureAwait(false); |
|||
Console.WriteLine(response.RequestMessage.RequestUri); |
|||
if (!response.IsSuccessStatusCode) |
|||
{ |
|||
var str = await response.Content.ReadAsStringAsync().ConfigureAwait(false); |
|||
throw new UserFriendlyException(str); |
|||
} |
|||
|
|||
var dto = await response.Content.ReadFromJsonAsync<BaererToken>().ConfigureAwait(false); |
|||
return dto; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,72 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Net.Http; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Options; |
|||
using StackExchange.Redis; |
|||
using Volo.Abp.Application.Services; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
using static Volo.Abp.Identity.Settings.IdentitySettingNames; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Client; |
|||
public class WebServiceAppService : IReader |
|||
{ |
|||
private readonly IHttpClientFactory _httpClientFactory; |
|||
private readonly IOptions<InjectionMoldingTaskOptions> _options; |
|||
|
|||
public WebServiceAppService(IHttpClientFactory httpClientFactory, IOptions<InjectionMoldingTaskOptions> options) |
|||
{ |
|||
_httpClientFactory = httpClientFactory; |
|||
_options = options; |
|||
} |
|||
|
|||
public Task<List<IncomingFromExternal>> ReadAsync() |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="p_type"></param>
|
|||
/// <returns></returns>
|
|||
public async Task<string> WebApi(int p_type) |
|||
{ |
|||
|
|||
//var client = _httpClientFactory.CreateClient();
|
|||
//// 设置用户名和密码
|
|||
//var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"));
|
|||
//client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
|
|||
//// 发送HTTP请求
|
|||
//var response = await client.GetAsync("https://example.com/api/data");
|
|||
//if (response.IsSuccessStatusCode)
|
|||
//{
|
|||
// return await response.Content.ReadAsStringAsync();
|
|||
//}
|
|||
// SoapClient
|
|||
|
|||
|
|||
|
|||
|
|||
var address = _options.Value.AutoRemote.IpAddress; |
|||
var username = _options.Value.AutoRemote.UserName; |
|||
var password=_options.Value.AutoRemote.Password; |
|||
var token= _options.Value.AutoRemote.Token; |
|||
var client = _httpClientFactory.CreateClient(); |
|||
var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); |
|||
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials); |
|||
var response = await client.GetAsync("https://example.com/api/data").ConfigureAwait(false); |
|||
if (response.IsSuccessStatusCode) |
|||
{ |
|||
return await response.Content.ReadAsStringAsync(); |
|||
} |
|||
return "Error occurred"; |
|||
} |
|||
} |
@ -0,0 +1,181 @@ |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Shared.Application; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.BackFlushNote; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.MaterialRequest; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.PCK; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.ScrapNote; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class FawtygAutoMapperProfile : Profile |
|||
{ |
|||
public FawtygAutoMapperProfile() |
|||
{ |
|||
CreateMap<IncomingToWms, ArchivedIncomingToWms>(); |
|||
CreateMap<IncomingFromExternal, ArchivedIncomingFromExternal>(); |
|||
CreateMap<OutgoingFromWms, ArchivedOutgoingFromWms>(); |
|||
CreateMap<OutgoingToExternal, ArchivedOutgoingToExternal>(); |
|||
CreateMap<BackFlushNoteExchangeDto, BackFlushNoteEditInput>(); |
|||
CreateMap<BackFlushNoteDetailExchangeDto, BackFlushNoteDetailInput>(); |
|||
CreateMap<ProductReceiptNoteExchangeDto, ProductReceiptNoteEditInput>() |
|||
|
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.ProductionPlanNumber) |
|||
.Ignore(x => x.JobNumber) |
|||
.Ignore(x => x.WorkShop) //必填
|
|||
.Ignore(x => x.ReceiptType) |
|||
.Ignore(x => x.SourceNumber) |
|||
.Ignore(x => x.Worker) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.ExtraProperties); |
|||
|
|||
CreateMap<ProductReceiptNoteDetailExchangeDto, ProductReceiptNoteDetailInput>() |
|||
.Ignore(x => x.Shift) |
|||
.Ignore(x => x.ProdLine) |
|||
.Ignore(x => x.BomVersion) |
|||
.Ignore(x => x.Status) |
|||
.Ignore(x => x.PackingCode) |
|||
.Ignore(x => x.ContainerCode) |
|||
.Ignore(x => x.StdPackQty) |
|||
.Ignore(x => x.Lot) //必填
|
|||
.Ignore(x => x.SupplierBatch) |
|||
.Ignore(x => x.ArriveDate) |
|||
.Ignore(x => x.ProduceDate) |
|||
.Ignore(x => x.ExpireDate) |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2) |
|||
|
|||
.Ignore(x => x.RecommendContainerCode) |
|||
.Ignore(x => x.RecommendPackingCode) |
|||
.Ignore(x => x.RecommendSupplierBatch) |
|||
.Ignore(x => x.RecommendArriveDate) |
|||
.Ignore(x => x.RecommendProduceDate) |
|||
.Ignore(x => x.RecommendExpireDate) |
|||
.Ignore(x => x.RecommendLot) |
|||
.Ignore(x => x.RecommendToLocationCode) |
|||
.Ignore(x => x.RecommendToLocationArea) |
|||
.Ignore(x => x.RecommendToLocationGroup) |
|||
.Ignore(x => x.RecommendToLocationErpCode) |
|||
.Ignore(x => x.RecommendToWarehouseCode) |
|||
.Ignore(x => x.RecommendQty) |
|||
|
|||
.Ignore(t => t.HandledContainerCode) |
|||
.Ignore(x => x.HandledPackingCode) |
|||
.Ignore(x => x.HandledSupplierBatch) |
|||
.Ignore(x => x.HandledArriveDate) |
|||
.Ignore(x => x.HandledProduceDate) |
|||
.Ignore(x => x.HandledExpireDate) |
|||
.Ignore(x => x.HandledLot) |
|||
.Ignore(x => x.HandledToLocationCode) |
|||
.Ignore(x => x.HandledToLocationArea) |
|||
.Ignore(x => x.HandledToLocationGroup) |
|||
.Ignore(x => x.HandledToLocationErpCode) |
|||
.Ignore(x => x.HandledToWarehouseCode) |
|||
.Ignore(x => x.HandledQty); |
|||
|
|||
CreateMap<MaterialRequestExchangeDto, MaterialRequestEditInput>() |
|||
//必填
|
|||
.Ignore(x => x.Workshop) |
|||
.Ignore(x => x.ProdLine) |
|||
.Ignore(x => x.PreparationPlanNumber) |
|||
.Ignore(x => x.AutoSubmit) |
|||
.Ignore(x => x.AutoAgree) |
|||
.Ignore(x => x.AutoHandle) |
|||
.Ignore(x => x.AutoCompleteJob) |
|||
.Ignore(x => x.DirectCreateNote) |
|||
.Ignore(x => x.Worker) |
|||
.Ignore(x => x.ActiveDate) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.ExtraProperties); |
|||
|
|||
CreateMap<MaterialRequestDetailExchangeDto, MaterialRequestDetailInput>() |
|||
.Ignore(x => x.ProdLine) |
|||
.Ignore(x => x.WorkStation) |
|||
.Ignore(x => x.ExpiredTime) |
|||
.Ignore(x => x.RequestStatus) |
|||
.Ignore(x => x.ToLocationErpCode) |
|||
.Ignore(x => x.Uom) |
|||
.Ignore(x => x.StdPackQty) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2); |
|||
|
|||
CreateMap<IssueNoteExchangeDto, IssueNoteEditInput>() |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.ExtraProperties) |
|||
|
|||
.Ignore(x => x.JobNumber) |
|||
.Ignore(x => x.Workshop) |
|||
.Ignore(x => x.RequestNumber) |
|||
.Ignore(x => x.Worker) |
|||
.Ignore(x => x.ActiveDate) |
|||
; |
|||
|
|||
CreateMap<IssueNoteDetailExchangeDto, IssueNoteDetailInput>() |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2) |
|||
.Ignore(x => x.IssueTime) |
|||
.Ignore(x => x.ExpiredTime) |
|||
.Ignore(x => x.ProdLine) |
|||
.Ignore(x => x.WorkStation) |
|||
.Ignore(x => x.FromContainerCode) |
|||
.Ignore(x => x.ToContainerCode) |
|||
.Ignore(x => x.FromLot) |
|||
.Ignore(x => x.ToLot) |
|||
.Ignore(x => x.SupplierBatch) |
|||
.Ignore(x => x.ArriveDate) |
|||
.Ignore(x => x.ProduceDate) |
|||
.Ignore(x => x.ExpireDate) |
|||
.Ignore(x => x.FromLocationCode) |
|||
.Ignore(x => x.FromLocationErpCode) |
|||
.Ignore(x => x.FromWarehouseCode) |
|||
.Ignore(x => x.StdPackQty) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ToPackingCode) |
|||
.Ignore(x => x.ToWarehouseCode) |
|||
.Ignore(x => x.FromStatus) |
|||
.Ignore(x => x.ToStatus) |
|||
.Ignore(x => x.Uom) |
|||
.IgnoreIHasRecommendAndHandledFrom(); |
|||
|
|||
CreateMap<IssueNoteDTO, IssueNoteExchangeDto>() |
|||
.Ignore(x => x.Detail) |
|||
; |
|||
CreateMap<IssueNoteDetailDTO, IssueNoteDetailExchangeDto>(); |
|||
|
|||
CreateMap<ScrapNoteExchangeDto, ScrapNoteEditInput>() |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.ExtraProperties) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.JobNumber) |
|||
; |
|||
CreateMap<ScrapNoteDetailExchangeDto, ScrapNoteDetailInput>() |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2) |
|||
.Ignore(x => x.FromPackingCode) |
|||
.Ignore(x => x.ToPackingCode) |
|||
.Ignore(x => x.FromContainerCode) |
|||
.Ignore(x => x.ToContainerCode) |
|||
.Ignore(x => x.FromLot) |
|||
.Ignore(x => x.ToLot) |
|||
.Ignore(x => x.SupplierBatch) |
|||
.Ignore(x => x.ArriveDate) |
|||
.Ignore(x => x.ProduceDate) |
|||
.Ignore(x => x.ExpireDate) |
|||
.Ignore(x => x.ToWarehouseCode) |
|||
.Ignore(x => x.ToWarehouseCode) |
|||
.Ignore(x => x.Uom) |
|||
.Ignore(x => x.StdPackQty) |
|||
; |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
using System; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class HttpAuthorizationHandler : ISingletonDependency |
|||
{ |
|||
private readonly ITokenService _tokenService; |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
private static TokenInfo TokenInfo { get; } = new(); |
|||
|
|||
public HttpAuthorizationHandler(ITokenService tokenService, IConfiguration configuration) |
|||
{ |
|||
_tokenService = tokenService; |
|||
_configuration = configuration; |
|||
} |
|||
|
|||
public bool IsLoggedIn() |
|||
{ |
|||
if (!string.IsNullOrEmpty(TokenInfo.BaererToken?.access_token) && |
|||
TokenInfo.ExpireTime > DateTimeOffset.Now) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
var token = _tokenService.GetTokenAsync().Result; |
|||
TokenInfo.BaererToken = token; |
|||
TokenInfo.GetTime = DateTimeOffset.Now; |
|||
|
|||
return true; |
|||
} |
|||
|
|||
public string GetCurrentBearer() |
|||
{ |
|||
return TokenInfo.BaererToken.access_token; |
|||
} |
|||
} |
@ -0,0 +1,218 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Net.Http; |
|||
using System.Text; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.CodeAnalysis; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.Application.Services; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain; |
|||
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|||
using Win_in.Sfs.Wms.DataExchange.WMS.PCK; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
using System.Text.Json.Serialization; |
|||
using System.IdentityModel.Tokens.Jwt; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; |
|||
|
|||
public class InjectionMoldingRequestReader : IReader |
|||
{ |
|||
|
|||
private readonly IInjectionRequestAppService _injectionRequest; |
|||
private readonly IItemBasicAppService _itemService; |
|||
private readonly ILocationAppService _locService; |
|||
|
|||
private readonly IIncomingFromExternalManager _incomingFromExternalManager; |
|||
private readonly ILogger<InjectionMoldingRequestReader> _logger; |
|||
private readonly IOptions<InjectionMoldingTaskOptions> _options; |
|||
private readonly IHttpClientFactory _httpClientFactory; |
|||
|
|||
|
|||
public InjectionMoldingRequestReader( |
|||
IInjectionRequestAppService injectionRequest |
|||
, IIncomingFromExternalManager incomingFromExternalManager |
|||
, ILogger<InjectionMoldingRequestReader> logger |
|||
,IOptions<InjectionMoldingTaskOptions> options |
|||
, IHttpClientFactory httpClientFactory |
|||
,IItemBasicAppService itemService |
|||
,ILocationAppService locService |
|||
|
|||
) |
|||
{ |
|||
_injectionRequest = injectionRequest; |
|||
_incomingFromExternalManager = incomingFromExternalManager; |
|||
_logger = logger; |
|||
_options = options; |
|||
_httpClientFactory = httpClientFactory; |
|||
_itemService=itemService; |
|||
_locService = locService; |
|||
|
|||
} |
|||
|
|||
public virtual async Task<List<IncomingFromExternal>> ReadAsync() |
|||
{ |
|||
try |
|||
{ |
|||
var jobCondition = new SfsStoreRequestInputBase(); |
|||
Filter filter = new Filter() |
|||
{ |
|||
Action = "<>", |
|||
Column = "JobStatus", |
|||
Logic = EnumFilterLogic.And.ToString(), |
|||
Value = ((int)EnumJobStatus.Done).ToString() |
|||
}; |
|||
jobCondition.Condition.Filters.Add(filter); |
|||
var jobs = await _injectionRequest.GetAllListByFilterAsync(jobCondition).ConfigureAwait(false); |
|||
List<InjectionRequestEditInput> joblist = new List<InjectionRequestEditInput>(); |
|||
if (jobs.Count == 0) |
|||
{ |
|||
string camera =await ReaderCameraApi().ConfigureAwait(false); |
|||
|
|||
List<InjectionRequest> cameraList = new List<InjectionRequest>(); |
|||
|
|||
if (camera == "Error occured") |
|||
{ |
|||
_logger.LogError($"没有读取到摄像头信息{DateTime.Now},请检查网络"); |
|||
return new List<IncomingFromExternal>(); |
|||
} |
|||
|
|||
|
|||
|
|||
cameraList = System.Text.Json.JsonSerializer.Deserialize<List<InjectionRequest>>(camera);//camera转注塑叫料明细任务数据
|
|||
|
|||
|
|||
InjectionRequestEditInput input=new InjectionRequestEditInput(); |
|||
List<InjectionRequestDetailInput> injectionRequestDetails = new List<InjectionRequestDetailInput>(); |
|||
|
|||
foreach (var job in cameraList) { |
|||
|
|||
var detailInput = new InjectionRequestDetailInput() |
|||
{ |
|||
ItemCode = job.ItemCode, |
|||
ToLocationCode = job.ToLocCode, |
|||
Qty = job.Qty, |
|||
}; |
|||
injectionRequestDetails.Add(detailInput); |
|||
} |
|||
input.Details.AddRange(injectionRequestDetails); |
|||
var errors=await BindAsync(input.Details).ConfigureAwait(false);//零件仓库赋值
|
|||
if (errors.Count > 0) |
|||
{ |
|||
foreach (var error in errors) { |
|||
_logger.LogError(error); |
|||
} |
|||
return new List<IncomingFromExternal>(); |
|||
|
|||
} |
|||
await _injectionRequest.CreateAsync(input).ConfigureAwait(false); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
_logger.LogError(ex.Message); |
|||
} |
|||
return new List<IncomingFromExternal>(); |
|||
} |
|||
|
|||
private async Task<List<string>> BindAsync(List<InjectionRequestDetailInput> p_list) |
|||
{ |
|||
List<string> errors = new List<string>(); |
|||
|
|||
foreach (var request in p_list) |
|||
{ |
|||
var itm =await _itemService.GetByCodeAsync(request.ItemCode).ConfigureAwait(false); |
|||
if(itm == null) { errors.Add($"编号:{request.ItemCode}零件表中没找到!" ); }else |
|||
{ |
|||
request.ItemDesc1 = itm.Desc1; |
|||
request.ItemDesc2 = itm.Desc2; |
|||
request.ItemName = itm.Name; |
|||
|
|||
} |
|||
var loc = await _locService.GetByCodeAsync(request.ToLocationCode).ConfigureAwait(false); |
|||
if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); }else |
|||
{ |
|||
request.ToLocationCode = loc.Code; |
|||
request.ToLocationGroup = loc.LocationGroupCode; |
|||
request.ToLocationErpCode = loc.ErpLocationCode; |
|||
request.ToWarehouseCode= loc.WarehouseCode; |
|||
} |
|||
} |
|||
|
|||
|
|||
return errors; |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="p_type"></param>
|
|||
/// <returns></returns>
|
|||
public async Task<string> ReaderCameraApi() |
|||
{ |
|||
|
|||
var address = _options.Value.AutoRemote.IpAddress; |
|||
var username = _options.Value.AutoRemote.UserName; |
|||
var password = _options.Value.AutoRemote.Password; |
|||
var token = _options.Value.AutoRemote.Token; |
|||
var client = _httpClientFactory.CreateClient(); |
|||
var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); |
|||
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials); |
|||
var response = await client.GetAsync("https://example.com/api/data").ConfigureAwait(false); |
|||
if (response.IsSuccessStatusCode) |
|||
{ |
|||
return await response.Content.ReadAsStringAsync().ConfigureAwait(false); |
|||
} |
|||
|
|||
return "Error occurred"; |
|||
} |
|||
|
|||
public class InjectionRequest |
|||
{ |
|||
/// <summary>
|
|||
/// 零件吗
|
|||
/// </summary>
|
|||
public string ItemCode { get; set; } |
|||
/// <summary>
|
|||
/// 零件名称
|
|||
/// </summary>
|
|||
public string ItemName { get; set; } |
|||
/// <summary>
|
|||
/// 发运库位
|
|||
/// </summary>
|
|||
public string ToLocCode { get; set; } |
|||
/// <summary>
|
|||
/// 来源库位
|
|||
/// </summary>
|
|||
public string FromLocCode { get; set; } |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public decimal Qty { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.BackgroundWorkers; |
|||
using Volo.Abp.Threading; |
|||
using Volo.Abp.Uow; |
|||
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase |
|||
{ |
|||
private readonly string Incoming = "InjectionMoldingTask Incoming"; |
|||
|
|||
private readonly IOptions<InjectionMoldingTaskOptions> _options; |
|||
|
|||
public InjectionMoldingTaskIncomingBackgroundWorker( |
|||
AbpAsyncTimer timer, |
|||
IOptions<InjectionMoldingTaskOptions> options, |
|||
IServiceScopeFactory serviceScopeFactory |
|||
) : base(timer, serviceScopeFactory) |
|||
{ |
|||
_options = options; |
|||
Timer.Period = options.Value.IncomingOptions.PeriodSeconds * 1000; //default 10 minutes
|
|||
} |
|||
|
|||
[UnitOfWork] |
|||
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) |
|||
{ |
|||
Logger.LogInformation($"Starting: Handling {Incoming}"); |
|||
if (!_options.Value.IncomingOptions.Active) |
|||
{ |
|||
Logger.LogInformation($"{Incoming} is not active!"); |
|||
return; |
|||
} |
|||
int min = DateTime.Now.Hour*60+ DateTime.Now.Minute;//第二天00:05:00与当天23:55:00不执行避免tyrpnumber重复
|
|||
if ( (24*60-5)<= min || min <= 5) |
|||
{ |
|||
Logger.LogInformation($"{Incoming} 时间小于第二天00:05:00大于当天23:55:00"); |
|||
return; |
|||
} |
|||
Logger.LogInformation($"注塑任务");//缴库
|
|||
var reader = workerContext.ServiceProvider.GetService<InjectionMoldingRequestReader>(); |
|||
await reader.ReadAsync().ConfigureAwait(false); |
|||
Logger.LogInformation($"Completed: Handling {Incoming}"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
using System; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Volo.Abp; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class InjectionMoldingTaskAgentHostedService : IHostedService |
|||
{ |
|||
private readonly IAbpApplicationWithExternalServiceProvider _application; |
|||
private readonly IServiceProvider _serviceProvider; |
|||
private readonly InjectionMoldingTaskAgentService _agentService; |
|||
|
|||
public InjectionMoldingTaskAgentHostedService( |
|||
IAbpApplicationWithExternalServiceProvider application, |
|||
IServiceProvider serviceProvider, |
|||
InjectionMoldingTaskAgentService agentService) |
|||
{ |
|||
_application = application; |
|||
_serviceProvider = serviceProvider; |
|||
_agentService = agentService; |
|||
} |
|||
|
|||
public Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
_application.Initialize(_serviceProvider); |
|||
|
|||
_agentService.Start(); |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) |
|||
{ |
|||
_application.Shutdown(); |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
@ -0,0 +1,167 @@ |
|||
using System; |
|||
using System.Net.Http; |
|||
using System.Net.Http.Headers; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Polly; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Account; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.BackgroundJobs; |
|||
using Volo.Abp.BackgroundWorkers; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Modularity; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Label.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Host; |
|||
|
|||
using Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore; |
|||
|
|||
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(AbpAutoMapperModule), |
|||
typeof(AbpBackgroundJobsModule), |
|||
typeof(AbpBackgroundWorkersModule), |
|||
typeof(AbpHttpClientModule) |
|||
)] |
|||
[DependsOn( |
|||
typeof(StoreApplicationContractsModule), |
|||
typeof(InventoryApplicationContractsModule), |
|||
typeof(LabelApplicationContractsModule), |
|||
typeof(DataExchangeDomainModule), |
|||
typeof(DataExchangeEntityFrameworkCoreModule), |
|||
//typeof(DataExchangeDomainFawtygMesModule),
|
|||
//typeof(DataExchangeEntityFrameworkCoreFawtygModule),
|
|||
typeof(AbpAccountApplicationContractsModule) |
|||
)] |
|||
public class InjectionMoldingTaskAgentModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
|
|||
PreConfigure<AbpHttpClientBuilderOptions>(options => |
|||
{ |
|||
//Polly 重试3次
|
|||
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => |
|||
{ |
|||
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => |
|||
policyBuilder.WaitAndRetryAsync( |
|||
3, |
|||
i => TimeSpan.FromSeconds(Math.Pow(2, i)) |
|||
) |
|||
); |
|||
}); |
|||
|
|||
//默认添加Authorization Header: Bearer Token
|
|||
options.ProxyClientActions.Add((a, s, h) => |
|||
{ |
|||
var httpAuthorizationHandler = s.GetService<HttpAuthorizationHandler>(); |
|||
if (httpAuthorizationHandler != null && httpAuthorizationHandler.IsLoggedIn()) |
|||
{ |
|||
h.DefaultRequestHeaders.Authorization = |
|||
new AuthenticationHeaderValue("Bearer", httpAuthorizationHandler.GetCurrentBearer()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var configuration = context.Services.GetConfiguration(); |
|||
var env = context.Services.GetSingletonInstance<IHostEnvironment>(); |
|||
|
|||
context.SetConsoleTitleOfConsoleApp("MesAgent", env.EnvironmentName); |
|||
|
|||
ConfigureDbContext(); |
|||
|
|||
ConfigureOptions(configuration); |
|||
|
|||
context.Services.AddHostedService<InjectionMoldingTaskAgentHostedService>(); |
|||
|
|||
ConfigureAutoMapper(context); |
|||
|
|||
ConfigureHttpClientProxies(context); |
|||
|
|||
ConfigureAuthentication(context, configuration); |
|||
} |
|||
|
|||
private void ConfigureDbContext() |
|||
{ |
|||
Configure<AbpDbContextOptions>(options => |
|||
{ |
|||
options.UseSqlServer(); |
|||
//options.UseSqlServer<DbContext>();
|
|||
}); |
|||
} |
|||
|
|||
private void ConfigureOptions(IConfiguration configuration) |
|||
{ |
|||
Configure<InjectionMoldingTaskOptions>(configuration.GetSection("InjectionMoldingTaskOptions")); |
|||
} |
|||
|
|||
private void ConfigureAutoMapper(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAutoMapperObjectMapper<InjectionMoldingTaskAgentModule>(); |
|||
Configure<AbpAutoMapperOptions>(options => { options.AddMaps<InjectionMoldingTaskAgentModule>(validate: false); }); |
|||
} |
|||
|
|||
private static void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) |
|||
{ |
|||
var isAlwaysAllowAuthorization = configuration.GetValue<bool>("AuthServer:AlwaysAllowAuthorization"); |
|||
if (isAlwaysAllowAuthorization) |
|||
{ |
|||
//绕过授权服务,用于测试
|
|||
context.Services.AddAlwaysAllowAuthorization(); |
|||
} |
|||
else |
|||
{ |
|||
context.Services.AddHttpClient(); |
|||
context.Services.AddAuthentication() |
|||
.AddJwtBearer(options => |
|||
{ |
|||
options.Authority = configuration["AuthServer:Authority"]; |
|||
options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); |
|||
options.Audience = "DataExchange"; |
|||
options.BackchannelHttpHandler = new HttpClientHandler |
|||
{ |
|||
ServerCertificateCustomValidationCallback = |
|||
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator |
|||
}; |
|||
}); |
|||
} |
|||
} |
|||
|
|||
private static void ConfigureHttpClientProxies(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddHttpClientProxies( |
|||
typeof(BasedataApplicationContractsModule).Assembly, |
|||
"BaseData" |
|||
); |
|||
context.Services.AddHttpClientProxies( |
|||
typeof(StoreApplicationContractsModule).Assembly, |
|||
"Store" |
|||
); |
|||
context.Services.AddHttpClientProxies( |
|||
typeof(LabelApplicationContractsModule).Assembly, |
|||
"Label" |
|||
); |
|||
} |
|||
public override void OnApplicationInitialization( |
|||
ApplicationInitializationContext context) |
|||
{ |
|||
|
|||
context.AddBackgroundWorkerAsync<InjectionMoldingTaskIncomingBackgroundWorker>(); |
|||
// context.AddBackgroundWorkerAsync<InjectionMoldingTaskOutgoingBackgroundWorker>();
|
|||
} |
|||
} |
|||
|
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class InjectionMoldingTaskAgentService : ITransientDependency |
|||
{ |
|||
public void Start() |
|||
{ |
|||
Console.WriteLine("InjectionMoldingTask data exchange service has started..."); |
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
using System.Net; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class InjectionMoldingTaskOptions |
|||
{ |
|||
public DataExchangeOptions IncomingOptions { get; set; } |
|||
public DataExchangeOptions OutgoingOptions { get; set; } |
|||
|
|||
public InjectionAutoRemote AutoRemote { get; set; } |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
public class InjectionAutoRemote |
|||
{ |
|||
|
|||
public string IpAddress { set; get; } |
|||
public string UserName { set; get; } |
|||
public string Password { set; get; } |
|||
public string Token { set; get; } |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public class DataExchangeOptions |
|||
{ |
|||
public bool Active { get; set; } |
|||
public int PeriodSeconds { get; set; } = 60; |
|||
public int BatchSize { get; set; } = 10; |
|||
public int MaxCount { get; set; } = 100; |
|||
public int RetryTimes { get; set; } = 3; |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.BackgroundWorkers; |
|||
using Volo.Abp.Threading; |
|||
using Volo.Abp.Uow; |
|||
|
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class InjectionMoldingTaskOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase |
|||
{ |
|||
private readonly string Outgoing = "InjectionMoldingTaskOptions Outgoing"; |
|||
|
|||
private readonly IOptions<InjectionMoldingTaskOptions> _options; |
|||
|
|||
public InjectionMoldingTaskOutgoingBackgroundWorker( |
|||
AbpAsyncTimer timer |
|||
|
|||
|
|||
|
|||
, IOptions<InjectionMoldingTaskOptions> options |
|||
, IServiceScopeFactory serviceScopeFactory |
|||
) : base(timer, serviceScopeFactory) |
|||
{ |
|||
_options = options; |
|||
Timer.Period = options.Value.OutgoingOptions.PeriodSeconds * 1000; //default 10 minutes
|
|||
|
|||
} |
|||
|
|||
[UnitOfWork] |
|||
protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) |
|||
{ |
|||
Logger.LogInformation($"Starting: Handling {Outgoing}"); |
|||
if (!_options.Value.IncomingOptions.Active) |
|||
{ |
|||
Logger.LogInformation($"{Outgoing} is not active!"); |
|||
return; |
|||
} |
|||
|
|||
Logger.LogInformation($"Write Issue"); |
|||
|
|||
|
|||
|
|||
//var issueConvert = workerContext.ServiceProvider.GetRequiredService<IssuesConverter>();
|
|||
//var issueNoteList = await issueConvert.ConvertAsync().ConfigureAwait(false);
|
|||
//var issueWriter = workerContext.ServiceProvider.GetRequiredService<IssueNoteWriter>();
|
|||
//await issueWriter.WriteAsync(issueNoteList).ConfigureAwait(false);
|
|||
|
|||
Logger.LogInformation($"Completed: Handling {Outgoing}"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Serilog; |
|||
|
|||
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; |
|||
|
|||
public class Program |
|||
{ |
|||
public static async Task<int> Main(string[] args) |
|||
{ |
|||
IConfigurationRoot configuration = |
|||
new ConfigurationBuilder() |
|||
.AddJsonFile("serilogsettings.json", false, true) |
|||
.Build(); |
|||
|
|||
Log.Logger = new LoggerConfiguration() |
|||
.ReadFrom.Configuration(configuration) |
|||
.CreateLogger(); |
|||
|
|||
try |
|||
{ |
|||
Log.Information("Starting console host."); |
|||
await CreateHostBuilder(args).RunConsoleAsync().ConfigureAwait(false); |
|||
return 0; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Log.Fatal(ex, "Host terminated unexpectedly!"); |
|||
return 1; |
|||
} |
|||
finally |
|||
{ |
|||
Log.CloseAndFlush(); |
|||
} |
|||
|
|||
} |
|||
|
|||
internal static IHostBuilder CreateHostBuilder(string[] args) => |
|||
Host.CreateDefaultBuilder(args) |
|||
.UseAutofac() |
|||
.UseSerilog() |
|||
.ConfigureAppConfiguration((context, config) => |
|||
{ |
|||
//setup your additional configuration sources
|
|||
}) |
|||
.ConfigureServices((hostContext, services) => |
|||
{ |
|||
services.AddApplication<InjectionMoldingTaskAgentModule>(); |
|||
}); |
|||
} |
@ -0,0 +1,43 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net6.0</TargetFramework> |
|||
<LangVersion>latest</LangVersion> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.12" /> |
|||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.12" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.12" /> |
|||
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.3.0" /> |
|||
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" /> |
|||
<PackageReference Include="Volo.Abp.BackgroundJobs" Version="5.3.5" /> |
|||
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="5.3.5" /> |
|||
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.3.5" /> |
|||
<PackageReference Include="Volo.Abp.Http.Client" Version="5.3.5" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\Modules\Label\src\Win_in.Sfs.Label.Application.Contracts\Win_in.Sfs.Label.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj" /> |
|||
<ProjectReference Include="..\..\..\Modules\Store\src\Win_in.Sfs.Wms.Store.Application.Contracts\Win_in.Sfs.Wms.Store.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\src\Win_in.Sfs.Wms.DataExchange.Application.Contracts\Win_in.Sfs.Wms.DataExchange.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\src\Win_in.Sfs.Wms.DataExchange.Domain\Win_in.Sfs.Wms.DataExchange.Domain.csproj" /> |
|||
<ProjectReference Include="..\..\src\Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore\Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Include="appsettings.json"> |
|||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
|||
</Content> |
|||
<Content Include="serilogsettings.json"> |
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> |
|||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
|||
</Content> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
@ -0,0 +1,88 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True;Encrypt=false", |
|||
"DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=Wms_DataExchange_Main_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True;Encrypt=false", |
|||
"MES": "Server=10.164.113.32,1818\\SHDB;Database=MES_SH;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True;Encrypt=false" |
|||
}, |
|||
|
|||
"AuthServer": { |
|||
"Authority": "http://dev.ccwin-in.com:60083", |
|||
"RequireHttpsMetadata": "false", |
|||
"SwaggerClientId": "admin", |
|||
"SwaggerClientSecret": "1q2w3E*", |
|||
"grant_type": "password", |
|||
"AlwaysAllowAuthorization": true |
|||
}, |
|||
|
|||
"Authentication": { |
|||
"client_id": "Auth_App", |
|||
"client_secret": "1q2w3e*", |
|||
"grant_type": "password", |
|||
"username": "jiekou", |
|||
"password": "1q2w3E*" |
|||
}, |
|||
|
|||
|
|||
"RemoteServices": { |
|||
|
|||
|
|||
"Inventory": { |
|||
"BaseUrl": "http://localhost:59095/" |
|||
}, |
|||
"Job": { |
|||
"BaseUrl": "http://localhost:59095/" |
|||
}, |
|||
"Label": { |
|||
"BaseUrl": "http://dev.ccwin-in.com:60082/" |
|||
}, |
|||
"Message": { |
|||
"BaseUrl": "http://dev.ccwin-in.com:60082/" |
|||
}, |
|||
"Store": { |
|||
"BaseUrl": "http://localhost:59095/" |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//"RemoteServices": { |
|||
// "BaseData": { |
|||
// "BaseUrl": "http://10.164.113.31:60084/" |
|||
// }, |
|||
// "Store": { |
|||
// "BaseUrl": "http://10.164.113.31:60085/" |
|||
// }, |
|||
// "Label": { |
|||
// "BaseUrl": "http://10.164.113.31:60082/" |
|||
// } |
|||
|
|||
//}, |
|||
"InjectionMoldingTaskOptions": { |
|||
|
|||
"AutoRemote": { |
|||
"IpAddress": "http://10.164.113.31:60085/", |
|||
"UserName": "", |
|||
"Password": "", |
|||
"Token": "" |
|||
|
|||
}, |
|||
|
|||
"IncomingOptions": { |
|||
"Active": true, |
|||
"PeriodSeconds": 10, |
|||
"BatchSize": 10, |
|||
"MaxCount": 100, |
|||
"RetryTimes": 3 |
|||
}, |
|||
"OutgoingOptions": { |
|||
"Active": true, |
|||
"PeriodSeconds": 10, |
|||
"BatchSize": 10, |
|||
"MaxCount": 100, |
|||
"RetryTimes": 3 |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,39 @@ |
|||
{ |
|||
"Serilog": { |
|||
"Using": [ "Serilog.Sinks.File", "Serilog.Sinks.Async", "Serilog.Sinks.Console", "Serilog.Sinks.MSSqlServer" ], |
|||
"MinimumLevel": { |
|||
"Default": "Debug", |
|||
"Override": { |
|||
"Microsoft": "Information", |
|||
"Microsoft.EntityFrameworkCore": "Warning" |
|||
} |
|||
}, |
|||
"WriteTo": [ |
|||
{ |
|||
"Name": "Async", |
|||
"Args": { |
|||
"configure": [ |
|||
{ |
|||
"Name": "File", |
|||
"Args": { |
|||
"path": "..//Logs//MesAgent//MesAgent_.log", |
|||
"rollingInterval": "Day", |
|||
"fileSizeLimitBytes": "52428800", |
|||
"rollOnFileSizeLimit": "true", |
|||
"restrictedToMinimumLevel": "Debug" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"Name": "Console", |
|||
"Args": { |
|||
"restrictedToMinimumLevel": "Debug", |
|||
"outputTemplate": "{Timestamp:HH:mm:ss.fff} [{Level:u3}] {Message} {NewLine}{Exception}" |
|||
} |
|||
} |
|||
], |
|||
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ] |
|||
} |
|||
} |
@ -0,0 +1 @@ |
|||
{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"oAL-OdQF7tHgMYho6jsPrxtuvDFdF0T6IRBihCrz0b_IB-aqWTVMTe5uilRgmY3aAzQC8mCmkFamneGLZy7QplZlOc57TSv64zAeRBSCyIfn1gvWCj7_p6qI7lElu0QHwnaErfDHsV47sIukRf_q2sE9ZVfHBYKNMLR_kbZZlzs3YZCIiiJwFbE6VKZ2HH2s9gf-DSpJ5WIGnyeAswZflNjkQdUbUl8tJCOHyi7BC60sCoPqASEeRIyarMG7AKjMw44rTs5TGpTp8uoPg4XhV4xP4LzX436gFFjrhf_EOo5UI2d6UCLwQNGWmrpWjLUAs7QjjcxH4sSaniDR51DTnQ","DP":"ayJZOPaME1B4c7tLZJdTpXCF5AUXUnS-Bq_buYxZAYXLaOdxJHjltCSLTdQ7p6Y1Y4tISg74uXFzmx18ERbi5WNMzhsGAezSDV_PWePu6Ujpm--F7TcE3aYRs0srsnbFWq57W2DusxwjWr_a-g08zP10O4IJP5WmE5rd4xQDO_s","DQ":"Q80U7ZCxMDcpmO87VHYS9sIZdoHu7PXK7mdjxTuTXYJTOE4BBMwacF-MbPO_Smno9-p32RnH7rJp8dpSevU5sUwT-xEPpGbJILBnFGesmBMiOiK5aKBhZ60T4gw6VNf_iIBHuIYB9MGybJfbf-7iZ7aGgNGdwr5XKITDahq_5Jk","E":"AQAB","K":null,"KeyId":"D6178DB50135E8E220498A66064AEF08","Kid":"D6178DB50135E8E220498A66064AEF08","Kty":"RSA","N":"tqqOx4HSDkuiEXAzYdJxsXyhXnXYaezE5KCHy4Mx6lFDmJfx6IQf9dhcCrumCga_1PfxXdV0R2OHo4i67yiQm-0XRgx7W87S6LR7ARraVme25SiOnZEtwlauYvEXz0cCR-bhvLwLTOPjptSKHl5DVl8Lcw7PjBpJLDP1zqCFMgU-KVusNoaruLFBb3zdgYt7ovzBOj94UkRAy5cLmAJKh73IOyExM-fO7rTR7dyc1jstNbUGhdX3fui3f0hUGsNOCvIyaaJn2SuGbSo5loWHBFtNkLHrXD9dLirJaXqkP7zK4rAYu0KrFqUp9LA_RNK2QLD2LnucCsmLPzz3jnpufQ","Oth":null,"P":"4D4K7xT2s-TJyUzbFZDsGPzD1kLbuB3lQnp6_tkHg0GrXgojf-obIviQPqhKmOQN-qAq0hoSVYXXmUCf-iMsV0XM6UcChI6GSO3dAQyB-e6TdCIw6kSEEJrhr6tadwOnOFb6HssX7n5nxw47dJV7ORQ6tjrTGi3IdlTUl8uo1-c","Q":"0Ikp47a-_VxvflocNK_6YyeNukMOjEmGqIQWQgXGJv6dd2-_ox6BztA9qcmmfuKU5xmD9aOlj_WIATRi3meSH7DdiGYCd-56QDj-Lvwej6_27rX8lISQ2D0TQqgPZCGAE_1PvIAmYfv0D7GrCFevJrJ2Z5zLC6GK61WjC0V3afs","QI":"Xk7BkXcsdP-RQc1VaJqQ9krQftyYlsxM6hC6x80y7fi7tR6g68GwrNdIw-dPE_bHQuD7DKwq8FFMROzR4t2cRTOGhlKj7VgJ8N8soXzXxUAmerhOXMJ1nJOAnNBSTglVFVUqdZMgOfPbClgg29tRBPQgrKnN_-yzXgglCB6rqPU","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true,"SignatureProviderObjectPoolCacheSize":32}} |
@ -0,0 +1,195 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text.Json; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Polly.Caching; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Auth.Application.Contracts; |
|||
using Win_in.Sfs.Basedata.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs; |
|||
|
|||
/// <summary>
|
|||
/// 注塑叫料任务
|
|||
/// </summary>
|
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}job/injection")] |
|||
public class InjectionJobController : AbpController |
|||
{ |
|||
private readonly IInjectionJobAppService _injectionJobAppService; |
|||
|
|||
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
|||
|
|||
private readonly IDictAppService _dictApp; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="injectionJobAppService"></param>
|
|||
/// <param name="userWorkGroupAppService"></param>
|
|||
public InjectionJobController( |
|||
IInjectionJobAppService injectionJobAppService, |
|||
IDictAppService dictApp |
|||
, IUserWorkGroupAppService userWorkGroupAppService) |
|||
{ |
|||
_userWorkGroupAppService = userWorkGroupAppService; |
|||
_injectionJobAppService = injectionJobAppService; |
|||
_dictApp = dictApp; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取任务详情
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{id}")] |
|||
|
|||
public virtual async Task<ActionResult<InjectionJobDTO>> GetAsync(Guid id) |
|||
{ |
|||
var result = await _injectionJobAppService.GetAsync(id).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表 筛选
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("list")] |
|||
public virtual async Task<PagedResultDto<InjectionJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO) |
|||
{ |
|||
var list = await _injectionJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false); |
|||
return list; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="pageSize"></param>
|
|||
/// <param name="pageIndex"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("list")] |
|||
public virtual async Task<PagedResultDto<InjectionJobDTO>> GetListAsync(int pageSize, int pageIndex) |
|||
{ |
|||
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; |
|||
var jsonStatus = JsonSerializer.Serialize(status); |
|||
|
|||
var request = new SfsJobRequestInputBase |
|||
{ |
|||
MaxResultCount = pageSize, |
|||
SkipCount = (pageIndex - 1) * pageSize, |
|||
Sorting = $"{nameof(InjectionJobDTO.CreationTime)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(IssueJobDTO.JobStatus),jsonStatus,"In") |
|||
} |
|||
} |
|||
|
|||
}; |
|||
|
|||
var list = await _injectionJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
|||
|
|||
|
|||
return list; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 根据Job Number 获取任务列表
|
|||
/// </summary>
|
|||
/// <param name="jobNumber"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("by-number/{jobNumber}")] |
|||
public virtual async Task<ActionResult<InjectionJobDTO>> GetByNumberAsync(string jobNumber) |
|||
{ |
|||
var jobDto = await _injectionJobAppService.GetByNumberAsync(jobNumber).ConfigureAwait(false); |
|||
if (jobDto == null) |
|||
{ |
|||
throw new UserFriendlyException($"未找到编号为 {jobNumber} 的任务"); |
|||
} |
|||
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); |
|||
if (!wlgCodes.Contains(jobDto.WorkGroupCode)) |
|||
{ |
|||
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); |
|||
} |
|||
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id) |
|||
{ |
|||
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理"); |
|||
} |
|||
return jobDto; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取任务数量
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet("count")] |
|||
public virtual async Task<ActionResult<long>> CountAsync() |
|||
{ |
|||
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); |
|||
var jsonCodes = JsonSerializer.Serialize(wlgCodes); |
|||
|
|||
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; |
|||
var jsonStatus = JsonSerializer.Serialize(status); |
|||
|
|||
var request = new SfsJobRequestInputBase |
|||
{ |
|||
Sorting = $"{nameof(InjectionJobDTO.Priority)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(InjectionJobDTO.WorkGroupCode),jsonCodes,"In"), |
|||
new(nameof(InjectionJobDTO.JobStatus),jsonStatus,"In") |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var count = await _injectionJobAppService.GetCountByFilterAsync(request).ConfigureAwait(false); |
|||
|
|||
return Ok(count); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 承接任务
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("take/{id}")] |
|||
public virtual async Task TakeAsync(Guid id) |
|||
{ |
|||
await _injectionJobAppService.AcceptAsync(id).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 取消承接任务
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("cancel-take/{id}")] |
|||
public virtual async Task CancelTakeAsync(Guid id) |
|||
{ |
|||
await _injectionJobAppService.CancelAcceptAsync(id).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 执行任务
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="dto"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("finish/{id}")] |
|||
public virtual async Task FinishAsync(Guid id, [FromBody] InjectionJobDTO dto) |
|||
{ |
|||
await _injectionJobAppService.CompleteAsync(id, dto).ConfigureAwait(false); |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; |
|||
|
|||
/// <summary>
|
|||
/// 注塑叫料记录
|
|||
/// </summary>
|
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}store/injection-note")] |
|||
|
|||
public class InjectionNoteController : AbpController |
|||
{ |
|||
private readonly IInjectionNoteAppService _injectionNoteAppService; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="injectionNoteAppService"></param>
|
|||
public InjectionNoteController(IInjectionNoteAppService injectionNoteAppService) |
|||
{ |
|||
_injectionNoteAppService = injectionNoteAppService; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建注塑叫料记录
|
|||
/// </summary>
|
|||
/// <param name="input">CreateInput</param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("")] |
|||
public virtual async Task CreateAsync(InjectionNoteEditInput input) |
|||
{ |
|||
await _injectionNoteAppService.CreateAsync(input).ConfigureAwait(false); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; |
|||
|
|||
/// <summary>
|
|||
/// 注塑叫料请求
|
|||
/// </summary>
|
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}store/injection-request")] |
|||
|
|||
public class InjectionRequestController : AbpController |
|||
{ |
|||
private readonly IInjectionRequestAppService _injectionRequestAppService; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="InjectionRequestAppService"></param>
|
|||
public InjectionRequestController(IInjectionRequestAppService InjectionRequestAppService) |
|||
{ |
|||
_injectionRequestAppService = InjectionRequestAppService; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 注塑叫料申请
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("")] |
|||
public virtual async Task CreateAsync(InjectionRequestEditInput input) |
|||
{ |
|||
_ = await _injectionRequestAppService.CreateAsync(input).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 根据number获取注塑叫料申请详情
|
|||
/// </summary>
|
|||
/// <param name="number"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{number}")] |
|||
|
|||
public virtual async Task<ActionResult<InjectionRequestDTO>> GetAsync(string number) |
|||
{ |
|||
var result = await _injectionRequestAppService.GetByNumberAsync(number).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
} |
@ -1,197 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
public class NewRecommendFromTo : SfsStoreDetailEntityBase//SfsDetailEntityBase
|
|||
{ |
|||
#region 库存基础信息
|
|||
/* |
|||
/// <summary>
|
|||
/// 物品代码
|
|||
/// </summary>
|
|||
public string ItemCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物品名称
|
|||
/// </summary>
|
|||
public string ItemName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物品描述1
|
|||
/// </summary>
|
|||
public string ItemDesc1 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物品描述2
|
|||
/// </summary>
|
|||
public string ItemDesc2 { get; set; } |
|||
*/ |
|||
/// <summary>
|
|||
/// 标包数量
|
|||
/// </summary>
|
|||
[Display(Name = "标包数量")] |
|||
[Column(TypeName = "decimal(18,6)")] |
|||
public decimal StdPackQty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库存状态
|
|||
/// </summary>
|
|||
public EnumInventoryStatus Status { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 计量单位
|
|||
/// </summary>
|
|||
public string Uom { get; set; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 推荐来源
|
|||
|
|||
/// <summary>
|
|||
/// 推荐来源托标签
|
|||
/// </summary>
|
|||
public string RecommendFromContainerCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源箱标签
|
|||
/// </summary>
|
|||
public string RecommendFromPackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源批次供应商批次
|
|||
/// </summary>
|
|||
public string RecommendFromSupplierBatch { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源批次到货时间
|
|||
/// </summary>
|
|||
public DateTime RecommendFromArriveDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源批次生产时间
|
|||
/// </summary>
|
|||
public DateTime RecommendFromProduceDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源批次过期时间
|
|||
/// </summary>
|
|||
public DateTime RecommendFromExpireDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源批次排序
|
|||
/// </summary>
|
|||
public string RecommendFromLot { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源库位
|
|||
/// </summary>
|
|||
public string RecommendFromLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源库区
|
|||
/// </summary>
|
|||
public string RecommendFromLocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源库位组
|
|||
/// </summary>
|
|||
public string RecommendFromLocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源ERP库位
|
|||
/// </summary>
|
|||
public string RecommendFromLocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源仓库
|
|||
/// </summary>
|
|||
public string RecommendFromWarehouseCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐来源数量
|
|||
/// </summary>
|
|||
public decimal RecommendFromQty { get; set; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 推荐目标
|
|||
|
|||
/// <summary>
|
|||
/// 推荐目标托标签
|
|||
/// </summary>
|
|||
public string RecommendToContainerCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标箱标签
|
|||
/// </summary>
|
|||
public string RecommendToPackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标批次供应商批次
|
|||
/// </summary>
|
|||
public string RecommendToSupplierBatch { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标批次到货时间
|
|||
/// </summary>
|
|||
public DateTime RecommendToArriveDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标批次生产时间
|
|||
/// </summary>
|
|||
public DateTime RecommendToProduceDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标批次过期时间
|
|||
/// </summary>
|
|||
public DateTime RecommendToExpireDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标批次排序
|
|||
/// </summary>
|
|||
public string RecommendToLot { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标库位
|
|||
/// </summary>
|
|||
public string RecommendToLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标库区
|
|||
/// </summary>
|
|||
public string RecommendToLocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标库位组
|
|||
/// </summary>
|
|||
public string RecommendToLocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标ERP库位
|
|||
/// </summary>
|
|||
public string RecommendToLocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标仓库
|
|||
/// </summary>
|
|||
public string RecommendToWarehouseCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 推荐目标数量
|
|||
/// </summary>
|
|||
public decimal RecommendToQty { get; set; } |
|||
|
|||
#endregion
|
|||
|
|||
public void SetId(Guid id) |
|||
{ |
|||
this.Id = id; |
|||
} |
|||
} |
@ -1,148 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
public class NewRecommendHandledFromTo : NewRecommendFromTo |
|||
{ |
|||
#region 实际来源
|
|||
|
|||
/// <summary>
|
|||
/// 实际目标托标签
|
|||
/// </summary>
|
|||
public string HandledFromContainerCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际箱标签
|
|||
/// </summary>
|
|||
public string HandledFromPackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次供应商批次
|
|||
/// </summary>
|
|||
public string HandledFromSupplierBatch { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次到货时间
|
|||
/// </summary>
|
|||
public DateTime HandledFromArriveDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次生产时间
|
|||
/// </summary>
|
|||
public DateTime HandledFromProduceDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次过期时间
|
|||
/// </summary>
|
|||
public DateTime HandledFromExpireDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次排序
|
|||
/// </summary>
|
|||
public string HandledFromLot { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库位
|
|||
/// </summary>
|
|||
public string HandledFromLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库区
|
|||
/// </summary>
|
|||
public string HandledFromLocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库位组
|
|||
/// </summary>
|
|||
public string HandledFromLocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际ERP库位
|
|||
/// </summary>
|
|||
public string HandledFromLocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际仓库
|
|||
/// </summary>
|
|||
public string HandledFromWarehouseCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际数量
|
|||
/// </summary>
|
|||
public decimal HandledFromQty { get; set; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 实际目标
|
|||
|
|||
/// <summary>
|
|||
/// 实际目标托标签
|
|||
/// </summary>
|
|||
public string HandledToContainerCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际箱标签
|
|||
/// </summary>
|
|||
public string HandledToPackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次供应商批次
|
|||
/// </summary>
|
|||
public string HandledToSupplierBatch { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次到货时间
|
|||
/// </summary>
|
|||
public DateTime HandledToArriveDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次生产时间
|
|||
/// </summary>
|
|||
public DateTime HandledToProduceDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次过期时间
|
|||
/// </summary>
|
|||
public DateTime HandledToExpireDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际批次排序
|
|||
/// </summary>
|
|||
public string HandledToLot { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库位
|
|||
/// </summary>
|
|||
public string HandledToLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库区
|
|||
/// </summary>
|
|||
public string HandledToLocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际库位组
|
|||
/// </summary>
|
|||
public string HandledToLocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际ERP库位
|
|||
/// </summary>
|
|||
public string HandledToLocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际仓库
|
|||
/// </summary>
|
|||
public string HandledToWarehouseCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 实际数量
|
|||
/// </summary>
|
|||
public decimal HandledToQty { get; set; } |
|||
|
|||
#endregion
|
|||
|
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
Loading…
Reference in new issue