undertaker_feedbacks.go
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// UndertakerFeedbackService 承接反馈服务 【完成】
type UndertakerFeedbackService struct {
}
// SearchFeedback 承接反馈列表
func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.ContractUndertakerFeedbackSearch(allied_creation_cooperation.ReqContractUndertakerFeedbackSearch{
PageNumber: cmd.PageNumber + 1, //手机序号从0开始的
PageSize: cmd.PageSize,
MatchWord: cmd.MatchWord,
CompanyId: cmd.Operator.CompanyId,
OrgId: cmd.Operator.OrgId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}
// CreateFeedback 创建承接反馈
func (srv UndertakerFeedbackService) CreateFeedback(cmd *command.CreateFeedbackCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.ContractUndertakerFeedbackAdd(allied_creation_cooperation.ReqContractUndertakerFeedbackAdd{
FeedbackAttachment: cmd.FeedbackAttachment,
FeedbackContent: cmd.FeedbackContent,
CooperationContractNumber: cmd.CooperationContractNumber,
UnderTakerUid: cmd.Operator.UserId,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return resultMenu, nil
}