提车信息修改

master
洁 任 2026-02-11 09:04:03 +08:00
parent 309fabe4f7
commit 7001cac12a
1 changed files with 89 additions and 67 deletions

View File

@ -143,57 +143,73 @@ namespace OpenAuth.App
using (var uow = base.UnitWork.CreateContext())
{
var result = await base.Repository.AsQueryable()
.Where(p => p.Id == id)
.LeftJoin<MiViolationReport>((p, r) => p.ViolationReportId == r.Id)
.LeftJoin<MiMinePoint>((p, r, m) => r.MinePointId == m.Id)
.LeftJoin<SysUser>((p, r, m, u) => p.Initiator == u.Id.ToString())
.LeftJoin<SysUser>((p, r, m, u, u2) => p.Reviewer == u2.Id.ToString())
.Select((p, r, m, u, u2) => new
{
// 提车信息
PickupId = p.Id,
p.Status,
p.Initiator,
InitiatorName = u.Name,
p.InitiateTime,
p.Reviewer,
ReviewerName = u2.Name,
p.ReviewTime,
p.Remark,
.Where(p => p.Id == id)
.LeftJoin<SysUser>((p, u) => p.Initiator == u.Id.ToString())
.LeftJoin<SysUser>((p, u, u2) => p.Reviewer == u2.Id.ToString())
.Select((p, u, u2) => new
{
// 提车信息
PickupId = p.Id,
p.Status,
p.Initiator,
InitiatorName = u.Name,
p.InitiateTime,
p.Reviewer,
ReviewerName = u2.Name,
p.ReviewTime,
p.Remark,
p.ViolationReportId
})
.FirstAsync();
// 违法上报信息
ReportId = r.Id,
r.Title,
ReportStatus = r.Status,
r.PartyName,
r.PartyPhone,
r.ViolationType,
r.ProblemDescription,
r.HandlingOpinion,
r.HandlingUnit,
r.Handler,
r.HandlingTime,
r.ReportTime,
r.Reporter,
r.ReportUnit,
r.Lng,
r.Lat,
// 盗采点信息
MinePointId = m.Id,
MinePointName = m.Name,
m.CountyName,
MinePointLng = m.Lng,
MinePointLat = m.Lat,
})
.FirstAsync();
var result1 = await base.Repository.ChangeRepository<SugarRepositiry<MiViolationReport>>()
.AsQueryable()
.Where(p => p.Id == result.ViolationReportId)
.LeftJoin<SysOrg>((p, r) => p.ReportUnit == r.Id.ToString())
.LeftJoin<MiMinePoint>((p, r, m) => p.MinePointId == m.Id)
.LeftJoin<SysUser>((p, r, m, u) => p.Reporter == u.Id.ToString())
.LeftJoin<SysUser>((p, r, m, u, u2) => p.Handler == u2.Id.ToString())
.LeftJoin<SysOrg>((p, r, m, u, u2, o) => p.HandlingUnit == o.Id.ToString())
.Select((p, r, m, u, u2, o) => new
{
// 违法上报信息
ReporterName = u.Name,
HandlerName = u2.Name,
ReportUnitName = r.Name,
HandUnitName = o.Name,
p.Id,
p.Title,
ReportStatus = p.Status,
p.PartyName,
p.PartyPhone,
p.ViolationType,
p.ProblemDescription,
p.HandlingOpinion,
p.HandlingUnit,
p.Handler,
p.HandlingTime,
p.ReportTime,
p.Reporter,
p.ReportUnit,
p.Lng,
p.Lat,
p.StatusName,
p.ViolationTypeName,
// 盗采点信息
MinePointId = m.Id,
MinePointName = m.Name,
m.CountyName,
MinePointLng = m.Lng,
MinePointLat = m.Lat,
})
.FirstAsync();
if (result == null)
return null;
// 查询车辆信息
var vehicles = await uow.MiVehicle.AsQueryable()
.Where(v => v.ViolationReportId == result.ReportId)
.Where(v => v.ViolationReportId == result.ViolationReportId)
.ToListAsync();
// 查询车辆图片
@ -208,7 +224,7 @@ namespace OpenAuth.App
// 查询现场照片
var scenePhotos = await uow.MiScenePhoto.AsQueryable()
.Where(sp => sp.ViolationReportId == result.ReportId)
.Where(sp => sp.ViolationReportId == result.ViolationReportId)
.ToListAsync();
return new
@ -228,31 +244,37 @@ namespace OpenAuth.App
ViolationReport = new
{
result.ReportId,
result.Title,
result.ReportStatus,
result.PartyName,
result.PartyPhone,
result.ViolationType,
result.ProblemDescription,
result.HandlingOpinion,
result.HandlingUnit,
result.Handler,
result.HandlingTime,
result.ReportTime,
result.Reporter,
result.ReportUnit,
result.Lng,
result.Lat
result1.Id,
result1.Title,
Status = result1.ReportStatus,
result1.PartyName,
result1.PartyPhone,
result1.ViolationType,
result1.ProblemDescription,
result1.HandlingOpinion,
result1.HandlingUnit,
result1.Handler,
result1.HandlingTime,
result1.ReportTime,
result1.Reporter,
result1.ReporterName,
result1.HandlerName,
result1.ReportUnit,
result1.ReportUnitName,
result1.Lng,
result1.Lat,
result1.StatusName,
result1.ViolationTypeName,
result1.HandUnitName
},
MinePoint = string.IsNullOrEmpty(result.MinePointId) ? null : new
MinePoint = string.IsNullOrEmpty(result1.MinePointId) ? null : new
{
result.MinePointId,
result.MinePointName,
result.CountyName,
result.MinePointLng,
result.MinePointLat
result1.MinePointId,
result1.MinePointName,
result1.CountyName,
result1.MinePointLng,
result1.MinePointLat
},
Vehicles = vehicles.Select(v => new