| | |
| | | "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; ; |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_Kf_ProdProcessSumReport_DyeColor_third '{sql}'", "h_p_Kf_ProdProcessSumReport_DyeColor_third"); |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 压水未出站报表 查询 |
| | | /// <summary> |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Kf_PressurizedWaterNoOutReport/list")] |
| | | [HttpGet] |
| | | public object GetKf_PressurizedWaterNoOutReport(string sWhere, string user, string userid) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | ////查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_PressurizedWaterNoOutReport_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //查询 |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | string sql = "exec h_p_Kf_PressurizedWaterNoOutReport '','" + userid + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Kf_PressurizedWaterNoOutReport"); |
| | | } |
| | | else |
| | | { |
| | | string sql = "exec h_p_Kf_PressurizedWaterNoOutReport '" + sWhere + "','" + userid + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Kf_PressurizedWaterNoOutReport"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 领料统计报表 |
| | | /// <summary> |
| | | /// 领料统计报表 |
| | |
| | | /// </summary> |
| | | [Route("Sc_BadReasonReport/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | public object list(string sWhere, string user,string HGroupID) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonReport '" + sWhere + "'", "h_p_Sc_BadReasonReport"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonReport '" + sWhere + "','" + HGroupID + "'", "h_p_Sc_BadReasonReport"); |
| | | } |
| | | |
| | | //添加列名 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 工厂日历批改上班工时 |
| | | [Route("Gy_PlanShifts/BulkWorkTime")] |
| | | [HttpGet] |
| | | public object BulkWorkTime(string HSourceNumber1, string HSourceNumber2, string HBeginDate, string HEndDate,string HWorkTime) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | string sql = $"update a set HOverTimes = {HWorkTime} from Gy_PlanShifts a left join Gy_Source b on a.HSourceID = b.HItemID where b.HNumber between '{HSourceNumber1}' and '{HSourceNumber2}' and CONVERT(varchar(120),a.HDate,23) between CONVERT(varchar(120),'{HBeginDate}',23) and CONVERT(varchar(120),'{HEndDate}',23)"; |
| | | |
| | | //执行更新上班工时语句 |
| | | oCN.RunProc(sql); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "批改成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 制成率明细报表 |
| | | [Route("MaterOutEntryReport/Sc_ProductedRateReport")] |
| | | [HttpGet] |
| | | public object Sc_ProductedRateReport(string HBeginDate,string HEndDate,string sWhere,double HRate_BeyondICMOQty, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ProductedRateReport", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql = "exec h_p_Sc_ProductedRateReport '" + HBeginDate + "','" + HEndDate + "','" + sWhere + "'," + HRate_BeyondICMOQty; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProductedRateReport"); |
| | | |
| | | 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 = ds.Tables; |
| | | 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_RetentionTimeReport")] |
| | | [HttpGet] |
| | | public object Sc_RetentionTimeReport(string HBeginDate,string HEndDate,string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_RetentionTimeReport", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql = "exec h_p_Sc_RetentionTimeReport '" + HBeginDate + "','" + HEndDate + "','" + sWhere + "'"; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_RetentionTimeReport"); |
| | | |
| | | 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 = ds.Tables; |
| | | 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_CompareOrderToSelloutReport")] |
| | | [HttpGet] |
| | | public object Sc_CompareOrderToSelloutReport(string HBeginDate, string HEndDate, string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_CompareOrderToSelloutReport", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql = "exec h_p_Sc_CompareOrderToSelloutReport '" + HBeginDate + "','" + HEndDate + "','" + sWhere + "'"; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_CompareOrderToSelloutReport"); |
| | | |
| | | 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 = ds.Tables; |
| | | 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/Xs_SellOutMoneyRangeReport")] |
| | | [HttpGet] |
| | | public object Xs_SellOutMoneyRangeReport(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SellOutMoneyRangeReport", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | 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_Xs_SellOutMoneyRangeReport '" + sWhere + "'", "h_p_Xs_SellOutMoneyRangeReport"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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/Xs_SeOrderBarCodeInAndOutStockDetailReport")] |
| | | [HttpGet] |
| | | public object Xs_SeOrderBarCodeInAndOutStockDetailReport(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBarCodeInAndOutStockDetailReport", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql = "select * from h_v_Xs_SeOrderBarCodeInAndOutStockDetailReport_Query where 1=1 " + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Xs_SeOrderBarCodeInAndOutStockDetailReport_Query"); |
| | | |
| | | 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 = ds.Tables; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | } |