Browse Source

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

dev_DY_CC
lvzb 1 year ago
parent
commit
f3870e6109
  1. 625
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Client/WebApi.cs
  2. 231
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/Incoming/InjectionMoldingRequestReader.cs
  3. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/InjectionMoldingTaskOptions.cs
  4. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/appsettings.json
  5. 15
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/DTOs/KittingDetailDTO.cs
  6. 16
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/Inputs/KittingDetailInput.cs
  7. 40
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/Inputs/KittingImportInput.cs
  8. 7
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/DTOs/ProductionLineDTO.cs
  9. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/IProductionLineAppService.cs
  10. 7
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineEditInput.cs
  11. 7
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineImportInput.cs
  12. 37
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs
  13. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs
  14. 42
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs
  15. 28
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs
  16. 6
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAutoMapperProfile.cs
  17. 11
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs
  18. 72
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs
  19. 16
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Enum/EnumProductionLineType.cs
  20. 64
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs
  21. 18
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Kittings/KittingDetail.cs
  22. 7
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/ProductionLines/ProductionLine.cs
  23. 6
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs
  24. 11
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs
  25. 5
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Basedata/EnumLocationType.cs
  26. 23
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Basedata/EnumProductionLineType.cs
  27. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Chassis/IChassisAppService.cs
  28. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/DTOs/ChassisOperationSequenceDTO.cs
  29. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/IChassisOperationSequenceAppService.cs
  30. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/Inputs/ChassisOperationSequenceEditInput.cs
  31. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/Inputs/ChassisOperationSequenceImportInput.cs
  32. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteChassisDetailDTO.cs
  33. 49
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDTO.cs
  34. 58
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDependentDetailDTO.cs
  35. 52
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDetailDTO.cs
  36. 32
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteChassisDetailInput.cs
  37. 88
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteCreateRequestInput.cs
  38. 52
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteDetailInput.cs
  39. 74
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteEditInput.cs
  40. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteImportInput.cs
  41. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs
  42. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
  43. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/DTOs/InjectionIssueRequestDetailDTO.cs
  44. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/IInjectionIssueRequestAppService.cs
  45. 42
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Chassis/ChassisAppService.cs
  46. 47
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ChassisOperationSequence/ChassisOperationSequenceAppService.cs
  47. 71
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/KittingPackagingNotes/KittingPackagingNoteAppService.cs
  48. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs
  49. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs
  50. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ChassisOperationSequence/ChassisOperationSequence.cs
  51. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNote.cs
  52. 46
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs
  53. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteDetail.cs
  54. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
  55. 31896
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422030203_Added_KittingPackagingNote.Designer.cs
  56. 958
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422030203_Added_KittingPackagingNote.cs
  57. 32112
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422032715_Added_KittingPackagingNoteV2.Designer.cs
  58. 137
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422032715_Added_KittingPackagingNoteV2.cs
  59. 32133
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240423013517_Update_KittingPackagingNoteV3.Designer.cs
  60. 91
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240423013517_Update_KittingPackagingNoteV3.cs
  61. 1902
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  62. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs
  63. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
  64. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
  65. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
  66. 149
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/KittingPackagingNoteHandler.cs
  67. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Win_in.Sfs.Wms.Store.Event.csproj
  68. 4
      build/src/docker/publish/conf/settings/appsettings.Development.json

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

