修复 培训机构管理 附件上次异常

master
xiaochanghai 11 months ago
parent d4f7855c0f
commit 235c7f69d3
  1. 2
      Tiobon.Core.Model/Edit/Ghre/Ghre_SchoolAttachment.Dto.EditInput.cs
  2. 2
      Tiobon.Core.Model/Insert/Ghre/Ghre_SchoolAttachment.Dto.InsertInput.cs
  3. 2
      Tiobon.Core.Model/View/Ghre/Ghre_SchoolAttachment.Dto.View.cs
  4. 8
      Tiobon.Core.Services/CommonServices.cs
  5. 16
      Tiobon.Core.Services/Ghre/Ghre_SchoolServices.cs

@ -27,6 +27,6 @@ namespace Tiobon.Core.Model.Models
{
[NotMapped]
public List<EditGhrs_AttachmentInput> Attachments { get; set; }
public List<EditGhre_AttachmentInput> Attachments { get; set; }
}
}

@ -26,6 +26,6 @@ namespace Tiobon.Core.Model.Models
public class InsertGhre_SchoolAttachmentInput : Ghre_SchoolAttachmentBase
{
[NotMapped]
public List<InsertGhrs_AttachmentInput> Attachments { get; set; }
public List<InsertGhre_AttachmentInput> Attachments { get; set; }
}
}

@ -32,6 +32,6 @@ public class Ghre_SchoolAttachmentDto : Ghre_SchoolAttachment
/// </summary>
public string UpdateDataInfo { get; set; }
public List<Ghrs_AttachmentDto> Attachments { get; set; } = new List<Ghrs_AttachmentDto>();
public List<Ghre_AttachmentDto> Attachments { get; set; } = new List<Ghre_AttachmentDto>();
}

@ -1027,6 +1027,10 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
icon = "ghr-icon-stop",
position = "left"
});
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD6YN"; }
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD7YN"; }
result.DT_Procedure.ExportExcel = "/api/Ghre_Course/ExportExcel/Released";
break;
@ -1041,6 +1045,10 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
icon = "ghr-icon-stop",
position = "left"
});
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "CopyYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD6YN"; }
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD7YN"; }
result.DT_Procedure.ExportExcel = "/api/Ghre_Course/ExportExcel/Disabled";
break;

@ -18,17 +18,17 @@ namespace Tiobon.Core.Services;
public class Ghre_SchoolServices : BaseServices<Ghre_School, Ghre_SchoolDto, InsertGhre_SchoolInput, EditGhre_SchoolInput>, IGhre_SchoolServices
{
private readonly IBaseRepository<Ghre_School> _dal;
private IGhrs_AttachmentServices _ghrs_AttachmentServices;
private IGhre_AttachmentServices _ghre_AttachmentServices;
private IGhre_SchoolAttachmentServices _ghre_SchoolAttachmentServices;
public Ghre_SchoolServices(ICaching caching,
IGhrs_AttachmentServices ghrs_AttachmentServices,
IGhre_AttachmentServices ghre_AttachmentServices,
IGhre_SchoolAttachmentServices ghre_SchoolAttachmentServices,
IBaseRepository<Ghre_School> dal)
{
this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
_ghrs_AttachmentServices = ghrs_AttachmentServices;
_ghre_AttachmentServices = ghre_AttachmentServices;
_ghre_SchoolAttachmentServices = ghre_SchoolAttachmentServices;
}
@ -68,7 +68,7 @@ public class Ghre_SchoolServices : BaseServices<Ghre_School, Ghre_SchoolDto, Ins
var ids = entitys.Select(x => x.Id).ToList();
var schoolAttachments = await _ghre_SchoolAttachmentServices.QueryDto(x => ids.Contains(x.SchoolId.Value));
var ids1 = schoolAttachments.Select(x => x.Id.ToString()).ToList();
var attachments = await _ghrs_AttachmentServices.QueryDto(x => ids1.Contains(x.TableName));
var attachments = await _ghre_AttachmentServices.QueryDto(x => ids1.Contains(x.TableName));
schoolAttachments.ForEach(x =>
{
@ -97,8 +97,8 @@ public class Ghre_SchoolServices : BaseServices<Ghre_School, Ghre_SchoolDto, Ins
if (insert.Attachments != null && insert.Attachments.Any())
for (int j = 0; j < insert.Attachments.Count; j++)
{
await Db.Updateable<Ghrs_Attachment>()
.SetColumns(it => new Ghrs_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now })
await Db.Updateable<Ghre_Attachment>()
.SetColumns(it => new Ghre_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now })
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath)
.ExecuteCommandAsync();
}
@ -122,8 +122,8 @@ public class Ghre_SchoolServices : BaseServices<Ghre_School, Ghre_SchoolDto, Ins
if (insert.Attachments != null && insert.Attachments.Any())
for (int j = 0; j < insert.Attachments.Count; j++)
{
await Db.Updateable<Ghrs_Attachment>()
.SetColumns(it => new Ghrs_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now })
await Db.Updateable<Ghre_Attachment>()
.SetColumns(it => new Ghre_Attachment() { TableName = schoolAttachmentId.ToString(), UpdateTime = DateTime.Now })
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath)
.ExecuteCommandAsync();
}

Loading…
Cancel
Save