yangle
2024-11-29 f76084c29964fb0bd45c7fd8da2d1837ae995608
WebAPI/Controllers/MJGL/Sc_MouldDotCheckRuleBillController.cs
@@ -68,6 +68,56 @@
        }
        #endregion
        #region 器具点检规程单列表
        [Route("Sc_MouldDotCheckRuleBill/Sc_MouldDotCheckRuleListPDA")]
        [HttpGet]
        public object Sc_MouldDotCheckRuleListPDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //反序列化传递的值
                //HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString());
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckRuleBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql = "select * from h_v_Sc_MouldDotCheckRuleListByMould where 1 = 1" + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckRuleListByMould");
                //添加列名
                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;
            }
        }
        #endregion
        #region 器具点检规程 保存/编辑
        /// <summary>
        /// 保存模具维修单
@@ -342,5 +392,44 @@
            }
        }
        #endregion
        #region[器具点检记录表,选点检计划获取点检计划清单信息]
        [Route("Sc_MouldDotCheckPlanBill/Sc_MouldDotCheckPlanBill_PlanList")]
        [HttpGet]
        public object Sc_MouldDotCheckPlanBill_PlanList(string HInterID, string HDate)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("exec h_p_Sc_MouldDotCheck_GetPlanList " + HInterID + ",'" + HDate + "'", "h_p_Sc_MouldDotCheck_GetPlanList");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询到数据信息!";
                    objJsonResult.data = ds.Tables[0];
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "发生异常,没有返回任何计划!" + e.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
    }
}