diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_EvaluationDataMain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_EvaluationDataMain/Index.js index 5caf36d9f..af0e21fe1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_EvaluationDataMain/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_EvaluationDataMain/Index.js @@ -90,8 +90,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '党小组长评分详情', url: top.$.rootUrl + '/PersonnelManagement/DT_EvaluationData/Index?MainId=' + keyValue + '&ScoreType=2', - width: 600, - height: 400, + width: 900, + height: 700, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -110,19 +110,19 @@ var bootstrap = function ($, learun) { headData: [ { label: "年度", name: "ScoreYear", width: 100, align: "left" }, { label: "季度", name: "ScoreQuarter", width: 100, align: "left" }, - { - label: "党员小组", name: "PartyMemberGroupId", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DT_PartyMemberGroup', - key: value, - keyId: 'id', - callback: function (_data) { - callback(_data['name']); - } - }); - } - }, + //{ + // label: "党员小组", name: "PartyMemberGroupId", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DT_PartyMemberGroup', + // key: value, + // keyId: 'id', + // callback: function (_data) { + // callback(_data['name']); + // } + // }); + // } + //}, { label: "被考核党员", name: "BeAssessed", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_PartyMemberGroup/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_PartyMemberGroup/Index.js index 56890bc2d..5638eabb3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_PartyMemberGroup/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/DT_PartyMemberGroup/Index.js @@ -75,7 +75,7 @@ var bootstrap = function ($, learun) { { label: "名称", name: "Name", width: 100, align: "left" }, { label: "编号", name: "EnCode", width: 100, align: "left" }, { - label: "组长", name: "GroupLeader", width: 100, align: "left", + label: "组长", name: "GroupLeader", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { if (value.indexOf(',') != -1) { var content = ''; @@ -106,7 +106,7 @@ var bootstrap = function ($, learun) { } }, { - label: "组员", name: "PartyMember", width: 100, align: "left", + label: "组员", name: "PartyMember", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { if (value.indexOf(',') != -1) { var content = ''; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/EvaluatingIndicatorApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/EvaluatingIndicatorApi.cs index 0d7e6dee9..a9fefd4d6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/EvaluatingIndicatorApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PersonnelManagement/EvaluatingIndicatorApi.cs @@ -25,11 +25,17 @@ namespace Learun.Application.WebApi.Modules Get["/getevaluationlistforzp"] = GetEvaluationListForZP; //评价考核 下发评价 Post["/savelist"] = SaveList; + //党员自评 提交/审核 + Post["/submitevaluationforzp"] = SubmitEvaluationForZP; + + //党小组评 获取党员评分的列表 + Get["/getevaluationlistforxz"] = GetEvaluationListForXZ; } //党员小组 private DT_PartyMemberGroupIBLL partyMemberGroupIBLL = new DT_PartyMemberGroupBLL(); //评价考核表 private DT_EvaluationDataIBLL dT_EvaluationDataIBLL = new DT_EvaluationDataBLL(); + private DT_EvaluationDataMainIBLL dT_EvaluationDataMainIBLL = new DT_EvaluationDataMainBLL(); /// /// 获取党员小组列表 @@ -49,24 +55,24 @@ namespace Learun.Application.WebApi.Modules /// public Response AddEvaluationData(dynamic _) { - //AddEvaluationEntity parameter = this.GetReqData(); - //if (parameter == null) - //{ - // return Fail("参数不可空!"); - //} + AddEvaluationEntity parameter = this.GetReqData(); + if (parameter == null) + { + return Fail("参数不可空!"); + } //年度 - string scoreYear = "2021";//parameter.ScoreYear;// + int scoreYear = parameter.ScoreYear;// 2021;// //季度 - string scoreQuarter = "4";// parameter.ScoreQuarter;// + int scoreQuarter = parameter.ScoreQuarter;//4;// //小组Id - string partyMemberGroupId = "f4f8df5e-021b-4739-b006-6c25f04c2723";//parameter.PartyMemberGroupId;// + string partyMemberGroupId = parameter.PartyMemberGroupId;//"2e329d08-e9ae-4c54-8fdb-00d80498d05e";// - if (string.IsNullOrEmpty(scoreYear)) + if (scoreYear == null || scoreYear <= 0) { return Fail("年度不可空!"); } - else if (string.IsNullOrEmpty(scoreQuarter)) + else if (scoreQuarter == null || scoreQuarter <= 0) { return Fail("季度不可空!"); } @@ -87,25 +93,18 @@ namespace Learun.Application.WebApi.Modules /// public Response GetEvaluationListForZP(dynamic _) { - dynamic parameter = this.GetReqData(); + DT_EvaluationDataWhere parameter = this.GetReqData(); if (parameter == null) { return Fail("参数不可空!"); } - - DT_EvaluationDataWhere where = new DT_EvaluationDataWhere(); - //被考核党员Id - where.beAssessed = parameter.BeAssessed; - //年份 季度 - where.scoreYear = parameter.ScoreYear; - where.scoreQuarter = parameter.ScoreQuarter; - where.ScoreType = 1; - var list = dT_EvaluationDataIBLL.GetListByWhere(where); + parameter.ScoreType = 1; + var list = dT_EvaluationDataIBLL.GetListByWhere(parameter); return Success(list); } /// - /// 保存实体数据(新增、修改) + /// 党员自评 保存 /// /// /// @@ -116,16 +115,52 @@ namespace Learun.Application.WebApi.Modules dT_EvaluationDataIBLL.SaveList(list); return Success("保存成功!"); } + /// + /// 党员自评 提交/审核 + /// + /// + /// + public Response SubmitEvaluationForZP(dynamic _) + { + ReqSubmitEvaluation parameter = this.GetReqData(); + dT_EvaluationDataIBLL.UpdateStatusForZP(parameter.Assessed, parameter.Status); + return Success("保存成功!"); + } + + /// + /// 党小组长评分 获取党员评分的列表 + /// + /// + /// + public Response GetEvaluationListForXZ(dynamic _) + { + string Assessed = this.GetReqData(); + var list = dT_EvaluationDataMainIBLL.GetEvaluationListForXZ(Assessed); + return Success(list); + } + + /// + /// 党小组长评分 获取评分题目 + /// + /// + /// + public Response GetEvaluationDataForXZ(dynamic _) + { + ReqGetEvaluationDataForXZ parameter = this.GetReqData(); + //var list = dT_EvaluationDataIBLL.GetEvaluationDataForXZ(parameter.Assessed, parameter.Id); + //return Success(list); + return ""; + } #region 私有类 /// - /// 表单实体类 + /// 下发评价 /// private class AddEvaluationEntity { - public string ScoreYear { get; set; } - public string ScoreQuarter { get; set; } + public int ScoreYear { get; set; } + public int ScoreQuarter { get; set; } public string PartyMemberGroupId { get; set; } } @@ -137,6 +172,18 @@ namespace Learun.Application.WebApi.Modules //public string keyValue { get; set; } public string strEntity { get; set; } } + + private class ReqSubmitEvaluation + { + public string Assessed { get; set; } + public int Status { get; set; } + } + private class ReqGetEvaluationDataForXZ + { + public string Assessed { get; set; } + public int Id { get; set; } + } + #endregion } } \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM index 7b7d07b8a..6d9883c53 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM @@ -1,5 +1,5 @@ - + @@ -13156,9 +13156,9 @@ LABL 0 新宋体,8,N 1639036439 -1639036442 +1639128183 -1 -((-13420,205469), (1856,217291)) +((-13420,205020), (1856,217290)) 0 12615680 16570034 @@ -55561,7 +55561,7 @@ B9AF DT_EvaluationData 1586611688 edy -1639036861 +1639118553 edy 评价考核表 @@ -55605,29 +55605,17 @@ B9AF 14D0548F-44A3-49F8-8E89-318CB337A8A9 -PartyMemberGroupId------------- -PartyMemberGroupId------------- +PartyMemberGroupId +PartyMemberGroupId 1638943834 edy -1639038717 +1639045487 edy 党员小组Id nvarchar(50) 50 -1FC97445-9D19-4577-8E16-5F2DD09DD2FE -BeAssessed------------ -BeAssessed------------ -1586611865 -edy -1639038717 -edy -被考核党员 -nvarchar(100) -100 - - D3E4B805-A3A5-405B-888A-42F71AC8D15E Assessed Assessed @@ -55639,7 +55627,7 @@ B9AF nvarchar(500) 500 - + 6B52B587-4698-453B-96D2-4BD7940BB028 Score Score @@ -55650,7 +55638,7 @@ B9AF 分值 int - + 029C6080-F16F-4229-98F2-3E9BEB6EF7EB ScoreType ScoreType @@ -55661,29 +55649,18 @@ B9AF 类型(1:党员自评,2:党小组长评) int - -A6AD45A2-DBBA-4C40-B40B-A7E2E1DDD269 -ScoreYear---------------- -ScoreYear---------------- -1586611838 -edy -1639038717 -edy -打分年度 -int - - + EB4FF1DC-26F3-4998-829A-7E9A6162E299 -ScoreQuarter-------------- -ScoreQuarter-------------- +Status +Status 1586611838 edy -1639038717 +1639118553 edy -打分季度 +状态 int - + 42919921-7BCD-4C19-815B-2ADD335D23E7 Remark Remark @@ -55695,7 +55672,7 @@ B9AF nvarchar(50) 50 - + 558D0FAE-5D3E-49B2-9DA7-560B6127FFC7 EOrder EOrder @@ -55706,7 +55683,7 @@ B9AF 排序 int - + 06C6B77A-1370-48B3-82CF-1EB43C330513 CreateTime CreateTime @@ -55717,7 +55694,7 @@ B9AF 创建时间 DateTime - + C7621A34-8243-45F9-9CE3-86B1344B21F0 CreateUserId CreateUserId @@ -55731,7 +55708,7 @@ B9AF - + 6B3EBE9A-4B47-406F-B35A-1F5BDB9AD0C6 Key_1 Key_1 @@ -55745,10 +55722,10 @@ B9AF - + - + @@ -55757,12 +55734,12 @@ B9AF DT_EvaluationDataMain 1586611688 edy -1639037696 +1639130489 edy 评价主表 - + 173CBABF-C3E9-4247-A10E-56EBC1171305 Id Id @@ -55775,19 +55752,7 @@ B9AF 50 1 - -5CA80D17-BA58-4479-8FE6-65B99611BAD4 -PartyMemberGroupId -PartyMemberGroupId -1638943834 -edy -1639036689 -edy -党员小组Id -nvarchar(50) -50 - - + E66151E0-DDF8-46AD-86C3-ACEB5101E669 BeAssessed BeAssessed @@ -55799,7 +55764,7 @@ B9AF nvarchar(100) 100 - + A0A825FD-99D3-4320-A397-F36FFA054AFC ScoreZP ScoreZP @@ -55812,7 +55777,7 @@ B9AF 18 1 - + 9AA1A880-5082-42FE-8A1B-D513BB426E93 ScoreXZ ScoreXZ @@ -55825,7 +55790,7 @@ B9AF 18 1 - + 1DCE7522-C8E9-446E-A14F-DE642C0F9B7A Remark Remark @@ -55837,7 +55802,7 @@ B9AF nvarchar(50) 50 - + 290E7C63-4445-4CDC-917D-47B432931104 ScoreYear ScoreYear @@ -55848,7 +55813,7 @@ B9AF 打分年度 int - + AFD02C65-E08A-4165-B0A7-4392F789E837 ScoreQuarter ScoreQuarter @@ -55859,7 +55824,7 @@ B9AF 打分季度 int - + 98234711-3A4E-4A1F-852A-B90BB54CFFDA CreateTime CreateTime @@ -55870,7 +55835,7 @@ B9AF 创建时间 DateTime - + 8A7B0EE8-EB4D-4305-9048-0540DF725ECF CreateUserId CreateUserId @@ -55884,7 +55849,7 @@ B9AF - + 4A0077ED-0AAF-4336-A2E1-A06A02B8B1DC Key_1 Key_1 @@ -55893,15 +55858,15 @@ B9AF 1639036439 edy - + - + - + @@ -55926,7 +55891,7 @@ B9AF - + 14D78C43-17A2-48F0-83B4-3DF757D5ABE8 1552635393 l @@ -55961,7 +55926,7 @@ B9AF - + FEAECB7B-8E2A-4492-A530-B0062E1511B8 1552635777 l @@ -55996,7 +55961,7 @@ B9AF - + 81527A47-E565-49C2-AAA7-F0555E81CE72 1553245426 l @@ -56031,7 +55996,7 @@ B9AF - + A3225D9D-069C-4A67-ABF0-43DC2FA55CF0 1553247802 l @@ -56065,7 +56030,7 @@ B9AF - + B458081F-CEE1-4251-9E7A-5E9CC93519D5 1553248376 l @@ -56100,7 +56065,7 @@ B9AF - + 8397C4F6-A728-4D3F-B2F8-FAC56886462B 1553248622 l @@ -56134,7 +56099,7 @@ B9AF - + 2F8BC700-F31E-41CC-9DA8-9505EAC5DA85 1553483161 l @@ -56168,7 +56133,7 @@ B9AF - + 0E2D2049-564F-4247-9F5B-B0AA82F9BE96 1555404296 admin @@ -56185,7 +56150,7 @@ B9AF - + 46EC3E2A-6CBF-421A-9DA8-6BCCEDEC7DF5 PUBLIC PUBLIC @@ -56448,7 +56413,7 @@ B9AF - + B1BAD530-6C69-4A9D-BD41-F62F564CA348 Microsoft SQL Server 2008 MSSQLSRV2008 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataBLL.cs index 9b1558c0c..b9650c704 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataBLL.cs @@ -119,6 +119,25 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + public void UpdateStatusForZP(string Assessed, int Status) + { + try + { + dT_EvaluationDataService.UpdateStatusForZP(Assessed, Status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) /// @@ -144,11 +163,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } - public void SaveList(List list) + public string SaveList(List list) { try { - dT_EvaluationDataService.SaveList(list); + return dT_EvaluationDataService.SaveList(list); } catch (Exception ex) { @@ -170,7 +189,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 季度 /// 小组Id /// - public void AddEvaluationData(string scoreYear, string scoreQuarter, string partyMemberGroupId) + public void AddEvaluationData(int scoreYear, int scoreQuarter, string partyMemberGroupId) { try { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataEntity.cs index 7c02a5d97..a799bf2a8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataEntity.cs @@ -59,11 +59,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement ///// //[Column("SCOREQUARTER")] //public int? ScoreQuarter { get; set; } - ///// - ///// 党员小组Id - ///// - //[Column("PARTYMEMBERGROUPID")] - //public string PartyMemberGroupId { get; set; } + /// + /// 党员小组Id + /// + [Column("PARTYMEMBERGROUPID")] + public string PartyMemberGroupId { get; set; } /// /// 备注 /// @@ -74,7 +74,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// [Column("EORDER")] public int? EOrder { get; set; } - + + /// + /// 状态 -1 未打分,0 草稿,1 已提交,2 审核通过,3 未通过 + /// + [Column("STATUS")] + public int? Status { get; set; } /// /// 创建时间 /// @@ -94,8 +99,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Create() { this.Id = Guid.NewGuid().ToString(); + this.Status = -1; this.CreateTime=DateTime.Now; - //this.CreateUserId = LoginUserInfo.Get().userId; + this.CreateUserId = LoginUserInfo.Get().userId; } /// /// 编辑调用 @@ -107,11 +113,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } #endregion #region 扩展字段 - /// - /// 党小组Id - /// - [NotMapped] - public string PartyMemberGroupId { get; set; } + /// /// 被考核党员 /// @@ -156,27 +158,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement #endregion } + + /// + /// 获取自评数据 + /// public class DT_EvaluationDataWhere { /// /// 被考核党员 /// - public string beAssessed { get; set; } + public string BeAssessed { get; set; } /// /// 年度 /// - public int scoreYear { get; set; } + public int ScoreYear { get; set; } /// /// 季度 /// - public int scoreQuarter { get; set; } + public int ScoreQuarter { get; set; } /// /// 类型 1党员自评 2 党小组长 /// public int ScoreType { get; set; } } - } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataIBLL.cs index c4d1c22cf..2c93d7cba 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataIBLL.cs @@ -37,13 +37,14 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// 主键 void DeleteEntity(string keyValue); + void UpdateStatusForZP(string Assessed, int Status); /// /// 保存实体数据(新增、修改) /// /// 主键 /// 实体 void SaveEntity(string keyValue, DT_EvaluationDataEntity entity); - void SaveList(List list); + string SaveList(List list); /// /// 下发评价 @@ -52,7 +53,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 季度 /// 小组Id /// - void AddEvaluationData(string scoreYear,string scoreQuarter,string partyMemberGroupId); + void AddEvaluationData(int scoreYear,int scoreQuarter,string partyMemberGroupId); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataService.cs index 69c3647f2..64b58a2ff 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationData/DT_EvaluationDataService.cs @@ -86,11 +86,13 @@ e.Assessment as Assessment,e.ConductRequirements as ConductRequirements { try { - string sql = @"select t.*,m.PartyMemberGroupId,m.BeAssessed,m.ScoreYear,m.ScoreQuarter,e.Assessment,e.ConductRequirements,e.CRRemark,e.MaxScore,e.ScoringCriteria + string sql = @"select t.*, +(case t.Status when -1 then '未打分' when 0 then '草稿' when 1 then '待审核' when 2 then '审核通过' when 3 then '未通过' end) as StatusName, +m.BeAssessed,m.ScoreYear,m.ScoreQuarter,e.Assessment,e.ConductRequirements,e.CRRemark,e.MaxScore,e.ScoringCriteria FROM DT_EvaluationData t join DT_EvaluatingIndicator e on t.EvaluatingIndicatorId=e.Id join DT_EvaluationDataMain m on t.MainId=m.Id where 1=1 "; - sql += $" and t.ScoreType='{where.ScoreType}' and m.BeAssessed='{where.beAssessed}' and m.ScoreYear='{where.scoreYear}' and m.ScoreQuarter='{where.scoreQuarter}'"; + sql += $" and t.ScoreType='{where.ScoreType}' and m.BeAssessed='{where.BeAssessed}' and m.ScoreYear='{where.ScoreYear}' and m.ScoreQuarter='{where.ScoreQuarter}'"; return this.BaseRepository("CollegeMIS").FindList(sql).OrderBy(x => x.EOrder); } @@ -158,6 +160,53 @@ join DT_EvaluationDataMain m on t.MainId=m.Id } } + /// + /// 党员自评 提交 + /// + /// + /// + public void UpdateStatusForZP(string Assessed, int Status) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + if (Status == 1) + { + //提交 修改主表自评分值 + string updSql = $@" update DT_EvaluationDataMain set ScoreZP=( + select MAX(Score) from DT_EvaluationData where Assessed = '{Assessed}' and ScoreType = 1 + ) + where BeAssessed = '{Assessed}'"; + + db.ExecuteBySql(updSql); + } + else if(Status == 3) + { + //审核未通过 修改主表 自评分值为NULL + string updSql = $@" update DT_EvaluationDataMain set ScoreZP=NULL where BeAssessed = '{Assessed}'"; + db.ExecuteBySql(updSql); + Status = 0; + } + string sql = + $"update DT_EvaluationData set Status='{Status}' where ScoreType=1 and Assessed='{Assessed}'"; + db.ExecuteBySql(sql); + + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + db.Rollback(); + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) /// @@ -191,23 +240,42 @@ join DT_EvaluationDataMain m on t.MainId=m.Id } } - - public void SaveList(List list) + /// + /// 保存党员自评评分 + /// + /// + public string SaveList(List list) { var db = this.BaseRepository("CollegeMIS"); try { + string str = ""; foreach (var model in list) { - if (!string.IsNullOrEmpty(model.Id)) + string sql_get = $@"select t.*,m.BeAssessed,m.ScoreYear,m.ScoreQuarter,e.Assessment,e.ConductRequirements,e.CRRemark,e.MaxScore,e.ScoringCriteria +FROM DT_EvaluationData t join DT_EvaluatingIndicator e on t.EvaluatingIndicatorId=e.Id +join DT_EvaluationDataMain m on t.MainId=m.Id + where t.Id='{model.Id}'"; + var entity = db.FindList(sql_get).FirstOrDefault(); + if (entity != null) { - string sql = $"update DT_EvaluationData set Score='{model.Score}' where Id='{model.Id}'"; - - db.ExecuteBySql(sql); + if (model.Score > entity.MaxScore) + { + return entity.ConductRequirements + " 不得超过最高分:" + entity.MaxScore + "分"; + } + else if (entity.Status > 0) + { + return "数据已提交,不可修改!"; + } + else + { + string sql = $"update DT_EvaluationData set Score='{model.Score}',Status=0 where Id='{model.Id}'"; + db.ExecuteBySql(sql); + } } } - db.Commit(); + return str; } catch (Exception ex) { @@ -230,7 +298,7 @@ join DT_EvaluationDataMain m on t.MainId=m.Id /// 季度 /// 小组Id /// - public void AddEvaluationData(string scoreYear, string scoreQuarter, string partyMemberGroupId) + public void AddEvaluationData(int scoreYear, int scoreQuarter, string partyMemberGroupId) { var db = this.BaseRepository("CollegeMIS"); try @@ -254,47 +322,65 @@ join DT_EvaluationDataMain m on t.MainId=m.Id foreach (var item in partyMemberList) { - DT_EvaluationDataMainEntity mainEntity=new DT_EvaluationDataMainEntity(); - mainEntity.Create(); - mainEntity.BeAssessed = item; - mainEntity.ScoreYear = Convert.ToInt32(scoreYear); - mainEntity.ScoreQuarter = Convert.ToInt32(scoreQuarter); - mainEntity.PartyMemberGroupId = partyMemberGroupId; - db.Insert(mainEntity); + DT_EvaluationDataMainEntity mainEntity = new DT_EvaluationDataMainEntity(); + //主表 + if (db.FindList(x => + x.BeAssessed == item && x.ScoreYear == scoreYear && x.ScoreQuarter == scoreQuarter).Count() > 0) + { + mainEntity = db.FindList(x => + x.BeAssessed == item && x.ScoreYear == scoreYear && x.ScoreQuarter == scoreQuarter) + .FirstOrDefault(); + } + else + { + mainEntity.Create(); + mainEntity.BeAssessed = item; + mainEntity.ScoreYear = scoreYear; + mainEntity.ScoreQuarter = scoreQuarter; + //mainEntity.PartyMemberGroupId = partyMemberGroupId; + db.Insert(mainEntity); + } //考核指标 foreach (var EvaluatingIndicator in DT_EvaluatingIndicator) { - DT_EvaluationDataEntity entity = new DT_EvaluationDataEntity(); - entity.Create(); - entity.MainId = mainEntity.Id; - entity.EvaluatingIndicatorId = EvaluatingIndicator.Id; - entity.EOrder = EvaluatingIndicator.EOrder; - //entity.BeAssessed = item; - entity.Assessed = item;//自评 - entity.ScoreType = 1; - //entity.ScoreYear = Convert.ToInt32(scoreYear); - //entity.ScoreQuarter = Convert.ToInt32(scoreQuarter); - //entity.PartyMemberGroupId = partyMemberGroupId; - db.Insert(entity); + //********************需要判断是否存在 + if (db.FindList(x => + x.MainId == mainEntity.Id && + x.ScoreType == 1 && x.Assessed == item) + .Count() <= 0) + { + DT_EvaluationDataEntity entity = new DT_EvaluationDataEntity(); + entity.Create(); + entity.MainId = mainEntity.Id; + entity.EvaluatingIndicatorId = EvaluatingIndicator.Id; + entity.EOrder = EvaluatingIndicator.EOrder; + entity.Assessed = item;//自评 + entity.ScoreType = 1; + entity.PartyMemberGroupId = partyMemberGroupId; + db.Insert(entity); + } //组长评 if (EvaluatingIndicator.ScoringPersonnel.Contains(",") && !groupLeaderList.Contains(item)) { foreach (var groupLeader in groupLeaderList) { - DT_EvaluationDataEntity entity1 = new DT_EvaluationDataEntity(); - entity1.Create(); - entity1.MainId = mainEntity.Id; - entity1.ScoreType = 2; - entity1.Assessed = groupLeader; - entity1.EvaluatingIndicatorId = EvaluatingIndicator.Id; - entity1.EOrder = EvaluatingIndicator.EOrder; - //entity1.BeAssessed = item; - //entity1.ScoreYear = Convert.ToInt32(scoreYear); - //entity1.ScoreQuarter = Convert.ToInt32(scoreQuarter); - //entity1.PartyMemberGroupId = partyMemberGroupId; + if (db.FindList(x => + x.MainId == mainEntity.Id && + x.ScoreType == 2 && x.Assessed == groupLeader && x.EvaluatingIndicatorId == EvaluatingIndicator.Id) + .Count() <= 0) + { + DT_EvaluationDataEntity entity1 = new DT_EvaluationDataEntity(); + entity1.Create(); + entity1.MainId = mainEntity.Id; + entity1.ScoreType = 2; + entity1.Assessed = groupLeader; + entity1.EvaluatingIndicatorId = EvaluatingIndicator.Id; + entity1.EOrder = EvaluatingIndicator.EOrder; + entity1.PartyMemberGroupId = partyMemberGroupId; - db.Insert(entity1); + db.Insert(entity1); + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainBLL.cs index fe0774543..b329db4db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainBLL.cs @@ -43,6 +43,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// + /// + /// + /// + public IEnumerable GetEvaluationListForXZ(string Assessed) + { + try + { + return dT_EvaluationDataMainService.GetEvaluationListForXZ(Assessed); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取DT_EvaluationDataMain表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainEntity.cs index 4b3a44ca0..7fe29b9c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainEntity.cs @@ -74,7 +74,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { this.Id = Guid.NewGuid().ToString(); this.CreateTime=DateTime.Now; - //this.CreateUserId = LoginUserInfo.Get().userId; + this.CreateUserId = LoginUserInfo.Get().userId; } /// /// 编辑调用 @@ -86,6 +86,11 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } #endregion #region 扩展字段 + /// + /// + /// + public string StatusName { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainIBLL.cs index 58384b11e..95a3536e0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetEvaluationListForXZ(string Assessed); /// /// 获取DT_EvaluationDataMain表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainService.cs index 68729be69..d67e811b8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/DT_EvaluationDataMain/DT_EvaluationDataMainService.cs @@ -59,6 +59,34 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 党小组长评分 返回需要我打分的列表 + /// + /// + /// + public IEnumerable GetEvaluationListForXZ(string Assessed) + { + try + { + string sql = $@" select distinct t.*,(case c.Status when -1 then '未打分' when 0 then '草稿' when 1 then '待审核' when 2 then '审核通过' when 3 then '未通过' end) as StatusName from DT_EvaluationDataMain t + join DT_EvaluationData c on t.Id = c.MainId + where charindex(t.BeAssessed, (select distinct PartyMember from DT_PartyMemberGroup where charindex('{Assessed}', GroupLeader)> 0))> 0 + and c.ScoreType = 2 and Assessed = '{Assessed}'"; + return this.BaseRepository("CollegeMIS").FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取DT_EvaluationDataMain表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyMember/PartyMemberService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyMember/PartyMemberService.cs index 7c3d55228..0fb8f015b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyMember/PartyMemberService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyMember/PartyMemberService.cs @@ -126,7 +126,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"delete PartyMember where ID in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) {