25 changed files with 1070 additions and 90 deletions
@ -0,0 +1,33 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
[ApiController] |
||||
|
[Route($"{PdaHostConst.ROOT_ROUTE}item-container")] |
||||
|
public class ItemContainerController : AbpController |
||||
|
{ |
||||
|
private readonly IItemContainerAppService _itemContainerAppService; |
||||
|
|
||||
|
public ItemContainerController(IItemContainerAppService itemContainerAppService) |
||||
|
{ |
||||
|
_itemContainerAppService = itemContainerAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据名称获取物品
|
||||
|
/// </summary>
|
||||
|
/// <param name="itemCode"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("by-item")] |
||||
|
public virtual async Task<ItemContainerDTO> GetListByItemNameAsync(string itemCode) |
||||
|
{ |
||||
|
var dto = await _itemContainerAppService.GetByItemCodeAsync(itemCode).ConfigureAwait(false); |
||||
|
|
||||
|
return dto; |
||||
|
} |
||||
|
} |
@ -0,0 +1,176 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Auth.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs.IssueJobs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
[ApiController] |
||||
|
[Route($"{PdaHostConst.ROOT_ROUTE}job/kitting-issue")] |
||||
|
public class KittingIssueJobsController : AbpController |
||||
|
{ |
||||
|
private readonly IKittingIssueJobAppService _kittingIssueJobAppService; |
||||
|
|
||||
|
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
||||
|
|
||||
|
public KittingIssueJobsController(IKittingIssueJobAppService kittingIssueJobAppService, IUserWorkGroupAppService userWorkGroupAppService) |
||||
|
{ |
||||
|
_kittingIssueJobAppService = kittingIssueJobAppService; |
||||
|
_userWorkGroupAppService = userWorkGroupAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="pageSize"></param>
|
||||
|
/// <param name="pageIndex"></param>
|
||||
|
/// <param name="isFinished"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("list")] |
||||
|
public virtual async Task<PagedResultDto<KittingIssueJobDTO>> GetListAsync(int pageSize, int pageIndex, |
||||
|
bool isFinished) |
||||
|
{ |
||||
|
var status = new List<int>(); |
||||
|
if (isFinished) |
||||
|
{ |
||||
|
status.Add((int)EnumJobStatus.Done); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
status.Add((int)EnumJobStatus.Open); |
||||
|
status.Add((int)EnumJobStatus.Wait); |
||||
|
status.Add((int)EnumJobStatus.Doing); |
||||
|
status.Add((int)EnumJobStatus.Partial); |
||||
|
} |
||||
|
|
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsJobRequestInputBase |
||||
|
{ |
||||
|
MaxResultCount = pageSize, |
||||
|
SkipCount = (pageIndex - 1) * pageSize, |
||||
|
Sorting = $"{nameof(ContainerJobDTO.CreationTime)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> { new(nameof(ContainerJobDTO.JobStatus), jsonStatus, "In") } |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var list = await _kittingIssueJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 承接任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("take/{id}")] |
||||
|
public virtual async Task TakeAsync(Guid id) |
||||
|
{ |
||||
|
await _kittingIssueJobAppService.AcceptAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 取消承接任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("cancel-take/{id}")] |
||||
|
public virtual async Task CancelTakeAsync(Guid id) |
||||
|
{ |
||||
|
await _kittingIssueJobAppService.CancelAcceptAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行任务明细
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("ExecuteDetail/{masterId}")] |
||||
|
public async Task ExecuteDetailAsync(Guid masterId, Guid detailId, KittingIssueJobDetailDTO issueJobDetailDto) |
||||
|
{ |
||||
|
await _kittingIssueJobAppService.ExecuteDetailAsync(masterId,detailId,issueJobDetailDto).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务数量
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("count")] |
||||
|
public virtual async Task<ActionResult<long>> CountAsync() |
||||
|
{ |
||||
|
var status = new List<int> |
||||
|
{ |
||||
|
(int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial, (int)EnumJobStatus.Wait |
||||
|
}; |
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsJobRequestInputBase |
||||
|
{ |
||||
|
Sorting = $"{nameof(InspectJobDTO.Priority)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> |
||||
|
{ |
||||
|
//new(nameof(InspectJobDTO.WorkGroupCode),jsonCodes,"In"),
|
||||
|
new(nameof(InspectJobDTO.JobStatus), jsonStatus, "In") |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var count = await _kittingIssueJobAppService.GetCountByFilterAsync(request).ConfigureAwait(false); |
||||
|
|
||||
|
return Ok(count); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务详情
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public virtual async Task<ActionResult<KittingIssueJobDTO>> GetAsync(Guid id) |
||||
|
{ |
||||
|
var result = await _kittingIssueJobAppService.GetAsync(id).ConfigureAwait(false); |
||||
|
return Ok(result); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据Job Number 获取盘点任务列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="jobNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("by-number/{jobNumber}")] |
||||
|
public virtual async Task<ActionResult<KittingIssueJobDTO>> GetByNumberAsync(string jobNumber) |
||||
|
{ |
||||
|
var jobDto = await _kittingIssueJobAppService.GetByNumberAsync(jobNumber).ConfigureAwait(false); |
||||
|
if (jobDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到编号为 {jobNumber} 的任务"); |
||||
|
} |
||||
|
|
||||
|
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); |
||||
|
if (!wlgCodes.Contains(jobDto.WorkGroupCode)) |
||||
|
{ |
||||
|
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); |
||||
|
} |
||||
|
|
||||
|
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id) |
||||
|
{ |
||||
|
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理"); |
||||
|
} |
||||
|
|
||||
|
return jobDto; |
||||
|
} |
||||
|
} |
@ -0,0 +1,125 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Auth.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Kitting叫料请求
|
||||
|
/// </summary>
|
||||
|
[ApiController] |
||||
|
[Route($"{PdaHostConst.ROOT_ROUTE}store/kitting-request")] |
||||
|
public class KittingRequestController : AbpController |
||||
|
{ |
||||
|
private readonly IKittingIssueRequestAppService _kittingIssueRequestAppService; |
||||
|
|
||||
|
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="kittingIssueRequestAppService"></param>
|
||||
|
public KittingRequestController(IKittingIssueRequestAppService kittingIssueRequestAppService, |
||||
|
IUserWorkGroupAppService userWorkGroupAppService) |
||||
|
{ |
||||
|
_kittingIssueRequestAppService = kittingIssueRequestAppService; |
||||
|
_userWorkGroupAppService = userWorkGroupAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Kitting叫料申请
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("")] |
||||
|
public virtual async Task CreateAsync(KittingIssueRequestEditInput input) |
||||
|
{ |
||||
|
await _kittingIssueRequestAppService.CreateAndHandleAsync(input).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="pageSize"></param>
|
||||
|
/// <param name="pageIndex"></param>
|
||||
|
/// <param name="isFinished"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("list")] |
||||
|
public virtual async Task<PagedResultDto<KittingIssueRequestDTO>> GetListAsync(int pageSize, int pageIndex, |
||||
|
bool isFinished) |
||||
|
{ |
||||
|
var status = new List<int>(); |
||||
|
if (isFinished) |
||||
|
{ |
||||
|
status.Add((int)EnumRequestStatus.Completed); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
status.Add((int)EnumRequestStatus.Partial); |
||||
|
status.Add((int)EnumRequestStatus.Handling); |
||||
|
status.Add((int)EnumRequestStatus.New); |
||||
|
} |
||||
|
|
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsStoreRequestInputBase |
||||
|
{ |
||||
|
MaxResultCount = pageSize, |
||||
|
SkipCount = (pageIndex - 1) * pageSize, |
||||
|
Sorting = $"{nameof(ContainerJobDTO.CreationTime)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> { new(nameof(ContainerJobDTO.JobStatus), jsonStatus, "In") } |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var list = await _kittingIssueRequestAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
[HttpPost("handle/{id}")] |
||||
|
public virtual async Task HandleAsync(Guid id) |
||||
|
{ |
||||
|
await _kittingIssueRequestAppService.HandleAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据Job Number 获取盘点任务列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="jobNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("by-number/{requestNumber}")] |
||||
|
public virtual async Task<ActionResult<KittingIssueRequestDTO>> GetByNumberAsync(string requestNumber) |
||||
|
{ |
||||
|
var jobDto = await _kittingIssueRequestAppService.GetByNumberAsync(requestNumber).ConfigureAwait(false); |
||||
|
if (jobDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到编号为 {requestNumber} 的请求"); |
||||
|
} |
||||
|
|
||||
|
return jobDto; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务详情
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public virtual async Task<ActionResult<KittingIssueRequestDTO>> GetAsync(Guid id) |
||||
|
{ |
||||
|
var result = await _kittingIssueRequestAppService.GetAsync(id).ConfigureAwait(false); |
||||
|
return Ok(result); |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存转移记录-实体DTO //??TransferLib实体
|
||||
|
/// </summary>
|
||||
|
public class GaoTongResultDTO : EntityDto |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "")] |
||||
|
public string Code { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "")] |
||||
|
public string Message { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "")] |
||||
|
public string OperateTime { get; set; } |
||||
|
} |
||||
|
/* |
||||
|
{"code":"1","message":"接收成功", |
||||
|
"operateTime":"2020-01-0513:50:01"} |
||||
|
|
||||
|
*/ |
@ -0,0 +1,20 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public sealed class GaoTongResultStatus |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 成功
|
||||
|
/// </summary>
|
||||
|
public const string Success = "1"; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 失败
|
||||
|
/// </summary>
|
||||
|
public const string Failure = "-1"; |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public static class GaoTongPermissions |
||||
|
{ |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 立库接口
|
||||
|
/// </summary>
|
||||
|
public interface IGaoTongAppService : IApplicationService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 组盘信息反馈到东阳WMS(喷涂完工转储)
|
||||
|
/// </summary>
|
||||
|
/// <param name="input">组盘接口输入参数</param>
|
||||
|
/// <returns>立库接口通用输出参数</returns>
|
||||
|
Task<GaoTongResultDTO> FeedbackZuPanAsync(ZuPanEditInput input); |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增和更新基础DTO //??TransferLib实体
|
||||
|
/// </summary>
|
||||
|
public class ZuPanEditInput : EntityDto |
||||
|
{ |
||||
|
[Display(Name = "产品编号:映射ERP料号")] |
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
[Display(Name = "器具号")] |
||||
|
public string ContainerCode { get; set; } |
||||
|
|
||||
|
[Display(Name = "数量")] |
||||
|
public string Qty { get; set; } |
||||
|
|
||||
|
[Display(Name = "固定值,在立库中配置。用于多立库时区分哪个立库")] |
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
[Display(Name = "由1.2接口中获取富维东阳MES提供的来源位置")] |
||||
|
public string FromLocationCode { get; set; } |
||||
|
|
||||
|
} |
||||
|
/* |
||||
|
{ |
||||
|
"ItemCode": "ERPCODE0001", |
||||
|
"Qty": 122, |
||||
|
"ContainerCode": "C111123", |
||||
|
"ToLocationCode": "W1", |
||||
|
"FromLocationCode": "WIPT" |
||||
|
} |
||||
|
*/ |
@ -0,0 +1,142 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.Users; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Basedata.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 立库接口
|
||||
|
/// </summary>
|
||||
|
//[Authorize]
|
||||
|
[AllowAnonymous] |
||||
|
[Route($"{StoreConsts.RootPath}gao-tong")] |
||||
|
public class GaoTongAppService : ApplicationService, IGaoTongAppService |
||||
|
{ |
||||
|
private readonly IBalanceAppService _balanceAppService; |
||||
|
private readonly ITransferNoteAppService _transferNoteAppService; |
||||
|
private readonly CurrentUser _currentUser; |
||||
|
private readonly IItemBasicAppService _itemBasicAppService; |
||||
|
private readonly ILocationAppService _locationAppService; |
||||
|
|
||||
|
public GaoTongAppService( |
||||
|
IBalanceAppService balanceAppService |
||||
|
, ITransferNoteAppService transferNoteAppService |
||||
|
, CurrentUser currentUser |
||||
|
, IItemBasicAppService itemBasicAppService |
||||
|
,ILocationAppService locationAppService) |
||||
|
{ |
||||
|
_balanceAppService = balanceAppService; |
||||
|
_transferNoteAppService = transferNoteAppService; |
||||
|
_currentUser = currentUser; |
||||
|
_itemBasicAppService = itemBasicAppService; |
||||
|
_locationAppService = locationAppService; |
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 组盘信息反馈到东阳WMS
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("feedback-zu-pan")] |
||||
|
public async Task<GaoTongResultDTO> FeedbackZuPanAsync(ZuPanEditInput input) |
||||
|
{ |
||||
|
GaoTongResultDTO ret = new GaoTongResultDTO(); |
||||
|
try |
||||
|
{ |
||||
|
ItemBasicDTO itemBasicObj = await _itemBasicAppService.GetByCodeAsync(input.ItemCode).ConfigureAwait(false); |
||||
|
if (itemBasicObj == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"{input.ItemCode}在Item表不存在!"); |
||||
|
} |
||||
|
|
||||
|
TransferNoteEditInput transferNoteEditInput = new TransferNoteEditInput(); |
||||
|
transferNoteEditInput.TenantId = null; |
||||
|
transferNoteEditInput.Remark = String.Empty; |
||||
|
transferNoteEditInput.Worker = _currentUser.UserName; |
||||
|
transferNoteEditInput.ActiveDate = CommonHelper.CurTime; |
||||
|
transferNoteEditInput.Type = EnumTransSubType.Transfer_Coating.ToString(); //喷涂完工转储
|
||||
|
transferNoteEditInput.UseOnTheWayLocation = false; |
||||
|
//transferNoteEditInput.number
|
||||
|
//transferNoteEditInput.CallServerName
|
||||
|
//transferNoteEditInput.Confirmed = true;
|
||||
|
//transferNoteEditInput.ConfirmTime = CommonHelper.CurTime;
|
||||
|
if (transferNoteEditInput.Details == null) |
||||
|
{ |
||||
|
transferNoteEditInput.Details = new List<TransferNoteDetailInput>(); |
||||
|
} |
||||
|
TransferNoteDetailInput detailObj = new TransferNoteDetailInput(); |
||||
|
transferNoteEditInput.Details.Add(detailObj); |
||||
|
detailObj.Remark = ""; |
||||
|
detailObj.ItemCode = input.ItemCode; |
||||
|
detailObj.ItemName = itemBasicObj.Name; |
||||
|
detailObj.ItemDesc1 = itemBasicObj.Desc1; |
||||
|
detailObj.ItemDesc2 = itemBasicObj.Desc2; |
||||
|
detailObj.Uom = itemBasicObj.BasicUom; |
||||
|
detailObj.Qty = input.Qty.TryToDecimalZero(); |
||||
|
detailObj.StdPackQty = itemBasicObj.StdPackQty; |
||||
|
|
||||
|
#region 去箱、去批、去托
|
||||
|
detailObj.FromPackingCode = String.Empty; |
||||
|
detailObj.ToPackingCode = String.Empty; |
||||
|
detailObj.FromContainerCode = String.Empty; |
||||
|
detailObj.ToContainerCode = String.Empty; |
||||
|
detailObj.FromLot = String.Empty; |
||||
|
detailObj.ToLot = String.Empty; |
||||
|
#endregion
|
||||
|
|
||||
|
detailObj.SupplierBatch = String.Empty; |
||||
|
detailObj.ArriveDate = CommonHelper.CurTime; |
||||
|
detailObj.ProduceDate = CommonHelper.CurTime; |
||||
|
detailObj.ExpireDate = DateTime.MaxValue; |
||||
|
var fromLocationObj = await _locationAppService.GetByCodeAsync(input.FromLocationCode).ConfigureAwait(false); |
||||
|
if (fromLocationObj == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"{input.FromLocationCode}在Location表不存在!"); |
||||
|
} |
||||
|
detailObj.FromLocationCode = input.FromLocationCode; |
||||
|
detailObj.FromLocationArea = fromLocationObj.AreaCode; |
||||
|
detailObj.FromLocationGroup = fromLocationObj.LocationGroupCode; |
||||
|
detailObj.FromLocationErpCode = fromLocationObj.ErpLocationCode; |
||||
|
detailObj.FromWarehouseCode = fromLocationObj.WarehouseCode; |
||||
|
var toLocationObj = await _locationAppService.GetByCodeAsync(input.ToLocationCode).ConfigureAwait(false); |
||||
|
if (toLocationObj == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"{input.ToLocationCode}在Location表不存在!"); |
||||
|
} |
||||
|
detailObj.ToLocationCode = input.ToLocationCode; |
||||
|
detailObj.ToLocationArea = toLocationObj.AreaCode; |
||||
|
detailObj.ToLocationGroup = toLocationObj.LocationGroupCode; |
||||
|
detailObj.ToLocationErpCode = toLocationObj.ErpLocationCode; |
||||
|
detailObj.ToWarehouseCode = toLocationObj.WarehouseCode; |
||||
|
detailObj.FromStatus = EnumInventoryStatus.OK; |
||||
|
detailObj.ToStatus = EnumInventoryStatus.OK; |
||||
|
detailObj.OnTheWayLocationCode = String.Empty; |
||||
|
detailObj.Reason = ""; |
||||
|
var temp = await _transferNoteAppService.CreateAsync(transferNoteEditInput).ConfigureAwait(false); |
||||
|
ret.Code = GaoTongResultStatus.Success; |
||||
|
ret.Message = "接收成功"; |
||||
|
ret.OperateTime = CommonHelper.CurTimeStr; |
||||
|
return ret; |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret.Code = GaoTongResultStatus.Failure; |
||||
|
ret.Message = "FeedbackZuPanAsync执行失败:" + ex.Message; |
||||
|
ret.OperateTime = CommonHelper.CurTimeStr; |
||||
|
return ret; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using AutoMapper; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
public partial class StoreApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void GaoTongAutoMapperProfile() |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,107 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Notes.IssueNotes; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 装配发料记录传给TYRP(线边仓领料单)
|
||||
|
/// </summary>
|
||||
|
public class AssembleIssueNoteEventHandler |
||||
|
: StoreDataExchangeEventHandlerBase<AssembleIssueNote> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleIssueNote>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleIssueNote>>> |
||||
|
{ |
||||
|
|
||||
|
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.AssembleIssue; |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<AssembleIssueNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<AssembleIssueNote>> eventData) |
||||
|
{ |
||||
|
var entities = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
protected override async Task AddExchangeDataAsync(List<AssembleIssueNote> entities) |
||||
|
{ |
||||
|
var dtos = ObjectMapper.Map<List<AssembleIssueNote>, List<AssembleIssueNoteDTO>>(entities); |
||||
|
foreach (var detail in dtos.SelectMany(dto => dto.Details)) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledFromLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledFromLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledFromLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledFromWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledToLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledToLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledToLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledToWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var toErpDto = new List<AssembleIssueNoteDTO>(); |
||||
|
foreach (var item in dtos) |
||||
|
{ |
||||
|
if (item.Details != null && item.Details.Count != 0) |
||||
|
{ |
||||
|
toErpDto.Add(item); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//2023-12-6要求同储位不传入接口 按历史规则
|
||||
|
var result = new List<AssembleIssueNoteDTO>(); |
||||
|
foreach (var assembleIssueNoteDto in toErpDto) |
||||
|
{ |
||||
|
assembleIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); |
||||
|
if (assembleIssueNoteDto.Details.Count > 0) |
||||
|
{ |
||||
|
result.Add(assembleIssueNoteDto); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (result.Count > 0) |
||||
|
{ |
||||
|
var exchangeDataerp = |
||||
|
await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result) |
||||
|
.ConfigureAwait(false); |
||||
|
await AddManyAsync(exchangeDataerp).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Notes.IssueNotes; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 涂装发料记录传给TYRP(线边仓领料单)
|
||||
|
/// </summary>
|
||||
|
public class CoatingIssueNoteEventHandler |
||||
|
: StoreDataExchangeEventHandlerBase<CoatingIssueNote> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueNote>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueNote>>> |
||||
|
{ |
||||
|
|
||||
|
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.CoatingIssue; |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<CoatingIssueNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<CoatingIssueNote>> eventData) |
||||
|
{ |
||||
|
var entities = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
protected override async Task AddExchangeDataAsync(List<CoatingIssueNote> entities) |
||||
|
{ |
||||
|
var dtos = ObjectMapper.Map<List<CoatingIssueNote>, List<CoatingIssueNoteDTO>>(entities); |
||||
|
foreach (var detail in dtos.SelectMany(dto => dto.Details)) |
||||
|
{ |
||||
|
if (string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledFromLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledFromLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledFromLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledFromWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledToLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledToLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledToLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledToLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledToWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var toErpDto = new List<CoatingIssueNoteDTO>(); |
||||
|
foreach (var item in dtos) |
||||
|
{ |
||||
|
if (item.Details != null && item.Details.Count != 0) |
||||
|
{ |
||||
|
toErpDto.Add(item); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//2023-12-6要求同储位不传入接口 按历史规则
|
||||
|
var result = new List<CoatingIssueNoteDTO>(); |
||||
|
foreach (var coatingIssueNoteDto in toErpDto) |
||||
|
{ |
||||
|
coatingIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); |
||||
|
if (coatingIssueNoteDto.Details.Count > 0) |
||||
|
{ |
||||
|
result.Add(coatingIssueNoteDto); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (result.Count > 0) |
||||
|
{ |
||||
|
var exchangeDataerp = |
||||
|
await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result) |
||||
|
.ConfigureAwait(false); |
||||
|
await AddManyAsync(exchangeDataerp).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,106 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注塑发料记录传给TYRP(线边仓领料单)
|
||||
|
/// </summary>
|
||||
|
public class InjectionIssueNoteEventHandler |
||||
|
: StoreDataExchangeEventHandlerBase<InjectionIssueNote> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<InjectionIssueNote>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<InjectionIssueNote>>> |
||||
|
{ |
||||
|
|
||||
|
private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.InjectionIssue; |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<InjectionIssueNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<InjectionIssueNote>> eventData) |
||||
|
{ |
||||
|
var entities = eventData.Entity; |
||||
|
await AddExchangeDataAsync(entities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
protected override async Task AddExchangeDataAsync(List<InjectionIssueNote> entities) |
||||
|
{ |
||||
|
var dtos = ObjectMapper.Map<List<InjectionIssueNote>, List<InjectionIssueNoteDTO>>(entities); |
||||
|
foreach (var detail in dtos.SelectMany(dto => dto.Details)) |
||||
|
{ |
||||
|
if(string.IsNullOrEmpty(detail.HandledFromLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledFromLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledFromLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledFromLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledFromLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledFromWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledFromWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if(string.IsNullOrEmpty(detail.HandledToLocationErpCode)) |
||||
|
{ |
||||
|
var location = await LocationAclService.GetByCodeAsync(detail.HandledToLocationCode).ConfigureAwait(false); |
||||
|
if (location != null) |
||||
|
{ |
||||
|
detail.HandledToLocationErpCode = location.ErpLocationCode; |
||||
|
detail.HandledToLocationGroup = location.LocationGroupCode; |
||||
|
detail.HandledToLocationArea = location.AreaCode; |
||||
|
|
||||
|
if (string.IsNullOrEmpty(detail.HandledToWarehouseCode)) |
||||
|
{ |
||||
|
detail.HandledToWarehouseCode = location.WarehouseCode; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var toErpDto = new List<InjectionIssueNoteDTO>(); |
||||
|
foreach (var item in dtos) |
||||
|
{ |
||||
|
if (item.Details != null && item.Details.Count != 0) |
||||
|
{ |
||||
|
toErpDto.Add(item); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//2023-12-6要求同储位不传入接口 按历史规则
|
||||
|
var result = new List<InjectionIssueNoteDTO>(); |
||||
|
foreach (var injectionIssueNoteDto in toErpDto) |
||||
|
{ |
||||
|
injectionIssueNoteDto.Details.RemoveAll(p => p.HandledFromLocationErpCode == p.HandledToLocationErpCode); |
||||
|
if (injectionIssueNoteDto.Details.Count > 0) |
||||
|
{ |
||||
|
result.Add(injectionIssueNoteDto); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (result.Count > 0) |
||||
|
{ |
||||
|
var exchangeDataerp = |
||||
|
await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, result) |
||||
|
.ConfigureAwait(false); |
||||
|
await AddManyAsync(exchangeDataerp).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue