题库新增集团数据归属维护

master
xiaochanghai 3 weeks ago
parent 868eee2cea
commit e7fecfc34b
  1. 9487
      Model/Tiobon.Web.pdm
  2. 7
      Tiobon.Core.Model/Base/Ghre/Ghre_Question.Dto.Base.cs
  3. 7
      Tiobon.Core.Model/Models/Ghre/Ghre_Question.cs
  4. 1
      Tiobon.Core.Model/View/Ghre/Ghre_Question.Dto.View.cs
  5. 5
      Tiobon.Core.Model/ViewModels/Extend/FromGhre_QuestionInput.cs
  6. 4
      Tiobon.Core.Services/CommonServices.cs
  7. 21
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs
  8. 15
      Tiobon.Core/Tiobon.Core.Model.xml

File diff suppressed because it is too large Load Diff

@ -6,7 +6,7 @@
*
* Ver
*
*V0.01 2025/4/7 14:23:25 SimonHsiao
*V0.01 2025/5/29 15:26:19 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
@ -149,4 +149,9 @@ public class Ghre_QuestionBase
/// 内置
/// </summary>
public int? BuiltIn { get; set; }
/// <summary>
/// 集团数据归属
/// </summary>
public int? DataBelongID { get; set; }
}

@ -6,7 +6,7 @@
*
* Ver
*
*V0.01 2025/4/7 14:23:25 SimonHsiao
*V0.01 2025/5/29 15:26:19 SimonHsiao
*
* Copyright(c) 2025 Tiobon Corporation. All Rights Reserved.
*
@ -150,4 +150,9 @@ public class Ghre_Question : BasePoco
/// 内置
/// </summary>
public int? BuiltIn { get; set; }
/// <summary>
/// 集团数据归属
/// </summary>
public int? DataBelongID { get; set; }
}

@ -59,4 +59,5 @@ public class Ghre_QuestionDto : Ghre_Question
public string BuiltInLabel { get; set; }
public string DataBelongName { get; set; }
}

@ -31,6 +31,11 @@ public class FromGhre_QuestionBaseData
public string questionNo { get; set; }
public int? BuiltIn { get; set; }
/// <summary>
/// 集团数据归属
/// </summary>
public int? DataBelongID { get; set; }
/// <summary>
/// 创建信息

@ -2612,7 +2612,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
};
TableColumn.Add(searchItem);
sql = "SELECT Id, CourseNo, CourseName FROM Ghre_Course WHERE IsEnable=1 AND Status='Released'";
sql = $"SELECT Id, CourseNo, CourseName FROM Ghre_Course WHERE IsEnable=1 AND Status='Released' AND dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1";
if (!string.IsNullOrWhiteSpace(keyWords))
sql += $"AND ( CourseNo like '%{keyWords}%' or CourseName like '%{keyWords}%')";
dt = await Db.Ado.GetDataTableAsync(sql);
@ -2652,7 +2652,7 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
};
TableColumn.Add(searchItem);
sql = "SELECT Id, SceneNo, SceneName FROM Ghre_CourseScene WHERE IsEnable=1";
sql = $"SELECT Id, SceneNo, SceneName FROM Ghre_CourseScene WHERE IsEnable=1 AND dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1";
if (!string.IsNullOrWhiteSpace(keyWords))
sql += $"AND ( SceneNo like '%{keyWords}%' or SceneName like '%{keyWords}%')";
dt = await Db.Ado.GetDataTableAsync(sql);

@ -35,7 +35,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
//var data1 = await BaseDal.QueryFilterPage(body);
RefAsync<int> totalCount = 0;
var query = Db.Queryable<Ghre_Question>();
var query = Db.Queryable<Ghre_Question>().Where($"dbo.FUserDataBelongPriv ({App.User.ID}, DataBelongID, NULL) = 1");
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "UpdateTime DESC,CreateTime DESC";
@ -197,7 +197,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
{
RefAsync<int> totalCount = 0;
string sql = @"SELECT *
string sql = @$"SELECT *
FROM (SELECT A.*,
B.CourseName + ' (' + B.CourseNo + ')' CourseName,
B.CourseClassId,
@ -208,7 +208,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
LEFT JOIN Ghre_Course B ON A.CourseId = B.Id
LEFT JOIN Ghrs_User G ON A.CreateBy = G.UserId
LEFT JOIN Ghrs_User H ON A.UpdateBy = H.UserId
WHERE A.IsEnable = 1) A";
WHERE A.IsEnable = 1AND dbo.FUserDataBelongPriv ({App.User.ID}, A.DataBelongID, NULL) = 1) A";
if (string.IsNullOrWhiteSpace(filter.orderBy))
filter.orderBy = "CreateTime1 DESC";
@ -328,6 +328,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
x.CourseName = string.Join(",", courseClass.Select(a => a.CourseName + " (" + a.CourseNo + ")"));
}
x.BuiltInLabel = x.BuiltIn == 1 ? "是" : "否";
x.DataBelongName = await GetDataBelongName(x.DataBelongID);
});
@ -376,6 +377,17 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
dataSource = "",
placeholder = "保存后自动生成"
});
data.Column.Add(new FromGhre_QuestionColumn()
{
label = "集团数据归属",
field = "DataBelongID",
elementType = "ApiSelect",
required = false,
multipleSelect = false,
editable = true,
dataSource = "CommonList_DataBelongAll",
placeholder = ""
});
#endregion
@ -487,6 +499,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
data.PageData.baseData.CreateDataInfo = question.CreateDataInfo;
data.PageData.baseData.UpdateDataInfo = question.UpdateDataInfo;
data.PageData.baseData.BuiltIn = question.BuiltIn;
data.PageData.baseData.DataBelongID = question.DataBelongID;
var questionType = data.PageData.questionType.Where(x => x.type == question.QuestionType).FirstOrDefault();
if (questionType != null)
@ -564,6 +577,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
//insert.CourseId = courseID;
insert.CourseIds = JsonHelper.ObjToJson(insertModel.baseData.courseID);
insert.BuiltIn = insertModel.baseData.BuiltIn;
insert.DataBelongID = insertModel.baseData.DataBelongID;
insert.QuestionType = questionType.type;
insert.DifficultyLevel = questionType.detail.difficulty;
@ -656,6 +670,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
edit.QuestionType = questionType.type;
edit.BuiltIn = editModel.baseData.BuiltIn;
edit.DataBelongID = editModel.baseData.DataBelongID;
edit.DifficultyLevel = questionType.detail.difficulty;
edit.QuestionContent = questionType.detail.content;
edit.QuestionAnalysis = questionType.detail.RemarkSz;

@ -7520,6 +7520,11 @@
内置
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_QuestionBase.DataBelongID">
<summary>
集团数据归属
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_QuestionAnswerBase">
<summary>
题目答案 (Dto.Base)
@ -27197,6 +27202,11 @@
内置
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_Question.DataBelongID">
<summary>
集团数据归属
</summary>
</member>
<member name="T:Tiobon.Core.Model.Models.Ghre_QuestionAnswer">
<summary>
题目答案 (Model)
@ -43548,6 +43558,11 @@
试卷配置ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.FromGhre_QuestionBaseData.DataBelongID">
<summary>
集团数据归属
</summary>
</member>
<member name="P:Tiobon.Core.Model.FromGhre_QuestionBaseData.CreateDataInfo">
<summary>
创建信息

Loading…
Cancel
Save