| | |
| | | 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";//固定值 |
| | |
| | | //反序列化传递的值 |
| | | MaterOutSumReport com = JsonConvert.DeserializeObject<MaterOutSumReport>(sWhere.ToString()); |
| | | |
| | | //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 + |
| | | // " " + 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; |
| | | "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"); |
| | | |
| | |
| | | //反序列化传递的值 |
| | | MaterOutSumReport com = JsonConvert.DeserializeObject<MaterOutSumReport>(sWhere.ToString()); |
| | | |
| | | //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 + |
| | | // " " + 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; |
| | | "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 不良原因分析报表 |
| | | /// <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] |
| | |
| | | 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] |
| | |
| | | { |
| | | 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}'"; |
| | | 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"); |
| | | |
| | |
| | | { |
| | | SemiFinishedProductsReport DayRkReportList = JsonConvert.DeserializeObject<SemiFinishedProductsReport>(sWhere); |
| | | |
| | | //string sql = $"exec h_p_sc_SemiFinishedProductsReport '{DayRkReportList.HBeginDate}','{DayRkReportList.HEndDate}','{DayRkReportList.HMaterNumber}'" + |
| | | // $",'{DayRkReportList.HProductName}','{DayRkReportList.HCustomerName}','{DayRkReportList.HOtherSearch}'"; |
| | | 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; |