From 07774c70a65bed6bacf936bdd66f756ba9c7f266 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期二, 02 十二月 2025 10:15:48 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 72 +++++++++++++++++++++++++++++++----
1 files changed, 63 insertions(+), 9 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 6e8308a..29f446f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -27,6 +27,7 @@
using System.Reflection.Emit;
using System.Threading.Tasks;
using System.Xml.Linq;
+using WIDESEA_Common.AllocateEnum;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.OrderEnum;
@@ -51,6 +52,7 @@
using WIDESEA_IStockService;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Check;
using WIDESEA_Model.Models.Outbound;
namespace WIDESEA_TaskInfoService
@@ -64,8 +66,11 @@
private readonly IRepository<Dt_StockInfo> _stockRepository;
private readonly ILocationInfoService _locationInfoService;
private readonly IInboundOrderService _inboundOrderService;
- private readonly IInboundOrderDetailService _inboundOrderDetailService;
+ private readonly IInboundOrderDetailService _inboundOrderDetailService;
+ private readonly IRepository<Dt_AllocateOrderDetail> _allocateOrderDetailRepository;
+ private readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
+ private readonly IRepository<Dt_ReCheckOrder> _reCheckOrderRepository;
private readonly IRepository<Dt_OutboundBatch> _OutboundBatchRepository;
private readonly IOutboundOrderService _outboundOrderService;
private readonly IOutboundOrderDetailService _outboundOrderDetailService;
@@ -95,7 +100,7 @@
public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
- public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository) : base(BaseDal)
+ public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository) : base(BaseDal)
{
_mapper = mapper;
_unitOfWorkManage = unitOfWorkManage;
@@ -114,6 +119,9 @@
_outStockLockInfoService = outStockLockInfoService;
_allocateService = allocateService;
_OutboundBatchRepository = outboundBatchRepository;
+ _reCheckOrderRepository = reCheckOrderRepository;
+ _allocateOrderDetailRepository = allocateOrderDetailRepository;
+ _allocateOrderRepository = allocateOrderRepository;
}
@@ -282,7 +290,7 @@
{
ReqCode = Guid.NewGuid().ToString(),
ReqTime = DateTime.Now.ToString(),
- BusinessType = "3",
+ BusinessType = BusinessTypeEnum.澶栭儴浠撳簱璋冩櫤浠�.ObjToInt().ToString(),
FactoryArea = inboundOrder.FactoryArea,
OperationType = 1,
Operator = inboundOrder.Operator,
@@ -293,7 +301,7 @@
};
- var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
+ var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
.Select(group => new AllocateDtoDetail
{
MaterialCode = group.Key.MaterielCode,
@@ -308,7 +316,7 @@
Qty = row.BarcodeQty,
BatchNo = row.BatchNo,
SupplyCode = row.SupplyCode,
- Unit = row.Unit
+ Unit = row.BarcodeUnit
}).ToList()
}).ToList();
allocatefeedmodel.Details = groupedData;
@@ -331,7 +339,53 @@
{
_logger.LogInformation($"InboundTaskCompleted 鍥炲啓MES : {inboundOrder.InboundOrderNo } ,ordertype: {InOrderTypeEnum.InternalAllocat.ObjToInt()} " );
// BusinessTypeEnum.鏅轰粨璋冩櫤浠�
+ if (inboundOrder != null && inboundOrder.OrderStatus == InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt())
+ {
+ var allocate = _allocateService.Repository.QueryData(x => x.OrderNo == inboundOrder.InboundOrderNo).First();
+ var allocatefeedmodel = new AllocateDto
+ {
+ ReqCode = Guid.NewGuid().ToString(),
+ ReqTime = DateTime.Now.ToString(),
+ BusinessType = BusinessTypeEnum.鏅轰粨璋冩櫤浠�.ObjToInt().ToString(),
+ FactoryArea = inboundOrder.FactoryArea,
+ OperationType = 1,
+ Operator = inboundOrder.Operator,
+ OrderNo = inboundOrder.UpperOrderNo,
+ fromWarehouse = allocate?.FromWarehouse ?? "",
+ toWarehouse = allocate?.ToWarehouse ?? "",
+ Details = new List<AllocateDtoDetail>()
+ };
+
+ var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
+ .Select(group => new AllocateDtoDetail
+ {
+ MaterialCode = group.Key.MaterielCode,
+ LineNo = group.Key.lineNo,
+ WarehouseCode = group.Key.WarehouseCode,
+ Qty = group.Sum(x => x.BarcodeQty),
+ // warehouseCode= "1072",
+ Unit = group.Key.BarcodeUnit,
+ Barcodes = group.Select(row => new BarcodeInfo
+ {
+ Barcode = row.Barcode,
+ Qty = row.BarcodeQty,
+ BatchNo = row.BatchNo,
+ SupplyCode = row.SupplyCode,
+ Unit = row.BarcodeUnit
+ }).ToList()
+ }).ToList();
+ allocatefeedmodel.Details = groupedData;
+
+ var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
+ if (result != null && result.code == 200)
+ {
+ _inboundOrderService.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
+ _inboundOrderDetailService.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
+ .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+ }
+ }
}
else
@@ -629,7 +683,7 @@
{
ReqCode = Guid.NewGuid().ToString(),
ReqTime = DateTime.Now.ToString(),
- BusinessType = "3",
+ BusinessType = "2",
FactoryArea = outboundOrder.FactoryArea,
OperationType = 1,
Operator = outboundOrder.Operator,
@@ -653,10 +707,9 @@
var detailModel = new AllocateDtoDetail
{
MaterialCode = detail.MaterielCode,
- LineNo = detail.lineNo, // 娉ㄦ剰锛氳繖閲屽彲鑳介渶瑕佽皟鏁村瓧娈靛悕
+ LineNo = detail.lineNo,
WarehouseCode = detail.WarehouseCode,
- Qty = detail.OverOutQuantity, // 浣跨敤璁㈠崟鏄庣粏鐨勫凡鍑哄簱鏁伴噺
- //currentDeliveryQty = detail.OverOutQuantity,
+ Qty = detailLocks.Sum(x=>x.BarcodeQty),
Unit = detail.Unit,
Barcodes = detailLocks.Select(lockInfo => new BarcodeInfo
{
@@ -670,6 +723,7 @@
allocatefeedmodel.Details.Add(detailModel);
}
+
var result = await _invokeMESService.FeedbackAllocate(allocatefeedmodel);
if (result != null && result.code == 200)
{
--
Gitblit v1.9.3