冉成楼 2026-02-04 13:48:44 +08:00
parent cdfc62bab1
commit 3cf15cc403
5 changed files with 241 additions and 57 deletions

View File

@ -52,7 +52,6 @@
<Folder Include="BaseApp\Permission\" />
<Folder Include="BaseApp\WFTask\Response\新文件夹\" />
<Folder Include="ServiceApp\DroneCaseInfoTaskManage\Response\" />
<Folder Include="ServiceApp\MiManager\Response\" />
</ItemGroup>
</Project>

View File

@ -1,11 +1,13 @@
using DocumentFormat.OpenXml.Office.CustomUI;
using Infrastructure;
using NPOI.SS.Util;
using OpenAuth.App.BaseApp.Base;
using OpenAuth.App.Interface;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.ServiceApp.Request;
using OpenAuth.App.ServiceApp.Response;
using OpenAuth.Repository;
using OpenAuth.Repository.Domain;
using SqlSugar;
@ -29,9 +31,16 @@ namespace OpenAuth.App
/// </summary>
public async Task<Response<PageInfo<List<MiViolationReport>>>> LoadAllPage(PageReq request)
{
//等级
var level = _auth.GetCurrentUser().Orgs.Min(a => a.Level);
//路径
var cascadeId = _auth.GetCurrentUser().Orgs.Where(a => a.Level == level).First().CascadeId;
RefAsync<int> totalCount = 0;
var result = new PageInfo<SysRole>();
var list = await base.Repository.AsQueryable()
.LeftJoin<SysOrg>((r, o) => r.ReportUnit == o.Id.ToString())
.Where((r,o)=>o.CascadeId.Contains(cascadeId))
.ToPageListAsync(request.page, request.limit, totalCount);
return new Response<PageInfo<List<MiViolationReport>>>
@ -45,9 +54,24 @@ namespace OpenAuth.App
}
#endregion
public async Task<MiViolationReport> Get(object id)
public async Task<ReportDetail> Get(string id)
{
return await Repository.GetByIdAsync(id);
//基础信息
var model = Repository.GetByIdAsync(id).MapTo<ReportDetail>();
model.Vehicles = new List<Vehicle>();
model.SencePhotos = base.Repository.AsSugarClient()
.Queryable<MiScenePhoto>()
.Where(a => a.ViolationReportId == id)
.Select(a => new SencePhoto { Image = a.Image }, true).ToList();
model.Vehicles = base.Repository.AsSugarClient()
.Queryable<MiVehicle>()
.Includes(a => a.MiVehicleImages)
.Where(a => a.ViolationReportId == id)
.Select(a => new Vehicle { LicensePlate = a.LicensePlate }, true).ToList();
return model;
}

View File

@ -0,0 +1,152 @@
using OpenAuth.App.ServiceApp.Request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenAuth.App.ServiceApp.Response
{
public class ReportDetail
{
public string Id { get; set; }
/// <summary>
/// Desc:标题
/// Default:
/// Nullable:False
/// </summary>
public string Title { get; set; }
/// <summary>
/// Desc:当事人姓名
/// Default:
/// Nullable:True
/// </summary>
public string PartyName { get; set; }
/// <summary>
/// Desc:当事人电话
/// Default:
/// Nullable:True
/// </summary>
public string PartyPhone { get; set; }
/// <summary>
/// Desc:违法类型
/// Default:
/// Nullable:True
/// </summary>
public string ViolationType { get; set; }
/// <summary>
/// 违法类型名称
/// </summary>
public string ViolationName { get; set; }
/// <summary>
/// Desc:问题描述
/// Default:
/// Nullable:True
/// </summary>
public string ProblemDescription { get; set; }
/// <summary>
/// Desc:处理意见
/// Default:
/// Nullable:True
/// </summary>
public string HandlingOpinion { get; set; }
/// <summary>
/// Desc:停车场 id
/// Default:
/// Nullable:True
/// </summary>
public string ParkingId { get; set; }
/// <summary>
/// 停车场名称
/// </summary>
public string ParkName { get; set; }
/// <summary>
/// Desc:经度
/// Default:
/// Nullable:True
/// </summary>
public decimal? Lng { get; set; }
/// <summary>
/// Desc:纬度
/// Default:
/// Nullable:True
/// </summary>
public decimal? Lat { get; set; }
/// <summary>
/// Desc:处理单位
/// Default:
/// Nullable:True
/// </summary>
public string HandlingUnit { get; set; }
public string HandlingUnitName { get; set; }
/// <summary>
/// Desc:处理人
/// Default:
/// Nullable:True
/// </summary>
public string Handler { get; set; }
public string HandlerName { get; set; }
/// <summary>
/// Desc:处理时间
/// Default:
/// Nullable:True
/// </summary>
public DateTime? HandlingTime { get; set; }
/// <summary>
/// Desc:上报时间
/// Default:DateTime.Now
/// Nullable:True
/// </summary>
public DateTime? ReportTime { get; set; }
/// <summary>
/// Desc:上报人
/// Default:
/// Nullable:True
/// </summary>
public string Reporter { get; set; }
public string ReporterName { get; set; }
/// <summary>
/// Desc:盗采点id
/// Default:
/// Nullable:True
/// </summary>
public string MinePointId { get; set; }
/// <summary>
/// 盗采点名称
/// </summary>
public string MinePointName { get; set; }
/// <summary>
/// 上报单位
/// </summary>
public string ReportUnit { get; set; }
public string ReportUnitName { get; set; }
/// <summary>
/// 现场图片
/// </summary>
public List<SencePhoto> SencePhotos { get; set; }
/// <summary>
/// 车辆信息
/// </summary>
public List<Vehicle> Vehicles { get; set; }
}
}

