From b9c4dbdbde334ba4cd8fcc76ce0663f897899052 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Sun, 28 Apr 2024 15:49:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=9C=88=E5=B8=B8=E8=A7=84=E5=B7=A5=E4=BD=9C=E7=BB=A9=E6=95=88?= =?UTF-8?q?=EF=BC=9A=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/excel/JobPerformanceImport.xls | Bin 0 -> 20480 bytes .../Learun.Application.Web.csproj | 1 + .../JobPerformance/JobPerformanceService.cs | 133 +++++++++++------- 3 files changed, 83 insertions(+), 51 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls new file mode 100644 index 0000000000000000000000000000000000000000..1df69c5571ce599e7286da5ad4192dc4cfdc78bd GIT binary patch literal 20480 zcmeHP2V4}_*1x+fuz*NM1c3#XDj-D!HPS3mLAr$?g5m-ymViNsB5R8URFuR@6brG% z8cP(7T`U+CdrTBX6zuvmh>h=@8D@9b-PxGD_j}(j@4dU+nK|d4^S|ewTjtKaGn_wX zRK04uA^oORVCYnhIT>dZojXdxkY;}an(|{;| zs0k74TpOYgq7Fn|h`CIFq^0VJVMjLFd0s_+*>lFdPZF z1931J2j$}pho+HBME{-;O4%@!hc+An2Y2IX5gza~U_?P4)H@tasN+^jYCm=CMvX>< zY#6ZBApj)s4mF4$Ov%lqj`q~CH5_?l52f=9#qoym>lw&5>d}VudRq)dRxf9usu2I0}!-%Y0E_V)j0S6!bpcdam&#e2SFE*qcG)4Bk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bM} zRO>U*l_1{nL>S>AcR(o zFm6==l;qPW+cd<*geLelv^`l43z9hcVSlB+Co^pEJ((Wd6_|h>z!3)G!O)5Hagzfy z`S7ia0UWUtzZGt)9?qv9@4r0zcQUVLDB@6%! z!*T2n7($Wufx<1qbJHOVjU`34N=>||UQdc=`2(=?+*^k3+DT_9Sw{1oG za(NS&B#BzfX`CM@ z6R=>Gz8Gc(?D9Ioo}1KBF7E_8gi=#E?Fnqo?M!Q?&FZwU#ZQfP_?6bjH3p9E8VfTlD^D7?VHqzQn+ z-bbftf+W7(L{rdmq4hG9Hc-&iv5ayA%27r+0p%p4pdC^V zd35eBK)J}$T!C_xQEouF0d*B>e+(ZkNFd*s?4~An!9Wd17K8$r+7+VmE|?ju$#c2OMB1rTxc#*T_3HTE_fmGOUb;0TQ4E{?WH z&WyeV_7%jh{*OGv&6Ns0 zNNMxAnmRWa;8>tT4u=pj-IEZcc?vY2MN=y|l&0e01Ncst8i87-;J8#hW95s+$aKR^ z3xuS-^AFd(fVUqaHdIXS4H1Gg3JzGGgCOFVH4Y-$Hyt95S49wUj4FZ11RV3Wff9~e z0#L%46yoNAcsedLE!`*64phDdspuFMUug84HT5M)CAUmKLg zadIFmGsOZ%B>X3rRKQDt#Url3RerROfBEd?5>G3`;>A#Y_r@()8=4BdLg1kvu>9x~ z7l;s~=qt1(0HPtpV2Fxk#&k{61D3;5sO2#U^&f!#-2bBq095v92atalaE?9;jr|ve zKb!x*C|eoK-#ve92N>Q##QQ%6Y(H2<&Gzkvaey~sBTwz-?jXdl_VbJ0uq1|Uf zYZ?x%DFrk`;XDEsVTZ#arvy?kF!PK)q&skx+a&fO?5p^0sUI9YVA0iwc)}6?vjd(x zL7VOjZ@$re(+ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs index 8aab3aa51..c27c9fc85 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs @@ -316,7 +316,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration private ICache cache = CacheFactory.CaChe(); private string cacheKey = "Learun_adms_excelError_"; // +公司主键 #endregion - + /// /// 工作绩效导入 /// @@ -347,75 +347,106 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { //检测是否有空值 - if (dr[1].ToString() == "" || dr[3].ToString() == "" || dr[6].ToString() == "" || dr[26].ToString() == "" || dr[35].ToString() == "") + if (string.IsNullOrEmpty(dr["发放年份"].ToString())) + { + throw (new Exception("发放年份不能为空!")); + } + if (string.IsNullOrEmpty(dr["发放月份"].ToString())) + { + throw (new Exception("发放月份不能为空!")); + } + if (string.IsNullOrEmpty(dr["姓名"].ToString())) { - throw (new Exception("行内必填项数据有空值,不能为空!")); + throw (new Exception("姓名不能为空!")); } - if (EmpInfoEntities.Count(m => m.EmpName.ToUpper() == dr[1].ToString().ToUpper()) == 0) + if (string.IsNullOrEmpty(dr["身份证号"].ToString())) { - throw (new Exception("【姓名】不存在,请核对!")); + throw (new Exception("身份证号不能为空!")); } - if (dr[2].ToString() == "") + //检测发放年份 + decimal year = 0; + bool yearParseResult = decimal.TryParse(dr["发放年份"].ToString(), out year); + if (!yearParseResult || dr["发放年份"].ToString().Length != 4) { - throw (new Exception("【工资卡号】不能为空")); + throw (new Exception("发放年份数据无效!")); } - if (dr[36].ToString() == "" || dr[37].ToString() == "") + //检测发放月份 + int month = 0; + bool monthParseResult = int.TryParse(dr["发放月份"].ToString(), out month); + if (!monthParseResult) { - throw (new Exception("发放【年、月】不能为空")); + throw (new Exception("发放月份必须为数字!")); } - if (jobPerformanceEntityList.Count(x => x.IssueYear == dr[37].ToString() && x.IssueMonth == dr[36].ToInt() && x.EmpName == dr[1].ToString()) > 0) + if (month <= 0 || month > 12) { - throw (new Exception("导入信息已重复,信息已忽略")); + throw (new Exception("发放月份必须为1-12中间的数字!")); + } + //检测姓名 + var empinfoEntity = EmpInfoEntities.FirstOrDefault(x => x.IdentityCardNo == dr["身份证号"].ToString()); + if (empinfoEntity == null) + { + throw (new Exception("【身份证号】不存在,请核对!")); + } + //检测重复 + if (jobPerformanceEntityList.Count(x => x.IssueYear == dr["发放年份"].ToString() && x.IssueMonth == dr["发放月份"].ToInt() && x.EmpName == empinfoEntity.EmpName && x.EmpNo == empinfoEntity.EmpNo) > 0) + { + throw (new Exception("导入信息已重复,信息已忽略!")); } //写入要导入的数据 JobPerformanceEntity jobPerformanceEntity = new JobPerformanceEntity { Id = Guid.NewGuid().ToString(), - //No = dr[0].ToString(), - //EmpName = dr[1].ToString(), - //WageCardNo = dr[2].ToString(), - //PeopleType = dr[3].ToString(), - //PostType = dr[4].ToString(), - //PayGrade = dr[5].ToString(), - //TotalGrossPay = dr[6].ToDecimalOrNull(), - //PostWage = dr[7].ToDecimalOrNull(), - //PayGradeWage = dr[8].ToDecimalOrNull(), - //TenPercent = dr[9].ToDecimalOrNull(), - //BasicsPerformance = dr[10].ToDecimalOrNull(), - //AwardPerformance = dr[11].ToDecimalOrNull(), - //SeparateBasicsPerformance = dr[12].ToDecimalOrNull(), - //SeparateAwardPerformance = dr[13].ToDecimalOrNull(), - //RoughEdgeAllowance = dr[14].ToDecimalOrNull(), - //NationAllowance = dr[15].ToDecimalOrNull(), - //TeachAllowance = dr[16].ToDecimalOrNull(), - //SuperfineTeacherResearch = dr[17].ToDecimalOrNull(), - //Transportation = dr[18].ToDecimalOrNull(), - //RealeState = dr[19].ToDecimalOrNull(), - //WorkKeep = dr[20].ToDecimalOrNull(), - //GirlStaffSanitation = dr[21].ToDecimalOrNull(), - //TeacherAndTown = dr[22].ToDecimalOrNull(), - //HousingAllowance = dr[23].ToDecimalOrNull(), - //HousingFundAllowance = dr[24].ToDecimalOrNull(), - //OtherOne = dr[25].ToDecimalOrNull(), - //DeductionsSubtotal = dr[26].ToDecimalOrNull(), - //AccumulationFund = dr[27].ToDecimalOrNull(), - //EndowmentInsurance = dr[28].ToDecimalOrNull(), - //OccupationalAnnuities = dr[29].ToDecimalOrNull(), - //MedicalInsurance = dr[30].ToDecimalOrNull(), - //UnemploymentInsurance = dr[31].ToDecimalOrNull(), - //LaborUnionWage = dr[32].ToDecimalOrNull(), - //PersonalIncomeTax = dr[33].ToDecimalOrNull(), - //Other = dr[34].ToDecimalOrNull(), - //NetCombined = dr[35].ToDecimalOrNull(), - IssueMonth = dr[36].ToInt(), - IssueYear = dr[37].ToString(), + IssueYear = year.ToString(), + IssueMonth = month, + EmpNo = empinfoEntity.EmpNo, + EmpName = empinfoEntity.EmpName, + Department = dr[2].ToString(), + Post = dr[5].ToString(), + AdminPosition = dr[6].ToDecimalOrNull(), + LeagueSecretary = dr[7].ToDecimalOrNull(), + CenterPeople = dr[8].ToDecimalOrNull(), + TeachingPosition = dr[9].ToDecimalOrNull(), + Director = dr[10].ToDecimalOrNull(), + TeacherWorkRoom = dr[11].ToDecimalOrNull(), + MajorPeople = dr[12].ToDecimalOrNull(), + WorkLeader = dr[13].ToDecimalOrNull(), + TrainAdmin = dr[14].ToDecimalOrNull(), + CommitteeMember = dr[15].ToDecimalOrNull(), + LessonNum = dr[16].ToIntOrNull(), + LessonHour = dr[17].ToDecimalOrNull(), + MorningStudyNum = dr[18].ToIntOrNull(), + MorningStudyHour = dr[19].ToDecimalOrNull(), + NightStudyNum = dr[20].ToIntOrNull(), + NightStudyHour = dr[21].ToDecimalOrNull(), + TwoExerciseNum = dr[22].ToIntOrNull(), + TwoExerciseHour = dr[23].ToDecimalOrNull(), + TempWorkDay = dr[24].ToDecimalOrNull(), + TempWorkScore = dr[25].ToDecimalOrNull(), + OffWorkDay = dr[26].ToIntOrNull(), + OffWorkMinusScore = dr[27].ToDecimalOrNull(), + OnDutyDay = dr[28].ToDecimalOrNull(), + OnDutyScore = dr[29].ToDecimalOrNull(), + ShouldWorkDay = dr[30].ToDecimalOrNull(), + WorkBasicScore = dr[31].ToDecimalOrNull(), + WorkOffCount = dr[32].ToIntOrNull(), + WorkMinusScore = dr[33].ToDecimalOrNull(), + BigActivityMinusScore = dr[34].ToDecimalOrNull(), + AbsenteeismDay = dr[35].ToDecimalOrNull(), + AbsenteeismMinusScore = dr[36].ToDecimalOrNull(), + WorkRemark = dr[37].ToString(), + RoutineBasicScore = dr[38].ToDecimalOrNull(), + RoutineMinusScore = dr[39].ToDecimalOrNull(), + RoutineRemark = dr[40].ToString(), + PerformanceTotalScore = dr[41].ToDecimalOrNull(), + HolidayJobPerformance = dr[42].ToString(), + CreateUser = LoginUserInfo.Get().userId, + CreateTime = DateTime.Now, F_EnabledMark = "0" }; - jobPerformanceEntityList.Add(jobPerformanceEntity); //删除表中旧数据 及同年同月同名同姓之人 - db.Delete(x => x.EmpName == jobPerformanceEntity.EmpName && x.IssueMonth == jobPerformanceEntity.IssueMonth && x.IssueYear == jobPerformanceEntity.IssueYear); + db.Delete(x => x.EmpName == jobPerformanceEntity.EmpName && x.EmpNo == jobPerformanceEntity.EmpNo && x.IssueMonth == jobPerformanceEntity.IssueMonth && x.IssueYear == jobPerformanceEntity.IssueYear); snum++; } catch (Exception ex) From 266a1f582942fb9f186cd98d3b215b8fa4ee52fe Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Sun, 28 Apr 2024 17:07:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=9C=88=E5=B8=B8=E8=A7=84=E5=B7=A5=E4=BD=9C=E7=BB=A9=E6=95=88?= =?UTF-8?q?=EF=BC=9A=E5=AF=BC=E5=85=A5=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/JobPerformanceController.cs | 28 -------- .../Views/JobPerformance/ImportForm.js | 2 +- .../Controllers/ExcelImportController.cs | 33 +++++++++ .../JobPerformance/JobPerformanceBLL.cs | 59 +--------------- .../JobPerformance/JobPerformanceIBLL.cs | 8 +-- .../JobPerformance/JobPerformanceService.cs | 68 +------------------ 6 files changed, 40 insertions(+), 158 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs index 3f8fb357b..f385c48e9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs @@ -70,34 +70,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers #endregion #region 获取数据 - /// - /// 人员类别 - /// - /// - public ActionResult PeopleType() - { - var data = jobPerformanceIBLL.GetPeopleType(); - return Success(data); - } - /// - /// 岗位类别 - /// - /// - public ActionResult PostType() - { - var data = jobPerformanceIBLL.GetPostType(); - return Success(data); - } - /// - /// 薪级 - /// - /// - public ActionResult PayGrade() - { - var data = jobPerformanceIBLL.GetPayGrade(); - return Success(data); - } - /// /// 获取列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js index 19638a9c4..31a28a2d2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js @@ -106,7 +106,7 @@ var bootstrap = function ($, learun) { param['chunks'] = fileInfo[file.id].chunks; param['ext'] = file.ext; param['templateId'] = id; - learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/SalarySheetImport", param, function (res) { + learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/JobPerformanceImport", param, function (res) { var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); $fileItem.find('.lr-uploader-progress').remove(); if (res.code == learun.httpCode.success) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs index a73267113..e2e11b411 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs @@ -23,6 +23,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); private WageScheduleIBLL wageScheduleIBLL = new WageScheduleBLL(); + private JobPerformanceIBLL jobPerformanceIBLL = new JobPerformanceBLL(); #region 视图功能 /// @@ -352,6 +353,38 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return Fail("导入数据失败!"); } } + + /// + /// 工作绩效导入 + /// + /// 模板Id + /// 文件主键 + /// 分片数 + /// 文件扩展名 + /// + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult JobPerformanceImport(string fileId, int chunks, string ext) + { + UserInfo userInfo = LoginUserInfo.Get(); + string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); + if (!string.IsNullOrEmpty(path)) + { + DataTable dt = ExcelHelper.ExcelImport(path); + string res = jobPerformanceIBLL.JobPerformanceImport(dt, fileId); + var data = new + { + Success = res.Split('|')[0], + Fail = res.Split('|')[1] + }; + return JsonResult(data); + } + else + { + return Fail("导入数据失败!"); + } + } + /// /// 下载文件(导入文件未被导入的数据) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs index fc5888cd6..f3a8477db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs @@ -92,61 +92,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - public List GetPeopleType() - { - try - { - return jobPerformanceService.GetPeopleType().Select(x => new JobPerformanceEntity { }).Distinct().ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - public List GetPostType() - { - try - { - return jobPerformanceService.GetPostType().Select(x => new JobPerformanceEntity { }).Distinct().ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - public List GetPayGrade() - { - try - { - return jobPerformanceService.GetPayGrade().Select(x => new JobPerformanceEntity { }).Distinct().ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - #endregion #region 提交数据 @@ -223,11 +168,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public string SalarySheelImport(DataTable dt, string fileId) + public string JobPerformanceImport(DataTable dt, string fileId) { try { - return jobPerformanceService.SalarySheelImport(dt, fileId); + return jobPerformanceService.JobPerformanceImport(dt, fileId); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs index fa959976f..15a17e34f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs @@ -34,11 +34,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// JobPerformanceEntity GetEntity(string keyValue); - - List GetPeopleType(); - List GetPostType(); - List GetPayGrade(); - + #endregion #region 提交数据 @@ -63,7 +59,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - string SalarySheelImport(DataTable dt, string fileId); + string JobPerformanceImport(DataTable dt, string fileId); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs index c27c9fc85..9671c5f01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs @@ -134,71 +134,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - - - public List GetPeopleType() - { - try - { - string sql = " select distinct PeopleType from JobPerformance where 1=1 and PeopleType is not null order by PeopleType asc "; - return this.BaseRepository("CollegeMIS").FindList(sql).ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } - - public List GetPostType() - { - try - { - string sql = " select distinct PostType from JobPerformance where 1=1 and PostType is not null order by PostType asc "; - return this.BaseRepository("CollegeMIS").FindList(sql).ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } - /// - /// 薪级 - /// - /// - /// - public List GetPayGrade() - { - try - { - string sql = " select distinct PayGrade from JobPerformance where 1=1 and PayGrade is not null order by PayGrade asc"; - return this.BaseRepository("CollegeMIS").FindList(sql).ToList(); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } + #endregion #region 提交数据 @@ -323,7 +259,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public string SalarySheelImport(DataTable dt, string fileId) + public string JobPerformanceImport(DataTable dt, string fileId) { try {