master
huanghai 5 years ago
parent 648e6d91cc
commit 625cd0aee9

@ -16,5 +16,5 @@ func main(){
}
studentTemplate = studentTemplate +"student.xlsx"
ExcelUtil.GenerateTemplate(jsonTemplate, studentTemplate)
fmt.Println("恭喜,学生导入的基本结构生成成功,请手动设置身份证列为文本格式,现在的库不支持这样设置,只能手动来了~")
fmt.Println("恭喜,学生导入的基本结构生成成功,请手动设置身份证列为文本格式,出生日期要设置为日期格式,现在的库不支持这样设置,只能手动来了~")
}

@ -16,5 +16,5 @@ func main(){
}
teacherTemplate=teacherTemplate+"teacher.xlsx"
ExcelUtil.GenerateTemplate(jsonTemplate,teacherTemplate)
fmt.Println("恭喜,教师导入的基本结构生成成功,请手动设置身份证列为文本格式,现在的库不支持这样设置,只能手动来了~")
fmt.Println("恭喜,教师导入的基本结构生成成功,请手动设置身份证列为文本格式,出生日期要设置为日期格式,现在的库不支持这样设置,只能手动来了~")
}

@ -24,6 +24,16 @@
"width": 16,
"require": true
},
{
"col_name": "性别",
"width": 16,
"require": true
},
{
"col_name": "出生日期",
"width": 16,
"require": true
},
{
"col_name": "民族",
"width": 16,

@ -19,6 +19,21 @@
"width": 16,
"require": true
},
{
"col_name": "性别",
"width": 16,
"level_1_sql": true,
"require": true,
"sql_num": 1,
"sql_parameter": [
"xbm"
]
},
{
"col_name": "出生日期",
"width": 16,
"require": true
},
{
"col_name": "民族",
"width": 16,

@ -363,7 +363,7 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
}
if ExportExcelStatus > 0 {
//将现有数据填充到下载的模板中
sql := `select t1.person_id,t2.org_name,t1.xm,
sql := `select t1.person_id,t2.org_name,t1.xm,t1.xbm,t1.csrq,
t1.mzm,t1.zzmmm,t1.sfzjlxm, (case t1.sfzjh when '-1' then '' else t1.sfzjh end ) as sfzjh,
t1.xlm,t1.xwm,t1.zcm,t1.bzlbm,t1.stage_id,t1.subject_id,t1.gwzym,t1.lxdh,t1.dzxx
from t_base_teacher as t1 inner join t_base_teacher_org as t3 on t1.person_id=t3.person_id
@ -399,7 +399,7 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
}
//填充
var colNames = []string{"org_name", "xm", "mzm", "zzmmm", "sfzjlxm", "sfzjh", "xlm", "xwm", "zcm", "bzlbm", "stage_name", "subject_name", "lxdh"}
var colNames = []string{"org_name", "xm", "xbm", "csrq", "mzm", "zzmmm", "sfzjlxm", "sfzjh", "xlm", "xwm", "zcm", "bzlbm", "stage_name", "subject_name", "lxdh"}
for i := range list {
for j := range colNames {
cName, _ := excelize.ColumnNumberToName(j + 1)
@ -407,7 +407,7 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
f.SetCellValue(SheetName, cName, list[i][colNames[j]])
}
//单独填充上person_id,为了能在没有身份号的唯一标识的情况下,确定是新增还是修改
cName := "N"
cName := "P"
cName = cName + strconv.Itoa(i+2+ExcelUtil.HiddenRows)
f.SetCellValue(SheetName, cName, list[i]["person_id"])
}

Loading…
Cancel
Save