作者 tangxuhui

数据调整

... ... @@ -11,7 +11,7 @@ type GetCooperationContractQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创合约ID
CooperationContractId int `json:"cooperationContractId,string" valid:"Required"`
CooperationContractId int `json:"cooperationContractId,string"`
}
func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -8,7 +8,8 @@ type GetDividendsOrderQuery struct {
//操作人
Operator domain.Operator `json:"-"`
// 分红订单ID
DividendsOrderId int `json:"dividendsOrderId,string" valid:"Required"`
DividendsOrderId int `json:"dividendsOrderId,string" valid:"Required"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
}
// func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -55,12 +55,10 @@ func (dividendsOrderService *DividendsOrderService) CreateDividendsOrder(createD
// 返回分红订单实体对象
func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividendsOrderQuery *query.GetDividendsOrderQuery) (interface{}, error) {
// if err := getDividendsOrderQuery.ValidateQuery(); err != nil {
// return nil, application.ThrowError(application.ARG_ERROR, err.Error())
// }
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderGet(allied_creation_cooperation.ReqDividendsOrderGet{
DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
DividendsOrderId: getDividendsOrderQuery.DividendsOrderId,
DividendsOrderNumber: getDividendsOrderQuery.DividendsOrderNumber,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -203,6 +203,9 @@ func (gateway HttplibAlliedCreationCooperation) DividendsOrderGet(param ReqDivid
url := gateway.baseUrL + "/dividends-orders/" + strconv.Itoa(param.DividendsOrderId)
method := "GET"
req := gateway.CreateRequest(url, method)
if len(param.DividendsOrderNumber) > 0 {
req.Param("dividendsOrderNumber", param.DividendsOrderNumber)
}
log.Logger.Debug("向业务模块请求数据:返回分红订单详情。", map[string]interface{}{
"api": method + ":" + url,
"param": param,
... ...
... ... @@ -172,7 +172,8 @@ type (
//返回分红订单详情
type (
ReqDividendsOrderGet struct {
DividendsOrderId int `json:"dividendsOrderId"`
DividendsOrderId int `json:"dividendsOrderId"`
DividendsOrderNumber string `json:"dividendsOrderNumber"`
}
DataDividendsOrderGet struct {
... ...
... ... @@ -60,7 +60,9 @@ func (controller *DividendsOrderController) GetDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
getDividendsOrderQuery := &query.GetDividendsOrderQuery{}
orderId, _ := controller.GetInt(":orderId")
dividendsOrderNumber := controller.GetString("dividendsOrderNumber")
getDividendsOrderQuery.DividendsOrderId = orderId
getDividendsOrderQuery.DividendsOrderNumber = dividendsOrderNumber
getDividendsOrderQuery.Operator = controller.GetOperator()
data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery)
controller.Response(data, err)
... ...