|
@@ -63,6 +63,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
private readonly ILogger<GroupsController> _logger;
|
|
|
private readonly ITextFileLogger _eec_textLogger;
|
|
|
+ private readonly IGroupTextFileLogger _groupTextLogger;
|
|
|
private readonly GrpScheduleRepository _grpScheduleRep;
|
|
|
private readonly IMapper _mapper;
|
|
|
private readonly DelegationInfoRepository _groupRepository;
|
|
@@ -120,6 +121,7 @@ namespace OASystem.API.Controllers
|
|
|
/// </summary>
|
|
|
/// <param name="logger"></param>
|
|
|
/// <param name="eec_textLogger"></param>
|
|
|
+ /// <param name="groupTextLogger"></param>
|
|
|
/// <param name="mapper"></param>
|
|
|
/// <param name="hubContext"></param>
|
|
|
/// <param name="sqlSugar"></param>
|
|
@@ -163,6 +165,7 @@ namespace OASystem.API.Controllers
|
|
|
public GroupsController(
|
|
|
ILogger<GroupsController> logger,
|
|
|
ITextFileLogger eec_textLogger,
|
|
|
+ IGroupTextFileLogger groupTextLogger,
|
|
|
IMapper mapper,
|
|
|
IHubContext<ChatHub, IChatClient> hubContext,
|
|
|
SqlSugarClient sqlSugar,
|
|
@@ -208,6 +211,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
_logger = logger;
|
|
|
_eec_textLogger = eec_textLogger;
|
|
|
+ _groupTextLogger = groupTextLogger;
|
|
|
_mapper = mapper;
|
|
|
_grpScheduleRep = grpScheduleRep;
|
|
|
_groupRepository = groupRepository;
|
|
@@ -876,12 +880,12 @@ namespace OASystem.API.Controllers
|
|
|
string sql = string.Format(@"Select Row_Number,Id,SalesQuoteNo,TourCode,TeamTypeId, TeamType,Department,
|
|
|
TeamLevId,TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
VisitDate,VisitDays,VisitPNumber,JietuanOperatorId,
|
|
|
- JietuanOperator,IsSure,CreateTime,IsBid
|
|
|
+ JietuanOperator,IsSure,CreateTime,IsBid,Step
|
|
|
From (
|
|
|
Select row_number() over(order by gdi.VisitStartDate Desc) as Row_Number,
|
|
|
CASE WHEN gdi.JietuanOperator = 4 OR gdi.JietuanOperator = 21 THEN '国交部'
|
|
|
ELSE (Select DepName FROM OA2023DB.dbo.Sys_Department WHERE Id = su.DepId) END AS 'Department',
|
|
|
- gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,
|
|
|
+ gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,gdi.Step,
|
|
|
ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,
|
|
|
VisitDate,VisitDays,VisitPNumber,JietuanOperator JietuanOperatorId,
|
|
|
su.CnName JietuanOperator,IsSure,gdi.CreateTime,gdi.IsBid
|
|
@@ -2749,10 +2753,11 @@ FROM
|
|
|
/// <summary>
|
|
|
/// 报批完成企微通知
|
|
|
/// </summary>
|
|
|
+ /// <param name="currUserId"></param>
|
|
|
/// <param name="diid"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<IActionResult> EnterpriseWeChatNotificationAsyncBaoPi(int diid)
|
|
|
+ public async Task<IActionResult> EnterpriseWeChatNotificationAsyncBaoPi(int currUserId,int diid)
|
|
|
{
|
|
|
var jw = JsonView(true);
|
|
|
var users = new List<string>();
|
|
@@ -2763,6 +2768,44 @@ FROM
|
|
|
{
|
|
|
users = JsonConvert.DeserializeObject<List<string>>(ssd.Remark);
|
|
|
var res = await AppNoticeLibrary.SendUserMsg_BaoPi_ToUser(users, diid);
|
|
|
+
|
|
|
+ //消息通知成功 更改团组step、记录日志
|
|
|
+ if (res)
|
|
|
+ {
|
|
|
+ var groupStep = 0; //0-新建 1-企微消息通知
|
|
|
+
|
|
|
+ //更改团组step
|
|
|
+ var updStatus = await _sqlSugar.Updateable<Grp_DelegationInfo>()
|
|
|
+ .SetColumns(x => new Grp_DelegationInfo()
|
|
|
+ {
|
|
|
+ Step = 2
|
|
|
+ })
|
|
|
+ .Where(x => x.Id == diid && x.IsDel == 0)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ if (updStatus > 0) groupStep = 2;
|
|
|
+ string groupStepLabel = groupStep switch
|
|
|
+ {
|
|
|
+ 1 => "新建",
|
|
|
+ 2 => "企微消息通知(报批)",
|
|
|
+ _ => "未设置"
|
|
|
+ };
|
|
|
+
|
|
|
+ //记录日志
|
|
|
+
|
|
|
+ var teamName = _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where(x => x.Id == diid && x.IsDel == 0)
|
|
|
+ .Select(x => x.TeamName)
|
|
|
+ .First() ?? "-";
|
|
|
+
|
|
|
+ var operationName = _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .Where(x => x.Id == currUserId && x.IsDel == 0)
|
|
|
+ .Select(x => x.CnName)
|
|
|
+ .First() ?? "-";
|
|
|
+
|
|
|
+ _groupTextLogger.LogInformation("团组:【{teamName}({groupId})】 操作人:【{operationName}】 操作时间:【{operationTime}】{logContent}", teamName, diid, operationName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), groupStepLabel);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|