@ -1,72 +1,587 @@
using System; //----------------------
using System.Collections.Generic; // <auto-generated>
using System.Linq; // Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
using System.Net.Http; // </auto-generated>
using System.Text; //----------------------
using System.Threading.Tasks;
using Microsoft.Extensions.Options; #pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
using StackExchange.Redis; #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
using Volo.Abp.Application.Services; #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
using Win_in.Sfs.Wms.DataExchange.Domain; #pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
using Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent; #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
using static Volo.Abp.Identity.Settings.IdentitySettingNames; #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Client; #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
public class WebServiceAppService : IReader #pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming
{ {
private readonly IHttpClientFactory _httpClientFactory; using System = global::System;
private readonly IOptions<InjectionMoldingTaskOptions> _options;
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Client
{
#pragma warning disable 8618
private string _baseUrl;
#pragma warning restore 8618
private System.Net.Http.HttpClient _httpClient;
private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public Client(string baseUrl, System.Net.Http.HttpClient httpClient)
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
BaseUrl = baseUrl;
_httpClient = httpClient;
}
private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
}
public string BaseUrl
{
get { return _baseUrl; }
set
{
_baseUrl = value;
if (!string.IsNullOrEmpty(_baseUrl) && !_baseUrl.EndsWith("/"))
_baseUrl += '/';
}
}
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
/// <summary>
/// 生命周期操作
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<int> GetMacStaticAsync()
{
return GetMacStaticAsync(System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// 生命周期操作
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<int> GetMacStaticAsync(System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
var urlBuilder_ = new System.Text.StringBuilder();
if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl);
// Operation Path: "CargoState/GetMacStatic"
urlBuilder_.Append("CargoState/GetMacStatic");
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
foreach (var item_ in response_.Headers)
headers_[item_.Key] = item_.Value;
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<int>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 403)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Forbidden", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 401)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 501)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 500)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string p_AreaID)
{
return GetCargoStaticAsync(p_AreaID, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ResponCargoItem>> GetCargoStaticAsync(string p_AreaID, System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "text/plain");
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
var urlBuilder_ = new System.Text.StringBuilder();
if (!string.IsNullOrEmpty(_baseUrl)) urlBuilder_.Append(_baseUrl);
// Operation Path: "CargoState/GetCargoStatic"
urlBuilder_.Append("CargoState/GetCargoStatic");
urlBuilder_.Append('?');
if (p_AreaID != null)
{
urlBuilder_.Append(System.Uri.EscapeDataString("p_AreaID")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(p_AreaID, System.Globalization.CultureInfo.InvariantCulture))).Append('&');
}
urlBuilder_.Length--;
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
foreach (var item_ in response_.Headers)
headers_[item_.Key] = item_.Value;
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ResponCargoItem>>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 403)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Forbidden", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 401)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 501)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 500)
{
var objectResponse_ = await ReadObjectResponseAsync<RemoteServiceErrorResponse>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<RemoteServiceErrorResponse>("Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
protected struct ObjectResponseResult<T>
{
public ObjectResponseResult(T responseObject, string responseText)
{
this.Object = responseObject;
this.Text = responseText;
}
public WebServiceAppService(IHttpClientFactory httpClientFactory, IOptions<InjectionMoldingTaskOptions> options) public T Object { get; }
public string Text { get; }
}
public bool ReadResponseAsString { get; set; }
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken)
{
if (response == null || response.Content == null)
{
return new ObjectResponseResult<T>(default(T), string.Empty);
}
if (ReadResponseAsString)
{
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings);
return new ObjectResponseResult<T>(typedBody, responseText);
}
catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
}
}
else
{
try
{
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
using (var streamReader = new System.IO.StreamReader(responseStream))
using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
{
var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
var typedBody = serializer.Deserialize<T>(jsonTextReader);
return new ObjectResponseResult<T>(typedBody, string.Empty);
}
}
catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
}
}
}
private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
{
if (value == null)
{
return "";
}
if (value is System.Enum)
{
var name = System.Enum.GetName(value.GetType(), value);
if (name != null)
{
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
if (field != null)
{
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
as System.Runtime.Serialization.EnumMemberAttribute;
if (attribute != null)
{
return attribute.Value != null ? attribute.Value : name;
}
}
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo));
return converted == null ? string.Empty : converted;
}
}
else if (value is bool)
{
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant();
}
else if (value is byte[])
{
return System.Convert.ToBase64String((byte[])value);
}
else if (value is string[])
{
return string.Join(",", (string[])value);
}
else if (value.GetType().IsArray)
{
var valueArray = (System.Array)value;
var valueTextArray = new string[valueArray.Length];
for (var i = 0; i < valueArray.Length; i++)
{
valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo);
}
return string.Join(",", valueTextArray);
}
var result = System.Convert.ToString(value, cultureInfo);
return result == null ? "" : result;
}
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class RemoteServiceErrorInfo
{ {
_httpClientFactory = httpClientFactory; [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
_options = options; public string Code { get; set; }
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
[Newtonsoft.Json.JsonProperty("details", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Details { get; set; }
[Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.IDictionary<string, object> Data { get; set; }
[Newtonsoft.Json.JsonProperty("validationErrors", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<RemoteServiceValidationErrorInfo> ValidationErrors { get; set; }
} }
public Task<List<IncomingFromExternal>> ReadAsync() [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class RemoteServiceErrorResponse
{ {
throw new NotImplementedException(); [Newtonsoft.Json.JsonProperty("error", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public RemoteServiceErrorInfo Error { get; set; }
} }
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class RemoteServiceValidationErrorInfo
{
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
[Newtonsoft.Json.JsonProperty("members", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<string> Members { get; set; }
}
/// <summary> [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
/// public partial class ResponCargoItem
/// </summary>
/// <param name="p_type"></param>
/// <returns></returns>
public async Task<string> WebApi(int p_type)
{ {
/// <summary>
/// 区域ID
/// </summary>
[Newtonsoft.Json.JsonProperty("areaID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string AreaID { get; set; }
//var client = _httpClientFactory.CreateClient(); /// <summary>
//// 设置用户名和密码 /// 货位号
//var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); /// </summary>
//client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials); [Newtonsoft.Json.JsonProperty("cargoID", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
//// 发送HTTP请求 public string CargoID { get; set; }
//var response = await client.GetAsync("https://example.com/api/data");
//if (response.IsSuccessStatusCode) /// <summary>
//{ /// 零件号
// return await response.Content.ReadAsStringAsync(); /// </summary>
//} [Newtonsoft.Json.JsonProperty("partCode", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
// SoapClient public string PartCode { get; set; }
/// <summary>
/// 货位状态
/// </summary>
var address = _options.Value.AutoRemote.IpAddress; [Newtonsoft.Json.JsonProperty("flag", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
var username = _options.Value.AutoRemote.UserName; public int Flag { get; set; }
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); [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
if (response.IsSuccessStatusCode) public partial class ApiException : System.Exception
{
public int StatusCode { get; private set; }
public string Response { get; private set; }
public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{ {
return await response.Content.ReadAsStringAsync(); StatusCode = statusCode;
Response = response;
Headers = headers;
}
public override string ToString()
{
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
} }
return "Error occurred";
} }
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException<TResult> : ApiException
{
public TResult Result { get; private set; }
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
: base(message, statusCode, response, headers, innerException)
{
Result = result;
}
}
} }
#pragma warning restore 108
#pragma warning restore 114
#pragma warning restore 472
#pragma warning restore 612
#pragma warning restore 1573
#pragma warning restore 1591
#pragma warning restore 8073
#pragma warning restore 3016
#pragma warning restore 8603
#pragma warning restore 8604
#pragma warning restore 8625

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

@ -19,6 +19,7 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using Volo.Abp; using Volo.Abp;
using System.Net.NetworkInformation;
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent.Incoming;
public class InjectionMoldingRequestReader : IReader public class InjectionMoldingRequestReader : IReader
{ {
@ -60,69 +61,112 @@ public class InjectionMoldingRequestReader : IReader
try try
{ {
// 获取注塑叫料任务数量 // 获取注塑叫料任务数量
var count = await _injectionRequest.GetCountAsync().ConfigureAwait(false); //var count = await _injectionRequest.GetCountAsync().ConfigureAwait(false);
List<InjectionIssueRequestEditInput> joblist = new List<InjectionIssueRequestEditInput>(); //List<InjectionIssueRequestEditInput> joblist = new List<InjectionIssueRequestEditInput>();
if (count == 0) //if (count == 0)
{ //{
// 调用 ReaderCameraApi 方法获取摄像头信息 // 调用 ReaderCameraApi 方法获取摄像头信息
string camera = await ReaderCameraApi().ConfigureAwait(false);
List<InjectionRequest> cameraList = new List<InjectionRequest>();
if (camera == "Error occured") Client client = new Client(_options.Value.AutoRemote.IpAddress, _httpClientFactory.CreateClient());//调用客户记录
var flag= await client.GetMacStaticAsync().ConfigureAwait(false);
if (flag!=1)
{ {
// 记录错误日志并返回空列表 // 记录错误日志并返回空列表
_logger.LogInformation($"没有读取到摄像头信息{DateTime.Now},请检查网络"); _logger.LogInformation($"读取到摄像头信息为不可用{DateTime.Now},请检查摄像头");
return new List<IncomingFromExternal>();
}
if (string.IsNullOrEmpty(_options.Value.AutoRemote.AreaIDs))
{
_logger.LogInformation($"没有设置指定区域AutoRemote->AreaIDs");
return new List<IncomingFromExternal>(); return new List<IncomingFromExternal>();
} }
//将摄像头信息转换为注塑叫料明细任务数据
cameraList = System.Text.Json.JsonSerializer.Deserialize<List<InjectionRequest>>(camera); var ids=_options.Value.AutoRemote.AreaIDs.Split(",");
//测试数据 List<ResponCargoItem> camralist = new List<ResponCargoItem>();
//var cameraList = new List<InjectionRequest>() foreach (var itm in ids)//遍历区域查找所有货物
//{
// new InjectionRequest() { ItemCode = "THILDD0A542AG", ToLocCode = "ZSXB2", Qty = 100 },
// };
InjectionIssueRequestEditInput input = new InjectionIssueRequestEditInput();
input.Worker = "Vision";
input.Type = "Vision";
input.AutoSubmit = true;
input.ActiveDate = DateTime.Now;
input.UseOnTheWayLocation = false;
input.Remark = "视觉叫料";
List<InjectionIssueRequestDetailInput> injectionRequestDetails = new List<InjectionIssueRequestDetailInput>();
foreach (var job in cameraList)
{ {
var detailInput = new InjectionIssueRequestDetailInput() var idsList= await client.GetCargoStaticAsync(itm).ConfigureAwait(false);
{ camralist.AddRange(idsList);
ItemCode = job.ItemCode,
ToLocationCode = job.ToLocCode,
Qty = job.Qty,
RecommendType = EnumRecommendType.W,
IssuedQty = 0,
ReceivedQty = 0,
Status = EnumStatus.Open,
RequestStatus = EnumRequestStatus.New,
};
// 添加注塑叫料明细任务数据
injectionRequestDetails.Add(detailInput);
} }
input.Details.AddRange(injectionRequestDetails); camralist = camralist.Where(p=>p.Flag==0).ToList();
// 通过 BindAsync 方法对零件仓库进行赋值
var errors = await BindAsync(input.Details).ConfigureAwait(false);
if (errors.Count > 0) List<UnCompletedRequestDto> inputdetail=new List<UnCompletedRequestDto>();
foreach (var item in camralist)
{
UnCompletedRequestDto jobrequestinput = new UnCompletedRequestDto();
jobrequestinput.ItemCode = item.PartCode;
jobrequestinput.LocCode = item.AreaID.ToString();
jobrequestinput.PositionCode = item.CargoID.ToString();
inputdetail.Add(jobrequestinput);
}
var uncompletelist= await _injectionRequest.GetUnCompletedRequestAsync(inputdetail).ConfigureAwait(false);//将所有库位零件信息查找未完成记录
var query = from itm in camralist
join itm1 in uncompletelist on new { locCode = itm.AreaID.ToString(), itmCode = itm.PartCode, PositionCode = itm.CargoID.ToString() }
equals new { locCode = itm1.LocCode, itmCode = itm1.ItemCode, PositionCode = itm1.PositionCode} into temp
from tm in temp.DefaultIfEmpty()
where tm == null
select itm;
var injectionList=query.ToList();//已经完成的记录
foreach (var inject in injectionList)
{ {
// 记录错误日志并返回空列表 List<InjectionRequest> cameraList = new List<InjectionRequest>();
foreach (var error in errors)
InjectionIssueRequestEditInput input = new InjectionIssueRequestEditInput();
input.Worker = "Vision";
input.Type = "Vision";
input.AutoSubmit = true;
input.ActiveDate = DateTime.Now;
input.UseOnTheWayLocation = false;
input.Remark = "视觉叫料";
List<InjectionIssueRequestDetailInput> injectionRequestDetails = new List<InjectionIssueRequestDetailInput>();
//foreach (var job in cameraList)
//{
var detailInput = new InjectionIssueRequestDetailInput()
{
ItemCode = inject.PartCode,
ToLocationCode = inject.AreaID.ToString(),
PositionCode=inject.CargoID,
Qty = 1,
RecommendType = EnumRecommendType.W,
IssuedQty = 0,
ReceivedQty = 0,
Status = EnumStatus.Open,
RequestStatus = EnumRequestStatus.New,
BoxQty=1
};
// 添加注塑叫料明细任务数据
injectionRequestDetails.Add(detailInput);
//}
input.Details.AddRange(injectionRequestDetails);
// 通过 BindAsync 方法对零件仓库进行赋值
var errors = await BindAsync(input.Details).ConfigureAwait(false);
if (errors.Count > 0)
{ {
_logger.LogInformation(error); // 记录错误日志并返回空列表
foreach (var error in errors)
{
_logger.LogInformation(error);
}
return new List<IncomingFromExternal>();
} }
return new List<IncomingFromExternal>(); // 创建新的注塑请求并将数据写入数据库
await _injectionRequest.CreateAsync(input).ConfigureAwait(false);
} }
// 创建新的注塑请求并将数据写入数据库
await _injectionRequest.CreateAsync(input).ConfigureAwait(false); //}
} //else
else //{
{ // _logger.LogInformation("注塑叫料任务已存在,无需读取");
_logger.LogInformation("注塑叫料任务已存在,无需读取"); //}
}
} }
// 捕获特定异常并记录日志 // 捕获特定异常并记录日志
@ -162,6 +206,7 @@ public class InjectionMoldingRequestReader : IReader
if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); } if (loc == null) { errors.Add($"编号:{request.ToLocationCode}库位表中没找到!"); }
else else
{ {
// 更新请求中的库位相关信息 // 更新请求中的库位相关信息
request.ToLocationCode = loc.Code; request.ToLocationCode = loc.Code;
request.ToLocationGroup = loc.LocationGroupCode; request.ToLocationGroup = loc.LocationGroupCode;
@ -174,55 +219,55 @@ public class InjectionMoldingRequestReader : IReader
return errors; return errors;
} }
/// <summary> // /// <summary>
/// 读取摄像头API // /// 读取摄像头API
/// </summary> // /// </summary>
/// <param name="p_type"></param> // /// <param name="p_type"></param>
/// <returns></returns> // /// <returns></returns>
public async Task<string> ReaderCameraApi() // public async Task<string> ReaderCameraApi()
{ // {
try // try
{ // {
// 从配置中获取远程摄像头的地址、用户名、密码和令牌 // // 从配置中获取远程摄像头的地址、用户名、密码和令牌
var address = _options.Value.AutoRemote.IpAddress; // var address = _options.Value.AutoRemote.IpAddress;
var username = _options.Value.AutoRemote.UserName; // var username = _options.Value.AutoRemote.UserName;
var password = _options.Value.AutoRemote.Password; // var password = _options.Value.AutoRemote.Password;
var token = _options.Value.AutoRemote.Token; // var token = _options.Value.AutoRemote.Token;
// 创建一个HttpClient实例 // // 创建一个HttpClient实例
var client = _httpClientFactory.CreateClient(); // var client = _httpClientFactory.CreateClient();
// 将用户名和密码转换为Base64编码的凭据,并设置请求的身份验证信息 // // 将用户名和密码转换为Base64编码的凭据,并设置请求的身份验证信息
var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")); // var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"));
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials); // client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
// 发送GET请求到远程摄像头地址并等待响应 // // 发送GET请求到远程摄像头地址并等待响应
var response = await client.GetAsync(address).ConfigureAwait(false); // var response = await client.PostAsync(address, new StringContent(token, Encoding.UTF8, "application/json")).ConfigureAwait(false);
// 如果请求成功,则返回响应内容,否则返回错误信息 // // 如果请求成功,则返回响应内容,否则返回错误信息
if (response.IsSuccessStatusCode) // if (response.IsSuccessStatusCode)
{ // {
return await response.Content.ReadAsStringAsync().ConfigureAwait(false); // return await response.Content.ReadAsStringAsync().ConfigureAwait(false);
} // }
} // }
catch (HttpRequestException ex) // catch (HttpRequestException ex)
{ // {
_logger.LogInformation("远程摄像头连接失败:" + ex.Message); // _logger.LogInformation("远程摄像头连接失败:" + ex.Message);
}
return "Error occurred"; // }
}
private List<InjectionRequest> Parse(string p_str) // return "Error occurred";
{ // }
List<InjectionRequest> requests = new List<InjectionRequest>();
return System.Text.Json.JsonSerializer.Deserialize<List<InjectionRequest>>(p_str); // private List<InjectionRequest> Parse(string p_str)
} // {
// List<InjectionRequest> requests = new List<InjectionRequest>();
// return System.Text.Json.JsonSerializer.Deserialize<List<InjectionRequest>>(p_str);
// }
@ -231,7 +276,7 @@ public class InjectionMoldingRequestReader : IReader
public class InjectionRequest public class InjectionRequest
{ {
/// <summary> /// <summary>
/// 零件M /// 零件M
@ -256,7 +301,7 @@ public class InjectionRequest
} }

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

@ -24,6 +24,9 @@ public class InjectionAutoRemote
public string Password { set; get; } public string Password { set; get; }
// 令牌 // 令牌
public string Token { set; get; } public string Token { set; get; }
public string AreaIDs { set; get; }
} }

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.InjectionMoldingTaskAgent/appsettings.json

@ -67,11 +67,11 @@
"InjectionMoldingTaskOptions": { "InjectionMoldingTaskOptions": {
"AutoRemote": { "AutoRemote": {
"IpAddress": "http://10.164.113.31:60085/", "IpAddress": "http://localhost:59094/",
"UserName": "", "UserName": "",
"Password": "", "Password": "",
"Token": "" "Token": "",
"AreaIDs": "1"
}, },
"IncomingOptions": { "IncomingOptions": {

15
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/DTOs/KittingDetailDTO.cs

@ -20,17 +20,26 @@ public class KittingDetailDTO: AuditedEntityDto<Guid>, IMultiTenant, IRemark
/// 物料编码 /// 物料编码
/// </summary> /// </summary>
[Display(Name = "物料编码")] [Display(Name = "物料编码")]
public string PartCode { set; get; } public string ItemCode { set; get; }
/// <summary>
/// 物品名称
/// </summary>
[Display(Name = "物品名称")]
public string ItemName { get; set; }
/// <summary> /// <summary>
/// 描述1 /// 描述1
/// </summary> /// </summary>
[Display(Name = "描述1")] [Display(Name = "描述1")]
public string Desc1 { set; get; } public string ItemDesc1 { set; get; }
/// <summary> /// <summary>
/// 描述2 /// 描述2
/// </summary> /// </summary>
[Display(Name = "描述2")] [Display(Name = "描述2")]
public string Desc2 { set; get; } public string ItemDesc2 { set; get; }
/// <summary> /// <summary>
/// 包装数量 /// 包装数量
/// </summary> /// </summary>

16
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/Inputs/KittingDetailInput.cs

@ -20,17 +20,27 @@ public class KittingDetailInput: EntityDto<Guid>, IMultiTenant, IRemark
/// 物料编码 /// 物料编码
/// </summary> /// </summary>
[Display(Name = "物料编码")] [Display(Name = "物料编码")]
public string PartCode { set; get; } public string ItemCode { set; get; }
/// <summary> /// <summary>
/// 描述1 /// 描述1
/// </summary> /// </summary>
[Display(Name = "描述1")] [Display(Name = "描述1")]
public string Desc1 { set; get; } public string ItemDesc1 { set; get; }
/// <summary> /// <summary>
/// 描述2 /// 描述2
/// </summary> /// </summary>
[Display(Name = "描述2")] [Display(Name = "描述2")]
public string Desc2 { set; get; } public string ItemDesc2 { set; get; }
/// <summary>
/// 物品名称
/// </summary>
[Display(Name = "物品名称")]
public string ItemName { get; set; }
/// <summary> /// <summary>
/// 包装数量 /// 包装数量
/// </summary> /// </summary>

40
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Kittings/Inputs/KittingImportInput.cs

@ -8,32 +8,42 @@ public class KittingImportInput : SfsBaseDataImportInputBase
/// <summary> /// <summary>
/// Kitting编码 /// Kitting编码
/// </summary> /// </summary>
[Display(Name = "Kitting编码")] ///
public string Code { get; set; }
[Display(Name = "物料编码")]
public string ItemCode { set; get; }
/// <summary> /// <summary>
/// Kitting名称 /// 描述1
/// </summary> /// </summary>
[Display(Name = "Kitting名称")] [Display(Name = "描述1")]
public string Name { get; set; } public string ItemDesc1 { set; get; }
/// <summary> /// <summary>
/// 物料编码 /// 描述2
/// </summary> /// </summary>
[Display(Name = "物料编码")] [Display(Name = "描述2")]
public string PartCode { set; get; } public string ItemDesc2 { set; get; }
/// <summary> /// <summary>
/// 描述1 /// 物品名称
/// </summary> /// </summary>
[Display(Name = "物料描述1")] [Display(Name = "物品名称")]
public string Desc1 { set; get; } public string ItemName { get; set; }
[Display(Name = "Kitting编码")]
public string Code { get; set; }
/// <summary> /// <summary>
/// 描述2 /// Kitting名称
/// </summary> /// </summary>
[Display(Name = "物料描述2")] [Display(Name = "Kitting名称")]
public string Desc2 { set; get; } public string Name { get; set; }
/// <summary> /// <summary>
/// 包装数量 /// 包装数量

7
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/DTOs/ProductionLineDTO.cs

@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -37,4 +38,10 @@ public class ProductionLineDTO : SfsBaseDataDTOBase, IHasCode, IHasName
/// </summary> /// </summary>
[Display(Name = "描述")] [Display(Name = "描述")]
public string Description { get; set; } public string Description { get; set; }
/// <summary>
/// 生产线类型
/// </summary>
[Display(Name = "生产线类型")]
public EnumProductionLineType ProductionLineType { get; set; }
} }

3
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/IProductionLineAppService.cs

@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -9,4 +11,5 @@ public interface IProductionLineAppService
, ISfsUpsertAppService<ProductionLineEditInput> , ISfsUpsertAppService<ProductionLineEditInput>
{ {
Task<ProductionLineDTO> GetByLocationCodeAsync(string locationCode); Task<ProductionLineDTO> GetByLocationCodeAsync(string locationCode);
Task<List<ProductionLineDTO>> GetByLocationCodeAsync(EnumProductionLineType productionLineType);
} }

7
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineEditInput.cs

@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -35,4 +36,10 @@ public class ProductionLineEditInput : SfsBaseDataCreateOrUpdateInputBase
/// </summary> /// </summary>
[Display(Name = "描述")] [Display(Name = "描述")]
public string Description { get; set; } public string Description { get; set; }
/// <summary>
/// 生产线类型
/// </summary>
[Display(Name = "生产线类型")]
public EnumProductionLineType ProductionLineType { get; set; }
} }

7
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ProductionLines/Inputs/ProductionLineImportInput.cs

@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -36,4 +37,10 @@ public class ProductionLineImportInput : SfsBaseDataImportInputBase
/// </summary> /// </summary>
[Display(Name = "描述")] [Display(Name = "描述")]
public string Description { get; set; } public string Description { get; set; }
/// <summary>
/// 生产线类型
/// </summary>
[Display(Name = "生产线类型")]
public EnumProductionLineType ProductionLineType { get; set; }
} }

37
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/tests/Class1.cs

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win_in.Sfs.Basedata.tests;
[Serializable]
//测试文件暂时不删除
public class ResponseJson
{
// 错误码:
public int Code { set; get; } = 0;
// 返回值 其具体含义由调用接口确定
public string Value { set; get; } = "";
// 错误消息
public string Msg { set; get; } = "";
}
[Serializable]
public class ResponCargoItem
{
// 区域ID
[Display(Name = "区域ID")]
public string AreaID { set; get; }
// 货位号
[Display(Name = "货位号")]
public string CargoID { set; get; } = "";
// 零件号
[Display(Name = "零件号")]
public string PartCode { set; get; } = "";
//货位状态 1 – 货位占用 0 – 货位空闲
[Display(Name = "货位状态")]
public int Flag { set; get; } = 0;
}

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Boms/BomAppService.cs

@ -20,8 +20,6 @@ public class BomAppService :
SfsBaseDataAppServiceBase<Bom, BomDTO, SfsBaseDataRequestInputBase, BomEditInput, BomImportInput>, SfsBaseDataAppServiceBase<Bom, BomDTO, SfsBaseDataRequestInputBase, BomEditInput, BomImportInput>,
IBomAppService IBomAppService
{ {
private new readonly IBomRepository _repository; private new readonly IBomRepository _repository;
private readonly IBomManager _bomManager; private readonly IBomManager _bomManager;
@ -224,7 +222,7 @@ public class BomAppService :
return ObjectMapper.Map<List<Bom>, List<BomDTO>>(entities); return ObjectMapper.Map<List<Bom>, List<BomDTO>>(entities);
} }
[HttpPost("get_bom_sublist")] [HttpPost("get-bom-sublist")]
public async Task<List<BomComponentDTO>> GetSubcomponentsRecursiveList(List<BomComponentDTO> p_lst, public async Task<List<BomComponentDTO>> GetSubcomponentsRecursiveList(List<BomComponentDTO> p_lst,
EnumBomSelectedType p_type EnumBomSelectedType p_type
) )

42
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Caches/CacheAppService.cs

@ -43,13 +43,6 @@ public class TaskItem
public class CycleOptions public class CycleOptions
{ {
/// <summary> /// <summary>
@ -76,32 +69,35 @@ public class CacheService:ISingletonDependency
/// </summary> /// </summary>
private async Task BomsCycle() private async Task BomsCycle()
{ {
var reassigner = new Reassigner(DateTime.Now, new TimeSpan(0, 0, _options.Value.BomsCycle == 0 ? 60 : _options.Value.BomsCycle));
//Task.Run(async () => await reassigner.RunAsync(async () =>
//{ {
var reassigner = new Reassigner(DateTime.Now, new TimeSpan(0, 0, _options.Value.BomsCycle == 0 ? 60 : _options.Value.BomsCycle)); using (var serviceScope = _serviceProvider.CreateScope())
await reassigner.RunAsync(async () => {
{ var repository = serviceScope.ServiceProvider.GetRequiredService<IBomRepository>();
using var serviceScope = _serviceProvider.CreateScope(); Cache.Boms.Clear();
var repository = serviceScope.ServiceProvider.GetRequiredService<IBomRepository>(); Cache.Boms = await repository.GetListAsync().ConfigureAwait(false);
Cache.Boms.Clear(); };
Cache.Boms = await repository.GetListAsync().ConfigureAwait(false); }).ConfigureAwait(false);
}).ConfigureAwait(false);
//});
;
} }
/// <summary> /// <summary>
/// 异步开始生命周期操作不能堵塞 /// 异步开始生命周期操作不能堵塞
/// </summary> /// </summary>
public async Task StartAsync() public async Task StartAsync()
{ {
BomsCycle();//异步处理不能堵塞主任务 BomsCycle();//异步处理不能堵塞主任务
} }
} }

28
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAppService.cs

@ -55,10 +55,9 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
var detailquery=await _repository.WithDetailsAsync().ConfigureAwait(false); var detailquery=await _repository.WithDetailsAsync().ConfigureAwait(false);
var first = detailquery.FirstOrDefault(p => p.Code == input.Code); var first = detailquery.FirstOrDefault(p => p.Code == input.Code);
var codes = input.Details.Select(p => p.PartCode); var codes = input.Details.Select(p => p.ItemCode);
if (first != null) if (first != null)
{ {
throw new UserFriendlyException($"已存在编码:{input.Code}的Kitting箱"); throw new UserFriendlyException($"已存在编码:{input.Code}的Kitting箱");
//var query = from itm in input.Details //var query = from itm in input.Details
// join itm1 in first.Details on itm.PartCode equals itm1.PartCode // join itm1 in first.Details on itm.PartCode equals itm1.PartCode
@ -86,7 +85,6 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
}); });
entity = await _repository.InsertAsync(entity).ConfigureAwait(false); entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
return ObjectMapper.Map<Kitting, KittingDTO>(entity); return ObjectMapper.Map<Kitting, KittingDTO>(entity);
} }
//first.Details.Where(p => codes.Contains(p.PartCode)); //first.Details.Where(p => codes.Contains(p.PartCode));
@ -151,13 +149,11 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
var inputFileBytes = ms.GetAllBytes(); var inputFileBytes = ms.GetAllBytes();
var importList= _excelService.Import<KittingImportInput>(inputFileBytes).ToList(); var importList= _excelService.Import<KittingImportInput>(inputFileBytes).ToList();
var checklist=importList.GroupBy(p => new { p.Code, p.PartCode }).Where(g => g.Count() > 1).Select(p => new { Code = p.Key.Code, PartCode = p.Key.PartCode });//导入重复报错 //检测是否导入重复 var checklist=importList.GroupBy(p => new { p.Code, p.ItemCode }).Where(g => g.Count() > 1).Select(p => new { Code = p.Key.Code, PartCode = p.Key.ItemCode });//导入重复报错 //检测是否导入重复
List<KittingErrorDto> errors = new List<KittingErrorDto>(); List<KittingErrorDto> errors = new List<KittingErrorDto>();
if (checklist.Any()) if (checklist.Any())
{ {
foreach (var error in checklist) { foreach (var error in checklist) {
errors.Add(new KittingErrorDto() { Code=error.Code,PartCode=error.PartCode, Content="记录有重复!" }); errors.Add(new KittingErrorDto() { Code=error.Code,PartCode=error.PartCode, Content="记录有重复!" });
} }
} }
@ -183,7 +179,6 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
var first = newDetail.FirstOrDefault(); var first = newDetail.FirstOrDefault();
var kitting = new KittingEditInput(); var kitting = new KittingEditInput();
kitting.InjectFrom(first); kitting.InjectFrom(first);
// kitting.Code = $"Q{kitting.Code}";
foreach (var detail in newDetail) foreach (var detail in newDetail)
{ {
var inputdetail = new KittingDetailInput(); var inputdetail = new KittingDetailInput();
@ -197,47 +192,40 @@ public class KittingAppService : SfsBaseDataWithCodeAppServiceBase<Kitting, Kitt
{ {
var id = Guid.NewGuid(); var id = Guid.NewGuid();
itm.SetId(id); itm.SetId(id);
//newMainList.Add(itm);
foreach (var detail in itm.Details) foreach (var detail in itm.Details)
{ {
detail.SetId(Guid.NewGuid()); detail.SetId(Guid.NewGuid());
detail.MasterId = id; detail.MasterId = id;
//newdetailList.Add(detail);
} }
} }
await _repository.InsertManyAsync(kittingList).ConfigureAwait(false); await _repository.InsertManyAsync(kittingList).ConfigureAwait(false);
//await _repository.GetDbContext().BulkInsertAsync(newMainList).ConfigureAwait(false);
//await _repository.GetDbContext().BulkInsertAsync<KittingDetail>(newdetailList).ConfigureAwait(false);
#endregion #endregion
} }
if (existCodeList.Any()) if (existCodeList.Any())
{ {
var existKittingList = importList.Where(p => existCodeList.Contains(p.Code)).ToList();//新Kitting var existKittingList = importList.Where(p => existCodeList.Contains(p.Code)).ToList();//新Kitting
List<KittingEditInput> existKittingInputList = new List<KittingEditInput>(); List<KittingEditInput> existKittingInputList = new List<KittingEditInput>();
//List<KittingDetail> existKittingDetailList = new List<KittingDetail>();
//List<KittingDetail> newKittingDetailList = new List<KittingDetail>();
foreach (var include in includeList) foreach (var include in includeList)
{ {
var newDetail = existKittingList.Where(p => p.Code == include.Code).ToList(); var newDetail = existKittingList.Where(p => p.Code == include.Code).ToList();
var innerExist = from itm in newDetail var innerExist = from itm in newDetail
join itm1 in include.Details on itm.PartCode equals itm1.PartCode join itm1 in include.Details on itm.ItemCode equals itm1.ItemCode
select itm; select itm;
if (innerExist.Any()) if (innerExist.Any())
{ {
var list = innerExist.ToList(); var list = innerExist.ToList();
foreach (var itm in include.Details) foreach (var itm in include.Details)
{ {
var entity = list.FirstOrDefault(p => p.PartCode == itm.PartCode); var entity = list.FirstOrDefault(p => p.ItemCode == itm.ItemCode);
itm.Desc1 = entity.Desc1; itm.ItemDesc1 = entity.ItemDesc1;
itm.Desc2 = entity.Desc2; itm.ItemDesc2 = entity.ItemDesc2;
itm.Qty = entity.Qty; itm.Qty = entity.Qty;
itm.Conf = entity.Conf; itm.Conf = entity.Conf;
//existKittingDetailList.Add(itm);
} }
} }
var leftExist = from itm in newDetail var leftExist = from itm in newDetail
join itm1 in include.Details on itm.PartCode equals itm1.PartCode join itm1 in include.Details on itm.ItemCode equals itm1.ItemCode
into temp into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
where tm == null where tm == null

6
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Kittings/KittingAutoMapperProfile.cs

@ -30,9 +30,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<KittingImportInput, KittingDetail>() CreateMap<KittingImportInput, KittingDetail>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
//.ForMember(x => x., y => y.MapFrom(t => t.Code)) //.ForMember(x => x., y => y.MapFrom(t => t.Code))
.ForMember(x => x.PartCode, y => y.MapFrom(t => t.PartCode)) .ForMember(x => x.ItemCode, y => y.MapFrom(t => t.ItemCode))
.ForMember(x => x.Desc1, y => y.MapFrom(t => t.Desc1)) .ForMember(x => x.ItemDesc1, y => y.MapFrom(t => t.ItemDesc1))
.ForMember(x => x.Desc2, y => y.MapFrom(t => t.Desc2)) .ForMember(x => x.ItemDesc2, y => y.MapFrom(t => t.ItemDesc2))
.Ignore(x => x.MasterId) .Ignore(x => x.MasterId)
.Ignore(x => x.TenantId) .Ignore(x => x.TenantId)
.Ignore(x => x.Remark) .Ignore(x => x.Remark)

11
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLines/ProductionLineAppService.cs

@ -1,12 +1,15 @@
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain; using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Shared; using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Application; namespace Win_in.Sfs.Basedata.Application;
@ -57,4 +60,12 @@ public class ProductionLineAppService
return ObjectMapper.Map<ProductionLine, ProductionLineDTO>(entity); return ObjectMapper.Map<ProductionLine, ProductionLineDTO>(entity);
} }
[HttpPost("get-by-type")]
public virtual async Task<List<ProductionLineDTO>> GetByLocationCodeAsync(EnumProductionLineType productionLineType)
{
var entitList = await _repository.GetListAsync(p => p.ProductionLineType == productionLineType).ConfigureAwait(false);
return ObjectMapper.Map<List<ProductionLine>, List<ProductionLineDTO>>(entitList);
}
} }

72
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/test/TestAppService.cs

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Office2010.Drawing;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Caches;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Basedata.tests;
namespace Win_in.Sfs.Basedata.Application;
/// <summary>
/// 接口模拟测试
/// </summary>
[AllowAnonymous]
[Route($"CargoState")]
public class TestService:ApplicationService
{
private readonly IServiceProvider _serviceProvider;
private readonly IOptions<CycleOptions> _options;
public TestService(IServiceProvider serviceProvider, IOptions<CycleOptions> options)
{
_serviceProvider = serviceProvider;
_options = options;
}
/// <summary>
/// 生命周期操作
/// </summary>
[HttpPost("GetMacStatic")]
public async Task<int> GetMacStatic()
{
return 1;
}
[HttpPost("GetCargoStatic")]
/// <summary>
/// 异步开始生命周期操作不能堵塞
/// </summary>
public async Task<List<ResponCargoItem>> GetCargoStatic(string p_AreaID)
{
List<ResponCargoItem> result = new List<ResponCargoItem>();
result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB1", PartCode = "TMDLYA0A071AB", Flag = 0 });
result.Add(new ResponCargoItem() { AreaID = "1", CargoID = "PTXB2", PartCode = "TMDLYA0A061AB", Flag = 0 });
result.Add(new ResponCargoItem() { AreaID = "2", CargoID = "ZSXB2", PartCode = "TMDLYD0ABM5A", Flag = 0 });
result = result.Where(p => p.AreaID == p_AreaID).ToList();
return result;
}
}

16
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain.Shared/Enum/EnumProductionLineType.cs

@ -1,16 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Basedata.Domain.Shared;
/// <summary>
/// 生产线类型
/// </summary>
public enum EnumProductionLineType
{
/// <summary>
/// 空枚举
/// </summary>
[Display(Name = "空")]
None = 0,
}

64
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Boms/BomManager.cs

@ -249,7 +249,7 @@ public class BomManager : DomainService, IBomManager
return list; return list;
} }
@ -261,35 +261,39 @@ public class BomManager : DomainService, IBomManager
/// <param name="p_component"></param> /// <param name="p_component"></param>
/// <param name="p_type"></param> /// <param name="p_type"></param>
/// <returns></returns> /// <returns></returns>
public async Task<List<BomComponent>> GetSubcomponentsRecursive(BomComponent p_component, EnumBomSelectedType p_type public async Task<List<BomComponent>> GetSubcomponentsRecursive(BomComponent p_component, EnumBomSelectedType p_type
) )
{ {
// 创建用于存储最终结果、维度结果和树状结果的列表
List<BomComponent> lastList = new List<BomComponent>(); List<BomComponent> lastList = new List<BomComponent>();
List<BomComponent> dimensionList=new List<BomComponent>(); List<BomComponent> dimensionList = new List<BomComponent>();
var treeList=await GetSubcomponentsRecursive(p_component, 1, p_component.ComponentQty, p_component.Component,
// 调用异步方法GetSubcomponentsRecursive以获取树状结果,并使用lambda表达式将结果添加到lastList和dimensionList
var treeList = await GetSubcomponentsRecursive(p_component, 1, p_component.ComponentQty, p_component.Component,
(rs) => lastList.Add(rs) (rs) => lastList.Add(rs)
, ,
(rs1)=>{ (rs1) => {
dimensionList.Add(rs1); dimensionList.Add(rs1);
}).ConfigureAwait(false); }).ConfigureAwait(false);
// 根据用户指定的类型,返回相应的结果列表
List<BomComponent> returnList=new List<BomComponent>(); List<BomComponent> returnList = new List<BomComponent>();
switch (p_type) switch (p_type)
{ {
case EnumBomSelectedType.Last: case EnumBomSelectedType.Last:
returnList = lastList; returnList = lastList;
break; break;
case EnumBomSelectedType.Tree: case EnumBomSelectedType.Tree:
returnList=treeList; returnList = treeList;
break; break;
case EnumBomSelectedType.Dimension: case EnumBomSelectedType.Dimension:
returnList=dimensionList; returnList = dimensionList;
break; break;
} }
return returnList; return returnList;
} }
/// <summary> /// <summary>
@ -303,55 +307,73 @@ public class BomManager : DomainService, IBomManager
/// <param name="p_actionDimension">树型转成一维表用</param> /// <param name="p_actionDimension">树型转成一维表用</param>
/// <param name="bomList"></param> /// <param name="bomList"></param>
/// <returns></returns> /// <returns></returns>
private async Task<List<BomComponent>> GetSubcomponentsRecursive(BomComponent p_component, int level, decimal sumQty, string root, Action<BomComponent> p_actionLast, private async Task<List<BomComponent>> GetSubcomponentsRecursive(BomComponent p_component, int level, decimal sumQty, string root, Action<BomComponent> p_actionLast,
Action<BomComponent> p_actionDimension Action<BomComponent> p_actionDimension
/* ,List<Bom> bomList =null*/ /* ,List<Bom> bomList =null*/
) )
{ {
// 初始化子零件列表
List<BomComponent> subComponents = new List<BomComponent>(); List<BomComponent> subComponents = new List<BomComponent>();
// 假设 GetComponentsByProduct 方法可获取某个物料号下的所有子零件 // 假设 GetComponentsByProduct 方法可获取某个物料号下的所有子零件
List<BomComponent> directSubComponents =await GetComponentsByProduct(p_component.Component).ConfigureAwait(false); List<BomComponent> directSubComponents = await GetComponentsByProduct(p_component.Component).ConfigureAwait(false);
if (!directSubComponents.Any() && level != 1)//不是根元素 // 如果没有直接子零件且不是根元素,则执行最后操作回调函数
if (!directSubComponents.Any() && level != 1)
{ {
p_actionLast(p_component); p_actionLast(p_component);
} }
// 遍历直接子零件列表
foreach (var component in directSubComponents) foreach (var component in directSubComponents)
{ {
// 设置根元素和数量
component.Root = root; component.Root = root;
component.SumQty = sumQty * component.ComponentQty; component.SumQty = sumQty * component.ComponentQty;
component.ParentComponent = p_component.Component; component.ParentComponent = p_component.Component;
component.Level = level; component.Level = level;
// 设置拆解路径
component.Path = (p_component.Component != root) ? p_component.Path + $"->{component.Component}" : p_component.Component + $"->{component.Component}"; component.Path = (p_component.Component != root) ? p_component.Path + $"->{component.Component}" : p_component.Component + $"->{component.Component}";
component.SubComponents =await GetSubcomponentsRecursive(component, level + 1, sumQty * component.ComponentQty, component.Root, p_actionLast, p_actionDimension).ConfigureAwait(false); // 递归获取子零件列表,并执行维度操作回调函数
component.SubComponents = await GetSubcomponentsRecursive(component, level + 1, sumQty * component.ComponentQty, component.Root, p_actionLast, p_actionDimension).ConfigureAwait(false);
p_actionDimension(component); p_actionDimension(component);
// 添加子零件到子零件列表
subComponents.Add(component); subComponents.Add(component);
} }
// 返回子零件列表
return subComponents; return subComponents;
} }
/// <summary>
/// 读取子节点
/// </summary>
/// <param name="product"></param>
/// <returns></returns>
private async Task<List<BomComponent>> GetComponentsByProduct(string product) private async Task<List<BomComponent>> GetComponentsByProduct(string product)
{ {
List<Bom> list=new List<Bom>(); List<Bom> list = new List<Bom>();
if (Cache.Boms.Count == 0) if (Cache.Boms.Count == 0)
{ {
InitBomComponent(); InitBomComponent();
} }
list=Cache.Boms.Count > 0 ? Cache.Boms.Where(p => p.Product == product).ToList() : // 如果缓存中有Bom列表,则从缓存中筛选符合条件的数据;否则从仓储中异步获取数据
list = Cache.Boms.Count > 0 ? Cache.Boms.Where(p => p.Product == product).ToList() :
await _repository.GetListAsync(p => p.Product == product).ConfigureAwait(false); await _repository.GetListAsync(p => p.Product == product).ConfigureAwait(false);
List<BomComponent> components = new List<BomComponent>(); List<BomComponent> components = new List<BomComponent>();
foreach (var component in list) foreach (var component in list)
{ {
BomComponent bomComponent = new BomComponent(); BomComponent bomComponent = new BomComponent();
bomComponent.InjectFrom(component); bomComponent.InjectFrom(component);
components.Add(bomComponent); components.Add(bomComponent);
} }
// 其他物料号的子零件信息类似添加 // 其他物料号的子零件信息类似添加
return components; return components;
} }
/// <summary> /// <summary>
/// 获取所有bomtree /// 获取所有bomtree
/// </summary> /// </summary>

