隐患整改导出

This commit is contained in:
geh
2025-04-21 09:33:45 +08:00
parent 226efdacc2
commit df2f29c5c4
18 changed files with 1242 additions and 67 deletions
@@ -71,7 +71,7 @@ namespace WebAPI.Controllers.HSSE
/// <param name="PersonId"></param>
/// <returns></returns>
[HttpPost]
public Model.ResponeData updateSignTime(string PersonId, DateTime? newSignTime = null)
public Model.ResponeData updateSignTime([FromBody] Item item)
{
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
{
@@ -79,11 +79,44 @@ namespace WebAPI.Controllers.HSSE
try
{
// 查找要修改的记录
var person = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == PersonId);
var person = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == item.PersonId);
if (person != null)
{
person.SignTime = newSignTime.HasValue ? newSignTime.Value : DateTime.Now; // 更新签字时间
person.SignTime = item.newSignTime.HasValue ? item.newSignTime.Value : DateTime.Now; // 更新签字时间
db.SubmitChanges();
Model.ToDoItem toDoItem = new Model.ToDoItem
{
MenuId = Const.PersonListMenuId,
DataId = item.PersonId + "_1",
UrlStr = item.AttachUrl1,
};
if (!string.IsNullOrEmpty(item.AttachUrl1))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_2";
toDoItem.UrlStr = item.AttachUrl2;
if (!string.IsNullOrEmpty(item.AttachUrl2))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_3";
toDoItem.UrlStr = item.AttachUrl3;
if (!string.IsNullOrEmpty(item.AttachUrl3))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
toDoItem.DataId = item.PersonId + "_4";
toDoItem.UrlStr = item.AttachUrl4;
if (!string.IsNullOrEmpty(item.AttachUrl4))
{
APIUpLoadFileService.SaveAttachUrl(toDoItem);
}
responeData.code = 1;
responeData.message = "保存成功。";
}
@@ -100,4 +133,14 @@ namespace WebAPI.Controllers.HSSE
#endregion
}
public class Item
{
public string PersonId { get; set; }
public string AttachUrl1 { get; set; }
public string AttachUrl2 { get; set; }
public string AttachUrl3 { get; set; }
public string AttachUrl4 { get; set; }
public DateTime? newSignTime { get; set; }
}
}