zrg
2025-04-02 235ddcabc45bab8a8434c92e537f5c6183b7efb7
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
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_MESProductReportBillController : 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_MESProductReportBill/Get_Sc_MESProductReportBillList")]
        [HttpGet]
        public object Get_Sc_MESProductReportBillList(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp " + sWhere+ "order by 单据号 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 单据号 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_MESProductReportBill/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
    }
}