杨乐
2022-02-10 777db38816776abbe4b864d26a6c0381b75e8f9d
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
 
namespace WebAPI.Controllers.SCGL
{
    public class Sc_MESProductReportStepBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        private WebS.WebService1 oWebs = new WebS.WebService1();
 
        #region  产量汇报列表
        [Route("Sc_MESProductReportStepBill/Get_Sc_MESProductReportBillListxxxx")]
        [HttpGet]
        public object Get_Sc_MESProductReportBillListxxxx(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillProcessWorkQty_Tmp " + sWhere+ "order by 单据号 desc", "h_v_IF_ICMOBillProcessWorkQty_Tmp");
                }
                else
                {
                    string sql1 = "select * from h_v_IF_ICMOBillProcessWorkQty_Tmp where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillProcessWorkQty_Tmp");
                }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查询数据成功!";
                    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_MESProductReportStepBill/Get_Sc_MESProductReportEditBillListxxxx")]
        [HttpGet]
        public object Get_Sc_MESProductReportEditBillListxxxx(string linterid, string HICMOInID, string HICMOEnID)
        {
            try
            {
                //根据选择资源ID获取当前生产工单、责任人
                ds=oCN.RunProcReturn("select * from h_v_IF_ICMOBillProcessWorkQty_Tmp  where HInterID='" + linterid + "' and HICMOInterID='" + HICMOInID + "' and HICMOEntryID='" + HICMOEnID + "'", "h_v_IF_ICMOBillProcessWorkQty_Tmp");
                if (ds.Tables[0].Rows.Count > 0)
                {
 
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取资源绑定数据成功!";
                    objJsonResult.data = ds;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂无资源绑定!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
 
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
 
            }
            return objJsonResult;
        }
        #endregion
 
        #region  产量汇报列表新
        [Route("Sc_MESProductReportStepBill/Get_Sc_MESProductReportBillList")]
        [HttpGet]
        public object Get_Sc_MESProductReportBillList(string sWhere, string user)
        {
            try
            {
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("MES_ProcExchReport_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp order by HInterID desc", "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                }
                else
                {
                    string sql1 = "select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by HInterID desc";
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "查询数据成功!";
                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_MESProductReportStepBill/Get_Sc_MESProductReportEditBillList")]
        [HttpGet]
        public object Get_Sc_MESProductReportEditBillList(string linterid, string HICMOInID, string HICMOEnID)
        {
            try
            {
                //根据选择资源ID获取当前生产工单、责任人
                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp  where HInterID='" + linterid + "' and HICMOInterID='" + HICMOInID + "' and HICMOEntryID='" + HICMOEnID + "'", "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                if (ds.Tables[0].Rows.Count > 0)
                {
 
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取资源绑定数据成功!";
                    objJsonResult.data = ds;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂无资源绑定!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
 
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
 
            }
            return objJsonResult;
        }
        #endregion
    }
}