作者 陈志颖

fix:修复共创申请人编号

@@ -65,7 +65,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -65,7 +65,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
65 // 获取申请人 65 // 获取申请人
66 var applicant *domain.User 66 var applicant *domain.User
67 if data, err := userService.UserFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserId); err != nil { 67 if data, err := userService.UserFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId, applyForCooperationCommand.UserId); err != nil {
68 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 68 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取申请人失败")
69 } else { 69 } else {
70 applicant = data 70 applicant = data
71 } 71 }
@@ -81,7 +81,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -81,7 +81,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
81 // 获取公司信息 81 // 获取公司信息
82 var company *domain.Company 82 var company *domain.Company
83 if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil { 83 if data, err := companyService.CompanyFrom(applyForCooperationCommand.CompanyId); err != nil {
84 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 84 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取公司信息失败")
85 } else { 85 } else {
86 company = data 86 company = data
87 } 87 }
@@ -97,7 +97,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop @@ -97,7 +97,7 @@ func (cooperationApplicationService *CooperationApplicationService) ApplyForCoop
97 // 获取组织机构信息 97 // 获取组织机构信息
98 var organization *domain.Org 98 var organization *domain.Org
99 if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil { 99 if data, err := organizationService.OrgFrom(applyForCooperationCommand.CompanyId, applyForCooperationCommand.OrgId); err != nil {
100 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 100 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取组织机构数据失败")
101 } else { 101 } else {
102 organization = data 102 organization = data
103 } 103 }
@@ -13,5 +13,5 @@ type UserInfo struct { @@ -13,5 +13,5 @@ type UserInfo struct {
13 // 用户账号,区别于手机号,冗余字段 13 // 用户账号,区别于手机号,冗余字段
14 UserAccount string `json:"userAccount"` 14 UserAccount string `json:"userAccount"`
15 // 用户编码 15 // 用户编码
16 - UserCode string `json:"用户编码"` 16 + UserCode string `json:"userCode"`
17 } 17 }
@@ -74,7 +74,7 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) @@ -74,7 +74,7 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail)
74 var roles []*domain.Role 74 var roles []*domain.Role
75 for _, role := range user.UserRole { 75 for _, role := range user.UserRole {
76 roles = append(roles, &domain.Role{ 76 roles = append(roles, &domain.Role{
77 - RoleId: int64(role.RoleID), 77 + RoleId: role.RoleID,
78 RoleName: role.RoleName, 78 RoleName: role.RoleName,
79 }) 79 })
80 } 80 }
@@ -104,6 +104,7 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) @@ -104,6 +104,7 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail)
104 UserName: user.UserInfo.UserName, 104 UserName: user.UserInfo.UserName,
105 UserPhone: user.UserInfo.Phone, 105 UserPhone: user.UserInfo.Phone,
106 UserAccount: "", 106 UserAccount: "",
  107 + UserCode: user.UserCode,
107 }, 108 },
108 UserType: user.UserType, 109 UserType: user.UserType,
109 UserName: user.UserInfo.UserName, 110 UserName: user.UserInfo.UserName,
@@ -269,6 +270,7 @@ func (translator *UserTranslator) ToSalesmanFromRepresentation(user *UserDetail) @@ -269,6 +270,7 @@ func (translator *UserTranslator) ToSalesmanFromRepresentation(user *UserDetail)
269 UserName: user.UserInfo.UserName, 270 UserName: user.UserInfo.UserName,
270 UserPhone: user.UserInfo.Phone, 271 UserPhone: user.UserInfo.Phone,
271 UserAccount: "", 272 UserAccount: "",
  273 + UserCode: user.UserCode,
272 }, 274 },
273 UserType: user.UserType, 275 UserType: user.UserType,
274 UserName: user.UserInfo.UserName, 276 UserName: user.UserInfo.UserName,
@@ -316,6 +318,7 @@ func (translator *UserTranslator) ToOperatorFromRepresentation(user *UserDetail) @@ -316,6 +318,7 @@ func (translator *UserTranslator) ToOperatorFromRepresentation(user *UserDetail)
316 UserName: user.UserInfo.UserName, 318 UserName: user.UserInfo.UserName,
317 UserPhone: user.UserInfo.Phone, 319 UserPhone: user.UserInfo.Phone,
318 UserAvatar: user.UserInfo.Avatar, 320 UserAvatar: user.UserInfo.Avatar,
  321 + UserCode: user.UserCode,
319 }, 322 },
320 UserType: user.UserType, 323 UserType: user.UserType,
321 UserName: user.UserInfo.UserName, 324 UserName: user.UserInfo.UserName,
@@ -369,6 +372,7 @@ func (translator *UserTranslator) ToUserFromRepresentation(user *UserDetail) (*d @@ -369,6 +372,7 @@ func (translator *UserTranslator) ToUserFromRepresentation(user *UserDetail) (*d
369 UserName: user.UserInfo.UserName, 372 UserName: user.UserInfo.UserName,
370 UserPhone: user.UserInfo.Phone, 373 UserPhone: user.UserInfo.Phone,
371 UserAvatar: user.UserInfo.Avatar, 374 UserAvatar: user.UserInfo.Avatar,
  375 + UserCode: user.UserCode,
372 }, 376 },
373 UserType: user.UserType, 377 UserType: user.UserType,
374 UserName: user.UserInfo.UserName, 378 UserName: user.UserInfo.UserName,