From 7950b545498bacba797b0f78dc1faac75c301929 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Mon, 24 Aug 2020 18:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=B3=A8=E5=86=8C=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XmlConfig/system.config | 3 +++ .../EmpInfo/EmpInfoService.cs | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 047fb33b9..ae44e78c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -138,4 +138,7 @@ + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs index 43ee50afb..50d137d49 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs @@ -3,6 +3,7 @@ using Learun.DataBase.Repository; using Learun.Util; using System; using System.Collections.Generic; +using System.Configuration; using System.Data; using System.Linq; using System.Text; @@ -21,6 +22,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public class EmpInfoService : RepositoryFactory { + private object Select; + #region 获取数据 /// @@ -562,6 +565,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { + //生成编号 + var ruleName = ConfigurationManager.AppSettings["EmpNoRule"]; + if (ruleName == "jy") + { + var strHead = DateTime.Now.ToString("yyyyMM"); + var SerialNum = 1; + var empInfoEntities = this.BaseRepository("CollegeMIS").FindList(a => a.EmpNo.Contains(strHead)); + if (empInfoEntities.Count() > 0) + { + var aa = empInfoEntities.Where(a => a.EmpNo.Length >= 8); + var bb = aa.Select(a => a.EmpNo.Substring(a.EmpNo.Length - 2, 2)); + var cc = bb.Select(a => int.Parse(a)); + SerialNum = cc.Max() + 1; + } + entity.EmpNo = strHead + SerialNum.ToString().PadLeft(2, '0'); + + + } + UserIBLL userIBLL = new UserBLL(); if (!string.IsNullOrEmpty(keyValue)) {