作者 tangxuhui
@@ -13,7 +13,7 @@ type CreateCooperationProjectCommand struct { @@ -13,7 +13,7 @@ type CreateCooperationProjectCommand struct {
13 // 模式编码,唯一确定 13 // 模式编码,唯一确定
14 CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"` 14 CooperationModeNumber string `json:"cooperationModeNumber" valid:"Required"`
15 // 发起组织ID 15 // 发起组织ID
16 - OrgId int64 `json:"departmentId" valid:"Required"` 16 + OrgId int `json:"departmentId" valid:"Required"`
17 // 共创项目名称 17 // 共创项目名称
18 CooperationProjectName string `json:"cooperationProjectName" valid:"Required"` 18 CooperationProjectName string `json:"cooperationProjectName" valid:"Required"`
19 // 共创发起人id 19 // 共创发起人id
@@ -35,7 +35,7 @@ type CreditAccountItem struct { @@ -35,7 +35,7 @@ type CreditAccountItem struct {
35 Company domain.CompanyData `json:"company"` // 公司 35 Company domain.CompanyData `json:"company"` // 公司
36 CreatedAt int64 `json:"createdAt"` // 创建时间 36 CreatedAt int64 `json:"createdAt"` // 创建时间
37 UpdatedAt int64 `json:"updatedAt"` // 更新时间 37 UpdatedAt int64 `json:"updatedAt"` // 更新时间
38 - AccountDetail []struct { 38 + AccountDetail struct {
39 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` 39 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
40 DividendsType int `json:"dividendsType"` 40 DividendsType int `json:"dividendsType"`
41 DividendsAmount float64 `json:"dividendsAmount"` 41 DividendsAmount float64 `json:"dividendsAmount"`
@@ -41,6 +41,9 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application @@ -41,6 +41,9 @@ func (srv CooperationApplicationsService) GetCooperationApplications(application
41 resultApplication.CooperationProject.CooperationMode.CooperationModeNumber = resultProject.CooperationMode.CooperationModeNumber 41 resultApplication.CooperationProject.CooperationMode.CooperationModeNumber = resultProject.CooperationMode.CooperationModeNumber
42 resultApplication.CooperationProject.CooperationMode.CooperationModeName = resultProject.CooperationMode.CooperationModeName 42 resultApplication.CooperationProject.CooperationMode.CooperationModeName = resultProject.CooperationMode.CooperationModeName
43 resultApplication.CooperationProject.CooperationMode.CooperationModeId = resultProject.CooperationMode.CooperationModeId 43 resultApplication.CooperationProject.CooperationMode.CooperationModeId = resultProject.CooperationMode.CooperationModeId
  44 +
  45 + resultApplication.Department.DepartmentID = resultApplication.Org.OrgID
  46 + resultApplication.Department.DepartmentName = resultApplication.Org.OrgName
44 return resultApplication, nil 47 return resultApplication, nil
45 } 48 }
46 49
@@ -75,6 +78,10 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat @@ -75,6 +78,10 @@ func (srv CooperationApplicationsService) SearchCooperationApplications(applicat
75 CompanyId: int(applicationQuery.Operator.CompanyId), 78 CompanyId: int(applicationQuery.Operator.CompanyId),
76 CooperationApplicationStatus: applicationQuery.Status, 79 CooperationApplicationStatus: applicationQuery.Status,
77 }) 80 })
  81 + for i := 0; i < len(resultApplications.Grid.List); i++ {
  82 + resultApplications.Grid.List[i].Department.DepartmentID = resultApplications.Grid.List[i].Org.OrgID
  83 + resultApplications.Grid.List[i].Department.DepartmentName = resultApplications.Grid.List[i].Org.OrgName
  84 + }
78 if err != nil { 85 if err != nil {
79 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 86 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
80 } 87 }
@@ -27,6 +27,7 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -27,6 +27,7 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
27 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor, 27 SponsorUid: createCooperationProjectCommand.CooperationProjectSponsor,
28 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType, 28 CooperationProjectUndertakerType: createCooperationProjectCommand.CooperationProjectUndertakerType,
29 Attachment: createCooperationProjectCommand.Attachment, 29 Attachment: createCooperationProjectCommand.Attachment,
  30 + DepartmentId: createCooperationProjectCommand.OrgId,
30 }) 31 })
31 32
32 if err != nil { 33 if err != nil {
@@ -92,6 +93,7 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm @@ -92,6 +93,7 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
92 PageNumber: projectQuery.PageNumber, 93 PageNumber: projectQuery.PageNumber,
93 PageSize: projectQuery.PageSize, 94 PageSize: projectQuery.PageSize,
94 Status: int(projectQuery.Status), 95 Status: int(projectQuery.Status),
  96 + OrgId: projectQuery.Operator.OrgId,
95 }) 97 })
96 if err != nil { 98 if err != nil {
97 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 99 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -19,6 +19,7 @@ func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAc @@ -19,6 +19,7 @@ func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAc
19 PageNumber: cmd.PageNumber, 19 PageNumber: cmd.PageNumber,
20 PageSize: cmd.PageSize, 20 PageSize: cmd.PageSize,
21 PaymentStatus: cmd.PaymentStatus, 21 PaymentStatus: cmd.PaymentStatus,
  22 + OrgId: cmd.Operator.OrgId,
22 }) 23 })
23 if err != nil { 24 if err != nil {
24 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 25 return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -13,7 +13,7 @@ type UpdateUserInfoCommand struct { @@ -13,7 +13,7 @@ type UpdateUserInfoCommand struct {
13 //操作人 13 //操作人
14 Operator domain.Operator `json:"-"` 14 Operator domain.Operator `json:"-"`
15 // 头像 15 // 头像
16 - Avatar string `cname:"头像" json:"avatar" valid:"Required"` 16 + Avatar string `cname:"头像" json:"avatar"`
17 // 用户姓名 17 // 用户姓名
18 UserName string `cname:"用户姓名" json:"userName" valid:"Required"` 18 UserName string `cname:"用户姓名" json:"userName" valid:"Required"`
19 // 邮箱 19 // 邮箱
@@ -100,7 +100,9 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU @@ -100,7 +100,9 @@ func (srv UserService) UpdateUserBaseInfo(updateUserInfoCommand *command.UpdateU
100 if err != nil { 100 if err != nil {
101 return nil, application.ThrowError(application.BUSINESS_ERROR, "用户不存在") 101 return nil, application.ThrowError(application.BUSINESS_ERROR, "用户不存在")
102 } 102 }
103 - 103 + if _, ok := updateUserInfoCommand.BodyKV["avatar"]; !ok {
  104 + updateUserInfoCommand.Avatar = user.UserInfo.Avatar
  105 + }
104 if _, ok := updateUserInfoCommand.BodyKV["email"]; !ok { 106 if _, ok := updateUserInfoCommand.BodyKV["email"]; !ok {
105 updateUserInfoCommand.Email = user.UserInfo.Email 107 updateUserInfoCommand.Email = user.UserInfo.Email
106 } 108 }
@@ -25,10 +25,10 @@ type CreditAccountItem struct { @@ -25,10 +25,10 @@ type CreditAccountItem struct {
25 OrgID int `json:"orgId,string"` 25 OrgID int `json:"orgId,string"`
26 OrgName string `json:"orgName"` 26 OrgName string `json:"orgName"`
27 } `json:"org"` // 数据所属组织机构 27 } `json:"org"` // 数据所属组织机构
28 - Company domain.CompanyData `json:"company"` // 公司 28 + Company domain.CompanyData `json:"company11"` // TODO:暂时不需要公司
29 CreatedAt int64 `json:"createdAt"` // 创建时间 29 CreatedAt int64 `json:"createdAt"` // 创建时间
30 UpdatedAt int64 `json:"updatedAt"` // 更新时间 30 UpdatedAt int64 `json:"updatedAt"` // 更新时间
31 - AccountDetail []struct { 31 + AccountDetail struct {
32 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` 32 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
33 DividendsType int `json:"dividendsType"` 33 DividendsType int `json:"dividendsType"`
34 DividendsAmount float64 `json:"dividendsAmount"` 34 DividendsAmount float64 `json:"dividendsAmount"`
@@ -195,7 +195,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co @@ -195,7 +195,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
195 //数据转换 195 //数据转换
196 cnt := int64(result.Count) 196 cnt := int64(result.Count)
197 var ( 197 var (
198 - listData []dto.CompanyUserItem 198 + listData = make([]dto.CompanyUserItem, 0)
199 item dto.CompanyUserItem 199 item dto.CompanyUserItem
200 ) 200 )
201 for _, v := range result.Users { 201 for _, v := range result.Users {
@@ -374,7 +374,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery * @@ -374,7 +374,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
374 InOrgIds: cooperationUserListQuery.Operator.OrgIds, 374 InOrgIds: cooperationUserListQuery.Operator.OrgIds,
375 }) 375 })
376 var ( 376 var (
377 - listData []dto.CooperationUserItem 377 + listData = make([]dto.CooperationUserItem, 0)
378 item dto.CooperationUserItem 378 item dto.CooperationUserItem
379 ) 379 )
380 cnt := result.Count 380 cnt := result.Count
@@ -57,6 +57,10 @@ type CooperationApplication struct { @@ -57,6 +57,10 @@ type CooperationApplication struct {
57 OrgID int `json:"orgId"` 57 OrgID int `json:"orgId"`
58 OrgName string `json:"orgName"` 58 OrgName string `json:"orgName"`
59 } `json:"org"` 59 } `json:"org"`
  60 + Department struct {
  61 + DepartmentID int `json:"departmentId"`
  62 + DepartmentName string `json:"departmentName"`
  63 + } `json:"department"`
60 IsCanceled bool `json:"isCanceled"` 64 IsCanceled bool `json:"isCanceled"`
61 Company struct { 65 Company struct {
62 CompanyID int `json:"companyId"` 66 CompanyID int `json:"companyId"`
@@ -38,10 +38,10 @@ type CreditAccount struct { @@ -38,10 +38,10 @@ type CreditAccount struct {
38 OrgID int `json:"orgId,string"` 38 OrgID int `json:"orgId,string"`
39 OrgName string `json:"orgName"` 39 OrgName string `json:"orgName"`
40 } `json:"org"` // 数据所属组织机构 40 } `json:"org"` // 数据所属组织机构
41 - Company domain.CompanyData `json:"company"` // 公司 41 + Company domain.CompanyData `json:"company1"` // 公司
42 CreatedAt time.Time `json:"createdAt"` // 创建时间 42 CreatedAt time.Time `json:"createdAt"` // 创建时间
43 UpdatedAt time.Time `json:"updatedAt"` // 更新时间 43 UpdatedAt time.Time `json:"updatedAt"` // 更新时间
44 - AccountDetail []struct { 44 + AccountDetail struct {
45 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` 45 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
46 DividendsType int `json:"dividendsType"` 46 DividendsType int `json:"dividendsType"`
47 DividendsAmount float64 `json:"dividendsAmount"` 47 DividendsAmount float64 `json:"dividendsAmount"`
@@ -76,6 +76,16 @@ type ( @@ -76,6 +76,16 @@ type (
76 PaymentStatus int32 `json:"paymentStatus" valid:"Required"` 76 PaymentStatus int32 `json:"paymentStatus" valid:"Required"`
77 // 结算周期,按年“2021”或者按月结算”2021-07“ 77 // 结算周期,按年“2021”或者按月结算”2021-07“
78 Period time.Time `json:"period,omitempty"` 78 Period time.Time `json:"period,omitempty"`
  79 + // 公司ID,通过集成REST上下文获取
  80 + CompanyId int64 `cname:"公司ID" json:"companyId"`
  81 + // 组织机构ID
  82 + OrgId int64 `cname:"组织机构ID" json:"orgId"`
  83 + // 关联的组织机构ID列表
  84 + OrgIds []int64 `cname:"关联的组织机构ID列表" json:"orgIds"`
  85 + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
  86 + UserId int64 `cname:"用户ID" json:"userId"`
  87 + // 用户基础数据id
  88 + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId"`
79 } 89 }
80 90
81 DataCreditAccountsSearch struct { 91 DataCreditAccountsSearch struct {