作者 yangfu
@@ -8,53 +8,20 @@ import ( @@ -8,53 +8,20 @@ import (
8 ) 8 )
9 9
10 type CooperationApplicationItem struct { 10 type CooperationApplicationItem struct {
11 - CooperationProject struct {  
12 - CooperationProjectID string `json:"cooperationProjectId"` //共创项目  
13 - CooperationProjectName string `json:"cooperationProjectName"` //共创名称  
14 - CooperationProjectNumber string `json:"cooperationProjectNumber"` //共创编号  
15 - } `json:"cooperationProject"`  
16 - CooperationApplicationApplicant struct {  
17 - UserId int  
18 - UserInfo struct {  
19 - UserAvatar string  
20 - UserEmail string  
21 - UserName string  
22 - UserPhone string  
23 - UserAccount string  
24 - }  
25 - } `json:"cooperationApplicationApplicant"`  
26 - CooperationApplicationAttachment []domain.Attachment `json:"cooperationApplicationAttachment"` //附件  
27 - CooperationApplicationDescription string `json:"cooperationApplicationDescription"` //描述  
28 - CooperationApplicationID string `json:"cooperationApplicationId"` //id  
29 - IsCanceled bool `json:"isCanceled"` //是否取消  
30 - CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"` //审核描述  
31 - CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"` //审核时间  
32 - CooperationApplicationStatus int `json:"cooperationApplicationStatus"` //  
33 - Org struct {  
34 - OrgID string `json:"orgId"`  
35 - OrgName string `json:"orgName"`  
36 - } `json:"org"` //组织 11 + allied_creation_cooperation.CooperationApplication
  12 + AuthFlag bool `json:"authFlag"`
37 } 13 }
38 14
39 -func ToCooperationApplicationItem(param *allied_creation_cooperation.CooperationApplication) *CooperationApplicationItem {  
40 - //data := CooperationApplicationItem{  
41 - // CooperationApplicationAttachment: param.CooperationApplicationAttachment,  
42 - // CooperationApplicationDescription: param.CooperationApplicationDescription,  
43 - // CooperationApplicationID: param.CooperationApplicationID,  
44 - // IsCanceled: param.IsCanceled,  
45 - // CooperationApplicationVerifyDescription: param.CooperationApplicationVerifyDescription,  
46 - // CooperationApplicationStatus: param.CooperationApplicationStatus,  
47 - // Org: param.Org,  
48 - //}  
49 - //data.CooperationApplicationApplicant.UserName = param.CooperationApplicationApplicant.UserInfo.UserName  
50 - //data.CooperationApplicationApplicant.Phone = param.CooperationApplicationApplicant.UserInfo.UserPhone  
51 - //data.CooperationApplicationApplicant.UserCode = param.CooperationApplicationApplicant.UserInfo.UserPhone  
52 - //data.CooperationApplicationApplicant.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName  
53 - //data.CooperationProject.CooperationProjectID = param.CooperationProject.CooperationProjectID  
54 - //data.CooperationProject.CooperationProjectName = param.CooperationProject.CooperationProjectName  
55 - //data.CooperationProject.CooperationProjectNumber = param.CooperationProject.CooperationProjectNumber  
56 - //return &data  
57 - return nil 15 +func ToCooperationApplicationItem(param []allied_creation_cooperation.CooperationApplication, operatorOrgId int64) []CooperationApplicationItem {
  16 + listData := []CooperationApplicationItem{}
  17 + for i := range param {
  18 + item := CooperationApplicationItem{
  19 + CooperationApplication: param[i],
  20 + AuthFlag: param[i].Org.OrgID == int(operatorOrgId),
  21 + }
  22 + listData = append(listData, item)
  23 + }
  24 + return listData
58 } 25 }
59 26
60 type CooperationApplicationInfo struct { 27 type CooperationApplicationInfo struct {
@@ -3,6 +3,7 @@ package service @@ -3,6 +3,7 @@ package service
3 import ( 3 import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/dto"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
8 ) 9 )
@@ -73,15 +74,12 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat @@ -73,15 +74,12 @@ func (cooperationApplicationService *CooperationApplicationService) ListCooperat
73 if err != nil { 74 if err != nil {
74 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 75 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
75 } 76 }
76 - //var dataList []dto.CooperationApplicationItem  
77 - //for i := range result.Grid.List {  
78 - // item := dto.ToCooperationApplicationItem(&result.Grid.List[i])  
79 - // dataList = append(dataList, *item)  
80 - //} 77 +
81 if len(result.Grid.List) == 0 { 78 if len(result.Grid.List) == 0 {
82 result.Grid.List = []allied_creation_cooperation.CooperationApplication{} 79 result.Grid.List = []allied_creation_cooperation.CooperationApplication{}
83 } 80 }
84 - return int64(result.Grid.Total), result.Grid.List, nil 81 + listData := dto.ToCooperationApplicationItem(result.Grid.List, listCooperationApplicationQuery.Operator.OrgId)
  82 + return int64(result.Grid.Total), listData, nil
85 } 83 }
86 84
87 func NewCooperationApplicationService(options map[string]interface{}) *CooperationApplicationService { 85 func NewCooperationApplicationService(options map[string]interface{}) *CooperationApplicationService {
@@ -22,9 +22,10 @@ type CooperationContractItem struct { @@ -22,9 +22,10 @@ type CooperationContractItem struct {
22 Org domain.Org `json:"org"` //组织结构 22 Org domain.Org `json:"org"` //组织结构
23 CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"` //共创合约承接对象,1员工,2共创用户,3公开 23 CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"` //共创合约承接对象,1员工,2共创用户,3公开
24 CooperationContractDescription string `json:"cooperationContractDescription"` //合约描述 24 CooperationContractDescription string `json:"cooperationContractDescription"` //合约描述
  25 + AuthFlag bool `json:"authFlag"`
25 } 26 }
26 27
27 -func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem { 28 +func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract, operatorOrgId int64) *CooperationContractItem {
28 cooperationContractUndertakerType := param.CooperationContractUndertakerTypes 29 cooperationContractUndertakerType := param.CooperationContractUndertakerTypes
29 if len(cooperationContractUndertakerType) == 0 { 30 if len(cooperationContractUndertakerType) == 0 {
30 cooperationContractUndertakerType = []int{} 31 cooperationContractUndertakerType = []int{}
@@ -38,6 +39,7 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon @@ -38,6 +39,7 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon
38 CooperationContractNumber: param.CooperationContractNumber, 39 CooperationContractNumber: param.CooperationContractNumber,
39 Status: param.Status, 40 Status: param.Status,
40 CreateTime: int(param.CreatedAt.UnixNano() / 1e6), 41 CreateTime: int(param.CreatedAt.UnixNano() / 1e6),
  42 + AuthFlag: param.Org.OrgId == operatorOrgId,
41 } 43 }
42 data.CooperationContractSponsor.UserId = param.CooperationContractSponsor.UserId 44 data.CooperationContractSponsor.UserId = param.CooperationContractSponsor.UserId
43 data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName 45 data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
@@ -112,7 +114,7 @@ type CooperationContractInfo struct { @@ -112,7 +114,7 @@ type CooperationContractInfo struct {
112 UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"` // 可以去除勾选的共创项目承接对象列表 114 UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"` // 可以去除勾选的共创项目承接对象列表
113 } 115 }
114 116
115 -func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationContract) *CooperationContractInfo { 117 +func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationContract, operatorOrgId int64) *CooperationContractInfo {
116 118
117 relevants := []Relevant{} 119 relevants := []Relevant{}
118 dividendsIncentivesRules := []DividendsIncentivesRule{} 120 dividendsIncentivesRules := []DividendsIncentivesRule{}
@@ -202,7 +204,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon @@ -202,7 +204,7 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
202 undertakerTypesUncheckedAvailable = []int{} 204 undertakerTypesUncheckedAvailable = []int{}
203 } 205 }
204 data := CooperationContractInfo{ 206 data := CooperationContractInfo{
205 - CooperationContract: *ToCooperationContractItem(param), 207 + CooperationContract: *ToCooperationContractItem(param, operatorOrgId),
206 Relevant: relevants, 208 Relevant: relevants,
207 DividendsIncentivesRules: dividendsIncentivesRules, 209 DividendsIncentivesRules: dividendsIncentivesRules,
208 MoneyIncentivesRules: moneyIncentivesRules, 210 MoneyIncentivesRules: moneyIncentivesRules,
@@ -77,7 +77,8 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC @@ -77,7 +77,8 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
77 if err != nil { 77 if err != nil {
78 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 78 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
79 } 79 }
80 - return dto.ToCooperationContractInfo(&result.CooperationContract), err 80 + return dto.ToCooperationContractInfo(&result.CooperationContract, createCooperationContractCommand.Operator.OrgId), err
  81 +
81 } 82 }
82 83
83 // 暂停恢复共创合约 84 // 暂停恢复共创合约
@@ -105,13 +106,12 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont @@ -105,13 +106,12 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont
105 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 106 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
106 } 107 }
107 108
108 - return dto.ToCooperationContractInfo(&result.CooperationContract), nil 109 + return dto.ToCooperationContractInfo(&result.CooperationContract, getCooperationContractQuery.Operator.OrgId), nil
109 } 110 }
110 111
111 // 返回共创合约管理列表 112 // 返回共创合约管理列表
112 func (cooperationContractService *CooperationContractService) ListCooperationContract( 113 func (cooperationContractService *CooperationContractService) ListCooperationContract(
113 listCooperationContractQuery *query.ListCooperationContractQuery) (int, interface{}, error) { 114 listCooperationContractQuery *query.ListCooperationContractQuery) (int, interface{}, error) {
114 -  
115 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator) 115 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator)
116 result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{ 116 result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
117 PageNumber: listCooperationContractQuery.PageNumber, 117 PageNumber: listCooperationContractQuery.PageNumber,
@@ -124,7 +124,7 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon @@ -124,7 +124,7 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon
124 } 124 }
125 data := []dto.CooperationContractItem{} 125 data := []dto.CooperationContractItem{}
126 for i := range result.Grid.List { 126 for i := range result.Grid.List {
127 - item := dto.ToCooperationContractItem(&result.Grid.List[i]) 127 + item := dto.ToCooperationContractItem(&result.Grid.List[i], listCooperationContractQuery.Operator.OrgId)
128 data = append(data, *item) 128 data = append(data, *item)
129 } 129 }
130 130
@@ -194,7 +194,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC @@ -194,7 +194,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
194 if err != nil { 194 if err != nil {
195 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 195 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
196 } 196 }
197 - return dto.ToCooperationContractInfo(&result.CooperationContract), nil 197 + return dto.ToCooperationContractInfo(&result.CooperationContract, updateCooperationContractCommand.Operator.OrgId), nil
198 } 198 }
199 199
200 func NewCooperationContractService(options map[string]interface{}) *CooperationContractService { 200 func NewCooperationContractService(options map[string]interface{}) *CooperationContractService {
@@ -17,4 +17,5 @@ type CooperationModeItem struct { @@ -17,4 +17,5 @@ type CooperationModeItem struct {
17 // 组织名称 17 // 组织名称
18 OrgName string `json:"orgName"` 18 OrgName string `json:"orgName"`
19 } `json:"org"` 19 } `json:"org"`
  20 + AuthFlag bool `json:"authFlag"`
20 } 21 }
@@ -51,6 +51,7 @@ func (cooperationModeService *CooperationModeService) GetCooperationMode(getCoop @@ -51,6 +51,7 @@ func (cooperationModeService *CooperationModeService) GetCooperationMode(getCoop
51 Status: result.Status, 51 Status: result.Status,
52 CooperationModeNumber: result.CooperationModeNumber, 52 CooperationModeNumber: result.CooperationModeNumber,
53 Org: result.Org, 53 Org: result.Org,
  54 + AuthFlag: result.Org.OrgId == int(getCooperationModeQuery.Operator.OrgId),
54 } 55 }
55 return data, nil 56 return data, nil
56 } 57 }
@@ -85,6 +86,7 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo @@ -85,6 +86,7 @@ func (cooperationModeService *CooperationModeService) ListCooperationMode(listCo
85 Status: v.Status, 86 Status: v.Status,
86 CooperationModeNumber: v.CooperationModeNumber, 87 CooperationModeNumber: v.CooperationModeNumber,
87 Org: v.Org, 88 Org: v.Org,
  89 + AuthFlag: v.Org.OrgId == int(listCooperationModeQuery.Operator.OrgId),
88 } 90 }
89 listData = append(listData, item) 91 listData = append(listData, item)
90 } 92 }
@@ -169,6 +171,7 @@ func (cooperationModeService *CooperationModeService) CooperationModeSelector(li @@ -169,6 +171,7 @@ func (cooperationModeService *CooperationModeService) CooperationModeSelector(li
169 Status: v.Status, 171 Status: v.Status,
170 CooperationModeNumber: v.CooperationModeNumber, 172 CooperationModeNumber: v.CooperationModeNumber,
171 Org: v.Org, 173 Org: v.Org,
  174 + AuthFlag: v.Org.OrgId == int(listCooperationModeQuery.Operator.OrgId),
172 } 175 }
173 listData = append(listData, item) 176 listData = append(listData, item)
174 } 177 }
@@ -124,3 +124,22 @@ func ToCooperationApplicationItem(param *allied_creation_cooperation.Cooperation @@ -124,3 +124,22 @@ func ToCooperationApplicationItem(param *allied_creation_cooperation.Cooperation
124 return &data 124 return &data
125 //return nil 125 //return nil
126 } 126 }
  127 +
  128 +type CooperationProjectSearchItem struct {
  129 + allied_creation_cooperation.DataCooperationProjectSearchItem
  130 + AuthFlag bool `json:"authFlag"` //当前用户是否可以编辑
  131 +}
  132 +
  133 +func ToCooperationProjectSearchItem(items []allied_creation_cooperation.DataCooperationProjectSearchItem, operatorOrgId int) []CooperationProjectSearchItem {
  134 + listData := []CooperationProjectSearchItem{}
  135 + operatorOrgIdStr := strconv.Itoa(operatorOrgId)
  136 + for i := range items {
  137 + listItem := CooperationProjectSearchItem{
  138 + DataCooperationProjectSearchItem: items[i],
  139 + AuthFlag: operatorOrgIdStr == items[i].Org.OrgID,
  140 + }
  141 + listData = append(listData, listItem)
  142 + }
  143 +
  144 + return listData
  145 +}