View File

@ -11,65 +11,72 @@ namespace OpenAuth.Repository.Domain
[SugarTable("mi_vehicle")]
public partial class MiVehicle
{
public MiVehicle(){
public MiVehicle()
{
}
/// <summary>
/// Desc:车辆ID
/// Default:
/// Nullable:False
/// </summary>
public string Id {get;set;}
}
/// <summary>
/// Desc:车辆ID
/// Default:
/// Nullable:False
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
/// <summary>
/// Desc:牌照/编号
/// Default:
/// Nullable:False
/// </summary>
public string LicensePlate {get;set;}
/// <summary>
/// Desc:牌照/编号
/// Default:
/// Nullable:False
/// </summary>
public string LicensePlate { get; set; }
/// <summary>
/// Desc:类型
/// Default:
/// Nullable:True
/// </summary>
public string Type {get;set;}
/// <summary>
/// Desc:类型
/// Default:
/// Nullable:True
/// </summary>
public string Type { get; set; }
/// <summary>
/// Desc:姓名
/// Default:
/// Nullable:True
/// </summary>
public string Name {get;set;}
/// <summary>
/// Desc:姓名
/// Default:
/// Nullable:True
/// </summary>
public string Name { get; set; }
/// <summary>
/// Desc:身份证号
/// Default:
/// Nullable:True
/// </summary>
public string IdCard {get;set;}
/// <summary>
/// Desc:身份证号
/// Default:
/// Nullable:True
/// </summary>
public string IdCard { get; set; }
/// <summary>
/// Desc:电话
/// Default:
/// Nullable:True
/// </summary>
public string Phone {get;set;}
/// <summary>
/// Desc:电话
/// Default:
/// Nullable:True
/// </summary>
public string Phone { get; set; }
/// <summary>
/// Desc:违法上报信息id
/// Default:
/// Nullable:True
/// </summary>
public string ViolationReportId {get;set;}
/// <summary>
/// Desc:违法上报信息id
/// Default:
/// Nullable:True
/// </summary>
public string ViolationReportId { get; set; }
/// <summary>
/// Desc:创建时间
/// Default:DateTime.Now
/// Nullable:True
/// </summary>
public DateTime? CreateTime {get;set;}
/// <summary>
/// Desc:创建时间
/// Default:DateTime.Now
/// Nullable:True
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 导航属性
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(MiVehicleImage.VehicleId))]
public List<MiVehicleImage> MiVehicleImages { get; set; }
}
}

View File

@ -6,6 +6,7 @@ using OpenAuth.App;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.ServiceApp.Request;
using OpenAuth.App.ServiceApp.Response;
using OpenAuth.Repository.Domain;
using System;
using System.Collections.Generic;
@ -42,12 +43,12 @@ namespace OpenAuth.WebApi.Controllers
#region 实体
/// <summary>
/// 实体
/// 上报详情
/// </summary>
[HttpGet]
public async Task<Response<MiViolationReport>> Get(object id)
public async Task<Response<ReportDetail>> Get(string id)
{
var result = new Response<MiViolationReport>();
var result = new Response<ReportDetail>();
try
{
result.Result = await _app.Get(id);
@ -139,6 +140,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public async Task<Response<bool>> Report(MiViolationReportRequest request)
{
var result = new Response<bool>();