Browse Source

修改塔里木学生同步增加角色

master
王晓寒 2 months ago
parent
commit
46044cb91a
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      DigitalSchoolApi/Controllers/TLMSchoolController.cs

+ 5
- 2
DigitalSchoolApi/Controllers/TLMSchoolController.cs View File

@@ -1131,6 +1131,7 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and
var key = Md5Helper.Encrypt(CreateNo(), 16).ToLower();
var pwd = Md5Helper.Encrypt(DESEncrypt.Encrypt(Md5Helper.Encrypt("tlmzy123456", 32).ToLower(), key).ToLower(), 32).ToLower();
var id= item.ID.Length == 30 ? Guid.ParseExact(item.ID, "N"):Guid.NewGuid();
var userid = Guid.NewGuid();
var sql =
"INSERT INTO StuInfoBasic(StuId,StuNo,StuCode,NoticeNo,GraduateYear,ksh,DeptNo,MajorNo,Grade,ClassNo,StuName,SpellFull,GenderNo,Birthday,PartyFaceNo," +
"FamilyOriginNo,NationalityNo,ResidenceNo,HealthStatusNo,GraduateNo,OverseasChineseNo,GoodAt,IdentityCardNo,InSchoolAddress," +
@@ -1142,10 +1143,12 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and
//conn.Execute(sql);
var userSql =
$"INSERT INTO {basedbname}.dbo.LR_Base_User(F_UserId,F_EnCode,F_Account,F_Password,F_Secretkey,F_RealName,F_Gender,F_CompanyId," +
$"F_DepartmentId,F_DeleteMark,F_EnabledMark,F_Description,F_CreateDate,F_CreateUserId,F_CreateUserName,F_IdentityCardNo) VALUES('{Guid.NewGuid():D}'," +
$"F_DepartmentId,F_DeleteMark,F_EnabledMark,F_Description,F_CreateDate,F_CreateUserId,F_CreateUserName,F_IdentityCardNo) VALUES('{userid:D}'," +
$"'{item.XH}','{item.XH}','{pwd}','{key}','{item.XM}','{xb}','207fa1a9-160c-4943-a89b-8fa4db0547ce','{item.YXBH}',0,1,'学生'," +
$"'{DateTime.Now:yyyy-MM-dd hh:mm:ss}','System','数据同步','{item.SFZJH}');";
conn.Execute(sql+userSql);
var relatioaSql =
$"INSERT INTO [dbo].[LR_Base_UserRelation] ( [F_UserId], [F_Category], [F_ObjectId], [F_CreateDate], [F_CreateUserId], [F_CreateUserName]) VALUES ( '{userid:D}', 1, '0cfc388c-80e6-4cf0-b53b-02201827490a', '{DateTime.Now:yyyy-mm-dd HH:mm:ss}', 'System', '数据同步');";
conn.Execute(sql+userSql+ relatioaSql);
}
else
{


Loading…
Cancel
Save