作者 yangfu

共创申请修改

... ... @@ -13,7 +13,7 @@ type CreateCooperationApplicationCommand struct {
// 共创申请描述
CooperationApplicationDescription string `json:"cooperationApplicationDescription" valid:"Required"`
// 申请人的id
UserId int `json:"userId"`
//ApplicantUid int `json:"userId"`
//
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 附件列表
... ...
... ... @@ -11,7 +11,7 @@ type ListCooperationApplicationQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber" valid:"Required"`
PageNumber int `json:"pageIndex" valid:"Required"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
//审核状态
... ...
... ... @@ -10,6 +10,12 @@ import (
type CreateFeedbackCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 合约承接方反馈内容附件
FeedbackAttachment []*domain.Attachment `cname:"合约承接方反馈内容附件" json:"feedbackAttachment"`
// 合约承接方反馈内容
FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"`
// 共创合约编号
CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
}
func (cmd *CreateFeedbackCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -10,6 +10,10 @@ import (
type SearchFeedbackCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
}
func (cmd *SearchFeedbackCommand) Valid(validation *validation.Validation) {
... ...
... ... @@ -81,7 +81,7 @@ func (srv CooperationApplicationsService) CreateCooperationApplications(createAp
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
createApplicationsCommand.Operator)
result, err := creationCooperationGateway.CooperationApplicationAdd(allied_creation_cooperation.ReqCooperationApplicationAdd{
ApplicantUid: strconv.Itoa(createApplicationsCommand.UserId),
ApplicantUid: strconv.Itoa(int(createApplicationsCommand.Operator.UserId)),
CooperationApplicationDescription: createApplicationsCommand.CooperationApplicationDescription,
CooperationApplicationAttachment: createApplicationsCommand.Attachment,
CooperationProjectNumber: createApplicationsCommand.CooperationProjectNumber,
... ...
... ... @@ -3,7 +3,7 @@ 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_user"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// UndertakerFeedbackService 承接反馈服务
... ... @@ -11,31 +11,31 @@ type UndertakerFeedbackService struct {
}
// CreateCooperationProject TODO:承接反馈列表
func (srv UndertakerFeedbackService) SearchFeedback(userMenusCommand *command.SearchFeedbackCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
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,
PageSize: cmd.PageSize,
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return resultMenu, nil
}
// CreateCooperationProject TODO:创建承接反馈
func (srv UndertakerFeedbackService) CreateFeedback(userMenusCommand *command.CreateFeedbackCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
userMenusCommand.Operator)
resultMenu, err := creationUserGateway.UserAccessMenus(allied_creation_user.ReqUserAccessMenus{
UserId: int(userMenusCommand.Operator.UserId),
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 map[string]interface{}{
"accessMenus": resultMenu.Menus,
}, nil
return resultMenu, nil
}
... ...
package allied_creation_cooperation
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
//创建共创合约反馈信息
type (
ReqContractUndertakerFeedbackAdd struct {
// 合约承接方反馈内容附件
FeedbackAttachment []*domain.Attachment `cname:"合约承接方反馈内容附件" json:"feedbackAttachment"`
// 合约承接方反馈内容
FeedbackContent string `cname:"合约承接方反馈内容" json:"feedbackContent" valid:"Required"`
// 共创合约编号
CooperationContractNumber string `cname:"共创合约编号" json:"cooperationContractNumber" valid:"Required"`
// 承接人uid
UnderTakerUid int64 `cname:"承接人uid" json:"underTakerUid,string,omitempty"`
}
DataContractUndertakerFeedbackAdd struct {
... ... @@ -22,9 +32,29 @@ type (
//查询共创承接方反馈信息
type (
ReqContractUndertakerFeedbackSearch struct {
// 页面大小
PageNumber int64 `cname:"页码" json:"pageNumber,omitempty"`
// 页面大小
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
}
DataContractUndertakerFeedbackSearch struct {
Grid struct {
List []struct {
FeedbackID string `json:"feedbackId"`
FeedbackAttachment interface{} `json:"feedbackAttachment"`
FeedbackContent string `json:"feedbackContent"`
CooperationContractNumber string `json:"cooperationContractNumber"`
CooperationContractName string `json:"cooperationContractName"`
ContractUndertaker interface{} `json:"contractUndertaker"`
Org interface{} `json:"org"`
Company interface{} `json:"company"`
//UpdatedAt time.Time `json:"updatedAt"`
//DeletedAt time.Time `json:"deletedAt"`
//CreatedAt time.Time `json:"createdAt"`
} `json:"list"`
Total int `json:"total"`
} `json:"grid"`
}
)
... ...
... ... @@ -265,7 +265,7 @@ type (
//返回共创申请详情
type (
ReqCooperationApplicationGet struct {
CooperationApplicationId int `json:"cooperationApplicationId"`
CooperationApplicationId int `json:"cooperationApplicationId,string"`
}
DataCooperationApplicationGet struct {
... ...
... ... @@ -100,8 +100,7 @@ func (controller *CooperationController) CreateCooperationApplication() {
cmd := &command.CreateCooperationApplicationCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
log.Logger.Error(err.Error())
}
cmd.Operator = controller.GetOperator()
data, err := svr.CreateCooperationApplications(cmd)
... ...
... ... @@ -24,7 +24,7 @@ func init() {
/***** 承接反馈 *****/
web.Router("/v1/app/contract-undertaker-feedbacks", &mobile_client.CooperationController{}, "Post:CreateFeedback")
web.Router("/v1/app/contract-undertaker-feedbacks/search", &mobile_client.CooperationController{}, "Get:SearchFeedback")
web.Router("/v1/app/contract-undertaker-feedbacks/search", &mobile_client.CooperationController{}, "Post:SearchFeedback")
/***** CompanyDividends 共创项目 *****/
web.Router("/v1/app/cooperation-projects", &mobile_client.CooperationController{}, "Post:CreateCooperationProject")
... ...