Tiger.Business.MES/iERP/MES_U9C.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Controllers.MES/Controllers/MESController.MES_U9C.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.IBusiness.MES/iERP/IMES_U9C.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Tiger.Model.Net.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Tiger.Business.MES/iERP/MES_U9C.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,82 @@ using Tiger.Model; using SqlSugar; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using Rhea.Common; using System.Net; using System.Linq; using Newtonsoft.Json; using Tiger.IBusiness; using Microsoft.AspNetCore.Http; using Tiger.Model.Minsun; using Org.BouncyCastle.Asn1.Tsp; using Tiger.Model.Entitys.MES.Position; using Apache.NMS.ActiveMQ.Commands; using System.Security.Cryptography; using System.Diagnostics; using Tiger.Model.Entitys.MES.U9C; using Newtonsoft.Json.Linq; namespace Tiger.Business.MES { public partial class MES_U9C : IMES_U9C { public static string U9CAuthLoginUrl { get; set; } = "http://172.16.80.20/U9C/webapi/OAuth2/AuthLogin"; /// <summary> /// å ¥åºåæ¥å£ /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task<ApiAction> RcvRptDocCreate(RcvRptDocCreateInput input) { Logger.Interface.Info($"/**\r\n *è¿å ¥å ¥åºåæ¥å£....\r\n */\r\n"); //åºå®åæ³ var action = new ApiAction(); try { JObject json = new JObject(); json["CompleteList"] = new JArray(); // å建ä¸ä¸ªç©ºçJArray JObject moKey = new JObject(); moKey["DocNo"] = input.WorkOrder; JObject Wh = new JObject(); Wh["Code"] = input.WhCode; json["CompleteList"]["Wh"] = Wh; JObject DescFlexField = new JObject(); DescFlexField["PrivateDescSeg1"] = input.PkgQty; json["CompleteList"]["DescFlexField"] = DescFlexField; JObject Item = new JObject(); Item["Code"] = input.ItemCode; json["CompleteList"]["Item"] = Item; json["CompleteList"]["CompleteQty"] = input.CompleteQty; json["CompleteList"]["OutputType"] = input.OutputType; json["CompleteList"]["StorageType"] = input.StorageType; json["CompleteList"]["DocState"] = input.DocState; var response = await HttpHelper.PostAsync(U9CAuthLoginUrl, json); var result = JsonConvert.DeserializeObject<U9CReturnData>(response.Message); Logger.Interface.Info($"çæå ¥åºåæ¥å£æäº¤Json: {json}ï¼è¿åJson: {response.Message}"); var db = Biz.Db; var dbTran = db.UseTran(() => { }); if (!dbTran.IsSuccess) { action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); Logger.Interface.Error(action.Message); } Logger.Interface.Info($"çæå ¥åºåæå"); } catch (System.Exception ex) { action.CatchExceptionWithLog(ex, "çæå ¥åºåå¼å¸¸"); } Logger.Interface.Info($"/* å ¥åºåæ¥å£ç»æ */\r\n"); //åºå®åæ³ return action; } } } Tiger.Controllers.MES/Controllers/MESController.MES_U9C.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,38 @@ using Microsoft.AspNetCore.Mvc; using Rhea.Common; using SqlSugar; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; using Tiger.Model.Entitys.MES.BizMesWo; using Tiger.Model.Entitys.MES.BizMesWoBatch; using Tiger.Api.iBiz; using Tiger.Model.Entitys.MES.U9C; namespace Tiger.Api.Controllers.MES { public partial class MESController : ControllerBase { /// <summary> /// å ¥åºåæ¥å£ /// </summary> /// <param name="action"></param> /// <returns></returns> [HttpPost] [Route("api/[controller]/[action]")] public async Task<IActionResult> RcvRptDocCreate([FromBody] ApiAction<RcvRptDocCreateInput> action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<IMES_U9C>().RcvRptDocCreate(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } } Tiger.IBusiness.MES/iERP/IMES_U9C.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ using Rhea.Common; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.Model; using Tiger.Model.Entitys.MES.U9C; namespace Tiger.IBusiness { public interface IMES_U9C { public Task<ApiAction> RcvRptDocCreate(RcvRptDocCreateInput input); } } Tiger.Model.Net/Entitys/MES/ParameterEntity/U9CParameter.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tiger.Model.Entitys.MES.U9C { public class U9CResult { public int ResCode { get; set; } public bool Success { get; set; } public string ResMsg { get; set; } public List<U9CReturnData> Data { get; set; } public int Status { get; set; } public int RouteStatus { get; set; } } public class U9CReturnData { public string u9c_version { get; set; } public bool m_isSucess { get; set; } public string m_otherID { get; set; } public string m_iD { get; set; } public string m_code { get; set; } public string m_errorMsg { get; set; } public string m_datas { get; set; } } /// <summary> /// å ¥åºåæ¥å£ä¼ å ¥åæ° /// </summary> public class RcvRptDocCreateInput { public string WorkOrder { get; set; } public string ItemCode { get; set; } public string WhCode { get; set; } = "10105"; public int PkgQty { get; set; } public int CompleteQty { get; set; } public int OutputType { get; set; } = 0; public int StorageType { get; set; } = 4; public int DocState { get; set; } = 1; } } Tiger.Model.Net/Tiger.Model.Net.csproj
@@ -162,6 +162,7 @@ <Compile Include="Entitys\MES\node.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizMesWoBatchParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizBasPkgRuleParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\U9CParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\DoUnPackParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\CodeVerificationParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizMesWoParameter.cs" />