Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 1 year ago
parent
commit
1bfa90189e
  1. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs
  2. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs
  3. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs
  4. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
  5. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs
  6. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs
  7. 46
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
  8. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs
  9. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs
  10. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs
  11. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs
  12. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs
  13. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs
  14. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs
  15. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs
  16. 58
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs
  17. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs
  18. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs
  19. 19
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs
  20. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs
  21. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs
  22. 146
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs
  23. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs
  24. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs
  25. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs
  26. 51
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs
  27. 25
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs
  28. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
  29. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs
  30. 128
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/BaererToken.cs

@ -1,6 +1,6 @@
using System;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons;
public class BaererToken
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/ITokenService.cs

@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons;
public interface ITokenService : ITransientDependency
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Authenticaitons/TokenService.cs

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Volo.Abp;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons;
public class TokenService : ITokenService
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs

@ -8,7 +8,7 @@ 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 Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
using static Volo.Abp.Identity.Settings.IdentitySettingNames;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Client;

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/FawtygAutoMapperProfile.cs

@ -9,7 +9,7 @@ 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;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class FawtygAutoMapperProfile : Profile
{

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/HttpAuthorizationHandler.cs

@ -1,9 +1,9 @@
using System;
using Microsoft.Extensions.Configuration;
using Volo.Abp.DependencyInjection;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Authenticaitons;
using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Authenticaitons;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class HttpAuthorizationHandler : ISingletonDependency
{

46
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs

@ -18,8 +18,9 @@ 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;
using Volo.Abp;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
public class InjectionMoldingRequestReader : IReader
{
@ -27,13 +28,11 @@ 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
@ -63,9 +62,9 @@ public class InjectionMoldingRequestReader : IReader
Filter filter = new Filter()
{
Action = "<>",
Column = "JobStatus",
Column = "RequestStatus",
Logic = EnumFilterLogic.And.ToString(),
Value = ((int)EnumJobStatus.Done).ToString()
Value = ((int)EnumRequestStatus.Completed).ToString()
};
jobCondition.Condition.Filters.Add(filter);
var jobs = await _injectionRequest.GetAllListByFilterAsync(jobCondition).ConfigureAwait(false);
@ -81,12 +80,8 @@ public class InjectionMoldingRequestReader : IReader
_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>();
@ -113,6 +108,14 @@ public class InjectionMoldingRequestReader : IReader
await _injectionRequest.CreateAsync(input).ConfigureAwait(false);
}
}
catch (AbpException ex)
{
_logger.LogError(ex.Message);
}
catch (JsonException ex)
{
_logger.LogError(ex.Message);
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
@ -123,19 +126,19 @@ public class InjectionMoldingRequestReader : IReader
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
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
if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); }
else
{
request.ToLocationCode = loc.Code;
request.ToLocationGroup = loc.LocationGroupCode;
@ -143,18 +146,11 @@ public class InjectionMoldingRequestReader : IReader
request.ToWarehouseCode= loc.WarehouseCode;
}
}
return errors;
}
/// <summary>
///
/// 读取摄像头API
/// </summary>
/// <param name="p_type"></param>
/// <returns></returns>
@ -168,7 +164,7 @@ public class InjectionMoldingRequestReader : IReader
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);
var response = await client.GetAsync(address).ConfigureAwait(false);
if (response.IsSuccessStatusCode)
{
return await response.Content.ReadAsStringAsync().ConfigureAwait(false);
@ -180,7 +176,7 @@ public class InjectionMoldingRequestReader : IReader
public class InjectionRequest
{
/// <summary>
/// 零件
/// 零件M
/// </summary>
public string ItemCode { get; set; }
/// <summary>
@ -200,10 +196,6 @@ public class InjectionMoldingRequestReader : IReader
/// </summary>
public decimal Qty { get; set; }
}

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingTaskIncomingBackgroundWorker.cs

@ -6,10 +6,10 @@ 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.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentHostedService.cs

@ -4,7 +4,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Volo.Abp;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskAgentHostedService : IHostedService
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentModule.cs

@ -24,7 +24,7 @@ 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;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
[DependsOn(
typeof(AbpAutofacModule),

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskAgentService.cs

@ -1,7 +1,7 @@
using System;
using Volo.Abp.DependencyInjection;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskAgentService : ITransientDependency
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs

@ -1,6 +1,6 @@
using System.Net;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskOptions
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Outgoing/InjectionMoldingTaskOutgoingBackgroundWorker.cs

@ -7,7 +7,7 @@ using Volo.Abp.Threading;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class InjectionMoldingTaskOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
{

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Program.cs

@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent;
public class Program
{

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs

@ -1,6 +1,9 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -51,4 +54,8 @@ public class CountJobDTO : SfsJobDTOBase<CountJobDetailDTO>
[Display(Name = "库位代码")]
public string LocationCode { get; set; }
/// <summary>
/// 任务从表明细(记录每次扫得明细)
/// </summary>
public List<CountJobDependentDetailDTO> DepDetails { get; set; }
}

58
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs

@ -0,0 +1,58 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CountJobDependentDetailDTO : SfsJobDetailDTOBase, IHasCountResult
{
/// <summary>
/// 盘点标签
/// </summary>
[Display(Name = "盘点标签")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string CountLabel { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
/// <summary>
/// 库存数量
/// </summary>
[Display(Name = "库存数量")]
public decimal InventoryQty { get; set; }
/// <summary>
/// 库存库位
/// </summary>
[Display(Name = "库存库位")]
public string InventoryLocationCode { get; set; }
/// <summary>
/// 盘点数量
/// </summary>
[Display(Name = "盘点数量")]
public decimal CountQty { get; set; }
/// <summary>
/// 盘点时间
/// </summary>
[Display(Name = "盘点时间")]
public DateTime? CountTime { get; set; }
/// <summary>
/// 盘点操作员
/// </summary>
[Display(Name = "盘点操作员")]
public string CountOperator { get; set; }
/// <summary>
/// 盘点描述
/// </summary>
[Display(Name = "盘点描述")]
public string CountDescription { get; set; }
}

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/DTOs/TransferNoteDTO.cs

@ -44,4 +44,30 @@ public class TransferNoteDTO : SfsStoreDTOBase<TransferNoteDetailDTO>, IHasNumbe
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs

@ -51,4 +51,31 @@ public class TransferNoteEditInput : SfsStoreCreateOrUpdateInputBase
[Display(Name = "详情")]
public List<TransferNoteDetailInput> Details { get; set; } = new List<TransferNoteDetailInput>();
#region 回调服务相关
/// <summary>
/// 回调服务名称
/// </summary>
[Display(Name = "回调服务名称")]
public string CallServerName { get; set; }
/// <summary>
/// 回调业务类型
/// </summary>
[Display(Name = "回调业务类型")]
public string CallBusinessType { get; set; }
/// <summary>
/// 调用者传入申请单号
/// </summary>
[Display(Name = "传入申请单号")]
public string CallRequestNumber { get; set; }
/// <summary>
/// 调用者传入任务单号
/// </summary>
[Display(Name = "传入任务单号")]
public string CallJobNumber { get; set; }
#endregion
}

19
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/InjectionRequests/Inputs/InjectionRequestEditInput.cs

@ -7,12 +7,6 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
{
#region Base
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
/// <summary>
/// 使用在途库
@ -22,12 +16,6 @@ public class InjectionRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
#endregion
#region Create
/// <summary>
/// 要货单号
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Number { get; set; }
/// <summary>
/// 叫料类型
@ -35,13 +23,6 @@ public class InjectionRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
[Display(Name = "叫料类型")]
public string Type { get; set; }
/// <summary>
/// 备料计划单号
/// </summary>
[Display(Name = "备料计划单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string PreparationPlanNumber { get; set; }
/// <summary>
/// 明细列表
/// </summary>

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionJobs/InjectionJobAppService.cs

@ -138,9 +138,9 @@ public class InjectionJobAppService
}
[HttpPost("Do-Call-Back")]
public async Task<TransferLibJobDTO> DoTransferLibCallbackAsync(string businessType, string requestNum, string jobNum)
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
var job = await _repository.FindAsync(p => p.Number == jobNum).ConfigureAwait(false);
var job = await _repository.FindAsync(p => p.Number == dto.JobNumber).ConfigureAwait(false);
//todo 等云峰写好换成真实的
var transferLibJobDto= await _transferLibJobAppService.GetByNumberAsync("AAA").ConfigureAwait(false);
@ -181,8 +181,7 @@ public class InjectionJobAppService
await _repository.UpdateAsync(job).ConfigureAwait(false);
//return new Tuple<bool?, string>(true,"s");
return new TransferLibJobDTO();
return;
}
[HttpPost("test")]

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs

@ -34,7 +34,7 @@ public class PurchaseReceiptJobAppService :
/// <param name="fileAppService"></param>
public PurchaseReceiptJobAppService(IPurchaseReceiptJobRepository repository,
IPurchaseReceiptJobManager purchaseReceiptJobManager,
IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService,
//IPurchaseReceiptNoteAppService purchaseReceiptNoteAppService, //lyf at 0415移库调用此处报错,提示注入错误,此处没有使用,所以删除
IFileAppService fileAppService) : base(repository, purchaseReceiptJobManager)
{
_purchaseReceiptJobManager = purchaseReceiptJobManager;

146
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/TransferLibJobs/TransferLibJobAppService.cs

@ -38,7 +38,6 @@ public class TransferLibJobAppService
[UnitOfWork]
public override async Task<TransferLibJobDTO> CompleteAsync(Guid id, TransferLibJobDTO dto)
{
//var str = "Win_in.Sfs.Wms.Store.Application.InjectionJobAppService";
string methodPrefix = "TransferLibJobAppService.CompleteAsync - ";
if (dto.CallServerName.IsNullOrEmpty())
{
@ -57,6 +56,122 @@ public class TransferLibJobAppService
throw new UserFriendlyException($"{methodPrefix}CallJobNumber 不能为空");
}
#region 校验
foreach (var detailObj in dto.Details)
{
if (detailObj.IsPackingCodeFrom)
{
if (detailObj.RecommendFromPackingCode != detailObj.HandledFromPackingCode)
{
throw new UserFriendlyException($"触发校验:推荐From箱码必须等于实际From箱码");
}
}
if (detailObj.IsPackingCodeTo)
{
if (detailObj.RecommendToPackingCode != detailObj.HandledToPackingCode)
{
throw new UserFriendlyException($"触发校验:推荐To箱码必须等于实际To箱码");
}
}
if (detailObj.IsLotFrom)
{
if (detailObj.RecommendFromLot != detailObj.HandledFromLot)
{
throw new UserFriendlyException($"触发校验:推荐From批次必须等于实际From批次");
}
}
if (detailObj.IsLotTo)
{
if (detailObj.RecommendToLot != detailObj.HandledToLot)
{
throw new UserFriendlyException($"触发校验:推荐To批次必须等于实际To批次");
}
}
//if (detailObj.IsItemCodeFrom)
//if (detailObj.IsItemCodeTo)
//if (detailObj.IsStatusFrom)
//if (detailObj.IsStatusTo)
if (detailObj.IsLocationCodeFrom)
{
if (detailObj.RecommendFromLocationCode != detailObj.HandledFromLocationCode)
{
throw new UserFriendlyException($"触发校验:推荐From库位必须等于实际From库位");
}
}
if (detailObj.IsLocationCodeTo)
{
if (detailObj.RecommendToLocationCode != detailObj.HandledToLocationCode)
{
throw new UserFriendlyException($"触发校验:推荐To库位必须等于实际To库位");
}
}
if (detailObj.IsLocationGroupFrom)
{
if (detailObj.RecommendFromLocationGroup != detailObj.HandledFromLocationGroup)
{
throw new UserFriendlyException($"触发校验:推荐From库位组必须等于实际From库位组");
}
}
if (detailObj.IsLocationGroupTo)
{
if (detailObj.RecommendToLocationGroup != detailObj.HandledToLocationGroup)
{
throw new UserFriendlyException($"触发校验:推荐To库位组必须等于实际To库位组");
}
}
if (detailObj.IsLocationAreaFrom)
{
if (detailObj.RecommendFromLocationArea != detailObj.HandledFromLocationArea)
{
throw new UserFriendlyException($"触发校验:推荐From库区必须等于实际From库区");
}
}
if (detailObj.IsLocationAreaTo)
{
if (detailObj.RecommendToLocationArea != detailObj.HandledToLocationArea)
{
throw new UserFriendlyException($"触发校验:推荐To库区必须等于实际To库区");
}
}
if (detailObj.IsLocationErpCodeFrom)
{
if (detailObj.RecommendFromLocationErpCode != detailObj.HandledFromLocationErpCode)
{
throw new UserFriendlyException($"触发校验:推荐From ERP库区必须等于实际From ERP库区");
}
}
if (detailObj.IsLocationErpCodeTo)
{
if (detailObj.RecommendToLocationErpCode != detailObj.HandledToLocationErpCode)
{
throw new UserFriendlyException($"触发校验:推荐To ERP库区必须等于实际To ERP库区");
}
}
if (detailObj.IsQtyFrom)
{
if (detailObj.RecommendFromQty != detailObj.HandledFromQty)
{
throw new UserFriendlyException($"触发校验:推荐From数量必须等于实际From数量");
}
}
if (detailObj.IsQtyTo)
{
if (detailObj.RecommendToQty != detailObj.HandledToQty)
{
throw new UserFriendlyException($"触发校验:推荐To数量必须等于实际To数量");
}
}
}
#endregion
var ret = await base.CompleteAsync(id, dto).ConfigureAwait(false);
if (ret != null)
{
@ -70,37 +185,12 @@ public class TransferLibJobAppService
{
throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败");
}
ITransferLibCallback transferLibCallback = (Win_in.Sfs.Wms.Store.Notes.ITransferLibCallback)instance;
ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance;
if (transferLibCallback == null)
{
throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口");
}
TransferLibJobDTO callbackRet = await transferLibCallback.DoTransferLibCallbackAsync(dto.CallServerName, dto.CallRequestNumber, dto.CallJobNumber).ConfigureAwait(false);
if (callbackRet == null || callbackRet.Number == null)
{
throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回实体为空!");
}
//var assembly = Assembly.GetExecutingAssembly();
//var ty = assembly.GetType(dto.CallServerName);
//if (ty == null)
//{
// throw new UserFriendlyException($"{methodPrefix}没有找到类型为{dto.CallServerName}的对象");
//}
//var instance = Activator.CreateInstance(ty);
//if (instance == null)
//{
// throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象创建失败");
//}
//ITransferLibCallback transferLibCallback = (ITransferLibCallback)instance;
//if (transferLibCallback == null)
//{
// throw new UserFriendlyException($"{methodPrefix}类型为{dto.CallServerName}的对象没有实现ITransferLibCallback接口");
//}
//Tuple<bool?, string> callbackRet = transferLibCallback.DoTransferLibCallback(dto.CallServerName, dto.CallRequestNumber, dto.CallJobNumber);
//if (callbackRet != null && callbackRet.Item1 == false)
//{
// throw new UserFriendlyException($"{methodPrefix}执行回调服务{dto.CallServerName}出错,返回错误信息:{callbackRet.Item2}");
//}
await transferLibCallback.DoTransferLibCallbackAsync(dto).ConfigureAwait(false);
}
return ret;
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferLibNotes/ITransferLibCallback.cs

@ -9,7 +9,7 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Notes;
public interface ITransferLibCallback
{
Task<TransferLibJobDTO> DoTransferLibCallbackAsync(string businessType, string requestNum, string jobNum);
Task DoTransferLibCallbackAsync(TransferLibJobDTO dto);
}
public class TestTransferLibCallback : ITransferLibCallback
@ -18,9 +18,8 @@ public class TestTransferLibCallback : ITransferLibCallback
{
}
public async Task<TransferLibJobDTO> DoTransferLibCallbackAsync(string businessType, string requestNum,
string jobNum)
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
return new TransferLibJobDTO();
await Task.Run(() => { }).ConfigureAwait(false);
}
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs

@ -99,6 +99,12 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
detailInput.ToWarehouseCode= toLocationDto.WarehouseCode;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.ItemDesc1 = itemBasicDto.Desc1;
detailInput.ItemDesc2 = itemBasicDto.Desc2;
detailInput.ItemName = itemBasicDto.Name;
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Status = EnumStatus.Open;
//因为是刚创建的 所以发料数一定是0

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs

@ -62,6 +62,11 @@ public class CountJob : SfsJobAggregateRootBase<CountJobDetail>
/// </summary>
[IgnoreUpdate]
public override List<CountJobDetail> Details { get; set; } = new List<CountJobDetail>();
/// <summary>
/// 任务从表明细(记录每次扫得明细)
/// </summary>
[IgnoreUpdate]
public List<CountJobDependentDetail> DepDetails { get; set; } = new List<CountJobDependentDetail>();
/// <summary>
/// 设置任务明细的实际库位和实际数量

51
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs

@ -0,0 +1,51 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Domain;
public class CountJobDependentDetail : SfsJobDetailEntityBase, IHasCountResult, IHasInventoryQty
{
/// <summary>
/// 盘点标签
/// </summary>
public string CountLabel { get; set; }
/// <summary>
/// 库存数量
/// </summary>
public decimal InventoryQty { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
/// <summary>
/// 库存库位
/// </summary>
public string InventoryLocationCode { get; set; }
/// <summary>
/// 盘点数量(每次扫得数量)
/// </summary>
public decimal CountQty { get; set; }
/// <summary>
/// 盘点时间
/// </summary>
public DateTime? CountTime { get; set; }
/// <summary>
/// 盘点操作员
/// </summary>
public string CountOperator { get; set; }
/// <summary>
/// 盘点描述
/// </summary>
public string CountDescription { get; set; }
}

25
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs

@ -29,6 +29,7 @@ public static class CountJobDbContextModelCreatingExtensions
b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
b.HasMany(q => q.DepDetails).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
@ -55,5 +56,29 @@ public static class CountJobDbContextModelCreatingExtensions
//Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
});
builder.Entity<CountJobDependentDetail>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(CountJobDependentDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobDetail();
//Properties
b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.InventoryLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.CountOperator).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.CountDescription).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
//None
//Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
});
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

@ -337,7 +337,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
#region Jobs
options.Entity<CountJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details).Include(o => o.DepDetails));
options.Entity<CheckJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ProductReceiveJob>(orderOptions =>

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs

@ -99,6 +99,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.CompleteUserId)
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.DepDetails)
;
CreateMap<CountPlanDetailDTO, CountJobDetail>()