18
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Kittings/KittingDetail.cs

@ -14,15 +14,27 @@ public class KittingDetail : AuditedEntity<Guid>, IMultiTenant, IRemark
/// <summary> /// <summary>
/// 物料编码 /// 物料编码
/// </summary> /// </summary>
public string PartCode { set; get; } [Display(Name = "物料编码")]
public string ItemCode { set; get; }
/// <summary> /// <summary>
/// 描述1 /// 描述1
/// </summary> /// </summary>
public string Desc1 { set; get; } [Display(Name = "描述1")]
public string ItemDesc1 { set; get; }
/// <summary> /// <summary>
/// 描述2 /// 描述2
/// </summary> /// </summary>
public string Desc2 { set; get; } [Display(Name = "描述2")]
public string ItemDesc2 { set; get; }
/// <summary>
/// 物品名称
/// </summary>
[Display(Name = "物品名称")]
public string ItemName { get; set; }
/// <summary> /// <summary>
/// 包装数量 /// 包装数量
/// </summary> /// </summary>

7
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/ProductionLines/ProductionLine.cs

@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Basedata.Domain; namespace Win_in.Sfs.Basedata.Domain;
@ -35,4 +36,10 @@ public class ProductionLine : SfsBaseDataAggregateRootBase, IHasCode, IHasName
/// </summary> /// </summary>
[Display(Name = "描述")] [Display(Name = "描述")]
public string Description { get; set; } public string Description { get; set; }
/// <summary>
/// 生产线类型
/// </summary>
[Display(Name = "生产线类型")]
public EnumProductionLineType ProductionLineType { get; set; }
} }

