|
@@ -1,22 +1,23 @@
|
|
package service
|
|
package service
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "cmplatform/push"
|
|
|
|
+ "cmplatform/util"
|
|
|
|
+ "fmt"
|
|
|
|
+ "io"
|
|
|
|
+ "mime/multipart"
|
|
|
|
+ "strings"
|
|
|
|
+ "time"
|
|
|
|
+
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
elastic "app.yhyue.com/moapp/jybase/es"
|
|
elastic "app.yhyue.com/moapp/jybase/es"
|
|
"app.yhyue.com/moapp/jybase/go-xweb/log"
|
|
"app.yhyue.com/moapp/jybase/go-xweb/log"
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
"app.yhyue.com/moapp/jybase/mongodb"
|
|
- "cmplatform/push"
|
|
|
|
- "cmplatform/util"
|
|
|
|
- "fmt"
|
|
|
|
es "github.com/olivere/elastic/v7"
|
|
es "github.com/olivere/elastic/v7"
|
|
"github.com/tealeg/xlsx"
|
|
"github.com/tealeg/xlsx"
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
- "io"
|
|
|
|
- "mime/multipart"
|
|
|
|
- "strings"
|
|
|
|
- "time"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
type EntData struct {
|
|
type EntData struct {
|
|
@@ -167,11 +168,11 @@ func ImportDataByExcel(mf multipart.File, eid int64, entid string) (int, int64,
|
|
}
|
|
}
|
|
} else if fMap[index] == "bidopentime" || fMap[index] == "publishtime" || fMap[index] == "docstarttime" || fMap[index] == "bidstarttime" || fMap[index] == "bidendtime" {
|
|
} else if fMap[index] == "bidopentime" || fMap[index] == "publishtime" || fMap[index] == "docstarttime" || fMap[index] == "bidstarttime" || fMap[index] == "bidendtime" {
|
|
if cell.Type() == xlsx.CellTypeNumeric {
|
|
if cell.Type() == xlsx.CellTypeNumeric {
|
|
- date, err := cell.GetTime(false)
|
|
|
|
|
|
+ dates, err := cell.GetTime(false)
|
|
if err != nil {
|
|
if err != nil {
|
|
- log.Debug("Error getting date:", err)
|
|
|
|
|
|
+ log.Debug("Error getting dates:", err)
|
|
} else {
|
|
} else {
|
|
- tmp[fMap[index]] = date.Format(time.DateOnly)
|
|
|
|
|
|
+ tmp[fMap[index]] = dates.Format(date.Date_Short_Layout)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
tmp[fMap[index]] = val
|
|
tmp[fMap[index]] = val
|