正在显示
2 个修改的文件
包含
50 行增加
和
21 行删除
1 | +/** | ||
2 | + @author: stevechan | ||
3 | + @date: 2021/2/2 | ||
4 | + @note: | ||
5 | +**/ | ||
6 | + | ||
7 | +package query | ||
8 | + | ||
9 | +type ListOrderBonusForExcelQuery struct { | ||
10 | + Type string `json:"type"` // 操作类型 ORDER_BASE | ||
11 | + Where BonusWhere `json:"where"` // 导出条件 | ||
12 | + IDS []int `json:"ids"` // 勾选id | ||
13 | +} | ||
14 | + | ||
15 | +type BonusWhere struct { | ||
16 | + SearchWord string `json:"searchWord"` | ||
17 | + OrderType int `json:"orderType"` | ||
18 | + PageSize int `json:"pageSize"` | ||
19 | + PageNumber int `json:"pageNumber"` | ||
20 | + PartnerCategoryId int `json:"partnerCategoryId"` | ||
21 | + CreateTime []string `json:"createTime"` | ||
22 | +} |
@@ -292,16 +292,18 @@ func (c *OrderDividendController) EditOrderRemarkBonus() { | @@ -292,16 +292,18 @@ func (c *OrderDividendController) EditOrderRemarkBonus() { | ||
292 | } | 292 | } |
293 | 293 | ||
294 | func (c *OrderDividendController) ListOrderBonusForExcel() { | 294 | func (c *OrderDividendController) ListOrderBonusForExcel() { |
295 | - type Parameter struct { | ||
296 | - SearchWord string `json:"searchWord"` | ||
297 | - OrderType int `json:"orderType"` | ||
298 | - PageSize int `json:"pageSize"` | ||
299 | - PageNumber int `json:"pageNumber"` | ||
300 | - PartnerCategoryId int `json:"partnerCategoryId"` | ||
301 | - CreateTime []string `json:"createTime"` | ||
302 | - } | 295 | + //type Parameter struct { |
296 | + // SearchWord string `json:"searchWord"` | ||
297 | + // OrderType int `json:"orderType"` | ||
298 | + // PageSize int `json:"pageSize"` | ||
299 | + // PageNumber int `json:"pageNumber"` | ||
300 | + // PartnerCategoryId int `json:"partnerCategoryId"` | ||
301 | + // CreateTime []string `json:"createTime"` | ||
302 | + //} | ||
303 | + | ||
303 | var ( | 304 | var ( |
304 | - param Parameter | 305 | + //param Parameter |
306 | + param orderQuery.ListOrderBonusForExcelQuery | ||
305 | err error | 307 | err error |
306 | ) | 308 | ) |
307 | if err = c.BindJsonData(¶m); err != nil { | 309 | if err = c.BindJsonData(¶m); err != nil { |
@@ -309,9 +311,14 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | @@ -309,9 +311,14 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | ||
309 | c.ResponseError(errors.New("json数据解析失败")) | 311 | c.ResponseError(errors.New("json数据解析失败")) |
310 | return | 312 | return |
311 | } | 313 | } |
312 | - if !(param.OrderType == 0 || | ||
313 | - param.OrderType == domain.OrderReal || | ||
314 | - param.OrderType == domain.OrderTypeBestShop) { | 314 | + if param.Type != "ORDER_DIVIDEND" { |
315 | + logs.Error(err) | ||
316 | + c.ResponseError(errors.New("错误的操作类型")) | ||
317 | + return | ||
318 | + } | ||
319 | + if !(param.Where.OrderType == 0 || | ||
320 | + param.Where.OrderType == domain.OrderReal || | ||
321 | + param.Where.OrderType == domain.OrderTypeBestShop) { | ||
315 | c.ResponseError(errors.New("参数异常")) | 322 | c.ResponseError(errors.New("参数异常")) |
316 | return | 323 | return |
317 | } | 324 | } |
@@ -319,9 +326,9 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | @@ -319,9 +326,9 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | ||
319 | createTimeBegin string | 326 | createTimeBegin string |
320 | createTimeEnd string | 327 | createTimeEnd string |
321 | ) | 328 | ) |
322 | - if len(param.CreateTime) > 0 { | ||
323 | - if len(param.CreateTime[0]) > 0 { | ||
324 | - t, err := time.ParseInLocation("2006-01-02", param.CreateTime[0], time.Local) | 329 | + if len(param.Where.CreateTime) > 0 { |
330 | + if len(param.Where.CreateTime[0]) > 0 { | ||
331 | + t, err := time.ParseInLocation("2006-01-02", param.Where.CreateTime[0], time.Local) | ||
325 | if err != nil { | 332 | if err != nil { |
326 | c.ResponseError(errors.New("UpdateTimeBegin 时间格式错误")) | 333 | c.ResponseError(errors.New("UpdateTimeBegin 时间格式错误")) |
327 | return | 334 | return |
@@ -329,9 +336,9 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | @@ -329,9 +336,9 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | ||
329 | createTimeBegin = t.Format("2006-01-02 15:04:05-07") | 336 | createTimeBegin = t.Format("2006-01-02 15:04:05-07") |
330 | } | 337 | } |
331 | } | 338 | } |
332 | - if len(param.CreateTime) > 1 { | ||
333 | - if len(param.CreateTime[1]) > 0 { | ||
334 | - t, err := time.ParseInLocation("2006-01-02", param.CreateTime[1], time.Local) | 339 | + if len(param.Where.CreateTime) > 1 { |
340 | + if len(param.Where.CreateTime[1]) > 0 { | ||
341 | + t, err := time.ParseInLocation("2006-01-02", param.Where.CreateTime[1], time.Local) | ||
335 | if err != nil { | 342 | if err != nil { |
336 | c.ResponseError(errors.New("UpdateTimeEnd 时间格式错误")) | 343 | c.ResponseError(errors.New("UpdateTimeEnd 时间格式错误")) |
337 | return | 344 | return |
@@ -345,10 +352,10 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | @@ -345,10 +352,10 @@ func (c *OrderDividendController) ListOrderBonusForExcel() { | ||
345 | orderSrv := orderService.NewOrderInfoService(nil) | 352 | orderSrv := orderService.NewOrderInfoService(nil) |
346 | dataResult, column, err := orderSrv.ListOrderBonusForExcel( | 353 | dataResult, column, err := orderSrv.ListOrderBonusForExcel( |
347 | orderQuery.ListOrderBonusQuery{ | 354 | orderQuery.ListOrderBonusQuery{ |
348 | - OrderType: param.OrderType, | ||
349 | - PartnerOrCode: param.SearchWord, | 355 | + OrderType: param.Where.OrderType, |
356 | + PartnerOrCode: param.Where.SearchWord, | ||
350 | CompanyId: companyId, | 357 | CompanyId: companyId, |
351 | - PartnerCategory: param.PartnerCategoryId, | 358 | + PartnerCategory: param.Where.PartnerCategoryId, |
352 | CreateTimeBegin: createTimeBegin, | 359 | CreateTimeBegin: createTimeBegin, |
353 | CreateTimeEnd: createTimeEnd, | 360 | CreateTimeEnd: createTimeEnd, |
354 | }) | 361 | }) |
-
请 注册 或 登录 后发表评论