6
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingDbContextModelCreatingExtensions.cs

@ -36,10 +36,10 @@ public static class KittingDbContextModelCreatingExtensions
b.ConfigureByConvention(); b.ConfigureByConvention();
//Configure Sfs base properties //Configure Sfs base properties
b.ConfigureSfsBase(); b.ConfigureSfsBase();
b.Property(p => p.ItemName).HasMaxLength(SfsPropertyConst.DescLength);
b.Property(p => p.Desc1).HasMaxLength(SfsPropertyConst.DescLength); b.Property(p => p.ItemDesc1).HasMaxLength(SfsPropertyConst.DescLength);
//Properties //Properties
b.Property(q => q.Desc2).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.ItemDesc2).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations
b.Property(q => q.MasterId).IsRequired(); b.Property(q => q.MasterId).IsRequired();
//Indexes //Indexes

11
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Kittings/KittingEfCoreRepository.cs

@ -33,14 +33,14 @@ public class KittingEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataD
var left = from itm in newData.Details var left = from itm in newData.Details
join itm1 in detailList on join itm1 in detailList on
itm.PartCode equals itm1.PartCode itm.ItemCode equals itm1.ItemCode
into temp into temp
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
where tm == null where tm == null
select itm; select itm;
var inner = from itm in detailList var inner = from itm in detailList
join itm1 in newData.Details on join itm1 in newData.Details on
itm.PartCode equals itm1.PartCode itm.ItemCode equals itm1.ItemCode
select itm1; select itm1;
//await detail.AddRangeAsync(left.ToList()).ConfigureAwait(false); //await detail.AddRangeAsync(left.ToList()).ConfigureAwait(false);
@ -48,10 +48,11 @@ public class KittingEfCoreRepository : SfsBaseDataEfCoreRepositoryBase<BasedataD
List<KittingDetail> update = new List<KittingDetail>(); List<KittingDetail> update = new List<KittingDetail>();
foreach (var itm in inner.ToList()) foreach (var itm in inner.ToList())
{ {
var first = newData.Details.FirstOrDefault(p => p.PartCode == itm.PartCode); var first = newData.Details.FirstOrDefault(p => p.ItemCode == itm.ItemCode);
itm.Qty = first.Qty; itm.Qty = first.Qty;
itm.Desc1 = first.Desc1; itm.ItemDesc1 = first.ItemDesc1;
itm.Desc2 = first.Desc2; itm.ItemDesc2 = first.ItemDesc2;
itm.ItemName=first.ItemName;
update.Add(itm); update.Add(itm);
} }

5
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Basedata/EnumLocationType.cs

@ -78,4 +78,9 @@ public enum EnumLocationType
/// 三方库 /// 三方库
/// </summary> /// </summary>
[Display(Name = "三方库")] THIRDPARTY = 14, [Display(Name = "三方库")] THIRDPARTY = 14,
/// <summary>
/// Kitting线边
/// </summary>
[Display(Name = "Kitting线边")] KittingWip = 15,
} }

