缺陷修复

master
xiaochanghai 1 year ago
parent 658db1f10a
commit f26dd11e5a
  1. 1384
      Model/Tiobon.Web.pdm
  2. 4
      Tiobon.Core.Api/Controllers/Base/BaseController.cs
  3. 30
      Tiobon.Core.Api/Tiobon.Core.Model.xml
  4. 2
      Tiobon.Core.IServices/BASE/IBaseServices.cs
  5. 16
      Tiobon.Core.Model/Base/Ghre/Ghre_CourseScene.Dto.Base.cs
  6. 12
      Tiobon.Core.Model/Models/Ghre/Ghre_CourseScene.cs
  7. 13
      Tiobon.Core.Model/View/Ghre/Ghre_CourseScene.Dto.View.cs
  8. 12
      Tiobon.Core.Model/ViewModels/Extend/ServiceFormResult.cs
  9. 20
      Tiobon.Core.Services/BASE/BaseServices.cs
  10. 70
      Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs
  11. 189
      Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
  12. 9
      Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs
  13. 15
      Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs
  14. 4
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs
  15. 30
      Tiobon.Core/Tiobon.Core.Model.xml

File diff suppressed because it is too large Load Diff

@ -89,9 +89,9 @@ public class BaseController<IServiceBase, TEntity, TEntityDto, TInsertDto, TEdit
/// <param name="body">body</param> /// <param name="body">body</param>
/// <returns></returns> /// <returns></returns>
[HttpPost("QueryForm")] [HttpPost("QueryForm")]
public virtual async Task<ServiceFormResult> QueryForm([FromBody] QueryForm body) public virtual async Task<ServiceFormResult<TEntityDto>> QueryForm([FromBody] QueryForm body)
{ {
var entity = await InvokeServiceAsync("QueryForm", [body]) as ServiceFormResult; var entity = await InvokeServiceAsync("QueryForm", [body]) as ServiceFormResult<TEntityDto>;
return entity; return entity;
} }
#endregion #endregion

@ -1240,6 +1240,16 @@
场景名称 场景名称
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.CourseId">
<summary>
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.CourseName">
<summary>
课程
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.RemarkSz">
<summary> <summary>
备注 备注
@ -4618,6 +4628,16 @@
场景名称 场景名称
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.CourseId">
<summary>
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.CourseName">
<summary>
课程
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.RemarkSz">
<summary> <summary>
备注 备注
@ -7271,6 +7291,16 @@
课程场景(Dto.View) 课程场景(Dto.View)
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneDto.CreateDataInfo">
<summary>
创建信息
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneDto.UpdateDataInfo">
<summary>
修改信息
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_CourseWareDto"> <member name="T:Tiobon.Core.Model.Models.Ghre_CourseWareDto">
<summary> <summary>
课件(Dto.View) 课件(Dto.View)

@ -94,7 +94,7 @@ namespace Tiobon.Core.IServices.BASE
Task<TEntityDto> QueryById(object objId, bool blnUseCache = false); Task<TEntityDto> QueryById(object objId, bool blnUseCache = false);
Task<List<TEntityDto>> QueryByIDs(object[] lstIds); Task<List<TEntityDto>> QueryByIDs(object[] lstIds);
Task<ServiceFormResult> QueryForm(QueryForm body); Task<ServiceFormResult<TEntityDto>> QueryForm(QueryForm body);
Task<long> Add(TInsertDto model); Task<long> Add(TInsertDto model);

@ -38,6 +38,18 @@ namespace Tiobon.Core.Model.Models
[Display(Name = "SceneName"), Description("场景名称"), MaxLength(32, ErrorMessage = "场景名称 不能超过 32 个字符")] [Display(Name = "SceneName"), Description("场景名称"), MaxLength(32, ErrorMessage = "场景名称 不能超过 32 个字符")]
public string SceneName { get; set; } public string SceneName { get; set; }
/// <summary>
/// 课程ID
/// </summary>
[Display(Name = "CourseId"), Description("课程ID"), MaxLength(2000, ErrorMessage = "课程ID 不能超过 2000 个字符")]
public string CourseId { get; set; }
/// <summary>
/// 课程
/// </summary>
[Display(Name = "CourseName"), Description("课程ID"), MaxLength(2000, ErrorMessage = "课程ID 不能超过 2000 个字符")]
public string CourseName { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
@ -123,5 +135,9 @@ namespace Tiobon.Core.Model.Models
/// 预留字段12 /// 预留字段12
/// </summary> /// </summary>
public int? ReverseI2 { get; set; } public int? ReverseI2 { get; set; }
public List<string> CourseIds { get; set; } = new List<string>();
} }
} }

