...
|
...
|
@@ -2,6 +2,7 @@ package controllers |
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
|
...
|
...
|
@@ -302,3 +303,68 @@ func (c *OrderInfoController) OrderPurposeDelivery() { |
|
|
c.ResponseData(nil)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//PageListOrderReal 获取实发订单列表
|
|
|
func (c *OrderInfoController) PageListOrderReal() {
|
|
|
type Parameter struct {
|
|
|
SearchText string `json:"searchText"`
|
|
|
Partner int64 `json:"partner"`
|
|
|
PageSize int `json:"pageSize"`
|
|
|
PageNumber int `json:"pageNumber"`
|
|
|
}
|
|
|
var (
|
|
|
param Parameter
|
|
|
err error
|
|
|
)
|
|
|
if err = c.BindJsonData(¶m); err != nil {
|
|
|
logs.Error(err)
|
|
|
c.ResponseError(errors.New("json数据解析失败"))
|
|
|
return
|
|
|
}
|
|
|
if param.PageNumber == 0 {
|
|
|
param.PageNumber = 1
|
|
|
}
|
|
|
if param.PageSize == 0 {
|
|
|
param.PageSize = 20
|
|
|
}
|
|
|
|
|
|
orderSrv := orderService.NewOrderInfoService(nil)
|
|
|
orderinfos, cnt, err := orderSrv.PageListOrderBase(orderQuery.ListOrderBaseQuery{
|
|
|
PartnerId: param.Partner,
|
|
|
DeliveryCode: param.SearchText,
|
|
|
OrderType: domain.OrderReal,
|
|
|
Limit: param.PageSize,
|
|
|
Offset: (param.PageNumber - 1) * param.PageSize,
|
|
|
})
|
|
|
if err != nil {
|
|
|
c.ResponseError(err)
|
|
|
return
|
|
|
}
|
|
|
rsp := []map[string]interface{}{}
|
|
|
for i := range orderinfos {
|
|
|
orderinfo := orderinfos[i]
|
|
|
m := map[string]interface{}{
|
|
|
"createTime": orderinfo.CreateTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"updateTime": orderinfo.UpdateTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"buyer": orderinfo.Buyer.BuyerName,
|
|
|
"id": orderinfo.Id,
|
|
|
"orderId": orderinfo.OrderCode,
|
|
|
"shipmentsId": orderinfo.DeliveryCode,
|
|
|
"partner": orderinfo.PartnerInfo.PartnerName,
|
|
|
"orderNum": orderinfo.OrderCompute.PlanOrderCount,
|
|
|
"orderPrice": orderinfo.OrderCompute.PlanOrderAmount,
|
|
|
"orderDist": orderinfo.RegionInfo.RegionName,
|
|
|
"quantityControl": "",
|
|
|
"priceControl": "",
|
|
|
}
|
|
|
if orderinfo.OrderCompute.UseOrderCount >= 0 {
|
|
|
m["quantityControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderCount)
|
|
|
}
|
|
|
if orderinfo.OrderCompute.UseOrderAmount >= 0 {
|
|
|
m["priceControl"] = fmt.Sprint(orderinfo.OrderCompute.UseOrderAmount)
|
|
|
}
|
|
|
rsp = append(rsp, m)
|
|
|
}
|
|
|
c.ResponsePageList(rsp, cnt, param.PageNumber)
|
|
|
return
|
|
|
} |
...
|
...
|
|