yusijie
2024-03-06 c193ef49cf93c007b8b908574e92ba5d8b0f6fc3
WebAPI/Controllers/WebAPIController.cs
@@ -7872,6 +7872,69 @@
            return model;
        }
        /// <summary>
        /// 用户关联用户删除
        /// </summary>
        /// <returns></returns>
        [Route("Xt_User/Gy_UserByUserListDrop")]
        [HttpGet]
        public object DeltetGy_Material(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserByUser_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(HItemID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HItemID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_UserByUserRelation where HItemID=" + HItemID, "Gy_UserByUserRelation");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete from Gy_UserByUserRelation where HItemID=" + HItemID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "* 数据删除成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                oCN.RollBack();//回滚事务
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// 用关联物料获取信息
@@ -7897,6 +7960,43 @@
            var model = LuBaoSevice.GetGy_UserStockRelationDetail(HID);
            return model;
        }
        /// <summary>
        /// 用关联用户获取信息
        /// </summary>
        /// <returns></returns>
        [Route("Gy_UserByUserEdit")]
        [HttpGet]
        public ApiResult<DataSet> Gy_UserByUserEdit(string HID)
        {
            var model = LuBaoSevice.Gy_UserByUserEdit(HID);
            return model;
        }
        /// <summary>
        /// 用户关联班组获取信息
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_UserGroupDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_UserGroupDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_UserGroupBillDetail(HID);
            return model;
        }
        /// <summary>
        /// 用户关联供应商获取信息
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_UserSupplierDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_UserSupplierDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_UserSupplierBillDetail(HID);
            return model;
        }
        /// <summary>
        /// 报废原因
@@ -8996,11 +9096,11 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("Select HItemID,HNumber 代码,HName 名称 ,HQCCheckClassID 检验项目类别 from Gy_QCCheckItem where HStopflag=0 Order by HItemID  ", "Gy_QCCheckItem");
                    ds = oCN.RunProcReturn("Select HItemID,HNumber 代码,HName 名称 ,HQCCheckClassID 检验项目类别,HDefaultResult 默认结论 from Gy_QCCheckItem where HStopflag=0 Order by HItemID  ", "Gy_QCCheckItem");
                }
                else
                {
                    string sql = "Select HItemID,HNumber 代码,HName 名称 ,HQCCheckClassID 检验项目类别 from Gy_QCCheckItem where HStopflag=0 " + sWhere + "Order by HItemID ";
                    string sql = "Select HItemID,HNumber 代码,HName 名称 ,HQCCheckClassID 检验项目类别,HDefaultResult 默认结论 from Gy_QCCheckItem where HStopflag=0 " + sWhere + "Order by HItemID ";
                    ds = oCN.RunProcReturn(sql, "Gy_QCCheckItem");
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
@@ -9603,7 +9703,7 @@
        /// <returns></returns>
        [Route("Web/GetItemByEquipFile")]
        [HttpGet]
        public object GetItemByEquipFile(int EquipProjectID,string Type)
        public object GetItemByEquipFile(int EquipProjectID,string Type,string HDate)
        {
            if (EquipProjectID <= 0)
            {
@@ -9633,7 +9733,8 @@
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
                //string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID);
                string sql = string.Format(@"Exec h_p_Sb_GetCheckItem_PDA '" + EquipProjectID + "','" + Type + "','" + HDate + "'");
                ds = oCN.RunProcReturn(sql, HView);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
@@ -9912,6 +10013,39 @@
                objJsonResult.Message = "删除失败!";
                objJsonResult.data = e.ToString();
                return objJsonResult;
            }
        }
        /// <summary>
        /// 获取选单号的源单类型
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetHSourceBillType")]
        [HttpGet]
        public object GetHSourceBillType(string HName)
        {
            try
            {
                ClsCN oCn = new ClsCN();
                DataSet oDs = new DataSet();
                //==========
                oDs = oCn.RunProcReturn("select * from  Xt_BillSourceSet where HName='"+HName+"'", "Xt_BillSourceSet");
                objjson.code = "1";
                objjson.count = 1;
                objjson.Message = "获取成功!";
                objjson.data = oDs.Tables[0];
                return objjson; ;
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败!异常" + e.ToString();
                objjson.data = null;
                return objjson; ;
            }
        }
@@ -10817,6 +10951,47 @@
            }
        }
        /// <summary>
        /// 获取单据模块名称
        /// </summary>
        /// <returns></returns>
        [Route("Web/GetModuleName")]
        [HttpGet]
        public object GetModuleName(string HModuleType)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("Select * from Xt_BillType where HNumber = '" + HModuleType + "'", "Xt_BillType");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
    }
}