lvzb 2 years ago
parent
commit
7887573b16
  1. 7
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs
  2. 67
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs
  3. 6
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs
  4. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs
  5. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs
  6. 6
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs
  7. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs
  8. 2
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs
  9. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs
  10. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs
  11. 72
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
  12. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs
  13. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs
  14. 13
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs
  15. 13
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs
  16. 23
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs
  17. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs
  18. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs
  19. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs
  20. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs
  21. 5
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs
  22. 1
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs
  23. 1
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs
  24. 8
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs
  25. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs
  26. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs
  27. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs
  28. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs
  29. 9
      be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs
  30. 7
      be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs
  31. 1
      be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs
  32. 9
      be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs
  33. 3
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs
  34. 43
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs
  35. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs
  36. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs
  37. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs
  38. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs
  39. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs
  40. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs
  41. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs
  42. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs
  43. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs
  44. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs
  45. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs
  46. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs
  47. 25
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs
  48. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs
  49. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs
  50. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs
  51. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs
  52. 20
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs
  53. 121
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs
  54. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs
  55. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs
  56. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs
  57. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs
  58. 20983
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs
  59. 68
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs
  60. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  61. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs
  62. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs
  63. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs
  64. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs
  65. 132
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs
  66. 57
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs
  67. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs
  68. 15
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs
  69. 255
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs
  70. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs
  71. 6
      build/src/docker/publish/conf/settings/appsettings.Development.json

7
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs

@ -1,4 +1,5 @@
using System.IO;
using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -83,6 +84,12 @@ public class StoreHttpApiHostModule : ModuleBase<StoreHttpApiHostModule>
{
base.ConfigureServices(context);
ConfigureVirtualFileSystem();
//将枚举返回时都变为字符串
//context.Services.AddControllers().AddJsonOptions(options =>
//{
// options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
//});
//ConfigureSwaggerServices(context, context.Services.GetConfiguration());
}

67
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs

