1
zrg
2026-02-10 a20222cae5a8862547d121204396caeb4cf5b1ca
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -3777,6 +3777,122 @@
        }
        #endregion
        #region 小卫组托缓存 查询
        [Route("Cj_SingleStation/xiaoweizutuo_CacheList")]
        [HttpGet]
        public object xiaoweizutuo_CacheList(string sWhere, string user, string gnsy)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (gnsy != "" && gnsy != null)
                {
                    //查看权限
                    if (!DBUtility.ClsPub.Security_Log(gnsy, 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_Sc_PackUnionBill_Temp" +
                        " order by 栈板码 desc,中箱码,SN码", "h_v_Sc_PackUnionBill_Temp");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_PackUnionBill_Temp where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 栈板码 desc,中箱码,SN码";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_PackUnionBill_Temp");
                }
                //添加列名
                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 e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 小卫组托缓存 删除
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Cj_SingleStation/deleteBill")]
        [HttpGet]
        public object deleteBill(string HInterID, string user,string gnsy)
        {
            try
            {
                if (gnsy != "" && gnsy != null)
                {
                    //查看权限
                    if (!DBUtility.ClsPub.Security_Log(gnsy, 1, false, user))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "无查看权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                oCN.RunProc("delete from Sc_PackUnionBill_Temp where HInterID = " + HInterID);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
    }