Browse Source

修改 agv发料

Agv分支2024-11-19
郑勃旭 5 months ago
parent
commit
87ca14ff9e
  1. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/LocationDeliverys/ILocationDeliveryAppService.cs
  2. 6
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/DTOs/LocationDTO.cs
  3. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/Inputs/LocationEditInput.cs
  4. 6
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/Inputs/LocationImportInput.cs
  5. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs
  6. 14
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/LocationDeliverys/LocationDeliveryAppService.cs
  7. 1
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Locations/Location.cs
  8. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/BasedataDbContext.cs
  9. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/IBasedataDbContext.cs
  10. 41
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  11. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/AssembleIssueRequests/AssembleIssueRequestManager.cs

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/LocationDeliverys/ILocationDeliveryAppService.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.Basedata.Application.Contracts; namespace Win_in.Sfs.Basedata.Application.Contracts;
@ -5,4 +6,5 @@ namespace Win_in.Sfs.Basedata.Application.Contracts;
public interface ILocationDeliveryAppService public interface ILocationDeliveryAppService
: ISfsBaseDataAppServiceBase<LocationDeliveryDTO, SfsBaseDataRequestInputBase, LocationDeliveryEditInput> : ISfsBaseDataAppServiceBase<LocationDeliveryDTO, SfsBaseDataRequestInputBase, LocationDeliveryEditInput>
{ {
Task<LocationDeliveryDTO> GetByFromLocationCodeAndToLocationCodeAsync(string fromLocationCode,string toLocationCode);
} }

6
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/DTOs/LocationDTO.cs

@ -190,9 +190,5 @@ public class LocationDTO : SfsBaseDataDTOBase, IHasCode, IHasName, IHasLocationS
[Display(Name = "是否可以拆托")] [Display(Name = "是否可以拆托")]
public bool EnableSplitPallet { get; set; } = true; public bool EnableSplitPallet { get; set; } = true;
/// <summary>
/// 是否AGV配送
/// </summary>
[Display(Name = "是否AGV配送")]
public bool EnableAgv { get; set; } = false; //是否AGV配送
} }

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/Inputs/LocationEditInput.cs

@ -178,11 +178,6 @@ public class LocationEditInput : SfsBaseDataWithWarehouseCreateOrUpdateInputBase
[Display(Name = "是否可以拆托")] [Display(Name = "是否可以拆托")]
public bool EnableSplitPallet { get; set; } = true; public bool EnableSplitPallet { get; set; } = true;
/// <summary>
/// 是否AGV配送
/// </summary>
[Display(Name = "是否AGV配送")]
public bool EnableAgv { get; set; } = false; //是否AGV配送
#endregion #endregion
#region Create #region Create

6
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/Locations/Inputs/LocationImportInput.cs

@ -210,12 +210,6 @@ public class LocationImportInput : SfsBaseDataImportInputBase, IHasLocationSwitc
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
public bool EnableSplitPallet { get; set; } = true; public bool EnableSplitPallet { get; set; } = true;
/// <summary>
/// 是否AGV配送
/// </summary>
[Display(Name = "是否AGV配送")]
public bool EnableAgv { get; set; } = false; //是否AGV配送
/// <summary> /// <summary>
/// 描述 /// 描述
/// </summary> /// </summary>

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/BasedataApplicationAutoMapperProfile.cs

@ -58,7 +58,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
EquipmentPartCodeAutoMapperProfile(); EquipmentPartCodeAutoMapperProfile();
EquipmentLocCapAutoMapperProfile(); EquipmentLocCapAutoMapperProfile();
PostionLocationAutoMapperProfile(); PostionLocationAutoMapperProfile();
LocationDeliveryAutoMapperProfile();
} }
} }

