| | |
| | | using static HH.WCS.Mobox3.pinggao.models.DAPING; |
| | | using HH.WCS.Mobox3.pinggao.util; |
| | | using SqlSugar; |
| | | using System.Diagnostics; |
| | | |
| | | namespace HH.WCS.Mobox3.pinggao.api |
| | | { |
| | |
| | | { |
| | | #region xml数据接收转数组 |
| | | |
| | | LogHelper.Info("供应商接收接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //LogHelper.Info("供应商接收接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | |
| | | { |
| | | #region xml数据接收转数组 |
| | | |
| | | LogHelper.Info("生产订单接收接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //LogHelper.Info("生产订单接收接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | |
| | | [HttpPost] |
| | | public WLReturnRoot.Root MaterReceiveXmlData([FromBody] MaterDto.Root xmlData) |
| | | { |
| | | #region xml数据接收转数组 |
| | | |
| | | LogHelper.Info("物料接收接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | | //xmlDoc.LoadXml(xmlData.ToString()); |
| | | |
| | | //// 将 XmlDocument 转换为 JSON 字符串 |
| | | //JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc)); |
| | | |
| | | //// 处理特定字段,强制转换为数组 |
| | | //WmsSpaHelper.EnsureArrayFormats(jsonObject, "ITEM"); |
| | | //// 反序列化为RootWithArray |
| | | //var data = JsonConvert.DeserializeObject<MaterDto.Root>(jsonObject.ToString()); |
| | | #endregion |
| | | |
| | | |
| | | #region 外采入库业务流程 |
| | | WLReturnRoot.Root simpleResult = WmsSpaHelper.Mater_In(xmlData); |
| | | //接收返回参数 生成sap对接文档返回格式 |
| | | //var json = WmsSpaHelper.GetJsonResult(simpleResult.WLPZBH, simpleResult.resultCode.ToString(), simpleResult.resultMsg); |
| | | |
| | | //#endregion |
| | | //#region 返回xml |
| | | //string xml = JsonConvert.DeserializeXmlNode(json, "root").OuterXml; |
| | | ////返回json |
| | | //var response = new HttpResponseMessage() |
| | | //{ |
| | | // Content = new StringContent(xml, Encoding.UTF8, "application/xml") |
| | | //}; |
| | | //return response; |
| | | |
| | | |
| | | var json = JsonConvert.SerializeObject(simpleResult); |
| | | return simpleResult; |
| | |
| | | public WcReturnRoot.Root WCReceiveXmlData([FromBody] SapRoot.Root xmlData) |
| | | { |
| | | #region xml数据接收转数组 |
| | | LogHelper.Info("外采收货接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //LogHelper.Info("外采收货接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | | //xmlDoc.LoadXml(xmlData.ToString()); |
| | |
| | | |
| | | //NcDto.ROOT rOOT = new NcDto.ROOT(); |
| | | //rOOT.WLPZ = new NcDto.WLPZ(); |
| | | LogHelper.Info("内采收货接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //LogHelper.Info("内采收货接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xmloo |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | |
| | | [HttpPost] |
| | | public OtherReturnRoot.Root OtherReceiveXmlData([FromBody] otherDto.Root xmlData) |
| | | { |
| | | #region xml数据接收转数组 |
| | | LogHelper.Info("其他出入库sap接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | | //xmlDoc.LoadXml(xmlData.ToString()); |
| | | |
| | | //// 将 XmlDocument 转换为 JSON 字符串 |
| | | //JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc)); |
| | | |
| | | //// 处理特定字段,强制转换为数组 |
| | | //WmsSpaHelper.EnsureArrayFormat(jsonObject, "ITEM", "ITEM1"); |
| | | //// 反序列化为RootWithArray |
| | | //var data = JsonConvert.DeserializeObject<otherDto.Root>(jsonObject.ToString()); |
| | | #endregion |
| | | |
| | | #region 其他出入库业务流程 |
| | | List<SimpleResult> simpleResult = WmsSpaHelper.Otherbound_Order_In(xmlData); |
| | | //接收返回参数 生成sap对接文档返回格式 |
| | | //var json = WmsSpaHelper.GetJsonResult(simpleResult.WLPZBH, simpleResult.resultCode.ToString(), simpleResult.resultMsg); |
| | | |
| | | #endregion |
| | | #region 返回xml |
| | | //string xml = JsonConvert.DeserializeXmlNode(json, "ROOT").OuterXml; |
| | | ////返回json |
| | | //var response = new HttpResponseMessage() |
| | | //{ |
| | | // Content = new StringContent(xml, Encoding.UTF8, "application/xml") |
| | | //}; |
| | | //return response; |
| | | #endregion |
| | | List<OtherReturnRoot.ITEM> wcReturnRoots = new List<OtherReturnRoot.ITEM>(); |
| | | foreach (var item in simpleResult) |
| | |
| | | wcReturnRoot.MSGDESP = item.resultMsg; |
| | | wcReturnRoots.Add(wcReturnRoot); |
| | | } |
| | | //var json = WmsSpaHelper.GetJsonResult(simpleResult.WLPZBH, simpleResult.resultCode.ToString(), simpleResult.resultMsg); |
| | | // 完整嵌套实例化 |
| | | var result = new OtherReturnRoot.Root |
| | | { |
| | | ROOT = new OtherReturnRoot.ROOT |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// pda分拣完整版 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public Task<SimpleResult> AllOutboundOrderSorting(FJSorting model) |
| | | { |
| | | return WmsSpaHelper.ALLOutboundOrderSorting(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// pda分拣 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | |
| | | { |
| | | return WmsSpaHelper.OutboundOrderSorting(model); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 回库 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public Task<SimpleResult> HkGet(HuiK model) |
| | | { |
| | | return WmsSpaHelper.HkGets(model); |
| | | } |
| | | /// <summary> |
| | | /// 空托出入库 |
| | | /// </summary> |
| | |
| | | [HttpPost] |
| | | public LLDReturnRoot.Root LLDReceiveXmlData([FromBody] CKDdto.Root xmlData) |
| | | { |
| | | //Stopwatch sw = new Stopwatch(); |
| | | //sw.Start(); |
| | | #region xml数据接收转数组 |
| | | LogHelper.Info("生产订单领料单(生成领料单)接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | //LogHelper.Info("生产订单领料单(生成领料单)接口:" + JsonConvert.SerializeObject(xmlData)); |
| | | |
| | | ////接收xml数据 |
| | | //XmlDocument xmlDoc = new XmlDocument(); |
| | | //xmlDoc.LoadXml(xmlData.ToString()); |
| | | |
| | | //// 将 XmlDocument 转换为 JSON 字符串 |
| | | //JObject jsonObject = JsonConvert.DeserializeObject<JObject>(JsonConvert.SerializeXmlNode(xmlDoc)); |
| | | |
| | | //// 处理特定字段,强制转换为数组 |
| | | |
| | | ////WmsSpaHelper.EnsureArrayFormat(jsonObject, "ITME"); |
| | | //WmsSpaHelper.EnsureArrayFormat(jsonObject["ROOT"]["SCDDLL"] as JObject, "ITEM"); |
| | | //// 反序列化为RootWithArray |
| | | //var data = JsonConvert.DeserializeObject<CKDdto.Root>(jsonObject.ToString()); |
| | | #endregion |
| | | |
| | | #region 出库业务流程 |
| | | LLDReturnRoot.Root json = WmsSpaHelper.Out_Order_Ins(xmlData); |
| | | //接收返回参数 生成sap对接文档返回格式 |
| | | //var json = WmsSpaHelper.GetJsonResult(simpleResult.WLPZBH, simpleResult.resultCode.ToString(), simpleResult.resultMsg); |
| | | //接收返回参数 生成sap对接文档返回格式 |
| | | List<WcReturnRoot.ITEM> wcReturnRoots = new List<WcReturnRoot.ITEM>(); |
| | | return WmsSpaHelper.Out_Order_Ins(xmlData); |
| | | |
| | | return json; |
| | | |
| | | //sw.Stop(); |
| | | //long elapsedMilliseconds = sw.ElapsedMilliseconds; |
| | | //LogHelper.Info("生产订单领料单(生成领料单)返回时长:" + elapsedMilliseconds); |
| | | |
| | | #endregion |
| | | //#region 返回xml |
| | | //string xml = JsonConvert.DeserializeXmlNode(json, "root").OuterXml; |
| | | ////返回json |
| | | //var response = new HttpResponseMessage() |
| | | //{ |
| | | // Content = new StringContent(xml, Encoding.UTF8, "application/xml") |
| | | //}; |
| | | //return response; |
| | | //#endregion |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | |
| | | |
| | | var json = WmsSpaHelper.Out_Order_Inss(dto.S_NO); |
| | | var json = WmsSpaHelper.Out_Order_Inss(dto.S_NO,dto.N_PRIORITY); |
| | | |
| | | |
| | | return json; |