WebAPI/Controllers/MateOutController.cs
@@ -547,6 +547,9 @@
                websLsmain.HBillNo = lsmain[0].HBillNo;
                websLsmain.HDeptID = lsmain[0].HDeptID;
                websLsmain.HEmpID = lsmain[0].HEmpID;
                websLsmain.HKeeperID = lsmain[0].HKeeperID;
                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
                websLsmain.HBillerID = lsmain[0].HBillerID;
                websLsmain.HRemark = lsmain[0].HRemark;
                websLsmain.HMaker = lsmain[0].HMaker;
                websLsmain.HBillType = "1204";//固定值
@@ -2026,6 +2029,58 @@
        }
        #endregion
        #region 不良原因分析报表
        /// <summary>
        /// 返回不良原因分析报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_BadReasonReport/list")]
        [HttpGet]
        public object list(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonReport '" + sWhere + "'", "h_p_Sc_BadReasonReport");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  生产入库报表
        [Route("MaterOutEntryReport/sc_ICOMRKBanReport")]
        [HttpGet]
@@ -2075,6 +2130,8 @@
            public string HCustomerName { get; set; }
            public string HProductName { get; set; }
            public string HOtherSearch { get; set; }
            public string HEmpName { get; set; }
            public string sWheres { get; set; }
        }
        [Route("MaterOutEntryReport/SC_DayRkReport")]
        [HttpGet]
@@ -2085,7 +2142,7 @@
               DayRkReport DayRkReportList = JsonConvert.DeserializeObject<DayRkReport>(sWhere);
                string sql = $"exec h_p_Gy_DayRkReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" +
                    $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}'";
                    $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}','{DayRkReportList.HEmpName}','{DayRkReportList.sWheres}'";
                //string sql = $"exec h_p_Gy_DayRkReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" +
                //    $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'";