public async Task <IActionResult> UpdateMemberByOpenIdAsync([FromBody] encryData data) { result.success = await _memberService.UpdateMemberByOpenIdAsync(data.MemberData); result.returnMsg = result.success ? "修改会员信息成功!" : "修改会员信息失败!"; return(Ok(result)); }
public async Task <IActionResult> GetHospitalByCodeAsync([FromBody] encryData data) { var hospital = await _hospitalService.GetHospitalByCodeAsync(data.HospitalData.code); result.returnData = hospital; return(Ok(result)); }
public async Task <IActionResult> UpdateTagAsync([FromBody] encryData data) { var success = await _tagService.UpdateTagAsync(data.TagData); result.success = success; result.returnMsg = success ? "修改标签成功!" : "修改标签失败!"; return(Ok(result)); }
public async Task <IActionResult> CodeClusterDel([FromBody] encryData data) { var success = await _codeClusterService.CodeClusterDel(data.codeClusterData.clusCode); result.success = success; result.returnMsg = success ? "套餐删除成功!" : "套餐删除失败!"; return(Ok(result)); }
public async Task <IActionResult> CodeItemCombUpdate([FromBody] encryData data) { var success = await _codeItemCombService.CodeItemCombUpdate(data.CodeItemCombData); result.success = success; result.returnMsg = success ? "组合修改成功!" : "组合修改失败!"; return(Ok(result)); }
public async Task <IActionResult> DeleteHospitalByCodeAsync([FromBody] encryData data) { var success = await _hospitalService.DeleteHospitalByCodeAsync(data.HospitalData.code); result.success = success; result.returnMsg = success ? "删除医院成功!" : "删除医院失败!"; return(Ok(result)); }
public async Task <IActionResult> DeleteTagAsync([FromBody] encryData data) { var success = await _tagService.DeleteTagAsync(data.data.tagId); result.success = success; result.returnMsg = success ? "删除标签成功!" : "删除标签失败!"; return(Ok(result)); }
public async Task <IActionResult> CodeItemDel([FromBody] encryData data) { var success = await _codeItemService.CodeItemDel(data.ItemData.itemCode); result.success = success; result.returnMsg = success ? "项目删除成功!" : "项目删除失败!"; return(Ok(result)); }
public async Task <IActionResult> GetHospitalListAsync([FromBody] encryData data) { var paramers = data.data; (var hospitalList, var count) = await _hospitalService.GetHospitalListAsync(paramers.page, paramers.rows, paramers.hospitalAndCodeOrName, paramers.hospitalLevel); result.returnData = hospitalList; result.countSum = count; return(Ok(result)); }
public async Task <IActionResult> GetMemberListAsync([FromBody] encryData data) { var paramers = data.data; (var memberList, var count) = await _memberService.GetMemberListAsync( paramers.memberOpenIdOrName, paramers.page, paramers.rows); result.returnData = memberList; result.countSum = count; return(Ok(result)); }
public async Task <IActionResult> SetPower([FromBody] encryData pData) { try { await Task.Factory.StartNew(() => _peAdminService.SetPower(pData.PeRoleData.id, pData.data.ids)); } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> GetMenuIdsByRoleId([FromBody] encryData pData) { try { result.returnData = await Task.Factory.StartNew(() => _peAdminService.GetMenuListById(pData.PeRoleData.id)); } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> GetAdminList([FromBody] encryData pData) { try { var adminList = await Task.Factory.StartNew(() => _peAdminService.GetAdminList(pData.data.kw, pData.data.state)); result.returnData = adminList; } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> CodeItemAdd([FromBody] encryData data) { var item = await _codeItemService.CodeItemAdd(data.ItemData); if (item != null) { result.success = true; result.returnData = item; result.returnMsg = "项目添加成功!"; } else { result.success = false; result.returnMsg = "项目添加失败!"; } return(Ok(result)); }
public async Task <IActionResult> CreateHospitalAsync([FromBody] encryData data) { var hospital = await _hospitalService.CreateHospitalAsync(data.HospitalData); if (hospital != null) { result.success = true; result.returnData = hospital; result.returnMsg = "创建医院成功!"; } else { result.success = false; result.returnMsg = "创建医院失败!"; } return(Ok(result)); }
public async Task <IActionResult> CreateTagAsync([FromBody] encryData data) { var tag = await _tagService.CreateTagAsync(data.TagData); if (tag != null) { result.success = true; result.returnData = tag; result.returnMsg = "创建标签成功!"; } else { result.success = false; result.returnMsg = "创建标签失败!"; } return(Ok(result)); }
public async Task <IActionResult> GetMenuListById([FromBody] encryData pData) { try { List <Menu> menu = await Task.Factory.StartNew(() => _menuService.GetMenuListByRole(pData.data.id)); result.returnData = menu; return(Ok(result)); } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; return(Ok(result)); } }
public async Task <IActionResult> DeleteRoleByIds([FromBody] encryData pData) { try { bool isDelete = await Task.Factory.StartNew(() => _peAdminService.DeleteByIds(pData.data.ids)); if (!isDelete) { result.success = false; result.returnMsg = "删除角色失败"; } } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> AddRole([FromBody] encryData pData) { try { bool isAdd = await Task.Factory.StartNew(() => _peAdminService.AddRole(pData.PeRoleData)); if (!isAdd) { result.success = false; result.returnMsg = "添加角色失败"; } } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> UpdateAdmin([FromBody] encryData pData) { try { bool isUpdate = await Task.Factory.StartNew(() => _peAdminService.UpdateAdmin(pData.PeAdminData)); if (!isUpdate) { result.success = false; result.returnMsg = "修改信息失败"; } } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> AddAdmin([FromBody] encryData pData) { try { string errMsg = string.Empty; bool isInsert = await Task.Factory.StartNew(() => _peAdminService.AddAdmin(pData.PeAdminData, ref errMsg)); if (!isInsert) { log.Error(errMsg); result.success = false; result.returnMsg = errMsg; } } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "系统繁忙!请稍后再试"; } return(Ok(result)); }
public async Task <IActionResult> Login([FromBody] encryData pData) { try { PeAdmin admin = await Task.Factory.StartNew(() => _peAdminService.FindByClause(x => (x.adminCode ?? "").ToUpper() == pData.data.code.ToUpper())); if (admin == null) { result.success = false; result.returnMsg = "不存在该管理员"; return(Ok(result)); } if (admin.adminPwd.ToUpper() != SecurityHelper.ToMD5((pData.data.password ?? "").Trim()).Substring(8, 16).ToUpper()) { result.success = false; result.returnMsg = "密码不正确"; return(Ok(result)); } if (admin.state == 0) { result.success = false; result.returnMsg = "当前账号已被停用,请联系管理员"; return(Ok(result)); } var client = new HttpClient(); var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest { Address = Appsettings.GetSectionValue("AppSettings:IdSHttpsUrl") + "/connect/token", ClientId = "clientanduser", ClientSecret = "secret", UserName = "******", Password = "******", Scope = "api1" }); if (tokenResponse.IsError) { throw new Exception(tokenResponse.Error); } admin.token = tokenResponse.AccessToken; //记录登录时间 admin.loginDate = DateTime.Now; _peAdminService.Update(admin); //清空密码返回 admin.adminPwd = null; admin.menudata = _menuService.GetMenuListByRole(admin.id); result.returnData = admin; return(Ok(result)); } catch (Exception e) { log.Error(e.Message); result.success = false; result.returnMsg = "登录失败,请稍后重试"; return(Ok(result)); } }