@ -40,6 +40,18 @@ namespace Tiobon.Core.Model.Models
[Display(Name = "SceneName"), Description("场景名称"), MaxLength(32, ErrorMessage = "场景名称 不能超过 32 个字符"), EntityColumn(Unique = true)] [Display(Name = "SceneName"), Description("场景名称"), MaxLength(32, ErrorMessage = "场景名称 不能超过 32 个字符"), EntityColumn(Unique = true)]
public string SceneName { get; set; } public string SceneName { get; set; }
/// <summary>
/// 课程ID
/// </summary>
[Display(Name = "CourseId"), Description("课程ID"), MaxLength(2000, ErrorMessage = "课程ID 不能超过 2000 个字符")]
public string CourseId { get; set; }
/// <summary>
/// 课程
/// </summary>
[Display(Name = "CourseName"), Description("课程ID"), MaxLength(2000, ErrorMessage = "课程ID 不能超过 2000 个字符")]
public string CourseName { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

@ -23,5 +23,18 @@ namespace Tiobon.Core.Model.Models
/// </summary> /// </summary>
public class Ghre_CourseSceneDto : Ghre_CourseScene public class Ghre_CourseSceneDto : Ghre_CourseScene
{ {
public List<string> CourseIds { get; set; }
/// <summary>
/// 创建信息
/// </summary>
public string CreateDataInfo { get; set; }
/// <summary>
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
} }
} }

@ -2,14 +2,22 @@
namespace Tiobon.Core.Model; namespace Tiobon.Core.Model;
public class ServiceFormResult public class ServiceFormResult<T>
{ {
public int code { get; set; } = 0; public int code { get; set; } = 0;
public string message { get; set; } public string message { get; set; }
public dynamic result { get; set; } = new ExpandoObject(); public ServiceFormItemResult<T> result { get; set; } = new ServiceFormItemResult<T> { };
public string type { get; set; } = "success"; public string type { get; set; } = "success";
public bool Success { get; set; } = true; public bool Success { get; set; } = true;
public string Message { get; set; } public string Message { get; set; }
}
public class ServiceFormItemResult<T>
{
public List<T> DT_TableDataT1 { get; set; } = new List<T> { };
public dynamic JM_PageFormActionsT1 { get; set; } = new ExpandoObject();
public dynamic DT_PageMutiMsg { get; set; } = new ExpandoObject();
public dynamic JM_TableColumnT1 { get; set; } = new ExpandoObject();
public dynamic JM_PageFormT1 { get; set; } = new ExpandoObject();
} }