23
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Basedata/EnumProductionLineType.cs

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Shared.Domain.Shared;
public enum EnumProductionLineType
{
None = 0,
/// <summary>
/// 注塑
/// </summary>
[Display(Name = "注塑")] Injection = 1,
/// <summary>
/// 喷涂
/// </summary>
[Display(Name = "喷涂")] Coating = 2,
/// <summary>
/// 装配
/// </summary>
[Display(Name = "装配")] Assemble = 3
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Chassis/IChassisAppService.cs

@ -1,3 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -9,4 +12,10 @@ public interface IChassisAppService
ISfsCheckStatusAppService ISfsCheckStatusAppService
, ISfsUpsertAppService<ChassisEditInput> , ISfsUpsertAppService<ChassisEditInput>
{ {
/// <summary>
/// 平板或手持使用 按照底盘返回排序大于参数中20个的
/// </summary>
/// <returns></returns>
Task<PagedResultDto<ChassisDTO>> GetListWithNextCountAsync(long sortNumber,int count,
CancellationToken cancellationToken = default);
} }

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/DTOs/ChassisOperationSequenceDTO.cs

@ -1,8 +1,8 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary> /// <summary>
/// 底盘执行位置序列 /// 底盘执行位置序列
/// </summary> /// </summary>
@ -10,10 +10,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ChassisOperationSequenceDTO : SfsBasicDTOBase public class ChassisOperationSequenceDTO : SfsBasicDTOBase
{ {
/// <summary> /// <summary>
/// kitting执行序列号 /// Kitting执行底盘序列位置
/// </summary> /// </summary>
[Display(Name = "kitting执行序列号")] [Display(Name = "Kitting执行底盘序列位置")]
public string KittingNumber { get; set; } public long ChassisSortNumber { get; set; }
/// <summary> /// <summary>
/// kitting代码 /// kitting代码

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/IChassisOperationSequenceAppService.cs

@ -1,3 +1,4 @@
using System.Threading.Tasks;
using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -9,4 +10,11 @@ public interface IChassisOperationSequenceAppService
ISfsCheckStatusAppService ISfsCheckStatusAppService
, ISfsUpsertAppService<ChassisOperationSequenceEditInput> , ISfsUpsertAppService<ChassisOperationSequenceEditInput>
{ {
/// <summary>
/// 修改底盘执行序列位置 根据 KitingCode
/// </summary>
/// <param name="kittingCode"></param>
/// <param name="newChassisSortNumber"></param>
/// <returns></returns>
Task UpdateChassisSortNumberByKittingCodeAsync(string kittingCode, long newChassisSortNumber);
} }

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/Inputs/ChassisOperationSequenceEditInput.cs

@ -1,4 +1,3 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -11,10 +10,10 @@ public class ChassisOperationSequenceEditInput
: SfsStoreCreateOrUpdateInputBase : SfsStoreCreateOrUpdateInputBase
{ {
/// <summary> /// <summary>
/// kitting执行序列号 /// Kitting执行底盘序列位置
/// </summary> /// </summary>
[Display(Name = "kitting执行序列号")] [Display(Name = "Kitting执行底盘序列位置")]
public string KittingNumber { get; set; } public long ChassisSortNumber { get; set; }
/// <summary> /// <summary>
/// kitting代码 /// kitting代码

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ChassisOperationSequence/Inputs/ChassisOperationSequenceImportInput.cs

@ -1,9 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -14,10 +9,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ChassisOperationSequenceImportInput : SfsStoreImportInputBase public class ChassisOperationSequenceImportInput : SfsStoreImportInputBase
{ {
/// <summary> /// <summary>
/// kitting执行序列号 /// Kitting执行底盘序列位置
/// </summary> /// </summary>
[Display(Name = "kitting执行序列号")] [Display(Name = "Kitting执行底盘序列位置")]
public string KittingNumber { get; set; } public long ChassisSortNumber { get; set; }
/// <summary> /// <summary>
/// kitting代码 /// kitting代码

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteChassisDetailDTO.cs

@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteChassisDetailDTO : SfsStoreDetailDTOBase
{
/// <summary>
/// 底盘号
/// </summary>
[Display(Name = "底盘号")]
public string ChassisNumber { get; set; }
/// <summary>
/// Kitting代码
/// </summary>
[Display(Name = "Kitting代码")]
public string KittingCode { get; set; }
/// <summary>
/// 底盘号排序序列
/// </summary>
[Display(Name = "底盘号排序序列")]
public long ChassisSortNumber { get; set; }
}

49
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDTO.cs

@ -8,54 +8,21 @@ using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
[Display(Name = "盘点任务")] [Display(Name = "盘点任务")]
public class KittingPackagingNoteDTO : SfsJobDTOBase<KittingPackagingNoteDetailDTO> public class KittingPackagingNoteDTO : SfsStoreDTOBase<KittingPackagingNoteDetailDTO>
{ {
/// <summary>
/// 生产计划号
/// </summary>
[Display(Name = "盘点计划号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string CountPlanNumber { get; set; }
/// <summary>
/// 盘点阶段
/// </summary>
[Display(Name = "盘点阶段")]
public EnumCountStage CountStage { get; set; }
/// <summary>
/// 盘点方式
/// </summary>
[Display(Name = "盘点方式")]
public EnumCountMethod CountMethod { get; set; }
/// <summary>
/// 类型
/// </summary>
[Display(Name = "盘点类型")]
public EnumCountType Type { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string Description { get; set; }
/// <summary> /// <summary>
/// 物料代码 /// kitting代码
/// </summary> /// </summary>
[Display(Name = "物料代码")] [Display(Name = "Kitting代码")]
public string ItemCode { get; set; } public string KittingCode { get; set; }
/// <summary> /// <summary>
/// 库位代码 /// 明细(记录Kitting打包中的子物品明细)
/// </summary> /// </summary>
[Display(Name = "库位代码")] public override List<KittingPackagingNoteDetailDTO> Details { get; set; } = new();
public string LocationCode { get; set; }
/// <summary> /// <summary>
/// 任务从表明细(记录每次扫得明细 /// 明细(记录底盘相关的信息)
/// </summary> /// </summary>
public List<KittingPackagingNoteDependentDetailDTO> DepDetails { get; set; } public List<KittingPackagingNoteChassisDetailDTO> DepDetails { get; set; } = new();
} }

58
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDependentDetailDTO.cs

@ -1,58 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteDependentDetailDTO : 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; }
}

52
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/DTOs/KittingPackagingNoteDetailDTO.cs

@ -4,55 +4,41 @@ using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteDetailDTO : SfsJobDetailDTOBase, IHasCountResult public class KittingPackagingNoteDetailDTO : SfsStoreDetailDTOBase
{ {
/// <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>
/// 库存数量 /// 物品代码
/// </summary> /// </summary>
[Display(Name = "库存数量")] [Display(Name = "物品代码")]
public decimal InventoryQty { get; set; } public string ItemCode { get; set; }
/// <summary> /// <summary>
/// 库存库位 /// 物品名称
/// </summary> /// </summary>
[Display(Name = "库存库位")] [Display(Name = "物品名称")]
public string InventoryLocationCode { get; set; } public string ItemName { get; set; }
/// <summary> /// <summary>
/// 盘点数量 /// 物品描述1
/// </summary> /// </summary>
[Display(Name = "盘点数量")] [Display(Name = "物品描述1")]
public decimal CountQty { get; set; } public string ItemDesc1 { get; set; }
/// <summary> /// <summary>
/// 盘点时间 /// 物品描述2
/// </summary> /// </summary>
[Display(Name = "盘点时间")] [Display(Name = "物品描述2")]
public DateTime? CountTime { get; set; } public string ItemDesc2 { get; set; }
/// <summary> /// <summary>
/// 盘点操作员 /// 数量
/// </summary> /// </summary>
[Display(Name = "盘点操作员")] [Display(Name = "数量")]
public string CountOperator { get; set; } public decimal Qty { get; set; }
/// <summary> /// <summary>
/// 盘点描述 /// Kitting代码
/// </summary> /// </summary>
[Display(Name = "盘点描述")] [Display(Name = "Kitting代码")]
public string CountDescription { get; set; } public string KittingCode { get; set; }
} }

32
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteChassisDetailInput.cs

@ -0,0 +1,32 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteChassisDetailInput : SfsStoreDetailInputBase
{
/// <summary>
/// 底盘号
/// </summary>
[Display(Name = "底盘号")]
public string ChassisNumber { get; set; }
/// <summary>
/// Kitting代码
/// </summary>
[Display(Name = "Kitting代码")]
public string KittingCode { get; set; }
/// <summary>
/// 底盘号排序序列
/// </summary>
[Display(Name = "底盘号排序序列")]
public long ChassisSortNumber { get; set; }
/// <summary>
///
/// </summary>
public string ItemCode { get; set; }
}

88
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteCreateRequestInput.cs

@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -11,91 +12,18 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteCreateRequestInput public class KittingPackagingNoteCreateRequestInput
{ {
/// <summary> /// <summary>
/// 盘点方式 /// kitting代码
/// </summary> /// </summary>
[Display(Name = "盘点方式")] [Display(Name = "Kitting代码")]
public EnumCountMethod CountMethod { get; set; } public string KittingCode { get; set; }
/// <summary> /// <summary>
/// 描述 /// 明细(记录打包的明细)
/// </summary> /// </summary>
[Display(Name = "描述")] public List<KittingPackagingNoteDetail> Details { get; set; } = new();
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Description { get; set; }
/// <summary> /// <summary>
/// 盘点执行形式 /// 明细(记录每次扫的位置)
/// </summary> /// </summary>
[Display(Name = "盘点执行形式")] public List<KittingPackagingNoteChassisDetail> DepDetails { get; set; } = new();
public CountPlanRequestType RequestType { get; set; }
/// <summary>
/// 类型
/// </summary>
[Display(Name = "盘点类型")]
public EnumCountType Type { get; set; }
/// <summary>
/// 零件条件集合
/// </summary>
[Display(Name = "零件条件集合")]
public List<string> PartCondition { get; set; } = new();
/// <summary>
/// 库位条件集合
/// </summary>
[Display(Name = "库位条件集合")]
public List<string> LocCondition { get; set; } = new();
/// <summary>
/// 状态
/// </summary>
[Display(Name = "状态")]
public List<EnumInventoryStatus> StatusList { get; set; }
/// <summary>
/// 操作员
/// </summary>
[Display(Name = "操作员")]
//[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Worker { get; set; }
/// <summary>
/// 仓库
/// </summary>
[Display(Name = "仓库")]
//[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WarehouseCode { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
public string Remark { get; set; }
/// <summary>
/// 盘点阶段
/// </summary>
[Display(Name = "盘点阶段")]
public EnumCountStage CountStage { get; set; } = EnumCountStage.Circulate;
/// <summary>
/// 盘点的零件集合
/// </summary>
[Display(Name = "盘点的零件集合")]
public string JsonItemCodes { get; set; }
/// <summary>
/// 盘点的库位集合
/// </summary>
[Display(Name = "盘点的库位集合")]
public string JsonLocationCodes { get; set; }
/// <summary>
/// 盘点的库存状态集合
/// </summary>
[Display(Name = "盘点的库存状态集合")]
public string JsonInventoryStatus { get; set; }
} }

52
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteDetailInput.cs

@ -4,55 +4,41 @@ using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteDetailInput : SfsJobDetailInputBase, IHasCountResult public class KittingPackagingNoteDetailInput : SfsStoreDetailInputBase
{ {
/// <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>
/// 库存数量 /// 物品代码
/// </summary> /// </summary>
[Display(Name = "库存数量")] [Display(Name = "物品代码")]
public decimal InventoryQty { get; set; } public string ItemCode { get; set; }
/// <summary> /// <summary>
/// 库存库位 /// 物品名称
/// </summary> /// </summary>
[Display(Name = "库存库位")] [Display(Name = "物品名称")]
public string InventoryLocationCode { get; set; } public string ItemName { get; set; }
/// <summary> /// <summary>
/// 盘点数量 /// 物品描述1
/// </summary> /// </summary>
[Display(Name = "盘点数量")] [Display(Name = "物品描述1")]
public decimal CountQty { get; set; } public string ItemDesc1 { get; set; }
/// <summary> /// <summary>
/// 盘点时间 /// 物品描述2
/// </summary> /// </summary>
[Display(Name = "盘点时间")] [Display(Name = "物品描述2")]
public DateTime? CountTime { get; set; } public string ItemDesc2 { get; set; }
/// <summary> /// <summary>
/// 盘点操作员 /// 数量
/// </summary> /// </summary>
[Display(Name = "盘点操作员")] [Display(Name = "数量")]
public string CountOperator { get; set; } public decimal Qty { get; set; }
/// <summary> /// <summary>
/// 盘点描述 /// Kitting代码
/// </summary> /// </summary>
[Display(Name = "盘点描述")] [Display(Name = "Kitting代码")]
public string CountDescription { get; set; } public string KittingCode { get; set; }
} }

74
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteEditInput.cs

@ -2,81 +2,25 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<KittingPackagingNoteDetailInput> public class KittingPackagingNoteEditInput : SfsStoreCreateOrUpdateInputBase
{ {
#region Base
/// <summary> /// <summary>
/// 盘点方式 /// kitting代码
/// </summary> /// </summary>
[Display(Name = "盘点方式")] [Display(Name = "Kitting代码")]
public EnumCountMethod CountMethod { get; set; } public string KittingCode { get; set; }
/// <summary>
/// 类型
/// </summary>
[Display(Name = "盘点类型")]
public EnumCountType Type { get; set; }
/// <summary>
/// 描述
/// </summary>
[Display(Name = "描述")]
public string Description { get; set; }
/// <summary>
/// 物料代码
/// </summary>
[Display(Name = "物料代码")]
public string ItemCode { get; set; }
/// <summary>
/// 库位代码
/// </summary>
[Display(Name = "库位代码")]
public string LocationCode { get; set; }
#endregion
#region Create
/// <summary>
/// 上游任务编号
/// </summary>
[Display(Name = "上游任务编号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string UpStreamJobNumber { get; set; }
/// <summary>
/// 盘点计划号
/// </summary>
[Display(Name = "盘点计划号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string CountPlanNumber { get; set; }
/// <summary>
/// 盘点阶段
/// </summary>
[Display(Name = "盘点阶段")]
public EnumCountStage CountStage { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[Display(Name = "任务类型")]
public EnumJobType JobType { get; set; }
/// <summary> /// <summary>
/// 是否自动完成 /// 明细(记录Kitting打包中的子物品明细)
/// </summary> /// </summary>
[Display(Name = "是否自动完成")] public List<KittingPackagingNoteDetailInput> Details { get; set; } = new();
public bool IsAutoComplete { get; set; }
/// <summary> /// <summary>
/// 任务明细 /// 明细(记录底盘相关的信息)
/// </summary> /// </summary>
[Display(Name = "任务明细")] public List<KittingPackagingNoteChassisDetailInput> DepDetails { get; set; } = new();
public List<KittingPackagingNoteDetailInput> Details { get; set; }
#endregion
} }

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/KittingPackagingNotes/Inputs/KittingPackagingNoteImportInput.cs

@ -1,32 +1,24 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class KittingPackagingNoteImportInput : SfsStoreImportInputBase public class KittingPackagingNoteImportInput : SfsStoreImportInputBase
{ {
/// <summary>
/// 盘点任务单号
/// </summary>
[Display(Name = "盘点任务单号")]
public string CountJobNumber { get; set; }
/// <summary> /// <summary>
/// 盘点计划单号 /// kitting代码
/// </summary> /// </summary>
[Display(Name = "盘点计划单号")] [Display(Name = "Kitting代码")]
public string CountPlanNumber { get; set; } public string KittingCode { get; set; }
/// <summary> /// <summary>
/// 调整类型 /// 明细(记录打包的明细)
/// </summary> /// </summary>
[Display(Name = "调整类型")] public List<KittingPackagingNoteDetail> Details { get; set; } = new();
public string Type { get; set; }
/// <summary> /// <summary>
/// 是否已经调整 /// 明细(记录每次扫的位置)
/// </summary> /// </summary>
[Display(Name = "是否已经调整")] public List<KittingPackagingNoteChassisDetail> DepDetails { get; set; } = new();
[Required(ErrorMessage = "{0}是必填项")]
public bool IsAdjusted { get; set; } = false;
} }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/MesNotes/Inputs/MesNoteEditInput.cs

@ -29,7 +29,7 @@ public class MesNoteEditInput : SfsStoreCreateOrUpdateInputBase
public string MesRequestNumber { get; set; } public string MesRequestNumber { get; set; }
/// <summary> /// <summary>
/// Mes类型(40-冻结、41-解冻 ) /// Mes类型(事务类型40-冻结、41-解冻 )
/// </summary> /// </summary>
[Display(Name = "类型")] [Display(Name = "类型")]
public string Type { get; set; } public string Type { get; set; }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs

@ -98,6 +98,8 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddChassisPermission(); storeGroup.AddChassisPermission();
storeGroup.AddChassisOperationSequencePermission(); storeGroup.AddChassisOperationSequencePermission();
storeGroup.AddKittingPackagingNotePermission();
#region Jobs #region Jobs
storeGroup.AddPurchaseReceiptJobPermission(); storeGroup.AddPurchaseReceiptJobPermission();

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/DTOs/InjectionIssueRequestDetailDTO.cs

@ -53,3 +53,10 @@ public class InjectionIssueRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
[Display(Name = "需求箱数量")] [Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; } public decimal BoxQty { get; set; }
} }
public class UnCompletedRequestDto
{
public string ItemCode { get; set; }
public string LocCode { get; set; }
public string PositionCode { get; set; }
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/IInjectionIssueRequestAppService.cs

@ -23,4 +23,7 @@ public interface IInjectionIssueRequestAppService
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<List<ItemBasicDTO>> GetItemCategoryListAsync(); Task<List<ItemBasicDTO>> GetItemCategoryListAsync();
Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list);
} }

42
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Chassis/ChassisAppService.cs

@ -1,25 +1,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities; using Win_in.Sfs.Shared.Domain;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Equipments.DTOs;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Store.Application.Contracts; using Win_in.Sfs.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Equipments;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
@ -36,7 +26,7 @@ public class ChassisAppService
public ChassisAppService( public ChassisAppService(
IChassisRepository repository, IChassisManager manager IChassisRepository repository, IChassisManager manager
):base(repository) ) : base(repository)
{ {
base.CreatePolicyName = ChassisPermissions.Create; base.CreatePolicyName = ChassisPermissions.Create;
base.UpdatePolicyName = ChassisPermissions.Update; base.UpdatePolicyName = ChassisPermissions.Update;
@ -45,6 +35,7 @@ public class ChassisAppService
_repository = repository; _repository = repository;
_manager = manager; _manager = manager;
} }
#region 无用 #region 无用
[NonAction] [NonAction]
@ -83,5 +74,32 @@ public class ChassisAppService
throw new NotImplementedException(); throw new NotImplementedException();
} }
/// <summary>
/// 平板或手持使用 按照底盘返回排序大于参数中20个的
/// </summary>
/// <returns></returns>
[HttpPost("get-list-with-next-count")]
public async Task<PagedResultDto<ChassisDTO>> GetListWithNextCountAsync(long sortNumber,int count,
CancellationToken cancellationToken = default)
{
var requestInput = new SfsStoreRequestInputBase
{
MaxResultCount = count,
SkipCount = 0,
Sorting = $"{nameof(Chassis.SortNumber)} DESC",
Condition = new Condition
{
Filters = new List<Filter> { new(nameof(Chassis.SortNumber), sortNumber.ToString(), ">=") }
}
};
var expression = requestInput.Condition.Filters?.Count > 0
? requestInput.Condition.Filters.ToLambda<Chassis>()
: p => true;
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, false, cancellationToken).ConfigureAwait(false);
}
#endregion #endregion
} }

47
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ChassisOperationSequence/ChassisOperationSequenceAppService.cs

@ -1,32 +1,20 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Equipments.DTOs;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Store.Application.Contracts; using Win_in.Sfs.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Equipments;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
[Authorize] [Authorize]
[Route($"{StoreConsts.RootPath}ChassisOperationSequence")] [Route($"{StoreConsts.RootPath}ChassisOperationSequence")]
public class ChassisOperationSequenceAppService public class ChassisOperationSequenceAppService
: SfsStoreAppServiceBase<Domain.ChassisOperationSequence, ChassisOperationSequenceDTO, SfsStoreRequestInputBase, ChassisOperationSequenceEditInput, : SfsStoreAppServiceBase<ChassisOperationSequence, ChassisOperationSequenceDTO, SfsStoreRequestInputBase,
ChassisOperationSequenceEditInput,
ExchangeDataImportInput> ExchangeDataImportInput>
, IChassisOperationSequenceAppService , IChassisOperationSequenceAppService
@ -36,7 +24,7 @@ public class ChassisOperationSequenceAppService
public ChassisOperationSequenceAppService( public ChassisOperationSequenceAppService(
IChassisOperationSequenceRepository repository, IChassisOperationSequenceManager manager IChassisOperationSequenceRepository repository, IChassisOperationSequenceManager manager
):base(repository) ) : base(repository)
{ {
base.CreatePolicyName = ChassisOperationSequencePermissions.Create; base.CreatePolicyName = ChassisOperationSequencePermissions.Create;
base.UpdatePolicyName = ChassisOperationSequencePermissions.Update; base.UpdatePolicyName = ChassisOperationSequencePermissions.Update;
@ -45,6 +33,35 @@ public class ChassisOperationSequenceAppService
_repository = repository; _repository = repository;
_manager = manager; _manager = manager;
} }
/// <summary>
/// 修改底盘执行序列位置 根据 KitingCode
/// </summary>
/// <param name="kittingCode"></param>
/// <param name="newChassisSortNumber"></param>
/// <returns></returns>
[HttpPost("update-chassis-sort-number-by-kitting-code")]
public async Task UpdateChassisSortNumberByKittingCodeAsync(string kittingCode, long newChassisSortNumber)
{
var chassisOperationSequence =
await _repository.FindAsync(p => p.KittingCode == kittingCode).ConfigureAwait(false);
if (chassisOperationSequence == null)
{
var input= new ChassisOperationSequenceEditInput();
input.KittingCode=kittingCode;
input.ChassisNumber = string.Empty;
input.ChassisSortNumber = newChassisSortNumber;
await CreateAsync(input).ConfigureAwait(false);
}
else
{
chassisOperationSequence.ChassisSortNumber = newChassisSortNumber;
await _repository.UpdateAsync(chassisOperationSequence).ConfigureAwait(false);
}
}
#region 无用 #region 无用
[NonAction] [NonAction]

71
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/KittingPackagingNotes/KittingPackagingNoteAppService.cs

@ -1,5 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Boms.DTOs;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared; using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -7,7 +17,7 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application; namespace Win_in.Sfs.Wms.Store.Application;
/// <summary> /// <summary>
/// 盘点接口 /// kitting打包记录
/// </summary> /// </summary>
[Authorize] [Authorize]
[Route($"{StoreConsts.RootPath}KittingPackagingNote")] [Route($"{StoreConsts.RootPath}KittingPackagingNote")]
@ -22,13 +32,62 @@ public class KittingPackagingNoteAppService
SfsStoreRequestInputBase, SfsStoreRequestInputBase,
KittingPackagingNoteImportInput>, IKittingPackagingNoteAppService KittingPackagingNoteImportInput>, IKittingPackagingNoteAppService
{ {
private readonly IKittingPackagingNoteManager _kittingPackagingNoteManager; private readonly IChassisOperationSequenceAppService _chassisOperationSequenceAppService;
private readonly IBomAppService _bomAppService;
private readonly IKittingAppService _kittingAppService;
public KittingPackagingNoteAppService( public KittingPackagingNoteAppService(
IKittingPackagingNoteRepository repository, IKittingPackagingNoteRepository repository, IChassisOperationSequenceAppService chassisOperationSequenceAppService, IBomAppService bomAppService, IKittingAppService kittingAppService) : base(repository)
IJisProductReceiptNoteManager KittingPackagingNoteManager,
IKittingPackagingNoteManager kittingPackagingNoteManager) : base(repository)
{ {
_kittingPackagingNoteManager = kittingPackagingNoteManager; _chassisOperationSequenceAppService = chassisOperationSequenceAppService;
_bomAppService = bomAppService;
_kittingAppService = kittingAppService;
}
[HttpPost("")]
public override async Task<KittingPackagingNoteDTO> CreateAsync(KittingPackagingNoteEditInput input)
{
var sortNumber=input.DepDetails.Max(p => p.ChassisSortNumber);
await _chassisOperationSequenceAppService.UpdateChassisSortNumberByKittingCodeAsync(input.KittingCode,sortNumber).ConfigureAwait(false);
//所有底盘转换为总成的零件号
var chassisItemCode = new List<string>();
var listItemCode=input.DepDetails.Select(p => p.ItemCode);
foreach (var itemCode in listItemCode)
{
var bomDtos=await _bomAppService.GetBomTreeByCodeAsync(itemCode).ConfigureAwait(false);
if (bomDtos == null|| bomDtos.Count<1)
{
throw new UserFriendlyException($"物品代码【{itemCode}】没有Bom信息");
}
var bomItemCodeList = bomDtos.Select(p => p.Component);
chassisItemCode.AddRange(bomItemCodeList);
}
chassisItemCode=chassisItemCode.Distinct().ToList();
//获取kitting中维护的零件号
var kittingDto=await _kittingAppService.GetByCodeAsync(input.KittingCode).ConfigureAwait(false);
var kittingItemCodeList= kittingDto.Details.Select(p => p.PartCode);
//取出交集得到KittingCode中的零件
var hasItemCode= kittingItemCodeList.Intersect(chassisItemCode).ToList();
foreach (var itemCode in hasItemCode)
{
var detailInput = new KittingPackagingNoteDetailInput();
var itemBase=kittingDto.Details.First(p => p.PartCode == itemCode);
detailInput.KittingCode = input.KittingCode;
detailInput.ItemCode = itemCode;
detailInput.ItemDesc1 = itemBase.Desc1;
detailInput.ItemDesc2= itemBase.Desc2;
//todo 等待赵新宇加完字段
//kittingPackagingNoteDetail.ItemName=itemBase.ItemName
detailInput.Qty= itemBase.Qty;
input.Details.Add(detailInput);
}
input.DepDetails.ForEach(p=>p.KittingCode=input.KittingCode);
return await base.CreateAsync(input).ConfigureAwait(false);
} }
} }

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/MesNotes/MesNoteAppService.cs

@ -66,7 +66,11 @@ public class MesNoteAppService :
var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
if (fromLocation == null) if (fromLocation == null)
{ {
throw new UserFriendlyException($"库位为空"); throw new UserFriendlyException($"来源库位为空");
}
if (fromLocation == null)
{
throw new UserFriendlyException($"目标库位为空");
} }
detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number);
detail.FromLocationArea = fromLocation.AreaCode; detail.FromLocationArea = fromLocation.AreaCode;

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs

@ -349,5 +349,35 @@ public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<Inj
return query; return query;
} }
/// <summary>
/// 获取已完成的叫料单数量
/// </summary>
/// <returns></returns>
[HttpPost("get-uncompleted-request")]
public async Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list)
{
List<UnCompletedRequestDto> returnList = new List<UnCompletedRequestDto>();
//枚举类型查不到改成SQL查询
var list =await _repository.WithDetails().Where(p => p.RequestStatus != EnumRequestStatus.Completed && p.Type == nameof(EnumIssueType.Vision)).ToListAsync().ConfigureAwait(false);
foreach (var itm in list)
{
var query = from detail in itm.Details join citm in p_list on new { detail.ItemCode, locCode= detail.ToLocationCode,areaCode=detail.PositionCode } equals
new { citm.ItemCode, locCode= citm.LocCode,areaCode=citm.PositionCode }
select new UnCompletedRequestDto { ItemCode = detail.ItemCode, LocCode = detail.ToLocationCode, PositionCode = detail.PositionCode } ;
returnList.AddRange(query.ToList());
}
return returnList;
}
#endregion #endregion
} }

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ChassisOperationSequence/ChassisOperationSequence.cs

