From 0acf46f718a782bdb8ef330a1b48afffc0265868 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Fri, 9 Oct 2020 15:14:15 +0800 Subject: [PATCH] 1 --- .../EmpInfo/EmpInfoService.cs | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) 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 5412a82c5..ec63197f6 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 @@ -565,24 +565,7 @@ 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)) @@ -612,6 +595,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { if (string.IsNullOrEmpty(entity.EmpId)) { + //生成编号 + 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'); + + + } entity.Create(); } this.BaseRepository("CollegeMIS").Insert(entity);