作者 yangfu

订单号查询修改

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