...
|
...
|
@@ -871,6 +871,7 @@ func (service OrderInfoService) PageListOrderBonus(listOrderQuery query.ListOrde |
|
|
listIndex := listOrderQuery.Offset + (1 + i)
|
|
|
listItem := map[string]interface{}{
|
|
|
"index": listIndex,
|
|
|
"createTime": orders[i].CreateTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"updateTime": orders[i].UpdateTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
"id": orders[i].Id,
|
|
|
"shipmentsId": orders[i].DeliveryCode,
|
...
|
...
|
@@ -1315,7 +1316,7 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List |
|
|
[2]string{"delivery_code", "发货单号"},
|
|
|
[2]string{"partner_name", "合伙人"},
|
|
|
[2]string{"bonus_status", "支付状态"},
|
|
|
[2]string{"update_time", "最后操作时间"},
|
|
|
[2]string{"create_time", "创建时间"},
|
|
|
[2]string{"partner_bonus", "应收分红"},
|
|
|
[2]string{"partner_bonus_has", "已收分红"},
|
|
|
[2]string{"partner_bonus_not", "未收分红"},
|
...
|
...
|
@@ -1323,3 +1324,74 @@ func (service OrderInfoService) ListOrderBonusForExcel(listOrderQuery query.List |
|
|
}
|
|
|
return resultMaps, column, nil
|
|
|
}
|
|
|
|
|
|
func (service OrderInfoService) ListOrderForExcel(listOrderQuery query.ListOrderBaseQuery) ([]map[string]string, [][2]string, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
var (
|
|
|
orderBaseDao *dao.OrderBaseDao
|
|
|
)
|
|
|
|
|
|
if orderBaseDao, err = factory.CreateOrderBaseDao(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, nil, lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
ordersData, err := orderBaseDao.OrderListForExcel(
|
|
|
listOrderQuery.CompanyId,
|
|
|
listOrderQuery.PartnerOrCode,
|
|
|
[2]string{listOrderQuery.UpdateTimeBegin, listOrderQuery.UpdateTimeEnd},
|
|
|
[2]string{listOrderQuery.CreateTimeBegin, listOrderQuery.UpdateTimeEnd},
|
|
|
listOrderQuery.PartnerCategory,
|
|
|
)
|
|
|
if err != nil {
|
|
|
return nil, nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
err = transactionContext.CommitTransaction()
|
|
|
if err != nil {
|
|
|
return nil, nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
var resultMaps []map[string]string
|
|
|
for i := range ordersData {
|
|
|
m := map[string]string{
|
|
|
"num": fmt.Sprint(i + 1),
|
|
|
"order_code": ordersData[i].OrderCode,
|
|
|
"delivery_code": ordersData[i].DeliveryCode,
|
|
|
"partner_name": ordersData[i].PartnerName,
|
|
|
"update_time": ordersData[i].UpdateTime,
|
|
|
"create_time": ordersData[i].CreateTime,
|
|
|
"plan_order_count": fmt.Sprint(ordersData[i].PlanOrderCount),
|
|
|
"use_order_count": fmt.Sprint(ordersData[i].UseOrderCount),
|
|
|
"region_name": fmt.Sprint(ordersData[i].RegionName),
|
|
|
"plan_order_amount": fmt.Sprint(ordersData[i].PlanOrderAmount),
|
|
|
"user_order_amount": fmt.Sprint(ordersData[i].UseOrderAmount),
|
|
|
"partner_category": ordersData[i].PartnerCategory,
|
|
|
"buyer_name": ordersData[i].BuyerName,
|
|
|
}
|
|
|
resultMaps = append(resultMaps, m)
|
|
|
}
|
|
|
column := [][2]string{
|
|
|
[2]string{"num", "序号"},
|
|
|
[2]string{"order_code", "订单号"},
|
|
|
[2]string{"delivery_code", "发货单号"},
|
|
|
[2]string{"create_time", "创建时间"},
|
|
|
[2]string{"update_time", "更新时间"},
|
|
|
[2]string{"plan_order_count", "订单数量"},
|
|
|
[2]string{"use_order_count", "数量调整"},
|
|
|
[2]string{"plan_order_amount", "订单金额"},
|
|
|
[2]string{"use_order_amount", "金额调整"},
|
|
|
[2]string{"region_name", "订单区域"},
|
|
|
[2]string{"partner_category", "合伙人类型"},
|
|
|
[2]string{"buyer_name", "客户"},
|
|
|
[2]string{"partner_name", "合伙人"},
|
|
|
}
|
|
|
return resultMaps, column, nil
|
|
|
} |
...
|
...
|
|