|
|
@ -8,7 +8,6 @@ using Tiobon.Core.Common; |
|
|
|
using Tiobon.Core.Model; |
|
|
|
using Tiobon.Core.Model; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
using AgileObjects.AgileMapper; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using Tiobon.Core.Common.DB.Dapper.Extensions; |
|
|
|
|
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json; |
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
namespace Tiobon.Core.Services; |
|
|
@ -19,17 +18,17 @@ namespace Tiobon.Core.Services; |
|
|
|
public class Ghre_TeacherServices : BaseServices<Ghre_Teacher, Ghre_TeacherDto, InsertGhre_TeacherInput, EditGhre_TeacherInput>, IGhre_TeacherServices |
|
|
|
public class Ghre_TeacherServices : BaseServices<Ghre_Teacher, Ghre_TeacherDto, InsertGhre_TeacherInput, EditGhre_TeacherInput>, IGhre_TeacherServices |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly IBaseRepository<Ghre_Teacher> _dal; |
|
|
|
private readonly IBaseRepository<Ghre_Teacher> _dal; |
|
|
|
private IGhrs_AttachmentServices _ghrs_AttachmentServices; |
|
|
|
private IGhre_AttachmentServices _ghre_AttachmentServices; |
|
|
|
private IGhre_TeacherAttachmentServices _ghre_TeacherAttachmentServices; |
|
|
|
private IGhre_TeacherAttachmentServices _ghre_TeacherAttachmentServices; |
|
|
|
public Ghre_TeacherServices(ICaching caching, |
|
|
|
public Ghre_TeacherServices(ICaching caching, |
|
|
|
IGhrs_AttachmentServices ghrs_AttachmentServices, |
|
|
|
IGhre_AttachmentServices ghre_AttachmentServices, |
|
|
|
IGhre_TeacherAttachmentServices ghre_TeacherAttachmentServices, |
|
|
|
IGhre_TeacherAttachmentServices ghre_TeacherAttachmentServices, |
|
|
|
IBaseRepository<Ghre_Teacher> dal) |
|
|
|
IBaseRepository<Ghre_Teacher> dal) |
|
|
|
{ |
|
|
|
{ |
|
|
|
this._dal = dal; |
|
|
|
this._dal = dal; |
|
|
|
base.BaseDal = dal; |
|
|
|
base.BaseDal = dal; |
|
|
|
base._caching = caching; |
|
|
|
base._caching = caching; |
|
|
|
_ghrs_AttachmentServices = ghrs_AttachmentServices; |
|
|
|
_ghre_AttachmentServices = ghre_AttachmentServices; |
|
|
|
_ghre_TeacherAttachmentServices = ghre_TeacherAttachmentServices; |
|
|
|
_ghre_TeacherAttachmentServices = ghre_TeacherAttachmentServices; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -174,7 +173,7 @@ FROM (SELECT A.*, |
|
|
|
var ids = entitys.Select(x => x.Id).ToList(); |
|
|
|
var ids = entitys.Select(x => x.Id).ToList(); |
|
|
|
var teacherAttachments = await _ghre_TeacherAttachmentServices.QueryDto(x => ids.Contains(x.TeacherId.Value)); |
|
|
|
var teacherAttachments = await _ghre_TeacherAttachmentServices.QueryDto(x => ids.Contains(x.TeacherId.Value)); |
|
|
|
var ids1 = teacherAttachments.Select(x => x.Id.ToString()).ToList(); |
|
|
|
var ids1 = teacherAttachments.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)); |
|
|
|
|
|
|
|
|
|
|
|
teacherAttachments.ForEach(x => |
|
|
|
teacherAttachments.ForEach(x => |
|
|
|
{ |
|
|
|
{ |
|
|
@ -221,8 +220,8 @@ FROM (SELECT A.*, |
|
|
|
if (insert.Attachments != null && insert.Attachments.Any()) |
|
|
|
if (insert.Attachments != null && insert.Attachments.Any()) |
|
|
|
for (int j = 0; j < insert.Attachments.Count; j++) |
|
|
|
for (int j = 0; j < insert.Attachments.Count; j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
await Db.Updateable<Ghrs_Attachment>() |
|
|
|
await Db.Updateable<Ghre_Attachment>() |
|
|
|
.SetColumns(it => new Ghrs_Attachment() { TableName = teacherAttachmentId.ToString(), UpdateTime = DateTime.Now }) |
|
|
|
.SetColumns(it => new Ghre_Attachment() { TableName = teacherAttachmentId.ToString(), UpdateTime = DateTime.Now }) |
|
|
|
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath) |
|
|
|
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath) |
|
|
|
.ExecuteCommandAsync(); |
|
|
|
.ExecuteCommandAsync(); |
|
|
|
} |
|
|
|
} |
|
|
@ -260,8 +259,8 @@ FROM (SELECT A.*, |
|
|
|
if (insert.Attachments != null && insert.Attachments.Any()) |
|
|
|
if (insert.Attachments != null && insert.Attachments.Any()) |
|
|
|
for (int j = 0; j < insert.Attachments.Count; j++) |
|
|
|
for (int j = 0; j < insert.Attachments.Count; j++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
await Db.Updateable<Ghrs_Attachment>() |
|
|
|
await Db.Updateable<Ghre_Attachment>() |
|
|
|
.SetColumns(it => new Ghrs_Attachment() { TableName = TeacherAttachmentId.ToString(), UpdateTime = DateTime.Now }) |
|
|
|
.SetColumns(it => new Ghre_Attachment() { TableName = TeacherAttachmentId.ToString(), UpdateTime = DateTime.Now }) |
|
|
|
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath) |
|
|
|
.Where(it => it.RelativePath == insert.Attachments[j].RelativePath) |
|
|
|
.ExecuteCommandAsync(); |
|
|
|
.ExecuteCommandAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|