作者 陈志颖

feat:完善分红预算查询功能

... ... @@ -11,9 +11,9 @@ import (
// SearchDividendsEstimateQuery 查询分红预算单
type SearchDividendsEstimateQuery struct {
// 承接人分红预算单号
DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber" valid:"Required"`
DividendsEstimateOrderNumber string `cname:"承接人分红预算单号" json:"dividendsEstimateOrderNumber,omitempty"`
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `cname:"分红类型" json:"dividendsType" valid:"Required"`
DividendsType int32 `cname:"分红类型" json:"dividendsType,omitempty"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
... ...
... ... @@ -223,6 +223,12 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
var dividendsEstimateModels []*models.DividendsEstimate
dividendsEstimates := make([]*domain.DividendsEstimate, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsEstimateModels), queryOptions)
if dividendsType, ok := queryOptions["dividendsType"]; ok && dividendsType.(int32) != 0 {
query.Where("dividends_type = ?", dividendsType)
}
if dividendsEstimateOrderNumber, ok := queryOptions["dividendsEstimateOrderNumber"]; ok && dividendsEstimateOrderNumber != "" {
query.Where("dividends_estimate_order_number ilike ?", fmt.Sprintf("%%%s%%", dividendsEstimateOrderNumber))
}
offsetLimitFlag := true
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
... ...