Selaa lähdekoodia

西昌同步教师、学生、部门修改

master
dao 8 kuukautta sitten
vanhempi
commit
b072a66a51
1 muutettua tiedostoa jossa 11 lisäystä ja 7 poistoa
  1. +11
    -7
      DigitalSchoolApi/Controllers/YKTTrabs.cs

+ 11
- 7
DigitalSchoolApi/Controllers/YKTTrabs.cs Näytä tiedosto

@@ -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,");


Ladataan…
Peruuta
Tallenna