From b513ce3a4527e998da66c6f179a279472c7262a8 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 18 十一月 2025 10:59:46 +0800
Subject: [PATCH] 代码更新优化
---
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutStockLockInfoService.cs | 127 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 127 insertions(+), 0 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutStockLockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutStockLockInfoService.cs"
new file mode 100644
index 0000000..293bc15
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_OutboundService/OutStockLockInfoService.cs"
@@ -0,0 +1,127 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Common.StockEnum;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Enums;
+using WIDESEA_Core.Helper;
+using WIDESEA_IOutboundRepository;
+using WIDESEA_IRecordService;
+using WIDESEA_IStockService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IOutboundService
+{
+ public partial class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
+ {
+
+ private readonly IStockService _stockService;
+ private readonly IRecordService _recordService;
+
+ public IOutStockLockInfoRepository Repository => BaseDal;
+ public IUnitOfWorkManage _unitOfWorkManage;
+
+ public OutStockLockInfoService(IOutStockLockInfoRepository BaseDal, IStockService stockService, IRecordService recordService, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
+ {
+ _recordService = recordService;
+ _stockService = stockService;
+ _unitOfWorkManage = unitOfWorkManage;
+ }
+
+
+ public List<Dt_OutStockLockInfo> GetByOrderDetailId(string orderNo, int orderDetailId, OutLockStockStatusEnum? outStockStatus)
+ {
+ return BaseDal.QueryData(x =>x.OrderNo== orderNo && x.OrderDetailId == orderDetailId && outStockStatus == null ? true : x.Status == outStockStatus.ObjToInt());
+ }
+
+ /// <summary>
+ /// 鐢熸垚鍑哄簱璇︽儏
+ /// </summary>
+ public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutBSTOrder outBSTOrder, Dt_OutBSTOrderDetail outboundOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null)
+ {
+ Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
+ {
+ PalletCode = outStock.PalletCode,
+ AssignQuantity = assignQuantity,
+ MaterielCode = outboundOrderDetail.MaterialNo,
+ BatchNo = "",
+ LocationCode = outStock.LocationCode,
+ MaterielName = outStock.MaterielName,
+ OrderDetailId = outboundOrderDetail.Id,
+ OrderNo = outBSTOrder.OutBSTOrderNo,
+ MaterielId = outStock.MaterielId,
+ OriginalQuantity = outStock.StockLength,
+ Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(),
+ StockId = outStock.Id,
+ TaskNum = taskNum,
+ OrderQuantity = outboundOrderDetail.XqLen,
+ Unit = outStock.Unit
+ };
+
+ return outStockLockInfo;
+ }
+ /// <summary>
+ /// 鐢熸垚MES鍑哄簱璇︽儏
+ /// </summary>
+ public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutMESOrder ouMESOrder, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null)
+ {
+ Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
+ {
+ PalletCode = outStock.PalletCode,
+ AssignQuantity = assignQuantity,
+ MaterielCode = ouMESOrder.MaterialCode,
+ BatchNo = ouMESOrder.MaterialLot,
+ LocationCode = outStock.LocationCode,
+ MaterielName = outStock.MaterielName,
+ OrderDetailId = ouMESOrder.OutDetailId,
+ OrderNo = ouMESOrder.OutMESOrderNo,
+ MakeCode = ouMESOrder.MakeCode,
+ MachineName=ouMESOrder.MakeArea.ToString(),
+ MaterielId = outStock.MaterielId,
+ OriginalQuantity = outStock.StockLength,
+ Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(),
+ StockId = outStock.Id,
+ TaskNum = taskNum,
+ OrderQuantity = ouMESOrder.ReqQuantity,
+ Unit = outStock.Unit
+ };
+
+ return outStockLockInfo;
+ }
+ /// <summary>
+ /// 鐢熸垚鐢熺鍑哄簱璇︽儏
+ /// </summary>
+ public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutSGOrder outSGOrder, Dt_OutSGOrderDetail outSGOrderDetail, Dt_StockInfo outStock, decimal assignQuantity, int? taskNum = null)
+ {
+ Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
+ {
+ PalletCode = outStock.PalletCode,
+ AssignQuantity = assignQuantity,
+ OrderType=OutOrderTypeEnum.OutSGPick.ObjToInt(),
+ MaterielCode = outSGOrderDetail.MaterialNo,
+ BatchNo = outSGOrderDetail.BoardFluteNo, //妤炲埆鎵规
+ LocationCode = outStock.LocationCode,
+ MaterielName = outStock.MaterielName,
+ OrderDetailId = outSGOrderDetail.Id,
+ OrderNo = outSGOrder.OrderId,
+ MaterielId = outStock.MaterielId,
+ OriginalQuantity = outStock.StockLength,
+ Status = taskNum == null ? OutLockStockStatusEnum.宸插垎閰�.ObjToInt() : OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt(),
+ StockId = outStock.Id,
+ TaskNum = taskNum,
+ OrderQuantity = outSGOrderDetail.XqLen,
+ MaterialWeight=outStock.MaterielWeight,
+ MaterialWide=outStock.MaterielWide,
+ Unit = outStock.Unit,
+ MachineName=outSGOrderDetail.MachineName,
+ };
+
+ return outStockLockInfo;
+ }
+ }
+}
--
Gitblit v1.9.3