@ -127,9 +127,9 @@ public class BaseServices<TEntity, TEntityDto, TInsertDto, TEditDto> : IBaseServ
return Mapper.Map(data).ToANew<List<TEntityDto>>(); return Mapper.Map(data).ToANew<List<TEntityDto>>();
} }
public virtual async Task<ServiceFormResult> QueryForm(QueryForm body) public virtual async Task<ServiceFormResult<TEntityDto>> QueryForm(QueryForm body)
{ {
var result = new ServiceFormResult(); var data = new ServiceFormResult<TEntityDto>();
string sql = string.Empty; string sql = string.Empty;
var dt = new DataTable(); var dt = new DataTable();
@ -166,7 +166,7 @@ public class BaseServices<TEntity, TEntityDto, TInsertDto, TEditDto> : IBaseServ
UpdateDataInfo UpdateDataInfo
FROM {entityType.GetEntityTableName()} a FROM {entityType.GetEntityTableName()} a
WHERE a.Id = @ID"; WHERE a.Id = @ID";
result.result.DT_TableDataT1 = await Db.Ado.SqlQueryAsync<TEntityDto>(sql); data.result.DT_TableDataT1 = await Db.Ado.SqlQueryAsync<TEntityDto>(sql);
} }
else else
{ {
@ -175,7 +175,7 @@ public class BaseServices<TEntity, TEntityDto, TInsertDto, TEditDto> : IBaseServ
new TEntity() new TEntity()
}; };
result.result.DT_TableDataT1 = Mapper.Map(list).ToANew<List<TEntityDto>>(); data.result.DT_TableDataT1 = Mapper.Map(list).ToANew<List<TEntityDto>>();
} }
#region JM_PageFormActionsT1 #region JM_PageFormActionsT1
@ -293,11 +293,11 @@ public class BaseServices<TEntity, TEntityDto, TInsertDto, TEditDto> : IBaseServ
} }
#endregion #endregion
result.result.JM_PageFormActionsT1 = JM_PageFormActionsT1; data.result.JM_PageFormActionsT1 = JM_PageFormActionsT1;
result.result.JM_TableColumnT1 = JM_TableColumnT1; data.result.JM_TableColumnT1 = JM_TableColumnT1;
result.result.JM_PageFormT1 = JM_PageFormT1; data.result.JM_PageFormT1 = JM_PageFormT1;
result.result.DT_PageMutiMsg = DT_PageMutiMsg; data.result.DT_PageMutiMsg = DT_PageMutiMsg;
return result; return data;
} }
#region 新增 #region 新增
@ -704,7 +704,7 @@ public class BaseServices<TEntity, TEntityDto, TInsertDto, TEditDto> : IBaseServ
public virtual async Task<ServicePageResult<TEntityDto>> QueryFilterPage(QueryBody filter, string condition) public virtual async Task<ServicePageResult<TEntityDto>> QueryFilterPage(QueryBody filter, string condition)
{ {
if (string.IsNullOrWhiteSpace(filter.orderBy)) if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime DESC"; filter.orderBy = "UpdateTime DESC,CreateTime DESC";
if (filter.pageSize == 0) if (filter.pageSize == 0)
filter.pageSize = 10000; filter.pageSize = 10000;

@ -4,20 +4,70 @@ using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE; using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base; using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Common.Caches; using Tiobon.Core.Common.Caches;
using Tiobon.Core.Common;
using Tiobon.Core.Model;
using Tiobon.Core.Common.Helper;
using MathNet.Numerics.Distributions;
using NPOI.Util.Collections;
namespace Tiobon.Core.Services namespace Tiobon.Core.Services;
/// <summary>
/// 课程场景 (服务)
/// </summary>
public class Ghre_CourseSceneServices : BaseServices<Ghre_CourseScene, Ghre_CourseSceneDto, InsertGhre_CourseSceneInput, EditGhre_CourseSceneInput>, IGhre_CourseSceneServices
{ {
/// <summary> private readonly IBaseRepository<Ghre_CourseScene> _dal;
/// 课程场景 (服务) public Ghre_CourseSceneServices(ICaching caching, IBaseRepository<Ghre_CourseScene> dal)
/// </summary> {
public class Ghre_CourseSceneServices : BaseServices<Ghre_CourseScene, Ghre_CourseSceneDto, InsertGhre_CourseSceneInput, EditGhre_CourseSceneInput>, IGhre_CourseSceneServices this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
}
public override async Task<ServiceFormResult<Ghre_CourseSceneDto>> QueryForm(QueryForm body)
{
var result = await base.QueryForm(body);
var DT_TableDataT1 = result.result.DT_TableDataT1;
DT_TableDataT1.ForEach(t =>
{
if (!string.IsNullOrWhiteSpace(t.CourseId))
t.CourseIds = JsonHelper.JsonToObj<List<string>>(t.CourseId);
else
t.CourseIds = new List<string>();
});
result.result.DT_TableDataT1 = DT_TableDataT1;
return result;
}
public override async Task<long> Add(InsertGhre_CourseSceneInput entity)
{
if (entity.CourseIds != null && entity.CourseIds.Any())
{
entity.CourseId = JsonHelper.ObjToJson(entity.CourseIds);
var list = Db.Queryable<Ghre_Course>().Where(x => entity.CourseIds.Contains(x.Id.ToString())).Select(x => x.CourseName).ToList();
entity.CourseName = string.Join("、", list.Select(x => x).ToArray());
}
return await base.Add(entity);
}
public override async Task<bool> Update(long Id, EditGhre_CourseSceneInput editModel)
{ {
private readonly IBaseRepository<Ghre_CourseScene> _dal;
public Ghre_CourseSceneServices(ICaching caching, IBaseRepository<Ghre_CourseScene> dal) if (editModel.CourseIds != null && editModel.CourseIds.Any())
{ {
this._dal = dal;
base.BaseDal = dal; editModel.CourseId = JsonHelper.ObjToJson(editModel.CourseIds);
base._caching = caching;
var list = Db.Queryable<Ghre_Course>().Where(x => editModel.CourseIds.Contains(x.Id.ToString())).Select(x => x.CourseName).ToList();
editModel.CourseName = string.Join("、", list.Select(x => x).ToArray());
} }
return await base.Update(Id, editModel);
} }
} }

@ -66,7 +66,7 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins
WHERE A.IsEnable = 1) A"; WHERE A.IsEnable = 1) A";
if (string.IsNullOrWhiteSpace(filter.orderBy)) if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime DESC"; filter.orderBy = "UpdateTime DESC,CreateTime DESC";
string conditions = "1=1"; string conditions = "1=1";
if (filter.jsonParam != null) if (filter.jsonParam != null)
@ -284,189 +284,22 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins
} }
public override async Task<ServiceFormResult> QueryForm(QueryForm body) public override async Task<ServiceFormResult<Ghre_CourseDto>> QueryForm(QueryForm body)
{ {
var result = new ServiceFormResult(); var result = await base.QueryForm(body);
string sql = string.Empty; string examPaperId = result.result.DT_TableDataT1[0].ExamPaperId;
var dt = new DataTable(); if (!string.IsNullOrWhiteSpace(examPaperId))
result.result.DT_TableDataT1[0].ExamPaperIds = JsonConvert.DeserializeObject<List<long>>(examPaperId);
if (body.id != null)
{
Type entityType = typeof(Ghre_Course);
sql = @$"DECLARE @langId INT = '{body.langId}',@ID BIGINT = '{body.id}';
SELECT *,
isnull
((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END
FROM Ghrs_User kk
WHERE kk.UserId = a.CreateBy),
'')
+ ' '
+ [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, ' ')
+ ' '
+ CONVERT (NVARCHAR (16), CreateTime, 121)
+ ' '
+ [dbo].[FLangKeyToValue] ('GHR_Common_000079', @langId, ' ')
CreateDataInfo,
isnull
((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END
FROM Ghrs_User kk
WHERE kk.UserId = a.UpdateBy),
'')
+ ' '
+ [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, '于')
+ ' '
+ CONVERT (NVARCHAR (16), UpdateTime, 121)
+ ' '
+ [dbo].[FLangKeyToValue]
('GHR_Common_000080', @langId, ' ')
UpdateDataInfo
FROM {entityType.GetEntityTableName()} a
WHERE a.Id = @ID";
var list = await Db.Ado.SqlQueryAsync<Ghre_CourseDto>(sql);
list.ForEach(x =>
{
if (!string.IsNullOrWhiteSpace(x.ExamPaperId))
x.ExamPaperIds = JsonHelper.JsonToObj<List<long>>(x.ExamPaperId);
});
result.result.DT_TableDataT1 = list;
}
else
{
var list = new List<Ghre_Course>
{
new()
};
result.result.DT_TableDataT1 = Mapper.Map(list).ToANew<List<Ghre_CourseDto>>();
}
#region JM_PageFormActionsT1
dynamic JM_PageFormActionsT1 = new ExpandoObject();
var toolbars = await _caching.GetAsync<List<FormToolbar>>(body.menuName + "FormToolbar");
if (toolbars == null || (toolbars != null && !toolbars.Any()))
{
sql = @$"SELECT field fnKey, [dbo].[FLangKeyToValue] (mkey, {body.langId}, label) fnTitle, icon
FROM Ghrs_PageSettingEdit
WHERE IsEnable = 1 AND pageNo = '{body.menuName}' AND elementType = 'FnKey'";
toolbars = await Db.Ado.SqlQueryAsync<FormToolbar>(sql);
if (toolbars.Any())
await _caching.SetAsync(body.menuName + "FormToolbar", toolbars);
}
else result.result.DT_TableDataT1[0].ExamPaperIds = new List<long>();
JM_PageFormActionsT1.Toolbar = toolbars; if (body.doType == "Copy")
#endregion
#region JM_TableColumnT1
dynamic JM_TableColumnT1 = new ExpandoObject();
var tableColumn = new JArray();
sql = @$"SELECT field,
[dbo].[FLangKeyToValue] (mkey, {body.langId}, label)
label,
required,
editable,
rowNum,
colNum,
elementType,
dbo.FS_GetdataSourceBySet
(dataSource, APIDataSourceType, Ghrs_PageSettingEdit.APIDataSourceID)
dataSource,
defaultHidden,
isPrimaryKey,
isSingleColumn,multipleSelect
FROM Ghrs_PageSettingEdit
WHERE IsEnable = 1
AND pageNo = '{body.menuName}'
AND elementType NOT IN ('FnKey', 'PageGroup');";
dt = await Db.Ado.GetDataTableAsync(sql);
for (int i = 0; i < dt.Rows.Count; i++)
{
string dataSource = dt.Rows[i]["dataSource"].ToString();
string field = dt.Rows[i]["field"].ToString();
if (field == "SchoolTeacherId")
dataSource = "api/Ghre_Course/GetSelect?FW=DOTNETCORE&linkId=";
JObject item =
[
new JProperty("field",field),
new JProperty("label", dt.Rows[i]["label"].ToString()),
new JProperty("required",!string.IsNullOrWhiteSpace(dt.Rows[i]["required"].ToString())? Convert.ToBoolean(dt.Rows[i]["required"]):null),
new JProperty("editable",!string.IsNullOrWhiteSpace(dt.Rows[i]["editable"].ToString())? Convert.ToBoolean(dt.Rows[i]["editable"]):null),
new JProperty("rowNum",!string.IsNullOrWhiteSpace(dt.Rows[i]["rowNum"].ToString())? Convert.ToInt32(dt.Rows[i]["rowNum"]):null),
new JProperty("colNum",!string.IsNullOrWhiteSpace(dt.Rows[i]["colNum"].ToString())? Convert.ToInt32(dt.Rows[i]["colNum"]):null),
new JProperty("elementType", dt.Rows[i]["elementType"].ToString()),
new JProperty("dataSource", dataSource),
new JProperty("defaultHidden", dt.Rows[i]["defaultHidden"].ToString()),
new JProperty("isPrimaryKey", !string.IsNullOrWhiteSpace(dt.Rows[i]["isPrimaryKey"].ToString())? Convert.ToBoolean(dt.Rows[i]["isPrimaryKey"]):null),
new JProperty("isSingleColumn",!string.IsNullOrWhiteSpace(dt.Rows[i]["isSingleColumn"].ToString())? Convert.ToInt32(dt.Rows[i]["isSingleColumn"]):null),
new JProperty("multipleSelect",!string.IsNullOrWhiteSpace(dt.Rows[i]["multipleSelect"].ToString())? Convert.ToBoolean(dt.Rows[i]["multipleSelect"]):null),
];
tableColumn.Add(item);
}
JM_TableColumnT1.TableColumn = tableColumn;
#endregion
#region JM_PageFormT1
dynamic JM_PageFormT1 = new ExpandoObject();
var pageForm = new JArray();
JObject pageFormItem =
[
new JProperty("disabled", false),
new JProperty("labelAlign", "right"),
new JProperty("labelCol", "{span: 6}"),
new JProperty("labelWidth",120),
new JProperty("layout", "horizontal")
];
sql = $@"SELECT [dbo].[FLangKeyToValue] (MKey, {body.langId}, MenuName) pageTitle,
IUDProcedure apiName
FROM Ghrs_Menu
WHERE MenuNo = '{body.menuName}' AND IsEnable = 1";
dt = await Db.Ado.GetDataTableAsync(sql);
if (dt.Rows.Count > 0)
{ {
pageFormItem.Add(new JProperty("pageTitle", dt.Rows[0]["pageTitle"].ToString())); result.result.DT_TableDataT1[0].CourseNo = null;
pageFormItem.Add(new JProperty("apiName", dt.Rows[0]["apiName"].ToString())); result.result.DT_TableDataT1[0].CourseName = null;
} }
pageForm.Add(pageFormItem);
JM_PageFormT1.PageForm = pageForm;
#endregion
#region DT_PageMutiMsg
var DT_PageMutiMsg = await _caching.GetAsync<List<DT_PageMutiMsg>>("DT_PageMutiMsg");
if (DT_PageMutiMsg == null || (DT_PageMutiMsg != null && !DT_PageMutiMsg.Any()))
{
sql = $@"SELECT Langkey field,
CASE {body.langId}
WHEN 1 THEN isnull (Value01, LangValue)
WHEN 2 THEN isnull (Value02, LangValue)
WHEN 3 THEN isnull (Value03, LangValue)
WHEN 4 THEN isnull (Value04, LangValue)
WHEN 5 THEN isnull (Value05, LangValue)
WHEN 6 THEN isnull (Value06, LangValue)
WHEN 7 THEN isnull (Value07, LangValue)
WHEN 8 THEN isnull (Value08, LangValue)
WHEN 9 THEN isnull (Value09, LangValue)
WHEN 10 THEN isnull (Value10, LangValue)
END label
FROM Ghrs_LangKey
WHERE (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%')
AND IsEnable = 1";
DT_PageMutiMsg = Db.Ado.SqlQuery<DT_PageMutiMsg>(sql);
if (DT_PageMutiMsg.Any())
await _caching.SetAsync("DT_PageMutiMsg", DT_PageMutiMsg);
}
#endregion
result.result.JM_PageFormActionsT1 = JM_PageFormActionsT1;
result.result.JM_TableColumnT1 = JM_TableColumnT1;
result.result.JM_PageFormT1 = JM_PageFormT1;
result.result.DT_PageMutiMsg = DT_PageMutiMsg;
return result; return result;
} }

@ -63,7 +63,7 @@ namespace Tiobon.Core.Services
return await base.Update(Id, editModel); return await base.Update(Id, editModel);
} }
public override async Task<ServiceFormResult> QueryForm(QueryForm body) public override async Task<ServiceFormResult<Ghre_CourseWareDto>> QueryForm(QueryForm body)
{ {
var result = await base.QueryForm(body); var result = await base.QueryForm(body);
string courseIds = result.result.DT_TableDataT1[0].CourseIds; string courseIds = result.result.DT_TableDataT1[0].CourseIds;
@ -72,8 +72,13 @@ namespace Tiobon.Core.Services
else result.result.DT_TableDataT1[0].CourseIds2 = new List<long>(); else result.result.DT_TableDataT1[0].CourseIds2 = new List<long>();
result.result.DT_TableDataT1[0].Attachments = await _ghre_CourseWareAttachmentServices.Query(x => x.CourseWareId == body.id); result.result.DT_TableDataT1[0].Attachments = await _ghre_CourseWareAttachmentServices.Query(x => x.CourseWareId == body.id);
if (body.doType == "Copy")
{
result.result.DT_TableDataT1[0].CourseWareNo = null;
result.result.DT_TableDataT1[0].CourseWareName = null;
}
return result; return result;
} }

