冉成楼 2026-02-04 16:34:35 +08:00
parent 5548edfcf4
commit 95430823d5
3 changed files with 67 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using DocumentFormat.OpenXml.EMMA;
using DocumentFormat.OpenXml.Office.CustomUI;
using Infrastructure;
using NPOI.SS.Util;
@ -6,6 +7,7 @@ using OpenAuth.App.BaseApp.Base;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.ServiceApp.MiManager.Request;
using OpenAuth.App.ServiceApp.Request;
using OpenAuth.App.ServiceApp.Response;
using OpenAuth.Repository;
@ -40,7 +42,7 @@ namespace OpenAuth.App
var list = await base.Repository.AsQueryable()
.LeftJoin<SysOrg>((r, o) => r.ReportUnit == o.Id.ToString())
.Where((r,o)=>o.CascadeId.Contains(cascadeId))
.Where((r, o) => o.CascadeId.Contains(cascadeId))
.ToPageListAsync(request.page, request.limit, totalCount);
return new Response<PageInfo<List<MiViolationReport>>>
@ -198,7 +200,30 @@ namespace OpenAuth.App
}
}
public async Task<Response<bool>> ReportHandle(HandleInfo info)
{
var user = _auth.GetCurrentUser().User;
var level = _auth.GetCurrentUser().Orgs.Min(a => a.Level);
//路径
var org = _auth.GetCurrentUser().Orgs.Where(a => a.Level == level).First();
int count = await base.Repository.AsUpdateable().SetColumns(
a => new MiViolationReport
{
HandlingOpinion = info.HandlingOpinion,
HandlingTime = DateTime.Now,
HandlingUnit = org.Id.ToString()
}).Where(a => a.Id == info.Id).ExecuteCommandAsync();
return new Response<bool>
{
Result = count > 0,
Message = count > 0 ? "success" : "error"
};
}
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.App.ServiceApp.MiManager.Request
{
public class HandleInfo
{
public string Id { get; set; }
public string HandlingOpinion { get; set; }
}
}

View File

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc;
using OpenAuth.App;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.ServiceApp.MiManager.Request;
using OpenAuth.App.ServiceApp.Request;
using OpenAuth.App.ServiceApp.Response;
using OpenAuth.Repository.Domain;
@ -159,6 +160,31 @@ namespace OpenAuth.WebApi.Controllers
}
#endregion
#region
/// <summary>
/// 处理
/// </summary>
/// <param name="info"></param>
/// <returns></returns>
[HttpPost]
public async Task<Response<bool>> ReportHandle(HandleInfo info)
{
var result = new Response<bool>();
try
{
result = await _app.ReportHandle(info);
}
catch (Exception ex)
{
result.Code = 500;
result.Message = ex.InnerException?.Message ?? ex.Message;
}
return result;
}
#endregion
#endregion
}
}