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
|
}
|
}
|