UserRelationController.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Microsoft.AspNetCore.Mvc;
  2. using WMS.BZModels.Models.UserCenterManager;
  3. using WMS.BZServices.UserCenterManager;
  4. using WMS.Info;
  5. namespace WMS.BZWeb.Areas.UserCenterManager.Controllers
  6. {
  7. [Area("UserCenterManager")]
  8. public class UserRelationController : MvcControllerBase
  9. {
  10. private readonly ACLUserRelationService _aclUserRelationService;
  11. public UserRelationController(ACLUserRelationService aclUserRelationService)
  12. {
  13. _aclUserRelationService = aclUserRelationService;
  14. }
  15. #region 获取视图
  16. /// <summary>
  17. /// 人员选择
  18. /// </summary>
  19. /// <returns></returns>
  20. [HttpGet]
  21. public ActionResult SelectForm()
  22. {
  23. return View();
  24. }
  25. /// <summary>
  26. /// 人员选择
  27. /// </summary>
  28. /// <returns></returns>
  29. [HttpGet]
  30. public ActionResult LookForm()
  31. {
  32. return View();
  33. }
  34. #endregion
  35. /// <summary>
  36. /// 获取用户主键列表信息
  37. /// </summary>
  38. /// <param name="objectId">用户主键</param>
  39. /// <returns></returns>
  40. [HttpGet]
  41. public ActionResult GetUserIdList(string objectno, ACLObjType objecttype)
  42. {
  43. var data = _aclUserRelationService.GetUserList(objectno, objecttype);
  44. string UserNos = "";
  45. if (data != null)
  46. {
  47. UserNos = string.Join(",", data.Select(it => it.Id).ToList());
  48. }
  49. var datajson = new
  50. {
  51. usernos = UserNos,
  52. userInfoList = data
  53. };
  54. return Success("", datajson);
  55. }
  56. [HttpPost]
  57. [ValidateAntiForgeryToken]
  58. public ActionResult SaveForm(string objectno, ACLObjType objecttype, List<string> usernos)
  59. {
  60. _aclUserRelationService.SaveEntityList(objectno, objecttype, usernos);
  61. return Success("保存成功!");
  62. }
  63. }
  64. }