...
|
...
|
@@ -19,7 +19,7 @@ import ( |
|
|
"strings"
|
|
|
)
|
|
|
|
|
|
//用户信息
|
|
|
//TODO 用户信息返回合伙人编号
|
|
|
func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) (rsp *protocol.UserInfoResponse, err error) {
|
|
|
var (
|
|
|
partnerInfo *domain.PartnerInfo
|
...
|
...
|
@@ -37,6 +37,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
|
|
|
rsp = &protocol.UserInfoResponse{}
|
|
|
|
|
|
funcPartnerInfo := func() {
|
...
|
...
|
@@ -47,6 +48,7 @@ func UserInfo(header *protocol.RequestHeader, request *protocol.UserInfoRequest) |
|
|
if company, err = CompanyRepository.FindOne(map[string]interface{}{"id": header.CompanyId}); err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
rsp.User = protocol.User{
|
|
|
Id: partnerInfo.Id,
|
|
|
PartnerName: partnerInfo.PartnerName,
|
...
|
...
|
@@ -231,15 +233,35 @@ func UserInfoV2(header *protocol.RequestHeader, request *protocol.UserInfoReques |
|
|
PartnerName: partnerInfo.PartnerName,
|
|
|
Phone: partnerInfo.Account,
|
|
|
CooperateCompany: userx.Company{
|
|
|
Id: company.Id,
|
|
|
Name: company.Name,
|
|
|
Phone: company.Phone,
|
|
|
SerialNo: partnerInfo.Id,
|
|
|
CooperateTime: partnerInfo.CooperateTime.Unix() * 1000,
|
|
|
MiniProgram: miniProgram,
|
|
|
District: map[string]interface{}{"id": partnerInfo.RegionInfo.RegionId, "name": partnerInfo.RegionInfo.RegionName},
|
|
|
Id: company.Id,
|
|
|
Name: company.Name,
|
|
|
Phone: company.Phone,
|
|
|
//SerialNo: partnerInfo.Id,
|
|
|
CareerSerialNo: "",
|
|
|
BusinessSerialNo: "",
|
|
|
DevelopSerialNo: "",
|
|
|
AppSerialNo: "",
|
|
|
CooperateTime: partnerInfo.CooperateTime.Unix() * 1000,
|
|
|
MiniProgram: miniProgram,
|
|
|
District: map[string]interface{}{"id": partnerInfo.RegionInfo.RegionId, "name": partnerInfo.RegionInfo.RegionName},
|
|
|
},
|
|
|
}
|
|
|
|
|
|
//TODO 获取合伙人分类
|
|
|
|
|
|
//TODO 获取编号
|
|
|
for _, partnerCategoryInfo := range partnerInfo.PartnerCategoryInfos {
|
|
|
if partnerCategoryInfo.Id == 1 {
|
|
|
u.CooperateCompany.CareerSerialNo = partnerCategoryInfo.Code
|
|
|
} else if partnerCategoryInfo.Id == 2 {
|
|
|
u.CooperateCompany.BusinessSerialNo = partnerCategoryInfo.Code
|
|
|
} else if partnerCategoryInfo.Id == 3 {
|
|
|
u.CooperateCompany.DevelopSerialNo = partnerCategoryInfo.Code
|
|
|
} else if partnerCategoryInfo.Id == 4 {
|
|
|
u.CooperateCompany.AppSerialNo = partnerCategoryInfo.Code
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if len(partnerInfo.Salesman) > 0 {
|
|
|
u.CooperateCompany.Salesman = map[string]interface{}{"uname": partnerInfo.Salesman[0].Name, "phone": partnerInfo.Salesman[0].Telephone}
|
|
|
} else {
|
...
|
...
|
|