作者 tangxuhui

补充分红单路由

... ... @@ -15,7 +15,7 @@ type DividendsOrder struct {
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
... ...
package query
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
type SelectorDividendsOrderQuery struct {
Operator domain.Operator `json:"-"`
DividendsOrderNumber string `json:"DividendsOrderNumber"`
}
... ...
... ... @@ -84,6 +84,31 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide
return updateDividendsReturnedOrderCommand, nil
}
// 更新分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) SelectorDividendsOrder(selectorDividendsOrderQuery *query.SelectorDividendsOrderQuery) (
int, interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(selectorDividendsOrderQuery.Operator)
result, err := creationCooperationGateway.DividendsOrderSearch(allied_creation_cooperation.ReqDividendsOrderSearch{
DividendsOrderNumber: selectorDividendsOrderQuery.DividendsOrderNumber,
PageNumber: 1,
PageSize: 999,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
listData := []map[string]interface{}{}
for _, v := range result.Gride.List {
m := map[string]interface{}{
"dividendsOrderNumber": v.DividendsOrderNumber,
"dividendsOriginalOrderNum": v.DividendsOriginalOrderNum,
"dividendsOrderId": strconv.Itoa(v.DividendsOrderID),
"dividendTime": v.DividendTime.Unix(),
}
listData = append(listData, m)
}
return result.Gride.Total, listData, nil
}
func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService {
newDividendsReturnedOrderService := &DividendsReturnedOrderService{}
return newDividendsReturnedOrderService
... ...
... ... @@ -15,7 +15,7 @@ type DividendsOrder struct {
DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
... ...
... ... @@ -70,3 +70,15 @@ func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder
cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery)
controller.ReturnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber)
}
func (controller *DividendsReturnedOrderController) SelectorDividendsOrder() {
dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil)
selectorDividendsOrderQuery := &query.SelectorDividendsOrderQuery{}
err := controller.Unmarshal(selectorDividendsOrderQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
selectorDividendsOrderQuery.Operator = controller.GetOperator()
cnt, data, err := dividendsReturnedOrderService.SelectorDividendsOrder(selectorDividendsOrderQuery)
controller.ReturnPageListData(int64(cnt), data, err, 0)
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
)
func init() {
web.Router("/v1/web/dividends-order/", &web_client.DividendsOrderController{}, "Post:CreateDividendsOrder")
web.Router("/v1/web/dividends-order/:orderId", &web_client.DividendsOrderController{}, "Put:UpdateDividendsOrder")
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")
}
... ...
... ... @@ -11,4 +11,5 @@ func init() {
web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder")
web.Router("/v1/web/dividends-returned-order/selector/dividends-order", &web_client.DividendsReturnedOrderController{}, "Post:SelectorDividendsOrder")
}
... ...