From a7f9f1c44f6a1201061e12dbb4c5424f4b44737c Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期一, 23 十二月 2024 21:07:33 +0800 Subject: [PATCH] Update ITaskService.cs --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 86 insertions(+), 0 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs" index f88f409..9f898a1 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/ERPService/InvokeERPService.cs" @@ -3,6 +3,11 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using WIDESEA_Common.APIEnum; +using WIDESEA_Core.Helper; +using WIDESEA_External.Model; +using WIDESEA_IBasicRepository; +using WIDESEA_Model.Models; namespace WIDESEA_External.ERPService { @@ -11,5 +16,86 @@ /// </summary> public class InvokeERPService : IInvokeERPService { + private readonly IApiInfoRepository _apiInfoRepository; + public InvokeERPService(IApiInfoRepository apiInfoRepository) + { + _apiInfoRepository= apiInfoRepository; + } + /// <summary> + /// ERP鏀惰揣鍗曟帴鍙h皟鐢� + /// </summary> + /// <param name="receiveModel"></param> + /// <returns></returns> + public string InvokeMatReceiveApi(ERPReceiveModel receiveModel) + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x=>x.ApiCode==APIEnum.InvokeMatReceiveApi.ToString()); + ERPBaseModel<ERPReceiveModel> model = new ERPBaseModel<ERPReceiveModel>() + { + Data = receiveModel, + Desc = "鏀惰揣鍗�", + Type = "toTCWMSReceive", + SecurityCode = "" + }; + string response = HttpHelper.Post(apiInfo.ApiAddress, model.Serialize()); + return response; + } + + /// <summary> + /// ERP鐗╂枡IQC妫�楠屽崟鎺ュ彛璋冪敤 + /// </summary> + /// <param name="checkModel"></param> + /// <returns></returns> + public string InvokeCheckOrderApi(ERPCheckModel checkModel) + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokeCheckOrderApi.ToString()); + ERPBaseModel<ERPCheckModel> model = new ERPBaseModel<ERPCheckModel>() + { + Data = checkModel, + Desc = "鏀惰揣鍗�", + Type = "toTCWMSIQCTest", + SecurityCode = "" + }; + + string response = HttpHelper.Post(apiInfo.ApiAddress, model.Serialize()); + return response; + } + + /// <summary> + /// ERP鐗╂枡鍏ュ簱鍗曟帴鍙h皟鐢� + /// </summary> + /// <param name="inboundModel"></param> + /// <returns></returns> + public string InvokeInboundOrderApi(ERPInboundModel inboundModel) + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokeInboundOrderApi.ToString()); + ERPBaseModel<ERPInboundModel> model = new ERPBaseModel<ERPInboundModel>() + { + Data = inboundModel, + Desc = "鏀惰揣鍗�", + Type = "toTCWMSMaterialWarehousing", + SecurityCode = "" + }; + + string response = HttpHelper.Post(apiInfo.ApiAddress, model.Serialize()); + return response; + } + /// <summary> + /// ERP鐗╂枡鍑哄簱鎺ュ彛璋冪敤 + /// </summary> + /// <param name="outboundModel"></param> + /// <returns></returns> + public string InvokeOutboundOrderApi(ERPOutboundModel outboundModel) + { + Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokeOutboundOrderApi.ToString()); + ERPBaseModel<ERPOutboundModel> model = new ERPBaseModel<ERPOutboundModel>() + { + Data = outboundModel, + Desc = "鏉愭枡鍑哄簱", + Type = "toBomMaterialOutTC", + SecurityCode = "LxkgPgN3$U" + }; + string response = HttpHelper.Post(apiInfo.ApiAddress, model.Serialize()); + return response; + } } } -- Gitblit v1.9.3