|  |  |  | 
|---|
|  |  |  | 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";//固定值 | 
|---|
|  |  |  | 
|---|
|  |  |  | string sql = "" + | 
|---|
|  |  |  | "( (日期 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + | 
|---|
|  |  |  | "and (产品代码=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + | 
|---|
|  |  |  | "and (单据号=''" + com.HBillNo + "'' or ''"+ com.HBillNo + "''='''') " + | 
|---|
|  |  |  | "and (单据号=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + | 
|---|
|  |  |  | "and (产品名称=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + | 
|---|
|  |  |  | "and (规格型号=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch + | 
|---|
|  |  |  | " " + com.OtherSearch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //string sql = "" + | 
|---|
|  |  |  | //    "( (日期 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + | 
|---|
|  |  |  | //    "and (产品代码=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + | 
|---|
|  |  |  | //    "and (单据号=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + | 
|---|
|  |  |  | //    "and (产品名称=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + | 
|---|
|  |  |  | //    "and (规格型号=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn($"exec h_p_Kf_MaterOutSumReport_Cloth_New '{sql}'" , "h_p_Kf_MaterOutSumReport_Cloth_New"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | "and (产品代码=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + | 
|---|
|  |  |  | "and (生产订单号=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + | 
|---|
|  |  |  | "and (产品名称=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + | 
|---|
|  |  |  | "and (规格型号=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; | 
|---|
|  |  |  | "and (规格型号=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch + | 
|---|
|  |  |  | " " + com.OtherSearch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //string sql = "" + | 
|---|
|  |  |  | //    "( (生产订单日期 between ''" + com.HBeginDate + "'' and ''" + com.HEndDate + "'') or (''" + com.HBeginDate + "'' = '''' and ''" + com.HEndDate + "''='''') ) " + | 
|---|
|  |  |  | //    "and (产品代码=''" + com.HMaterNumber + "'' or ''" + com.HMaterNumber + "''='''') " + | 
|---|
|  |  |  | //    "and (生产订单号=''" + com.HBillNo + "'' or ''" + com.HBillNo + "''='''') " + | 
|---|
|  |  |  | //    "and (产品名称=''" + com.HProductName + "'' or ''" + com.HProductName + "''='''') " + | 
|---|
|  |  |  | //    "and (规格型号=''" + com.HProductModel + "'' or ''" + com.HProductModel + "''='''') " + com.RandomSearch; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn($"exec h_p_Kf_ProdProcessSumReport_DyeColor '{sql}'", "h_p_Kf_ProdProcessSumReport_DyeColor"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region  流转卡未入库报表 | 
|---|
|  |  |  | [Route("MaterOutEntryReport/Sc_ProcExchangeNoInReport")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object Sc_ProcExchangeNoInReport(string sWhere, string HBeginDate, string HEndDate) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | string sql = "exec h_p_Sc_ProcExchangeNoInReport '" + sWhere + "','" + HBeginDate + "','" + HEndDate + "'"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchangeNoInReport"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DataTable dt = ds.Tables[0]; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取列名 | 
|---|
|  |  |  | List<object> columnNameList = new List<object>(); | 
|---|
|  |  |  | //添加列名 | 
|---|
|  |  |  | 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.list = columnNameList; | 
|---|
|  |  |  | objJsonResult.data = dt; | 
|---|
|  |  |  | 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_ICOMRKReport")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | 
|---|
|  |  |  | objJsonResult.Message = "Sucess!"; | 
|---|
|  |  |  | objJsonResult.list = columnNameList; | 
|---|
|  |  |  | objJsonResult.data = dt; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "Exception!" + e.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #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) | 
|---|
|  |  |  | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region  生产日记报表 | 
|---|
|  |  |  | public class DayRkReport { | 
|---|
|  |  |  | public string HBeginDate { get; set; } | 
|---|
|  |  |  | public string HEndDate { get; set; } | 
|---|
|  |  |  | public string HMaterNumber { get; set; } | 
|---|
|  |  |  | public string HCustomerName { get; set; } | 
|---|
|  |  |  | public string HProductName { get; set; } | 
|---|
|  |  |  | public class DayRkReport { | 
|---|
|  |  |  | public string HBeginDate { get; set; } | 
|---|
|  |  |  | public string HEndDate { get; set; } | 
|---|
|  |  |  | public string HMaterNumber { get; set; } | 
|---|
|  |  |  | 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] | 
|---|
|  |  |  | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | DayRkReport DayRkReportList = JsonConvert.DeserializeObject<DayRkReport>(sWhere); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | string sql = $"exec h_p_Gy_DayRkReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + | 
|---|
|  |  |  | $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; | 
|---|
|  |  |  | $",'{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}'"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql, "h_p_Gy_DayRkReport"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DataTable dt = null; | 
|---|
|  |  |  | 
|---|
|  |  |  | public string HMaterNumber { get; set; } | 
|---|
|  |  |  | public string HCustomerName { get; set; } | 
|---|
|  |  |  | public string HProductName { get; set; } | 
|---|
|  |  |  | public string HOtherSearch { get; set; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | [Route("MaterOutEntryReport/SemiFinishedProductsReportList")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | 
|---|
|  |  |  | SemiFinishedProductsReport DayRkReportList = JsonConvert.DeserializeObject<SemiFinishedProductsReport>(sWhere); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | string sql = $"exec h_p_sc_SemiFinishedProductsReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + | 
|---|
|  |  |  | $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; | 
|---|
|  |  |  | $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}'"; | 
|---|
|  |  |  | //string sql = $"exec h_p_sc_SemiFinishedProductsReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + | 
|---|
|  |  |  | //    $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}'"; | 
|---|
|  |  |  | ds = oCN.RunProcReturn(sql, "h_p_Gy_DayRkReport"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DataTable dt = null; | 
|---|