128
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/TransferLibRequestEventHandler.cs

@ -53,7 +53,6 @@ public class TransferLibRequestEventHandler
var entity = eventData.Entity;
var enumTransSubType = Enum.Parse<EnumTransSubType>(entity.Type);
return;
if (entity.DirectCreateNote)
{
@ -88,133 +87,6 @@ public class TransferLibRequestEventHandler
input.Details.ForEach(p => { p.OnTheWayLocationCode = locationDto.Code; });
//校验
foreach (var detailObj in input.Details)
{
if (detailObj.IsPackingCodeFrom)
{
if (detailObj.RecommendFromPackingCode != detailObj.HandledFromPackingCode)
{
throw new UserFriendlyException($"触发校验:推荐From箱码必须等于实际From箱码");
}
}
if (detailObj.IsPackingCodeTo)
{
if (detailObj.RecommendToPackingCode != detailObj.HandledToPackingCode)
{
throw new UserFriendlyException($"触发校验:推荐To箱码必须等于实际To箱码");
}
}
if (detailObj.IsLotFrom)
{
if (detailObj.RecommendFromLot != detailObj.HandledFromLot)
{
throw new UserFriendlyException($"触发校验:推荐From批次必须等于实际From批次");
}
}
if (detailObj.IsLotTo)
{
if (detailObj.RecommendToLot != detailObj.HandledToLot)
{
throw new UserFriendlyException($"触发校验:推荐To批次必须等于实际To批次");
}
}
//if (detailObj.IsItemCodeFrom)
//{
//}
//if (detailObj.IsItemCodeTo)
//{
//}
//if (detailObj.IsStatusFrom)
//{
//}
//if (detailObj.IsStatusTo)
//{
//}
if (detailObj.IsLocationCodeFrom)
{
if (detailObj.RecommendFromLocationCode != detailObj.HandledFromLocationCode)
{
throw new UserFriendlyException($"触发校验:推荐From库位必须等于实际From库位");
}
}
if (detailObj.IsLocationCodeTo)
{
if (detailObj.RecommendToLocationCode != detailObj.HandledToLocationCode)
{
throw new UserFriendlyException($"触发校验:推荐To库位必须等于实际To库位");
}
}
if (detailObj.IsLocationGroupFrom)
{
if (detailObj.RecommendFromLocationGroup != detailObj.HandledFromLocationGroup)
{
throw new UserFriendlyException($"触发校验:推荐From库位组必须等于实际From库位组");
}
}
if (detailObj.IsLocationGroupTo)
{
if (detailObj.RecommendToLocationGroup != detailObj.HandledToLocationGroup)
{
throw new UserFriendlyException($"触发校验:推荐To库位组必须等于实际To库位组");
}
}
if (detailObj.IsLocationAreaFrom)
{
if (detailObj.RecommendFromLocationArea != detailObj.HandledFromLocationArea)
{
throw new UserFriendlyException($"触发校验:推荐From库区必须等于实际From库区");
}
}
if (detailObj.IsLocationAreaTo)
{
if (detailObj.RecommendToLocationArea != detailObj.HandledToLocationArea)
{
throw new UserFriendlyException($"触发校验:推荐To库区必须等于实际To库区");
}
}
if (detailObj.IsLocationErpCodeFrom)
{
if (detailObj.RecommendFromLocationErpCode != detailObj.HandledFromLocationErpCode)
{
throw new UserFriendlyException($"触发校验:推荐From ERP库区必须等于实际From ERP库区");
}
}
if (detailObj.IsLocationErpCodeTo)
{
if (detailObj.RecommendToLocationErpCode != detailObj.HandledToLocationErpCode)
{
throw new UserFriendlyException($"触发校验:推荐To ERP库区必须等于实际To ERP库区");
}
}
if (detailObj.IsQtyFrom)
{
if (detailObj.RecommendFromQty != detailObj.HandledFromQty)
{
throw new UserFriendlyException($"触发校验:推荐From数量必须等于实际From数量");
}
}
if (detailObj.IsQtyTo)
{
if (detailObj.RecommendToQty != detailObj.HandledToQty)
{
throw new UserFriendlyException($"触发校验:推荐To数量必须等于实际To数量");
}
}
}
await _transferLibJobManager.AddAsync(input).ConfigureAwait(false);
}

Loading…
Cancel
Save