chenhaozhe
2026-02-27 82e5ca26ff07346e93e704852bfe7e80f8ba0f84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using RestSharp;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web;
using System.Web.Http;
using System.Windows.Forms;
using WebAPI.Models;
using WebAPI.Service;
using System.Text.RegularExpressions;
using WebAPI.Controllers.SCGL.日计划管理;
using SyntacticSugar.constant;
 
namespace WebAPI.Controllers.SBGL
{
    public class Sb_EquipMentReportController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
 
        #region 设备工艺参数数采临时表分页查询
        [Route("Sb_EquipMentReport/Sb_EquipMentCollectionTechParam_Temp_Page")]
        [HttpGet]
        public object Sb_EquipMentCollectionTechParam_Temp_Page(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
 
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParam_TempList " + page + "," + size + ",''", "h_p_Sb_EquipMentCollectionTechParam_TempList");
                }
                else
                {
                    sWhere = sWhere.Replace("'", "''");
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParam_TempList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipMentCollectionTechParam_TempList");
                }
 
                //添加列名
                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列对象的列名
                }
 
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
 
        #region 设备工艺参数数采表分页查询
        [Route("Sb_EquipMentReport/Sb_EquipMentCollectionTechParam_Page")]
        [HttpGet]
        public object Sb_EquipMentCollectionTechParam_Page(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
 
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParamList " + page + "," + size + ",''", "h_p_Sb_EquipMentCollectionTechParamList");
                }
                else
                {
                    sWhere = sWhere.Replace("'", "''");
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipMentCollectionTechParamList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipMentCollectionTechParamList");
                }
 
                //添加列名
                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列对象的列名
                }
 
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
 
    }
}