113 lines
3.3 KiB
C#
113 lines
3.3 KiB
C#
using Learn.Archives.Core.Model.Dto;
|
|
using Learn.Archives.Core.Model.Interface;
|
|
using SqlSugar;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Net;
|
|
using System.Text.Json;
|
|
using UserCenter.Model;
|
|
using UserCenter.Model.Common;
|
|
using UserCenter.Model.Enum;
|
|
|
|
namespace Learn.Archives.Core.Model
|
|
{
|
|
/// <summary>
|
|
/// 学校业务联系表
|
|
/// </summary>
|
|
[SugarTable("schoolbusiness")]
|
|
public class SchoolBusiness : EntityBaseId, IDB
|
|
{
|
|
/// <summary>
|
|
/// 学校ID
|
|
/// </summary>
|
|
public long SchoolId { get; set; }
|
|
/// <summary>
|
|
/// 学校名称
|
|
/// </summary>
|
|
public string SchoolName { get; set; }
|
|
|
|
/// <summary>
|
|
/// dto 处理的grade
|
|
/// </summary>
|
|
public string? _grade;
|
|
/// <summary>
|
|
/// 年级
|
|
/// </summary>
|
|
[SugarColumn(IsIgnore = true)]
|
|
public string Grade
|
|
{
|
|
get => GradeHelper.GetGrade(GradeLevel, GradeYear);
|
|
set => _grade = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 年级
|
|
/// </summary>
|
|
public int GradeYear { get; set; }
|
|
public string GradeLevel { get; set; }
|
|
/// <summary>
|
|
/// 赴校人员 逗号分隔
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true, IsJson = true)]
|
|
public string[]? SchoolBusinessUser { get; set; }
|
|
/// <summary>
|
|
/// 赴校时间
|
|
/// </summary>
|
|
public DateTime StartTime { get; set; } = DateTime.Now;
|
|
/// <summary>
|
|
/// 赴校备注
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true)]
|
|
public string? Remark { get; set; }
|
|
|
|
/// <summary>
|
|
/// 反馈问题
|
|
/// <para>数据库JSON字段!!!</para>
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true, IsJson = true,ColumnDataType ="text")]
|
|
public FeedbackQuestionsDto[]? FeedbackQuestions { get; set; }
|
|
/// <summary>
|
|
/// 解决方案的记录
|
|
/// <para>数据库JSON字段!!!</para>
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true, IsJson = true, ColumnDataType = "text")]
|
|
public SolutionRecordDto? SolutionRecord { get; set; }
|
|
|
|
/// <summary>
|
|
/// 赴校问题已解决
|
|
/// </summary>
|
|
public bool SolutionEnd { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 开展座谈
|
|
/// </summary>
|
|
[SugarColumn(IsNullable =true,Length = 1000)]
|
|
public string? Discussion { get; set; }
|
|
/// <summary>
|
|
/// 开展班会
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true, Length = 1000)]
|
|
public string? ClassMeeting { get; set; }
|
|
|
|
/// <summary>
|
|
/// 反馈问题数量
|
|
/// </summary>
|
|
public long FeedbackCount => FeedbackQuestions?.Count() ?? 0;
|
|
/// <summary>
|
|
/// 反馈问题已解决数量
|
|
/// </summary>
|
|
public long SolveFeedbackCount => FeedbackQuestions?
|
|
.Count(s => s.EndTime != null) ?? 0;
|
|
|
|
/// <summary>
|
|
/// 开展过座谈
|
|
/// </summary>
|
|
public bool IsDiscussion => !string.IsNullOrEmpty(Discussion);
|
|
/// <summary>
|
|
/// 开展过班会
|
|
/// </summary>
|
|
public bool IsClassMeeting => !string.IsNullOrEmpty(ClassMeeting);
|
|
|
|
}
|
|
}
|