From 1df5e870f115b5d3f1a02b13b15266b8b6c9ce4d Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Fri, 17 Jul 2020 17:30:26 +0800 Subject: [PATCH] 'commit' --- .../Config/ImportExcelTemplate/student.json | 2 +- .../Config/ImportExcelTemplate/teacher.json | 2 +- .../BaseOrganizationService.go | 29 ++++++++++++------- .../BaseStudentDao/BaseStudentDao.go | 2 +- .../BaseTeacherDao/BaseTeacherDao.go | 2 +- .../BaseTeacherService/BaseTeacherService.go | 10 +++++-- 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/dsBaseRpc/Config/ImportExcelTemplate/student.json b/dsBaseRpc/Config/ImportExcelTemplate/student.json index 7a4292ed..e7e48a7a 100644 --- a/dsBaseRpc/Config/ImportExcelTemplate/student.json +++ b/dsBaseRpc/Config/ImportExcelTemplate/student.json @@ -45,7 +45,7 @@ ] }, { - "col_name": "证件类型码", + "col_name": "身份证件类型", "width": 20, "require": true, "level_1_sql": true, diff --git a/dsBaseRpc/Config/ImportExcelTemplate/teacher.json b/dsBaseRpc/Config/ImportExcelTemplate/teacher.json index 857a51c5..39478ac2 100644 --- a/dsBaseRpc/Config/ImportExcelTemplate/teacher.json +++ b/dsBaseRpc/Config/ImportExcelTemplate/teacher.json @@ -40,7 +40,7 @@ ] }, { - "col_name": "证件类型码", + "col_name": "身份证件类型", "width": 20, "require": true, "level_1_sql": true, diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go index 6b5fe3e1..930804a1 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go @@ -85,7 +85,11 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto } if exist { reply.Success = false - reply.Message = "代码已存在,无法创建!" + if isBuMen { + reply.Message = "部门代码已存在,无法创建!" + } else { + reply.Message = "单位代码已存在,无法创建!" + } return &reply, err } @@ -256,9 +260,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr if count > 0 { reply.Success = false //判断是单位还是部门 - if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){ + if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) { reply.Message = "部门下存在教工数据,无法删除!" - }else{ + } else { reply.Message = "单位下存在教工数据,无法删除!" } return &reply, err @@ -274,9 +278,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr if count > 0 { reply.Success = false //判断是单位还是部门 - if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){ + if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) { reply.Message = "部门下存在子部门,无法删除!" - }else{ + } else { reply.Message = "单位下存在子部门,无法删除!" } return &reply, err @@ -296,9 +300,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr if count > 0 { reply.Success = false //判断是单位还是部门 - if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){ + if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) { reply.Message = "部门下存在班级,无法删除!" - }else{ + } else { reply.Message = "单位下存在班级,无法删除!" } return &reply, err @@ -373,7 +377,12 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr if exist { reply.Success = false - reply.Message = "代码已存在,无法修改!" + if BaseOrganizationDao.IsBuMen(in.OrgId){ + reply.Message = "部门代码已存在,无法修改!" + }else{ + reply.Message = "部门代码已存在,无法修改!" + } + return &reply, err } //2、检查机构名称是否存在,否则在导入人员时,不知道向哪个单位下进行导入 @@ -386,9 +395,9 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if exist { reply.Success = false - if BaseOrganizationDao.IsBuMen(in.OrgId){ + if BaseOrganizationDao.IsBuMen(in.OrgId) { reply.Message = "部门名称已存在,无法修改!" - }else{ + } else { reply.Message = "单位名称已存在,无法修改!" } return &reply, err diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go index ddb5f64c..c760790c 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentDao/BaseStudentDao.go @@ -449,7 +449,7 @@ func checkExcel(excelPath string, s1 ExcelUtil.TemplateStruct, MapClass map[stri pass = false } } - //(6)证件类型码 + //(6)身份证件类型 if j == 6 { if _, ok := SysDictKit.MapDictKindChineseToCode["sfzjlxm_"+row[j]]; !ok { pass = false diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go index 39489d99..0465aab3 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go @@ -677,7 +677,7 @@ func checkExcel(excelPath string, s1 ExcelUtil.TemplateStruct, MapOrgName map[st pass = false } } - //(4)证件类型码 + //(4)身份证件类型 if j == 4 { if _, ok := SysDictKit.MapDictKindChineseToCode["sfzjlxm_"+row[j]]; !ok { pass = false diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go index 1b98df91..c909bbbc 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go @@ -21,6 +21,7 @@ import ( "dsBaseRpc/Utils/PinYinUtil" "dsBaseRpc/Utils/SqlKit" "dsBaseRpc/models" + "time" ) type Rpc struct{} //服务对象 @@ -31,7 +32,12 @@ func (s *Rpc) GetBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) var reply BaseTeacherProto.Reply //通用获取单条 list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_teacher") - + //处理从教年月 + if len(list)>0{ + if list[0]["csrq"].(time.Time).Year()==1900{ + list[0]["csrq"]="" + } + } //将结果序列化 reply.Success = true reply.Count = 1 @@ -263,7 +269,7 @@ func (s *Rpc) UpdateBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelA model.Xm = in.Xm model.Xmpy = PinYinUtil.PinYin(in.Xmpy) model.Cym = in.Cym - //身份证件类型码 + //身份证件类型 model.Sfzjlxm = in.Sfzjlxm model.Sfzjh = in.Sfzjh //如果是身份证