From 52177a1d16cf22a928936368cb3c6c4b46ad356e Mon Sep 17 00:00:00 2001
From: muzexing <muzexing@qq.com>
Date: 星期四, 04 七月 2024 20:39:03 +0800
Subject: [PATCH] 出库/入库打印 修改bug
---
service/input_history_search.go | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/service/input_history_search.go b/service/input_history_search.go
index e81a10d..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,11 +100,16 @@
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)
- if err != nil && t.IsZero() {
- ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, map[string]interface{}{"baseOperationType": operationType}, from, pageSize)
+ 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() {
+ ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, m, from, pageSize)
} else {
- ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, map[string]interface{}{"baseOperationType": operationType}, from, pageSize)
+ ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, m, from, pageSize)
}
if err != nil {
--
Gitblit v1.8.0