@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http;
using Tiobon.Core.Common.UserManager; using Tiobon.Core.Common.UserManager;
using MongoDB.Driver.Linq; using MongoDB.Driver.Linq;
using Tiobon.Core.Common.DB.Dapper; using Tiobon.Core.Common.DB.Dapper;
using System.Drawing.Drawing2D;
namespace Tiobon.Core.Services; namespace Tiobon.Core.Services;
@ -453,7 +454,7 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
WHERE A.IsEnable = 1) A"; WHERE A.IsEnable = 1) A";
if (string.IsNullOrWhiteSpace(filter.orderBy)) if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime DESC"; filter.orderBy = "UpdateTime DESC,CreateTime DESC";
string conditions = "1=1"; string conditions = "1=1";
if (filter.jsonParam != null) if (filter.jsonParam != null)
@ -781,7 +782,8 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
elementType = "Input", elementType = "Input",
required =false , required =false ,
multipleSelect = false, multipleSelect = false,
editable = false editable = false,
placeholder="保存后自动生成"
}, },
new DefaultGhre_ExamColumn() new DefaultGhre_ExamColumn()
{ {
@ -979,11 +981,8 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
if (pageData.AfterHowLong == 0) if (pageData.AfterHowLong == 0)
pageData.AfterHowLong = pageData.AfterHowLong1; pageData.AfterHowLong = pageData.AfterHowLong1;
if (string.IsNullOrWhiteSpace(pageData.CoverUrl)) var course = await Db.Queryable<Ghre_ExamPaper>().Where(it => it.Id == pageData.ExamPaperId).FirstAsync();
{ pageData.CoverUrl = course?.CoverUrl;
var course = await Db.Queryable<Ghre_ExamPaper>().Where(it => it.Id == pageData.ExamPaperId).FirstAsync();
pageData.CoverUrl = course?.CoverUrl;
}
if (string.IsNullOrWhiteSpace(pageData.ExamNo)) if (string.IsNullOrWhiteSpace(pageData.ExamNo))
pageData.ExamNo = await GenerateContinuousSequence(); pageData.ExamNo = await GenerateContinuousSequence();
@ -1210,6 +1209,8 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
exam.Status = "Draft"; exam.Status = "Draft";
var insert = Mapper.Map(exam).ToANew<InsertGhre_ExamInput>(); var insert = Mapper.Map(exam).ToANew<InsertGhre_ExamInput>();
insert.ExamNo = await GenerateContinuousSequence();
var insertStaffs = Mapper.Map(exam).ToANew<List<InsertGhre_ExamStaffInput>>(); var insertStaffs = Mapper.Map(exam).ToANew<List<InsertGhre_ExamStaffInput>>();
id = await base.Add(insert); id = await base.Add(insert);
insertStaffs.ForEach(x => x.ExamId = id); insertStaffs.ForEach(x => x.ExamId = id);

@ -45,7 +45,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
var query = Db.Queryable<Ghre_Question>(); var query = Db.Queryable<Ghre_Question>();
if (string.IsNullOrWhiteSpace(filter.orderBy)) if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime DESC"; filter.orderBy = "UpdateTime DESC,CreateTime DESC";
string conditions = "1=1"; string conditions = "1=1";
if (filter.jsonParam != null) if (filter.jsonParam != null)
@ -173,7 +173,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
WHERE A.IsEnable = 1) A"; WHERE A.IsEnable = 1) A";
if (string.IsNullOrWhiteSpace(filter.orderBy)) if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime DESC"; filter.orderBy = "UpdateTime DESC,CreateTime DESC";
string conditions = " WHERE 1=1"; string conditions = " WHERE 1=1";
if (filter.jsonParam != null) if (filter.jsonParam != null)

@ -1240,6 +1240,16 @@
场景名称 场景名称
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.CourseId">
<summary>
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.CourseName">
<summary>
课程
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneBase.RemarkSz">
<summary> <summary>
备注 备注
@ -4618,6 +4628,16 @@
场景名称 场景名称
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.CourseId">
<summary>
课程ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.CourseName">
<summary>
课程
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.RemarkSz"> <member name="P:Tiobon.Core.Model.Models.Ghre_CourseScene.RemarkSz">
<summary> <summary>
备注 备注
@ -7271,6 +7291,16 @@
课程场景(Dto.View) 课程场景(Dto.View)
</summary> </summary>
</member> </member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneDto.CreateDataInfo">
<summary>
创建信息
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_CourseSceneDto.UpdateDataInfo">
<summary>
修改信息
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_CourseWareDto"> <member name="T:Tiobon.Core.Model.Models.Ghre_CourseWareDto">
<summary> <summary>
课件(Dto.View) 课件(Dto.View)

Loading…
Cancel
Save