@ -10,10 +10,10 @@ namespace Win_in.Sfs.Wms.Store.Domain;
public class ChassisOperationSequence : SfsAggregateRootBase public class ChassisOperationSequence : SfsAggregateRootBase
{ {
/// <summary> /// <summary>
/// kitting执行序列号 /// Kitting执行底盘序列位置
/// </summary> /// </summary>
[Display(Name = "kitting执行序列号")] [Display(Name = "Kitting执行底盘序列位置")]
public string KittingNumber { get; set; } public long ChassisSortNumber { get; set; }
/// <summary> /// <summary>
/// kitting代码 /// kitting代码

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNote.cs

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Domain;
@ -18,14 +16,12 @@ public class KittingPackagingNote : SfsStoreAggregateRootBase<KittingPackagingNo
public string KittingCode { get; set; } public string KittingCode { get; set; }
/// <summary> /// <summary>
/// 任务明细 /// 明细(记录Kitting打包中的子物品明细)
/// </summary> /// </summary>
[IgnoreUpdate] public List<KittingPackagingNoteDetail> Details { get; set; } = new();
public override List<KittingPackagingNoteDetail> Details { get; set; } = new();
/// <summary> /// <summary>
/// 任务从表明细(记录每次扫得明细 /// 明细(记录底盘相关的信息
/// </summary> /// </summary>
[IgnoreUpdate]
public List<KittingPackagingNoteChassisDetail> DepDetails { get; set; } = new(); public List<KittingPackagingNoteChassisDetail> DepDetails { get; set; } = new();
} }

