llj
3 天以前 b4dba39ce6afc201ede288ada4295a5fa345092f
抽样方案基础资料
1个文件已修改
1个文件已添加
74 ■■■■■ 已修改文件
WebAPI/Controllers/BaseSet/Gy_SampleSchemeController.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_SampleSchemeController.cs
New file
@@ -0,0 +1,72 @@
using Model;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
using System.Web;
using WebAPI.Controllers.SCGL.日计划管理;
using System.IO;
namespace WebAPI.Controllers.BaseSet
{
    public class Gy_SampleSchemeController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// 查询方法
        /// </summary>
        [Route("Gy_SampleScheme/list")]
        [HttpGet]
        public object list(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_WorkCenter_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere , "h_v_Gy_GetSampleSchemeListView");
                //添加列名
                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 = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}
WebAPI/WebAPI.csproj
@@ -427,6 +427,7 @@
    <Compile Include="Controllers\BaseSet\Gy_ColorClassController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_DriverController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_ICBomBillController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_SampleSchemeController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_WorkDayController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_PackTypeController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_RoutingGroupController.cs" />
@@ -1358,6 +1359,7 @@
    <Folder Include="Views\Gy_RecConditionBill\" />
    <Folder Include="Views\Gy_RepairCheckClass\" />
    <Folder Include="Views\Gy_RoutingGroup\" />
    <Folder Include="Views\Gy_SampleScheme\" />
    <Folder Include="Views\Gy_SettleStyle\" />
    <Folder Include="Views\Gy_SOPBill\" />
    <Folder Include="Views\Gy_SourceWorkStationSet\" />