using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; using System.Web.Http; using WebAPI.Models; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Diagnostics; namespace WebAPI.Controllers.SCGL.日计划管理 { public class JIT_ICMOSortBillController : ApiController { private json objJsonResult = new json(); public DataSet ds = new DataSet(); public WebServer webserver = new WebServer(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); #region 生产日计划 查询 [Route("JIT_ICMOSortBill/JIT_ICMOSortBillList")] [HttpGet] public object JIT_ICMOSortBillList(string sWhere, string user) { try { //查看权限 if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "无查看权限!"; objJsonResult.data = null; return objJsonResult; } ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOSortBillList", "h_v_Sc_ICMOSortBillList"); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess!"; 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("JIT_ICMOSortBill/JIT_ICMOSortBillCheck")] [HttpGet] public object JIT_ICMOSortBillCheck(string HSourceID, string HICMOInterID, DateTime HDate, int HStatus,string user) { try { oCN.RunProc("exec h_p_Sc_SetICMOStatus_ReadyMater " + HSourceID.ToString() + "," + HICMOInterID.ToString() + ",'" + HDate.ToShortDateString() + "'," + HStatus.ToString() + ",'" + user + "'"); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "执行成功!"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exception!" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } }