| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetUser")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetUser(string UserName, string PassWord, string HOrgName) |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | if (!oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "登录异常!Token 生成异常,无法获取公司信息!"; |
| | | } |
| | | |
| | | string tokenStr = Utility.JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czymc"].ToString()); |
| | | |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "[0000-1-073]登录成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | JObject jobjJsonResult = JObject.FromObject(objjson); |
| | | jobjJsonResult["token"] = tokenStr; |
| | | return jobjJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetDataBases")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetDataBases() |
| | | { |
| | | try |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetOrganizations")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetOrganizations() |
| | | { |
| | | try |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/BaseInfo")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetBaseInfo() |
| | | { |
| | | try |
| | |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + ex.ToString(); |
| | | objjson.Message = "获取失败" + ex.Message.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl"); |
| | | if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"]) //是否管理员 |
| | | { |
| | | //不是管理员 |
| | | sWhere += " and 制单人 = '" + user + "'"; |
| | | } |
| | | //ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl"); |
| | | //if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"]) //是否管理员 |
| | | //{ |
| | | // //不是管理员 |
| | | // sWhere += " and 制单人 = '" + user + "'"; |
| | | //} |
| | | |
| | | |
| | | string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 日期 desc, hmainid desc"); |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetModuleName")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetModuleName(string HModuleType) |
| | | { |
| | | try |
| | |
| | | #region 用于连接的健康度检验,只要能访问通这个接口,则表明连接可用 |
| | | [Route("Health")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public IHttpActionResult CheckHealth() |
| | | { |
| | | // 返回 200 状态码 确认健康状态 |
| | |
| | | { |
| | | if (param.TechParamName.StartsWith(category)) |
| | | { |
| | | param.TechParamName = param.TechParamName.Substring(category.Length - 1); |
| | | if(param.TechParamName.Length != category.Length) |
| | | { |
| | | param.TechParamName = param.TechParamName.Substring(category.Length); |
| | | } |
| | | groupedParams[category].Add(param); |
| | | isMatched = true; |
| | | break; // 匹配到第一个分类后停止(避免重复匹配) |