合并分支 'dev-v0.6.0' 到 'dev'
fix:返回合伙人为空 查看合并请求 !8
正在显示
6 个修改的文件
包含
15 行增加
和
13 行删除
@@ -19,7 +19,6 @@ import ( | @@ -19,7 +19,6 @@ import ( | ||
19 | "strings" | 19 | "strings" |
20 | ) | 20 | ) |
21 | 21 | ||
22 | -//TODO 用户信息返回合伙人编号 | ||
23 | func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) { | 22 | func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) { |
24 | var ( | 23 | var ( |
25 | partnerInfo *domain.PartnerInfo | 24 | partnerInfo *domain.PartnerInfo |
@@ -206,6 +205,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | @@ -206,6 +205,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | ||
206 | }() | 205 | }() |
207 | rsp = &protocol.UserInfoResponse{} | 206 | rsp = &protocol.UserInfoResponse{} |
208 | rspMap := make(map[string]interface{}) | 207 | rspMap := make(map[string]interface{}) |
208 | + | ||
209 | funcPartnerInfo := func() { | 209 | funcPartnerInfo := func() { |
210 | if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil { | 210 | if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil { |
211 | err = protocol.NewErrWithMessage(502, err) //账号不存在 | 211 | err = protocol.NewErrWithMessage(502, err) //账号不存在 |
@@ -247,8 +247,6 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | @@ -247,8 +247,6 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | ||
247 | }, | 247 | }, |
248 | } | 248 | } |
249 | 249 | ||
250 | - //TODO 获取合伙人分类 | ||
251 | - | ||
252 | //TODO 获取编号 | 250 | //TODO 获取编号 |
253 | for _, partnerCategoryInfo := range partnerInfo.PartnerCategoryInfos { | 251 | for _, partnerCategoryInfo := range partnerInfo.PartnerCategoryInfos { |
254 | if partnerCategoryInfo.Id == 1 { | 252 | if partnerCategoryInfo.Id == 1 { |
@@ -270,6 +268,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | @@ -270,6 +268,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | ||
270 | rspMap["user"] = u | 268 | rspMap["user"] = u |
271 | rsp = rspMap | 269 | rsp = rspMap |
272 | } | 270 | } |
271 | + | ||
273 | funcManagerInfo := func() { | 272 | funcManagerInfo := func() { |
274 | if user, err = UsersRepository.FindOne(map[string]interface{}{"id": header.UserId}); err != nil { | 273 | if user, err = UsersRepository.FindOne(map[string]interface{}{"id": header.UserId}); err != nil { |
275 | err = protocol.NewErrWithMessage(502, err) //账号不存在 | 274 | err = protocol.NewErrWithMessage(502, err) //账号不存在 |
@@ -291,6 +290,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | @@ -291,6 +290,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques | ||
291 | } | 290 | } |
292 | rsp = rspMap | 291 | rsp = rspMap |
293 | } | 292 | } |
293 | + | ||
294 | switch header.AdminType { | 294 | switch header.AdminType { |
295 | case int(protocolx.AdminTypePartner): | 295 | case int(protocolx.AdminTypePartner): |
296 | funcPartnerInfo() | 296 | funcPartnerInfo() |
@@ -11,10 +11,10 @@ var LOG_LEVEL = "debug" | @@ -11,10 +11,10 @@ var LOG_LEVEL = "debug" | ||
11 | var LOG_File = "app.log" | 11 | var LOG_File = "app.log" |
12 | 12 | ||
13 | var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897" | 13 | var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897" |
14 | -var UCENTER_SERVICE_HOST = "https://suplus-ucenter-dev.fjmaimaimai.com" | 14 | +var UCENTER_SERVICE_HOST = "https://suplus-ucenter-test.fjmaimaimai.com" |
15 | var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52" | 15 | var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52" |
16 | 16 | ||
17 | -var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-dev.fjmaimaimai.com" | 17 | +var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-test.fjmaimaimai.com" |
18 | var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块 | 18 | var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块 |
19 | 19 | ||
20 | var DEFAULT_GUEST_COMPANY int = 10011 | 20 | var DEFAULT_GUEST_COMPANY int = 10011 |
@@ -2,11 +2,11 @@ package constant | @@ -2,11 +2,11 @@ package constant | ||
2 | 2 | ||
3 | import "os" | 3 | import "os" |
4 | 4 | ||
5 | -var POSTGRESQL_DB_NAME = "partner_dev" //partner_test/partner_dev | ||
6 | -var POSTGRESQL_USER = "postgres" //postgres | ||
7 | -var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123/1993618jack | ||
8 | -var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1/114.55.200.59 | ||
9 | -var POSTGRESQL_PORT = "31543" //5432/31543 | 5 | +var POSTGRESQL_DB_NAME = "partner_test" //partner_test/partner_dev |
6 | +var POSTGRESQL_USER = "postgres" //postgres | ||
7 | +var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123/1993618jack | ||
8 | +var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1/114.55.200.59 | ||
9 | +var POSTGRESQL_PORT = "31543" //5432/31543 | ||
10 | var DISABLE_CREATE_TABLE = true | 10 | var DISABLE_CREATE_TABLE = true |
11 | var DISABLE_SQL_GENERATE_PRINT = false | 11 | var DISABLE_SQL_GENERATE_PRINT = false |
12 | 12 |
@@ -30,6 +30,8 @@ type PartnerInfo struct { | @@ -30,6 +30,8 @@ type PartnerInfo struct { | ||
30 | Salesman []*Salesman `json:"salesman"` | 30 | Salesman []*Salesman `json:"salesman"` |
31 | //合伙人分类信息 | 31 | //合伙人分类信息 |
32 | PartnerCategoryInfos []*PartnerCategoryInfo `partnerCategoryInfos` | 32 | PartnerCategoryInfos []*PartnerCategoryInfo `partnerCategoryInfos` |
33 | + //备注 | ||
34 | + Remark string `json:"remark"` | ||
33 | } | 35 | } |
34 | 36 | ||
35 | type PartnerInfoRepository interface { | 37 | type PartnerInfoRepository interface { |
@@ -97,7 +97,7 @@ func (dao *PartnerInfoDao) Partners(partnerIds []int64, queryOptions map[string] | @@ -97,7 +97,7 @@ func (dao *PartnerInfoDao) Partners(partnerIds []int64, queryOptions map[string] | ||
97 | filterPartners.WriteString(fmt.Sprintf(" and cooperate_time<to_timestamp(%v)", endTime)) | 97 | filterPartners.WriteString(fmt.Sprintf(" and cooperate_time<to_timestamp(%v)", endTime)) |
98 | } | 98 | } |
99 | if keyword, ok := queryOptions["keyword"]; ok && keyword.(string) != "" { | 99 | if keyword, ok := queryOptions["keyword"]; ok && keyword.(string) != "" { |
100 | - filterPartners.WriteString(fmt.Sprintf(` and partner_name LIKE '%v'`, fmt.Sprintf("%%%s%%", "%%" + keyword.(string) + "%"))) | 100 | + filterPartners.WriteString(fmt.Sprintf(` and partner_name LIKE '%v'`, fmt.Sprintf("%%%s%%", "%%"+keyword.(string)+"%"))) |
101 | } | 101 | } |
102 | 102 | ||
103 | sql.WriteString(fmt.Sprintf(` | 103 | sql.WriteString(fmt.Sprintf(` |
@@ -22,7 +22,6 @@ type PartnerInfo struct { | @@ -22,7 +22,6 @@ type PartnerInfo struct { | ||
22 | Status int `pg:",notnull,default:1"` | 22 | Status int `pg:",notnull,default:1"` |
23 | // 合伙类别 (1.研发合伙人 2.业务合伙人 3.事业) | 23 | // 合伙类别 (1.研发合伙人 2.业务合伙人 3.事业) |
24 | PartnerCategory int `pg:",notnull,default:1"` | 24 | PartnerCategory int `pg:",notnull,default:1"` |
25 | - | ||
26 | //所属区域信息 | 25 | //所属区域信息 |
27 | RegionInfo *domain.RegionInfo | 26 | RegionInfo *domain.RegionInfo |
28 | //合作时间 | 27 | //合作时间 |
@@ -31,9 +30,10 @@ type PartnerInfo struct { | @@ -31,9 +30,10 @@ type PartnerInfo struct { | ||
31 | CreateAt time.Time | 30 | CreateAt time.Time |
32 | //更新时间 | 31 | //更新时间 |
33 | UpdateAt time.Time | 32 | UpdateAt time.Time |
34 | - | ||
35 | //关联业务员 | 33 | //关联业务员 |
36 | Salesman []*domain.Salesman | 34 | Salesman []*domain.Salesman |
37 | //合伙人分类信息 | 35 | //合伙人分类信息 |
38 | PartnerCategoryInfos []*PartnerCategoryInfo | 36 | PartnerCategoryInfos []*PartnerCategoryInfo |
37 | + //备注 | ||
38 | + Remark string | ||
39 | } | 39 | } |
-
请 注册 或 登录 后发表评论