作者 yangfu

订单号查询修改

@@ -12,6 +12,8 @@ import ( @@ -12,6 +12,8 @@ import (
12 type SearchDividendsEstimateQuery struct { 12 type SearchDividendsEstimateQuery struct {
13 // 承接人分红预算单号 13 // 承接人分红预算单号
14 DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"` 14 DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"`
  15 + // 分红订单号或退货单号
  16 + MatchOrderOrReturnedOrderNum string `json:"matchOrderOrReturnedOrderNum"`
15 // 分红类型,1订单分红,2退货冲销,3金额激励 17 // 分红类型,1订单分红,2退货冲销,3金额激励
16 DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"` 18 DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"`
17 // 公司ID,通过集成REST上下文获取 19 // 公司ID,通过集成REST上下文获取
@@ -11,6 +11,8 @@ import ( @@ -11,6 +11,8 @@ import (
11 type SearchDividendsOrderQuery struct { 11 type SearchDividendsOrderQuery struct {
12 // 分红订单号 12 // 分红订单号
13 DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"` 13 DividendsOrderNumber string `cname:"分红订单号" json:"dividendsOrderNumber,omitempty"`
  14 + // 来源单号
  15 + DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
14 // 客户名称 16 // 客户名称
15 CustomerName string `cname:"客户名称" json:"customerName,omitempty"` 17 CustomerName string `cname:"客户名称" json:"customerName,omitempty"`
16 // 页面大小 18 // 页面大小
@@ -13,6 +13,8 @@ type SearchDividendsReturnedOrderQuery struct { @@ -13,6 +13,8 @@ type SearchDividendsReturnedOrderQuery struct {
13 DividendsReturnedCustomerName string `cname:"退货客户姓名" json:"dividendsReturnedCustomerName,omitempty"` 13 DividendsReturnedCustomerName string `cname:"退货客户姓名" json:"dividendsReturnedCustomerName,omitempty"`
14 // 分红退货单号 14 // 分红退货单号
15 DividendsReturnedOrderNumber string `cname:"分红退货单号" json:"dividendsReturnedOrderNumber,omitempty"` 15 DividendsReturnedOrderNumber string `cname:"分红退货单号" json:"dividendsReturnedOrderNumber,omitempty"`
  16 + //源单号(原始订单号)
  17 + OriginalOrderNum string `json:"originalOrderNum"`
16 // 页面大小 18 // 页面大小
17 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"` 19 PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
18 // 页面大小 20 // 页面大小
@@ -348,7 +348,10 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte @@ -348,7 +348,10 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
348 query.Where("order_good_id = ?", orderGoodId) 348 query.Where("order_good_id = ?", orderGoodId)
349 } 349 }
350 if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" { 350 if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" {
351 - query.Where("dividends_estimate_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber)) 351 + query.Where("dividends_estimate_order_number like ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber))
  352 + }
  353 + if matchOrderOrReturnedOrderNum, ok := queryOptions["matchOrderOrReturnedOrderNum"]; ok && matchOrderOrReturnedOrderNum != "" {
  354 + query.Where("order_or_returned_order_num like ?", fmt.Sprintf("%%%s%%", matchOrderOrReturnedOrderNum))
352 } 355 }
353 if dividendsEstimateIds, ok := queryOptions["dividendsEstimateIds"]; ok && len(dividendsEstimateIds.([]int64)) > 0 { 356 if dividendsEstimateIds, ok := queryOptions["dividendsEstimateIds"]; ok && len(dividendsEstimateIds.([]int64)) > 0 {
354 query.Where("dividends_estimate_id IN (?)", pg.In(dividendsEstimateIds)) 357 query.Where("dividends_estimate_id IN (?)", pg.In(dividendsEstimateIds))
@@ -558,7 +558,10 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa @@ -558,7 +558,10 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa
558 dividendsOrders := make([]*domain.DividendsOrder, 0) 558 dividendsOrders := make([]*domain.DividendsOrder, 0)
559 query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions) 559 query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions)
560 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" { 560 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
561 - query.Where("dividends_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber)) 561 + query.Where("dividends_order_number like ?", fmt.Sprintf("%%%s%%", dividendsOrderNumber))
  562 + }
  563 + if dividendsOriginalOrderNum, ok := queryOptions["dividendsOriginalOrderNum"]; ok && dividendsOriginalOrderNum != "" {
  564 + query.Where("dividends_original_order_num like ?", fmt.Sprintf("%%%s%%", dividendsOriginalOrderNum))
562 } 565 }
563 if dividendsOrderNumbers, ok := queryOptions["dividendsOrderNumbers"]; ok && len(dividendsOrderNumbers.([]string)) > 0 { 566 if dividendsOrderNumbers, ok := queryOptions["dividendsOrderNumbers"]; ok && len(dividendsOrderNumbers.([]string)) > 0 {
564 query.Where("dividends_order_number IN (?)", pg.In(dividendsOrderNumbers.([]string))) 567 query.Where("dividends_order_number IN (?)", pg.In(dividendsOrderNumbers.([]string)))
@@ -574,8 +574,11 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string @@ -574,8 +574,11 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string
574 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" { 574 if dividendsOrderNumber, ok := queryOptions["dividendsOrderNumber"]; ok && dividendsOrderNumber != "" {
575 query.Where("dividends_order_number = ?", dividendsOrderNumber) 575 query.Where("dividends_order_number = ?", dividendsOrderNumber)
576 } 576 }
  577 + if originalOrderNum, ok := queryOptions["originalOrderNum"]; ok && originalOrderNum != "" {
  578 + query.Where("original_order_num like ?", fmt.Sprintf("%%%s%%", originalOrderNum))
  579 + }
577 if dividendsReturnedOrderNumber, ok := queryOptions["dividendsReturnedOrderNumber"]; ok && dividendsReturnedOrderNumber != "" { 580 if dividendsReturnedOrderNumber, ok := queryOptions["dividendsReturnedOrderNumber"]; ok && dividendsReturnedOrderNumber != "" {
578 - query.Where("dividends_returned_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber)) 581 + query.Where("dividends_returned_order_number like ?", fmt.Sprintf("%%%s%%", dividendsReturnedOrderNumber))
579 } 582 }
580 if dividendsReturnedOrderNumbers, ok := queryOptions["dividendsReturnedOrderNumbers"]; ok && len(dividendsReturnedOrderNumbers.([]string)) > 0 { 583 if dividendsReturnedOrderNumbers, ok := queryOptions["dividendsReturnedOrderNumbers"]; ok && len(dividendsReturnedOrderNumbers.([]string)) > 0 {
581 query.Where("dividends_returned_order_number IN (?)", pg.In(dividendsReturnedOrderNumbers.([]string))) 584 query.Where("dividends_returned_order_number IN (?)", pg.In(dividendsReturnedOrderNumbers.([]string)))