duhe
2024-10-31 1fc7938f16689dd47e508d37710f37384899adce
WebAPI/Controllers/WebAPIController.cs
@@ -181,7 +181,7 @@
                string sErrMsg = "";
                Int64 HInterID = 0;//显示的字段
                HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg);
                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true);
                //HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true);
                DataSet ds;
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -1508,6 +1508,52 @@
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("Select HItemID,班组代码 班组代码,班组名称 班组 from h_v_GroupList where 1=1 " + sWhere + " Order by HItemID ", "h_v_GroupList");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        /// <summary>
        /// 获取班组列表  根据用户对应班组关系,获取用户对应的班组
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Web/GetGroupListByUser_Json")]
        [HttpGet]
        public object GetGroupListByUser_Json(string sWhere, string user)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //根据用户对应班组的关系,过滤条件中增加只显示对应的班组
                DataSet dsHitemID = oCN.RunProcReturn("exec h_p_Gy_GetSQLGroupByUser '" + user + "'", "h_p_Gy_GetSQLGroupByUser");
                sWhere = sWhere + DBUtility.ClsPub.isStrNull(dsHitemID.Tables[0].Rows[0]["HBack"]);
                DataSet ds = oCN.RunProcReturn("Select HItemID,班组代码 班组代码,班组名称 班组 from h_v_GroupList where 1=1 " + sWhere + " Order by HItemID ", "h_v_GroupList");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
@@ -14171,7 +14217,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn(" select * from h_v_Sc_ProcessExchangeBillList where 1=1 and 日期>=DATEADD(MONTH,-2,GETDATE()) order by 单据号 desc,hsubid", "h_v_Sc_ProcessExchangeBillList");
                    ds = oCN.RunProcReturn("select top 500 * from h_v_Sc_ProcessExchangeBillList where 1=1  order by 单据号 desc,hsubid", "h_v_Sc_ProcessExchangeBillList");
                }
                else
                {
@@ -14772,7 +14818,7 @@
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return objJsonResult;
                return res;
            }
        }
        #endregion