@@ -118,7 +118,8 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje @@ -118,7 +118,8 @@ func (cooperationProjectService *CooperationProjectService) ListCooperationProje
118 if len(result.List) == 0 { 118 if len(result.List) == 0 {
119 result.List = []allied_creation_cooperation.DataCooperationProjectSearchItem{} 119 result.List = []allied_creation_cooperation.DataCooperationProjectSearchItem{}
120 } 120 }
121 - return int64(result.Total), result.List, nil 121 + listData := dto.ToCooperationProjectSearchItem(result.List, int(listCooperationProjectQuery.Operator.OrgId))
  122 + return int64(result.Total), listData, nil
122 } 123 }
123 124
124 // 更新共创项目管理 125 // 更新共创项目管理
@@ -44,9 +44,10 @@ type CreditAccountItem struct { @@ -44,9 +44,10 @@ type CreditAccountItem struct {
44 UserAccount string `json:"userAccount"` // 用户账号, 44 UserAccount string `json:"userAccount"` // 用户账号,
45 } `json:"userInfo"` 45 } `json:"userInfo"`
46 } `json:"operator"` 46 } `json:"operator"`
  47 + AuthFlag bool `json:"authFlag"`
47 } 48 }
48 49
49 -func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *CreditAccountItem { 50 +func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount, operatorOrgId int64) *CreditAccountItem {
50 data := CreditAccountItem{ 51 data := CreditAccountItem{
51 CreditAccountId: param.CreditAccountId, 52 CreditAccountId: param.CreditAccountId,
52 ActuallyPaidAmount: param.ActuallyPaidAmount, 53 ActuallyPaidAmount: param.ActuallyPaidAmount,
@@ -62,6 +63,7 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred @@ -62,6 +63,7 @@ func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *Cred
62 CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间 63 CreatedAt: param.CreatedAt.UnixNano() / 1e6, // 创建时间
63 UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间 64 UpdatedAt: param.UpdatedAt.UnixNano() / 1e6, // 更新时间
64 AccountDetail: param.AccountDetail, 65 AccountDetail: param.AccountDetail,
  66 + AuthFlag: param.Org.OrgID == int(operatorOrgId),
65 } 67 }
66 if !param.PaymentTime.IsZero() { 68 if !param.PaymentTime.IsZero() {
67 data.PaymentTime = param.PaymentTime.UnixNano() / 1e6 69 data.PaymentTime = param.PaymentTime.UnixNano() / 1e6
@@ -29,7 +29,7 @@ func (srv *CreditAccountService) ListCreditAccount(listQuery *query.ListCreditAc @@ -29,7 +29,7 @@ func (srv *CreditAccountService) ListCreditAccount(listQuery *query.ListCreditAc
29 } 29 }
30 listData := []dto.CreditAccountItem{} 30 listData := []dto.CreditAccountItem{}
31 for i := range result.Grid.List { 31 for i := range result.Grid.List {
32 - item := dto.ToCreditAccountItem(&result.Grid.List[i]) 32 + item := dto.ToCreditAccountItem(&result.Grid.List[i], listQuery.Operator.OrgId)
33 listData = append(listData, *item) 33 listData = append(listData, *item)
34 } 34 }
35 return int64(result.Grid.Total), listData, nil 35 return int64(result.Grid.Total), listData, nil
@@ -44,7 +44,7 @@ func (srv *CreditAccountService) GetCreditAccount(getQuery *query.GetCreditAccou @@ -44,7 +44,7 @@ func (srv *CreditAccountService) GetCreditAccount(getQuery *query.GetCreditAccou
44 if err != nil { 44 if err != nil {
45 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 45 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
46 } 46 }
47 - return dto.ToCreditAccountItem(&result.CreditAccount), nil 47 + return dto.ToCreditAccountItem(&result.CreditAccount, getQuery.Operator.OrgId), nil
48 } 48 }
49 49
50 //PayCreditAccount 支付账期结算 50 //PayCreditAccount 支付账期结算
@@ -15,28 +15,29 @@ type DividendsEstimateDividendItem struct { @@ -15,28 +15,29 @@ type DividendsEstimateDividendItem struct {
15 OrderTime int64 `json:"orderTime"` //订单/退货单日期 15 OrderTime int64 `json:"orderTime"` //订单/退货单日期
16 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号 16 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
17 RegionName string `json:"regionName"` //区域名称 17 RegionName string `json:"regionName"` //区域名称
  18 + AuthFlag bool `json:"authFlag"`
18 } 19 }
19 20
20 -func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {  
21 - listdata := []DividendsEstimateDividendItem{}  
22 - for _, v := range param.List {  
23 - item := DividendsEstimateDividendItem{  
24 - OrderGoodId: v.OrderGoodId,  
25 - OrderGoodName: v.OrderGoodName,  
26 - CooperationContractNumber: v.CooperationContractNumber,  
27 - CustomerName: v.CustomerName,  
28 - DividendsIncentivesAmount: v.OrderAmount,  
29 - OrderOrReturnedOrderNum: v.OrderNumber, 21 +// func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {
  22 +// listdata := []DividendsEstimateDividendItem{}
  23 +// for _, v := range param.List {
  24 +// item := DividendsEstimateDividendItem{
  25 +// OrderGoodId: v.OrderGoodId,
  26 +// OrderGoodName: v.OrderGoodName,
  27 +// CooperationContractNumber: v.CooperationContractNumber,
  28 +// CustomerName: v.CustomerName,
  29 +// DividendsIncentivesAmount: v.OrderAmount,
  30 +// OrderOrReturnedOrderNum: v.OrderNumber,
30 31
31 - OriginalOrderNum: v.OriginalOrderNum,  
32 - RegionName: v.RegionName,  
33 - }  
34 - item.OrderTime = v.OrderDate.UnixNano() / 1e6  
35 - listdata = append(listdata, item)  
36 - } 32 +// OriginalOrderNum: v.OriginalOrderNum,
  33 +// RegionName: v.RegionName,
  34 +// }
  35 +// item.OrderTime = v.OrderDate.UnixNano() / 1e6
  36 +// listdata = append(listdata, item)
  37 +// }
37 38
38 - return listdata  
39 -} 39 +// return listdata
  40 +// }
40 41
41 //金额激励列表 42 //金额激励列表
42 type DividendsEstimateMoneyItem struct { 43 type DividendsEstimateMoneyItem struct {
@@ -108,4 +109,5 @@ type DividendsEstimateItem struct { @@ -108,4 +109,5 @@ type DividendsEstimateItem struct {
108 OrgId int `json:"orgId,string,"` // 组织机构ID 109 OrgId int `json:"orgId,string,"` // 组织机构ID
109 OrgName string `json:"orgName"` // 组织名称 110 OrgName string `json:"orgName"` // 组织名称
110 } `json:"org"` // 数据所属组织机构 111 } `json:"org"` // 数据所属组织机构
  112 + AuthFlag bool `json:"authFlag"`
111 } 113 }
@@ -96,6 +96,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat @@ -96,6 +96,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
96 CooperationContractNumber: v.CooperationContractNumber, 96 CooperationContractNumber: v.CooperationContractNumber,
97 DividendsIncentivesStage: v.DividendsStage, 97 DividendsIncentivesStage: v.DividendsStage,
98 IsCanceled: v.IsCanceled, 98 IsCanceled: v.IsCanceled,
  99 + AuthFlag: v.Org.OrgId == int(searchDividendsEstimateQuery.Operator.OrgId),
99 } 100 }
100 item.DividendsUser.Phone = v.DividendsUser.UserInfo.UserPhone 101 item.DividendsUser.Phone = v.DividendsUser.UserInfo.UserPhone
101 item.DividendsUser.UsersName = v.DividendsUser.UserInfo.UserName 102 item.DividendsUser.UsersName = v.DividendsUser.UserInfo.UserName
@@ -125,7 +126,22 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti @@ -125,7 +126,22 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti
125 if err != nil { 126 if err != nil {
126 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 127 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
127 } 128 }
128 - listdata := dto.ToDividendsEstimateDividendItem(result) 129 +
  130 + listdata := []dto.DividendsEstimateDividendItem{}
  131 + for _, v := range result.List {
  132 + item := dto.DividendsEstimateDividendItem{
  133 + OrderGoodId: v.OrderGoodId,
  134 + OrderGoodName: v.OrderGoodName,
  135 + CooperationContractNumber: v.CooperationContractNumber,
  136 + CustomerName: v.CustomerName,
  137 + DividendsIncentivesAmount: v.OrderAmount,
  138 + OrderOrReturnedOrderNum: v.OrderNumber,
  139 + OriginalOrderNum: v.OriginalOrderNum,
  140 + RegionName: v.RegionName,
  141 + }
  142 + item.OrderTime = v.OrderDate.UnixNano() / 1e6
  143 + listdata = append(listdata, item)
  144 + }
129 return result.Total, listdata, nil 145 return result.Total, listdata, nil
130 } 146 }
131 147
@@ -29,6 +29,7 @@ type DividendsOrder struct { @@ -29,6 +29,7 @@ type DividendsOrder struct {
29 Remarks string `json:"remarks"` 29 Remarks string `json:"remarks"`
30 Goods []DividendsOrderGoods `json:"goods"` 30 Goods []DividendsOrderGoods `json:"goods"`
31 Returned bool `json:"returned"` 31 Returned bool `json:"returned"`
  32 + AuthFlag bool `json:"authFlag"`
32 } 33 }
33 34
34 type DividendsOrderGoods struct { 35 type DividendsOrderGoods struct {
@@ -44,7 +45,7 @@ type DividendsOrderGoods struct { @@ -44,7 +45,7 @@ type DividendsOrderGoods struct {
44 OrderGoodDividendsStatus int32 `json:"orderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红 45 OrderGoodDividendsStatus int32 `json:"orderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
45 } 46 }
46 47
47 -func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *DividendsOrder { 48 +func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder, operatorOrgId int64) *DividendsOrder {
48 goods := []DividendsOrderGoods{} 49 goods := []DividendsOrderGoods{}
49 for _, v := range param.Goods { 50 for _, v := range param.Goods {
50 good := DividendsOrderGoods{ 51 good := DividendsOrderGoods{
@@ -75,6 +76,7 @@ func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *Divide @@ -75,6 +76,7 @@ func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *Divide
75 Remarks: param.Remarks, 76 Remarks: param.Remarks,
76 Goods: goods, 77 Goods: goods,
77 Returned: param.Returned, 78 Returned: param.Returned,
  79 + AuthFlag: param.Org.OrgID == int(operatorOrgId),
78 } 80 }
79 81
80 return &data 82 return &data
@@ -48,7 +48,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD @@ -48,7 +48,7 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
48 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 48 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
49 } 49 }
50 50
51 - return dto.ToDividendsOrder(&result.DividendsOrder), nil 51 + return dto.ToDividendsOrder(&result.DividendsOrder, createDividendsOrderCommand.Operator.OrgId), nil
52 } 52 }
53 53
54 // 返回分红订单实体对象 54 // 返回分红订单实体对象
@@ -61,7 +61,7 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen @@ -61,7 +61,7 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen
61 if err != nil { 61 if err != nil {
62 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 62 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
63 } 63 }
64 - return dto.ToDividendsOrder(&result.DividendsOrder), nil 64 + return dto.ToDividendsOrder(&result.DividendsOrder, getDividendsOrderQuery.Operator.OrgId), nil
65 } 65 }
66 66
67 // 移除分红订单实体对象 67 // 移除分红订单实体对象
@@ -93,7 +93,7 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD @@ -93,7 +93,7 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD
93 } 93 }
94 dataList := []dto.DividendsOrder{} 94 dataList := []dto.DividendsOrder{}
95 for i := range result.Grid.List { 95 for i := range result.Grid.List {
96 - item := dto.ToDividendsOrder(&result.Grid.List[i]) 96 + item := dto.ToDividendsOrder(&result.Grid.List[i], searchDividendsOrderQuery.Operator.OrgId)
97 dataList = append(dataList, *item) 97 dataList = append(dataList, *item)
98 } 98 }
99 return result.Grid.Total, dataList, nil 99 return result.Grid.Total, dataList, nil
@@ -33,10 +33,12 @@ type DividendsReturnedOrderInfo struct { @@ -33,10 +33,12 @@ type DividendsReturnedOrderInfo struct {
33 RegionName string `json:"regionName"` 33 RegionName string `json:"regionName"`
34 RegionNumber string `json:"regionNumber"` //区域编码 34 RegionNumber string `json:"regionNumber"` //区域编码
35 } `json:"region"` //区域信息 35 } `json:"region"` //区域信息
36 - Goods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"goods"` //货品 36 + AuthFlag bool `json:"authFlag"`
  37 + Goods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"goods"` //货品
  38 +
37 } 39 }
38 40
39 -func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo { 41 +func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder, operatorOrgId int64) *DividendsReturnedOrderInfo {
40 goods := param.Goods 42 goods := param.Goods
41 if len(param.Goods) == 0 { 43 if len(param.Goods) == 0 {
42 goods = []allied_creation_cooperation.DividendsReturnedOrderGoods{} 44 goods = []allied_creation_cooperation.DividendsReturnedOrderGoods{}
@@ -58,6 +60,7 @@ func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsRe @@ -58,6 +60,7 @@ func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsRe
58 DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund, 60 DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund,
59 OriginalOrderNum: param.OriginalOrderNum, 61 OriginalOrderNum: param.OriginalOrderNum,
60 Remarks: param.Remarks, 62 Remarks: param.Remarks,
  63 + AuthFlag: param.Org.OrgID == int(operatorOrgId),
61 } 64 }
62 return &data 65 return &data
63 } 66 }
@@ -44,7 +44,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide @@ -44,7 +44,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide
44 if err != nil { 44 if err != nil {
45 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 45 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
46 } 46 }
47 - return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil 47 + return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder, createDividendsReturnedOrderCommand.Operator.OrgId), nil
48 } 48 }
49 49
50 // 返回分红退货单服务 50 // 返回分红退货单服务
@@ -56,7 +56,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends @@ -56,7 +56,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
56 if err != nil { 56 if err != nil {
57 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 57 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
58 } 58 }
59 - return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil 59 + return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder, getDividendsReturnedOrderQuery.Operator.OrgId), nil
60 } 60 }
61 61
62 // 移除分红退货单服务 62 // 移除分红退货单服务
@@ -85,7 +85,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide @@ -85,7 +85,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
85 } 85 }
86 dataList := []dto.DividendsReturnedOrderInfo{} 86 dataList := []dto.DividendsReturnedOrderInfo{}
87 for i := range result.Grid.List { 87 for i := range result.Grid.List {
88 - item := dto.ToDividendsReturnedOrderInfo(&result.Grid.List[i]) 88 + item := dto.ToDividendsReturnedOrderInfo(&result.Grid.List[i], searchDividendsReturnedOrderQuery.Operator.OrgId)
89 dataList = append(dataList, *item) 89 dataList = append(dataList, *item)
90 } 90 }
91 return result.Grid.Total, dataList, nil 91 return result.Grid.Total, dataList, nil
@@ -10,4 +10,5 @@ type NoticeSettingItem struct { @@ -10,4 +10,5 @@ type NoticeSettingItem struct {
10 NoticeSettingID int `json:"noticeSettingId,string"` 10 NoticeSettingID int `json:"noticeSettingId,string"`
11 OrgID int `json:"orgId,string"` 11 OrgID int `json:"orgId,string"`
12 OrgName string `json:"orgName"` 12 OrgName string `json:"orgName"`
  13 + AuthFlag bool `json:"authFlag"`
13 } 14 }
@@ -69,6 +69,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin @@ -69,6 +69,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
69 NoticeSettingID: v.NoticeSettingID, 69 NoticeSettingID: v.NoticeSettingID,
70 OrgID: v.OrgID, 70 OrgID: v.OrgID,
71 ModuleActionName: v.ModuleActionName, 71 ModuleActionName: v.ModuleActionName,
  72 + AuthFlag: v.OrgID == int(noticeSettingListQuery.Operator.OrgId),
