1
zrg
2024-11-25 59f31f0caeef6fb37f397646efbcd19738299122
WebAPI/Controllers/SCGL/Sc_PPBomBillController.cs
@@ -90,6 +90,60 @@
                return objJsonResult;
            }
        }
        #region 生产用料清单列表分页列表
        [Route("Sc_PPBomBill/page")]
        [HttpGet]
        public object page(string sWhere, string user,int page,int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sc_PPBomBillList_Query", 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_PPBomBillList " + page + "," + size + "," + "''", "h_p_Sc_PPBomBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_PPBomBillList " + page + "," + size + ",'"  + sWhere + "'", "h_p_Sc_PPBomBillList");
                }
                //添加列名
                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 = 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 = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 生产用料清单 审核/反审核
        [Route("Sc_PPBomBill/DeOrAuditBill")]
        [HttpGet]