| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 模具点检记录表分页列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldDotCheckBill/GetMouldDotCheckBillListPage")] |
| | | [HttpGet] |
| | | public object GetMouldDotCheckBillListPage(string sWhere, string user, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",''", "h_p_Sc_MouldDotCheckBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldDotCheckBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | #region sql语句 |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 模具保养计划表列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldMaintainPlanBill/GetMouldMaintainPlanBillList")] |
| | | [HttpGet] |
| | | public object GetMouldMaintainPlanBillList(string sWhere,string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = Sc_MouldMaintainPlanBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | 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列对象的列名 |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "无数据"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region sql语句 |
| | | |
| | | |
| | | public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 "+sWhere+ " order by hmainid desc", "h_v_Sc_MouldMaintainPlanBillList"); |
| | | } |
| | | #endregion |
| | | |
| | | #region 模具保养计划分页列表 |
| | | [Route("Sc_MouldMaintainPlanBill/page")] |
| | | [HttpGet] |
| | | public object Sc_MouldMaintainPlanBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 模具故障登记表列表 |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | #region 模具保养计划单 |
| | | |
| | | #region 模具保养计划表列表 |
| | | [Route("Sc_MouldMaintainPlanBill/GetMouldMaintainPlanBillList")] |
| | | [HttpGet] |
| | | public object GetMouldMaintainPlanBillList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = Sc_MouldMaintainPlanBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | 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 ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region sql语句 |
| | | |
| | | |
| | | public static DataSet Sc_MouldMaintainPlanBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainPlanBillList where 1=1 " + sWhere + " order by hmainid desc", "h_v_Sc_MouldMaintainPlanBillList"); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 模具保养计划分页列表 |
| | | [Route("Sc_MouldMaintainPlanBill/page")] |
| | | [HttpGet] |
| | | public object Sc_MouldMaintainPlanBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainPlanBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldMaintainPlanBillList_Query"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 模具保养计划单 保存/编辑 |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具保养计划单编辑时获取表头数据] |
| | | [Route("Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai")] |
| | | [HttpGet] |
| | |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具保养计划单编辑时获取表题数据] |
| | | [Route("Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai")] |
| | | [HttpGet] |
| | |
| | | |
| | | #region 模具点检记录表 |
| | | |
| | | #region 模具点检记录表分页列表 |
| | | [Route("Sc_MouldDotCheckBill/GetMouldDotCheckBillListPage")] |
| | | [HttpGet] |
| | | public object GetMouldDotCheckBillListPage(string sWhere, string user, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",''", "h_p_Sc_MouldDotCheckBillList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldDotCheckBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 模具点检记录表 保存/编辑 |
| | | /// <summary> |
| | | /// 保存模具维修单 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模具点检记录表编辑时获取表头数据] |
| | | [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillListCheckDetai")] |
| | | [HttpGet] |
| | |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具点检记录表编辑时获取表题数据] |
| | | [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillListProjectDetai")] |
| | | [HttpGet] |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具点检记录表选择点检计划带出表格数据] |
| | | [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckSubBillListByPlan")] |
| | | [HttpGet] |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region [模具点检记录表删除功能] |
| | | /// <summary> |
| | | /// 模具点检记录删除功能 |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具点检记录表点击主表查看子表信息] |
| | | [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckBillList_sub")] |
| | | [HttpGet] |
| | | public object Sc_MouldDotCheckBillList_sub(string HInterID) |
| | | { |
| | | |
| | | DataSet ds; |
| | | List<object> list = new List<object>(); |
| | | string Swhere = ""; |
| | | try |
| | | { |
| | | if (HInterID != "" || HInterID != null) |
| | | { |
| | | Swhere = " and hmainid='" + HInterID + "'"; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //获取点检项目数据 |
| | | string sql = "select 点检项目代码 HDotCheckItemNumber, 点检项目 HDotCheckItem,点检方法名称 HDotCheckItemMethodName,点检部位 HDotCheckPart,具体要求 HClaim,负责人代码 HManagerNumber,负责人名称 HManagerName,点检结果 HDotCheckResult,子备注2 HRemark from h_v_Sc_MouldDotCheckBill_Edit where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBill_Edit"); |
| | | |
| | | list.Add(ds.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.list = list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[app根据模具 保养规程或点检规程自动获取子表信息] |
| | | [Route("Sc_MouldMaintainRuleBill/GetMouldRuleSubList-Detail")] |
| | | [HttpGet] |
| | | public object GetMouldMaintainRuleSubList(string HInterID,string HBillType) |
| | | { |
| | | |
| | | DataSet ds, ds1; |
| | | List<object> list = new List<object>(); |
| | | string Swhere = ""; |
| | | try |
| | | { |
| | | if (HInterID != "" || HInterID != null) |
| | | { |
| | | Swhere = " and HInterID='" + HInterID + "'"; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //保养记录调用 |
| | | if (HBillType== "3819") |
| | | { |
| | | //获取保养项目编辑数据 |
| | | string sql = "select HMaintainItemID,HManagerID,HMaintainItem,HMaintainPart,HClaim,HRemark,'true' HMaintainResult from Sc_MouldMaintainRuleBillSub_Item where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainRuleBillSub_Item"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select HMaterID, HUnitID, HQty, HQtyMust, HRemark from Sc_MouldMaintainRuleBillSub where 1 = 1 " + Swhere + ""; |
| | | ds1 = oCN.RunProcReturn(sql1, "Sc_MouldMaintainRuleBillSub"); |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | } |
| | | //点检记录调用 |
| | | else if (HBillType== "3821") |
| | | { |
| | | //获取点检项目编辑数据 |
| | | string sql = "select HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim,HManagerID,HDotCheckItemClassID,HDotCheckItemMethodID,HRemark from Sc_MouldDotCheckRuleBillSub where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckRuleBillSub"); |
| | | list.Add(ds.Tables[0]); |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.list = list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |