From b243875e653a35649dc7090203d640cba9b814fd Mon Sep 17 00:00:00 2001 From: yinbentan <yinbentan@live.com> Date: 星期六, 06 七月 2024 16:50:39 +0800 Subject: [PATCH] 未选仓库的时候统计产品数量错误bug修复 --- service/input_history_search.go | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/service/input_history_search.go b/service/input_history_search.go index 68b61f9..144d9ed 100644 --- a/service/input_history_search.go +++ b/service/input_history_search.go @@ -61,6 +61,9 @@ } for _, record := range records { + if operationMap[record.OperationId] == nil { + continue + } AddNewHistoryReportRecord(record, operationMap[record.OperationId]) } return nil @@ -97,12 +100,13 @@ func SearchHistoryReport(keyword string, operationType constvar.BaseOperationType, page, pageSize int) (recordIds []int, total uint64, err error) { var ids []string from := (page - 1) * pageSize - t, err := parseDateString(keyword) + t, err := time.ParseInLocation("20060102", keyword, time.Local) + //t, err := parseDateString(keyword) m := make(map[string]interface{}) if operationType > 0 { m["baseOperationType"] = operationType } - if err != nil && t.IsZero() { + if err != nil || t.IsZero() { ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, m, from, pageSize) } else { ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, m, from, pageSize) -- Gitblit v1.8.0