From dc4821eb0f3942a8ce69c771df2ec15dcf8a6129 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Fri, 17 Jul 2020 17:10:48 +0800 Subject: [PATCH] 'commit' --- .../ExportExcelTemplate/student_account.json | 2 +- .../ExportExcelTemplate/teacher_account.json | 6 +- .../Config/ImportExcelTemplate/student.json | 234 ++++++++-------- .../Config/ImportExcelTemplate/teacher.json | 252 +++++++++--------- .../BaseStudentDao/BaseStudentDao.go | 4 +- .../BaseStudentService/BaseStudentService.go | 6 +- .../BaseTeacherService/BaseTeacherService.go | 4 +- dsBaseRpc/Test/excel_test.go | 4 +- 8 files changed, 256 insertions(+), 256 deletions(-) diff --git a/dsBaseRpc/Config/ExportExcelTemplate/student_account.json b/dsBaseRpc/Config/ExportExcelTemplate/student_account.json index 82e14f35..b184cbc8 100644 --- a/dsBaseRpc/Config/ExportExcelTemplate/student_account.json +++ b/dsBaseRpc/Config/ExportExcelTemplate/student_account.json @@ -17,7 +17,7 @@ "width": 30 }, { - "col_name": "姓名", + "col_name": "学生姓名", "col_field": "person_name", "width": 30 }, diff --git a/dsBaseRpc/Config/ExportExcelTemplate/teacher_account.json b/dsBaseRpc/Config/ExportExcelTemplate/teacher_account.json index 925ec575..7d7a90eb 100644 --- a/dsBaseRpc/Config/ExportExcelTemplate/teacher_account.json +++ b/dsBaseRpc/Config/ExportExcelTemplate/teacher_account.json @@ -7,17 +7,17 @@ "width": 20 }, { - "col_name": "部门", + "col_name": "所属部门", "col_field": "org_name", "width": 30 }, { - "col_name": "姓名", + "col_name": "教职工姓名", "col_field": "person_name", "width": 20 }, { - "col_name": "登录名", + "col_name": "登录账号", "col_field": "login_name", "width": 30 }, diff --git a/dsBaseRpc/Config/ImportExcelTemplate/student.json b/dsBaseRpc/Config/ImportExcelTemplate/student.json index a3f5cfd2..7a4292ed 100644 --- a/dsBaseRpc/Config/ImportExcelTemplate/student.json +++ b/dsBaseRpc/Config/ImportExcelTemplate/student.json @@ -1,118 +1,118 @@ -{ - "title": "学生信息导入", - "level_1_sql": [ - "select dict_value from t_sys_dict where dict_kind =? order by sort_id" - ], - "cols": [ - { - "col_name": "学部", - "width": 16, - "require": true - }, - { - "col_name": "入学年份", - "width": 16, - "require": true - }, - { - "col_name": "班号", - "width": 16, - "require": true - }, - { - "col_name": "姓名", - "width": 16, - "require": true - }, - { - "col_name": "民族", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "mzm" - ] - }, - { - "col_name": "政治面貌", - "width": 28, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "zzmmm" - ] - }, - { - "col_name": "证件类型码", - "width": 20, - "require": true, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "sfzjlxm" - ] - }, - { - "col_name": "身份证件号", - "width": 30, - "require": true - }, - { - "col_name": "独生子女", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - }, - { - "col_name": "随迁子女", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - }, - { - "col_name": "务工子女", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - }, - { - "col_name": "孤儿", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - }, - { - "col_name": "留守儿童", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - }, - { - "col_name": "残疾儿童", - "width": 15, - "require": true, - "range": [ - "否", - "是" - ] - } - ] +{ + "title": "学生信息", + "level_1_sql": [ + "select dict_value from t_sys_dict where dict_kind =? order by sort_id" + ], + "cols": [ + { + "col_name": "学部", + "width": 16, + "require": true + }, + { + "col_name": "入学年份", + "width": 16, + "require": true + }, + { + "col_name": "班号", + "width": 16, + "require": true + }, + { + "col_name": "姓名", + "width": 16, + "require": true + }, + { + "col_name": "民族", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "mzm" + ] + }, + { + "col_name": "政治面貌", + "width": 28, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "zzmmm" + ] + }, + { + "col_name": "证件类型码", + "width": 20, + "require": true, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "sfzjlxm" + ] + }, + { + "col_name": "身份证件号", + "width": 30, + "require": true + }, + { + "col_name": "独生子女", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + }, + { + "col_name": "随迁子女", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + }, + { + "col_name": "务工子女", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + }, + { + "col_name": "孤儿", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + }, + { + "col_name": "留守儿童", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + }, + { + "col_name": "残疾儿童", + "width": 15, + "require": true, + "range": [ + "否", + "是" + ] + } + ] } \ No newline at end of file diff --git a/dsBaseRpc/Config/ImportExcelTemplate/teacher.json b/dsBaseRpc/Config/ImportExcelTemplate/teacher.json index 0f6721ef..857a51c5 100644 --- a/dsBaseRpc/Config/ImportExcelTemplate/teacher.json +++ b/dsBaseRpc/Config/ImportExcelTemplate/teacher.json @@ -1,127 +1,127 @@ -{ - "title": "教工信息导入", - "level_1_sql": [ - "select dict_value from t_sys_dict where dict_kind =? order by sort_id" - ], - "level_2_sql": [ - [ - "select stage_name as dict_value from t_dm_stage where b_use=1 order by sort_id", - "select subject_name as dict_value from t_dm_subject where subject_id in (select subject_id from t_dm_stage_subject where stage_id=(select stage_id from t_dm_stage where stage_name=?) and b_use=1)" - ] - ], - "cols": [ - { - "col_name": "部门", - "width": 28 - }, - { - "col_name": "姓名", - "width": 16, - "require": true - }, - { - "col_name": "民族", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "mzm" - ] - }, - { - "col_name": "政治面貌", - "width": 28, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "zzmmm" - ] - }, - { - "col_name": "证件类型码", - "width": 20, - "require": true, - "level_1_sql": true, - "sql_num": 1, - "sql_parameter": [ - "sfzjlxm" - ] - }, - { - "col_name": "身份证件号", - "width": 30, - "require": true - }, - { - "col_name": "学历", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "xlm" - ] - }, - { - "col_name": "学位", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "xwm" - ] - }, - { - "col_name": "职称", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "zcm" - ] - }, - { - "col_name": "编制", - "width": 16, - "level_1_sql": true, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "bzlbm" - ] - }, - { - "col_name": "岗位", - "level_1_sql": true, - "width": 16, - "require": true, - "sql_num": 1, - "sql_parameter": [ - "gwzym" - ] - }, - { - "col_name": "任课学段", - "require": true, - "width": 26 - }, - { - "col_name": "任课学科", - "level_1_sql": false, - "require": true, - "width": 26 - }, - { - "col_name": "联系电话", - "width": 20 - }, - { - "col_name": "电子信箱", - "width": 30 - } - ] +{ + "title": "教工信息", + "level_1_sql": [ + "select dict_value from t_sys_dict where dict_kind =? order by sort_id" + ], + "level_2_sql": [ + [ + "select stage_name as dict_value from t_dm_stage where b_use=1 order by sort_id", + "select subject_name as dict_value from t_dm_subject where subject_id in (select subject_id from t_dm_stage_subject where stage_id=(select stage_id from t_dm_stage where stage_name=?) and b_use=1)" + ] + ], + "cols": [ + { + "col_name": "部门", + "width": 28 + }, + { + "col_name": "姓名", + "width": 16, + "require": true + }, + { + "col_name": "民族", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "mzm" + ] + }, + { + "col_name": "政治面貌", + "width": 28, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "zzmmm" + ] + }, + { + "col_name": "证件类型码", + "width": 20, + "require": true, + "level_1_sql": true, + "sql_num": 1, + "sql_parameter": [ + "sfzjlxm" + ] + }, + { + "col_name": "身份证件号", + "width": 30, + "require": true + }, + { + "col_name": "学历", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "xlm" + ] + }, + { + "col_name": "学位", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "xwm" + ] + }, + { + "col_name": "职称", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "zcm" + ] + }, + { + "col_name": "编制", + "width": 16, + "level_1_sql": true, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "bzlbm" + ] + }, + { + "col_name": "岗位", + "level_1_sql": true, + "width": 16, + "require": true, + "sql_num": 1, + "sql_parameter": [ + "gwzym" + ] + }, + { + "col_name": "任课学段", + "require": true, + "width": 26 + }, + { + "col_name": "任课学科", + "level_1_sql": false, + "require": true, + "width": 26 + }, + { + "col_name": "联系电话", + "width": 20 + }, + { + "col_name": "电子信箱", + "width": 30 + } + ] } \ No newline at end of file diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go index 9649e0ab..ddb5f64c 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go @@ -63,7 +63,7 @@ func UpdateBaseStudent(model models.TBaseStudent, ForceUpdateFields []string) (i var ids = []string{model.PersonId} var selector = SqlKit.GetBean("t_base_student") SqlKit.DeleteCacheByIds(ids, selector) - //更改登录表中的教师姓名 + //更改登录表中的学生姓名 SysLoginpersonDao.UpdatePersonName(model.PersonId, model.Xm) //2、计算本次操作,有哪些字段需要更新 NeedUpdateFields := CommonUtil.GetNeedUpdateFields(model) @@ -144,7 +144,7 @@ func ExportStudentAccountInfoExcel(in *BaseStudentProto.ModelArg) ([]map[string] classIds = append(classIds, in.ClassId) myBuilder.And(builder.In("t3.class_id", classIds)) } - myBuilder.OrderBy("t3.stage_id").OrderBy("t3.id_int") + myBuilder.OrderBy("t3.stage_id").OrderBy("t3.id_int").OrderBy("t2.id_int") sql, err := myBuilder.ToBoundSQL() if err != nil { return nil, 0, err diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go index 4217fc42..f083b4a7 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go @@ -51,7 +51,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) //是不是重复 if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, "") { reply.Success = false - reply.Message = "唯一身份标识在系统中已存在,无法创建!" + reply.Message = "证件号在系统中已存在,无法创建!" return &reply, nil } //========================================== @@ -84,7 +84,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) model.Xbm = xbm } else { model.Csrq = DateUtil.ConvertDate(in.Csrq) - model.Xbm = "1" + model.Xbm = in.Xbm } //民族 (有字典) model.Mzm = in.Mzm @@ -245,7 +245,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA //是不是重复 if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, in.PersonId) { reply.Success = false - reply.Message = "唯一身份标识在系统中已存在,无法创建!" + reply.Message = "证件号在系统中已存在,无法创建!" return &reply, nil } //========================================== diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go index 4ad91ee3..1b98df91 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go @@ -55,7 +55,7 @@ func (s *Rpc) AddBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) //是不是重复 if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, "") { reply.Success = false - reply.Message = "唯一身份标识在系统中已存在,无法创建!" + reply.Message = "证件号在系统中已存在,无法创建!" return &reply, nil } //========================================== @@ -228,7 +228,7 @@ func (s *Rpc) UpdateBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelA //是不是重复 if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, in.PersonId) { reply.Success = false - reply.Message = "唯一身份标识在系统中已存在,无法创建!" + reply.Message = "证件号在系统中已存在,无法创建!" return &reply, nil } diff --git a/dsBaseRpc/Test/excel_test.go b/dsBaseRpc/Test/excel_test.go index 62d5ae06..6ed7e6fa 100644 --- a/dsBaseRpc/Test/excel_test.go +++ b/dsBaseRpc/Test/excel_test.go @@ -13,8 +13,8 @@ func TestStyle(t *testing.T) { tPath := `E:\Work\dsMin\dsBaseRpc\Config\ImportExcelTemplate\teacher2222.xlsx` f, _ := excelize.OpenFile(excelPath) - style, _ := f.GetCellStyle("教工信息导入", Const.RedCell) - f.SetCellStyle("教工信息导入", "A202", "A202", style) + style, _ := f.GetCellStyle("教工信息", Const.RedCell) + f.SetCellStyle("教工信息", "A202", "A202", style) if err := f.SaveAs(tPath); err != nil { println(err.Error())