46
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteChassisDetail.cs

@ -1,51 +1,19 @@
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Domain;
public class KittingPackagingNoteChassisDetail : SfsJobDetailEntityBase, IHasCountResult, IHasInventoryQty public class KittingPackagingNoteChassisDetail : SfsStoreDetailEntityBase
{ {
/// <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>
/// 库存库位 /// 底盘号
/// </summary> /// </summary>
public string InventoryLocationCode { get; set; } [Display(Name = "底盘号")]
public long ChassisNumber { get; set; }
/// <summary> /// <summary>
/// 盘点数量(每次扫得数量) /// Kitting代码
/// </summary> /// </summary>
public decimal CountQty { get; set; } [Display(Name = "Kitting代码")]
public string KittingCode { get; set; }
/// <summary>
/// 盘点时间
/// </summary>
public DateTime? CountTime { get; set; }
/// <summary>
/// 盘点操作员
/// </summary>
public string CountOperator { get; set; }
/// <summary>
/// 盘点描述
/// </summary>
public string CountDescription { get; set; }
} }

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/KittingPackagingNotes/KittingPackagingNoteDetail.cs

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Domain;
@ -10,8 +8,6 @@ public class KittingPackagingNoteDetail : SfsStoreDetailEntityBase
/// 物品代码 /// 物品代码
/// </summary> /// </summary>
[Display(Name = "物品代码")] [Display(Name = "物品代码")]
[Required(ErrorMessage = "{0}是必填项")]
[IgnoreUpdate]
public string ItemCode { get; set; } public string ItemCode { get; set; }
/// <summary> /// <summary>
@ -37,4 +33,10 @@ public class KittingPackagingNoteDetail : SfsStoreDetailEntityBase
/// </summary> /// </summary>
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// Kitting代码
/// </summary>
[Display(Name = "Kitting代码")]
public string KittingCode { get; set; }
} }

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs

@ -65,6 +65,7 @@ public interface IStoreDbContext : IEfCoreDbContext
#endregion #endregion
#region Notes #region Notes
public DbSet<ItemTransformNote> ItemTransformNotes { get; } public DbSet<ItemTransformNote> ItemTransformNotes { get; }
public DbSet<RecycledMaterialReceiptNote> RecycledMaterialReceiptNotes { get; } public DbSet<RecycledMaterialReceiptNote> RecycledMaterialReceiptNotes { get; }
public DbSet<TransferNote> TransferNotes { get; } public DbSet<TransferNote> TransferNotes { get; }
@ -105,6 +106,9 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<ContainerBindNote> ContainerBindNotes { get; } public DbSet<ContainerBindNote> ContainerBindNotes { get; }
public DbSet<NoOkConvertOkNote> NoOkConvertOkNotes { get; } public DbSet<NoOkConvertOkNote> NoOkConvertOkNotes { get; }
public DbSet<WipWarehouseAdjustNote> WipWarehouseAdjustNotes { get; } public DbSet<WipWarehouseAdjustNote> WipWarehouseAdjustNotes { get; }
public DbSet<KittingPackagingNote> KittingPackagingNote { get; }
#endregion #endregion
#region Jobs #region Jobs
@ -135,9 +139,9 @@ public interface IStoreDbContext : IEfCoreDbContext
#endregion #endregion
/// <summary> /// <summary>
/// 底盘信息 /// 底盘信息
/// </summary> /// </summary>
public DbSet<Domain.Chassis> Chassis { get; } public DbSet<Chassis> Chassis { get; }
public DbSet<ExchangeData> ExchangeDatas { get; } public DbSet<ExchangeData> ExchangeDatas { get; }

31896
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422030203_Added_KittingPackagingNote.Designer.cs

File diff suppressed because it is too large

958
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422030203_Added_KittingPackagingNote.cs

@ -0,0 +1,958 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Added_KittingPackagingNote : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Store_AssembleIssueRequestsDetail");
migrationBuilder.DropTable(
name: "Store_AssembleIssueRequests");
migrationBuilder.DropColumn(
name: "AuditCountDescription",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "AuditCountOperator",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "AuditCountQty",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "AuditCountTime",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "FirstCountDescription",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "FirstCountOperator",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "FirstCountQty",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "FirstCountTime",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "RepeatCountDescription",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "RepeatCountOperator",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "RepeatCountQty",
table: "Store_CountNoteDetail");
migrationBuilder.DropColumn(
name: "RepeatCountTime",
table: "Store_CountNoteDetail");
migrationBuilder.AddColumn<string>(
name: "InventoryMode",
table: "Store_CountPlan",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "InventoryStage",
table: "Store_CountPlan",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "CountJobNumber",
table: "Store_CountNote",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CountPlanNumber",
table: "Job_CountJobDetail",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "InventoryStage",
table: "Job_CountJobDetail",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "InventoryStage",
table: "Job_CountJobDependentDetail",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "InventoryMode",
table: "Job_CountJob",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "InventoryStage",
table: "Job_CountJob",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "Job_KittingIssueJob",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
KittingRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
UpStreamJobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
JobDescription = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
JobType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
JobStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Priority = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
PriorityIncrement = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
WorkGroupCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IsAutoComplete = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
AcceptUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
AcceptUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
AcceptTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CompleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CompleteUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CompleteTime = table.Column<DateTime>(type: "datetime2", nullable: true),
WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_KittingIssueJob", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_AssembleIssueRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AutoSubmit = table.Column<bool>(type: "bit", nullable: false),
AutoAgree = table.Column<bool>(type: "bit", nullable: false),
AutoHandle = table.Column<bool>(type: "bit", nullable: false),
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false),
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false),
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_AssembleIssueRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_CountNoteDependentDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CountLabel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
InventoryQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
InventoryLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CountQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CountTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CountOperator = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CountDescription = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Lot = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
PackingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ContainerCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
LocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
LocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
LocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
LocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
WarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_CountNoteDependentDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_CountNoteDependentDetail_Store_CountNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_CountNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_KittingIssueNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
Confirmed = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingIssueNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_KittingIssueRequest",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AutoSubmit = table.Column<bool>(type: "bit", nullable: false),
AutoAgree = table.Column<bool>(type: "bit", nullable: false),
AutoHandle = table.Column<bool>(type: "bit", nullable: false),
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false),
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false),
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingIssueRequest", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Job_KittingIssueJobDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ItemCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
ItemName = table.Column<string>(type: "nvarchar(max)", nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(max)", nullable: true),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RequestLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RequestQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RecommendFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RecommendToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
TransferLibFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
TransferLibToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Job_KittingIssueJobDetail", x => x.Id);
table.ForeignKey(
name: "FK_Job_KittingIssueJobDetail_Job_KittingIssueJob_MasterID",
column: x => x.MasterID,
principalTable: "Job_KittingIssueJob",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_AssembleIssueRequestDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BoxQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_AssembleIssueRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_AssembleIssueRequestDetail_Store_AssembleIssueRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_AssembleIssueRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_KittingIssueNoteDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RequestWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
RequestQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RecommendFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
RecommendToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RecommendToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
RecommendToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
TransferLibFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
TransferLibToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
TransferLibToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
TransferLibToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromPackingCode = table.Column<string>(type: "nvarchar(450)", nullable: true),
HandledFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationCode = table.Column<string>(type: "nvarchar(450)", nullable: true),
HandledFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
HandledToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false),
HandledToLot = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationCode = table.Column<string>(type: "nvarchar(450)", nullable: true),
HandledToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HandledToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingIssueNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_KittingIssueNoteDetail_Store_KittingIssueNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_KittingIssueNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_KittingIssueRequestDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BoxQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingIssueRequestDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_KittingIssueRequestDetail_Store_KittingIssueRequest_MasterID",
column: x => x.MasterID,
principalTable: "Store_KittingIssueRequest",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Job_KittingIssueJob_Number",
table: "Job_KittingIssueJob",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Job_KittingIssueJobDetail_MasterID",
table: "Job_KittingIssueJobDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequest_Number",
table: "Store_AssembleIssueRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestDetail_ItemCode",
table: "Store_AssembleIssueRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestDetail_MasterID",
table: "Store_AssembleIssueRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_AssembleIssueRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_CountNoteDependentDetail_MasterID",
table: "Store_CountNoteDependentDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueNote_Number",
table: "Store_KittingIssueNote",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueNoteDetail_HandledFromPackingCode",
table: "Store_KittingIssueNoteDetail",
column: "HandledFromPackingCode");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueNoteDetail_MasterID",
table: "Store_KittingIssueNoteDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueNoteDetail_Number_HandledFromPackingCode_HandledFromLocationCode_HandledToLocationCode",
table: "Store_KittingIssueNoteDetail",
columns: new[] { "Number", "HandledFromPackingCode", "HandledFromLocationCode", "HandledToLocationCode" },
unique: true,
filter: "[HandledFromPackingCode] IS NOT NULL AND [HandledFromLocationCode] IS NOT NULL AND [HandledToLocationCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueRequest_Number",
table: "Store_KittingIssueRequest",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueRequestDetail_ItemCode",
table: "Store_KittingIssueRequestDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueRequestDetail_MasterID",
table: "Store_KittingIssueRequestDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingIssueRequestDetail_Number_ItemCode_ToLocationCode",
table: "Store_KittingIssueRequestDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Job_KittingIssueJobDetail");
migrationBuilder.DropTable(
name: "Store_AssembleIssueRequestDetail");
migrationBuilder.DropTable(
name: "Store_CountNoteDependentDetail");
migrationBuilder.DropTable(
name: "Store_KittingIssueNoteDetail");
migrationBuilder.DropTable(
name: "Store_KittingIssueRequestDetail");
migrationBuilder.DropTable(
name: "Job_KittingIssueJob");
migrationBuilder.DropTable(
name: "Store_AssembleIssueRequest");
migrationBuilder.DropTable(
name: "Store_KittingIssueNote");
migrationBuilder.DropTable(
name: "Store_KittingIssueRequest");
migrationBuilder.DropColumn(
name: "InventoryMode",
table: "Store_CountPlan");
migrationBuilder.DropColumn(
name: "InventoryStage",
table: "Store_CountPlan");
migrationBuilder.DropColumn(
name: "CountJobNumber",
table: "Store_CountNote");
migrationBuilder.DropColumn(
name: "CountPlanNumber",
table: "Job_CountJobDetail");
migrationBuilder.DropColumn(
name: "InventoryStage",
table: "Job_CountJobDetail");
migrationBuilder.DropColumn(
name: "InventoryStage",
table: "Job_CountJobDependentDetail");
migrationBuilder.DropColumn(
name: "InventoryMode",
table: "Job_CountJob");
migrationBuilder.DropColumn(
name: "InventoryStage",
table: "Job_CountJob");
migrationBuilder.AddColumn<string>(
name: "AuditCountDescription",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "AuditCountOperator",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "AuditCountQty",
table: "Store_CountNoteDetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<DateTime>(
name: "AuditCountTime",
table: "Store_CountNoteDetail",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FirstCountDescription",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FirstCountOperator",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "FirstCountQty",
table: "Store_CountNoteDetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<DateTime>(
name: "FirstCountTime",
table: "Store_CountNoteDetail",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RepeatCountDescription",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RepeatCountOperator",
table: "Store_CountNoteDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "RepeatCountQty",
table: "Store_CountNoteDetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<DateTime>(
name: "RepeatCountTime",
table: "Store_CountNoteDetail",
type: "datetime2",
nullable: true);
migrationBuilder.CreateTable(
name: "Store_AssembleIssueRequests",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AutoAgree = table.Column<bool>(type: "bit", nullable: false),
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false),
AutoHandle = table.Column<bool>(type: "bit", nullable: false),
AutoSubmit = table.Column<bool>(type: "bit", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_AssembleIssueRequests", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_AssembleIssueRequestsDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
BoxQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_AssembleIssueRequestsDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_AssembleIssueRequestsDetail_Store_AssembleIssueRequests_MasterID",
column: x => x.MasterID,
principalTable: "Store_AssembleIssueRequests",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequests_Number",
table: "Store_AssembleIssueRequests",
column: "Number",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestsDetail_ItemCode",
table: "Store_AssembleIssueRequestsDetail",
column: "ItemCode");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestsDetail_MasterID",
table: "Store_AssembleIssueRequestsDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_AssembleIssueRequestsDetail_Number_ItemCode_ToLocationCode",
table: "Store_AssembleIssueRequestsDetail",
columns: new[] { "Number", "ItemCode", "ToLocationCode" },
unique: true);
}
}
}

32112
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422032715_Added_KittingPackagingNoteV2.Designer.cs

File diff suppressed because it is too large

137
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240422032715_Added_KittingPackagingNoteV2.cs

