作者 陈志颖

合并分支 'dev' 到 'test'

Dev



查看合并请求 !9
... ... @@ -19,7 +19,6 @@ import (
"strings"
)
//TODO 用户信息返回合伙人编号
func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) {
var (
partnerInfo *domain.PartnerInfo
... ... @@ -206,6 +205,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques
}()
rsp = &protocol.UserInfoResponse{}
rspMap := make(map[string]interface{})
funcPartnerInfo := func() {
if partnerInfo, err = PartnerInfoService.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
err = protocol.NewErrWithMessage(502, err) //账号不存在
... ... @@ -247,8 +247,6 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques
},
}
//TODO 获取合伙人分类
//TODO 获取编号
for _, partnerCategoryInfo := range partnerInfo.PartnerCategoryInfos {
if partnerCategoryInfo.Id == 1 {
... ... @@ -270,6 +268,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques
rspMap["user"] = u
rsp = rspMap
}
funcManagerInfo := func() {
if user, err = UsersRepository.FindOne(map[string]interface{}{"id": header.UserId}); err != nil {
err = protocol.NewErrWithMessage(502, err) //账号不存在
... ... @@ -291,6 +290,7 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques
}
rsp = rspMap
}
switch header.AdminType {
case int(protocolx.AdminTypePartner):
funcPartnerInfo()
... ...
... ... @@ -11,10 +11,10 @@ var LOG_LEVEL = "debug"
var LOG_File = "app.log"
var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897"
var UCENTER_SERVICE_HOST = "https://suplus-ucenter-dev.fjmaimaimai.com"
var UCENTER_SERVICE_HOST = "https://suplus-ucenter-test.fjmaimaimai.com"
var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52"
var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-dev.fjmaimaimai.com"
var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-test.fjmaimaimai.com"
var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块
var DEFAULT_GUEST_COMPANY int = 10011
... ...
... ... @@ -2,7 +2,7 @@ package constant
import "os"
var POSTGRESQL_DB_NAME = "partner_dev" //partner_test/partner_dev
var POSTGRESQL_DB_NAME = "partner_test" //partner_test/partner_dev
var POSTGRESQL_USER = "postgres" //postgres
var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123/1993618jack
var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1/114.55.200.59
... ...
... ... @@ -30,6 +30,8 @@ type PartnerInfo struct {
Salesman []*Salesman `json:"salesman"`
//合伙人分类信息
PartnerCategoryInfos []*PartnerCategoryInfo `partnerCategoryInfos`
//备注
Remark string `json:"remark"`
}
type PartnerInfoRepository interface {
... ...
... ... @@ -97,7 +97,7 @@ func (dao *PartnerInfoDao) Partners(partnerIds []int64, queryOptions map[string]
filterPartners.WriteString(fmt.Sprintf(" and cooperate_time<to_timestamp(%v)", endTime))
}
if keyword, ok := queryOptions["keyword"]; ok && keyword.(string) != "" {
filterPartners.WriteString(fmt.Sprintf(` and partner_name LIKE '%v'`, fmt.Sprintf("%%%s%%", "%%" + keyword.(string) + "%")))
filterPartners.WriteString(fmt.Sprintf(` and partner_name LIKE '%v'`, fmt.Sprintf("%%%s%%", "%%"+keyword.(string)+"%")))
}
sql.WriteString(fmt.Sprintf(`
... ...
... ... @@ -22,7 +22,6 @@ type PartnerInfo struct {
Status int `pg:",notnull,default:1"`
// 合伙类别 (1.研发合伙人 2.业务合伙人 3.事业)
PartnerCategory int `pg:",notnull,default:1"`
//所属区域信息
RegionInfo *domain.RegionInfo
//合作时间
... ... @@ -31,9 +30,10 @@ type PartnerInfo struct {
CreateAt time.Time
//更新时间
UpdateAt time.Time
//关联业务员
Salesman []*domain.Salesman
//合伙人分类信息
PartnerCategoryInfos []*PartnerCategoryInfo
//备注
Remark string
}
... ...