yxj
2024-04-28 fcd940f7fbdd40227eb64f89120acc6782160134
新增夏宝售后接口调用方法
4个文件已修改
1个文件已添加
135 ■■■■■ 已修改文件
WebAPI/Controllers/夏宝售后接口/ASSController.cs 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/FolderProfile.pubxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.config 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Ïı¦ÊÛºó½Ó¿Ú/ASSController.cs
New file
@@ -0,0 +1,124 @@

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class ASSController : ApiController
    {
        public DataSet ds = new DataSet();
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        #region å”®åŽæŽ¥å£ä¸€è°ƒç”¨
        /// <summary>
        /// å”®åŽæŽ¥å£ä¸€è°ƒç”¨
        /// </summary>
        /// <returns></returns>
        [Route("ASSController/GetASS_SellOutInterFace_Json")]
        [HttpGet]
        public object GetASS_SellOutInterFace_Json(string HBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_ASS_SellOut_InterFace '" + HBarCode + "'", "h_p_ASS_SellOut_InterFace");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询售后接口一信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å”®åŽæŽ¥å£äºŒè°ƒç”¨
        /// <summary>
        /// å”®åŽæŽ¥å£äºŒè°ƒç”¨
        /// </summary>
        /// <returns></returns>
        [Route("ASSController/GetASS_ProductInInterFace_Json")]
        [HttpGet]
        public object GetASS_ProductInInterFace_Json(string HBarCode)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_ASS_ProductIn_InterFace '" + HBarCode + "'", "h_p_ASS_ProductIn_InterFace");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何结果!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    List<object> columnNameList = new List<object>();
                    //添加列名
                    foreach (DataColumn col in ds.Tables[0].Columns)
                    {
                        Type dataType = col.DataType;
                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));  //获取到DataColumn列对象的列名
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询售后接口二信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Properties/PublishProfiles/FolderProfile.pubxml
@@ -10,7 +10,7 @@
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>x86</LastUsedPlatform>
    <PublishProvider>FileSystem</PublishProvider>
    <PublishUrl>G:\issWeb\网站发布\API</PublishUrl>
    <PublishUrl>D:\网站发布\智云MESWMS\API</PublishUrl>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <SiteUrlToLaunchAfterPublish />
  </PropertyGroup>
WebAPI/Web.config
@@ -22,7 +22,7 @@
        <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
        <!--<add key="FileIP" value="http://localhost:8080/" />-->
        <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
        <add key="sUrl" value="http://192.168.63.53/WEBS-WMS/WebService1.asmx"/>   <!--颜台式机-->
        <add key="sUrl" value="http://192.168.0.81/WEBS-WMS/WebService1.asmx"/>   <!--颜台式机-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®-->
        <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> -->
        <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    åšæ—¥ç§‘技-->
@@ -105,7 +105,7 @@
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://192.168.63.53/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
            <endpoint address="http://192.168.0.81/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
     bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap"
     name="WebService1Soap" />
        </client>
@@ -114,7 +114,7 @@
 <applicationSettings>
  <WebAPI.Properties.Settings>
   <setting name="WebAPI_WebS_WebService1" serializeAs="String">
    <value>http://192.168.63.53/WEBS-WMS/WebService1.asmx</value>
    <value>http://192.168.0.81/WEBS-WMS/WebService1.asmx</value>
   </setting>
  </WebAPI.Properties.Settings>
 </applicationSettings>
WebAPI/WebAPI.csproj
@@ -557,6 +557,7 @@
    <Compile Include="Controllers\基础资料\工资基础资料\Gy_WorkPayTypeController.cs" />
    <Compile Include="Controllers\基础资料\工资基础资料\Gy_ClassTimePrjGroupController.cs" />
    <Compile Include="Controllers\基础资料\生产基础资料\Gy_ShiftsController.cs" />
    <Compile Include="Controllers\夏宝售后接口\ASSController.cs" />
    <Compile Include="Controllers\工资管理\HR_EmployeeSkillBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_OutApplyBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_OverApplyBillController.cs" />
WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@
    <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\GIT仓库\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <UseIISExpress>true</UseIISExpress>
    <Use64BitIISExpress />