master
wubin 5 years ago
parent 59bad3ac3e
commit fde0b78db0

@ -786,8 +786,8 @@ func PageGovArea(c *gin.Context) {
})
}
// @Summary 获取行政区划信息
// @Description 获取行政区划信息
// @Summary 获取单位列表
// @Description 获取单位列表
// @Tags 接入系统
// @Accept application/x-www-form-urlencoded
// @Produce json

@ -0,0 +1,176 @@
syntax = "proto3";
//webpb.go
/*
protoc -I Business/BaseOrganization/BaseOrganizationProto/ Business/BaseOrganization/BaseOrganizationProto/BaseOrganization.proto --go_out=plugins=grpc:Business/BaseOrganization/BaseOrganizationProto
*/
package BaseOrganizationProto;
option go_package = ".;BaseOrganizationProto";
option java_multiple_files = true;
option java_package = "com.dsideal.dsmin.base";
option java_outer_classname = "BaseOrganization";
option objc_class_prefix = "";
service BaseOrganizationManage {
//
rpc GetBaseOrganization (ModelArg) returns (Reply) {}
//
rpc AddBaseOrganization (ModelArg) returns (Reply) {}
//
rpc DeleteBaseOrganization (DeleteIdsArg) returns (Reply) {}
//
rpc UpdateBaseOrganization (ModelArg) returns (Reply) {}
//()
rpc PageBaseOrganization (QueryArg) returns (Reply) {}
//orgIdorgName
rpc GetMultipleBaseOrganization (MultipleQueryArg) returns (Reply) {}
// IDReact Ant Design
//ModelArgBureauId,List,JSONReplyjsonData
rpc GetBureauOrgTree (ModelArg) returns (Reply) {}
//ID
rpc GetOrgManager (MultipleQueryArg) returns (Reply) {}
//
rpc SetEnableEdu (MultipleQueryArg) returns (Reply) {}
//
rpc SetDisableEdu (MultipleQueryArg) returns (Reply) {}
//ID
rpc ListOrgInfoByOrgKeyWord (ListOrgArg) returns (Reply) {}
//
rpc ListEduByCityCode (CityCodeArg)returns (Reply) {}
}
message CityCodeArg {
//
string CityCode = 1;
}
message ListOrgArg {
//ID
string PersonId = 1;
//
string OrgKeyWord = 2;
}
message MultipleQueryArg{
//orgId
repeated string Ids = 1;
//
string ActionPersonId = 2;
//IP
string ActionIpAddress = 3;
}
message ModelArg {
//ID
string OrgId = 1;
//ID
int32 OrgIdInt = 2;
//
string OrgCode = 3;
//
string OrgName = 4;
//ID0
string ParentId = 5;
//ID
string BureauId = 6;
// 1 2 3 4 5 6 7,8:
int32 OrgType = 7;
//
int32 EduAssistType = 8;
//123
int32 MainSchoolType = 9;
//ID,IDIDID
string MainSchoolId = 10;
//
string Xxbxlxm = 11;
//
string Szdcxlxm = 12;
//
string Xxjbzm = 13;
//ID*
string Fzr = 14;
//
string Fddbr = 15;
//
string Fddbrdh = 16;
//
string Address = 17;
//
string Lxdh = 18;
//
float OrgLng = 19;
//
float OrgLat = 20;
//
int32 SortId = 21;
// 0 1
int32 BUse = 22;
//
string ProvinceCode = 23;
//
string CityCode = 24;
//
string DistrictCode = 25;
// RPC
string AreaCode = 26;
//
string ManagerAreaCode = 27;
//
string LastUpdatedTime = 28;
// -1 1
int32 IsBranchSchool = 29;
//IDS
repeated string OrgManagerIds = 30;
//
repeated string ForceUpdateFields = 31;
//
repeated string FsbIds = 32;
//
string ActionPersonId = 33;
//IP
string ActionIpAddress = 34;
}
//
message QueryArg{
int32 Page = 1;
int32 Limit = 2;
// RPC
string AreaCode = 3;
// -1 1
int32 BUse = 4;
// 1 2 3 4 5 6 7 8
int32 OrgType = 5;
//
string OrgName = 6;
// 0
string Xxbxlxm = 7;
//ID
string BureauId = 8;
// true false
bool IsMainSchool = 9;
//
string ActionPersonId = 10;
//IP
string ActionIpAddress = 11;
}
//
message Reply{
bool Success = 1;
string Message = 2;
int32 Count = 3;
string List = 4;
}
//
message DeleteIdsArg {
//ID
repeated string Ids = 1;
//
string ActionPersonId = 2;
//IP
string ActionIpAddress = 3;
}

