wxw
2 天以前 950fac9fd7b9477fc2bbe3253d217f62ac7608e5
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -4,12 +4,14 @@
using Model.ModelDto.SysDto;
using Model.ModelVm;
using Model.ModelVm.SysVm;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Utility.Tools;
using WMS.BLL.LogServer;
using WMS.DAL;
using WMS.Entity.BllAsnEntity;
@@ -1324,6 +1326,7 @@
                    var detailModel = new BllArrivalNoticeDetail()
                    {
                        OrderDetailCode = asnDetailModel.lineNo,
                        ASNNo = asnNo,
                        SkuNo = asnDetailModel.skuNo.ToString(),
                        SkuName = skuModel.SkuName,
@@ -1334,9 +1337,9 @@
                        FactQty = 0,
                        CompleteQty = 0,
                        PackagNo = skuModel.PackagNo,
                        SupplierLot = asnDetailModel.supplyBatch,//生产日期
                        Lot1 = asnDetailModel.productionDate,//过期日期
                        Lot2 = asnDetailModel.expireDate,
                        SupplierLot = asnDetailModel.supplyBatch,
                        Lot1 = asnDetailModel.productionDate,//生产日期
                        Lot2 = asnDetailModel.expireDate,//过期日期
                        Status = "0",
                        IsSampling = "0",
                        InspectStatus = "0",
@@ -1389,28 +1392,39 @@
                {
                    throw new Exception("复核失败,复核人员和关闭订单人员不能相同!");
                }
                var list = new List<AsnDetail>();
                var list = new List<BackAsnDetail>();
                foreach (var d in detail)
                {
                    var item = new AsnDetail()
                    var mater = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == d.SkuNo);
                    if (mater == null)
                    {
                        SkuNo = d.SkuNo,
                        LotNo = d.LotNo,
                        Qty = d.CompleteQty,
                        PackagNo = d.PackagNo,
                        SupplierLot = d.SupplierLot
                        throw new Exception($"复核失败,物料编码:{d.SkuNo}的物料信息不存在");
                    }
                    var item = new BackAsnDetail()
                    {
                        POSNR=d.OrderDetailCode,
                        MATNR = d.SkuNo,
                        MAKTX=d.SkuName,
                        LFIMG = d.CompleteQty.ToString(),
                        MEINS= mater.UnitNo,
                        CHARG = d.LotNo,
                        HSDAT = d.Lot1,
                        VFDAT = d.Lot2
                    };
                    list.Add(item);
                }
                var soInfo = new AsnInfo()
                var soInfo = new BackAsnVm()
                {
                    OrderCode = notice.OrderCode,
                    AsnDetails = list
                    ZUUID = Guid.NewGuid().ToString(),
                    VBELN = notice.OrderCode,
                    LFART = notice.Type,
                    WADAT_IST = Convert.ToDateTime(notice.CompleteTime).ToString("yyyy-MM-dd"),
                    ITEM = list
                };
                #region 通过接口发送至erp 
                //系统对接后放开
                /*var jsonData = JsonConvert.SerializeObject(soInfo);
                var jsonData = JsonConvert.SerializeObject(soInfo);
                var response = HttpHelper.DoPost(url, jsonData, "入库单完成上传", "ERP");
@@ -1418,7 +1432,7 @@
                if (obj.Success != 0)
                {
                    throw new Exception("上传失败" + obj.Message);
                }*/
                }
                #endregion
                notice.Status = "4";