@ -5,6 +5,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -29,6 +31,8 @@ public class BalanceController : AbpController
private readonly ILocationAppService _locationAppService;
private readonly IExpectOutAppService _expectOutAppService;
/// <summary>
///
/// </summary>
@ -38,10 +42,11 @@ public class BalanceController : AbpController
public BalanceController(
IBalanceAppService balanceAppService,
IItemBasicAppService itemBasicAppService,
ILocationAppService locationAppService)
ILocationAppService locationAppService, IExpectOutAppService expectOutAppService)
{
this._balanceAppService = balanceAppService;
this._locationAppService = locationAppService;
_expectOutAppService = expectOutAppService;
this._itemBasicAppService = itemBasicAppService;
}
@ -280,11 +285,11 @@ public class BalanceController : AbpController
}
}
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
{
input.Condition.Filters.Add(
new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
}
//if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
//{
// input.Condition.Filters.Add(
// new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In"));
//}
var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
@ -426,6 +431,56 @@ public class BalanceController : AbpController
return balanceDTOs;
}
/// <summary>
/// 查询库存余额 根据 物品 库位 库位类型 库存状态 批次 并且没有被预计出 占用
/// </summary>
/// <param name="listInput"></param>
/// <returns></returns>
[HttpPost("by-balances-request-many-parameter-not-in-expect-out")]
public async Task<PagedResultDto<BalanceDTO>> GetListByLocationTypeAndInventoryStatusAndNotExpectOutAsync(
BalanceListByIssueInputByInventoryStatusAndLocationType listInput)
{
var expectOut = await _expectOutAppService.GetListByPackingCodeAsync(listInput.packingCode);
if (expectOut != null && expectOut.Any())
{
throw new UserFriendlyException($"箱码为 {listInput.packingCode} 已被任务{expectOut[0].JobNumber}使用");
}
var input = new SfsInventoryRequestInputBase()
{
MaxResultCount = listInput.pageSize,
SkipCount = (listInput.pageIndex - 1) * listInput.pageSize,
Sorting = listInput.sortBy,
Condition = new Condition { Filters = new List<Filter>() }
};
if (!string.IsNullOrWhiteSpace(listInput.itemCode))
input.Condition.Filters.Add(new Filter("ItemCode", listInput.itemCode));
if (!string.IsNullOrWhiteSpace(listInput.locationCode))
input.Condition.Filters.Add(new Filter("LocationCode", listInput.locationCode));
if (!string.IsNullOrWhiteSpace(listInput.lot)) input.Condition.Filters.Add(new Filter("Lot", listInput.lot));
if (!string.IsNullOrWhiteSpace(listInput.packingCode))
input.Condition.Filters.Add(new Filter("PackingCode", listInput.packingCode));
if (!string.IsNullOrWhiteSpace(listInput.containerCode))
input.Condition.Filters.Add(new Filter("ContainerCode", listInput.containerCode));
if (listInput.locationTypes != null && listInput.locationTypes.Any())
{
var locationCodes = (await this._locationAppService.GetListByTypesAsync(listInput.locationTypes).ConfigureAwait(false))
.Select(t => t.Code).ToList();
if (locationCodes.Any())
input.Condition.Filters.Add(
new Filter("LocationCode", JsonConvert.SerializeObject(locationCodes), "In"));
}
if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any())
input.Condition.Filters.Add(
new Filter("Status", JsonConvert.SerializeObject(listInput.inventoryStatuses), "In"));
return await this._balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false);
}
/*
/// <summary>
/// 查询库余额

6
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs

@ -75,7 +75,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -133,7 +133,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() {EnumJobStatus.Open.ToString(),EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase
@ -165,7 +165,7 @@ public class CountJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/DeliverJobController.cs

@ -75,7 +75,7 @@ public class DeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
_ = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class DeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InspectJobController.cs

@ -64,7 +64,7 @@ public class InspectJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -108,7 +108,7 @@ public class InspectJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

6
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/IssueJobController.cs

@ -65,7 +65,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -143,7 +143,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase
@ -175,7 +175,7 @@ public class IssueJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JisDeliverJobController.cs

@ -74,7 +74,7 @@ public class JisDeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class JisDeliverJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

2
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs

@ -76,7 +76,7 @@ public class JobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var list = new List<JobCountDto>();

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductReceiveJobController.cs

@ -62,7 +62,7 @@ public class ProductReceiveJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class ProductReceiveJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ProductionReturnJobController.cs

@ -69,7 +69,7 @@ public class ProductionReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -113,7 +113,7 @@ public class ProductionReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

72
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs

@ -21,14 +21,10 @@ namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs;
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}job/purchase-receipt")]
public class PurchaseReceiptJobController : AbpController
{
private readonly ISupplierAppService _supplierAppService;
private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService;
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService;
private readonly IFileAppService _fileAppService;
private readonly IUserWorkGroupAppService _userWorkGroupAppService;
/// <summary>
@ -42,15 +38,11 @@ public class PurchaseReceiptJobController : AbpController
public PurchaseReceiptJobController(
IPurchaseReceiptJobAppService purchaseReceiptJobAppService
, IUserWorkGroupAppService userWorkGroupAppService
, IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService
, ISupplierAppService supplierAppService
, IFileAppService fileAppService)
, ISupplierAppService supplierAppService)
{
_userWorkGroupAppService = userWorkGroupAppService;
_purchaseReceiptJobAppService = purchaseReceiptJobAppService;
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService;
_supplierAppService = supplierAppService;
_fileAppService = fileAppService;
}
/// <summary>
@ -59,10 +51,9 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")]
public virtual async Task<ActionResult<PurchaseReceiptJobDTO>> GetAsync(Guid id)
{
var result = await _purchaseReceiptJobAppService.GetAsync(id).ConfigureAwait(false);
var result = await _purchaseReceiptJobAppService.GetNoCacheAsync(id).ConfigureAwait(false);
var supplier = await _supplierAppService.GetByCodeAsync(result.SupplierCode).ConfigureAwait(false);
result.SupplierName = supplier.Name;
@ -79,12 +70,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday">是否今天</param>
/// <returns></returns>
[HttpGet("list")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(int pageSize, int pageIndex, bool isTimeWindowSorting, bool isToday)
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(int pageSize, int pageIndex,
bool isTimeWindowSorting, bool isToday)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -96,17 +88,19 @@ public class PurchaseReceiptJobController : AbpController
{
Filters = new List<Filter>
{
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In")
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In")
}
}
};
if (isToday)//只看当日
if (isToday) //只看当日
{
request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
request.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate),
Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
}
if (isTimeWindowSorting)//窗口时间排序
if (isTimeWindowSorting) //窗口时间排序
{
request.Sorting = $"{nameof(PurchaseReceiptJobDTO.TimeWindow)} ASC";
}
@ -131,7 +125,8 @@ public class PurchaseReceiptJobController : AbpController
[HttpPost("list")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO)
{
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false);
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true)
.ConfigureAwait(false);
return list;
}
@ -155,22 +150,27 @@ public class PurchaseReceiptJobController : AbpController
{
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
}
if (!wlgCodes.Any(r => r == jobDto.WorkGroupCode))
{
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
}
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id)
{
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理");
}
if (isToday)//只看当日
if (isToday) //只看当日
{
if (jobDto.PlanArriveDate.ToString("yyyy-MM-dd") == Clock.Now.ToString("yyyy-MM-dd"))
{
return jobDto;
}
return new NotFoundObjectResult($"不是当天的收货任务");
}
return jobDto;
}
@ -181,12 +181,13 @@ public class PurchaseReceiptJobController : AbpController
/// <param name="isToday"></param>
/// <returns></returns>
[HttpGet("list/by-asn")]
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListByAsnNumberAsync(string asnNumber, bool isToday)
public virtual async Task<PagedResultDto<PurchaseReceiptJobDTO>> GetListByAsnNumberAsync(string asnNumber,
bool isToday)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var requestInput = new SfsJobRequestInputBase
@ -198,17 +199,20 @@ public class PurchaseReceiptJobController : AbpController
{
Filters = new List<Filter>
{
new(nameof(PurchaseReceiptJobDTO.AsnNumber),asnNumber),
new(nameof(IssueJobDTO.WorkGroupCode),jsonWlgCodes,"In"),
new(nameof(IssueJobDTO.JobStatus),jsonStatus,"In"),
new(nameof(PurchaseReceiptJobDTO.AsnNumber), asnNumber),
new(nameof(IssueJobDTO.WorkGroupCode), jsonWlgCodes, "In"),
new(nameof(IssueJobDTO.JobStatus), jsonStatus, "In"),
}
}
};
if (isToday)//只看当日
if (isToday) //只看当日
{
requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
requestInput.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate),
Clock.Now.ToString("yyyy-MM-dd"), ">=", "And"));
}
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true).ConfigureAwait(false);
var list = await _purchaseReceiptJobAppService.GetPagedListByFilterAsync(requestInput, true)
.ConfigureAwait(false);
return list;
}
@ -222,7 +226,7 @@ public class PurchaseReceiptJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -232,8 +236,8 @@ public class PurchaseReceiptJobController : AbpController
{
Filters = new List<Filter>
{
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In")
new(nameof(PurchaseReceiptJobDTO.WorkGroupCode), jsonCodes, "In"),
new(nameof(PurchaseReceiptJobDTO.JobStatus), jsonStatus, "In")
}
}
};
@ -292,9 +296,11 @@ public class PurchaseReceiptJobController : AbpController
/// </summary>
/// <returns></returns>
[HttpPost("save-detail-inspect/{id}")]
public virtual async Task<PurchaseReceiptJobDetailDTO> SaveDetailAsync(Guid id, PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput)
public virtual async Task<PurchaseReceiptJobDetailDTO> SaveDetailAsync(Guid id,
PurchaseReceiptJobDetailSaveInput purchaseReceiptJobDetailSaveInput)
{
return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput).ConfigureAwait(false);
return await _purchaseReceiptJobAppService.SaveDetailInspectAsync(id, purchaseReceiptJobDetailSaveInput)
.ConfigureAwait(false);
}
/// <summary>

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReturnJobController.cs

@ -63,7 +63,7 @@ public class PurchaseReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -132,7 +132,7 @@ public class PurchaseReturnJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

4
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PutawayJobController.cs

@ -62,7 +62,7 @@ public class PutawayJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
@ -106,7 +106,7 @@ public class PutawayJobController : AbpController
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

13
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs

@ -2,6 +2,7 @@ using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
@ -29,9 +30,17 @@ public class IssueNoteController : AbpController
/// 创建发料记录
/// </summary>
/// <returns></returns>
[HttpPost("{input}")]
public virtual async Task CreateAsync(IssueNoteEditInput input)
[HttpPost("")]
public virtual async Task CreateAsync([FromBody] IssueNoteEditInput input)
{
input.RequestType = EnumMaterialRequestType.Direct_Issue.ToString();
input.Details.ForEach(p =>
{
p.ToLot = string.Empty;
p.ToPackingCode = string.Empty;
});
await _issueNoteAppService.CreateAsync(input).ConfigureAwait(false);
}

13
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReceiptRequestController.cs

@ -35,4 +35,17 @@ public class PurchaseReceiptRequestController : AbpController
var result = await _purchaseReceiptRequestAppService.GetByNumberAsync(number).ConfigureAwait(false);
return Ok(result);
}
/// <summary>
/// 根据 物品 箱 获取收货记录
/// </summary>
/// <param name="itemCode"></param>
/// <param name="packingCode"></param>
/// <returns></returns>
[HttpGet("detail-by-item-and-packing")]
public virtual async Task<PurchaseReceiptRequestDetailDTO> GetDetailByItemAndPackingAsync(string itemCode,
string packingCode)
{
return await _purchaseReceiptRequestAppService.GetDetailByItemAndPackingAsync(itemCode, packingCode).ConfigureAwait(false);
}
}

23
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/PurchaseReturnNoteController.cs

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Domain.Entities.Auditing;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -109,33 +110,34 @@ public class PurchaseReturnNoteController : AbpController
{
var poNumber = poNumberItem.Key;
var createInput = new PurchaseReturnNoteEditInput() { Details = new List<PurchaseReturnNoteDetailInput>() };
var returnNoteEditInput = new PurchaseReturnNoteEditInput() { Details = new List<PurchaseReturnNoteDetailInput>() };
createInput.PoNumber = poNumber;
returnNoteEditInput.PoNumber = poNumber;
foreach (var poNumberDetail in poNumberItem)
{
var packingCode = poNumberDetail.PackingCode;
await SetFromInventoryLabelAsync(packingCode, createInput).ConfigureAwait(false);
await SetFromInventoryLabelAsync(packingCode, returnNoteEditInput).ConfigureAwait(false);
await SetFormPurchaseOrderAsync(poNumber, createInput).ConfigureAwait(false);
await SetFormPurchaseOrderAsync(poNumber, returnNoteEditInput).ConfigureAwait(false);
createInput.ReturnType = returnType;
createInput.ReturnTime = returnTime;
createInput.ReturnReason = returnReason;
returnNoteEditInput.ReturnType = returnType;
returnNoteEditInput.ReturnTime = returnTime;
returnNoteEditInput.ReturnReason = returnReason;
var createInputDetail = new PurchaseReturnNoteDetailInput();
createInputDetail.PoNumber = poNumber;
createInputDetail.Reason = returnReason;
//createInputDetail.WarehouseCode= poNumberItem.
await SetDetailByBalanceAsync(packingCode, createInputDetail).ConfigureAwait(false);
createInput.Details.Add(createInputDetail);
returnNoteEditInput.Details.Add(createInputDetail);
}
createInputs.Add(createInput);
createInputs.Add(returnNoteEditInput);
}
return createInputs;
@ -149,6 +151,9 @@ public class PurchaseReturnNoteController : AbpController
createInputDetail.LocationCode = balance.LocationCode;
createInputDetail.LocationErpCode = balance.LocationErpCode;
createInputDetail.LocationArea = balance.LocationArea;
createInputDetail.LocationGroup= balance.LocationGroup;
createInputDetail.WarehouseCode= balance.WarehouseCode;
createInputDetail.PackingCode = balance.PackingCode;
createInputDetail.ContainerCode = balance.ContainerCode;
createInputDetail.Uom = balance.Uom;

3
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Calendars/InterfaceCalendarAutoMapperProfile.cs

@ -12,5 +12,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<InterfaceCalendar, InterfaceCalendarDTO>()
.IgnoreAuditedObjectProperties()
.ReverseMap();
CreateMap<InterfaceCalendarEditInput, InterfaceCalendar>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
}
}

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/CustomerItems/CustomerItemAutoMapperProfile.cs

@ -23,7 +23,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason)
;
CreateMap<CustomerItemEditInput, CustomerItem>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ErpLocations/ErpLocationAutoMapperProfile.cs

@ -18,6 +18,8 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp);
CreateMap<ErpLocationEditInput, ErpLocation>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
}
}

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemPacks/ItemPackAutoMapperProfile.cs

@ -22,9 +22,12 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<ItemPackEditInput, ItemPack>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x=>x.Id)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
;
CreateMap<ItemPackEditInput, ItemPack>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
}
}

5
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierItems/SupplierItemAutoMapperProfile.cs

@ -24,5 +24,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile
CreateMap<SupplierItem, SupplierItemImportInput>()
.Ignore(x => x.ReportStatus)
.Ignore(x => x.ReportReason);
CreateMap<SupplierItemEditInput, SupplierItem>()
.IgnoreAuditedObjectProperties()
//.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty)))
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

1
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs

@ -13,4 +13,5 @@ public interface IExpectOutAppService
Task<List<ExpectOutDTO>> GetListByJobAsync(string jobNumber);
Task<List<ExpectOutDTO>> GetListByItemAsync(string itemCode);
Task<List<ExpectOutDTO>> GetListByLocationAsync(string locationCode);
Task<List<ExpectOutDTO>> GetListByPackingCodeAsync(string packingCode);
}

1
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs

@ -31,5 +31,6 @@ public partial class InventoryApplicationAutoMapperProfile : Profile
CreateMap<BalanceDTO, ExpectInEditInput>()
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker);
}
}

8
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs

@ -146,4 +146,12 @@ public class ExpectOutAppService
//TODO
throw new UserFriendlyException("");
}
[HttpGet("list/by-packing/{packingCode}")]
public virtual async Task<List<ExpectOutDTO>> GetListByPackingCodeAsync(string packingCode)
{
var entitys = await _repository.GetListAsync(p => p.PackingCode == packingCode).ConfigureAwait(false);
return ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(entitys);
}
}

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelDto.cs

@ -214,4 +214,11 @@ public class InventoryLabelDto : SfsBasicDTOBase
/// </summary>
[Display(Name = "供应商零件名")]
public string SupplierItemName { get; set; }
/// <summary>
/// 计划到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
}

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelEditInput.cs

@ -221,5 +221,12 @@ public class InventoryLabelEditInput : SfsLabelCreateOrUpdateInputBase
[Required(ErrorMessage = "{0}是必填项")]
public EnumLabelType LabelType { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
#endregion
}

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelImportInput.cs

@ -74,6 +74,13 @@ public class InventoryLabelImportInput : SfsImportInputBase
[Display(Name = "规格")]
public string Specifications { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
#region PurchaseInfo
/// <summary>

7
be/Modules/Label/src/Win_in.Sfs.Label.Application.Contracts/InventoryLabels/InventoryLabelWithoutCodeCreateInput.cs

@ -200,4 +200,11 @@ public class InventoryLabelWithoutCodeCreateInput
[Display(Name = "标签类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumLabelType LabelType { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
}

9
be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs

@ -51,5 +51,14 @@ public class InventoryLabelAutoMapperProfile : Profile
.Ignore(x => x.Id)
.Ignore(x => x.StdPackQty)
.Ignore(x => x.Uom);
CreateMap<InventoryLabelEditInput, InventoryLabel>()
.IgnoreAuditedObjectProperties()
//.MapItemBatchQtyStdPackDto()
.MapPurchaseInfoDto()
.MapProductionInfoDto()
.MapQualityInfoDto()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

7
be/Modules/Label/src/Win_in.Sfs.Label.Domain/InventoryLabels/InventoryLabel.cs

@ -166,4 +166,11 @@ public class InventoryLabel : SfsAggregateRootBase
/// </summary>
[Display(Name = "供应商零件名")]
public string SupplierItemName { get; set; }
/// <summary>
/// 要求到货时间
/// </summary>
[Display(Name = "要求到货时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime PlanArriveDate { get; set; }
}

1
be/Modules/Shared/src/Win_in.Sfs.Shared.Application.Contracts/ISfsCrudWithDetailsAppService.cs

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Services;
namespace Win_in.Sfs.Shared.Application.Contracts;

9
be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs

@ -188,10 +188,11 @@ public abstract class SfsCrudWithDetailsAppServiceBase<TEntity, TEntityDto, TReq
[HttpGet("{id}")]
public override async Task<TEntityDto> GetAsync(Guid id)
{
var dto = await Cache.GetOrAddItemAsync(
id.ToString(),
async () => await base.GetAsync(id).ConfigureAwait(false),
SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
//var dto = await Cache.GetOrAddItemAsync(
// id.ToString(),
// async () => await base.GetAsync(id).ConfigureAwait(false),
// SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
var dto=await base.GetAsync(id).ConfigureAwait(false);
return dto;
}

3
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/EnumMaterialRequestType.cs

@ -26,4 +26,7 @@ public enum EnumMaterialRequestType
///// </summary>
//[Display(Name = "安全库存拉动")]
//Issue_SfaetyStock = 1504,
[Display(Name = "直接发料")]
Direct_Issue = 1505
}

43
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Filters/FilterExtensions.cs

@ -206,27 +206,28 @@ public static class FilterExtensions
var parameterExpression = Expression.Parameter(typeof(T), "p");
Type lstType = typeof(List<>).MakeGenericType(propertyType);
if (propertyType.IsEnum)
{
var valueArrayStrings = JsonSerializer.Deserialize<List<string>>(filter.Value);
List<object> newValues = new List<object>();
var enumValues = propertyType.GetEnumValues();
foreach (var valueArray in valueArrayStrings)
{
foreach (var enumValue in enumValues)
{
if (enumValue.ToString() == valueArray)
{
newValues.Add(enumValue);
break;
}
}
}
var newValue = JsonSerializer.Serialize(newValues);
filter.Value = newValue;
}
//转换枚举
//if (propertyType.IsEnum)
//{
// var valueArrayStrings = JsonSerializer.Deserialize<List<string>>(filter.Value);
// List<object> newValues = new List<object>();
// var enumValues = propertyType.GetEnumValues();
// foreach (var valueArray in valueArrayStrings)
// {
// foreach (var enumValue in enumValues)
// {
// if (enumValue.ToString() == valueArray)
// {
// newValues.Add(enumValue);
// break;
// }
// }
// }
// var newValue = JsonSerializer.Serialize(newValues);
// filter.Value = newValue;
//}
object propertyValue = JsonSerializer.Deserialize(filter.Value, lstType);
if (propertyValue != null)

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/PurchaseReceiptJobs/IPurchaseReceiptJobAppService.cs

@ -40,4 +40,12 @@ public interface IPurchaseReceiptJobAppService
/// </summary>
/// <returns></returns>
Task<List<PurchaseReceiptJobDetailDTO>> SetInspectWithNotInspectAsync(Guid id);
/// <summary>
/// 按Id获取实体 不走缓存
/// </summary>
/// <param name="id">实体Id</param>
/// <param name="noCache"></param>
/// <returns></returns>
Task<PurchaseReceiptJobDTO> GetNoCacheAsync(Guid id);
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/DTOs/DeliverNoteDTO.cs

@ -48,6 +48,13 @@ public class DeliverNoteDTO : SfsStoreDTOBase<DeliverNoteDetailDTO>
[Display(Name = "发货申请单号")]
public string DeliverRequestNumber { get; set; }
/// <summary>
/// 打印次数
/// </summary>
/// <returns></returns>
[Display(Name = "打印次数")]
public int CountPrint { get; set; }
/// <summary>
/// 发货类型
/// </summary>

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/DeliverNotes/Inputs/DeliverNoteEditInput.cs

@ -63,5 +63,13 @@ public class DeliverNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary>
[Display(Name = "明细列表")]
public List<DeliverNoteDetailInput> Details { get; set; }
/// <summary>
/// 打印次数
/// </summary>
/// <returns></returns>
[Display(Name = "打印次数")]
public int CountPrint { get; set; }
#endregion
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs

@ -20,4 +20,13 @@ public interface IPurchaseReceiptRequestAppService
/// <param name="inputs"></param>
/// <returns></returns>
Task<List<PurchaseReceiptRequestDTO>> CreateManyAsync(List<PurchaseReceiptRequestEditInput> inputs);
/// <summary>
/// 【获取】【收货记录详情】根据 物品 箱码
/// </summary>
/// <param name="itemCode"></param>
/// <param name="packingCode"></param>
/// <returns></returns>
Task<PurchaseReceiptRequestDetailDTO> GetDetailByItemAndPackingAsync(string itemCode,
string packingCode);
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs

@ -4,6 +4,7 @@ using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.FileStorage.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;

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

@ -5,6 +5,7 @@ using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.FileStorage.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -177,6 +178,19 @@ public class PurchaseReceiptJobAppService :
entity.Details.Find(p => p.Id == input.DetailId));
}
/// <summary>
/// 按Id获取实体 不走缓存
/// </summary>
/// <param name="id">实体Id</param>
/// <param name="noCache"></param>
/// <returns></returns>
[HttpGet("no-cache/{id}")]
public virtual async Task<PurchaseReceiptJobDTO> GetNoCacheAsync(Guid id)
{
var entity= await _repository.GetAsync(id).ConfigureAwait(false);
return ObjectMapper.Map<PurchaseReceiptJob, PurchaseReceiptJobDTO>(entity);
}
#endregion
/// <summary>

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAutoMapperProfile.cs

@ -22,5 +22,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<BackFlushNoteEditInput, BackFlushNote>()
.IgnoreAuditedObjectProperties();
}
}

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAppService.cs

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -72,7 +73,7 @@ public class DeliverNoteAppService :
CancellationToken cancellationToken = default)
{
sfsRequestDTO.Condition.Filters.Add(
new Filter(nameof(DeliverRequest.DeliverRequestType), "2"));
new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.FIS.ToString()));
return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken)
.ConfigureAwait(false);
@ -85,7 +86,7 @@ public class DeliverNoteAppService :
CancellationToken cancellationToken = default)
{
sfsRequestDTO.Condition.Filters.Add(
new Filter(nameof(DeliverRequest.DeliverRequestType), "1"));
new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.Normal.ToString()));
return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken)
.ConfigureAwait(false);
@ -98,7 +99,7 @@ public class DeliverNoteAppService :
CancellationToken cancellationToken = default)
{
sfsRequestDTO.Condition.Filters.Add(
new Filter(nameof(DeliverRequest.DeliverRequestType), "3"));
new Filter(nameof(DeliverRequest.DeliverRequestType), EnumDeliverRequestType.RAW.ToString()));
return await base.GetPagedListByFilterAsync(sfsRequestDTO, includeDetails, cancellationToken)
.ConfigureAwait(false);
@ -132,4 +133,18 @@ public class DeliverNoteAppService :
var list = ObjectMapper.Map<List<DeliverNote>, List<DeliverNoteDTO>>(entities);
return ExportImportService.Export(list, true, "Details");
}
/// <summary>
/// 调取打印
/// </summary>
/// <returns></returns>
[HttpPost("sum-print/{number}")]
public virtual async Task SumPrintAsync(string number)
{
var entity = await _repository.GetAsync(p => p.Number == number).ConfigureAwait(false);
entity.CountPrint++;
await _repository.UpdateAsync(entity).ConfigureAwait(false);
}
}

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/DeliverNotes/DeliverNoteAutoMapperProfile.cs

@ -19,5 +19,18 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<DeliverNoteEditInput, DeliverNote>()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id)
.Ignore(x=>x.CountPrint)
;
CreateMap<DeliverNoteDetailInput, DeliverNoteDetail>()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
}
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/IssueNoteAutoMapperProfile.cs

@ -20,5 +20,12 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<IssueNoteEditInput, IssueNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
}
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs

@ -23,5 +23,10 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<ProductReceiptNoteEditInput, ProductReceiptNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.Shift)
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs

@ -22,5 +22,19 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<PurchaseReturnNoteEditInput, PurchaseReturnNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id)
;
CreateMap<PurchaseReturnNoteDetailInput, PurchaseReturnNoteDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id)
;
}
}

25
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs

@ -2,9 +2,11 @@ using System;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Bibliography;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.EventBus;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -12,7 +14,11 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
using System.Linq;
using IdentityModel;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Event;
[Authorize]
[Route($"{StoreConsts.RootPath}scrap-note")]
@ -21,23 +27,26 @@ public class ScrapNoteAppService :
ScrapNoteDetail, ScrapNoteDetailDTO, SfsStoreRequestInputBase, ScrapNoteImportInput>,
IScrapNoteAppService
{
private readonly IScrapNoteManager _scrapNoteManager;
public ScrapNoteAppService(
IScrapNoteRepository repository
, IScrapNoteManager scrapNoteManager
) : base(repository)
IScrapNoteRepository repository) : base(repository)
{
_scrapNoteManager = scrapNoteManager;
}
[HttpPost("")]
//[Authorize(ScrapNotePermissions.Create)]
public override async Task<ScrapNoteDTO> CreateAsync(ScrapNoteEditInput input)
{
var entity = ObjectMapper.Map<ScrapNoteEditInput, ScrapNote>(input);
await _scrapNoteManager.CreateAsync(entity).ConfigureAwait(false);
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(ScrapNote), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
foreach (var detail in entity.Details)
{
detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number);
}
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData<ScrapNote>(entity), false).ConfigureAwait(false);
var dto = ObjectMapper.Map<ScrapNote, ScrapNoteDTO>(entity);
return dto;

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAutoMapperProfile.cs

@ -20,5 +20,19 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<ScrapNoteEditInput, ScrapNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
CreateMap<ScrapNoteDetailInput, ScrapNoteDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs

@ -55,5 +55,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.TenantId)
.Ignore(x => x.MasterID)
.Ignore(x => x.Id);
CreateMap<PurchaseOrderEditInput, PurchaseOrder>()
.IgnoreAuditedObjectProperties();
}
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs

@ -45,5 +45,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Number)
.IgnoreAuditedObjectProperties()
.Ignore(x => x.Id);
CreateMap<SaleOrderEditInput, SaleOrder>()
.IgnoreAuditedObjectProperties();
//.MapContactsDto()
//.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
}
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/SupplierAsns/SupplierAsnAppService.cs

@ -64,6 +64,7 @@ public class SupplierAsnAppService :
{
var inputEntity = ObjectMapper.Map<SupplierAsnEditInput, SupplierAsn>(input);
inputEntity.Number = input.Number;
var resultEntity = await _supplierAsnManager.CreateAsync(inputEntity).ConfigureAwait(false);
return ObjectMapper.Map<SupplierAsn, SupplierAsnDTO>(resultEntity);

20
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@ -54,6 +55,25 @@ public class PurchaseReceiptRequestAppService :
return ObjectMapper.Map<PurchaseReceiptRequest, PurchaseReceiptRequestDTO>(resultEntity);
}
/// <summary>
/// 【获取】【收货记录详情】根据 物品 箱码
/// </summary>
/// <param name="itemCode"></param>
/// <param name="packingCode"></param>
/// <returns></returns>
[HttpGet("detail-by-item-and-packing")]
public virtual async Task<PurchaseReceiptRequestDetailDTO> GetDetailByItemAndPackingAsync(string itemCode,
string packingCode)
{
var entity = (await _repository.GetListAsync(p => p.Details.Any(y => y.ItemCode == itemCode && y.PackingCode == packingCode), true).ConfigureAwait(false)).FirstOrDefault();
var detail = entity.Details.FirstOrDefault(y => y.ItemCode == itemCode && y.PackingCode == packingCode);
var dto = ObjectMapper.Map<PurchaseReceiptRequestDetail, PurchaseReceiptRequestDetailDTO>(detail);
return dto;
}
#endregion

121
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Users;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
@ -17,26 +18,85 @@ 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;
using Win_in.Sfs.Wms.Store.Domain.Acl.Dict;
using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}scrap-request")]
public class ScrapRequestAppService :
SfsStoreRequestAppServiceBase
<ScrapRequest, ScrapRequestDTO, SfsStoreRequestInputBase, ScrapRequestEditInput, ScrapRequestDetail, ScrapRequestDetailDTO, SfsStoreRequestInputBase, ScrapRequestImportInput>
public class ScrapRequestAppService : SfsStoreRequestAppServiceBase
<ScrapRequest,
ScrapRequestDTO,
SfsStoreRequestInputBase,
ScrapRequestEditInput,
ScrapRequestDetail,
ScrapRequestDetailDTO,
SfsStoreRequestInputBase,
ScrapRequestImportInput>
{
private readonly IScrapRequestManager _scrapRequestManager;
private const string ReasonItemCode = "Reason";
private readonly IScrapRequestManager _scrapRequestManager;
private readonly IDictAclService _dictAclService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly IItemBasicAppService _itemBasicAppService;
public ScrapRequestAppService(
IScrapRequestRepository repository,
IScrapRequestManager scrapRequestManager)
IScrapRequestRepository repository,
IScrapRequestManager scrapRequestManager,
IDictAclService dictAclService,
ITransactionTypeAppService transactionTypeAppService,
IItemBasicAppService itemBasicAppService)
: base(repository, scrapRequestManager)
{
_scrapRequestManager = scrapRequestManager;
_dictAclService = dictAclService;
_transactionTypeAppService = transactionTypeAppService;
_itemBasicAppService = itemBasicAppService;
}
#region 东阳使用
protected override async Task<Dictionary<ScrapRequest, EntityState>> ImportProcessingEntityAsync(
Dictionary<ScrapRequest, EntityState> dictionary)
{
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
foreach (var scrapRequest in addList)
{
scrapRequest.CreatorId = CurrentUser.Id;
scrapRequest.Worker = CurrentUser.Name;
scrapRequest.Type = EnumTransSubType.Scrap_WIP.ToString();
scrapRequest.ActiveDate = DateTime.Now;
await SetEntityPropertiesAsync(scrapRequest, EnumTransSubType.Scrap_WIP).ConfigureAwait(false);
foreach (var detail in scrapRequest.Details)
{
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
detail.ItemName = itemBasicDto.Name;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.Uom = itemBasicDto.BasicUom;
}
}
return dictionary;
}
private async Task SetEntityPropertiesAsync(ScrapRequest entity, EnumTransSubType subType)
{
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Scrap, subType)
.ConfigureAwait(false);
entity.Worker = CurrentUser.GetUserName();
entity.AutoCompleteJob = tranType.AutoCompleteJob;
entity.AutoSubmit = tranType.AutoSubmitRequest;
entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest;
entity.DirectCreateNote = tranType.DirectCreateNote;
}
[HttpPost("by-type/{type}")]
@ -53,9 +113,11 @@ public class ScrapRequestAppService :
}
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
}
#endregion
[HttpPost("export-by-type")]
public virtual async Task<IActionResult> ExportByTypeAsync(SfsExportRequestInput requestInput, string type)
{
@ -65,16 +127,19 @@ public class ScrapRequestAppService :
expression = expression.And(requestInput.Condition.Filters.ToLambda<ScrapRequest>());
}
var entities = await _repository.GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting, true).ConfigureAwait(false);
var entities = await _repository
.GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount, requestInput.Sorting,
true).ConfigureAwait(false);
var list = ObjectMapper.Map<List<ScrapRequest>, List<ScrapRequestDTO>>(entities);
return ExportImportService.Export(list, true, "Details");
}
#region import
#region 校验
protected override async Task ValidateImportModelAsync(ScrapRequestImportInput model, List<ValidationResult> validationRresult)
protected override async Task ValidateImportModelAsync(ScrapRequestImportInput model,
List<ValidationResult> validationRresult)
{
_ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false);
_ = await CheckLocationAsync(model, validationRresult).ConfigureAwait(false);
@ -82,33 +147,38 @@ public class ScrapRequestAppService :
await CheckDicAsync(model, validationRresult).ConfigureAwait(false);
}
protected async Task<ItemBasicDTO> CheckItemBasicAsync(ScrapRequestImportInput importInput, List<ValidationResult> validationRresul)
protected async Task<ItemBasicDTO> CheckItemBasicAsync(ScrapRequestImportInput importInput,
List<ValidationResult> validationRresul)
{
var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false);
if (item == null)
{
validationRresul.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new string[] { "物品代码" }));
}
if (importInput.Qty <= 0)
{
validationRresul.Add(new ValidationResult($"数量{importInput.Qty}需要大于0", new string[] { "数量" }));
}
return item;
}
protected async Task<LocationDTO> CheckLocationAsync(ScrapRequestImportInput importInput, List<ValidationResult> validationRresul)
protected async Task<LocationDTO> CheckLocationAsync(ScrapRequestImportInput importInput,
List<ValidationResult> validationRresul)
{
var location = await LocationAclService.GetByCodeAsync(importInput.LocationCode).ConfigureAwait(false);
if (location == null)
{
validationRresul.Add(new ValidationResult($"库位代码{importInput.LocationCode}不存在", new string[] { "库位代码" }));
}
return location;
}
protected async Task CheckDicAsync(ScrapRequestImportInput importInput, List<ValidationResult> validationRresul)
{
var dicItem = await DictAclService.GetByCodeAsync(ReasonItemCode).ConfigureAwait(false);
var dicItem = await _dictAclService.GetByCodeAsync(ReasonItemCode).ConfigureAwait(false);
if (dicItem == null)
{
validationRresul.Add(new ValidationResult($"字典编号{ReasonItemCode}不存在", new string[] { "字典编号" }));
@ -116,26 +186,28 @@ public class ScrapRequestAppService :
if (!dicItem.Items.Any(r => r.Code == importInput.ReasonCode))
{
validationRresul.Add(new ValidationResult($"报废原因代码{importInput.ReasonCode}在线边仓报废原因中不存在", new string[] { "报废原因代码" }));
validationRresul.Add(new ValidationResult($"报废原因代码{importInput.ReasonCode}在线边仓报废原因中不存在",
new string[] { "报废原因代码" }));
}
}
protected async Task<TransactionTypeDTO> CheckTransactionTypeAsync(List<ValidationResult> validationRresul)
{
var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.None).ConfigureAwait(false);
var transactionType = await TransactionTypeAclService
.GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.Scrap_WIP).ConfigureAwait(false);
Check.NotNull(transactionType, "事务类型", "事务类型报废不存在");
return transactionType;
}
protected async Task<BalanceDTO> CheckBalanceAsync(ScrapRequestImportInput importInput, List<ValidationResult> validationRresul)
protected async Task<BalanceDTO> CheckBalanceAsync(ScrapRequestImportInput importInput,
List<ValidationResult> validationRresul)
{
var balance = await BalanceAclService.GetByItemLocationAndPackingAsync(
string.Empty,
importInput.ItemCode,
importInput.LocationCode).ConfigureAwait(false);
string.Empty,
importInput.ItemCode,
importInput.LocationCode).ConfigureAwait(false);
//var balance = await this._balanceApp.GetByItemLocationAndPackingAsync(
// string.Empty,
// itemBasic.Code,
@ -145,6 +217,7 @@ public class ScrapRequestAppService :
{
throw new ArgumentException($"物品代码 {importInput.ItemCode}的库存余额数量{balance.Qty}小于导入数量{importInput.Qty}。");
}
return balance;
}
@ -157,7 +230,9 @@ public class ScrapRequestAppService :
{
foreach (var entity in dict.Keys)
{
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Scrap, Enum.Parse<EnumTransSubType>(entity.Type)).ConfigureAwait(false);
var tranType = await TransactionTypeAclService
.GetByTransTypeAsync(EnumTransType.Scrap, EnumTransSubType.Scrap_WIP)
.ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在");
entity.AutoCompleteJob = tranType.AutoCompleteJob;
entity.AutoSubmit = tranType.AutoSubmitRequest;
@ -165,6 +240,7 @@ public class ScrapRequestAppService :
entity.AutoHandle = tranType.AutoHandleRequest;
entity.DirectCreateNote = tranType.DirectCreateNote;
}
return await base.ValidateImportEntities(dict).ConfigureAwait(false);
}
@ -193,6 +269,7 @@ public class ScrapRequestAppService :
}
}
}
await base.SaveImportAsync(dict).ConfigureAwait(false);
}

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs

@ -25,8 +25,14 @@ namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}transfer-request")]
public class TransferRequestAppService : SfsStoreRequestAppServiceBase
<TransferRequest, TransferRequestDTO, SfsStoreRequestInputBase, TransferRequestEditInput, TransferRequestDetail,
TransferRequestDetailDTO, SfsStoreRequestInputBase, TransferRequestImportInput>,
<TransferRequest,
TransferRequestDTO,
SfsStoreRequestInputBase,
TransferRequestEditInput,
TransferRequestDetail,
TransferRequestDetailDTO,
SfsStoreRequestInputBase,
TransferRequestImportInput>,
ITransferRequestAppService
{
private readonly ITransferRequestManager _transferRequestManager;
@ -103,7 +109,8 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase
detail.ToLot = balanceDto.Lot;
}
await SetEntityPropertiesAsync(transferRequest, EnumTransSubType.Transfer_Customer).ConfigureAwait(false);
await SetEntityPropertiesAsync(transferRequest, EnumTransSubType.Transfer_Customer)
.ConfigureAwait(false);
}
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs

@ -138,8 +138,11 @@ public class InspectJobManager : SfsJobManagerBase<InspectJob, InspectJobDetail>
{
var jobEntity = await Repository.FindAsync(id);
jobEntity.Details.Where(p => p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK ||
p.DetailInspectStatus == EnumDetailInspectStatus.OK).ToList().ForEach(p =>
jobEntity.Details.Where(p => (p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK ||
p.DetailInspectStatus == EnumDetailInspectStatus.OK)&&
p.ItemCode== input.ItemCode&&
p.Lot==input.Lot
).ToList().ForEach(p =>
{
p.GoodQty = p.ReceiveQty;
});

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/DeliverNotes/DeliverNote.cs

@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using DocumentFormat.OpenXml.Wordprocessing;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
@ -52,6 +54,13 @@ public class DeliverNote : SfsStoreAggregateRootBase<DeliverNoteDetail>, IHasJob
[IgnoreUpdate]
public EnumDeliverRequestType DeliverRequestType { get; set; }
/// <summary>
/// 打印次数
/// </summary>
/// <returns></returns>
[Display(Name = "打印次数")]
public int CountPrint { get; set; }
/// <summary>
/// 明细列表
/// </summary>

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ScrapNotes/ScrapNoteManager.cs

@ -1,3 +1,5 @@
using System.Threading.Tasks;
namespace Win_in.Sfs.Wms.Store.Domain;
public class ScrapNoteManager : SfsStoreManagerBase<ScrapNote, ScrapNoteDetail>, IScrapNoteManager
@ -7,6 +9,6 @@ public class ScrapNoteManager : SfsStoreManagerBase<ScrapNote, ScrapNoteDetail>,
IScrapNoteRepository repository
) : base(repository)
{
}
}
}

20983
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.Designer.cs

File diff suppressed because it is too large

68
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20230412072454_Store_AddColumn.cs

@ -0,0 +1,68 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Store_AddColumn : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Type",
table: "Store_TransferNote",
type: "nvarchar(64)",
maxLength: 64,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "WarehouseCode",
table: "Store_PurchaseReceiptNote",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "WarehouseCode",
table: "Store_InspectRequest",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "CountPrint",
table: "Store_DeliverNote",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "WarehouseCode",
table: "Store_PurchaseReceiptNote");
migrationBuilder.DropColumn(
name: "WarehouseCode",
table: "Store_InspectRequest");
migrationBuilder.DropColumn(
name: "CountPrint",
table: "Store_DeliverNote");
migrationBuilder.AlterColumn<string>(
name: "Type",
table: "Store_TransferNote",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64);
}
}
}

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

@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
@ -3051,6 +3051,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<int>("CountPrint")
.HasColumnType("int");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
@ -5202,6 +5205,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.Property<string>("WarehouseCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Worker")
.HasColumnType("nvarchar(max)");
@ -13083,6 +13089,9 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("WarehouseCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Worker")
.HasColumnType("nvarchar(max)");
@ -17189,6 +17198,7 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnName("TenantId");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/IssueJobAutoMapperProfile.cs

@ -48,8 +48,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ToLocationErpCode)
;
CreateMap<
IssueJobDetail, ExpectInEditInput>()
CreateMap<IssueJobDetail, ExpectInEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
@ -62,5 +61,32 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties);
CreateMap<IssueJob, IssueNoteEditInput>()
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.RequestNumber)
.Ignore(x => x.ActiveDate)
;
CreateMap<IssueJobDetail, IssueNoteDetailInput>()
.Ignore(x => x.IssueTime)
.Ignore(x => x.FromPackingCode)
.Ignore(x => x.ToPackingCode)
.Ignore(x => x.FromContainerCode)
.Ignore(x => x.ToContainerCode)
.Ignore(x => x.FromLot)
.Ignore(x => x.ToLot)
.Ignore(x => x.SupplierBatch)
.Ignore(x => x.ArriveDate)
.Ignore(x => x.ProduceDate)
.Ignore(x => x.ExpireDate)
.Ignore(x => x.FromLocationCode)
.Ignore(x => x.FromLocationArea)
.Ignore(x => x.FromLocationGroup)
.Ignore(x => x.FromLocationErpCode)
.Ignore(x => x.FromWarehouseCode)
.Ignore(x => x.FromStatus)
.Ignore(x => x.ToStatus)
.Ignore(x => x.Qty)
;
}
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreDataExchangeEventHandlerBase.cs

@ -13,8 +13,8 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges;
public abstract class StoreDataExchangeEventHandlerBase<T> : StoreEventHandlerBase
{
// protected IDataExchangeHelperManager DataExchangeHelperManager =>
// LazyServiceProvider.LazyGetRequiredService<IDataExchangeHelperManager>();
protected IDataExchangeHelperManager DataExchangeHelperManager =>
LazyServiceProvider.LazyGetRequiredService<IDataExchangeHelperManager>();
protected IExchangeDataManager ExchangeDataManager =>
LazyServiceProvider.LazyGetRequiredService<IExchangeDataManager>();

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/IssueJobEventHandler.cs

@ -51,6 +51,7 @@ public class IssueJobEventHandler :
private async Task<IssueNoteEditInput> BuildIssueNoteAsync(IssueJob entity)
{
var issueNoteCreateInput = ObjectMapper.Map<IssueJob, IssueNoteEditInput>(entity);
issueNoteCreateInput.JobNumber = entity.Number;
var locationCodes = issueNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList();
var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false);
@ -61,7 +62,6 @@ public class IssueJobEventHandler :
var location = locations.First(p => p.Code == detail.ToLocationCode);
await RemovePackingCodeAndContainerCodeAndLotAsync(detail, location.Type); //去箱 去托 去批
detail.ToLocationArea = location.AreaCode;
detail.ToLocationGroup = location.LocationGroupCode;
detail.ToLocationErpCode = location.ErpLocationCode;

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs

@ -176,10 +176,17 @@ public class PurchaseOrderEventHandler
var itemPackDto=ItemPacks.First(p => p.ItemCode == purchaseOrderDetaildetail.ItemCode);
//总箱数
var itemPackQty = (int)(itemQty / itemPackDto.Qty);
if (itemQty % itemPackQty!= 0)
var itemPackingCount = (int)(itemQty / itemPackDto.Qty);
if (itemQty > itemPackDto.Qty)
{
itemPackQty++;
if (itemQty % itemPackDto.Qty != 0)
{
itemPackingCount++;
}
}
else
{
itemPackingCount = 1;
}
//添加物品信息
@ -192,9 +199,9 @@ public class PurchaseOrderEventHandler
//一次性返回所有箱码
var generateManyAsync = await _labelDefinitionAppService
.GenerateManyAsync(EnumLabelType.PurchaseLabel.ToString(), Clock.Now.ToString(SharedConst.TimeFormat),
itemPackQty).ConfigureAwait(false);
itemPackingCount).ConfigureAwait(false);
for (var i = 0; i < itemPackQty; i++)
for (var i = 0; i < itemPackingCount; i++)
{
var supplierAsnDetailInput = ObjectMapper.Map<PurchaseOrderDetail, SupplierAsnDetailInput>(purchaseOrderDetaildetail);
//添加箱码
@ -257,9 +264,6 @@ public class PurchaseOrderEventHandler
ItemPackDTO itemPackDto)
{
if (itemBasicDto == null)
{
throw new UserFriendlyException($"{supplierAsnDetail.ItemCode}零件信息为空");
}
if (supplierDto == null)
{
@ -288,6 +292,7 @@ public class PurchaseOrderEventHandler
inputLabel.RecommendLocationCode = supplierAsnDetail.RecommendErpCode;
inputLabel.Remark = supplierAsnDetail.Remark;
inputLabel.Code = supplierAsnDetail.PackingCode;
inputLabel.PlanArriveDate=supplierAsn.PlanArriveDate;
inputLabel.Qty = supplierAsnDetail.Qty;
inputLabel.Uom = supplierAsnDetail.Uom;

132
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/IssueNoteEventHandler.cs

@ -1,78 +1,78 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Domain;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading.Tasks;
//using Volo.Abp.EventBus;
//using Volo.Abp.Uow;
//using Win_in.Sfs.Shared.Event;
//using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
//namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
public class IssueNoteEventHandler
: StoreEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<IssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<IssueNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<IssueNote>>
{
private readonly IMaterialRequestManager _materialRequestManager;
//public class IssueNoteEventHandler
// : StoreEventHandlerBase
// , ILocalEventHandler<SfsCreatedEntityEventData<IssueNote>>
// , ILocalEventHandler<SfsCreatedEntityEventData<List<IssueNote>>>
// , ILocalEventHandler<SfsConfirmedEntityEventData<IssueNote>>
//{
// private readonly IMaterialRequestManager _materialRequestManager;
public IssueNoteEventHandler(
IMaterialRequestManager materialRequestManager
)
{
_materialRequestManager = materialRequestManager;
}
// public IssueNoteEventHandler(
// IMaterialRequestManager materialRequestManager
// )
// {
// _materialRequestManager = materialRequestManager;
// }
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<IssueNote> eventData)
{
var entity = eventData.Entity;
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<IssueNote> eventData)
// {
// var entity = eventData.Entity;
await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
}
// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
// }
private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity)
{
var receiveQtyGroup = entity.Details
.GroupBy(p => new { p.ItemCode, p.ToLocationCode })
.Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) })
.ToList();
// private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity)
// {
// var receiveQtyGroup = entity.Details
// .GroupBy(p => new { p.ItemCode, p.ToLocationCode })
// .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) })
// .ToList();
var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
// var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
//更新叫料请求的已收数量
foreach (var materialRequestDetail in materialRequest.Details)
{
var receiveQty = receiveQtyGroup.FirstOrDefault(p =>
p.ItemCode == materialRequestDetail.ItemCode &&
p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty;
if (receiveQty != null)
{
materialRequestDetail.ReceivedQty += receiveQty.Value;
}
}
// //更新叫料请求的已收数量
// foreach (var materialRequestDetail in materialRequest.Details)
// {
// var receiveQty = receiveQtyGroup.FirstOrDefault(p =>
// p.ItemCode == materialRequestDetail.ItemCode &&
// p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty;
// if (receiveQty != null)
// {
// materialRequestDetail.ReceivedQty += receiveQty.Value;
// }
// }
await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false);
}
// await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false);
// }
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<IssueNote> eventData)
{
var entity = eventData.Entity;
if (!entity.UseOnTheWayLocation)
{
await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
}
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<IssueNote> eventData)
// {
// var entity = eventData.Entity;
// if (!entity.UseOnTheWayLocation)
// {
// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
// }
}
// }
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<IssueNote>> eventData)
{
var entities = eventData.Entity;
foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation))
{
await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
}
}
}
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<IssueNote>> eventData)
// {
// var entities = eventData.Entity;
// foreach (var entity in entities.Where(entity => !entity.UseOnTheWayLocation))
// {
// await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false);
// }
// }
//}

57
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/ScrapNoteEventHandler.cs

@ -0,0 +1,57 @@
using System;
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.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Event.Transaction;
namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
public class ScrapNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<ScrapNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ScrapNote>>>
{
private readonly IScrapRequestManager _scrapRequestManager;
public ScrapNoteEventHandler(IScrapRequestManager scrapRequestManager)
{
_scrapRequestManager = scrapRequestManager;
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<ScrapNote> eventData)
{
var entity = eventData.Entity;
if (!string.IsNullOrEmpty(entity.ScrapRequestNumber))
{
var scrapRequest = await _scrapRequestManager.GetByNumberAsync(entity.ScrapRequestNumber)
.ConfigureAwait(false);
await _scrapRequestManager.CompleteAsync(scrapRequest).ConfigureAwait(false);
}
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<ScrapNote>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
if (string.IsNullOrEmpty(entity.ScrapRequestNumber))
{
var scrapRequest = await _scrapRequestManager.GetByNumberAsync(entity.ScrapRequestNumber)
.ConfigureAwait(false);
await _scrapRequestManager.CompleteAsync(scrapRequest).ConfigureAwait(false);
}
}
}
}

39
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ScrapRequestEventHandler.cs

@ -14,16 +14,51 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
public class ScrapRequestEventHandler
: StoreEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<ScrapRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ScrapRequest>>>
, ILocalEventHandler<SfsHandledEntityEventData<ScrapRequest>>
{
private readonly IScrapNoteAppService _scrapNoteApp;
private readonly IScrapRequestManager _scrapRequestManager;
public ScrapRequestEventHandler(
IScrapNoteAppService scrapNoteApp
)
IScrapNoteAppService scrapNoteApp,
IScrapRequestManager scrapRequestManager)
{
_scrapNoteApp = scrapNoteApp;
_scrapRequestManager = scrapRequestManager;
}
/// <summary>
/// 库移创建后
/// </summary>
/// <param name="eventData">Event data</param>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<ScrapRequest> eventData)
{
var entity = eventData.Entity;
if (entity.AutoSubmit)
{
await _scrapRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
/// <summary>
/// 库移批量创建后
/// </summary>
/// <param name="eventData">Event data</param>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<ScrapRequest>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
if (entity.AutoSubmit)
{
await _scrapRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
}
[UnitOfWork]

15
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs

@ -12,13 +12,14 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Event.Transaction;
// using Win_in.Sfs.Wms.Job.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class DeliverNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<DeliverNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<DeliverNote>>
{
private const EnumTransType TransType = EnumTransType.Deliver;
private readonly IDeliverRequestAppService _deliverRequestApp;
@ -34,6 +35,11 @@ public class DeliverNoteEventHandler
RedisDB = redisConnection.GetDatabase();
}
/// <summary>
/// 创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<DeliverNote> eventData)
{
@ -44,19 +50,18 @@ public class DeliverNoteEventHandler
await SetRequestStatusAsync(entity).ConfigureAwait(false);
}
#region 私有
private async Task AddTransactionsAsync(DeliverNote deliverNote)
{
//如果WMS管理客户寄售库,生成库存转移
if (await SettingManager.IsTrueAsync(StoreSettings.Common.EnableCustomerLocation).ConfigureAwait(false))
{
var transferLogs = BuildTransferLogs(deliverNote);
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
else //如果WMS不管理客户寄售库,生成出库
{
var transactions = BuildTransactions(deliverNote);
await TransactionAppService.AddManyAsync(transactions).ConfigureAwait(false);
}
@ -151,4 +156,6 @@ public class DeliverNoteEventHandler
return EnumTransSubType.None;
}
}
#endregion
}

255
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/IssueNoteEventHandler.cs

@ -4,119 +4,156 @@ using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.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;
using Win_in.Sfs.Wms.Store.Event.Transactions;
namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class IssueNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<IssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<IssueNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<IssueNote>>
namespace Win_in.Sfs.Wms.Store.Event.BusinessNote
{
private const EnumTransType TransType = EnumTransType.Issue;
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<IssueNote> eventData)
{
var entity = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<IssueNote>> eventData)
{
var entities = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
//如果要做库存事务汇总,可以修改此处
foreach (var issueNote in entities)
{
var route = issueNote.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route).ConfigureAwait(false));
}
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<IssueNote> eventData)
{
var entity = eventData.Entity;
var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination).ConfigureAwait(false);
await AddTransferLogsAsync(inputList).ConfigureAwait(false);
}
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList)
{
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(inputList);
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in issueNote.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map<IssueNoteDetail, TransferLogEditInput>(detail);
if (issueNote.UseOnTheWayLocation)
{
var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
switch (route)
{
case EnumTransferRoute.SourceToOnTheWay:
detail.ToLocationCode = detail.OnTheWayLocationCode;
detail.ToLocationErpCode = location.ErpLocationCode;
detail.ToWarehouseCode = location.WarehouseCode;
break;
case EnumTransferRoute.OnTheWayToDestination:
detail.FromLocationCode = detail.OnTheWayLocationCode;
detail.FromLocationErpCode = location.ErpLocationCode;
detail.FromWarehouseCode = location.WarehouseCode;
break;
case EnumTransferRoute.SourceToDestination:
default:
throw new ArgumentOutOfRangeException(nameof(route), route, null);
}
}
if (issueNote.UseOnTheWayLocation)
{
transferLog.FromLocationCode = detail.OnTheWayLocationCode;
var location = await LocationAclService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
transferLog.FromLocationGroup = location.LocationGroupCode;
transferLog.FromLocationArea = location.AreaCode;
transferLog.FromLocationErpCode = location.ErpLocationCode;
}
transferLog.TransType = TransType;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(issueNote.RequestType);
transferLog.Worker = issueNote.Worker;
transferLog.DocNumber = issueNote.Number;
transferLog.JobNumber = issueNote.JobNumber;
transferLogs.Add(transferLog);
}
return transferLogs;
}
//public class IssueNoteEventHandler
// : StoreEventHandlerBase
// , ILocalEventHandler<SfsCreatedEntityEventData<IssueNote>>
// , ILocalEventHandler<SfsCreatedEntityEventData<List<IssueNote>>>
// , ILocalEventHandler<SfsConfirmedEntityEventData<IssueNote>>
//{
// private const EnumTransType TransType = EnumTransType.Issue;
// private readonly Itranlog
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<IssueNote> eventData)
// {
// var entity = eventData.Entity;
// var transferLogs = new List<TransferLogEditInput>();
// var route = entity.UseOnTheWayLocation
// ? EnumTransferRoute.SourceToOnTheWay
// : EnumTransferRoute.SourceToDestination;
// //如果是mes拉动 先发到在途
// if (entity.RequestType == EnumMaterialRequestType.Issue_WIP.ToString())
// {
// route = EnumTransferRoute.SourceToOnTheWay;
// }
// transferLogs.AddRange(await BuildTransferLogsAsync(entity, route));
// await TransferLogAppService.AddManyAsync(transferLogs);
// }
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<IssueNote>> eventData)
// {
// var entities = eventData.Entity;
// var transferLogs = new List<TransferLogCreateInput>();
// //如果要做库存事务汇总,可以修改此处
// foreach (var issueNote in entities)
// {
// var route = issueNote.UseOnTheWayLocation
// ? EnumTransferRoute.SourceToOnTheWay
// : EnumTransferRoute.SourceToDestination;
// transferLogs.AddRange(await BuildTransferLogsAsync(issueNote, route));
// }
// await TransferLogAppService.AddManyAsync(transferLogs);
// }
// [UnitOfWork]
// public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<IssueNote> eventData)
// {
// var entity = eventData.Entity;
// var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination);
// await AddTransferLogsAsync(inputList);
// }
// private async Task AddTransferLogsAsync(List<TransferLogCreateInput> inputList)
// {
// var transferLogs = new List<TransferLogCreateInput>();
// transferLogs.AddRange(inputList);
// await TransferLogAppService.AddManyAsync(transferLogs);
// }
// private async Task<List<TransferLogCreateInput>> BuildTransferLogsAsync(IssueNote issueNote, EnumTransferRoute route)
// {
// var transferLogs = new List<TransferLogCreateInput>();
// foreach (var detail in issueNote.Details.Where(detail => detail.Qty.Qty != 0))
// {
// var transferLog = ObjectMapper.Map<IssueNoteDetail, TransferLogCreateInput>(detail);
// LocationDTO fromLocationDTO = null;
// LocationDTO toLocationDTO = null;
// if (issueNote.UseOnTheWayLocation)
// {
// var location = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode);
// switch (route)
// {
// case EnumTransferRoute.SourceToOnTheWay:
// fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode);
// toLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode);
// break;
// case EnumTransferRoute.OnTheWayToDestination:
// fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.OnTheWayLocationCode);
// toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode);
// await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog);
// break;
// case EnumTransferRoute.SourceToDestination:
// default:
// throw new ArgumentOutOfRangeException(nameof(route), route, null);
// }
// }
// else
// {
// fromLocationDTO = await LocationAppService.GetByCodeAsync(detail.FromLocationCode);
// toLocationDTO = await LocationAppService.GetByCodeAsync(detail.ToLocationCode);
// }
// transferLog.FromLocationCode = fromLocationDTO.Code;
// transferLog.FromLocationArea = fromLocationDTO.AreaCode;
// transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
// transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
// transferLog.ToLocationCode = toLocationDTO.Code;
// transferLog.ToLocationArea = toLocationDTO.AreaCode;
// transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
// transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
// transferLog.TransType = TransType;
// transferLog.TransSubType = Enum.Parse<EnumTransSubType>(issueNote.RequestType);
// transferLog.Company = issueNote.Company;
// transferLog.Worker = issueNote.Worker;
// transferLog.DocNumber = issueNote.Number;
// transferLog.JobNumber = issueNote.JobNumber;
// transferLogs.Add(transferLog);
// }
// return transferLogs;
// }
// private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogCreateInput transferLogCreateInput)
// {
// transferLogCreateInput.ToPackingCode = "";
// transferLogCreateInput.ToLot = "";
// transferLogCreateInput.ToContainerCode = "";
// transferLogCreateInput.FromPackingCode = "";
// transferLogCreateInput.FromLot = "";
// transferLogCreateInput.FromContainerCode = "";
// }
//}
}

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ScrapNoteEventHandler.cs

@ -17,37 +17,26 @@ namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class ScrapNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<ScrapNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ScrapNote>>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ScrapNote>>>
{
private const EnumTransType TransType = EnumTransType.Scrap;
private readonly IScrapRequestAppService _scrapRequestApp;
public ScrapNoteEventHandler(IScrapRequestAppService scrapRequestApp)
{
_scrapRequestApp = scrapRequestApp;
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<ScrapNote> eventData)
{
var entity = eventData.Entity;
await AddTransactionsAsync(new List<ScrapNote>() { entity }).ConfigureAwait(false);
if (!string.IsNullOrEmpty(entity.ScrapRequestNumber))
{
await _scrapRequestApp.CompleteByNumberAsync(entity.ScrapRequestNumber).ConfigureAwait(false);
}
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<ScrapNote>> eventData)
{
var entities = eventData.Entity;
await AddTransactionsAsync(entities).ConfigureAwait(false);
}
#region 私有
private async Task AddTransactionsAsync(List<ScrapNote> scrapNotes)
{
@ -112,4 +101,5 @@ public class ScrapNoteEventHandler
return transactions;
}
#endregion
}

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

@ -122,10 +122,10 @@
"BaseUrl": "http://dev.ccwin-in.com:21292/"
},
"Inventory": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://localhost:59095/"
},
"Job": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://localhost:59095/"
},
"Label": {
"BaseUrl": "http://dev.ccwin-in.com:21292/"
@ -134,7 +134,7 @@
"BaseUrl": "http://dev.ccwin-in.com:21292/"
},
"Store": {
"BaseUrl": "http://dev.ccwin-in.com:21295/"
"BaseUrl": "http://localhost:59095/"
}
},
"Serilog": {

Loading…
Cancel
Save