|
@@ -1,32 +1,20 @@
|
|
|
-using Aliyun.Credentials.Utils;
|
|
|
-using Aspose.Cells;
|
|
|
+using Aspose.Cells;
|
|
|
using FluentValidation;
|
|
|
-using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
-using Microsoft.IdentityModel.Tokens;
|
|
|
-using NPOI.POIFS.Crypt.Dsig;
|
|
|
using OASystem.API.OAMethodLib;
|
|
|
using OASystem.API.OAMethodLib.Hub.HubClients;
|
|
|
using OASystem.API.OAMethodLib.Hub.Hubs;
|
|
|
using OASystem.API.OAMethodLib.QiYeWeChatAPI;
|
|
|
-using OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice;
|
|
|
using OASystem.API.OAMethodLib.Quartz.Business;
|
|
|
-using OASystem.API.OAMethodLib.SignalR.Hubs;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Dtos.PersonnelModule;
|
|
|
-using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.Entities.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using OASystem.Infrastructure.Repositories.PersonnelModule;
|
|
|
-using Org.BouncyCastle.Asn1.Ocsp;
|
|
|
-using StackExchange.Redis;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.ComponentModel;
|
|
|
using System.Data;
|
|
|
using System.Diagnostics;
|
|
|
using System.Globalization;
|
|
|
-using System.IO;
|
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
@@ -45,8 +33,6 @@ namespace OASystem.API.Controllers
|
|
|
private readonly UsersRepository _usersRep;
|
|
|
private readonly TaskAllocationRepository _taskAllocationRep;
|
|
|
|
|
|
- private string url;
|
|
|
- private string path;
|
|
|
private readonly IHubContext<ChatHub, IChatClient> _hubContext;
|
|
|
private readonly GoodsRepository _goodsRep;
|
|
|
|
|
@@ -113,20 +99,19 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GetWageSheetMonthWorkdays(string startDt, string endDt)
|
|
|
{
|
|
|
-
|
|
|
//参数处理
|
|
|
- string dtFormat = "yyyy-MM-dd";
|
|
|
+ var dtFormat = "yyyy-MM-dd";
|
|
|
DateTime startDt1, endDt1;
|
|
|
- bool startDtIsValid = DateTime.TryParseExact(startDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt1);
|
|
|
- bool endDtIsValid = DateTime.TryParseExact(endDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt1);
|
|
|
+ var startDtIsValid = DateTime.TryParseExact(startDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt1);
|
|
|
+ var endDtIsValid = DateTime.TryParseExact(endDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt1);
|
|
|
|
|
|
if (!startDtIsValid) return Ok(JsonView(false, "开始日期格式错误!正确时间格式:yyyy-MM-dd "));
|
|
|
if (!endDtIsValid) return Ok(JsonView(false, "结束格式错误!正确时间格式:yyyy-MM-dd "));
|
|
|
|
|
|
|
|
|
|
|
|
- string sql = string.Format(@"Select * From Sys_Calendar
|
|
|
- Where Isdel = 0 And Dt between '{0}' And '{1}'", startDt, endDt);
|
|
|
+ var sql = string.Format(@"Select * From Sys_Calendar
|
|
|
+ Where Isdel = 0 And Dt between '{0}' And '{1}'", startDt, endDt);
|
|
|
var data = await _wageSheetRep._sqlSugar.SqlQueryable<CalendarInfoView>(sql).ToListAsync();
|
|
|
|
|
|
return Ok(JsonView(true, "查询成功!", data));
|
|
@@ -165,7 +150,7 @@ namespace OASystem.API.Controllers
|
|
|
sys_Calendars = sys_Calendars.OrderBy(it => it.Dt).ToList();
|
|
|
}
|
|
|
|
|
|
- pm_WageIssueWorkingDay1.Workdays = sys_Calendars.Where(it => it.IsWorkDay == true).ToList().Count();
|
|
|
+ pm_WageIssueWorkingDay1.Workdays = sys_Calendars.Where(it => it.IsWorkDay == true).ToList().Count;
|
|
|
foreach (var item in sys_Calendars)
|
|
|
{
|
|
|
item.Remark = pm_WageIssueWorkingDay1.Remark;
|
|
@@ -223,7 +208,7 @@ namespace OASystem.API.Controllers
|
|
|
YearMonth = dto.YearMonth,
|
|
|
StartDate = dto.StartDate,
|
|
|
EndDate = dto.EndDate,
|
|
|
- Workdays = calendarsDatas.Where(it => it.IsWorkDay == true).ToList().Count()
|
|
|
+ Workdays = calendarsDatas.Where(it => it.IsWorkDay == true).ToList().Count
|
|
|
};
|
|
|
|
|
|
string sql = string.Format("Select * From Pm_WageIssueWorkingDay Where Isdel = 0 And YearMonth='{0}'", dto.YearMonth);
|
|
@@ -671,8 +656,8 @@ namespace OASystem.API.Controllers
|
|
|
if (!yearMonthDtIsValid) return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM "));
|
|
|
//公司部门
|
|
|
string sql = string.Format(@"Select row_number() over(order by pm_ws.Id) as Row_Number,
|
|
|
- sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName,
|
|
|
- sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.*
|
|
|
+ sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName,
|
|
|
+ sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.*
|
|
|
From Pm_WageSheet pm_ws
|
|
|
Left Join Sys_Users sys_u1 On pm_ws.UserId = sys_u1.Id
|
|
|
Left Join Sys_Users sys_u2 On pm_ws.LastUpdateUserId = sys_u2.Id
|
|
@@ -853,8 +838,8 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
//公司部门
|
|
|
string sql = string.Format(@"Select row_number() over(order by pm_ws.Id) as Row_Number,
|
|
|
- sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName,
|
|
|
- sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.*
|
|
|
+ sc.Id as CompanyId,sc.CompanyName,sd.Id as DepId,sd.DepName,
|
|
|
+ sys_u1.CnName Name,sys_u2.CnName LastUpdateUserName,pm_ws.*
|
|
|
From Pm_WageSheet pm_ws
|
|
|
Left Join Sys_Users sys_u1 On pm_ws.UserId = sys_u1.Id
|
|
|
Left Join Sys_Users sys_u2 On pm_ws.LastUpdateUserId = sys_u2.Id
|
|
@@ -881,8 +866,8 @@ namespace OASystem.API.Controllers
|
|
|
.Select(it =>
|
|
|
{
|
|
|
//修改 绩效不等于0.00M的数据
|
|
|
- decimal oldTax = it.WithholdingTax;
|
|
|
- decimal newTax = Convert.ToDecimal(taxData.Rows[i][1].ToString());
|
|
|
+ //decimal oldTax = it.WithholdingTax;
|
|
|
+ var newTax = Convert.ToDecimal(taxData.Rows[i][1].ToString());
|
|
|
it.WithholdingTax = newTax;
|
|
|
it.TotalRealHair = it.Should - it.TotalDeductions - newTax;
|
|
|
return it;
|
|
@@ -983,25 +968,25 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationInit(TaskAllocationInitDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationInit(TaskAllocationInitDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._Init(_dto.PortType, _dto.UserId);
|
|
|
+ var _view = await _taskAllocationRep._Init(dto.PortType, dto.UserId);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
return Ok(JsonView(true, "查询成功!", _view.Data));
|
|
@@ -1023,18 +1008,18 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationPage(TaskAllocationPageDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationPage(TaskAllocationPageDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
|
|
|
#endregion
|
|
@@ -1046,29 +1031,29 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
//类型处理
|
|
|
- if (_dto.Type == 0) whereSql = "";
|
|
|
- else if (_dto.Type == 1) //1 由我指派
|
|
|
+ if (dto.Type == 0) whereSql = "";
|
|
|
+ else if (dto.Type == 1) //1 由我指派
|
|
|
{
|
|
|
- whereSql = string.Format(@" And ta.CreateUserId = {0} Or (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", _dto.UserId);
|
|
|
+ whereSql = string.Format(@" And ta.CreateUserId = {0} Or (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", dto.UserId);
|
|
|
}
|
|
|
- else if (_dto.Type == 2)// 2 指派给我
|
|
|
+ else if (dto.Type == 2)// 2 指派给我
|
|
|
{
|
|
|
- whereSql = string.Format(@" And (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", _dto.UserId);
|
|
|
+ whereSql = string.Format(@" And (Select COUNT(1) As PeopleNumber From Pm_TaskRelevanceUser Where IsDel = 0 And ta.Id = TAId And UserId = {0}) > 0", dto.UserId);
|
|
|
}
|
|
|
//状态 -1 全部 0 未开始 1 进行中 2 待审核 3 未完成 4 已完成
|
|
|
- if (_dto.Status == -1) //全部
|
|
|
+ if (dto.Status == -1) //全部
|
|
|
{
|
|
|
whereSql += "";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- whereSql += string.Format(@" And ta.Status = {0} ", _dto.Status);
|
|
|
+ whereSql += string.Format(@" And ta.Status = {0} ", dto.Status);
|
|
|
}
|
|
|
|
|
|
//任务名称
|
|
|
- if (!string.IsNullOrEmpty(_dto.TaskName))
|
|
|
+ if (!string.IsNullOrEmpty(dto.TaskName))
|
|
|
{
|
|
|
- whereSql += string.Format(@" And ta.TaskName Like '%{0}%' ", _dto.TaskName);
|
|
|
+ whereSql += string.Format(@" And ta.TaskName Like '%{0}%' ", dto.TaskName);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -1094,16 +1079,16 @@ namespace OASystem.API.Controllers
|
|
|
Where ta.IsDel = 0 {0} ) As temp ", whereSql);
|
|
|
|
|
|
RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
|
|
|
- var _view = await _taskAllocationRep._sqlSugar.SqlQueryable<TaskListView>(pageSql).ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);//ToPageAsync
|
|
|
+ var _view = await _taskAllocationRep._sqlSugar.SqlQueryable<TaskListView>(pageSql).ToPageListAsync(dto.PageIndex, dto.PageSize, total);//ToPageAsync
|
|
|
|
|
|
List<int> taskIds = new List<int>();
|
|
|
taskIds = _view.Select(it => it.Id).ToList();
|
|
|
|
|
|
string taskerSql = string.Format(@"Select tau.TAId,tau.Id,tau.UserId,u.CnName As UserName,tau.BeginTime,tau.OverTime,tau.TaskStatus,
|
|
|
- tau.Cause,tau.Score,tau.Remark As ScoreRemark,tau.CreateUserId As TaskCreateUserId
|
|
|
- From Pm_TaskRelevanceUser tau
|
|
|
- Left Join Sys_Users u On tau.UserId = u.Id
|
|
|
- Where tau.IsDel = 0");
|
|
|
+ tau.Cause,tau.Score,tau.Remark As ScoreRemark,tau.CreateUserId As TaskCreateUserId
|
|
|
+ From Pm_TaskRelevanceUser tau
|
|
|
+ Left Join Sys_Users u On tau.UserId = u.Id
|
|
|
+ Where tau.IsDel = 0");
|
|
|
|
|
|
var taskerData = _taskAllocationRep._sqlSugar.SqlQueryable<TaskerDetailsView>(taskerSql).Where(it => taskIds.Contains(it.TAId)).ToList();
|
|
|
foreach (var item in _view)
|
|
@@ -1111,7 +1096,7 @@ namespace OASystem.API.Controllers
|
|
|
item.TaskerDetails = taskerData.Where(it => it.TAId == item.Id).ToList();
|
|
|
|
|
|
////处理任务总状态 And 任务人状态
|
|
|
- //var taskerStatusData = taskerData.Where(it => it.TAId == item.Id && it.TaskCreateUserId != _dto.UserId && it.UserId == _dto.UserId).FirstOrDefault();
|
|
|
+ //var taskerStatusData = taskerData.Where(it => it.TAId == item.Id && it.TaskCreateUserId != dto.UserId && it.UserId == dto.UserId).FirstOrDefault();
|
|
|
//if (taskerStatusData != null)
|
|
|
//{
|
|
|
// item.Status = taskerStatusData.TaskStatus;
|
|
@@ -1135,25 +1120,25 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationDetails(TaskAllocationDetailsDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationDetails(TaskAllocationDetailsDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限!"));
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._Details(_dto.PortType, _dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._Details(dto.PortType, dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
return Ok(JsonView(true, "查询成功!", _view.Data));
|
|
@@ -1174,24 +1159,24 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationAddOrEdit(TaskAllocationAddOrEditDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationAddOrEdit(TaskAllocationAddOrEditDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
- if (_dto.Id == 0)
|
|
|
+ if (dto.Id == 0)
|
|
|
{
|
|
|
if (pageFunAuthView.AddAuth == 0) return Ok(JsonView(false, "您没有添加权限!"));
|
|
|
}
|
|
|
- else if (_dto.Id > 0)
|
|
|
+ else if (dto.Id > 0)
|
|
|
{
|
|
|
|
|
|
if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
|
|
@@ -1202,16 +1187,16 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._AddOrEdit(_dto);
|
|
|
+ var _view = await _taskAllocationRep._AddOrEdit(dto);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
|
|
|
- if (_dto.Id == 0) //添加提示任务单创建
|
|
|
+ if (dto.Id == 0) //添加提示任务单创建
|
|
|
{
|
|
|
- string title = $"[{_dto.TaskName}] 任务新建成功!";
|
|
|
- string content = $"[{_dto.TaskName}] 任务新建成功,请前往任务页面查看详情!";
|
|
|
+ string title = $"[{dto.TaskName}] 任务新建成功!";
|
|
|
+ string content = $"[{dto.TaskName}] 任务新建成功,请前往任务页面查看详情!";
|
|
|
|
|
|
- await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content, _dto.UserIds);
|
|
|
+ await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content, dto.UserIds);
|
|
|
}
|
|
|
|
|
|
return Ok(JsonView(true, "操作成功!"));
|
|
@@ -1232,11 +1217,11 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationTaskerDetails(TaskerDetailsDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationTaskerDetails(TaskerDetailsDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskerDetails(_dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._TaskerDetails(dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
return Ok(JsonView(true, "操作成功!", _view.Data));
|
|
@@ -1257,24 +1242,24 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationSetStartStatus(TaskerStatusDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationSetStartStatus(TaskerStatusDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskerSetStartStatus(_dto.UserId, _dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._TaskerSetStartStatus(dto.UserId, dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
|
|
|
+ var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
|
|
|
if (taskData != null)
|
|
|
{
|
|
|
- var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == _dto.Id).Select(it => it.UserId).ToList();
|
|
|
+ var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == dto.Id).Select(it => it.UserId).ToList();
|
|
|
if (taskUserIds.Count > 0)
|
|
|
{
|
|
|
- taskUserIds.Remove(_dto.UserId);
|
|
|
+ taskUserIds.Remove(dto.UserId);
|
|
|
}
|
|
|
|
|
|
- var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == _dto.UserId).Select(it => it.CnName).First();
|
|
|
+ var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == dto.UserId).Select(it => it.CnName).First();
|
|
|
|
|
|
string title_createUser = $"[{taskData.TaskName}] 进度更新!";
|
|
|
string conten_createUser = $"[{UserName}] 已开始任务,请注意该工作人员任务进度!";
|
|
@@ -1288,7 +1273,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
string content1 = $"任务已开始,请在规定时间完成!若需查看,请前往任务页面查看详情!";
|
|
|
- await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { _dto.UserId }); //设置任务人 发送消息
|
|
|
+ await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { dto.UserId }); //设置任务人 发送消息
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1310,24 +1295,24 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationSetOverStatus(TaskerStatusDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationSetOverStatus(TaskerStatusDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskerSetOverStatus(_dto.UserId, _dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._TaskerSetOverStatus(dto.UserId, dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
|
|
|
+ var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
|
|
|
if (taskData != null)
|
|
|
{
|
|
|
- var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == _dto.Id).Select(it => it.UserId).ToList();
|
|
|
+ var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.TAId == dto.Id).Select(it => it.UserId).ToList();
|
|
|
if (taskUserIds.Count > 0)
|
|
|
{
|
|
|
- taskUserIds.Remove(_dto.UserId);
|
|
|
+ taskUserIds.Remove(dto.UserId);
|
|
|
}
|
|
|
|
|
|
- var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == _dto.UserId).Select(it => it.CnName).First();
|
|
|
+ var UserName = _taskAllocationRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.Id == dto.UserId).Select(it => it.CnName).First();
|
|
|
|
|
|
string title_createUser = $"[{taskData.TaskName}] 进度更新!";
|
|
|
string conten_createUser = $"[{UserName}] 已完成任务,请前往任务页面进行审核操作!";
|
|
@@ -1341,7 +1326,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
string content1 = $"任务已完成,等待任务发布人审核!若需查看,请前往任务页面查看详情!";
|
|
|
- await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { _dto.UserId }); //设置任务人 发送消息
|
|
|
+ await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.TaskProgressUpdate, title, content1, new List<int>() { dto.UserId }); //设置任务人 发送消息
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1363,15 +1348,15 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationSetHaveStatus(TaskAllocationStatusDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationSetHaveStatus(TaskAllocationStatusDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskSetHaveStatus(_dto.SubId);
|
|
|
+ var _view = await _taskAllocationRep._TaskSetHaveStatus(dto.SubId);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
|
|
|
+ var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
|
|
|
if (taskUserData != null)
|
|
|
{
|
|
|
var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
|
|
@@ -1410,15 +1395,15 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationSetAuditStatus(TaskAllocationStatusDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationSetAuditStatus(TaskAllocationStatusDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskSetAuditStatus(_dto.SubId);
|
|
|
+ var _view = await _taskAllocationRep._TaskSetAuditStatus(dto.SubId);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
|
|
|
+ var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
|
|
|
if (taskUserData != null)
|
|
|
{
|
|
|
var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
|
|
@@ -1451,15 +1436,15 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationSetUnFinishedStatus(TaskAllocationSetUnFinishedStatusDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationSetUnFinishedStatus(TaskAllocationSetUnFinishedStatusDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var _view = await _taskAllocationRep._TaskSetUnFinishedStatus(_dto.SubId, _dto.Cause);
|
|
|
+ var _view = await _taskAllocationRep._TaskSetUnFinishedStatus(dto.SubId, dto.Cause);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
|
|
|
+ var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
|
|
|
if (taskUserData != null)
|
|
|
{
|
|
|
var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
|
|
@@ -1491,18 +1476,18 @@ namespace OASystem.API.Controllers
|
|
|
///// <returns></returns>
|
|
|
//[HttpPost]
|
|
|
//[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- //public async Task<IActionResult> PostTaskAllocationIsConfirmCompletion(TaskAllocationScoreDto _dto)
|
|
|
+ //public async Task<IActionResult> PostTaskAllocationIsConfirmCompletion(TaskAllocationScoreDto dto)
|
|
|
//{
|
|
|
// try
|
|
|
// {
|
|
|
// #region 参数验证
|
|
|
- // if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- // if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ // if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ // if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
// PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
// #region 页面操作权限验证
|
|
|
- // pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ // pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
// if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
|
|
|
|
|
@@ -1510,7 +1495,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
// #endregion
|
|
|
|
|
|
- // var _view = await _taskAllocationRep._TaskConfirmCompletion(_dto.PortType, _dto.Id);
|
|
|
+ // var _view = await _taskAllocationRep._TaskConfirmCompletion(dto.PortType, dto.Id);
|
|
|
// if (_view.Code == 0)
|
|
|
// {
|
|
|
// return Ok(JsonView(true, "操作成功!"));
|
|
@@ -1531,18 +1516,18 @@ namespace OASystem.API.Controllers
|
|
|
///// <returns></returns>
|
|
|
//[HttpPost]
|
|
|
//[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- //public async Task<IActionResult> PostTaskAllocationConfirmCompletion(TaskAllocationConfirmCompletionDto _dto)
|
|
|
+ //public async Task<IActionResult> PostTaskAllocationConfirmCompletion(TaskAllocationConfirmCompletionDto dto)
|
|
|
//{
|
|
|
// try
|
|
|
// {
|
|
|
// #region 参数验证
|
|
|
- // if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- // if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ // if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ // if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
// PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
// #region 页面操作权限验证
|
|
|
- // pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ // pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
// if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
|
|
|
|
|
@@ -1550,7 +1535,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
// #endregion
|
|
|
|
|
|
- // var _view = await _taskAllocationRep._TaskConfirmCompletion(_dto.PortType,_dto.Id);
|
|
|
+ // var _view = await _taskAllocationRep._TaskConfirmCompletion(dto.PortType,dto.Id);
|
|
|
// if (_view.Code == 0)
|
|
|
// {
|
|
|
// return Ok(JsonView(true, "操作成功!"));
|
|
@@ -1571,18 +1556,18 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationScore(TaskAllocationScoreDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationScore(TaskAllocationScoreDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
|
|
|
|
|
@@ -1590,11 +1575,11 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._TaskScore(_dto);
|
|
|
+ var _view = await _taskAllocationRep._TaskScore(dto);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.SubId).First();
|
|
|
+ var taskUserData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.SubId).First();
|
|
|
if (taskUserData != null)
|
|
|
{
|
|
|
var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == taskUserData.TAId).First();
|
|
@@ -1626,18 +1611,18 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationTermination(TaskAllocationConfirmCompletionDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationTermination(TaskAllocationConfirmCompletionDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
|
|
|
|
|
@@ -1645,14 +1630,14 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._TaskTermination(_dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._TaskTermination(dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
//发送消息
|
|
|
- var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == _dto.Id).First();
|
|
|
+ var taskData = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskAllocation>().Where(it => it.Id == dto.Id).First();
|
|
|
if (taskData != null)
|
|
|
{
|
|
|
- var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == _dto.Id).Select(it => it.UserId).ToList();
|
|
|
+ var taskUserIds = _taskAllocationRep._sqlSugar.Queryable<Pm_TaskRelevanceUser>().Where(it => it.Id == dto.Id).Select(it => it.UserId).ToList();
|
|
|
taskUserIds.Add(taskData.CreateUserId);
|
|
|
|
|
|
|
|
@@ -1680,18 +1665,18 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostTaskAllocationDel(TaskAllocationConfirmCompletionDto _dto)
|
|
|
+ public async Task<IActionResult> PostTaskAllocationDel(TaskAllocationConfirmCompletionDto dto)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
#region 参数验证
|
|
|
- if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
- if (_dto.PageId < 1) _dto.PageId = 172; //任务指派Id
|
|
|
+ if (dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
|
|
|
+ if (dto.PageId < 1) dto.PageId = 172; //任务指派Id
|
|
|
|
|
|
PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
|
|
|
|
|
|
#region 页面操作权限验证
|
|
|
- pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
|
|
|
+ pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
|
|
|
|
|
|
if (pageFunAuthView.DeleteAuth == 0) return Ok(JsonView(false, "您没有删除权限!"));
|
|
|
|
|
@@ -1699,7 +1684,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var _view = await _taskAllocationRep._TaskDel(_dto.Id);
|
|
|
+ var _view = await _taskAllocationRep._TaskDel(dto.Id);
|
|
|
if (_view.Code == 0)
|
|
|
{
|
|
|
return Ok(JsonView(true, "操作成功!"));
|
|
@@ -1719,16 +1704,16 @@ namespace OASystem.API.Controllers
|
|
|
/// <summary>
|
|
|
/// 测试
|
|
|
/// </summary>
|
|
|
- /// <param name="_dto"></param>
|
|
|
+ /// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile _dto)
|
|
|
+ public async Task<IActionResult> Test_QIYEWX(PostTourClientListDownloadFile dto)
|
|
|
{
|
|
|
//List<string> templist = new List<string>() { 234.ToString() };
|
|
|
//await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
|
|
|
|
|
|
- //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(_dto.DiId); ;
|
|
|
+ //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(dto.DiId); ;
|
|
|
|
|
|
|
|
|
//DeleReminderMessage.PostMessageByWebhook();
|
|
@@ -1754,17 +1739,17 @@ namespace OASystem.API.Controllers
|
|
|
//AppNoticeLibrary.SendUserMsg_GroupStatus_Create(2358, userList);
|
|
|
|
|
|
//费用审核
|
|
|
- //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(_dto.DiId, QiyeWeChatEnum.TestChat);
|
|
|
+ //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(dto.DiId, QiyeWeChatEnum.TestChat);
|
|
|
|
|
|
//费用审核结果通知(通过情况下发送财务群)
|
|
|
//List<string> userList = new List<string>() { "234" };
|
|
|
- //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(_dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
|
|
|
+ //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
|
|
|
|
|
|
//4、财务付款时:(1)对应版块人员【单独发,状态为已付款才发】
|
|
|
- //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(_dto.DiId, userList);
|
|
|
+ //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(dto.DiId, userList);
|
|
|
|
|
|
//团组提醒财务群
|
|
|
- DateTime dtNow = DateTime.Now;
|
|
|
+ //DateTime dtNow = DateTime.Now;
|
|
|
//List<Grp_DelegationInfo> listSource = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
|
|
|
//List<Grp_DelegationInfo> listAdd7day = _usersRep.Query<Grp_DelegationInfo>(s => s.IsDel == 0 && s.VisitStartDate >= dtNow).Take(3).ToList();
|
|
|
//List<Grp_DelegationInfo> listAdd3day = new List<Grp_DelegationInfo>() { };
|
|
@@ -1773,10 +1758,10 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
//日付申请提醒财务群
|
|
|
- //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(_dto.DiId, QiyeWeChatEnum.CaiWuChat02);
|
|
|
+ //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(dto.DiId, QiyeWeChatEnum.CaiWuChat02);
|
|
|
//日付申请结果推送用户、成功通知财务群
|
|
|
- //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(_dto.DiId, userList, QiyeWeChatEnum.TestChat);
|
|
|
- //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(_dto.DiId, userList);
|
|
|
+ //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(dto.DiId, userList, QiyeWeChatEnum.TestChat);
|
|
|
+ //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(dto.DiId, userList);
|
|
|
|
|
|
string q = "";
|
|
|
|
|
@@ -1809,12 +1794,12 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsList(GoodsListDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsList(GoodsListDTO dto)
|
|
|
{
|
|
|
- if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false,MsgTips.Port));
|
|
|
- if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
+ if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsList(_dto));
|
|
|
+ return Ok(await _goodsRep.GoodsList(dto));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1839,13 +1824,13 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsOP(GoodsOPDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsOP(GoodsOPDTO dto)
|
|
|
{
|
|
|
var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
|
|
|
var validator = new GoodsOPDTOValidator();
|
|
|
- var validatorRes = await validator.ValidateAsync(_dto);
|
|
|
+ var validatorRes = await validator.ValidateAsync(dto);
|
|
|
if (!validatorRes.IsValid)
|
|
|
{
|
|
|
var sb = new StringBuilder();
|
|
@@ -1853,7 +1838,7 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsOP(_dto, _currUserInfo.UserId));
|
|
|
+ return Ok(await _goodsRep.GoodsOp(dto, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1880,12 +1865,12 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsStorageList(GoodsStorageListDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsStorageList(GoodsStorageListDTO dto)
|
|
|
{
|
|
|
- if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
- if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
-
|
|
|
- return Ok(await _goodsRep.GoodsStorageList(_dto));
|
|
|
+ if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
+
|
|
|
+ return Ok(await _goodsRep.GoodsStorageList(dto));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1910,21 +1895,21 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsStorageOP(GoodsStorageOPDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsStorageOp(GoodsStorageOpDto dto)
|
|
|
{
|
|
|
- var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
- if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
+ var currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
+ if (currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
|
|
|
- var vadalitor = new GoodsStorageOPDTOValidator();
|
|
|
- var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
- if (!vadalitorRes.IsValid)
|
|
|
+ var validator = new GoodsStorageOpDtoValidator();
|
|
|
+ var validatorRes = await validator.ValidateAsync(dto);
|
|
|
+ if (!validatorRes.IsValid)
|
|
|
{
|
|
|
var sb = new StringBuilder();
|
|
|
- foreach (var error in vadalitorRes.Errors) sb.AppendLine(error.ErrorMessage);
|
|
|
+ foreach (var error in validatorRes.Errors) sb.AppendLine(error.ErrorMessage);
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsStorageOP(_dto, _currUserInfo.UserId));
|
|
|
+ return Ok(await _goodsRep.GoodsStorageOp(dto, currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1952,12 +1937,12 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveList(GoodsReceiveListDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsReceiveList(GoodsReceiveListDTO dto)
|
|
|
{
|
|
|
- if (_dto.PortType > 1 || _dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
- if (_dto.PageIndex < 1 || _dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
+ if (dto.PortType > 1 || dto.PortType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
+ if (dto.PageIndex < 1 || dto.PageSize < 1) return Ok(JsonView(false, MsgTips.PageIndex));
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsReceiveList(_dto));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveList(dto));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -1967,7 +1952,7 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpGet("{id}")]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveInfo([FromQuery]int portType, int id)
|
|
|
+ public async Task<IActionResult> GoodsReceiveInfo([FromQuery] int portType, int id)
|
|
|
{
|
|
|
if (portType > 1 || portType > 3) return Ok(JsonView(false, MsgTips.Port));
|
|
|
if (id < 1) return Ok(JsonView(false, MsgTips.Id));
|
|
@@ -1982,13 +1967,13 @@ namespace OASystem.API.Controllers
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveOP(GoodsReceiveOPDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsReceiveOP(GoodsReceiveOPDTO dto)
|
|
|
{
|
|
|
var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
|
|
|
var vadalitor = new GoodsReceiveOPDTOValidator();
|
|
|
- var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
+ var vadalitorRes = await vadalitor.ValidateAsync(dto);
|
|
|
if (!vadalitorRes.IsValid)
|
|
|
{
|
|
|
var sb = new StringBuilder();
|
|
@@ -1996,42 +1981,42 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
|
|
|
- return Ok(await _goodsRep.GoodsReceiveOP(_dto, _currUserInfo.UserId));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveOP(dto, _currUserInfo.UserId));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 物资进销存
|
|
|
/// 领用 审核
|
|
|
/// </summary>
|
|
|
- /// <param name="_dto"></param>
|
|
|
+ /// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> GoodsReceiveAudit(GoodsReceiveAuditDTO _dto)
|
|
|
+ public async Task<IActionResult> GoodsReceiveAudit(GoodsReceiveAuditDTO dto)
|
|
|
{
|
|
|
var _currUserInfo = JwtHelper.SerializeJwt(HttpContext.Request.Headers.Authorization);
|
|
|
if (_currUserInfo == null) return Ok(JsonView(false, "请传入token!"));
|
|
|
|
|
|
var vadalitor = new GoodsReceiveAuditDTOValidator();
|
|
|
- var vadalitorRes = await vadalitor.ValidateAsync(_dto);
|
|
|
+ var vadalitorRes = await vadalitor.ValidateAsync(dto);
|
|
|
if (!vadalitorRes.IsValid)
|
|
|
{
|
|
|
var sb = new StringBuilder();
|
|
|
foreach (var error in vadalitorRes.Errors) sb.AppendLine(error.ErrorMessage);
|
|
|
return Ok(JsonView(false, sb.ToString()));
|
|
|
}
|
|
|
- int[] idArray = _dto.Label
|
|
|
+ int[] idArray = dto.Label
|
|
|
.Split(',')
|
|
|
- .Select(x =>
|
|
|
+ .Select(x =>
|
|
|
{
|
|
|
int id;
|
|
|
if (int.TryParse(x, out id)) return id;
|
|
|
else return id;
|
|
|
})
|
|
|
.ToArray();
|
|
|
- return Ok(await _goodsRep.GoodsReceiveAudit(idArray, _currUserInfo.UserId, _dto.AuditEnum));
|
|
|
+ return Ok(await _goodsRep.GoodsReceiveAudit(idArray, _currUserInfo.UserId, dto.AuditEnum));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 物资进销存
|
|
|
/// 领用 Del
|