|
@@ -2,6 +2,7 @@ package service
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"history"
|
|
|
"log"
|
|
|
"os"
|
|
@@ -410,7 +411,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
items := strings.Split(v["item"].(string), ",")
|
|
|
for _, i := range items {
|
|
|
- if len(items) > 1 &&v["itemdist"]!=nil{
|
|
|
+ if len(items) > 1 && v["itemdist"] != nil {
|
|
|
v["matchkey"] = v["itemdist"].(map[string]interface{})[i]
|
|
|
v["item"] = i
|
|
|
}
|
|
@@ -457,7 +458,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
items := strings.Split(v["item"].(string), ",")
|
|
|
for _, i := range items {
|
|
|
- if len(items) > 1 &&v["itemdist"]!=nil{
|
|
|
+ if len(items) > 1 && v["itemdist"] != nil {
|
|
|
v["matchkey"] = v["itemdist"].(map[string]interface{})[i]
|
|
|
v["item"] = i
|
|
|
}
|
|
@@ -523,7 +524,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
items := strings.Split(v["item"].(string), ",")
|
|
|
for _, i := range items {
|
|
|
- if len(items) > 1 &&v["itemdist"]!=nil{
|
|
|
+ if len(items) > 1 && v["itemdist"] != nil {
|
|
|
v["matchkey"] = v["itemdist"].(map[string]interface{})[i]
|
|
|
v["item"] = i
|
|
|
}
|
|
@@ -584,7 +585,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
items := strings.Split(v["item"].(string), ",")
|
|
|
for _, i := range items {
|
|
|
- if len(items) > 1 &&v["itemdist"]!=nil{
|
|
|
+ if len(items) > 1 && v["itemdist"] != nil {
|
|
|
v["matchkey"] = v["itemdist"].(map[string]interface{})[i]
|
|
|
v["item"] = i
|
|
|
}
|
|
@@ -652,7 +653,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
items := strings.Split(v["item"].(string), ",")
|
|
|
for _, i := range items {
|
|
|
- if len(items) > 1 &&v["itemdist"]!=nil{
|
|
|
+ if len(items) > 1 && v["itemdist"] != nil {
|
|
|
v["matchkey"] = v["itemdist"].(map[string]interface{})[i]
|
|
|
v["item"] = i
|
|
|
}
|
|
@@ -718,7 +719,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
//xf.Sheets[0].Name = "详细数据"
|
|
|
//生文件
|
|
|
- t := strconv.FormatInt(time.Now().Unix(), 10)
|
|
|
+ //t := strconv.FormatInt(time.Now().Unix(), 10)
|
|
|
+ t := time.Now().Format("20060102")
|
|
|
dir := "./web/res/xlsx/" + t + "/"
|
|
|
if b, _ := history.PathExists(dir); !b {
|
|
|
err1 := os.MkdirAll(dir, os.ModePerm)
|
|
@@ -726,8 +728,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
log.Println("mkdir err", dir)
|
|
|
}
|
|
|
}
|
|
|
- fname := t + ".xlsx"
|
|
|
- //err = xf.Save(dir + fname)
|
|
|
+ fname := fmt.Sprintf("%s_%s_%s.xlsx", fn, t,qu.GetRandom(4))
|
|
|
+ log.Println("fname", fname)
|
|
|
err = newFile.Save(dir + fname)
|
|
|
if err != nil {
|
|
|
log.Println("xls error", fname)
|