|
|
|
@ -99,7 +99,8 @@ func PageBaseTeacher(in *BaseTeacherProto.QueryArg) ([]map[string]interface{}, i
|
|
|
|
|
// 注意两个表关联时的on用法:
|
|
|
|
|
var myBuilder = builder.Dialect(builder.MYSQL).Select("t1.*").
|
|
|
|
|
From("t_base_teacher as t1").
|
|
|
|
|
LeftJoin("t_base_teacher_org as t2", "t1.person_id=t2.person_id")
|
|
|
|
|
LeftJoin("t_base_teacher_org as t2", "t1.person_id=t2.person_id").
|
|
|
|
|
OrderBy("t1.org_id").OrderBy("t1.sort_id")
|
|
|
|
|
//所在单位ID
|
|
|
|
|
list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization")
|
|
|
|
|
if list == nil {
|
|
|
|
@ -216,7 +217,7 @@ func ExportTeacherAccountInfoExcel(in *BaseTeacherProto.ModelArg) ([]map[string]
|
|
|
|
|
And(builder.Eq{"t2.b_use": 1}).
|
|
|
|
|
And(builder.Eq{"t3.b_use": 1}).
|
|
|
|
|
And(builder.Eq{"t2.bureau_id": in.BureauId}).And(builder.Eq{"t1.identity_id": 2})
|
|
|
|
|
myBuilder.OrderBy("t3.sort_id").OrderBy("t2.sort_id").OrderBy("t2.id_int")
|
|
|
|
|
myBuilder.OrderBy("t3.org_id").OrderBy("t2.sort_id")
|
|
|
|
|
sql, err := myBuilder.ToBoundSQL()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, 0, err
|
|
|
|
@ -305,7 +306,7 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
|
|
|
|
|
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_organization as t2 on t1.org_id=t2.org_id
|
|
|
|
|
where t1.bureau_id=? and t1.identity_id=2 and t1.b_use=1`
|
|
|
|
|
where t1.bureau_id=? and t1.identity_id=2 and t1.b_use=1 order by t1.org_id,t1.sort_id`
|
|
|
|
|
list, _ := db.SQL(sql, bureauId).Query().List()
|
|
|
|
|
for i := range list {
|
|
|
|
|
record := list[i]
|
|
|
|
@ -355,7 +356,7 @@ func ExportTeacherInfoExcel(targetPath string, bureauId string, ExportExcelStatu
|
|
|
|
|
func ImportTeacherInfoExcel(excelPath string, bureauId string, actionPersonId string, actionIp string) (bool, string, error) {
|
|
|
|
|
//判断文件是不是存在
|
|
|
|
|
if !FileUtil.PathExists(excelPath) {
|
|
|
|
|
return false, "文件没有找到", nil
|
|
|
|
|
return false, "03", nil //03:文件没有找到
|
|
|
|
|
}
|
|
|
|
|
//模板是不是系统提供的
|
|
|
|
|
var templateSuccess = true
|
|
|
|
@ -381,7 +382,7 @@ func ImportTeacherInfoExcel(excelPath string, bureauId string, actionPersonId st
|
|
|
|
|
//1、对模板的合法性进行检查
|
|
|
|
|
templateSuccess = ExcelUtil.IsValidTemplate(excelPath, s1)
|
|
|
|
|
if !templateSuccess {
|
|
|
|
|
return false, "不是系统提供的模板,无法完成导入!", nil
|
|
|
|
|
return false, "01", nil //01:不是系统提供的模板,无法完成导入!
|
|
|
|
|
}
|
|
|
|
|
//2、对excel的合法性进行检查
|
|
|
|
|
excelSuccess = checkExcel(excelPath, s1, MapOrgName)
|
|
|
|
@ -394,7 +395,7 @@ func ImportTeacherInfoExcel(excelPath string, bureauId string, actionPersonId st
|
|
|
|
|
|
|
|
|
|
//两个有一个不成功,则提示
|
|
|
|
|
if !excelSuccess || !mysqlSuccess {
|
|
|
|
|
return false, "在excel检测中,发现问题,请检查后重新上传!", nil
|
|
|
|
|
return false, "02", nil //02:在excel检测中,发现问题,请检查后重新上传!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//4、获取所有单位的一些属性,用于一会维护人员信息时使用
|
|
|
|
|