From 516e36a4748cc5863bc1f0e00fef32062dcf7cde Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期四, 26 十二月 2024 21:56:24 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs |   71 +++++++++++++++++++++++++++++++++--
 1 files changed, 66 insertions(+), 5 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
index 0769450..a65c399 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
@@ -1,4 +1,5 @@
 锘縰sing AutoMapper;
+using MailKit.Search;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Serialization;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
@@ -41,17 +42,19 @@
         private readonly IStockInfoRepository _stockInfoRepository;
         public IOutboundOrderRepository Repository => BaseDal;
         private readonly IInvokeERPService _invokeERPService;
+        private readonly IOutStockLockInfoService _outStockLockInfoService;
 
         public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper,IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockInfoService stockInfoService,
-          IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService) : base(BaseDal)
+          IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService, IOutStockLockInfoService outStockLockInfoService) : base(BaseDal)
         {
             _mapper = mapper;
-            _unitOfWorkManage=unitOfWorkManage;
+            _unitOfWorkManage = unitOfWorkManage;
             _basicService = basicService;
             _outboundOrderDetailRepository = outboundOrderDetailRepository;
             _stockInfoService = stockInfoService;
             _stockInfoRepository = stockInfoRepository;
             _invokeERPService = invokeERPService;
+            _outStockLockInfoService = outStockLockInfoService;
         }
 
         public WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model)
@@ -136,6 +139,7 @@
 
                         Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder()
                         {
+                            OrderNo=model.OrderNo,
                             UpperOrderNo = model.OrderNo,
                             OrderStatus = OutOrderStatusEnum.鏈紑濮�.ObjToInt(),
                             OrderType = OutOrderTypeEnum.Issue.ObjToInt(),
@@ -213,6 +217,63 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        //涓婃姤鍑哄簱瀹屾垚
+        public WebResponseContent TestOutUpload(int id)
+        {
+            try
+            {
+                Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x=>x.Id==id).Includes(x=>x.Details).First();
+                Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == outboundOrder.WarehouseId);
+                //娴嬭瘯鏋跺簱缁橢RP涓婃姤鍑哄簱瀹屾垚
+                ERPPickItemModel eRPOutPick = new ERPPickItemModel()
+                {
+                    Lotno = "20241226001",
+                    Qty = "5",
+                    Location = warehouse.WarehouseCode
+                };
+                ERPPickModel pickModel = new ERPPickModel()
+                {
+                    Rowindex = outboundOrder.Details[0].RowNo,
+                    Material = outboundOrder.Details[0].MaterielCode,
+                    Qty = (outboundOrder.Details[0].OrderQuantity.ObjToInt()).ToString(),
+                    Dataitem=new List<ERPPickItemModel> { eRPOutPick }
+                };
+                
+                ERPIssueItemModel issueItemModel = new ERPIssueItemModel()
+                {
+                    Pickcode = outboundOrder.UpperOrderNo,
+                    PickList = new List<ERPPickModel>() { pickModel }
+                };
+                ERPIssueModel issueModel = new ERPIssueModel()
+                {
+                    UniqueTag = id.ToString(),
+                    Code = "FL20241226001",
+                    WarehouseCode = warehouse.WarehouseCode,
+                    Docremark = "",
+                    Deptno = "F2HAECZSQZ",
+                    Deptname = "娣畨浜屽巶鍒朵笁鍖洪樆鐒�",
+                    Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                    Createuser = "TC20082",
+                    Issitem = new List<ERPIssueItemModel>() { issueItemModel },
+                };
+                string response = _invokeERPService.InvokeOutStandardsApi(issueModel);
+                ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>();
+                if (requestContent.res == 1)
+                {
+
+                    return WebResponseContent.Instance.OK(requestContent.Data);
+                }
+                else
+                {
+                    return WebResponseContent.Instance.Error(requestContent.Data);
+                }
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+            return WebResponseContent.Instance.OK();
+        }
         /// <summary>
         /// 鏇存敼鍑哄簱鍗曞簱瀛樼姸鎬�
         /// </summary>
@@ -250,13 +311,13 @@
                 List<ERPOutPickDetail> pickDetails = stockInfos.Select(x => new ERPOutPickDetail()
                 {
                     Lotno = x.Details[0].BatchNo,
-                    Qty = x.Details[0].StockQuantity
+                    Qty = x.Details[0].StockQuantity.ObjToInt()
                 }).ToList();
                 ERPOutPick outPick = new ERPOutPick()
                 {
                     Rowindex = model.RowNo,
                     Material = model.MCode,
-                    Qty = model.Qty,
+                    Qty = model.Qty.ObjToInt(),
                     Dataitem = pickDetails
                 };
                 ERPOutboundModel inboundModel = new ERPOutboundModel()
@@ -268,7 +329,7 @@
                     Docremark = "",
                     Deptno = model.DepartmentCode,
                     DeptName = model.DepartmentName,
-                    Createtime = DateTime.Now,
+                    Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     Createuser = "WMS",
                     Picklist = new List<ERPOutPick>() { outPick },
                 };

--
Gitblit v1.9.3