diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_CreditPointController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CreditPointController.cs index f49d7f28..df57b64b 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_CreditPointController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_CreditPointController.cs @@ -11,4 +11,18 @@ public class Ghre_CreditPointController : BaseController + /// 查询明细数据 + /// + /// body + /// + [HttpPost, Route("QueryTotal")] + public async Task> QueryTotal([FromBody] QueryBody body) + { + return await _service.QueryTotal(body); + } + + #endregion } \ No newline at end of file diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index 38bc72ed..c0bee809 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -1655,6 +1655,106 @@ 预留字段12 + + + 学分记录 (Dto.Base) + + + + + 员工ID + + + + + 课程ID + + + + + 课程快照ID + + + + + 获得日期 + + + + + 获得学分 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 考试 (Dto.Base) @@ -4162,6 +4262,11 @@ 课件附件 (Dto.EditInput) + + + 学分记录 (Dto.EditInput) + + 考试 (Dto.EditInput) @@ -4312,6 +4417,11 @@ 课件附件 (Dto.InsertInput) + + + 学分记录 (Dto.InsertInput) + + 考试 (Dto.InsertInput) @@ -6241,6 +6351,106 @@ 预留字段12 + + + 学分记录 (Model) + + + + + 员工ID + + + + + 课程ID + + + + + 课程快照ID + + + + + 获得日期 + + + + + 获得学分 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 考试 (Model) @@ -9647,6 +9857,21 @@ 修改信息 + + + 学分记录(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + 考试(Dto.View) @@ -11170,5 +11395,50 @@ 修改信息 + + + 员工id + + + + + 工号 + + + + + 员工姓名 + + + + + 部门编号 + + + + + 部门名称 + + + + + 岗位 + + + + + 入职日期 + + + + + 在职状态 + + + + + 学分 + + diff --git a/Tiobon.Core.Api/Tiobon.Core.xml b/Tiobon.Core.Api/Tiobon.Core.xml index c9bf48da..c4f60c63 100644 --- a/Tiobon.Core.Api/Tiobon.Core.xml +++ b/Tiobon.Core.Api/Tiobon.Core.xml @@ -629,6 +629,18 @@ 课件ID + + + 学分记录(Controller) + + + + + 查询明细数据 + + body + + 考试(Controller) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs index 8711e108..cf872942 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs @@ -1,12 +1,14 @@ -using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Common; +using Tiobon.Core.IServices.BASE; +using Tiobon.Core.Model; using Tiobon.Core.Model.Models; -namespace Tiobon.Core.IServices -{ - /// - /// 学分记录(自定义服务接口) - /// +namespace Tiobon.Core.IServices; + +/// +/// 学分记录(自定义服务接口) +/// public interface IGhre_CreditPointServices :IBaseServices - { - } -} \ No newline at end of file +{ + Task> QueryTotal(QueryBody filter); + } \ No newline at end of file diff --git a/Tiobon.Core.Model/ViewModels/Extend/Ghre_CreditPointTotal.cs b/Tiobon.Core.Model/ViewModels/Extend/Ghre_CreditPointTotal.cs new file mode 100644 index 00000000..90eb9a5c --- /dev/null +++ b/Tiobon.Core.Model/ViewModels/Extend/Ghre_CreditPointTotal.cs @@ -0,0 +1,56 @@ +namespace Tiobon.Core.Model; + +public class Ghre_CreditPointTotal +{ + /// + /// 员工id + /// + public int Id { get; set; } + + /// + /// 工号 + /// + public string StaffNo { get; set; } + + /// + /// 员工姓名 + /// + + public string StaffName { get; set; } + + /// + /// 部门编号 + /// + + public string DeptNo { get; set; } + + /// + /// 部门名称 + /// + + public string DepteName { get; set; } + + /// + /// 岗位 + /// + + public string TitleName { get; set; } + + /// + /// 入职日期 + /// + + public string Indate { get; set; } + + /// + /// 在职状态 + /// + + public string InStatusLabel { get; set; } + + /// + /// 学分 + /// + + public string CreditPoints { get; set; } +} diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index 1dc87fc1..9f47c61d 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -795,7 +795,7 @@ public class BaseServices : IBaseServ case "LessOrEqual"://小于等于 conditions += $" AND {name} <='{jsonParam.columnValue}'"; break; - case "Less "://小于 + case "Less"://小于 conditions += $" AND {name} <'{jsonParam.columnValue}'"; break; default: diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index f548b917..35f8988f 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -1091,6 +1091,10 @@ public partial class CommonServices : BaseServices>, ICommon position = "left" }); break; + case "F_CreditCheck": + toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault(); + if (toolbar != null) { toolbar.fnKey = "TBD3YN"; } + break; } #endregion diff --git a/Tiobon.Core.Services/Ghre/Ghre_CreditPointServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CreditPointServices.cs index f420471b..526a2c3d 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CreditPointServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CreditPointServices.cs @@ -4,20 +4,165 @@ using Tiobon.Core.Model.Models; using Tiobon.Core.Services.BASE; using Tiobon.Core.IRepository.Base; using Tiobon.Core.Common.Caches; +using Newtonsoft.Json.Linq; +using SqlSugar; +using Tiobon.Core.Common; +using Tiobon.Core.Model; +using Newtonsoft.Json; -namespace Tiobon.Core.Services +namespace Tiobon.Core.Services; + +/// +/// 学分记录 (服务) +/// +public class Ghre_CreditPointServices : BaseServices, IGhre_CreditPointServices { - /// - /// 学分记录 (服务) - /// - public class Ghre_CreditPointServices : BaseServices, IGhre_CreditPointServices + private readonly IBaseRepository _dal; + public Ghre_CreditPointServices(ICaching caching, IBaseRepository dal) { - private readonly IBaseRepository _dal; - public Ghre_CreditPointServices(ICaching caching, IBaseRepository dal) - { - this._dal = dal; - base.BaseDal = dal; - base._caching = caching; - } + this._dal = dal; + base.BaseDal = dal; + base._caching = caching; } + + public async Task> QueryTotal(QueryBody filter) + { + RefAsync totalCount = 0; + string sql = @"SELECT * + FROM (SELECT StaffId Id, + StaffNo, + StaffName, + DeptNo, + DepteName, + TitleName, + CONVERT (NVARCHAR (10), Indate, 120) Indate, + InStatusLabel, + DeptID, + TitleID, + SUM (CreditPoints) CreditPoints + FROM Ghre_CreditPoint_V + WHERE {0} + GROUP BY StaffId, + StaffNo, + StaffName, + DeptNo, + DepteName, + TitleName, + Indate, + InStatusLabel, + DeptID, + TitleID) A"; + + if (string.IsNullOrWhiteSpace(filter.orderBy)) + filter.orderBy = "StaffNo ASC"; + + string conditions = "1=1"; + if (filter.jsonParam != null) + foreach (JProperty jProperty in filter.jsonParam.Properties()) + { + var name = jProperty.Name; + var value = jProperty.Value.ToString(); + if (name == "page" || name == "pageSize") + continue; + + //if (name == "Indate") + //{ + // var jsonParam = JsonConvert.DeserializeObject(value); + // conditions += $" AND (Indate BETWEEN '{jsonParam.columnValue[0]}' AND '{jsonParam.columnValue[1]}')"; + + // continue; + //} + if (name == "Date") + { + var jsonParam = JsonConvert.DeserializeObject(value); + conditions += $" AND (Date BETWEEN '{jsonParam.columnValue[0]}' AND '{jsonParam.columnValue[1]}')"; + + continue; + } + if (name == "CreditPoints") + { + var jsonParam = JsonConvert.DeserializeObject(value); + + switch (jsonParam.operationKey) + { + case "Include": + sql += $" WHERE {name} LIKE '%{jsonParam.columnValue}%'"; + break; + case "NotInclude": + sql += $" WHERE {name} NOT LIKE '%{jsonParam.columnValue}%'"; + break; + case "IsNull": + sql += $" WHERE {name} IS NULL"; + break; + case "NotNull": + sql += $" WHERE {name} IS NOT NULL"; + break; + case "Equal": + sql += $" WHERE {name} ='{jsonParam.columnValue}'"; + break; + case "NotEqual": + sql += $" WHERE {name} !='{jsonParam.columnValue}'"; + break; + case "GreaterOrEqual"://大于等于 + sql += $" WHERE {name} >='{jsonParam.columnValue}'"; + break; + case "Greater"://大于 + sql += $" WHERE {name} >'{jsonParam.columnValue}'"; + break; + case "LessOrEqual"://小于等于 + sql += $" WHERE {name} <='{jsonParam.columnValue}'"; + break; + case "Less"://小于 + sql += $" WHERE {name} <'{jsonParam.columnValue}'"; + break; + default: + break; + } + + continue; + } + + if (!string.IsNullOrWhiteSpace(value)) + { + var jsonParam = JsonConvert.DeserializeObject(value); + + switch (jsonParam.operationKey) + { + case "Include": + conditions += $" AND {name} LIKE '%{jsonParam.columnValue}%'"; + break; + case "NotInclude": + conditions += $" AND {name} NOT LIKE '%{jsonParam.columnValue}%'"; + break; + case "IsNull": + conditions += $" AND {name} IS NULL"; + break; + case "NotNull": + conditions += $" AND {name} IS NOT NULL"; + break; + case "Equal": + conditions += $" AND {name} ='{jsonParam.columnValue}'"; + break; + case "NotEqual": + conditions += $" AND {name} !='{jsonParam.columnValue}'"; + break; + default: + break; + } + } + } + + //if (ids != null && ids.Any()) + // conditions += $" AND Id IN({string.Join(",", ids)})"; + + sql = string.Format(sql, conditions); + if (filter.pageSize == 0) + filter.pageSize = 10000; + var data = await Db.SqlQueryable(sql) + .OrderBy(filter.orderBy) + .ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); + + return new ServicePageResult(filter.pageNum, totalCount, filter.pageSize, data); + } + } \ No newline at end of file diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 38bc72ed..c0bee809 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -1655,6 +1655,106 @@ 预留字段12 + + + 学分记录 (Dto.Base) + + + + + 员工ID + + + + + 课程ID + + + + + 课程快照ID + + + + + 获得日期 + + + + + 获得学分 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 考试 (Dto.Base) @@ -4162,6 +4262,11 @@ 课件附件 (Dto.EditInput) + + + 学分记录 (Dto.EditInput) + + 考试 (Dto.EditInput) @@ -4312,6 +4417,11 @@ 课件附件 (Dto.InsertInput) + + + 学分记录 (Dto.InsertInput) + + 考试 (Dto.InsertInput) @@ -6241,6 +6351,106 @@ 预留字段12 + + + 学分记录 (Model) + + + + + 员工ID + + + + + 课程ID + + + + + 课程快照ID + + + + + 获得日期 + + + + + 获得学分 + + + + + 备注 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + 考试 (Model) @@ -9647,6 +9857,21 @@ 修改信息 + + + 学分记录(Dto.View) + + + + + 创建信息 + + + + + 修改信息 + + 考试(Dto.View) @@ -11170,5 +11395,50 @@ 修改信息 + + + 员工id + + + + + 工号 + + + + + 员工姓名 + + + + + 部门编号 + + + + + 部门名称 + + + + + 岗位 + + + + + 入职日期 + + + + + 在职状态 + + + + + 学分 + + diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index c9bf48da..c4f60c63 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -629,6 +629,18 @@ 课件ID + + + 学分记录(Controller) + + + + + 查询明细数据 + + body + + 考试(Controller)