|
|
|
@ -1027,7 +1027,11 @@ func AddTeacherOrgInfo(personIds []string, orgId string, isMain int32, fromSortI
|
|
|
|
|
}
|
|
|
|
|
//(3)删除旧的
|
|
|
|
|
DeleteTeacherOrgInfo(personIds, orgId)
|
|
|
|
|
//(4)插入新的
|
|
|
|
|
//(4)如果isMain==1,还需要清除原来这些人员的主部门,准备插入新的
|
|
|
|
|
if isMain == 1 {
|
|
|
|
|
disableMainOrg(personIds)
|
|
|
|
|
}
|
|
|
|
|
//(5)插入新的
|
|
|
|
|
for i := range personIds {
|
|
|
|
|
var model models.TBaseTeacherOrg
|
|
|
|
|
model.Id = CommonUtil.GetUUID()
|
|
|
|
@ -1089,3 +1093,15 @@ func UpdateSortId(personId string, orgId string, sortId int32) {
|
|
|
|
|
sql := `update t_base_teacher_org set sort_id=? where person_id=? and org_id=?`
|
|
|
|
|
db.SQL(sql, sortId, personId, orgId).Execute()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:将指定人员的主部门信息禁用
|
|
|
|
|
作者:黄海
|
|
|
|
|
时间:2020-08-05
|
|
|
|
|
*/
|
|
|
|
|
func disableMainOrg(personIds []string) {
|
|
|
|
|
for i := range personIds {
|
|
|
|
|
sql := `update t_base_teacher_org set b_use=-2 where person_id=? and is_main=1`
|
|
|
|
|
db.SQL(sql, personIds[i]).Execute()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|