14
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/LocationDeliverys/LocationDeliveryAppService.cs

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Caching; using Volo.Abp.Caching;
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;
@ -41,4 +42,17 @@ public class LocationDeliveryAppService
{ {
await base.ValidateImportModelAsync(importInput, validationRresult).ConfigureAwait(false); await base.ValidateImportModelAsync(importInput, validationRresult).ConfigureAwait(false);
} }
[HttpPost("get-by-from-location-and-to-location")]
public async Task<LocationDeliveryDTO> GetByFromLocationCodeAndToLocationCodeAsync(string fromLocationCode,string toLocationCode)
{
var locationDelivery=await _repository.FindAsync(p => p.FromLocationCode == fromLocationCode && p.ToLocationCode == toLocationCode).ConfigureAwait(false);
if (locationDelivery == null)
{
return null;
}
else
{
return ObjectMapper.Map<LocationDelivery, LocationDeliveryDTO>(locationDelivery);
}
}
} }

1
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/Locations/Location.cs

@ -98,5 +98,4 @@ public class Location : SfsBaseDataAggregateRootBase, IHasCode, IHasName, IHasLo
public bool EnableReturnFromCustomer { get; set; } = true; // 可以接收客户退货 public bool EnableReturnFromCustomer { get; set; } = true; // 可以接收客户退货
public bool EnableSplitBox { get; set; } = true; //是否可以拆箱 public bool EnableSplitBox { get; set; } = true; //是否可以拆箱
public bool EnableSplitPallet { get; set; } = true; //是否可以拆托 public bool EnableSplitPallet { get; set; } = true; //是否可以拆托
public bool EnableAgv { get; set; } = false; //是否AGV配送
} }

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/BasedataDbContext.cs

@ -60,7 +60,7 @@ public class BasedataDbContext : AbpDbContext<BasedataDbContext>, IBasedataDbCon
public DbSet<SplitPackingRec> SplitPackingRecs { get; set; } public DbSet<SplitPackingRec> SplitPackingRecs { get; set; }
public DbSet<PostionLocation> PostionLocations { get; set; } public DbSet<PostionLocation> PostionLocations { get; set; }
public DbSet<PostionLocation> LocationDeliverys { get; set; } public DbSet<LocationDelivery> LocationDeliverys { get; set; }
public BasedataDbContext(DbContextOptions<BasedataDbContext> options) public BasedataDbContext(DbContextOptions<BasedataDbContext> options)
: base(options) : base(options)

2
be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/IBasedataDbContext.cs

@ -56,5 +56,5 @@ public interface IBasedataDbContext : IEfCoreDbContext
public DbSet<SplitPackingRec> SplitPackingRecs { get; set; } public DbSet<SplitPackingRec> SplitPackingRecs { get; set; }
public DbSet<PostionLocation> LocationDeliverys { get; set; } public DbSet<LocationDelivery> LocationDeliverys { get; set; }
} }

41
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