@ -0,0 +1,137 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Added_KittingPackagingNoteV2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Store_KittingPackagingNote",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
KittingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true),
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true),
Number = table.Column<string>(type: "nvarchar(450)", nullable: true),
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingPackagingNote", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Store_KittingPackagingNoteChassisDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ChassisSortNumber = table.Column<long>(type: "bigint", nullable: false),
KittingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingPackagingNoteChassisDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_KittingPackagingNoteChassisDetail_Store_KittingPackagingNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_KittingPackagingNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Store_KittingPackagingNoteDetail",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Qty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
KittingCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Number = table.Column<string>(type: "nvarchar(max)", nullable: true),
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Store_KittingPackagingNoteDetail", x => x.Id);
table.ForeignKey(
name: "FK_Store_KittingPackagingNoteDetail_Store_KittingPackagingNote_MasterID",
column: x => x.MasterID,
principalTable: "Store_KittingPackagingNote",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Store_KittingPackagingNote_Number",
table: "Store_KittingPackagingNote",
column: "Number",
unique: true,
filter: "[Number] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingPackagingNoteChassisDetail_KittingCode",
table: "Store_KittingPackagingNoteChassisDetail",
column: "KittingCode",
unique: true,
filter: "[KittingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingPackagingNoteChassisDetail_MasterID",
table: "Store_KittingPackagingNoteChassisDetail",
column: "MasterID");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingPackagingNoteDetail_KittingCode",
table: "Store_KittingPackagingNoteDetail",
column: "KittingCode",
unique: true,
filter: "[KittingCode] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_Store_KittingPackagingNoteDetail_MasterID",
table: "Store_KittingPackagingNoteDetail",
column: "MasterID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Store_KittingPackagingNoteChassisDetail");
migrationBuilder.DropTable(
name: "Store_KittingPackagingNoteDetail");
migrationBuilder.DropTable(
name: "Store_KittingPackagingNote");
}
}
}

32133
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240423013517_Update_KittingPackagingNoteV3.Designer.cs

File diff suppressed because it is too large

91
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240423013517_Update_KittingPackagingNoteV3.cs

@ -0,0 +1,91 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Update_KittingPackagingNoteV3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "KittingNumber",
table: "Store_ChassisOperationSequence");
migrationBuilder.RenameColumn(
name: "ChassisSortNumber",
table: "Store_KittingPackagingNoteChassisDetail",
newName: "ChassisNumber");
migrationBuilder.AddColumn<string>(
name: "ItemCode",
table: "Store_KittingPackagingNoteChassisDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "ItemDesc1",
table: "Store_KittingPackagingNoteChassisDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ItemDesc2",
table: "Store_KittingPackagingNoteChassisDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ItemName",
table: "Store_KittingPackagingNoteChassisDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true);
migrationBuilder.AddColumn<long>(
name: "ChassisSortNumber",
table: "Store_ChassisOperationSequence",
type: "bigint",
nullable: false,
defaultValue: 0L);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ItemCode",
table: "Store_KittingPackagingNoteChassisDetail");
migrationBuilder.DropColumn(
name: "ItemDesc1",
table: "Store_KittingPackagingNoteChassisDetail");
migrationBuilder.DropColumn(
name: "ItemDesc2",
table: "Store_KittingPackagingNoteChassisDetail");
migrationBuilder.DropColumn(
name: "ItemName",
table: "Store_KittingPackagingNoteChassisDetail");
migrationBuilder.DropColumn(
name: "ChassisSortNumber",
table: "Store_ChassisOperationSequence");
migrationBuilder.RenameColumn(
name: "ChassisNumber",
table: "Store_KittingPackagingNoteChassisDetail",
newName: "ChassisSortNumber");
migrationBuilder.AddColumn<string>(
name: "KittingNumber",
table: "Store_ChassisOperationSequence",
type: "nvarchar(max)",
nullable: true);
}
}
}

1902
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs

File diff suppressed because it is too large

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/KittingPackagingNotes/KittingPackagingNoteDbContextModelCreatingExtensions.cs

@ -13,7 +13,7 @@ public static class KittingPackagingNoteDbContextModelCreatingExtensions
builder.Entity<KittingPackagingNote>(b => builder.Entity<KittingPackagingNote>(b =>
{ {
//Configure table & schema name //Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(KittingPackagingNote), options.Schema); b.ToTable(options.TablePrefix + nameof(KittingPackagingNote), options.Schema);
//Configure ABP properties //Configure ABP properties
b.ConfigureByConvention(); b.ConfigureByConvention();
//Configure Sfs base properties //Configure Sfs base properties
@ -30,7 +30,7 @@ public static class KittingPackagingNoteDbContextModelCreatingExtensions
builder.Entity<KittingPackagingNoteDetail>(b => builder.Entity<KittingPackagingNoteDetail>(b =>
{ {
//Configure table & schema name //Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(KittingPackagingNoteDetail), options.Schema); b.ToTable(options.TablePrefix + nameof(KittingPackagingNoteDetail), options.Schema);
//Configure ABP properties //Configure ABP properties
b.ConfigureByConvention(); b.ConfigureByConvention();
//Configure Sfs base properties //Configure Sfs base properties
@ -38,40 +38,24 @@ public static class KittingPackagingNoteDbContextModelCreatingExtensions
//Configure Job base properties //Configure Job base properties
b.ConfigureSfsStoreDetailBase(); b.ConfigureSfsStoreDetailBase();
//Properties //Properties
//b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.KittingCode).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 //Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique(); b.HasIndex(q => new { q.KittingCode }).IsUnique();
}); });
builder.Entity<KittingPackagingNoteChassisDetail>(b => builder.Entity<KittingPackagingNoteChassisDetail>(b =>
{ {
//Configure table & schema name //Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(KittingPackagingNoteChassisDetail), options.Schema); b.ToTable(options.TablePrefix + nameof(KittingPackagingNoteChassisDetail), options.Schema);
//Configure ABP properties //Configure ABP properties
b.ConfigureByConvention(); b.ConfigureByConvention();
//Configure Sfs base properties //Configure Sfs base properties
b.ConfigureSfsBase(); b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobDetail();
//Properties //Properties
b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.KittingCode).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 //Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique(); b.HasIndex(q => new { q.KittingCode }).IsUnique();
}); });
} }
} }

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

@ -142,6 +142,8 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
//底盘序列 //底盘序列
public DbSet<ChassisOperationSequence> ChassisOperationSequence { get; set; } public DbSet<ChassisOperationSequence> ChassisOperationSequence { get; set; }
public DbSet<KittingPackagingNote> KittingPackagingNote { get; set; }
public StoreDbContext(DbContextOptions<StoreDbContext> options) public StoreDbContext(DbContextOptions<StoreDbContext> options)
: base(options) : base(options)
{ {

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs

@ -112,6 +112,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureMesRecord(options); builder.ConfigureMesRecord(options);
builder.ConfigureInjectioModelPlan(options); builder.ConfigureInjectioModelPlan(options);
builder.ConfigureCustomerProductionReturnNote(options); builder.ConfigureCustomerProductionReturnNote(options);
builder.ConfigureKittingPackagingNote(options);
#endregion #endregion
#region Jobs #region Jobs

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

@ -162,6 +162,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IChassisRepository, ChassisEfCoreRepository>(); context.Services.AddTransient<IChassisRepository, ChassisEfCoreRepository>();
context.Services.AddTransient<IChassisOperationSequenceRepository, ChassisOperationSequenceEfCoreRepository>(); context.Services.AddTransient<IChassisOperationSequenceRepository, ChassisOperationSequenceEfCoreRepository>();
context.Services.AddTransient<IKittingPackagingNoteRepository, KittingPackagingNoteEfCoreRepository>();
} }
private void ConfigureEntity() private void ConfigureEntity()
@ -344,6 +346,10 @@ public class StoreEntityFrameworkCoreModule : AbpModule
options.Entity<CustomerProductionReturnNote>(orderOptions => options.Entity<CustomerProductionReturnNote>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<KittingPackagingNote>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)
.Include(o => o.DepDetails));
#endregion #endregion
#region Jobs #region Jobs

149
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/KittingPackagingNoteHandler.cs

@ -0,0 +1,149 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Event.Transaction;
namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class KittingPackagingNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<KittingPackagingNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<KittingPackagingNote>>>
{
private readonly IProductionLineAppService _productionLineAppService;
private readonly IProductionLineItemAppService _productionLineItemAppService;
private readonly ILocationAppService _locationAppService;
public KittingPackagingNoteEventHandler(
IProductionLineAppService productionLineAppService, ILocationAppService locationAppService, IProductionLineItemAppService productionLineItemAppService)
{
_productionLineAppService = productionLineAppService;
_locationAppService = locationAppService;
_productionLineItemAppService = productionLineItemAppService;
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<KittingPackagingNote> eventData)
{
var entity = eventData.Entity;
var transferLogEditInputs = await BuildTransferLogsAsync(entity).ConfigureAwait(false);
await TransferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<KittingPackagingNote>> eventData)
{
var entities = eventData.Entity;
var transferLogCreateInputs = new List<TransferLogEditInput>();
foreach (var entitie in entities)
{
transferLogCreateInputs.AddRange(await BuildTransferLogsAsync(entitie).ConfigureAwait(false));
}
await TransferLogAppService.AddManyAsync(transferLogCreateInputs).ConfigureAwait(false);
}
/// <summary>
/// 构造库移DTO
/// </summary>
/// <param name="kittingPackagingNote"></param>
/// <returns></returns>
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(KittingPackagingNote kittingPackagingNote)
{
var transferLogCreateInputs = new List<TransferLogEditInput>();
//获取生产线和 生产线零件关系 用来下面找装配的线边做查询
var productionLineList = await _productionLineAppService.GetByLocationCodeAsync(EnumProductionLineType.Assemble)
.ConfigureAwait(false);
var productionItemList = new List<ProductionLineItemDTO>();
foreach (var productionLineDto in productionLineList)
{
productionItemList.AddRange(await _productionLineItemAppService.GetByProductLineCodeAsync(productionLineDto.Code).ConfigureAwait(false));
}
//Kitting线边库位
var kittingLocation =
await LocationAclService.GetFirstByTypeAsync(EnumLocationType.KittingWip).ConfigureAwait(false);
foreach (var detail in kittingPackagingNote.Details.Where(detail => detail.Qty != 0))
{
var productionLineItemDtos= productionItemList.FirstOrDefault(p => p.ItemCode == detail.ItemCode);
if (productionLineItemDtos == null)
{
var strProductionLine = string.Empty;
productionLineList.ForEach(dto => strProductionLine += " " + dto.Code);
throw new UserFriendlyException($"没有在 生产线代码列表中找到【{strProductionLine}】物料代码【{detail.ItemCode}】的配置");
}
var list = JsonSerializer.Deserialize<List<string>>(productionLineItemDtos.WipLocationCodeListJson);
if (list == null || list.Count < 1)
{
throw new UserFriendlyException($"没有在 生产线代码【{productionLineItemDtos.ProdLineCode}】物料代码【{detail.ItemCode}】中配置线边库位");
}
var assembleFirstLocationCode = list.First();
var assembleLocation =
await _locationAppService.GetByCodeAsync(assembleFirstLocationCode).ConfigureAwait(false);
var transferLogEditInput = transferLogCreateInputs.FirstOrDefault(p => p.ItemCode == detail.ItemCode);
if (transferLogEditInput != null)
{
transferLogEditInput.Qty += detail.Qty;
}
else
{
var transferLog = new TransferLogEditInput();
transferLog.TransType = EnumTransType.Transfer;
var itemBasicDto = await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
transferLog.ItemCode = detail.ItemCode;
transferLog.ItemDesc1 = detail.ItemDesc1;
transferLog.ItemDesc2 = detail.ItemDesc2;
transferLog.ItemName = detail.ItemName;
transferLog.Qty = detail.Qty;
transferLog.ArriveDate = DateTime.Now;
transferLog.ExpireDate = DateTime.Now;
transferLog.ProduceDate = DateTime.Now;
transferLog.StdPackQty = itemBasicDto.StdPackQty;
transferLog.Uom = itemBasicDto.BasicUom;
transferLog.ToLocationCode = assembleLocation.Code;
transferLog.ToWarehouseCode = assembleLocation.WarehouseCode;
transferLog.ToLocationErpCode = assembleLocation.ErpLocationCode;
transferLog.ToLocationArea = assembleLocation.AreaCode;
transferLog.ToLocationGroup = assembleLocation.LocationGroupCode;
transferLog.ToContainerCode = string.Empty;
transferLog.ToPackingCode = string.Empty;
transferLog.ToLot = string.Empty;
transferLog.ToStatus = EnumInventoryStatus.OK;
transferLog.FromLocationCode = kittingLocation.Code;
transferLog.FromWarehouseCode = kittingLocation.WarehouseCode;
transferLog.FromLocationErpCode = kittingLocation.ErpLocationCode;
transferLog.FromLocationArea = kittingLocation.AreaCode;
transferLog.FromLocationGroup = kittingLocation.LocationGroupCode;
transferLog.FromContainerCode = string.Empty;
transferLog.FromPackingCode = string.Empty;
transferLog.FromLot = string.Empty;
transferLog.FromStatus = EnumInventoryStatus.OK;
transferLog.Worker = kittingPackagingNote.Worker;
transferLog.DocNumber = kittingPackagingNote.Number;
transferLogCreateInputs.Add(transferLog);
}
}
return transferLogCreateInputs;
}
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Win_in.Sfs.Wms.Store.Event.csproj

@ -16,6 +16,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Quartz" Version="3.3.3" />
<PackageReference Include="Volo.Abp.Core" Version="5.3.5" /> <PackageReference Include="Volo.Abp.Core" Version="5.3.5" />
<PackageReference Include="Volo.Abp.EventBus" Version="5.3.5" /> <PackageReference Include="Volo.Abp.EventBus" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.3.5" /> <PackageReference Include="Volo.Abp.Autofac" Version="5.3.5" />

4
build/src/docker/publish/conf/settings/appsettings.Development.json

@ -117,8 +117,8 @@
//"BaseUrl": "http://localhost:59093/" //"BaseUrl": "http://localhost:59093/"
}, },
"BaseData": { "BaseData": {
"BaseUrl": "http://dev.ccwin-in.com:60084/" //"BaseUrl": "http://dev.ccwin-in.com:60084/"
//"BaseUrl": "http://localhost:59094/" "BaseUrl": "http://localhost:59094/"
}, },
"Default": { "Default": {
"BaseUrl": "http://dev.ccwin-in.com:60083/" "BaseUrl": "http://dev.ccwin-in.com:60083/"

Loading…
Cancel
Save