@ -0,0 +1,19 @@
package BaseOrganizationService
import (
"dsSupport/MyModel/AccessSystem/AccessSystemProto/BaseOrganizationProto"
"dsSupport/Utils/CommonUtil"
)
func GetOrganizationList(page int32, limit int32, areaCode string, orgType int32, orgName string) (*BaseOrganizationProto.Reply, error) {
Reply, err := PageBaseOrganization(BaseOrganizationProto.QueryArg{Page: page, Limit: limit, AreaCode: areaCode, OrgName: orgName, OrgType: orgType, BUse: 1})
handleListStr := CommonUtil.ListMerge(Reply.List, GetOrgTypeArr(), "org_type", "type_id", "org_type_name", "type_name")
Reply.List = handleListStr
return Reply, err
}
func GetOrgTypeArr() string {
orgTypeArr := "[{\"type_id\":1,\"type_name\":\"教育局\"},{\"type_id\":2,\"type_name\":\"学校\"},{\"type_id\":7,\"type_name\":\"教辅单位\"}]"
return orgTypeArr
}

@ -0,0 +1,32 @@
package BaseOrganizationService
import (
"context"
"dsSupport/MyModel/AccessSystem/AccessSystemProto/BaseOrganizationProto"
"dsSupport/Utils/GRpcUtil"
"dsSupport/Utils/LogUtil"
"errors"
"time"
)
/**
2020-05-22
*/
func PageBaseOrganization(queryArg BaseOrganizationProto.QueryArg) (*BaseOrganizationProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseOrganizationProto.NewBaseOrganizationManageClient(conn)
Reply, err := c.PageBaseOrganization(ctx, &queryArg)
if err != nil {
LogUtil.Error("获取组织机构列表错误: ", err.Error())
}
return Reply, err
}

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-09-17 08:09:16.5994261 +0800 CST m=+0.099943401
// 2020-09-17 08:24:52.1714344 +0800 CST m=+0.102940801
package docs
@ -558,7 +558,7 @@ var doc = `{
},
"/support/accessSystem/GetOrganizationList": {
"get": {
"description": "获取行政区划信息",
"description": "获取单位列表",
"consumes": [
"application/x-www-form-urlencoded"
],
@ -568,7 +568,7 @@ var doc = `{
"tags": [
"接入系统"
],
"summary": "获取行政区划信息",
"summary": "获取单位列表",
"parameters": [
{
"type": "integer",

@ -541,7 +541,7 @@
},
"/support/accessSystem/GetOrganizationList": {
"get": {
"description": "获取行政区划信息",
"description": "获取单位列表",
"consumes": [
"application/x-www-form-urlencoded"
],
@ -551,7 +551,7 @@
"tags": [
"接入系统"
],
"summary": "获取行政区划信息",
"summary": "获取单位列表",
"parameters": [
{
"type": "integer",

@ -688,7 +688,7 @@ paths:
get:
consumes:
- application/x-www-form-urlencoded
description: 获取行政区划信息
description: 获取单位列表
parameters:
- description: 第几页
in: query
@ -721,7 +721,7 @@ paths:
description: OK
schema:
$ref: '#/definitions/Model.Res'
summary: 获取行政区划信息
summary: 获取单位列表
tags:
- 接入系统
x-emptylimit:

Loading…
Cancel
Save