wtt
2024-11-26 d562ba1867762231cd5116307639d95d638b98db
WebAPI/Controllers/Æ·ÖʹÜÀí/¿â´æ¼ìÑéµ¥/QC_StockCheckBillController.cs
@@ -24,6 +24,109 @@
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region åº“存检验单列表查询 åªæ˜¾ç¤ºä¸»è¡¨
        [Route("QC_StockCheckBill/QC_StockCheckBillListMain")]
        [HttpGet]
        public object QC_StockCheckBillListMain(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_StockCheckBill_Query", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_QC_StockCheckBillList where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_StockCheckBillList");
                //添加列名
                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[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("QC_StockCheckBill/QC_StockCheckBillListPage")]
        [HttpGet]
        public object QC_StockCheckBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("QC_StockCheckBill_Query", 3, 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_QC_StockCheckBillListPage " + page + "," + size + ",''", "h_p_QC_StockCheckBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_StockCheckBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_StockCheckBillListPage");
                }
                //添加列名
                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("QC_StockCheckBill/QC_StockCheckBillList")]
        [HttpGet]
@@ -136,6 +239,11 @@
                BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo);
                BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType);
                BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID);                
                BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo);
                BillNew.omodel.HInSpectQty = ClsPub.isLong(mainList[0].HInSpectQty);
                BillNew.omodel.HRightQty = ClsPub.isLong(mainList[0].HRightQty);
                BillNew.omodel.HUnRightQty = ClsPub.isLong(mainList[0].HUnRightQty);
                BillNew.omodel.HUnKnowQty = ClsPub.isLong(mainList[0].HUnKnowQty);
                BillNew.omodel.HBillStatus = 1;
                BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID);
                BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment);