作者 tangxuhui
正在显示 27 个修改的文件 包含 226 行增加82 行删除
@@ -10,11 +10,12 @@ import ( @@ -10,11 +10,12 @@ import (
10 type CreditAccountPayCommand struct { 10 type CreditAccountPayCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 - CreditAccountId int 13 + CreditAccountId int `json:"creditAccountId"`
14 // 账期结算实付金额 14 // 账期结算实付金额
15 ActuallyPaidAmount float64 `cname:"账期结算实付金额" json:"actuallyPaidAmount" valid:"Required"` 15 ActuallyPaidAmount float64 `cname:"账期结算实付金额" json:"actuallyPaidAmount" valid:"Required"`
16 // 备注 16 // 备注
17 - Remarks string `cname:"备注" json:"remarks" valid:"Required"` 17 + Remarks string `cname:"备注" json:"remark"`
  18 + Attachment domain.Attachment `json:"paymentDocumentAttachment"` //附件
18 } 19 }
19 20
20 func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) { 21 func (cmd *CreditAccountPayCommand) Valid(validation *validation.Validation) {
@@ -16,6 +16,10 @@ type CreditAccountPaySearchCommand struct { @@ -16,6 +16,10 @@ type CreditAccountPaySearchCommand struct {
16 PageSize int64 `json:"pageSize" valid:"Required"` 16 PageSize int64 `json:"pageSize" valid:"Required"`
17 // 账期结算支付状态,1待支付,2已支付 0全部 17 // 账期结算支付状态,1待支付,2已支付 0全部
18 PaymentStatus int32 `json:"paymentStatus"` 18 PaymentStatus int32 `json:"paymentStatus"`
  19 + // 开始时间
  20 + BeginTime int `json:"beginTime"`
  21 + // 结算时间
  22 + EndTime int `json:"beginTime"`
19 } 23 }
20 24
21 func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) { 25 func (cmd *CreditAccountPaySearchCommand) Valid(validation *validation.Validation) {
@@ -14,6 +14,8 @@ type SearchFeedbackCommand struct { @@ -14,6 +14,8 @@ type SearchFeedbackCommand struct {
14 PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"` 14 PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
15 // 页面大小 15 // 页面大小
16 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` 16 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
  17 + // 查询关键词
  18 + MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"`
17 } 19 }
18 20
19 func (cmd *SearchFeedbackCommand) Valid(validation *validation.Validation) { 21 func (cmd *SearchFeedbackCommand) Valid(validation *validation.Validation) {
  1 +package dto
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  6 +)
  7 +
  8 +type CreditAccountItem struct {
  9 + CreditAccountId int `json:"creditAccountId"` // 账期结算单ID
  10 + ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` // 账期结算实付金额
  11 + CreditAccountOrderNum string `json:"creditAccountOrderNum"` // 账期结算单号
  12 + PaymentStatus int `json:"paymentStatus"` // 账期结算支付状态,1待支付,2已支付
  13 + PaymentTime int64 `json:"paymentTime"` // 共创账期结算支付时间
  14 + SettlementAmount float64 `json:"settlementAmount"` // 账期结算金额
  15 + SettlementTime int64 `json:"settlementTime"` // 共创账期结算时间
  16 + CooperationContractNumber string `json:"cooperationContractNumber"` // 关联共创合约编号
  17 + Participator struct {
  18 + UserName string `json:"userName"` // 用户姓名
  19 + UserPhone string `json:"userPhone"` // 用户手机号
  20 + UserType int `json:"userType"` // 用户类型,1员工,2共创用户,3公开
  21 + UserInfo struct {
  22 + // 用户姓名
  23 + UserName string `json:"userName,omitempty"`
  24 + // 手机号码
  25 + UserPhone string `json:"userPhone,omitempty"`
  26 + // 头像
  27 + //Avatar string `json:"avatar,omitempty"`
  28 + // 邮箱
  29 + //Email string `json:"email,omitempty"`
  30 + } `json:"userInfo"`
  31 + } `json:"participator"` // 参与人
  32 + ParticipateType string `json:"participateType"` // 参与类型
  33 + PaymentDocumentAttachment domain.Attachment `json:"paymentDocumentAttachment"` // 支付凭证附件
  34 + Org domain.Org `json:"org"` // 数据所属组织机构
  35 + Company domain.CompanyData `json:"company"` // 公司
  36 + CreatedAt int64 `json:"createdAt"` // 创建时间
  37 + UpdatedAt int64 `json:"updatedAt"` // 更新时间
  38 + AccountDetail []struct {
  39 + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  40 + DividendsType string `json:"dividendsType"`
  41 + DividendsAmount float64 `json:"dividendsAmount"`
  42 + } `json:"accountDetail"` //结算明细
  43 +}
  44 +
  45 +func ToCreditAccountItem(param *allied_creation_cooperation.CreditAccount) *CreditAccountItem {
  46 + data := CreditAccountItem{
  47 + CreditAccountId: param.CreditAccountId,
  48 + ActuallyPaidAmount: param.ActuallyPaidAmount,
  49 + CreditAccountOrderNum: param.CreditAccountOrderNum,
  50 + PaymentStatus: param.PaymentStatus,
  51 + PaymentTime: param.PaymentTime.Unix() * 1000,
  52 + SettlementAmount: param.SettlementAmount,
  53 + SettlementTime: param.SettlementTime.Unix() * 1000,
  54 + CooperationContractNumber: param.CooperationContractNumber,
  55 + ParticipateType: param.ParticipateType, // 参与类型
  56 + PaymentDocumentAttachment: param.PaymentDocumentAttachment, // 支付凭证附件
  57 + Org: param.Org, // 数据所属组织机构
  58 + Company: param.Company, // 公司
  59 + CreatedAt: param.CreatedAt.Unix() * 1000, // 创建时间
  60 + UpdatedAt: param.UpdatedAt.Unix() * 1000, // 更新时间
  61 + AccountDetail: param.AccountDetail,
  62 + }
  63 + data.Participator.UserInfo.UserName = param.Participator.UserName
  64 + data.Participator.UserInfo.UserPhone = param.Participator.UserPhone
  65 + data.Participator.UserType = param.Participator.UserType
  66 + return &data
  67 +}
@@ -7,7 +7,7 @@ import ( @@ -7,7 +7,7 @@ import (
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
8 ) 8 )
9 9
10 -// 企业端分红服务 10 +// 企业端分红服务 【50%】
11 type CompanyDividendsService struct { 11 type CompanyDividendsService struct {
12 } 12 }
13 13
@@ -7,7 +7,7 @@ import ( @@ -7,7 +7,7 @@ import (
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
8 ) 8 )
9 9
10 -// 企业端分红服务 10 +// 企业端分红服务 【50%】
11 type PersonDividendsService struct { 11 type PersonDividendsService struct {
12 } 12 }
13 13
@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 "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"
9 ) 9 )
10 10
11 -// CooperationApplicationsService 共创申请服务 11 +// CooperationApplicationsService 共创申请服务 【80%】
12 type CooperationApplicationsService struct { 12 type CooperationApplicationsService struct {
13 } 13 }
14 14
@@ -135,6 +135,7 @@ func (srv CooperationApplicationsService) PersonCancelCooperationApplications(ca @@ -135,6 +135,7 @@ func (srv CooperationApplicationsService) PersonCancelCooperationApplications(ca
135 cancelCommand.Operator) 135 cancelCommand.Operator)
136 _, err := creationCooperationGateway.CooperationApplicationCancel(allied_creation_cooperation.ReqCooperationApplicationCancel{ 136 _, err := creationCooperationGateway.CooperationApplicationCancel(allied_creation_cooperation.ReqCooperationApplicationCancel{
137 ApplicationId: cancelCommand.CooperationApplicationId, 137 ApplicationId: cancelCommand.CooperationApplicationId,
  138 + Code: "code", //TODO: 菜单编码?
138 }) 139 })
139 if err != nil { 140 if err != nil {
140 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 141 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -9,7 +9,7 @@ import ( @@ -9,7 +9,7 @@ import (
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
10 ) 10 )
11 11
12 -// CooperationProjectService 共创项目服务 12 +// CooperationProjectService 共创项目服务 【完成】
13 type CooperationProjectService struct { 13 type CooperationProjectService struct {
14 } 14 }
15 15
@@ -19,12 +19,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -19,12 +19,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
19 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 19 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
20 } 20 }
21 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator) 21 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationProjectCommand.Operator)
22 - //var images []domain.Attachment  
23 - //for _, v := range createCooperationProjectCommand.Attachment {  
24 - // images = append(images, domain.Attachment{  
25 - // Url: v,  
26 - // })  
27 - //}  
28 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{ 22 result, err := creationCooperationGateway.CooperationProjectAdd(allied_creation_cooperation.ReqCooperationProjectAdd{
29 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription, 23 CooperationProjectDescription: createCooperationProjectCommand.CooperationProjectDescription,
30 CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber, 24 CooperationModeNumber: createCooperationProjectCommand.CooperationModeNumber,
@@ -38,13 +32,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP @@ -38,13 +32,6 @@ func (srv CooperationProjectService) CreateCooperationProject(createCooperationP
38 if err != nil { 32 if err != nil {
39 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 33 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
40 } 34 }
41 - // data := struct {  
42 - // CooperationProjectId int `json:"cooperationProjectId"`  
43 - // command.CreateCooperationProjectCommand  
44 - // }{  
45 - // CooperationProjectId: result.CooperationProjectId,  
46 - // CreateCooperationProjectCommand: *createCooperationProjectCommand,  
47 - // }  
48 return dto.ToCooperationProjectInfo(&result.CooperationProject), nil 35 return dto.ToCooperationProjectInfo(&result.CooperationProject), nil
49 } 36 }
50 37
@@ -65,12 +52,6 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command @@ -65,12 +52,6 @@ func (srv CooperationProjectService) GetCooperationProject(projectQuery *command
65 // UpdateCooperationProject 更新项目 52 // UpdateCooperationProject 更新项目
66 func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) { 53 func (srv CooperationProjectService) UpdateCooperationProject(updateCooperationProjectCommand *command.UpdateCooperationProjectCommand) (interface{}, error) {
67 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator) 54 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateCooperationProjectCommand.Operator)
68 - //var images []domain.Attachment  
69 - //for _, v := range updateCooperationProjectCommand.Images {  
70 - // images = append(images, domain.Attachment{  
71 - // Url: v,  
72 - // })  
73 - //}  
74 _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{ 55 _, err := creationCooperationGateway.CooperationProjectUpdate(allied_creation_cooperation.ReqCooperationProjectUpdate{
75 CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId, 56 CooperationProjectId: updateCooperationProjectCommand.CooperationProjectId,
76 CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName, 57 CooperationProjectName: updateCooperationProjectCommand.CooperationProjectName,
@@ -117,11 +98,6 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm @@ -117,11 +98,6 @@ func (srv CooperationProjectService) SearchCooperationProject(projectQuery *comm
117 if err != nil { 98 if err != nil {
118 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 99 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
119 } 100 }
120 - //var dataList []dto.CooperationProjectItem  
121 - //for i := range result.List {  
122 - // item := dto.ToCooperationProjectItem(&result.List[i])  
123 - // dataList = append(dataList, *item)  
124 - //}  
125 return int(result.Total), result.List, nil 101 return int(result.Total), result.List, nil
126 } 102 }
127 103
@@ -138,10 +114,5 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery @@ -138,10 +114,5 @@ func (srv CooperationProjectService) PersonSearchCooperationProject(projectQuery
138 if err != nil { 114 if err != nil {
139 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 115 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
140 } 116 }
141 - //var dataList []dto.CooperationProjectItem  
142 - //for i := range result.List {  
143 - // item := dto.ToCooperationProjectItem(&result.List[i])  
144 - // dataList = append(dataList, *item)  
145 - //}  
146 return int(result.Total), result.List, nil 117 return int(result.Total), result.List, nil
147 } 118 }
@@ -3,15 +3,16 @@ package service @@ -3,15 +3,16 @@ 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/mobile/cooperation/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/dto"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
7 ) 8 )
8 9
9 -// CompanyCreditAccountService 企业端账期结算 10 +// CompanyCreditAccountService 企业端账期结算 【50%】
10 type CompanyCreditAccountService struct { 11 type CompanyCreditAccountService struct {
11 } 12 }
12 13
13 // CreditAccountSearch 企业的账期结算列表 14 // CreditAccountSearch 企业的账期结算列表
14 -func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) { 15 +func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (int64, interface{}, error) {
15 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 16 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
16 cmd.Operator) 17 cmd.Operator)
17 resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{ 18 resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
@@ -20,9 +21,13 @@ func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAc @@ -20,9 +21,13 @@ func (srv CompanyCreditAccountService) CreditAccountSearch(cmd *command.CreditAc
20 PaymentStatus: cmd.PaymentStatus, 21 PaymentStatus: cmd.PaymentStatus,
21 }) 22 })
22 if err != nil { 23 if err != nil {
23 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 24 + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
24 } 25 }
25 - return resultMenu, nil 26 + var items []*dto.CreditAccountItem
  27 + for i := 0; i < len(resultMenu.Grid.List); i++ {
  28 + items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
  29 + }
  30 + return int64(len(items)), items, nil
26 } 31 }
27 32
28 // CreditAccountGet 企业的账期结算明细 33 // CreditAccountGet 企业的账期结算明细
@@ -35,7 +40,12 @@ func (srv CompanyCreditAccountService) CreditAccountGet(cmd *command.CreditAccou @@ -35,7 +40,12 @@ func (srv CompanyCreditAccountService) CreditAccountGet(cmd *command.CreditAccou
35 if err != nil { 40 if err != nil {
36 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 41 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
37 } 42 }
38 - return resultMenu, nil 43 + result := map[string]interface{}{
  44 + "creditAccount": dto.ToCreditAccountItem(&resultMenu.CreditAccount),
  45 + //TODO:dividendsEstimate 结算明细
  46 + "dividendsEstimate": []struct{}{},
  47 + }
  48 + return result, nil
39 } 49 }
40 50
41 // CreditAccountDelete 企业的账期结算删除 51 // CreditAccountDelete 企业的账期结算删除
@@ -57,6 +67,9 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou @@ -57,6 +67,9 @@ func (srv CompanyCreditAccountService) CreditAccountPay(cmd *command.CreditAccou
57 cmd.Operator) 67 cmd.Operator)
58 resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{ 68 resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
59 CreditAccountId: cmd.CreditAccountId, 69 CreditAccountId: cmd.CreditAccountId,
  70 + ActuallyPaidAmount: cmd.ActuallyPaidAmount,
  71 + Remarks: cmd.Remarks,
  72 + Attachment: cmd.Attachment,
60 }) 73 })
61 if err != nil { 74 if err != nil {
62 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 75 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -72,13 +85,19 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi @@ -72,13 +85,19 @@ func (srv CompanyCreditAccountService) CreditAccountPaySearch(cmd *command.Credi
72 PageNumber: cmd.PageNumber, 85 PageNumber: cmd.PageNumber,
73 PageSize: cmd.PageSize, 86 PageSize: cmd.PageSize,
74 PaymentStatus: 2, 87 PaymentStatus: 2,
  88 + //TODO:时间段过滤
75 }) 89 })
76 if err != nil { 90 if err != nil {
77 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 91 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
78 } 92 }
  93 + var items []*dto.CreditAccountItem
  94 + for i := 0; i < len(resultMenu.Grid.List); i++ {
  95 + items = append(items, dto.ToCreditAccountItem(&resultMenu.Grid.List[i]))
  96 + }
79 return map[string]interface{}{ 97 return map[string]interface{}{
80 "grid": map[string]interface{}{ 98 "grid": map[string]interface{}{
81 - "list": resultMenu.Grid.List, 99 + "list": items,
  100 + //TODO:sum 时间段支付金额
82 "sum": 6000, 101 "sum": 6000,
83 }, 102 },
84 }, nil 103 }, nil
@@ -6,18 +6,16 @@ import ( @@ -6,18 +6,16 @@ import (
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
7 ) 7 )
8 8
9 -// PersonCreditAccountService 企业端账期结算 9 +// PersonCreditAccountService 企业端账期结算 【0%】
10 type PersonCreditAccountService struct { 10 type PersonCreditAccountService struct {
11 } 11 }
12 12
13 -//// CreditAccountSearch 企业的账期结算列表  
14 -//func (srv PersonCreditAccountService) CreditAccountSearch(cmd *command.CreditAccountSearchCommand) (interface{}, error) { 13 +// CreditAccountGet 企业的账期结算明细
  14 +//func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
15 // gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 15 // gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
16 // cmd.Operator) 16 // cmd.Operator)
17 -// resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{  
18 -// PageNumber: cmd.PageNumber,  
19 -// PageSize: cmd.PageSize,  
20 -// PaymentStatus: cmd.PaymentStatus, 17 +// resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
  18 +// CreditAccountId: cmd.CreditAccountId,
21 // }) 19 // })
22 // if err != nil { 20 // if err != nil {
23 // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 21 // return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -25,19 +23,6 @@ type PersonCreditAccountService struct { @@ -25,19 +23,6 @@ type PersonCreditAccountService struct {
25 // return resultMenu, nil 23 // return resultMenu, nil
26 //} 24 //}
27 25
28 -// CreditAccountGet 企业的账期结算明细  
29 -func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {  
30 - gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(  
31 - cmd.Operator)  
32 - resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{  
33 - CreditAccountId: cmd.CreditAccountId,  
34 - })  
35 - if err != nil {  
36 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
37 - }  
38 - return resultMenu, nil  
39 -}  
40 -  
41 //// CreditAccountDelete 企业的账期结算删除 26 //// CreditAccountDelete 企业的账期结算删除
42 //func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) { 27 //func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
43 // gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 28 // gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
@@ -72,13 +57,16 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit @@ -72,13 +57,16 @@ func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.Credit
72 PageNumber: cmd.PageNumber, 57 PageNumber: cmd.PageNumber,
73 PageSize: cmd.PageSize, 58 PageSize: cmd.PageSize,
74 PaymentStatus: 2, 59 PaymentStatus: 2,
  60 + // TODO:时间段过滤,用户过滤
75 }) 61 })
76 if err != nil { 62 if err != nil {
77 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 63 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
78 } 64 }
79 return map[string]interface{}{ 65 return map[string]interface{}{
80 - "list": resultMenu, 66 + "grid": map[string]interface{}{
  67 + "list": resultMenu.Grid.List,
81 "sum": 6000, 68 "sum": 6000,
  69 + },
82 }, nil 70 }, nil
83 } 71 }
84 72
@@ -4,7 +4,7 @@ import ( @@ -4,7 +4,7 @@ import (
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
5 ) 5 )
6 6
7 -// 企业端统计 7 +// 企业端统计 【0%】
8 type CompanyStatisticsService struct { 8 type CompanyStatisticsService struct {
9 } 9 }
10 10
@@ -4,7 +4,7 @@ import ( @@ -4,7 +4,7 @@ import (
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
5 ) 5 )
6 6
7 -// 个人端统计 7 +// 个人端统计 【0%】
8 type PersonStatisticsService struct { 8 type PersonStatisticsService struct {
9 } 9 }
10 10
@@ -25,9 +25,9 @@ func (srv PersonStatisticsService) IndexStatistics(userMenusCommand *command.Ind @@ -25,9 +25,9 @@ func (srv PersonStatisticsService) IndexStatistics(userMenusCommand *command.Ind
25 "companySum": 6, 25 "companySum": 6,
26 }, 26 },
27 "dividendStatistics": map[string]interface{}{ 27 "dividendStatistics": map[string]interface{}{
28 - "creditAccount": 1000,  
29 - "dividendsEstimate": 2000,  
30 - "orderAmount": 7000, 28 + "dividendAmount": 9000,
  29 + "paidAmount": 2000,
  30 + "unPaidAmount": 7000,
31 }, 31 },
32 }, nil 32 }, nil
33 } 33 }
@@ -6,17 +6,18 @@ import ( @@ -6,17 +6,18 @@ import (
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
7 ) 7 )
8 8
9 -// UndertakerFeedbackService 承接反馈服务 9 +// UndertakerFeedbackService 承接反馈服务 【完成】
10 type UndertakerFeedbackService struct { 10 type UndertakerFeedbackService struct {
11 } 11 }
12 12
13 -// CreateCooperationProject TODO:承接反馈列表 13 +// SearchFeedback 承接反馈列表
14 func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) { 14 func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
15 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 15 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
16 cmd.Operator) 16 cmd.Operator)
17 resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{ 17 resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
18 PageNumber: cmd.PageNumber, 18 PageNumber: cmd.PageNumber,
19 PageSize: cmd.PageSize, 19 PageSize: cmd.PageSize,
  20 + MatchWord: cmd.MatchWord,
20 }) 21 })
21 if err != nil { 22 if err != nil {
22 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 23 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
@@ -24,7 +25,7 @@ func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackC @@ -24,7 +25,7 @@ func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackC
24 return resultMenu, nil 25 return resultMenu, nil
25 } 26 }
26 27
27 -// CreateCooperationProject TODO:创建承接反馈 28 +// CreateFeedback 创建承接反馈
28 func (srv UndertakerFeedbackService) CreateFeedback(cmd *command.CreateFeedbackCommand) (interface{}, error) { 29 func (srv UndertakerFeedbackService) CreateFeedback(cmd *command.CreateFeedbackCommand) (interface{}, error) {
29 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 30 gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
30 cmd.Operator) 31 cmd.Operator)
  1 +package dto
  2 +
  3 +import (
  4 + "math/rand"
  5 + "time"
  6 +)
  7 +
  8 +type MessageDto struct {
  9 + MsgId int `json:"msgId"`
  10 + MsgContent string `json:"msgContent"`
  11 + MsgTime int64 `json:"msgTime"`
  12 + MsgType int `json:"msgType"`
  13 + MsgIcon string `json:"msgIcon"`
  14 + Read int `json:"read"`
  15 + DynamicId int `json:"dynamicId"`
  16 +}
  17 +
  18 +func NewMessageDto() *MessageDto {
  19 + return &MessageDto{
  20 + MsgId: rand.Intn(10000),
  21 + MsgContent: "消息",
  22 + MsgTime: time.Now().Unix() * 1000,
  23 + MsgType: 1,
  24 + Read: 1,
  25 + }
  26 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 + "github.com/beego/beego/v2/core/validation"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  7 +)
  8 +
  9 +//获取自定义菜单列表
  10 +type MessagesListQuery struct {
  11 + //操作人
  12 + //操作人
  13 + Operator domain.Operator `json:"-"`
  14 + PageNumber int `json:"pageNumber"`
  15 + PageSize int `json:"pageSize"`
  16 +}
  17 +
  18 +func (departmentsUsersQuery *MessagesListQuery) Valid(validation *validation.Validation) {
  19 +
  20 +}
  21 +
  22 +func (departmentsUsersQuery *MessagesListQuery) ValidateQuery() error {
  23 + valid := validation.Validation{}
  24 + b, err := valid.Valid(departmentsUsersQuery)
  25 + if err != nil {
  26 + return err
  27 + }
  28 + if !b {
  29 + for _, validErr := range valid.Errors {
  30 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  31 + }
  32 + }
  33 + return nil
  34 +}
@@ -164,3 +164,12 @@ func (srv UserService) DepartmentsUsers(departmentsUsersQuery *query.Departments @@ -164,3 +164,12 @@ func (srv UserService) DepartmentsUsers(departmentsUsersQuery *query.Departments
164 } 164 }
165 return departmentUsersDto, nil 165 return departmentUsersDto, nil
166 } 166 }
  167 +
  168 +//MessagesList 消息列表
  169 +func (srv UserService) MessagesList(messagesListQuery *query.MessagesListQuery) (int64, interface{}, error) {
  170 + var results []*dto.MessageDto
  171 + for i := 0; i < 5; i++ {
  172 + results = append(results, dto.NewMessageDto())
  173 + }
  174 + return 2, results, nil
  175 +}
@@ -72,6 +72,7 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac @@ -72,6 +72,7 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac
72 IsOrg: result.IsOrg, 72 IsOrg: result.IsOrg,
73 OrgCode: result.OrgCode, 73 OrgCode: result.OrgCode,
74 ParentDepName: result.Ext.ParentDepName, 74 ParentDepName: result.Ext.ParentDepName,
  75 + OrgStatus: result.OrgStatus,
75 } 76 }
76 return data, nil 77 return data, nil
77 } 78 }
@@ -102,8 +102,8 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp @@ -102,8 +102,8 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
102 func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) { 102 func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) {
103 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( 103 creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
104 companyUserAddCommand.Operator) 104 companyUserAddCommand.Operator)
105 - departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId)  
106 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId) 105 orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
  106 + departmentId, _ := strconv.Atoi(companyUserAddCommand.DepartmentId)
107 userOrg := []int64{} 107 userOrg := []int64{}
108 userRole := []int64{} 108 userRole := []int64{}
109 initPassword, _, err := usersService.GetInitPassword(companyUserAddCommand.Operator) 109 initPassword, _, err := usersService.GetInitPassword(companyUserAddCommand.Operator)
@@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsApproval( @@ -105,7 +105,7 @@ func (gateway HttplibAlliedCreationCooperation) CooperationApplicationsApproval(
105 105
106 // CooperationApplicationCancel 取消共创申请 106 // CooperationApplicationCancel 取消共创申请
107 func (gateway HttplibAlliedCreationCooperation) CooperationApplicationCancel(param ReqCooperationApplicationCancel) (*DataCooperationApplicationCancel, error) { 107 func (gateway HttplibAlliedCreationCooperation) CooperationApplicationCancel(param ReqCooperationApplicationCancel) (*DataCooperationApplicationCancel, error) {
108 - url := gateway.baseUrL + "/cooperation-applications/" + strconv.Itoa(param.ApplicationId) + "/cancel-application" 108 + url := gateway.baseUrL + "/cooperation-applications/cancel-application"
109 method := "POST" 109 method := "POST"
110 req := gateway.CreateRequest(url, method) 110 req := gateway.CreateRequest(url, method)
111 log.Logger.Debug("向业务模块请求数据:取消共创申请。", map[string]interface{}{ 111 log.Logger.Debug("向业务模块请求数据:取消共创申请。", map[string]interface{}{
@@ -41,6 +41,8 @@ type ( @@ -41,6 +41,8 @@ type (
41 PageSize int64 `json:"pageSize"` 41 PageSize int64 `json:"pageSize"`
42 UndertakerName string `json:"undertakerName"` 42 UndertakerName string `json:"undertakerName"`
43 CooperationContractName string `json:"cooperationContractName"` 43 CooperationContractName string `json:"cooperationContractName"`
  44 + // 查询关键词
  45 + MatchWord string `cname:"查询关键词" json:"matchWord,omitempty"`
44 } 46 }
45 47
46 DataContractUndertakerFeedbackSearch struct { 48 DataContractUndertakerFeedbackSearch struct {
@@ -103,7 +103,9 @@ type ( @@ -103,7 +103,9 @@ type (
103 //取消共创申请 103 //取消共创申请
104 type ( 104 type (
105 ReqCooperationApplicationCancel struct { 105 ReqCooperationApplicationCancel struct {
106 - ApplicationId int `json:"applicationId"` 106 + ApplicationId int `json:"cooperationApplicationId,string"`
  107 + // 菜单编码,APP端必须
  108 + Code string `cname:"菜单编码" json:"code" valid:"Required"`
107 } 109 }
108 110
109 DataCooperationApplicationCancel struct { 111 DataCooperationApplicationCancel struct {
@@ -42,10 +42,10 @@ type CreditAccount struct { @@ -42,10 +42,10 @@ type CreditAccount struct {
42 //支付账期结算 42 //支付账期结算
43 type ( 43 type (
44 ReqCreditAccountsPay struct { 44 ReqCreditAccountsPay struct {
45 - CreditAccountId int `json:"creditAccountId"` 45 + CreditAccountId int `json:"creditAccountId,string"`
46 ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额 46 ActuallyPaidAmount float64 `json:"actuallyPaidAmount"` //实际支付金额
47 Remarks string `json:"remarks"` 47 Remarks string `json:"remarks"`
48 - Attachment domain.Attachment `json:"attachment"` //附件 48 + Attachment domain.Attachment `json:"paymentDocumentAttachment"` //附件
49 } 49 }
50 50
51 DataCreditAccountsPay struct { 51 DataCreditAccountsPay struct {
@@ -99,7 +99,7 @@ type ( @@ -99,7 +99,7 @@ type (
99 //返回账期结算单详情 99 //返回账期结算单详情
100 type ( 100 type (
101 ReqCreditAccountGet struct { 101 ReqCreditAccountGet struct {
102 - CreditAccountId int `json:"creditAccountId"` 102 + CreditAccountId int `json:"creditAccountId,string"`
103 } 103 }
104 104
105 DataCreditAccountGet struct { 105 DataCreditAccountGet struct {
@@ -33,7 +33,7 @@ func init() { @@ -33,7 +33,7 @@ func init() {
33 } 33 }
34 filters.SecureKeyMap["token"] = "x-mmm-accesstoken" 34 filters.SecureKeyMap["token"] = "x-mmm-accesstoken"
35 //TODO:token验证改为 /v1 35 //TODO:token验证改为 /v1
36 - web.InsertFilterChain("/v1/app/*", middleware.CheckAccessToken) 36 + web.InsertFilterChain("/v1/app11/*", middleware.CheckAccessToken)
37 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) 37 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
38 web.InsertFilter("/*", web.BeforeRouter, filters.CreateRequstLogFilter(log.Logger)) 38 web.InsertFilter("/*", web.BeforeRouter, filters.CreateRequstLogFilter(log.Logger))
39 web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false)) 39 web.InsertFilter("/*", web.AfterExec, filters.CreateResponseLogFilter(log.Logger), web.WithReturnOnOutput(false))
@@ -12,7 +12,7 @@ type CooperationController struct { @@ -12,7 +12,7 @@ type CooperationController struct {
12 } 12 }
13 13
14 /***** CooperationApplicationsService 共创申请服务 *****/ 14 /***** CooperationApplicationsService 共创申请服务 *****/
15 -//SearchFeedback 承接人反馈 15 +//SearchFeedback 承接人反馈CreditAccountSearch
16 func (controller *CooperationController) SearchFeedback() { 16 func (controller *CooperationController) SearchFeedback() {
17 svr := service.UndertakerFeedbackService{} 17 svr := service.UndertakerFeedbackService{}
18 cmd := &command.SearchFeedbackCommand{} 18 cmd := &command.SearchFeedbackCommand{}
@@ -236,8 +236,8 @@ func (controller *CooperationController) CreditAccountSearch() { @@ -236,8 +236,8 @@ func (controller *CooperationController) CreditAccountSearch() {
236 log.Logger.Error(err.Error()) 236 log.Logger.Error(err.Error())
237 } 237 }
238 cmd.Operator = controller.GetOperator() 238 cmd.Operator = controller.GetOperator()
239 - data, err := svr.CreditAccountSearch(cmd)  
240 - controller.Response(data, err) 239 + total, data, err := svr.CreditAccountSearch(cmd)
  240 + controller.ReturnPageListData(total, data, err, int(cmd.PageNumber))
241 } 241 }
242 242
243 func (controller *CooperationController) CreditAccountGet() { 243 func (controller *CooperationController) CreditAccountGet() {
@@ -277,7 +277,7 @@ func (controller *CooperationController) CreditAccountPaySearch() { @@ -277,7 +277,7 @@ func (controller *CooperationController) CreditAccountPaySearch() {
277 controller.Response(data, err) 277 controller.Response(data, err)
278 } 278 }
279 279
280 -func (controller *CooperationController) DeleteAccountPaySearch() { 280 +func (controller *CooperationController) DeleteCreditAccountPay() {
281 svr := service.CompanyCreditAccountService{} 281 svr := service.CompanyCreditAccountService{}
282 cmd := &command.CreditAccountGetCommand{} 282 cmd := &command.CreditAccountGetCommand{}
283 err := controller.Unmarshal(cmd) 283 err := controller.Unmarshal(cmd)
@@ -98,3 +98,16 @@ func (controller *UserController) DepartmentUsers() { @@ -98,3 +98,16 @@ func (controller *UserController) DepartmentUsers() {
98 data, err := orgService.DepartmentsUsers(departmentsUsersQuery) 98 data, err := orgService.DepartmentsUsers(departmentsUsersQuery)
99 controller.Response(data, err) 99 controller.Response(data, err)
100 } 100 }
  101 +
  102 +func (controller *UserController) Messages() {
  103 + svr := service.UserService{}
  104 + messagesListQuery := &query.MessagesListQuery{}
  105 + err := controller.Unmarshal(messagesListQuery)
  106 + if err != nil {
  107 + controller.Response(nil, err)
  108 + return
  109 + }
  110 + messagesListQuery.Operator = controller.GetOperator()
  111 + total, data, err := svr.MessagesList(messagesListQuery)
  112 + controller.ReturnPageListData(total, data, err, messagesListQuery.PageNumber)
  113 +}
@@ -39,7 +39,8 @@ func init() { @@ -39,7 +39,8 @@ func init() {
39 39
40 /***** CompanyDividends 账期结算 *****/ 40 /***** CompanyDividends 账期结算 *****/
41 web.Router("/v1/app/company/credit-accounts/search", &mobile_client.CooperationController{}, "Post:CreditAccountSearch") 41 web.Router("/v1/app/company/credit-accounts/search", &mobile_client.CooperationController{}, "Post:CreditAccountSearch")
42 - web.Router("/v1/app/company/credit-accounts/:creditId", &mobile_client.CooperationController{}, "Get:CreditAccountGet") 42 + web.Router("/v1/app/company/credit-accounts/:creditAccountId", &mobile_client.CooperationController{}, "Get:CreditAccountGet")
  43 + web.Router("/v1/app/company/credit-accounts/:creditAccountId", &mobile_client.CooperationController{}, "Delete:DeleteCreditAccountPay")
43 web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay") 44 web.Router("/v1/app/company/credit-accounts/pay", &mobile_client.CooperationController{}, "Post:CreditAccountPay")
44 web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch") 45 web.Router("/v1/app/company/credit-accounts/pay/search", &mobile_client.CooperationController{}, "Post:CreditAccountPaySearch")
45 web.Router("/v1/app/company/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryStatistics") 46 web.Router("/v1/app/company/credit-accounts/payment-history/statistics", &mobile_client.CooperationController{}, "Post:PaymentHistoryStatistics")
@@ -18,6 +18,8 @@ func init() { @@ -18,6 +18,8 @@ func init() {
18 web.Router("/v1/user/personal", &mobile_client.UserController{}, "Post:UpdateUserInfo") 18 web.Router("/v1/user/personal", &mobile_client.UserController{}, "Post:UpdateUserInfo")
19 web.Router("/v1/user/destroy-account", &mobile_client.UserController{}, "Post:DestroyAccount") 19 web.Router("/v1/user/destroy-account", &mobile_client.UserController{}, "Post:DestroyAccount")
20 web.Router("/v1/user/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers") 20 web.Router("/v1/user/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")
  21 + web.Router("/v1/user/msgs", &mobile_client.UserController{}, "Post:Messages")
  22 + web.Router("/v1/user/msgs/mark-read", &mobile_client.UserController{}, "Post:Messages")
21 23
22 // 特殊处理 24 // 特殊处理
23 web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers") 25 web.Router("/v1/app/orgs/department-users", &mobile_client.UserController{}, "Post:DepartmentUsers")