|
@@ -1,4 +1,4 @@
|
|
|
-using OASystem.Domain.Dtos.System;
|
|
|
+using Org.BouncyCastle.Asn1.Cms;
|
|
|
using System.Collections;
|
|
|
using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
|
|
|
|
|
@@ -16,7 +16,7 @@ namespace OASystem.API.Controllers
|
|
|
private readonly DepartmentRepository _sysDepRep;
|
|
|
private readonly UsersRepository _userRep;
|
|
|
private readonly IMapper _mapper;
|
|
|
- private readonly MessageRepository _messageRep;
|
|
|
+
|
|
|
private readonly SetDataRepository _setDataRepository;
|
|
|
private readonly SystemMenuPermissionRepository _SystemMenuPermissionRepository;
|
|
|
private readonly CompanyRepository _CompanyRepository;
|
|
@@ -24,18 +24,18 @@ namespace OASystem.API.Controllers
|
|
|
private readonly SystemMenuAndFunctionRepository _SystemMenuAndFunctionRepository;
|
|
|
private readonly JobPostAuthorityRepository _JobPostAuthorityRepository;
|
|
|
private readonly JobPostRepository _jobRep;
|
|
|
+
|
|
|
private readonly UserAuthorityRepository _UserAuthorityRepository;
|
|
|
|
|
|
public SystemController( CompanyRepository syscom, DepartmentRepository sysDepRep, UsersRepository userRep,
|
|
|
IMapper mapper, SetDataRepository setDataRepository, CompanyRepository companyRepository,
|
|
|
SystemMenuPermissionRepository systemMenuPermissionRepository, PageFunctionPermissionRepository pageFunctionPermissionRepository,
|
|
|
- SystemMenuAndFunctionRepository systemMenuAndFunctionRepository, JobPostAuthorityRepository jobPostAuthorityRepository,
|
|
|
- JobPostRepository jobRep,UserAuthorityRepository userAuthorityRepository, MessageRepository messageRep)
|
|
|
+ SystemMenuAndFunctionRepository systemMenuAndFunctionRepository, JobPostAuthorityRepository jobPostAuthorityRepository, JobPostRepository jobRep
|
|
|
+ , UserAuthorityRepository userAuthorityRepository)
|
|
|
|
|
|
{
|
|
|
_syscomRep = syscom;
|
|
|
_sysDepRep = sysDepRep;
|
|
|
- _messageRep = messageRep;
|
|
|
_userRep = userRep;
|
|
|
_mapper = mapper;
|
|
|
_setDataRepository = setDataRepository;
|
|
@@ -45,83 +45,42 @@ namespace OASystem.API.Controllers
|
|
|
_SystemMenuAndFunctionRepository = systemMenuAndFunctionRepository;
|
|
|
_JobPostAuthorityRepository = jobPostAuthorityRepository;
|
|
|
_UserAuthorityRepository = userAuthorityRepository;
|
|
|
+ _jobRep = jobRep;
|
|
|
}
|
|
|
#region 消息
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 获取消息列表
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost]
|
|
|
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GetMsgList(MsgDto dto)
|
|
|
- {
|
|
|
- var msgData = await _messageRep.GetMsgList(dto);
|
|
|
|
|
|
- if (msgData.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, msgData.Msg));
|
|
|
- }
|
|
|
|
|
|
- return Ok(JsonView(true, msgData.Data));
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 获取消息详细信息
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost]
|
|
|
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GetMsgInfo(MsgInfoDto dto)
|
|
|
- {
|
|
|
- var msgData = await _messageRep.GetMsgInfo(dto);
|
|
|
-
|
|
|
- if (msgData.Code != 0)
|
|
|
- {
|
|
|
- return Ok(JsonView(false, msgData.Msg));
|
|
|
- }
|
|
|
-
|
|
|
- return Ok(JsonView(true, msgData.Data));
|
|
|
- }
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region 类型表
|
|
|
/// <summary>
|
|
|
- /// 消息设置已读
|
|
|
+ /// 查询类型数据
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> SetMessageRead(MsgSetReadDto dto)
|
|
|
+ public async Task<IActionResult> QuerSetData(SetDataDto dto)
|
|
|
{
|
|
|
- var msgData = await _messageRep.SetMsgRead(dto);
|
|
|
-
|
|
|
- if (msgData.Code != 0)
|
|
|
+ try
|
|
|
{
|
|
|
- return Ok(JsonView(false, msgData.Msg));
|
|
|
+ if (dto.DataType==0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请传类型Id!"));
|
|
|
+ }
|
|
|
+ var setData = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s=>s.STid==dto.DataType).ToList();
|
|
|
+ if (setData.Count == 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "暂无数据!"));
|
|
|
+ }
|
|
|
+ return Ok(JsonView(true, "查询成功!",setData));
|
|
|
}
|
|
|
-
|
|
|
- return Ok(JsonView(true, msgData.Data));
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 消息设置已读
|
|
|
- /// </summary>
|
|
|
- /// <param name="dto"></param>
|
|
|
- /// <returns></returns>
|
|
|
- [HttpPost]
|
|
|
- [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> DeleMsg(MsgDeleteDto dto)
|
|
|
- {
|
|
|
- var msgData = await _messageRep.DelMsg(dto);
|
|
|
-
|
|
|
- if (msgData.Code != 0)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- return Ok(JsonView(false, msgData.Msg));
|
|
|
+ return Ok(JsonView(false, "程序错误!"));
|
|
|
+ throw;
|
|
|
}
|
|
|
-
|
|
|
- return Ok(JsonView(true, msgData.Data));
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
@@ -514,12 +473,28 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
if (dto.PortType == 1)
|
|
|
{
|
|
|
- var result = _sysDepRep.QueryDto<Sys_JobPost, JobPostView>(s => s.CompanyId == dto.CompanyId && s.DepId == dto.DepId).ToList();
|
|
|
- if (result.Count == 0)
|
|
|
+ string sqlWhere = string.Empty;
|
|
|
+ if (dto.CompanyId != 0)
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And jp.CompanyId={0}", dto.CompanyId);
|
|
|
+ }
|
|
|
+ if (dto.DepId != 0)
|
|
|
+ {
|
|
|
+ sqlWhere += string.Format(@" And jp.DepId={0}", dto.DepId);
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(sqlWhere.Trim()))
|
|
|
+ {
|
|
|
+ Regex r = new Regex("And");
|
|
|
+ sqlWhere = r.Replace(sqlWhere, "Where", 1);
|
|
|
+ }
|
|
|
+ List<Sys_JobPostI> jobList = await _jobRep.QueryJobPost(sqlWhere);
|
|
|
+
|
|
|
+ List<JobPostView> List = _mapper.Map<List<JobPostView>>(jobList);
|
|
|
+ if (jobList.Count == 0)
|
|
|
{
|
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
- return Ok(JsonView(true, "查询成功!", result));
|
|
|
+ return Ok(JsonView(true, "查询成功!", jobList));
|
|
|
}
|
|
|
else if (dto.PortType == 2)
|
|
|
{
|
|
@@ -683,14 +658,9 @@ namespace OASystem.API.Controllers
|
|
|
Regex r = new Regex("And");
|
|
|
sqlWhere = r.Replace(sqlWhere, "Where", 1);
|
|
|
}
|
|
|
- string userSqlWhere = string.Format(@"Select sc.CompanyName,sd.DepName,sjp.JobName,su.* From Sys_Users su
|
|
|
- Inner Join Sys_Company sc On su.CompanyId = sc.Id
|
|
|
- Inner Join Sys_Department sd On su.DepId = sd.Id
|
|
|
- Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id {0}", sqlWhere);
|
|
|
- var _userList =_userRep.GetListBySqlWithNolock(userSqlWhere);
|
|
|
+ List<UserInfo> _userList =await _userRep.QueryUser(sqlWhere);
|
|
|
if (_userList.Count == 0)
|
|
|
{
|
|
|
-
|
|
|
return Ok(JsonView(false, "暂无数据!"));
|
|
|
}
|
|
|
List<UserInfoWebView> userList = _mapper.Map<List<UserInfoWebView>>(_userList);
|