You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
package main
|
|
|
|
import (
|
|
"dsBaseRpc/Utils/CommonUtil"
|
|
"dsBaseRpc/Utils/DbUtil"
|
|
"dsBaseRpc/Utils/PinYinUtil"
|
|
"dsBaseRpc/models"
|
|
"fmt"
|
|
"github.com/mritd/chinaid"
|
|
)
|
|
|
|
var db =DbUtil.Engine
|
|
|
|
const BureauId="042F28BE-296C-40F4-8AD4-A68A6D852CF0"
|
|
|
|
func main(){
|
|
//1、修复所有教师
|
|
sql:=`select person_id from t_base_teacher where bureau_id=? and identity_id=2`
|
|
list,_:=db.SQL(sql,BureauId).Query().List()
|
|
for i := range list {
|
|
teacher := new(models.TBaseTeacher)
|
|
teacher.Sfzjh=chinaid.IDNo()
|
|
teacher.Xm=chinaid.Name()
|
|
teacher.Cym=teacher.Xm
|
|
teacher.Csrq=chinaid.RandDate()
|
|
teacher.Xmpy=PinYinUtil.PinYin(teacher.Xm)
|
|
teacher.Lxdh=chinaid.Mobile()
|
|
teacher.Dzxx=chinaid.Email()
|
|
db.ID(list[i]["person_id"].(string)).Update(teacher)
|
|
fmt.Println("成功完成教师身份证号修改:"+CommonUtil.ConvertIntToString(i+1)+"个")
|
|
}
|
|
//2、修复所有学生
|
|
sql=`select person_id from t_base_student where bureau_id=?`
|
|
list,_=db.SQL(sql,BureauId).Query().List()
|
|
for i := range list {
|
|
student := new(models.TBaseStudent)
|
|
student.Sfzjh=chinaid.IDNo()
|
|
student.Xm=chinaid.Name()
|
|
student.Cym=student.Xm
|
|
student.Csrq=chinaid.RandDate()
|
|
student.Xmpy=PinYinUtil.PinYin(student.Xm)
|
|
db.ID(list[i]["person_id"].(string)).Update(student)
|
|
fmt.Println("成功完成学生身份证号修改:"+CommonUtil.ConvertIntToString(i+1)+"个")
|
|
}
|
|
fmt.Println("恭喜,所有身份证号信息修改成功!")
|
|
}
|