作者 tangxuhui

添加 关联合约选择列表

package query
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type ListContractSelectorQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
CooperationContractNumber string `json:"cooperationContractNumber"`
SponsorName string `json:"sponsorName"`
}
... ...
... ... @@ -233,3 +233,26 @@ func (cooperationContractService *CooperationContractService) RemoveCooperationC
return removeCooperationContractCommand, nil
}
// 返回共创合约下拉选择列表表
func (cooperationContractService *CooperationContractService) ListCooperationContractSelector(
listCooperationContractQuery *query.ListContractSelectorQuery) (int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator)
result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
PageNumber: listCooperationContractQuery.PageNumber,
PageSize: listCooperationContractQuery.PageSize,
SponsorName: listCooperationContractQuery.SponsorName,
CooperationContractNumber: listCooperationContractQuery.CooperationContractNumber,
OrgId: listCooperationContractQuery.Operator.OrgId,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := []dto.CooperationContractItem{}
for i := range result.Grid.List {
item := dto.ToCooperationContractItem(&result.Grid.List[i], listCooperationContractQuery.Operator.OrgId)
data = append(data, *item)
}
return result.Grid.Total, data, nil
}
... ...
... ... @@ -106,3 +106,18 @@ func (controller *CooperationContractController) RemoveCooperationContract() {
data, err := cooperationContractService.RemoveCooperationContract(removeCooperationContractCommand)
controller.Response(data, err)
}
//分红订单,分红退货单获取关联合约选择列表
func (controller *CooperationContractController) SelectorContract() {
cooperationContractService := service.NewCooperationContractService(nil)
listCooperationContractQuery := &query.ListContractSelectorQuery{}
err := controller.Unmarshal(listCooperationContractQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationContractQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationContractService.ListCooperationContractSelector(listCooperationContractQuery)
controller.ReturnPageListData(int64(cnt), data, err, listCooperationContractQuery.PageNumber)
}
... ...
... ... @@ -11,4 +11,5 @@ func init() {
web.Router("/v1/web/dividends-order/remove", &web_client.DividendsOrderController{}, "Post:RemoveDividendsOrder")
web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Get:GetDividendsOrder")
web.Router("/v1/web/dividends-order/search", &web_client.DividendsOrderController{}, "Post:SearchDividendsOrder")
web.Router("/v1/web/dividends-order/selector/contract", &web_client.CooperationContractController{}, "Post:SelectorContract")
}
... ...