作者 tangxuhui
@@ -75,7 +75,8 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat @@ -75,7 +75,8 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
75 resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{ 75 resultApplications, err := creationCooperationGateway.CooperationApplicationsSearch(allied_creation_cooperation.ReqCooperationApplicationSearch{
76 PageNumber: applicationQuery.PageNumber, 76 PageNumber: applicationQuery.PageNumber,
77 PageSize: applicationQuery.PageSize, 77 PageSize: applicationQuery.PageSize,
78 - CompanyId: int(applicationQuery.Operator.CompanyId), 78 + //CompanyId: int(applicationQuery.Operator.CompanyId),
  79 + OrgId: applicationQuery.Operator.OrgId,
79 CooperationApplicationStatus: applicationQuery.Status, 80 CooperationApplicationStatus: applicationQuery.Status,
80 }) 81 })
81 for i := 0; i < len(resultApplications.Grid.List); i++ { 82 for i := 0; i < len(resultApplications.Grid.List); i++ {
@@ -110,7 +110,7 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery @@ -110,7 +110,7 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
110 PageNumber: projectQuery.PageNumber, 110 PageNumber: projectQuery.PageNumber,
111 PageSize: projectQuery.PageSize, 111 PageSize: projectQuery.PageSize,
112 OrgId: projectQuery.OrgId, 112 OrgId: projectQuery.OrgId,
113 - UserBaseId: projectQuery.Operator.UserBaseId, 113 + //UserBaseId: projectQuery.Operator.UserBaseId,
114 }) 114 })
115 if err != nil { 115 if err != nil {
116 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 116 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -18,6 +18,8 @@ type ChangePasswordCommand struct { @@ -18,6 +18,8 @@ type ChangePasswordCommand struct {
18 SmsCode string `cname:"短信验证码" json:"smsCode" valid:"Required"` 18 SmsCode string `cname:"短信验证码" json:"smsCode" valid:"Required"`
19 // 新密码 19 // 新密码
20 NewPassword string `cname:"新密码" json:"newPassword" valid:"Required"` 20 NewPassword string `cname:"新密码" json:"newPassword" valid:"Required"`
  21 + // 旧密码
  22 + OldPassword string `cname:"旧密码" json:"oldPassword" valid:"Required"`
21 } 23 }
22 24
23 func (phoneAuthChangePasswordCommand *ChangePasswordCommand) Valid(validation *validation.Validation) { 25 func (phoneAuthChangePasswordCommand *ChangePasswordCommand) Valid(validation *validation.Validation) {
@@ -52,6 +52,18 @@ func (srv UserService) CheckSmsCode(smsCodeCommand *command.CheckSmsCodeCommand) @@ -52,6 +52,18 @@ func (srv UserService) CheckSmsCode(smsCodeCommand *command.CheckSmsCodeCommand)
52 //ChangePassword 修改密码 52 //ChangePassword 修改密码
53 func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePasswordCommand) (interface{}, error) { 53 func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePasswordCommand) (interface{}, error) {
54 smsServeGateway := sms_serve.NewHttplibHttplibSmsServe() 54 smsServeGateway := sms_serve.NewHttplibHttplibSmsServe()
  55 + if len(changePasswordCommand.OldPassword) > 0 {
  56 + // 2.重置密码
  57 + creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
  58 + _, err := creationUserGateway.AuthChangePassword(allied_creation_user.ReqAuthChangePassword{
  59 + OldPassword: changePasswordCommand.OldPassword,
  60 + NewPassword: changePasswordCommand.NewPassword,
  61 + UserId: changePasswordCommand.Operator.UserId,
  62 + })
  63 + if err != nil {
  64 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
  65 + }
  66 + } else {
55 err := smsServeGateway.CheckSmsCode(changePasswordCommand.Phone, changePasswordCommand.SmsCode) 67 err := smsServeGateway.CheckSmsCode(changePasswordCommand.Phone, changePasswordCommand.SmsCode)
56 if err != nil { 68 if err != nil {
57 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 69 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -65,7 +77,9 @@ func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePassw @@ -65,7 +77,9 @@ func (srv UserService) ChangePassword(changePasswordCommand *command.ChangePassw
65 if err != nil { 77 if err != nil {
66 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 78 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
67 } 79 }
68 - return changePasswordCommand, nil 80 + }
  81 +
  82 + return struct{}{}, nil
69 } 83 }
70 84
71 //ChangePhone 修改手机号 85 //ChangePhone 修改手机号
@@ -20,7 +20,7 @@ type ( @@ -20,7 +20,7 @@ type (
20 ReqAuthChangePassword struct { 20 ReqAuthChangePassword struct {
21 NewPassword string `json:"newPassword"` 21 NewPassword string `json:"newPassword"`
22 OldPassword string `json:"oldPassword"` 22 OldPassword string `json:"oldPassword"`
23 - UserId string `json:"userId"` 23 + UserId int64 `json:"userId"`
24 } 24 }
25 25
26 DataAuthChangePassword struct { 26 DataAuthChangePassword struct {