zrg
2024-06-18 38b01cb446b0725ded3ae8867353925e67da3ac1
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
@@ -86,6 +86,70 @@
        }
        #endregion
        #region 设备点检规程单列表PDA
        [Route("Sb_EquipDotCheckRuleBill/GetEquipDotCheckRuleListPDA")]
        [HttpGet]
        public object GetEquipDotCheckRuleListPDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_GetDotCheckRuleListByEquip " + sWhere , "h_v_Sb_GetDotCheckRuleListByEquip");
                }
                else
                {
                    string sql1 = "select * from h_v_Sb_GetDotCheckRuleListByEquip where 1 = 1";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_GetDotCheckRuleListByEquip");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region 设备点检规程记录删除功能
        [Route("Sb_EquipDotCheckRuleBill/DeleteEquipDotCheckRuleBillList")]
        [HttpGet]
@@ -110,9 +174,10 @@
                return objJsonResult;
            }
            DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Sb_EquipDotCheckRuleBillMain where HInterID=" + HInterID, "Sb_EquipDotCheckRuleBillMain");
            if (ds.Tables[0].Rows.Count>0)
            {
                if (oBill.omodel.HBillStatus > 1)
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString())  > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -176,7 +241,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql1 = @"select  *  from h_v_Sb_EquipDotCheckRuleList a
                        left join Gy_QCCheckItem b  on a.点检项目ID =b.HItemID where 1 = 1 ";
                        left join Gy_DotCheck b  on a.点检项目ID =b.HItemID where 1 = 1 ";
                string sql = sql1 + sqlWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList");
                objJsonResult.code = "0";