| | |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StockRepository; |
| | | using static Org.BouncyCastle.Pqc.Crypto.Utilities.PqcOtherInfoGenerator; |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | FeedbackInboundOrder(inboundOrder); |
| | | FeedbackInboundOrder(inboundOrder.Id); |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | /// 鍏ュ簱瀹屾垚涓婃姤ERP |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedbackInboundOrder(Dt_InboundOrder inboundOrder) |
| | | public WebResponseContent FeedbackInboundOrder(int inboundOrderId) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.Id == inboundOrderId).Includes(x => x.Details).First(); |
| | | if (inboundOrder.Details.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"鏈壘鍒板叆搴撳崟鏄庣粏淇℃伅"); |
| | |
| | | .Select(mg => new ReturnPickItem |
| | | { |
| | | Material = mg.Key, |
| | | Qty = mg.Sum(x => x.Qty), |
| | | Qty = mg.Sum(x => x.ReturnQty), |
| | | Dataitem = mg.Select(d => new ReturnDataItem |
| | | { |
| | | Lotno = d.BatchNo, |
| | | Qty = d.Qty, |
| | | Qty = d.ReturnQty, |
| | | Location = warehouse.WarehouseCode, |
| | | Msfpart = d.Code |
| | | }).ToList() |
| | |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// 鎴愬搧鍏ュ簱涓婁紶ERP |
| | | /// </summary> |
| | | public WebResponseContent FeedbackProIn(Dt_MesProInOrder mesProInOrder) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<ERPProItemsItem> proItemsItems = new List<ERPProItemsItem>(); |
| | | foreach (var item in mesProInOrder.Details) |
| | | { |
| | | ERPProItemsItem proItemsItem = new ERPProItemsItem() |
| | | { |
| | | PartNum = item.ProductCode, |
| | | Rev=item.ProductVersion, |
| | | DateCode=item.DateCode, |
| | | BatchNumber= item.BagNo, |
| | | XLocation=item.XSite, |
| | | Xqty=item.XQty, |
| | | QtySet=item.SETQty, |
| | | QtyPcs=item.OKPCSQTY, |
| | | WoList=new List<ERPProListItem>() |
| | | { |
| | | new ERPProListItem() |
| | | { |
| | | moNumber=item.MoNumber, |
| | | WoNumber=item.ERPOrder, |
| | | QtyPcs=item.OKPCSQTY, |
| | | QtySet=item.SETQty |
| | | } |
| | | } |
| | | }; |
| | | proItemsItems.Add(proItemsItem); |
| | | } |
| | | ERPProInboundModel proInboundModel = new ERPProInboundModel() |
| | | { |
| | | Way = 1, |
| | | Code = mesProInOrder.ProInOrderNo, |
| | | CreatorCode = "GSWMS", |
| | | CompanyCode = "HATC", |
| | | FactoryCode = "HA02", |
| | | WarehouseCode = "HA71", |
| | | LocationCode = "HA71", |
| | | StockDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | StockFormType= "Production", |
| | | StockFormItems= proItemsItems |
| | | }; |
| | | _invokeERPService.InvokeProInApi(proInboundModel); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | static object lock_code = new object(); |
| | | public string CreateCodeByRule(string ruleCode) |
| | | { |