SystemController.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. 
  2. using Google.Protobuf.WellKnownTypes;
  3. using OASystem.Domain.Dtos.UserDto;
  4. using OASystem.Infrastructure.Repositories.System;
  5. using System.ComponentModel.Design;
  6. namespace OASystem.API.Controllers
  7. {
  8. /// <summary>
  9. /// 系统设置
  10. /// </summary>
  11. //[Authorize]
  12. [Route("api/[controller]/[action]")]
  13. public class SystemController : ControllerBase
  14. {
  15. private readonly CompanyRepository _syscomRep;
  16. private readonly DepartmentRepository _sysDepRep;
  17. private readonly UsersRepository _userRep;
  18. private readonly IMapper _mapper;
  19. private readonly SetDataRepository _setDataRepository;
  20. private readonly SystemMenuPermissionRepository _SystemMenuPermissionRepository;
  21. private readonly CompanyRepository _CompanyRepository;
  22. private readonly JobPostRepository _jobRep;
  23. public SystemController( CompanyRepository syscom,DepartmentRepository sysDepRep, UsersRepository userRep,
  24. IMapper mapper, SetDataRepository setDataRepository, CompanyRepository companyRepository,
  25. SystemMenuPermissionRepository systemMenuPermissionRepository, JobPostRepository jobRep)
  26. {
  27. _syscomRep = syscom;
  28. _sysDepRep = sysDepRep;
  29. _userRep = userRep;
  30. _mapper = mapper;
  31. _setDataRepository = setDataRepository;
  32. _CompanyRepository = companyRepository;
  33. _SystemMenuPermissionRepository = systemMenuPermissionRepository;
  34. _jobRep = jobRep;
  35. }
  36. #region 企业操作
  37. /// <summary>
  38. /// 查询企业数据
  39. /// </summary>
  40. /// <param name="dto"></param>
  41. /// <returns></returns>
  42. [HttpPost]
  43. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  44. public async Task<IActionResult> getCompanyList(DtoBase dto)
  45. {
  46. try
  47. {
  48. if (dto.PortType == 1)
  49. {
  50. var CompanyDataResult = _CompanyRepository.GetCompanyData();
  51. if (CompanyDataResult.Code != 0)
  52. {
  53. return Ok(JsonView(CompanyDataResult.Msg));
  54. }
  55. return Ok(JsonView(true, "查询成功!", CompanyDataResult.Data));
  56. }
  57. else if (dto.PortType == 2)
  58. {
  59. var CompanyDataResult = _CompanyRepository.GetCompanyData();
  60. if (CompanyDataResult.Code != 0)
  61. {
  62. return Ok(JsonView(CompanyDataResult.Msg));
  63. }
  64. return Ok(JsonView(true,"查询成功!", CompanyDataResult.Data));
  65. }
  66. else if (dto.PortType == 3)
  67. {
  68. return Ok(JsonView(false, "暂无数据!"));
  69. }
  70. else
  71. {
  72. return Ok(JsonView(false, "暂无数据!"));
  73. }
  74. }
  75. catch (Exception ex)
  76. {
  77. return Ok(JsonView(false, "程序错误!"));
  78. throw;
  79. }
  80. }
  81. /// <summary>
  82. /// 添加企业数据
  83. /// </summary>
  84. /// <param name="dto"></param>
  85. /// <returns></returns>
  86. [HttpPost]
  87. [ProducesResponseType(typeof(JsonView),StatusCodes.Status200OK)]
  88. public async Task<IActionResult> AddCompany(AddCompanyDto dto)
  89. {
  90. try
  91. {
  92. if (string.IsNullOrWhiteSpace(dto.CompanyName) || dto.CreateUserId == 0 || string.IsNullOrWhiteSpace(dto.CompanyCode))
  93. {
  94. return Ok(JsonView(false, "请检查信息是否输入完整!"));
  95. }
  96. else if (string.IsNullOrWhiteSpace(dto.Tel))
  97. {
  98. return Ok(JsonView(false, "请检查联系方式是否输入正确!"));
  99. }
  100. else
  101. {
  102. Sys_Company _Company = _mapper.Map<Sys_Company>(dto);
  103. int id = await _syscomRep.AddAsyncReturnId(_Company);
  104. if (id == 0)
  105. {
  106. return Ok(JsonView(false, "添加失败!"));
  107. }
  108. return Ok(JsonView(true,"添加成功", new { Id = id }));
  109. }
  110. }
  111. catch (Exception)
  112. {
  113. return Ok(JsonView(false, "程序错误!"));
  114. throw;
  115. }
  116. }
  117. /// <summary>
  118. /// 企业修改
  119. /// </summary>
  120. /// <param name="dto"></param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  124. public async Task<IActionResult>EditCompany(EditCompanyDto dto)
  125. {
  126. try
  127. {
  128. if (string.IsNullOrWhiteSpace(dto.CompanyName) || string.IsNullOrWhiteSpace(dto.CompanyCode) || string.IsNullOrWhiteSpace(dto.Address) || dto.ParentCompanyId == 0 || dto.ContactUserId == 0)
  129. {
  130. return Ok(JsonView(false, "请检查信息是否输入完整!"));
  131. }
  132. else if (string.IsNullOrWhiteSpace(dto.Tel))
  133. {
  134. return Ok(JsonView(false, "请检查联系方式是否输入正确!"));
  135. }
  136. else
  137. {
  138. bool res = await _syscomRep.UpdateAsync(a => a.Id == dto.Id, a => new Sys_Company
  139. {
  140. CompanyName = dto.CompanyName,
  141. CompanyCode = dto.CompanyCode,
  142. Address = dto.Address,
  143. ParentCompanyId = dto.ParentCompanyId,
  144. Tel = dto.Tel,
  145. ContactUserId = dto.ContactUserId,
  146. });
  147. if (!res) { return Ok(JsonView(false, "修改失败")); }
  148. return Ok(JsonView(true,"修改成功!"));
  149. }
  150. }
  151. catch (Exception)
  152. {
  153. return Ok(JsonView(false, "程序错误!"));
  154. throw;
  155. }
  156. }
  157. /// <summary>
  158. /// 企业删除
  159. /// </summary>
  160. /// <param name="dto"></param>
  161. /// <returns></returns>
  162. [HttpPost]
  163. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  164. public async Task<IActionResult> DelCompany(DelCompanyDto dto)
  165. {
  166. try
  167. {
  168. bool res = await _syscomRep.SoftDeleteAsync<Sys_Company>(dto.Id.ToString());
  169. if (!res) { return Ok(JsonView(false, "删除失败")); }
  170. return Ok(JsonView(true, "删除成功"));
  171. }
  172. catch (Exception)
  173. {
  174. return Ok(JsonView(false, "程序错误!"));
  175. throw;
  176. }
  177. }
  178. #endregion
  179. #region 部门操作
  180. /// <summary>
  181. /// 查询部门数据
  182. /// </summary>
  183. /// <param name="dto"></param>
  184. /// <returns></returns>
  185. [HttpPost]
  186. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  187. public async Task<IActionResult> QueryDepartmentList(DepartmentDto dto)
  188. {
  189. try
  190. {
  191. if (dto.PortType==1)
  192. {
  193. return Ok(JsonView(false, "暂无数据!"));
  194. }
  195. else if (dto.PortType==2)
  196. {
  197. var result = _sysDepRep.QueryDto<Sys_Department, DepartmentIView>(s => s.CompanyId == dto.CompanyId).ToList();
  198. if (result.Count == 0)
  199. {
  200. return Ok(JsonView(false, "暂无数据!"));
  201. }
  202. return Ok(JsonView(true,"查询成功!",result));
  203. }
  204. else if (dto.PortType == 3)
  205. {
  206. return Ok(JsonView(false, "暂无数据!"));
  207. }
  208. else
  209. {
  210. return Ok(JsonView(false, "暂无数据!"));
  211. }
  212. }
  213. catch (Exception ex)
  214. {
  215. return Ok(JsonView(false, "程序错误!"));
  216. throw;
  217. }
  218. }
  219. /// <summary>
  220. /// 部门添加
  221. /// </summary>
  222. /// <param name="dto"></param>
  223. /// <returns></returns>
  224. [HttpPost]
  225. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  226. public async Task<IActionResult> AddDepartment(AddDepartmentDto dto)
  227. {
  228. try
  229. {
  230. if (dto.CreateUserId == 0 || string.IsNullOrWhiteSpace(dto.DepName) || dto.CompanyId == 0 || string.IsNullOrWhiteSpace(dto.DepCode))
  231. {
  232. return Ok(JsonView(false, "请检查信息是否输入完整!"));
  233. }
  234. else
  235. {
  236. Sys_Department _Department = _mapper.Map<Sys_Department>(dto);
  237. int id = await _sysDepRep.AddAsyncReturnId(_Department);
  238. if (id == 0)
  239. {
  240. return Ok(JsonView(false, "添加失败!"));
  241. }
  242. return Ok(JsonView(true, "添加成功!", new { Id = id }));
  243. }
  244. }
  245. catch (Exception)
  246. {
  247. return Ok(JsonView(false, "程序错误!"));
  248. throw;
  249. }
  250. }
  251. /// <summary>
  252. /// 部门修改
  253. /// </summary>
  254. /// <param name="dto"></param>
  255. /// <returns></returns>
  256. [HttpPost]
  257. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  258. public async Task<IActionResult> EditDepartment(EditDepartmentDto dto)
  259. {
  260. try
  261. {
  262. if (dto.Id==0 || string.IsNullOrWhiteSpace(dto.DepName) || dto.CompanyId == 0 || string.IsNullOrWhiteSpace(dto.DepCode))
  263. {
  264. return Ok(JsonView(false, "请检查信息是否输入完整!"));
  265. }
  266. else
  267. {
  268. bool res = await _sysDepRep.UpdateAsync<Sys_Department>(a => a.Id == dto.Id, a => new Sys_Department
  269. {
  270. CompanyId=dto.CompanyId,
  271. DepCode=dto.DepCode,
  272. DepName=dto.DepName,
  273. ParentDepId=dto.ParentDepId,
  274. Remark=dto.Remark,
  275. });
  276. if (!res)
  277. {
  278. return Ok(JsonView(false, "修改失败!"));
  279. }
  280. return Ok(JsonView(true, "修改成功!"));
  281. }
  282. }
  283. catch (Exception)
  284. {
  285. return Ok(JsonView(false, "程序错误!"));
  286. throw;
  287. }
  288. }
  289. /// <summary>
  290. /// 部门删除
  291. /// </summary>
  292. /// <param name="dto"></param>
  293. /// <returns></returns>
  294. [HttpPost]
  295. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  296. public async Task<IActionResult> DelDepartment(DelDepartmentDto dto)
  297. {
  298. try
  299. {
  300. if (dto.Id == 0)
  301. {
  302. return Ok(JsonView(-1, "请检查信息是否输入完整!", null));
  303. }
  304. else
  305. {
  306. bool res =await _sysDepRep.SoftDeleteAsync<Sys_Department>(dto.Id.ToString());
  307. if (!res)
  308. {
  309. return Ok(JsonView(false, "删除失败!"));
  310. }
  311. return Ok(JsonView(true, "删除成功!"));
  312. }
  313. }
  314. catch (Exception)
  315. {
  316. return Ok(JsonView(false, "程序错误!"));
  317. throw;
  318. }
  319. }
  320. #endregion
  321. #region 岗位板块
  322. /// <summary>
  323. /// 岗位查询
  324. /// </summary>
  325. /// <param name="dto"></param>
  326. /// <returns></returns>
  327. [HttpPost]
  328. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  329. public async Task<IActionResult> QueryJobPost(QueryJobPostDto dto)
  330. {
  331. try
  332. {
  333. if (dto.PortType == 1)
  334. {
  335. return Ok(JsonView(false, "暂无数据!"));
  336. }
  337. else if (dto.PortType == 2)
  338. {
  339. var result = _jobRep.QueryDto<Sys_JobPost, JobPostView>(s => s.CompanyId == dto.CompanyId && s.DepId==dto.DepId).ToList();
  340. if (result.Count == 0)
  341. {
  342. return Ok(JsonView(false, "暂无数据!"));
  343. }
  344. return Ok(JsonView(true, "查询成功!", result));
  345. }
  346. else if (dto.PortType == 3)
  347. {
  348. return Ok(JsonView(false, "暂无数据!"));
  349. }
  350. else
  351. {
  352. return Ok(JsonView(false, "暂无数据!"));
  353. }
  354. }
  355. catch (Exception ex)
  356. {
  357. return Ok(JsonView(false, "程序错误!"));
  358. throw;
  359. }
  360. }
  361. /// <summary>
  362. /// 添加岗位
  363. /// </summary>
  364. /// <param name="dto"></param>
  365. /// <returns></returns>
  366. [HttpPost]
  367. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  368. public async Task<IActionResult> AddJobPost(AddJobPostDto dto)
  369. {
  370. try
  371. {
  372. Sys_JobPost sys_Job = _mapper.Map<Sys_JobPost>(dto);
  373. int id = await _jobRep.AddAsyncReturnId(sys_Job);
  374. if (id == 0)
  375. {
  376. return Ok(JsonView(false, "添加失败"));
  377. }
  378. return Ok(JsonView(true, "添加成功", new { Id = id }));
  379. }
  380. catch (Exception ex)
  381. {
  382. return Ok(JsonView(false, "程序错误!"));
  383. throw;
  384. }
  385. }
  386. /// <summary>
  387. /// 修改岗位
  388. /// </summary>
  389. /// <param name="dto"></param>
  390. /// <returns></returns>
  391. [HttpPost]
  392. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  393. public async Task<IActionResult> EditJobPost(EditJobPostDto dto)
  394. {
  395. try
  396. {
  397. bool res = await _jobRep.UpdateAsync<Sys_JobPost>(a=>a.Id==dto.Id,a =>new Sys_JobPost
  398. {
  399. CompanyId=dto.CompanyId,
  400. DepId=dto.DepId,
  401. JobName=dto.JobName,
  402. Remark=dto.Remark,
  403. });
  404. if (!res)
  405. {
  406. return Ok(JsonView(false, "修改失败"));
  407. }
  408. return Ok(JsonView(true, "修改成功"));
  409. }
  410. catch (Exception ex)
  411. {
  412. return Ok(JsonView(false, "程序错误!"));
  413. throw;
  414. }
  415. }
  416. /// <summary>
  417. /// 删除岗位
  418. /// </summary>
  419. /// <param name="dto"></param>
  420. /// <returns></returns>
  421. [HttpPost]
  422. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  423. public async Task<IActionResult> DelJobPost(DelJobPostDto dto)
  424. {
  425. try
  426. {
  427. bool res = await _jobRep.SoftDeleteAsync<Sys_JobPost>(dto.Id.ToString());
  428. if (!res)
  429. {
  430. return Ok(JsonView(false, "删除失败!"));
  431. }
  432. return Ok(JsonView(true, "删除成功"));
  433. }
  434. catch (Exception)
  435. {
  436. return Ok(JsonView(false, "程序错误!"));
  437. throw;
  438. }
  439. }
  440. #endregion
  441. #region 用户操作
  442. /// <summary>
  443. /// 查询所有员工(web)
  444. /// </summary>
  445. /// <param name="dto"></param>
  446. /// <returns></returns>
  447. [HttpPost]
  448. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  449. public async Task<IActionResult> GetUserList(DtoBase dto)
  450. {
  451. try
  452. {
  453. var result = _userRep.GetUserList(dto.PortType, string.Empty);
  454. if (result.Result.Code != 0)
  455. {
  456. return Ok(JsonView(false, "暂无数据!"));
  457. }
  458. return Ok(JsonView(true, "查询成功!", result.Result.Data));
  459. }
  460. catch (Exception)
  461. {
  462. return Ok(JsonView(false, "程序错误!"));
  463. throw;
  464. }
  465. }
  466. /// <summary>
  467. /// 查询用户数据
  468. /// </summary>
  469. /// <param name="dto"></param>
  470. /// <returns></returns>
  471. [HttpPost]
  472. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  473. public async Task<IActionResult> QueryUserList(UserDto dto)
  474. {
  475. try
  476. {
  477. string sqlWhere = string.Empty;
  478. if (dto.CompanyId!=0)
  479. {
  480. sqlWhere += string.Format(@" And su.CompanyId={0}", dto.CompanyId);
  481. }
  482. if (dto.DepId != 0)
  483. {
  484. sqlWhere += string.Format(@" And su.DepId={0}", dto.DepId);
  485. }
  486. if (!string.IsNullOrEmpty(sqlWhere.Trim()))
  487. {
  488. Regex r = new Regex("And");
  489. sqlWhere = r.Replace(sqlWhere, "Where", 1);
  490. }
  491. var result=_userRep.GetUserList(dto.PortType,sqlWhere);
  492. if (result.Result.Code!=0)
  493. {
  494. return Ok(JsonView(false, "暂无数据!"));
  495. }
  496. return Ok(JsonView(true,"查询成功!",result.Result.Data));
  497. }
  498. catch (Exception)
  499. {
  500. return Ok(JsonView(false, "程序错误!"));
  501. throw;
  502. }
  503. }
  504. /// <summary>
  505. /// 修改用户信息(上级修改/分配 公司、部门、岗位、工号等信息)
  506. /// </summary>
  507. /// <param name="dto"></param>
  508. /// <returns></returns>
  509. [HttpPost]
  510. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  511. public async Task<IActionResult> EditUser(EditUserDto dto)
  512. {
  513. try
  514. {
  515. bool res = await _userRep.UpdateAsync<Sys_Users>(a => a.Id == dto.Id, a => new Sys_Users
  516. {
  517. Number = dto.Number,
  518. CompanyId = dto.CompanyId,
  519. DepId = dto.DepId,
  520. JobPostId = dto.JobPostId,
  521. Ext = dto.Ext,
  522. UsePeriod = dto.UsePeriod,
  523. HrAudit = dto.HrAudit
  524. });
  525. if (!res)
  526. {
  527. return Ok(JsonView(false, "修改失败!"));
  528. }
  529. return Ok(JsonView(true, "修改成功!"));
  530. }
  531. catch (Exception)
  532. {
  533. return Ok(JsonView(false, "程序错误!"));
  534. throw;
  535. }
  536. }
  537. /// <summary>
  538. /// 修改用户信息(登录用户修改个人信息)
  539. /// </summary>
  540. /// <param name="dto"></param>
  541. /// <returns></returns>
  542. [HttpPost]
  543. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  544. public async Task<IActionResult> EditMyUser(EditMyUserDto dto)
  545. {
  546. try
  547. {
  548. if (string.IsNullOrWhiteSpace(dto.CnName) || string.IsNullOrWhiteSpace(dto.Address) || string.IsNullOrWhiteSpace(dto.IDCard) || dto.Sex != 0 && dto.Sex != 1 ||
  549. string.IsNullOrWhiteSpace(dto.MaritalStatus) || string.IsNullOrWhiteSpace(dto.HomeAddress)|| dto.Birthday>=DateTime.Now.AddYears(-1))
  550. {
  551. return Ok(JsonView(false, "请完善你的个人信息!"));
  552. }
  553. else if (string.IsNullOrWhiteSpace(dto.GraduateInstitutions) || string.IsNullOrWhiteSpace(dto.Professional) || dto.Education == 0 || string.IsNullOrWhiteSpace(dto.GraduateInstitutions))
  554. {
  555. return Ok(JsonView(false, "请完善你的学历信息!"));
  556. }
  557. else if (string.IsNullOrWhiteSpace(dto.Phone) || string.IsNullOrWhiteSpace(dto.UrgentPhone) || string.IsNullOrWhiteSpace(dto.Email))
  558. {
  559. return Ok(JsonView(false, "请检查联系方式、紧急联系人及邮箱输写是否正确!"));
  560. }
  561. else
  562. {
  563. bool res = await _userRep.UpdateAsync<Sys_Users>(a => a.Id == dto.Id, a => new Sys_Users
  564. {
  565. CnName = dto.CnName,
  566. EnName = dto.EnName,
  567. Sex = dto.Sex,
  568. Phone = dto.Phone,
  569. UrgentPhone = dto.UrgentPhone,
  570. Email = dto.Email,
  571. Address = dto.Address,
  572. Edate = dto.Edate,
  573. Birthday = dto.Birthday,
  574. IDCard = dto.IDCard,
  575. GraduateInstitutions = dto.GraduateInstitutions,
  576. Professional = dto.Professional,
  577. Education = dto.Education,
  578. TheOrAdultEducation = dto.TheOrAdultEducation,
  579. MaritalStatus = dto.MaritalStatus,
  580. HomeAddress = dto.HomeAddress,
  581. WorkExperience = dto.WorkExperience,
  582. Certificate = dto.Certificate
  583. });
  584. if (!res)
  585. {
  586. return Ok(JsonView(false, "修改失败!"));
  587. }
  588. return Ok(JsonView(true, "修改成功!"));
  589. }
  590. }
  591. catch (Exception)
  592. {
  593. return Ok(JsonView(false, "程序错误!"));
  594. throw;
  595. }
  596. }
  597. #endregion
  598. #region 权限模块
  599. /// <summary>
  600. /// 权限数据页面初始化
  601. /// </summary>
  602. /// <param name="dto"></param>
  603. /// <returns></returns>
  604. //[Authorize]
  605. [HttpPost]
  606. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  607. public async Task<IActionResult> GetAuth(AuthDto dto)
  608. {
  609. Result result = new Result();
  610. //模块数据
  611. var setDataResult = await _setDataRepository.GetSySDefultModule(_setDataRepository);
  612. if (setDataResult.Code != 0)
  613. {
  614. return Ok(JsonView(setDataResult.Msg));
  615. }
  616. List<SetDataView> setDataList = _mapper.Map<List<SetDataView>>(setDataResult.Data);
  617. var mod = setDataList.Find(x => x.Name == "权限模块");
  618. if (mod == null)
  619. {
  620. return Ok(JsonView("未找到权限模块!"));
  621. }
  622. //页面数据
  623. var SystemMenuPermissionData = _SystemMenuPermissionRepository.GetSystemMenuViweData(_SystemMenuPermissionRepository, mod.Id, dto.pageSize, dto.currentPage);
  624. if (SystemMenuPermissionData.Code != 0)
  625. {
  626. return Ok(JsonView(SystemMenuPermissionData.Msg));
  627. }
  628. //公司数据
  629. var CompanyDataResult = _CompanyRepository.GetCompanyData();
  630. if (CompanyDataResult.Code != 0)
  631. {
  632. return Ok(JsonView(CompanyDataResult.Msg));
  633. }
  634. result.Code = 0;
  635. result.Msg = "成功!";
  636. var Dyresult = new
  637. {
  638. setDataResult = setDataResult.Data,
  639. CompanyDataResult = CompanyDataResult.Data,
  640. SystemMenuPermissionData = SystemMenuPermissionData.Data
  641. };
  642. return Ok(JsonView(200, "成功!", Dyresult));
  643. }
  644. #endregion
  645. }
  646. }