正在显示
16 个修改的文件
包含
80 行增加
和
55 行删除
@@ -10,21 +10,21 @@ import ( | @@ -10,21 +10,21 @@ import ( | ||
10 | 10 | ||
11 | type SearchCooperationContractQuery struct { | 11 | type SearchCooperationContractQuery struct { |
12 | // 页面大小 | 12 | // 页面大小 |
13 | - PageSize int64 `cname:"页面大小" json:"pageSize" valid:"Required"` | 13 | + PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` |
14 | // 页面大小 | 14 | // 页面大小 |
15 | - PageNumber int64 `cname:"页面大小" json:"pageNumber" valid:"Required"` | 15 | + PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` |
16 | // 共创合约编号 | 16 | // 共创合约编号 |
17 | - CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"` | 17 | + CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber,omitempty"` |
18 | // 发起人姓名 | 18 | // 发起人姓名 |
19 | SponsorName string `cname:"发起人姓名" json:"sponsorName,omitempty"` | 19 | SponsorName string `cname:"发起人姓名" json:"sponsorName,omitempty"` |
20 | // 公司ID,通过集成REST上下文获取 | 20 | // 公司ID,通过集成REST上下文获取 |
21 | - CompanyId int64 `cname:"公司ID,通过集成REST上下文获取" json:"companyId,string" valid:"Required"` | 21 | + CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"` |
22 | // 组织机构ID | 22 | // 组织机构ID |
23 | OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"` | 23 | OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"` |
24 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | 24 | // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 |
25 | - UserId int64 `cname:"用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员" json:"userId,string" valid:"Required"` | 25 | + UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"` |
26 | // 用户基础数据id | 26 | // 用户基础数据id |
27 | - UserBaseId int64 `cname:"用户基础数据is" json:"userBaseId,string" valid:"Required"` | 27 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"` |
28 | } | 28 | } |
29 | 29 | ||
30 | func (searchCooperationContractQuery *SearchCooperationContractQuery) Valid(validation *validation.Validation) { | 30 | func (searchCooperationContractQuery *SearchCooperationContractQuery) Valid(validation *validation.Validation) { |
@@ -394,10 +394,27 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC | @@ -394,10 +394,27 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC | ||
394 | defer func() { | 394 | defer func() { |
395 | _ = transactionContext.RollbackTransaction() | 395 | _ = transactionContext.RollbackTransaction() |
396 | }() | 396 | }() |
397 | - if err := transactionContext.CommitTransaction(); err != nil { | ||
398 | - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 397 | + var cooperationContractRepository domain.CooperationContractRepository |
398 | + if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{ | ||
399 | + "transactionContext": transactionContext, | ||
400 | + }); err != nil { | ||
401 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
402 | + } else { | ||
403 | + cooperationContractRepository = value | ||
404 | + } | ||
405 | + if count, cooperationContracts, err := cooperationContractRepository.Find(tool_funs.SimpleStructToMap(searchCooperationContractQuery)); err != nil { | ||
406 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
407 | + } else { | ||
408 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
409 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
410 | + } | ||
411 | + return map[string]interface{}{ | ||
412 | + "grid": map[string]interface{}{ | ||
413 | + "total": count, | ||
414 | + "list": cooperationContracts, | ||
415 | + }, | ||
416 | + }, nil | ||
399 | } | 417 | } |
400 | - return nil, nil | ||
401 | } | 418 | } |
402 | 419 | ||
403 | // SearchCooperationContractByUndertaker 根据承接人返回共创项目合约 | 420 | // SearchCooperationContractByUndertaker 根据承接人返回共创项目合约 |
@@ -88,12 +88,6 @@ func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data ma | @@ -88,12 +88,6 @@ func (cooperationContractChangeLog *CooperationContractChangeLog) Update(data ma | ||
88 | if departmentNumber, ok := data["departmentNumber"]; ok { | 88 | if departmentNumber, ok := data["departmentNumber"]; ok { |
89 | cooperationContractChangeLog.Operator.Department.DepartmentNumber = departmentNumber.(string) | 89 | cooperationContractChangeLog.Operator.Department.DepartmentNumber = departmentNumber.(string) |
90 | } | 90 | } |
91 | - if roleId, ok := data["roleId"]; ok { | ||
92 | - cooperationContractChangeLog.Operator.Role.RoleId = roleId.(int64) | ||
93 | - } | ||
94 | - if roleName, ok := data["roleName"]; ok { | ||
95 | - cooperationContractChangeLog.Operator.Role.RoleName = roleName.(string) | ||
96 | - } | ||
97 | if userAvatar, ok := data["userAvatar"]; ok { | 91 | if userAvatar, ok := data["userAvatar"]; ok { |
98 | cooperationContractChangeLog.Operator.UserInfo.UserAvatar = userAvatar.(string) | 92 | cooperationContractChangeLog.Operator.UserInfo.UserAvatar = userAvatar.(string) |
99 | } | 93 | } |
@@ -105,12 +105,6 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{} | @@ -105,12 +105,6 @@ func (cooperationProject *CooperationProject) Update(data map[string]interface{} | ||
105 | if isOrganization, ok := data["isOrganization"]; ok { | 105 | if isOrganization, ok := data["isOrganization"]; ok { |
106 | cooperationProject.CooperationProjectPublisher.Department.IsOrganization = isOrganization.(bool) | 106 | cooperationProject.CooperationProjectPublisher.Department.IsOrganization = isOrganization.(bool) |
107 | } | 107 | } |
108 | - if roleId, ok := data["roleId"]; ok { | ||
109 | - cooperationProject.CooperationProjectPublisher.Role.RoleId = roleId.(int64) | ||
110 | - } | ||
111 | - if roleName, ok := data["roleName"]; ok { | ||
112 | - cooperationProject.CooperationProjectPublisher.Role.RoleName = roleName.(string) | ||
113 | - } | ||
114 | if userAvatar, ok := data["userAvatar"]; ok { | 108 | if userAvatar, ok := data["userAvatar"]; ok { |
115 | cooperationProject.CooperationProjectPublisher.UserInfo.UserAvatar = userAvatar.(string) | 109 | cooperationProject.CooperationProjectPublisher.UserInfo.UserAvatar = userAvatar.(string) |
116 | } | 110 | } |
@@ -118,12 +118,6 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) | @@ -118,12 +118,6 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) | ||
118 | if isOrganization, ok := data["isOrganization"]; ok { | 118 | if isOrganization, ok := data["isOrganization"]; ok { |
119 | dividendsEstimate.DividendsUser.Department.IsOrganization = isOrganization.(bool) | 119 | dividendsEstimate.DividendsUser.Department.IsOrganization = isOrganization.(bool) |
120 | } | 120 | } |
121 | - if roleId, ok := data["roleId"]; ok { | ||
122 | - dividendsEstimate.DividendsUser.Role.RoleId = roleId.(int64) | ||
123 | - } | ||
124 | - if roleName, ok := data["roleName"]; ok { | ||
125 | - dividendsEstimate.DividendsUser.Role.RoleName = roleName.(string) | ||
126 | - } | ||
127 | if userAvatar, ok := data["userAvatar"]; ok { | 121 | if userAvatar, ok := data["userAvatar"]; ok { |
128 | dividendsEstimate.DividendsUser.UserInfo.UserAvatar = userAvatar.(string) | 122 | dividendsEstimate.DividendsUser.UserInfo.UserAvatar = userAvatar.(string) |
129 | } | 123 | } |
@@ -87,12 +87,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error | @@ -87,12 +87,6 @@ func (dividendsOrder *DividendsOrder) Update(data map[string]interface{}) error | ||
87 | if companyName, ok := data["companyName"]; ok { | 87 | if companyName, ok := data["companyName"]; ok { |
88 | dividendsOrder.OrderSalesman.Org.Company.CompanyName = companyName.(string) | 88 | dividendsOrder.OrderSalesman.Org.Company.CompanyName = companyName.(string) |
89 | } | 89 | } |
90 | - if roleId, ok := data["roleId"]; ok { | ||
91 | - dividendsOrder.OrderSalesman.Role.RoleId = roleId.(int64) | ||
92 | - } | ||
93 | - if roleName, ok := data["roleName"]; ok { | ||
94 | - dividendsOrder.OrderSalesman.Role.RoleName = roleName.(string) | ||
95 | - } | ||
96 | if userAvatar, ok := data["userAvatar"]; ok { | 90 | if userAvatar, ok := data["userAvatar"]; ok { |
97 | dividendsOrder.OrderSalesman.UserInfo.UserAvatar = userAvatar.(string) | 91 | dividendsOrder.OrderSalesman.UserInfo.UserAvatar = userAvatar.(string) |
98 | } | 92 | } |
@@ -95,12 +95,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int | @@ -95,12 +95,6 @@ func (dividendsReturnedOrder *DividendsReturnedOrder) Update(data map[string]int | ||
95 | if orgId, ok := data["orgId"]; ok { | 95 | if orgId, ok := data["orgId"]; ok { |
96 | dividendsReturnedOrder.Org.OrgId = orgId.(int64) | 96 | dividendsReturnedOrder.Org.OrgId = orgId.(int64) |
97 | } | 97 | } |
98 | - if roleId, ok := data["roleId"]; ok { | ||
99 | - dividendsReturnedOrder.Operator.Role.RoleId = roleId.(int64) | ||
100 | - } | ||
101 | - if roleName, ok := data["roleName"]; ok { | ||
102 | - dividendsReturnedOrder.Operator.Role.RoleName = roleName.(string) | ||
103 | - } | ||
104 | if userType, ok := data["userType"]; ok { | 98 | if userType, ok := data["userType"]; ok { |
105 | dividendsReturnedOrder.Operator.UserType = userType.(int32) | 99 | dividendsReturnedOrder.Operator.UserType = userType.(int32) |
106 | } | 100 | } |
@@ -13,9 +13,13 @@ type Participator struct { | @@ -13,9 +13,13 @@ type Participator struct { | ||
13 | // 用户所属的部门 | 13 | // 用户所属的部门 |
14 | Department *Department `json:"department"` | 14 | Department *Department `json:"department"` |
15 | // 用户角色 | 15 | // 用户角色 |
16 | - Role *Role `json:"role"` | 16 | + Roles []*Role `json:"role"` |
17 | // 冗余字段,jsonb格式,不限制存放内容 | 17 | // 冗余字段,jsonb格式,不限制存放内容 |
18 | UserInfo *UserInfo `json:"userInfo"` | 18 | UserInfo *UserInfo `json:"userInfo"` |
19 | + // 用户姓名 | ||
20 | + UserName string `json:"userName"` | ||
21 | + // 用户手机号 | ||
22 | + UserPhone string `json:"userPhone"` | ||
19 | // 用户类型,1员工,2共创用户,3公开 | 23 | // 用户类型,1员工,2共创用户,3公开 |
20 | UserType int32 `json:"userType"` | 24 | UserType int32 `json:"userType"` |
21 | // 状态 | 25 | // 状态 |
@@ -7,7 +7,7 @@ type Referrer struct { | @@ -7,7 +7,7 @@ type Referrer struct { | ||
7 | // 用户基本id | 7 | // 用户基本id |
8 | UserBaseId int64 `json:"userBaseId,string"` | 8 | UserBaseId int64 `json:"userBaseId,string"` |
9 | // 用户角色 | 9 | // 用户角色 |
10 | - Role *Role `json:"role"` | 10 | + Roles []*Role `json:"role"` |
11 | // 用户关联的组织机构 | 11 | // 用户关联的组织机构 |
12 | Orgs []*Org `json:"orgs"` | 12 | Orgs []*Org `json:"orgs"` |
13 | // 用户所属的组织机构 | 13 | // 用户所属的组织机构 |
@@ -20,4 +20,8 @@ type Referrer struct { | @@ -20,4 +20,8 @@ type Referrer struct { | ||
20 | UserInfo *UserInfo `json:"userInfo"` | 20 | UserInfo *UserInfo `json:"userInfo"` |
21 | // 用户类型,1员工,2共创用户,3公开 | 21 | // 用户类型,1员工,2共创用户,3公开 |
22 | UserType int32 `json:"userType"` | 22 | UserType int32 `json:"userType"` |
23 | + // 用户姓名 | ||
24 | + UserName string `json:"userName"` | ||
25 | + // 用户手机号 | ||
26 | + UserPhone string `json:"userPhone"` | ||
23 | } | 27 | } |
@@ -22,6 +22,10 @@ type Relevant struct { | @@ -22,6 +22,10 @@ type Relevant struct { | ||
22 | UserInfo *UserInfo `json:"userInfo"` | 22 | UserInfo *UserInfo `json:"userInfo"` |
23 | // 用户类型,1员工,2共创用户,3公开 | 23 | // 用户类型,1员工,2共创用户,3公开 |
24 | UserType int32 `json:"userType"` | 24 | UserType int32 `json:"userType"` |
25 | + // 用户姓名 | ||
26 | + UserName string `json:"userName"` | ||
27 | + // 用户手机号 | ||
28 | + UserPhone string `json:"userPhone"` | ||
25 | // 状态 | 29 | // 状态 |
26 | Status int32 `json:"status"` | 30 | Status int32 `json:"status"` |
27 | // 公司 | 31 | // 公司 |
@@ -7,7 +7,7 @@ type Salesman struct { | @@ -7,7 +7,7 @@ type Salesman struct { | ||
7 | // 用户基本id | 7 | // 用户基本id |
8 | UserBaseId int64 `json:"userBaseId,string"` | 8 | UserBaseId int64 `json:"userBaseId,string"` |
9 | // 用户角色 | 9 | // 用户角色 |
10 | - Role *Role `json:"role"` | 10 | + Roles []*Role `json:"role"` |
11 | // 用户关联的组织机构 | 11 | // 用户关联的组织机构 |
12 | Orgs []*Org `json:"orgs"` | 12 | Orgs []*Org `json:"orgs"` |
13 | // 用户所属的组织机构 | 13 | // 用户所属的组织机构 |
@@ -20,4 +20,8 @@ type Salesman struct { | @@ -20,4 +20,8 @@ type Salesman struct { | ||
20 | UserInfo *UserInfo `json:"userInfo"` | 20 | UserInfo *UserInfo `json:"userInfo"` |
21 | // 用户类型,1员工,2共创用户,3公开 | 21 | // 用户类型,1员工,2共创用户,3公开 |
22 | UserType int32 `json:"userType"` | 22 | UserType int32 `json:"userType"` |
23 | + // 用户姓名 | ||
24 | + UserName string `json:"userName"` | ||
25 | + // 用户手机号 | ||
26 | + UserPhone string `json:"userPhone"` | ||
23 | } | 27 | } |
@@ -22,6 +22,10 @@ type Undertaker struct { | @@ -22,6 +22,10 @@ type Undertaker struct { | ||
22 | UserInfo *UserInfo `json:"userInfo"` | 22 | UserInfo *UserInfo `json:"userInfo"` |
23 | // 用户类型,1员工,2共创用户,3公开 | 23 | // 用户类型,1员工,2共创用户,3公开 |
24 | UserType int32 `json:"userType"` | 24 | UserType int32 `json:"userType"` |
25 | + // 用户姓名 | ||
26 | + UserName string `json:"userName"` | ||
27 | + // 用户手机号 | ||
28 | + UserPhone string `json:"userPhone"` | ||
25 | // 推荐人 | 29 | // 推荐人 |
26 | Referrer *Referrer `json:"referrer"` | 30 | Referrer *Referrer `json:"referrer"` |
27 | // 关联业务员 | 31 | // 关联业务员 |
@@ -13,11 +13,15 @@ type User struct { | @@ -13,11 +13,15 @@ type User struct { | ||
13 | // 用户所属的部门 | 13 | // 用户所属的部门 |
14 | Department *Department `json:"department"` | 14 | Department *Department `json:"department"` |
15 | // 用户角色 | 15 | // 用户角色 |
16 | - Role *Role `json:"role"` | 16 | + Roles []*Role `json:"role"` |
17 | // 冗余字段,jsonb格式,不限制存放内容 | 17 | // 冗余字段,jsonb格式,不限制存放内容 |
18 | UserInfo *UserInfo `json:"userInfo"` | 18 | UserInfo *UserInfo `json:"userInfo"` |
19 | // 用户类型 | 19 | // 用户类型 |
20 | UserType int32 `json:"userType"` | 20 | UserType int32 `json:"userType"` |
21 | + // 用户姓名 | ||
22 | + UserName string `json:"userName"` | ||
23 | + // 用户手机号 | ||
24 | + UserPhone string `json:"userPhone"` | ||
21 | // 状态 | 25 | // 状态 |
22 | Status int32 `json:"status"` | 26 | Status int32 `json:"status"` |
23 | // 用户关联公司信息 | 27 | // 用户关联公司信息 |
@@ -680,6 +680,13 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | @@ -680,6 +680,13 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | ||
680 | var cooperationContractModels []*models.CooperationContract | 680 | var cooperationContractModels []*models.CooperationContract |
681 | cooperationContracts := make([]*domain.CooperationContract, 0) | 681 | cooperationContracts := make([]*domain.CooperationContract, 0) |
682 | query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractModels), queryOptions) | 682 | query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractModels), queryOptions) |
683 | + if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" { | ||
684 | + query.Where("cooperation_contract_number like ?", fmt.Sprintf("%%%s%%", cooperationContractNumber)) | ||
685 | + } | ||
686 | + if sponsorName, ok := queryOptions["sponsorName"]; ok && sponsorName != "" { | ||
687 | + //query.Where(`cooperation_contract.cooperation_contract_sponsor->'userName' LIKE ?`, fmt.Sprintf("%%%s%%", sponsorName)) | ||
688 | + query.Where(`(cooperation_contract.cooperation_contract_sponsor->>'userName')::text LIKE ?`, fmt.Sprintf("%%%s%%", sponsorName)) | ||
689 | + } | ||
683 | query.SetOffsetAndLimit(20) | 690 | query.SetOffsetAndLimit(20) |
684 | query.SetOrderDirect("cooperation_contract_id", "DESC") | 691 | query.SetOrderDirect("cooperation_contract_id", "DESC") |
685 | if count, err := query.SelectAndCount(); err != nil { | 692 | if count, err := query.SelectAndCount(); err != nil { |
@@ -105,8 +105,10 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) | @@ -105,8 +105,10 @@ func (translator *UserTranslator) ToRelevantFromRepresentation(user *UserDetail) | ||
105 | UserPhone: user.UserInfo.Phone, | 105 | UserPhone: user.UserInfo.Phone, |
106 | UserAccount: "", | 106 | UserAccount: "", |
107 | }, | 107 | }, |
108 | - UserType: user.UserType, | ||
109 | - Status: user.EnableStatus, | 108 | + UserType: user.UserType, |
109 | + UserName: user.UserInfo.UserName, | ||
110 | + UserPhone: user.UserInfo.Phone, | ||
111 | + Status: user.EnableStatus, | ||
110 | Company: &domain.Company{ | 112 | Company: &domain.Company{ |
111 | CompanyId: user.Company.CompanyId, | 113 | CompanyId: user.Company.CompanyId, |
112 | CompanyLogo: "", | 114 | CompanyLogo: "", |
@@ -119,13 +121,15 @@ func (translator *UserTranslator) ToReferrerFromRepresentation(user *UserDetail) | @@ -119,13 +121,15 @@ func (translator *UserTranslator) ToReferrerFromRepresentation(user *UserDetail) | ||
119 | return &domain.Referrer{ | 121 | return &domain.Referrer{ |
120 | UserId: user.UserId, | 122 | UserId: user.UserId, |
121 | UserBaseId: user.UserBaseId, | 123 | UserBaseId: user.UserBaseId, |
122 | - Role: nil, | 124 | + Roles: nil, |
123 | Orgs: nil, | 125 | Orgs: nil, |
124 | Org: nil, | 126 | Org: nil, |
125 | Department: nil, | 127 | Department: nil, |
126 | Company: nil, | 128 | Company: nil, |
127 | UserInfo: nil, | 129 | UserInfo: nil, |
128 | UserType: 0, | 130 | UserType: 0, |
131 | + UserName: user.UserInfo.UserName, | ||
132 | + UserPhone: user.UserInfo.Phone, | ||
129 | }, nil | 133 | }, nil |
130 | } | 134 | } |
131 | 135 | ||
@@ -139,6 +143,8 @@ func (translator *UserTranslator) ToUndertakerFromRepresentation(user *UserDetai | @@ -139,6 +143,8 @@ func (translator *UserTranslator) ToUndertakerFromRepresentation(user *UserDetai | ||
139 | Roles: nil, | 143 | Roles: nil, |
140 | UserInfo: nil, | 144 | UserInfo: nil, |
141 | UserType: 0, | 145 | UserType: 0, |
146 | + UserName: user.UserInfo.UserName, | ||
147 | + UserPhone: user.UserInfo.Phone, | ||
142 | Status: 0, | 148 | Status: 0, |
143 | Company: nil, | 149 | Company: nil, |
144 | ContractAttachment: nil, | 150 | ContractAttachment: nil, |
@@ -149,13 +155,15 @@ func (translator *UserTranslator) ToSalesmanFromRepresentation(user *UserDetail) | @@ -149,13 +155,15 @@ func (translator *UserTranslator) ToSalesmanFromRepresentation(user *UserDetail) | ||
149 | return &domain.Salesman{ | 155 | return &domain.Salesman{ |
150 | UserId: user.UserId, | 156 | UserId: user.UserId, |
151 | UserBaseId: user.UserBaseId, | 157 | UserBaseId: user.UserBaseId, |
152 | - Role: nil, | 158 | + Roles: nil, |
153 | Orgs: nil, | 159 | Orgs: nil, |
154 | Org: nil, | 160 | Org: nil, |
155 | Department: nil, | 161 | Department: nil, |
156 | Company: nil, | 162 | Company: nil, |
157 | UserInfo: nil, | 163 | UserInfo: nil, |
158 | UserType: 0, | 164 | UserType: 0, |
165 | + UserName: user.UserInfo.UserName, | ||
166 | + UserPhone: user.UserInfo.Phone, | ||
159 | }, nil | 167 | }, nil |
160 | } | 168 | } |
161 | 169 | ||
@@ -166,9 +174,11 @@ func (translator *UserTranslator) ToOperatorFromRepresentation(user *UserDetail) | @@ -166,9 +174,11 @@ func (translator *UserTranslator) ToOperatorFromRepresentation(user *UserDetail) | ||
166 | Org: nil, | 174 | Org: nil, |
167 | Orgs: nil, | 175 | Orgs: nil, |
168 | Department: nil, | 176 | Department: nil, |
169 | - Role: nil, | 177 | + Roles: nil, |
170 | UserInfo: nil, | 178 | UserInfo: nil, |
171 | UserType: 0, | 179 | UserType: 0, |
180 | + UserName: user.UserInfo.UserName, | ||
181 | + UserPhone: user.UserInfo.Phone, | ||
172 | Status: 0, | 182 | Status: 0, |
173 | Company: nil, | 183 | Company: nil, |
174 | }, nil | 184 | }, nil |
@@ -181,9 +191,11 @@ func (translator *UserTranslator) ToUserFromRepresentation(user *UserDetail) (*d | @@ -181,9 +191,11 @@ func (translator *UserTranslator) ToUserFromRepresentation(user *UserDetail) (*d | ||
181 | Org: nil, | 191 | Org: nil, |
182 | Orgs: nil, | 192 | Orgs: nil, |
183 | Department: nil, | 193 | Department: nil, |
184 | - Role: nil, | 194 | + Roles: nil, |
185 | UserInfo: nil, | 195 | UserInfo: nil, |
186 | UserType: 0, | 196 | UserType: 0, |
197 | + UserName: user.UserInfo.UserName, | ||
198 | + UserPhone: user.UserInfo.Phone, | ||
187 | Status: 0, | 199 | Status: 0, |
188 | Company: nil, | 200 | Company: nil, |
189 | }, nil | 201 | }, nil |
@@ -59,7 +59,6 @@ func (controller *CooperationContractController) RemoveCooperationContract() { | @@ -59,7 +59,6 @@ func (controller *CooperationContractController) RemoveCooperationContract() { | ||
59 | cooperationContractService := service.NewCooperationContractService(nil) | 59 | cooperationContractService := service.NewCooperationContractService(nil) |
60 | removeCooperationContractCommand := &command.RemoveCooperationContractCommand{} | 60 | removeCooperationContractCommand := &command.RemoveCooperationContractCommand{} |
61 | _ = controller.Unmarshal(removeCooperationContractCommand) | 61 | _ = controller.Unmarshal(removeCooperationContractCommand) |
62 | - // 解析头部信息 | ||
63 | header := controller.GetRequestHeader(controller.Ctx) | 62 | header := controller.GetRequestHeader(controller.Ctx) |
64 | removeCooperationContractCommand.CompanyId = header.CompanyId | 63 | removeCooperationContractCommand.CompanyId = header.CompanyId |
65 | removeCooperationContractCommand.OrgId = header.OrgId | 64 | removeCooperationContractCommand.OrgId = header.OrgId |
@@ -74,16 +73,12 @@ func (controller *CooperationContractController) RemoveCooperationContract() { | @@ -74,16 +73,12 @@ func (controller *CooperationContractController) RemoveCooperationContract() { | ||
74 | func (controller *CooperationContractController) SearchCooperationContract() { | 73 | func (controller *CooperationContractController) SearchCooperationContract() { |
75 | cooperationContractService := service.NewCooperationContractService(nil) | 74 | cooperationContractService := service.NewCooperationContractService(nil) |
76 | searchCooperationContractQuery := &query.SearchCooperationContractQuery{} | 75 | searchCooperationContractQuery := &query.SearchCooperationContractQuery{} |
77 | - // 解析头部信息 | 76 | + _ = controller.Unmarshal(searchCooperationContractQuery) |
78 | header := controller.GetRequestHeader(controller.Ctx) | 77 | header := controller.GetRequestHeader(controller.Ctx) |
79 | searchCooperationContractQuery.CompanyId = header.CompanyId | 78 | searchCooperationContractQuery.CompanyId = header.CompanyId |
80 | searchCooperationContractQuery.OrgId = header.OrgId | 79 | searchCooperationContractQuery.OrgId = header.OrgId |
81 | searchCooperationContractQuery.UserId = header.UserId | 80 | searchCooperationContractQuery.UserId = header.UserId |
82 | searchCooperationContractQuery.UserBaseId = header.UserBaseId | 81 | searchCooperationContractQuery.UserBaseId = header.UserBaseId |
83 | - pageSize, _ := controller.GetInt64("pageSize") | ||
84 | - searchCooperationContractQuery.PageSize = pageSize | ||
85 | - pageNumber, _ := controller.GetInt64("pageNumber") | ||
86 | - searchCooperationContractQuery.PageNumber = pageNumber | ||
87 | data, err := cooperationContractService.SearchCooperationContract(searchCooperationContractQuery) | 82 | data, err := cooperationContractService.SearchCooperationContract(searchCooperationContractQuery) |
88 | controller.Response(data, err) | 83 | controller.Response(data, err) |
89 | } | 84 | } |
-
请 注册 或 登录 后发表评论