master
parent
b768a7f331
commit
5cd409ae91
|
|
@ -0,0 +1,199 @@
|
|||
using DocumentFormat.OpenXml.Packaging;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenAuth.App.Common
|
||||
{
|
||||
public class MiWordHelper
|
||||
{
|
||||
// 在服务类中添加以下方法
|
||||
public string GenerateSeizureDocumentWord(MiSeizureDocument mr, IWebHostEnvironment env)
|
||||
{
|
||||
// 模板文件路径(假设放在项目根目录的 Templates 文件夹下)
|
||||
string templatePath = Path.Combine(env.ContentRootPath, "Templates", "扣押财物决定书.docx");
|
||||
if (!File.Exists(templatePath))
|
||||
throw new FileNotFoundException("模板文件不存在", templatePath);
|
||||
|
||||
// 生成文件名(使用ID保证唯一)
|
||||
string fileName = $"扣押财物决定书_{mr.Id}.docx";
|
||||
|
||||
// 上传目录(发布文件夹下的 upload)
|
||||
string uploadDir = Path.Combine(env.ContentRootPath, "upload");
|
||||
if (!Directory.Exists(uploadDir))
|
||||
Directory.CreateDirectory(uploadDir);
|
||||
|
||||
string outputPath = Path.Combine(uploadDir, fileName);
|
||||
|
||||
// 复制模板到输出路径(避免修改原模板)
|
||||
File.Copy(templatePath, outputPath, true);
|
||||
|
||||
// 使用 OpenXml 修改文档
|
||||
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(outputPath, true))
|
||||
{
|
||||
MainDocumentPart mainPart = wordDoc.MainDocumentPart;
|
||||
Body body = mainPart.Document.Body;
|
||||
|
||||
// 1. 替换物品列表(先处理,避免后续替换影响索引)
|
||||
ReplaceItemsList(body, mr.Items);
|
||||
|
||||
// 2. 替换其他占位符
|
||||
ReplacePlaceholders(body, mr);
|
||||
|
||||
mainPart.Document.Save();
|
||||
}
|
||||
|
||||
// 返回相对路径(用于存入数据库)
|
||||
return $"/upload/{fileName}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 替换物品列表部分
|
||||
/// </summary>
|
||||
private void ReplaceItemsList(Body body, string itemsStr)
|
||||
{
|
||||
var paragraphs = body.Elements<Paragraph>().ToList();
|
||||
|
||||
// 解析物品列表(按分号分隔)
|
||||
string[] items = itemsStr.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
// 查找列表起始段落(包含 "1、" 和 "[设备及车辆类型]")
|
||||
int startIdx = -1;
|
||||
for (int i = 0; i < paragraphs.Count; i++)
|
||||
{
|
||||
string text = paragraphs[i].InnerText;
|
||||
if (text.Contains("1、") && text.Contains("[设备及车辆类型]"))
|
||||
{
|
||||
startIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (startIdx == -1) return; // 未找到列表区域,不处理
|
||||
|
||||
// 查找列表结束段落(包含 "3、" 和 "[其它设备的录入内容]")
|
||||
int endIdx = startIdx;
|
||||
for (int i = startIdx; i < paragraphs.Count; i++)
|
||||
{
|
||||
string text = paragraphs[i].InnerText;
|
||||
if (text.Contains("3、") && text.Contains("[其它设备的录入内容]"))
|
||||
{
|
||||
endIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 如果没找到结束,默认往后找2个段落(假设模板固定三行)
|
||||
if (endIdx == startIdx)
|
||||
endIdx = Math.Min(startIdx + 2, paragraphs.Count - 1);
|
||||
|
||||
// 移除原列表段落
|
||||
for (int i = endIdx; i >= startIdx; i--)
|
||||
{
|
||||
paragraphs[i].Remove();
|
||||
}
|
||||
|
||||
// 获取参考段落样式(取前一段落或后一段落的样式属性)
|
||||
Paragraph refPara = null;
|
||||
if (startIdx > 0)
|
||||
refPara = paragraphs[startIdx - 1];
|
||||
else if (startIdx < paragraphs.Count - 1)
|
||||
refPara = paragraphs[startIdx + 1];
|
||||
|
||||
// 在起始位置插入新的列表项
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
{
|
||||
string itemText = $"{i + 1}、 {items[i].Trim()}";
|
||||
Paragraph newPara = new Paragraph();
|
||||
|
||||
// 复制参考段落的样式(如果有)
|
||||
if (refPara != null)
|
||||
{
|
||||
// 复制段落属性
|
||||
if (refPara.ParagraphProperties != null)
|
||||
newPara.ParagraphProperties = (ParagraphProperties)refPara.ParagraphProperties.CloneNode(true);
|
||||
|
||||
// 复制第一个Run的样式(如果有)
|
||||
Run refRun = refPara.Elements<Run>().FirstOrDefault();
|
||||
if (refRun != null && refRun.RunProperties != null)
|
||||
{
|
||||
Run newRun = new Run();
|
||||
newRun.RunProperties = (RunProperties)refRun.RunProperties.CloneNode(true);
|
||||
newRun.AppendChild(new Text(itemText));
|
||||
newPara.AppendChild(newRun);
|
||||
}
|
||||
else
|
||||
{
|
||||
newPara.AppendChild(new Run(new Text(itemText)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newPara.AppendChild(new Run(new Text(itemText)));
|
||||
}
|
||||
|
||||
// 在起始索引位置插入(body.InsertAt 需要索引,但由于已经移除了原段落,现在的段落集合已变化,需要使用 body 的插入方法)
|
||||
// 更简单的方法:重新获取 body 的段落列表,找到合适的插入点
|
||||
var currentParas = body.Elements<Paragraph>().ToList();
|
||||
if (startIdx <= currentParas.Count)
|
||||
body.InsertAt(newPara, startIdx + i);
|
||||
else
|
||||
body.AppendChild(newPara);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 替换文档中的占位符
|
||||
/// </summary>
|
||||
private void ReplacePlaceholders(Body body, MiSeizureDocument mr)
|
||||
{
|
||||
string dateStr = mr.SeizureDate?.ToString("yyyy年MM月dd日") ?? " 年 月 日";
|
||||
|
||||
foreach (var para in body.Elements<Paragraph>())
|
||||
{
|
||||
// 处理日期占位符(单独的“年 月 日”段落)
|
||||
string paraText = para.InnerText.Trim();
|
||||
if (paraText == "年 月 日")
|
||||
{
|
||||
// 清除原有内容
|
||||
para.RemoveAllChildren();
|
||||
// 添加新的Run
|
||||
Run run = new Run();
|
||||
run.AppendChild(new Text(dateStr));
|
||||
para.AppendChild(run);
|
||||
continue; // 已处理,跳过后续替换
|
||||
}
|
||||
|
||||
// 处理其他占位符(遍历Run)
|
||||
foreach (var run in para.Elements<Run>())
|
||||
{
|
||||
Text text = run.Elements<Text>().FirstOrDefault();
|
||||
if (text == null) continue;
|
||||
|
||||
string original = text.Text;
|
||||
string replaced = original;
|
||||
|
||||
// 替换 [当事人]
|
||||
replaced = replaced.Replace("[当事人]", mr.Party ?? "");
|
||||
|
||||
// 替换 [线索位置]
|
||||
replaced = replaced.Replace("[线索位置]", mr.ClueLocation ?? "");
|
||||
|
||||
// 替换 [违法类型]
|
||||
replaced = replaced.Replace("[违法类型]", mr.ViolationType ?? "");
|
||||
|
||||
// 替换组合占位符 [于[线索位置]的[违法类型]行为]
|
||||
string combined = $"于{mr.ClueLocation}的{mr.ViolationType}行为";
|
||||
replaced = replaced.Replace("[于[线索位置]的[违法类型]行为]", combined);
|
||||
|
||||
// 如果文本有变化,更新
|
||||
if (original != replaced)
|
||||
text.Text = replaced;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
<PackageReference Include="Autofac.Extras.Quartz" Version="9.0.0" />
|
||||
<PackageReference Include="ce.autofac.extension" Version="6.0.2" />
|
||||
<PackageReference Include="ClosedXML" Version="0.102.2" />
|
||||
<PackageReference Include="DocumentFormat.OpenXml" Version="3.4.1" />
|
||||
<PackageReference Include="Flurl.Http" Version="3.2.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.16" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.16" />
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ using DocumentFormat.OpenXml.EMMA;
|
|||
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||
using Infrastructure;
|
||||
using Infrastructure.Helpers;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using NPOI.SS.Util;
|
||||
using OpenAuth.App.BaseApp.Base;
|
||||
using OpenAuth.App.Common;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
|
|
@ -20,13 +22,16 @@ namespace OpenAuth.App
|
|||
{
|
||||
public class MiViolationReportApp : SqlSugarBaseApp<MiViolationReport, SugarDbContext>
|
||||
{
|
||||
private readonly IWebHostEnvironment _env;
|
||||
private MiWordHelper _helper;
|
||||
public MiViolationReportApp(
|
||||
ISugarUnitOfWork<SugarDbContext> unitWork,
|
||||
ISimpleClient<MiViolationReport> repository,
|
||||
IAuth auth
|
||||
IAuth auth, IWebHostEnvironment env, MiWordHelper helper
|
||||
) : base(unitWork, repository, auth)
|
||||
{
|
||||
|
||||
_env = env;
|
||||
_helper = helper;
|
||||
}
|
||||
|
||||
#region 查询
|
||||
|
|
@ -178,6 +183,14 @@ namespace OpenAuth.App
|
|||
p.StatusName,
|
||||
p.ViolationTypeName,
|
||||
p.MineralTypes,
|
||||
p.ReviewTime,
|
||||
p.ReviewerName,
|
||||
p.ReviewComments,
|
||||
p.ReviewerSignature,
|
||||
p.SeReviewTime,
|
||||
p.SeReviewerName,
|
||||
p.SeReviewComments,
|
||||
p.SeReviewerSignature,
|
||||
// 盗采点信息
|
||||
MinePointId = m.Id,
|
||||
MinePointName = m.Name,
|
||||
|
|
@ -221,6 +234,16 @@ namespace OpenAuth.App
|
|||
.Where(r => r.ViolationReportId == result.Id)
|
||||
.ToListAsync();
|
||||
|
||||
// 查询其他人员图片
|
||||
List<MiOtherpersonImage> personImages = new List<MiOtherpersonImage>();
|
||||
if (otherPersons.Any())
|
||||
{
|
||||
var personIds = otherPersons.Select(v => v.Id).ToList();
|
||||
personImages = await uow.MiOtherpersonImage.AsQueryable()
|
||||
.Where(vi => personIds.Contains(vi.PersonId))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
ViolationReport = new
|
||||
|
|
@ -247,7 +270,15 @@ namespace OpenAuth.App
|
|||
result.StatusName,
|
||||
result.ViolationTypeName,
|
||||
result.HandUnitName,
|
||||
result.MineralTypes
|
||||
result.MineralTypes,
|
||||
result.ReviewTime,
|
||||
result.ReviewerName,
|
||||
result.ReviewComments,
|
||||
result.ReviewerSignature,
|
||||
result.SeReviewTime,
|
||||
result.SeReviewerName,
|
||||
result.SeReviewComments,
|
||||
result.SeReviewerSignature,
|
||||
},
|
||||
|
||||
MinePoint = string.IsNullOrEmpty(result.MinePointId) ? null : new
|
||||
|
|
@ -300,7 +331,25 @@ namespace OpenAuth.App
|
|||
sp.Angle,
|
||||
sp.CreateTime
|
||||
}).ToList(),
|
||||
OtherPersons = otherPersons.ToList()
|
||||
OtherPersons = otherPersons.Select(v => new
|
||||
{
|
||||
v.Id,
|
||||
v.Name,
|
||||
v.Phone,
|
||||
v.RelationShip,
|
||||
PersonImages = personImages
|
||||
.Where(img => img.PersonId == v.Id)
|
||||
.Select(img => new
|
||||
{
|
||||
img.Id,
|
||||
img.Image,
|
||||
img.Lng,
|
||||
img.Lat,
|
||||
img.Angle,
|
||||
img.CreateTime
|
||||
})
|
||||
.ToList()
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -349,15 +398,160 @@ namespace OpenAuth.App
|
|||
/// 更新
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
public async Task<Response<bool>> Update(MiViolationReport model)
|
||||
public async Task<Response<bool>> Update(MiViolationReportRequest request)
|
||||
{
|
||||
bool flag = await base.Repository.UpdateAsync(model);
|
||||
|
||||
return new Response<bool>
|
||||
using (var uwo = UnitWork.CreateContext())
|
||||
{
|
||||
Result = flag,
|
||||
Message = flag == true ? "success" : "error"
|
||||
};
|
||||
var user = _auth.GetCurrentUser();
|
||||
var org = user.Orgs.FirstOrDefault();
|
||||
if (org == null)
|
||||
{
|
||||
throw new Exception("请先分配部门");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(request.Id))
|
||||
{
|
||||
throw new Exception("数据id错误,请重新数据");
|
||||
}
|
||||
|
||||
await uwo.MiScenePhoto.DeleteAsync(r => r.ViolationReportId == request.Id); //删除现场照片
|
||||
await uwo.MiViolationUsers.DeleteAsync(r => r.ViolationReportId == request.Id); //删除其他人员
|
||||
await uwo.MiOtherpersonImage.DeleteAsync(r => r.ViolationReportId == request.Id); //删除其他人员
|
||||
await uwo.MiSeizureDocument.DeleteAsync(r => r.ViolationReportId == request.Id); //删除扣押财务信息
|
||||
await uwo.MiVehicleImage.DeleteAsync(r => r.ViolationReportId == request.Id); //删除车辆图片
|
||||
await uwo.MiVehicle.DeleteAsync(r => r.ViolationReportId == request.Id); //删除车辆信息
|
||||
|
||||
//上报信息
|
||||
var model = request.MapTo<MiViolationReport>();
|
||||
model.Status = 0;
|
||||
model.StatusName = "待处理";
|
||||
|
||||
//现场照片
|
||||
var photos = request.SencePhotos.MapToList<MiScenePhoto>();
|
||||
photos.ForEach(a =>
|
||||
{
|
||||
a.Id = Guid.NewGuid().ToString();
|
||||
a.ViolationReportId = model.Id;
|
||||
a.CreateTime = DateTime.Now;
|
||||
});
|
||||
|
||||
//其他人员
|
||||
var personList = new List<MiViolationUsers>();
|
||||
var personImageList = new List<MiOtherpersonImage>();
|
||||
foreach (var item in request.OtherPersons)
|
||||
{
|
||||
var person = item.MapTo<MiViolationUsers>();
|
||||
person.Id = Guid.NewGuid().ToString();
|
||||
person.ViolationReportId = model.Id;
|
||||
|
||||
//人员图片
|
||||
var images = item.Images.MapToList<MiOtherpersonImage>();
|
||||
images.ForEach(a =>
|
||||
{
|
||||
a.Id = Guid.NewGuid().ToString();
|
||||
a.ViolationReportId = model.Id;
|
||||
a.PersonId = person.Id;
|
||||
a.CreateTime = DateTime.Now;
|
||||
personImageList.Add(a);
|
||||
|
||||
});
|
||||
|
||||
personList.Add(person);
|
||||
}
|
||||
//var others = request.OtherPersons.MapToList<MiViolationUsers>();
|
||||
//others.ForEach(a =>
|
||||
//{
|
||||
// a.Id = Guid.NewGuid().ToString();
|
||||
// a.ViolationReportId = model.Id;
|
||||
//});
|
||||
|
||||
//车辆信息
|
||||
var vehicleList = new List<MiVehicle>();
|
||||
var vehicleImageList = new List<MiVehicleImage>();
|
||||
foreach (var item in request.Vehicles)
|
||||
{
|
||||
var vehicle = item.MapTo<MiVehicle>();
|
||||
vehicle.Id = Guid.NewGuid().ToString();
|
||||
vehicle.ViolationReportId = model.Id;
|
||||
vehicle.CreateTime = DateTime.Now;
|
||||
vehicle.State = 0; //初始默认未提车
|
||||
|
||||
//车辆图片
|
||||
var images = item.VehicleImages.MapToList<MiVehicleImage>();
|
||||
images.ForEach(a =>
|
||||
{
|
||||
a.Id = Guid.NewGuid().ToString();
|
||||
a.ViolationReportId = model.Id;
|
||||
a.ParkingId = model.ParkingId;
|
||||
a.VehicleId = vehicle.Id;
|
||||
a.CreateTime = DateTime.Now;
|
||||
vehicleImageList.Add(a);
|
||||
|
||||
});
|
||||
|
||||
vehicleList.Add(vehicle);
|
||||
}
|
||||
|
||||
//扣押财务单信息
|
||||
MiSeizureDocument mr = new MiSeizureDocument();
|
||||
mr.Id = Guid.NewGuid().ToString();
|
||||
mr.CreatedAt = DateTime.Now;
|
||||
mr.CreatedBy = user.User.Id.ToString();
|
||||
mr.Year = DateTime.Now.Year.ToString();
|
||||
mr.SeizureDate = DateTime.Now;
|
||||
var mrinfo = base.Repository.ChangeRepository<SugarRepositiry<MiSeizureDocument>>().AsQueryable().ToList();
|
||||
if (mrinfo.Count == 0)
|
||||
{
|
||||
mr.SerialNumber = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mr.SerialNumber = (int)mrinfo.Max(r => r.SerialNumber) + 1;
|
||||
}
|
||||
mr.ViolationReportId = model.Id;
|
||||
mr.ViolationType = model.ViolationTypeName;
|
||||
mr.Party = model.PartyName;
|
||||
//查询巡查点信息
|
||||
var point = await uwo.MiMinePoint.AsQueryable().Where(r => r.Id == model.MinePointId).FirstAsync();
|
||||
if (point != null)
|
||||
{
|
||||
mr.ClueLocation = point.CountyName + point.StreetName + point.CommunityName + point.Name;
|
||||
}
|
||||
|
||||
var type = vehicleList
|
||||
.GroupBy(r => r.TypeName)
|
||||
.Select(g => new
|
||||
{
|
||||
name = g.Key,
|
||||
count = g.Count()
|
||||
}).ToList();
|
||||
string items = "";
|
||||
foreach (var item in type)
|
||||
{
|
||||
items += item.name + "*" + item.count + ";";
|
||||
}
|
||||
mr.Items = items;
|
||||
|
||||
//此处创建word并上传,调用新方法
|
||||
string wordPath = _helper.GenerateSeizureDocumentWord(mr, _env);
|
||||
mr.FilePath = wordPath; // 设置文件路径
|
||||
|
||||
await uwo.MiViolationReport.UpdateAsync(model);
|
||||
await uwo.MiScenePhoto.InsertRangeAsync(photos);
|
||||
await uwo.MiViolationUsers.InsertRangeAsync(personList); //其他人员
|
||||
await uwo.MiOtherpersonImage.InsertRangeAsync(personImageList); //其他人员图片
|
||||
await uwo.MiVehicle.InsertRangeAsync(vehicleList);
|
||||
await uwo.MiVehicleImage.InsertRangeAsync(vehicleImageList);
|
||||
await uwo.MiSeizureDocument.InsertAsync(mr);
|
||||
|
||||
var flag = uwo.Commit();
|
||||
return new Response<bool>
|
||||
{
|
||||
Result = flag,
|
||||
Message = flag == true ? "success" : "error"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -413,14 +607,36 @@ namespace OpenAuth.App
|
|||
a.ViolationReportId = model.Id;
|
||||
a.CreateTime = DateTime.Now;
|
||||
});
|
||||
|
||||
//其他人员
|
||||
var others = request.OtherPersons.MapToList<MiViolationUsers>();
|
||||
others.ForEach(a =>
|
||||
var personList = new List<MiViolationUsers>();
|
||||
var personImageList = new List<MiOtherpersonImage>();
|
||||
foreach (var item in request.OtherPersons)
|
||||
{
|
||||
a.Id = Guid.NewGuid().ToString();
|
||||
a.ViolationReportId = model.Id;
|
||||
});
|
||||
var person = item.MapTo<MiViolationUsers>();
|
||||
person.Id = Guid.NewGuid().ToString();
|
||||
person.ViolationReportId = model.Id;
|
||||
|
||||
//人员图片
|
||||
var images = item.Images.MapToList<MiOtherpersonImage>();
|
||||
images.ForEach(a =>
|
||||
{
|
||||
a.Id = Guid.NewGuid().ToString();
|
||||
a.ViolationReportId = model.Id;
|
||||
a.PersonId = person.Id;
|
||||
a.CreateTime = DateTime.Now;
|
||||
personImageList.Add(a);
|
||||
|
||||
});
|
||||
|
||||
personList.Add(person);
|
||||
}
|
||||
//其他人员
|
||||
//var others = request.OtherPersons.MapToList<MiViolationUsers>();
|
||||
//others.ForEach(a =>
|
||||
//{
|
||||
// a.Id = Guid.NewGuid().ToString();
|
||||
// a.ViolationReportId = model.Id;
|
||||
//});
|
||||
|
||||
//车辆信息
|
||||
var vehicleList = new List<MiVehicle>();
|
||||
|
|
@ -455,15 +671,15 @@ namespace OpenAuth.App
|
|||
mr.CreatedAt = DateTime.Now;
|
||||
mr.CreatedBy = user.User.Id.ToString();
|
||||
mr.Year = DateTime.Now.Year.ToString();
|
||||
mr.SeizureDate=DateTime.Now;
|
||||
mr.SeizureDate = DateTime.Now;
|
||||
var mrinfo = base.Repository.ChangeRepository<SugarRepositiry<MiSeizureDocument>>().AsQueryable().ToList();
|
||||
if (mrinfo.Count==0)
|
||||
if (mrinfo.Count == 0)
|
||||
{
|
||||
mr.SerialNumber = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mr.SerialNumber = (int)mrinfo.Max(r=>r.SerialNumber) + 1;
|
||||
mr.SerialNumber = (int)mrinfo.Max(r => r.SerialNumber) + 1;
|
||||
}
|
||||
mr.ViolationReportId = model.Id;
|
||||
mr.ViolationType = model.ViolationTypeName;
|
||||
|
|
@ -489,11 +705,15 @@ namespace OpenAuth.App
|
|||
}
|
||||
mr.Items = items;
|
||||
|
||||
//此处创建word并上传,调用新方法
|
||||
string wordPath = _helper.GenerateSeizureDocumentWord(mr, _env);
|
||||
mr.FilePath = wordPath; // 设置文件路径
|
||||
|
||||
|
||||
await uwo.MiViolationReport.InsertAsync(model);
|
||||
await uwo.MiScenePhoto.InsertRangeAsync(photos);
|
||||
await uwo.MiViolationUsers.InsertRangeAsync(others); //其他人员
|
||||
await uwo.MiViolationUsers.InsertRangeAsync(personList); //其他人员
|
||||
await uwo.MiOtherpersonImage.InsertRangeAsync(personImageList); //其他人员图片
|
||||
await uwo.MiVehicle.InsertRangeAsync(vehicleList);
|
||||
await uwo.MiVehicleImage.InsertRangeAsync(vehicleImageList);
|
||||
await uwo.MiSeizureDocument.InsertAsync(mr);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace OpenAuth.App.ServiceApp.Request
|
|||
{
|
||||
public class MiViolationReportRequest
|
||||
{
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// Desc:标题
|
||||
/// Default:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
|
@ -35,5 +36,7 @@ namespace OpenAuth.App.ServiceApp.Request
|
|||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string RelationShip { get; set; }
|
||||
|
||||
public List<MiOtherpersonImage> Images { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OpenAuth.Repository.Domain
|
||||
{
|
||||
///<summary>
|
||||
///其他人员图片表
|
||||
///</summary>
|
||||
[SugarTable("mi_otherperson_image")]
|
||||
public partial class MiOtherpersonImage
|
||||
{
|
||||
public MiOtherpersonImage()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:图片ID
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:违法信息id
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string ViolationReportId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:图片
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string Image { 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 decimal? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:DateTime.Now
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车辆 Id
|
||||
/// </summary>
|
||||
public string PersonId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -92,6 +92,10 @@ namespace OpenAuth.Repository.Domain
|
|||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string ViolationReportId {get;set;}
|
||||
/// <summary>
|
||||
/// word地址
|
||||
/// </summary>
|
||||
public string FilePath {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,5 +58,11 @@ namespace OpenAuth.Repository.Domain
|
|||
/// </summary>
|
||||
public string RelationShip {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// 导航属性
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToMany, nameof(MiOtherpersonImage.PersonId))]
|
||||
public List<MiOtherpersonImage> MiOtherpersonImages { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,5 +109,6 @@ namespace OpenAuth.Repository
|
|||
public SugarRepositiry<MiParkingUser> MiParkingUser { get; set; }
|
||||
public SugarRepositiry<MiReleaseDocument> MiReleaseDocument { get; set; }
|
||||
public SugarRepositiry<MiSeizureDocument> MiSeizureDocument { get; set; }
|
||||
public SugarRepositiry<MiOtherpersonImage> MiOtherpersonImage { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ namespace OpenAuth.WebApi.Controllers
|
|||
/// 修改
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public async Task<Response<bool>> Update(MiViolationReport model)
|
||||
public async Task<Response<bool>> Update(MiViolationReportRequest model)
|
||||
{
|
||||
var result = new Response<bool>();
|
||||
try
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
费县综合行政执法局
|
||||
扣押财物决定书
|
||||
费综执扣字[ 年 ]第 序号 号
|
||||
当事人 :
|
||||
经查,你(单位) 于[线索位置]的[违法类型]行为
|
||||
|
||||
违反了《中华人民共和国矿产资源法》第四条的规定。本机关根据《中华人民共和国矿产资源法》第五十七条之规定,决定于 年 月 日对下列物品予以扣押:
|
||||
1、 设备及车辆类型
|
||||
2、 设备及车辆类型
|
||||
3、 其它设备的录入内容
|
||||
|
||||
|
||||
年 月 日
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
PK
|
||||
| ||||