@ -59,6 +59,7 @@ public class AssembleIssueJobAppService
private readonly ILogger<AssembleIssueJobAppService> _logger; private readonly ILogger<AssembleIssueJobAppService> _logger;
private readonly IPostionLocationAppService _postionLocationAppService; private readonly IPostionLocationAppService _postionLocationAppService;
private readonly ILocationDeliveryAppService _locationDeliveryAppService;
public AssembleIssueJobAppService( public AssembleIssueJobAppService(
ILogger<AssembleIssueJobAppService> logger, ILogger<AssembleIssueJobAppService> logger,
@ -70,15 +71,14 @@ public class AssembleIssueJobAppService
, IOptions<RestoOptions> options, ITransferLibRequestAppService transferLibRequestAppService, , IOptions<RestoOptions> options, ITransferLibRequestAppService transferLibRequestAppService,
ICurrentUser currentUser, UnitOfWorkManager unitOfWorkManager ICurrentUser currentUser, UnitOfWorkManager unitOfWorkManager
, IOptions<AgvOptions> agvOptions , IOptions<AgvOptions> agvOptions
, IPostionLocationAppService postionLocationAppService , IPostionLocationAppService postionLocationAppService, ILocationDeliveryAppService locationDeliveryAppService) : base(
) : base(
repository, assembleIssueJobManager repository, assembleIssueJobManager
) )
{ {
_postionLocationAppService = postionLocationAppService; _postionLocationAppService = postionLocationAppService;
_locationDeliveryAppService = locationDeliveryAppService;
_assembleIssueJobManager = assembleIssueJobManager; _assembleIssueJobManager = assembleIssueJobManager;
_locationAppService = locationAppService; _locationAppService = locationAppService;
_assembleIssueNoteAppService = assembleIssueNoteAppService; _assembleIssueNoteAppService = assembleIssueNoteAppService;
@ -120,17 +120,20 @@ public class AssembleIssueJobAppService
: _options.Value.StereosPassword; : _options.Value.StereosPassword;
} }
//如果是Agv if (dimensionalStorehouseflag == false)
var agvFlag = await UpdateJobStatusWaitByAgvAsync(input).ConfigureAwait(false);
if (agvFlag)
{ {
input.IsClaims = true; //如果是Agv
input.ClaimsUserId = string.IsNullOrEmpty(_options.Value.StereosUser) var agvFlag = await UpdateJobStatusWaitByAgvAsync(input).ConfigureAwait(false);
? "AGV" if (agvFlag)
: _options.Value.StereosUser; {
input.ClaimsUserName = string.IsNullOrEmpty(_options.Value.StereosPassword) input.IsClaims = true;
? "AGV" input.ClaimsUserId = string.IsNullOrEmpty(_options.Value.StereosUser)
: _options.Value.StereosPassword; ? "AGV"
: _options.Value.StereosUser;
input.ClaimsUserName = string.IsNullOrEmpty(_options.Value.StereosPassword)
? "AGV"
: _options.Value.StereosPassword;
}
} }
} }
@ -795,10 +798,10 @@ public class AssembleIssueJobAppService
private async Task DoingAgvAsync(AssembleIssueJobDTO assembleIssueJobDto) private async Task DoingAgvAsync(AssembleIssueJobDTO assembleIssueJobDto)
{ {
var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault(); var jobDetailInputdetail = assembleIssueJobDto.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) var locationDeliveryDto = await _locationDeliveryAppService.GetByFromLocationCodeAndToLocationCodeAsync(
.ConfigureAwait(false); jobDetailInputdetail.RecommendFromLocationCode, jobDetailInputdetail.RecommendToLocationCode).ConfigureAwait(false);
if (loctionDto.EnableAgv) if (locationDeliveryDto != null && locationDeliveryDto.EnumLocationDeliveryType == EnumLocationDeliveryType.Agv)
{ {
//TODO AGV //TODO AGV
var ret = await CallAgvAsync(assembleIssueJobDto).ConfigureAwait(false); var ret = await CallAgvAsync(assembleIssueJobDto).ConfigureAwait(false);
@ -825,10 +828,10 @@ public class AssembleIssueJobAppService
{ {
var jobDetailInputdetail = input.Details.FirstOrDefault(); var jobDetailInputdetail = input.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) var locationDeliveryDto=await _locationDeliveryAppService.GetByFromLocationCodeAndToLocationCodeAsync(
.ConfigureAwait(false); jobDetailInputdetail.RecommendFromLocationCode, jobDetailInputdetail.RecommendToLocationCode).ConfigureAwait(false);
if (loctionDto.EnableAgv) if (locationDeliveryDto!=null&& locationDeliveryDto.EnumLocationDeliveryType==EnumLocationDeliveryType.Agv)
{ {
input.JobStatus = EnumJobStatus.WaitAgv; input.JobStatus = EnumJobStatus.WaitAgv;
return true; return true;

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/AssembleIssueRequests/AssembleIssueRequestManager.cs

@ -62,6 +62,6 @@ public class AssembleIssueRequestManager
await Task.CompletedTask.ConfigureAwait(false); await Task.CompletedTask.ConfigureAwait(false);
var entity = await _repository.GetAsync(request.Id).ConfigureAwait(false); var entity = await _repository.GetAsync(request.Id).ConfigureAwait(false);
entity.Details = request.Details; entity.Details = request.Details;
return await _repository.UpdateAsync(entity, true).ConfigureAwait(false); return await _repository.UpdateAsync(entity).ConfigureAwait(false);
} }
} }

Loading…
Cancel
Save