yusijie
9 天以前 861aefcec45c1843ad20d22a017054d33f78f8b9
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
using Newtonsoft.Json;
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.IO;
using System.Web.Http;
using WebAPI.DLL;
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
 
namespace WebAPI.Controllers
{
    public class Sc_ICMOBillWorkQtyStatus_TmpController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
 
 
        #region 设备产量采集列表
        [Route("Sc_ICMOBillWorkQtyStatus_Tmp/Sc_ICMOBillWorkQtyStatus_TmpList")]
        [HttpGet]
        public object Sc_ICMOBillWorkQtyStatus_TmpList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
 
                string sql1 = "select * from Sc_ICMOBillWorkQtyStatus_TmpList where 1 = 1  ";
                string sql = sql1 + sWhere + " order by 采集时间 desc";
                ds = oCN.RunProcReturn(sql, "Sc_ICMOBillWorkQtyStatus_TmpList");
 
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
 
        #region 设备产量采集列表
        [Route("Sc_ICMOBillQualityStatus_Tmp/Sc_ICMOBillQualityStatus_TmpList")]
        [HttpGet]
        public object Sc_ICMOBillQualityStatus_TmpList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
 
                string sql1 = "select * from Sc_ICMOBillQualityStatus_TmpList where 1 = 1  ";
                string sql = sql1 + sWhere + " order by 制单日期 desc";
                ds = oCN.RunProcReturn(sql, "Sc_ICMOBillQualityStatus_TmpList");
 
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}