WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_CompleteController..cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -25,11 +26,16 @@
        /// <returns></returns>
        [Route("JIT_Complete/JIT_CompleteDetailList")]
        [HttpGet]
        public object JIT_CompleteDetailList(string sWhere, string HMainICMOEntryID)
        public object JIT_CompleteDetailList(string sWhere, string HMainICMOEntryID,string HMainICMOInterID,string HICMOInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_JIT_MOMaterReadysBill where ä¸»ç”Ÿäº§è®¢å•子内码 = '" + HMainICMOEntryID + "' " + sWhere + "  order by æ—¥è®¡åˆ’日期,物料ID  desc ", "h_v_JIT_MOMaterReadysBill");
                string sql = "";
                if (HMainICMOEntryID != "-1" && HMainICMOInterID != "-1" && HICMOInterID != "-1")
                {
                    sql = "and ä¸»ç”Ÿäº§è®¢å•子内码 = '" + HMainICMOEntryID + "' and ä¸»ç”Ÿäº§è®¢å•主内码='" + HMainICMOInterID + "' and æ—¥è®¡åˆ’订单主内码='" + HICMOInterID + "'";
                }
                ds = oCN.RunProcReturn("select * from h_v_JIT_MOMaterReadysBill where 1=1 " +sql + sWhere + "  order by æ—¥è®¡åˆ’日期,物料ID  desc ", "h_v_JIT_MOMaterReadysBill");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -110,5 +116,47 @@
            }
        }
        #endregion
        #region é½å¥—分析报表
        public class ReportMOMaterReadysBill
        {
            public int? HORGID;//组织
            public int? HMATERIALID;//物料
            public int? HDeptID;//生产车间
            public int? HSCZYID;//生产资源
            public string HXQD;//需求单号
            public string HMOBILLNO;//生产订单号
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        [Route("JIT_Complete/ReportMOMaterReadysBillList")]
        [HttpGet]
        public object ReportMOMaterReadysBillList(string sWhere)
        {
            try
            {
                ReportMOMaterReadysBill Report = JsonConvert.DeserializeObject<ReportMOMaterReadysBill>(sWhere);
                ds = oCN.RunProcReturn($"exec  PR_Complete_Report '{Report.HXQD}','{Report.HMOBILLNO}',{Report.HORGID},{Report.HDeptID},{Report.HSCZYID},{Report.HMATERIALID}", "PR_Complete_Report");
                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 = e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}