diff --git a/Document/大数据组待完成工作.mmap b/Document/大数据组待完成工作.mmap new file mode 100644 index 00000000..2f18409a Binary files /dev/null and b/Document/大数据组待完成工作.mmap differ diff --git a/Document/手工配置GIT更新.txt b/Document/手工配置GIT更新.txt index c58311e8..aac80cb0 100644 --- a/Document/手工配置GIT更新.txt +++ b/Document/手工配置GIT更新.txt @@ -1,25 +1,28 @@ -ύgit pushʱʾPermission denied (publickey)... -https://blog.csdn.net/wyp_comeon/article/details/91388107 - - -# E:\Work\dsMin\ҼGit Bash Ȼڴִ -ssh-keygen -t rsa -C "10402852@qq.com" - -Ȼس㶨 - -ssh -v git@10.10.6.203 -ssh-agent -s -ssh-agent bash -ssh-add /c/Users/Administrator/.ssh/id_rsa - -cat ~/.ssh/id_rsa.pub - -ִкid_rsa.pubļݽնˣԿһssh-rsa ͷgitee˺ŵעβģȫ - -ssh -T git@10.10.6.203 - -git pull -git fetch - - +ύgit pushʱʾPermission denied (publickey)... +https://blog.csdn.net/wyp_comeon/article/details/91388107 + + +# E:\Work\dsMin\ҼGit Bash Ȼڴִ +ssh-keygen -t rsa -C "10402852@qq.com" + +Ȼس㶨 + +ssh -v git@10.10.6.203 +ssh-agent -s +ssh-agent bash +ssh-add /c/Users/Administrator/.ssh/id_rsa + +cat ~/.ssh/id_rsa.pub + +ִкid_rsa.pubļݽնˣԿһssh-rsa ͷgitee˺ŵעβģȫ + +ssh -T git@10.10.6.203 + +git pull +git fetch + + +git config --global core.autocrlf false + + git config --global core.autocrlf false \ No newline at end of file diff --git a/dsBaseRpc/Const/Const.go b/dsBaseRpc/Const/Const.go index 4b80d9d9..540d3e8b 100644 --- a/dsBaseRpc/Const/Const.go +++ b/dsBaseRpc/Const/Const.go @@ -57,7 +57,7 @@ const BlueCell = "C200" const YellowCell = "D200" //整数最大值 -const IntMax = 9999999 +const Int32Max = 2147483647 //操作CODE const ActionInsert = "INSERT" diff --git a/dsBaseRpc/ExcelTemp/063E3EB2-61BC-48C6-9461-5A25A57AE303.xlsx b/dsBaseRpc/ExcelTemp/063E3EB2-61BC-48C6-9461-5A25A57AE303.xlsx deleted file mode 100644 index 4c8e14d2..00000000 Binary files a/dsBaseRpc/ExcelTemp/063E3EB2-61BC-48C6-9461-5A25A57AE303.xlsx and /dev/null differ diff --git a/dsBaseRpc/ExcelTemp/2C9E596C-8109-45D0-A046-ED08BA62C3FB.xlsx b/dsBaseRpc/ExcelTemp/2C9E596C-8109-45D0-A046-ED08BA62C3FB.xlsx deleted file mode 100644 index 98864603..00000000 Binary files a/dsBaseRpc/ExcelTemp/2C9E596C-8109-45D0-A046-ED08BA62C3FB.xlsx and /dev/null differ diff --git a/dsBaseRpc/ExcelTemp/9A622538-0100-4F2B-BF41-EF14D9E64E8B.xlsx b/dsBaseRpc/ExcelTemp/9A622538-0100-4F2B-BF41-EF14D9E64E8B.xlsx deleted file mode 100644 index c1e0f224..00000000 Binary files a/dsBaseRpc/ExcelTemp/9A622538-0100-4F2B-BF41-EF14D9E64E8B.xlsx and /dev/null differ diff --git a/dsBaseRpc/ExcelTemp/F509FC2B-6363-46DF-9E55-937443ED0648.xlsx b/dsBaseRpc/ExcelTemp/F509FC2B-6363-46DF-9E55-937443ED0648.xlsx deleted file mode 100644 index 6bbecba1..00000000 Binary files a/dsBaseRpc/ExcelTemp/F509FC2B-6363-46DF-9E55-937443ED0648.xlsx and /dev/null differ diff --git a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go index c4690b3f..d3ec163a 100644 --- a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go +++ b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go @@ -100,7 +100,7 @@ func PageBaseClass(in *BaseClassProto.QueryArg) ([]map[string]interface{}, int32 //根据学校ID获取学部(学段)信息 func GetStage(schoolId string) ([]map[string]interface{}, int32, error) { //1、获取办学类型 - list := SqlKit.QueryListMapByIds([]string{schoolId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{schoolId}, "t_base_organization") if list == nil || len(list) == 0 { return nil, 0, errors.New("无法找到此学校id。") } diff --git a/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go b/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go index aa003236..ee0ca9e1 100644 --- a/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go +++ b/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go @@ -24,7 +24,7 @@ func (s *Rpc) GetBaseClass(ctx context.Context, in *BaseClassProto.ModelArg) (*B //rpc响应 var reply BaseClassProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{in.ClassId}, "t_base_class") //将结果序列化 reply.Success = true reply.Count = 1 @@ -38,7 +38,7 @@ func (s *Rpc) AddBaseClass(ctx context.Context, in *BaseClassProto.ModelArg) (*B //rpc响应 var reply BaseClassProto.Reply //检查单位号是不是存在 - list := SqlKit.QueryListMapByIds([]string{in.BureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.BureauId}, "t_base_organization") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "输入的学校编号不存在,无法创建班级!" diff --git a/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go b/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go index 3e8c7742..dcff768f 100644 --- a/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go +++ b/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go @@ -18,7 +18,7 @@ func (s *Rpc) GetBaseGlobal(ctx context.Context, in *BaseGlobalProto.ModelArg) ( //rpc响应 var reply BaseGlobalProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.GlobalId}, "t_base_global") + list := SqlKit.QueryByIds([]string{in.GlobalId}, "t_base_global") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go index 77a13577..c8d996dc 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go @@ -265,7 +265,7 @@ func GetChildSchoolCount(mainSchoolId string) (int64, error) { 时间:2020-06-03 */ func GetBureauAdministrativeDivision(BureauId string) (string, string, string, string, string, error) { - list := SqlKit.QueryListMapByIds([]string{BureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{BureauId}, "t_base_organization") if len(list) > 0 { return list[0]["area_code"].(string), list[0]["province_code"].(string), list[0]["city_code"].(string), list[0]["district_code"].(string), list[0]["main_school_id"].(string), nil @@ -280,7 +280,7 @@ func GetBureauAdministrativeDivision(BureauId string) (string, string, string, s 时间:2020-06-03 */ func GetMultipleBaseOrganization(Ids []string) ([]map[string]interface{}, int32, error) { - list := SqlKit.QueryListMapByIds(Ids, "t_base_organization") + list := SqlKit.QueryByIds(Ids, "t_base_organization") return list, int32(len(list)), nil } diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go index ec47837b..45119159 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go @@ -21,6 +21,7 @@ import ( "dsBaseRpc/Utils/PinYinUtil" "dsBaseRpc/Utils/SqlKit" "dsBaseRpc/models" + "errors" ) type Rpc struct{} //服务对象 @@ -30,7 +31,7 @@ func (s *Rpc) GetBaseOrganization(ctx context.Context, in *BaseOrganizationProto //rpc响应 var reply BaseOrganizationProto.Reply //使用通用方法获取单条记录 - list := SqlKit.QueryListMapByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") //将结果序列化 reply.Success = true @@ -373,9 +374,13 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr //普通学校 model.MainSchoolType = 1 //查看它有没有父校? - list := SqlKit.QueryListMapByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") + if list == nil || len(list) == 0 { + reply.Success = false + reply.Message = "没有找到此OrgId!" + return &reply, err + } mainSchoolId := list[0]["main_school_id"] - if mainSchoolId != "" { //如果有父校,父校ID是不是还有其它孩子 count, err := BaseOrganizationDao.GetChildSchoolCount(mainSchoolId.(string)) @@ -596,7 +601,10 @@ func (s *Rpc) GetOrgManager(ctx context.Context, in *BaseOrganizationProto.Multi */ func UpdateManager(bureauId string, bUse int32) error { //使用通用方法获取单条记录 - list := SqlKit.QueryListMapByIds([]string{bureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{bureauId}, "t_base_organization") + if list == nil || len(list) == 0 { + return errors.New("无法找到指定的单位ID") + } bureauName := list[0]["org_name"].(string) orgType := int32(list[0]["org_type"].(float64)) //组织机构类型 1:教育局 2:学校 3:部门 4:院 5:系 6:专业 7:教辅单位,8:大学区 diff --git a/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go b/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go index e9a21614..9e938e6f 100644 --- a/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go +++ b/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go @@ -5,6 +5,7 @@ import ( "dsBaseRpc/Utils/DbUtil" "dsBaseRpc/Utils/SqlKit" "dsBaseRpc/models" + "errors" ) //操作数据库的变量 @@ -22,7 +23,10 @@ func UpdateOrgManager(OrgId string, OrgManagerIds []string) error { //2、后插入 //部门所在的单位 - list := SqlKit.QueryListMapByIds([]string{OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{OrgId}, "t_base_organization") + if list == nil || len(list) == 0 { + return errors.New("无法找到指定的OrgId") + } BureauId := list[0]["bureau_id"].(string) //事务声明 diff --git a/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go b/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go index db9517b5..93f9d5a9 100644 --- a/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go +++ b/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go @@ -20,7 +20,7 @@ func (s *Rpc) GetBasePurview(ctx context.Context, in *BasePurviewProto.ModelArg) //统一返回的结构体 var reply BasePurviewProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.PurviewId}, "t_base_purview") + list := SqlKit.QueryByIds([]string{in.PurviewId}, "t_base_purview") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go index 17985a6d..a39af5c1 100644 --- a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go +++ b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go @@ -20,7 +20,7 @@ func (s *Rpc) GetBaseRolePerson(ctx context.Context, in *BaseRolePersonProto.Mod //rpc响应 var reply BaseRolePersonProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.Id}, "t_base_role_person") + list := SqlKit.QueryByIds([]string{in.Id}, "t_base_role_person") //将结果序列化 reply.Success = true reply.Count = 1 @@ -269,7 +269,7 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch orgIds := in.OrgId if len(orgIds) > 0 { found = true - l2 := SqlKit.QueryListMapByIds(orgIds, "t_base_organization") + l2 := SqlKit.QueryByIds(orgIds, "t_base_organization") if l2 == nil { reply.Success = false reply.Message = "传入的单位或部门ID没有找到!!" @@ -296,7 +296,7 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch classIds := in.ClassId if len(classIds) > 0 { found = true - listClass := SqlKit.QueryListMapByIds(classIds, "t_base_class") + listClass := SqlKit.QueryByIds(classIds, "t_base_class") if listClass == nil { reply.Success = false reply.Message = "传入的班级ID没有找到!!" diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go index ffe06c34..62849b4b 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go @@ -27,7 +27,7 @@ func (s *Rpc) GetBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) //rpc响应 var reply BaseStudentProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.PersonId}, "t_base_student") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_student") //将结果序列化 reply.Success = true reply.Count = 1 @@ -102,7 +102,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) model.BUse = 1 //状态码 model.StateId = 1 - list := SqlKit.QueryListMapByIds([]string{in.ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{in.ClassId}, "t_base_class") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到对应的班级!" @@ -282,7 +282,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA //残疾标志 0:不是 1:是 model.Cjbz = in.Cjbz //查找此学生所在的班级 - list := SqlKit.QueryListMapByIds([]string{in.PersonId}, "t_base_student") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_student") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到对应的学生!" diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go index d20c0e02..562e2031 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go @@ -101,7 +101,7 @@ func PageBaseTeacher(in *BaseTeacherProto.QueryArg) ([]map[string]interface{}, i From("t_base_teacher as t1"). LeftJoin("t_base_teacher_org as t2", "t1.person_id=t2.person_id") //所在单位ID - list := SqlKit.QueryListMapByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") if list == nil { return nil, 0, errors.New("没有找到此单位编码!") } diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go index d65afa44..f568ed2b 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go @@ -30,7 +30,7 @@ func (s *Rpc) GetBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) //rpc响应 var reply BaseTeacherProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.PersonId}, "t_base_teacher") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_teacher") //将结果序列化 reply.Success = true @@ -151,7 +151,7 @@ func (s *Rpc) AddBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) //排序号 model.SortId = int32(BaseTeacherDao.GetMaxSortId(in.OrgId)) + 1 //主单位与主部门 - list := SqlKit.QueryListMapByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到指定的组织机构ID!" diff --git a/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go b/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go index 0ee3ab91..d3fd06d1 100644 --- a/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go +++ b/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go @@ -25,7 +25,7 @@ func (s *Rpc) GetGovArea(ctx context.Context, in *GovAreaProto.ModelArg) (*GovAr return &reply, nil } //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.AreaCode}, "t_gov_area") + list := SqlKit.QueryByIds([]string{in.AreaCode}, "t_gov_area") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go b/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go index 13defa6b..1ec863f7 100644 --- a/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go +++ b/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go @@ -19,7 +19,7 @@ func (s *Rpc) GetSysDict(ctx context.Context, in *SysDictProto.ModelArg) (*SysDi //统一返回的结构体 var reply SysDictProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{CommonUtil.ConvertInt32ToString(in.DictId)}, "t_sys_dict") + list := SqlKit.QueryByIds([]string{CommonUtil.ConvertInt32ToString(in.DictId)}, "t_sys_dict") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go index c511e967..c969e793 100644 --- a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go +++ b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go @@ -9,6 +9,7 @@ import ( "dsBaseRpc/Utils/RedisUtil" "dsBaseRpc/Utils/SqlKit" "dsBaseRpc/models" + "errors" "fmt" "github.com/xormplus/builder" ) @@ -125,7 +126,7 @@ func PageSysLoginPerson(in *SysLoginpersonProto.QueryArg) ([]map[string]interfac myBuilder.OrderBy("t3.sort_id").OrderBy("t3.org_type").OrderBy("t3.id_int") //获取拼接完成的SQL语句 sql, err := myBuilder.Limit(limit, offset).ToBoundSQL() - if err!=nil{ + if err != nil { fmt.Println(err.Error()) } list, count, err := SqlKit.Query(sql) @@ -241,6 +242,10 @@ func EnableDisableAccount(personIds []string, bUse int) error { //根据登录信息表,获取人员与单位的关系信息 func GetBureauIdsByPersonIds(personIds []string) ([]map[string]interface{}, string, error) { + //如果没有正确传入参数 + if len(personIds) == 0 { + return nil, Const.DataBaseActionError, errors.New("没有正确传入人员ID数组") + } //一组人员,肯定是同一个身份ID myBuilder := builder.Dialect(builder.MYSQL).Select("identity_id").From("t_sys_loginperson"). Where(builder.Eq{"person_id": personIds[0]}) diff --git a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go index b31084af..64f87a25 100644 --- a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go +++ b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go @@ -21,7 +21,7 @@ func (s *Rpc) GetSysLoginperson(ctx context.Context, in *SysLoginpersonProto.Mod //rpc响应 var reply SysLoginpersonProto.Reply //通用获取单条 - list := SqlKit.QueryListMapByIds([]string{in.Id}, "t_sys_loginperson") + list := SqlKit.QueryByIds([]string{in.Id}, "t_sys_loginperson") //将结果序列化 reply.Success = true reply.Count = 1 @@ -184,7 +184,7 @@ func (s *Rpc) PageSysLoginpersonExcel(ctx context.Context, in *SysLoginpersonPro //重新设置长度和显示的页 in.Page = 1 - in.Limit = Const.IntMax + in.Limit = Const.Int32Max list, _, err := SysLoginpersonDao.PageSysLoginPerson(in) //错误处理 diff --git a/dsBaseRpc/Test/GetSysDict_test.go b/dsBaseRpc/Test/GetSysDict_test.go deleted file mode 100644 index 927ebb1b..00000000 --- a/dsBaseRpc/Test/GetSysDict_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package Test - -import ( - "testing" -) - -func TestGetSysDict(t *testing.T) { - -} diff --git a/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go b/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go index 1289de93..0ceab67e 100644 --- a/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go +++ b/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go @@ -8,7 +8,7 @@ import ( func main(){ var ClassId="1" - list := SqlKit.QueryListMapByIds([]string{ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{ClassId}, "t_base_class") list2:=make([]map[string]interface{},0) fmt.Println(list) fmt.Println(list2) diff --git a/dsBaseRpc/Test/dm_stage_http_test.go b/dsBaseRpc/Test/dm_stage_http_test.go deleted file mode 100644 index 5da3bb92..00000000 --- a/dsBaseRpc/Test/dm_stage_http_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package Test - -import ( - "flag" - "testing" -) - -var ( - addr = flag.String("addr", "localhost:8972", "server address") -) - -func TestBaseRpcGateWay(t *testing.T) { - //cc := &codec.MsgpackCodec{} - ////提交的参数 - ////准备计算的参数 - //args := &RpcService.DmStageArgs{ - // Limit: 1000, - // Offset: 0, - //} - ////定义返回的变量 - //reply := &RpcService.Reply{} - //data, _ := cc.Encode(args) - //// request - //req, err := http.NewRequest("POST", "http://10.10.6.200:8001/", bytes.NewReader(data)) - //if err != nil { - // fmt.Println("failed to create request: ", err) - // return - //} - // - //// 设置header - //h := req.Header - //h.Set(gateway.XMessageID, "10000") - //h.Set(gateway.XMessageType, "0") - //h.Set(gateway.XSerializeType, "3") - //h.Set(gateway.XServicePath, "Base") - //h.Set(gateway.XServiceMethod, "GetStageList") - // - //// 发送http请求 - //// http请求===>rpcx请求===>rpcx服务===>返回rpcx结果===>转换为http的response===>输出到client - //res, err := http.DefaultClient.Do(req) - //if err != nil { - // fmt.Println("failed to call: ", err) - //} - //defer res.Body.Close() - //// 获取结果 - //replyData, err := ioutil.ReadAll(res.Body) - //if err != nil { - // fmt.Println("failed to read response: ", err) - //} - //// 解码 - //err = cc.Decode(replyData, reply) - //if err != nil { - // fmt.Println("failed to decode reply: ", err) - //} - //fmt.Println(reply.List) -} diff --git a/dsBaseRpc/Test/idCard_test.go b/dsBaseRpc/Test/idCard_test.go deleted file mode 100644 index 7aa36610..00000000 --- a/dsBaseRpc/Test/idCard_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package Test - -import ( - "dsBaseRpc/Utils/IdCardUtil" - "fmt" - "testing" -) - -func TestIdCard(t *testing.T) { - //待验证的身份证号 - idCard:="222301197710110018" - //开始检查 - isValid, birthday, xb := IdCardUtil.GetIdCardNoInfo(idCard) - if !isValid{ - fmt.Println("身份证号不合法!") - } else { - // isMale:true---->男 - fmt.Printf("birthday=%s, xb=%s \n", birthday, xb) - } -} diff --git a/dsBaseRpc/Test/sqlin_test.go b/dsBaseRpc/Test/sqlin_test.go deleted file mode 100644 index 42b42da2..00000000 --- a/dsBaseRpc/Test/sqlin_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package Test - -import ( - "dsBaseRpc/Utils/CommonUtil" - "dsBaseRpc/Utils/DbUtil" - "fmt" - "strings" - "testing" -) - -func TestSqlIn(t *testing.T) { - //方式1:传入字符串数组 - idAry := []string{"1", "2", "3"} - ids := strings.Join(idAry, "','") - sqlRaw := fmt.Sprintf(`SELECT * FROM table WHERE id IN ('%s')`, ids) - fmt.Println(sqlRaw) - - //方式2:传入整数数组 - nums := []int{11, 12, 13} - ids = strings.Join(CommonUtil.ConvertIntegerArrayToStringArray(nums), "','") - sqlRaw = fmt.Sprintf(`select * from t_dm_subject where subject_id in ('%s')`, ids) - fmt.Println(sqlRaw) - - var db = DbUtil.Engine - list, err := db.SQL(sqlRaw).Query().List() - if err != nil { - fmt.Println(err) - } - fmt.Println(list) -} diff --git a/dsBaseRpc/Utils/SqlKit/SqlKit.go b/dsBaseRpc/Utils/SqlKit/SqlKit.go index 50776098..58dc3ef7 100644 --- a/dsBaseRpc/Utils/SqlKit/SqlKit.go +++ b/dsBaseRpc/Utils/SqlKit/SqlKit.go @@ -43,9 +43,10 @@ func DeleteIds(tableName string, ids []string) error { 作者:黄海 时间:2020-02-05 */ -func QueryListMapByIds(ids []string, tableName string) []map[string]interface{} { +func QueryByIds(ids []string, tableName string) []map[string]interface{} { return getListByIds(ids, GetBean(tableName)) } + func getListByIds(ids []string, m Selector) []map[string]interface{} { //1、第一步从缓存读取 list, notExistsIds := batchReadRedis(ids, m.RedisPrefix) diff --git a/dsBaseRpc/go.mod b/dsBaseRpc/go.mod index dbaf89ea..208fedee 100644 --- a/dsBaseRpc/go.mod +++ b/dsBaseRpc/go.mod @@ -31,7 +31,6 @@ require ( github.com/go-xorm/cmd/xorm v0.0.0-20190426080617-f87981e709a1 // indirect github.com/go-xorm/xorm v0.7.9 // indirect github.com/gogo/protobuf v1.3.1 // indirect - github.com/goinggo/mapstructure v0.0.0-20140717182941-194205d9b4a9 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.0 github.com/google/uuid v1.1.1 // indirect