72 } 73 }
73 orgData, _ := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{ 74 orgData, _ := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
74 OrgId: v.OrgID, 75 OrgId: v.OrgID,
@@ -163,6 +164,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting @@ -163,6 +164,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting
163 ModuleAction: result.ModuleAction, 164 ModuleAction: result.ModuleAction,
164 NoticeSettingID: result.NoticeSettingID, 165 NoticeSettingID: result.NoticeSettingID,
165 OrgID: result.OrgID, 166 OrgID: result.OrgID,
  167 + AuthFlag: result.OrgID == int(noticeSettingGetQuery.Operator.OrgId),
166 } 168 }
167 return data, nil 169 return data, nil
168 } 170 }
@@ -182,10 +182,6 @@ type ( @@ -182,10 +182,6 @@ type (
182 UserPhone string `json:"userPhone"` 182 UserPhone string `json:"userPhone"`
183 UserAccount string `json:"userAccount"` 183 UserAccount string `json:"userAccount"`
184 } `json:"userInfo"` 184 } `json:"userInfo"`
185 - //UserType int `json:"userType"`  
186 - //UserName string `json:"userName"`  
187 - //UserPhone string `json:"userPhone"`  
188 - //Status int `json:"status"`  
189 } `json:"cooperationProjectPublisher"` 185 } `json:"cooperationProjectPublisher"`
190 CooperationProjectSponsor struct { 186 CooperationProjectSponsor struct {
191 UserID string `json:"userId"` 187 UserID string `json:"userId"`