From b072a66a51944f7083e966b5e9553b3637eeb18b Mon Sep 17 00:00:00 2001 From: dao Date: Fri, 29 Mar 2024 13:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=98=8C=E5=90=8C=E6=AD=A5=E6=95=99?= =?UTF-8?q?=E5=B8=88=E3=80=81=E5=AD=A6=E7=94=9F=E3=80=81=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DigitalSchoolApi/Controllers/YKTTrabs.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/DigitalSchoolApi/Controllers/YKTTrabs.cs b/DigitalSchoolApi/Controllers/YKTTrabs.cs index f23d156..3f028ca 100644 --- a/DigitalSchoolApi/Controllers/YKTTrabs.cs +++ b/DigitalSchoolApi/Controllers/YKTTrabs.cs @@ -1598,9 +1598,11 @@ namespace DigitalSchoolApi.Controllers { try { - if (teachinfo.Exists(x => x.EmpNo == item.TEA_NO && x.EmpName == item.NAME_)) + if (teachinfo.Exists(x => x.EmpNo == item.TEA_NO)) { StringBuilder sb = new StringBuilder("update empinfo set "); + sb.Append($" EmpName='{item.NAME_}',"); + sb.Append($" UpdateTime='{DateTime.Now}', "); if (!string.IsNullOrEmpty(item.ZZJG_ID)) { sb.Append($" ZZJG_ID='{item.ZZJG_ID}',"); @@ -1653,7 +1655,7 @@ namespace DigitalSchoolApi.Controllers } else { - int mysql = conncores.Execute($"insert into empinfo (empid,ZZJG_ID,F_DepartmentId,empNo,empName,Birthday,IdentityCardNo,mobile,DegreeNo,HighestRecord,CheckMark,F_CompanyId,BZLB_CODE,BZLX_CODE,IsInActiveStatus) values (newid(), '{item.ZZJG_ID}', '{item.DEPT_ID}', '{item.TEA_NO}', '{item.NAME_}', '{item.BIRTH_DATE}', '{item.IDNO}', '{item.PHONE}', '{item.EDU_ID}', '{item.DEGREE_ID}', '{item.IS_NORMAL}', '207fa1a9-160c-4943-a89b-8fa4db0547ce', '{item.BZLB_CODE}', '{item.BZLX_CODE}', '{item.TEA_STATUS_CODE}')"); + int mysql = conncores.Execute($"insert into empinfo (empid,ZZJG_ID,F_DepartmentId,empNo,empName,Birthday,IdentityCardNo,mobile,DegreeNo,HighestRecord,CheckMark,F_CompanyId,BZLB_CODE,BZLX_CODE,IsInActiveStatus,UpdateTime) values (newid(), '{item.ZZJG_ID}', '{item.DEPT_ID}', '{item.TEA_NO}', '{item.NAME_}', '{item.BIRTH_DATE}', '{item.IDNO}', '{item.PHONE}', '{item.EDU_ID}', '{item.DEGREE_ID}', '{item.IS_NORMAL}', '207fa1a9-160c-4943-a89b-8fa4db0547ce', '{item.BZLB_CODE}', '{item.BZLX_CODE}', '{item.TEA_STATUS_CODE}','{DateTime.Now}')"); anumTeach += mysql; } } @@ -1872,7 +1874,7 @@ namespace DigitalSchoolApi.Controllers } if (departments.Any(x => x.F_DepartmentId == item.ID)) { - var sql = $"update LR_Base_Department set F_FullName='{item.NAME_}',F_ParentId='{item.PID}',F_EnCode='{item.CODE_}',F_ShortName='{item.NAME_SHORT}',F_Manager='{manager}',F_Description='{item.LEVEL_TYPE}',F_CreateDate='{DateTime.Now}' where F_DepartmentId='{item.ID}'"; + var sql = $"update LR_Base_Department set F_FullName='{item.NAME_}',F_ParentId='{item.PID}',F_EnCode='{item.CODE_}',F_ShortName='{item.NAME_SHORT}',F_Manager='{manager}',F_Description='{item.LEVEL_TYPE}',F_ModifyDate='{DateTime.Now}' where F_DepartmentId='{item.ID}'"; anumDept += db.Execute(sql); } else @@ -1919,11 +1921,13 @@ namespace DigitalSchoolApi.Controllers { try { - if (stuInfoBasicList.Exists(x => x.StuNo == item.STU_NO && x.StuName == item.NAME_)) + if (stuInfoBasicList.Exists(x => x.StuNo == item.STU_NO)) { //学生存在,修改 #region 拼接SQL StringBuilder sb = new StringBuilder("update StuInfoBasic set "); + sb.Append($" StuName='{item.NAME_}',"); + sb.Append($" UpdateTime='{DateTime.Now}', "); if (!string.IsNullOrEmpty(item.DEPT_ID)) { sb.Append($" DeptNo='{item.DEPT_ID}',"); @@ -2009,7 +2013,7 @@ namespace DigitalSchoolApi.Controllers { sb.Remove(sb.ToString().LastIndexOf(","), 1); } - sb.Append($" where StuNo='{item.STU_NO}' and StuName='{item.NAME_}'"); + sb.Append($" where StuNo='{item.STU_NO}'"); //System.IO.File.AppendAllText(@"c:\test.txt", sb.ToString() + "\r\n"); #endregion unum += conn.Execute(sb.ToString()); @@ -2067,8 +2071,8 @@ namespace DigitalSchoolApi.Controllers string mysql = "insert into StuInfoBasic("; StringBuilder fieleSb = new StringBuilder(); StringBuilder sb = new StringBuilder(); - fieleSb.Append("StuId,stuno,stuname,CheckMark,F_SchoolId,"); - sb.Append($" NEWID(),'{xsxx.STU_NO}','{xsxx.NAME_}','1','207fa1a9-160c-4943-a89b-8fa4db0547ce',"); + fieleSb.Append("StuId,stuno,stuname,CheckMark,F_SchoolId,UpdateTime,"); + sb.Append($" NEWID(),'{xsxx.STU_NO}','{xsxx.NAME_}','1','207fa1a9-160c-4943-a89b-8fa4db0547ce','{DateTime.Now}',"); if (!string.IsNullOrEmpty(xsxx.DEPT_ID)) { fieleSb.Append("DeptNo,");