|
@@ -446,6 +446,14 @@ func (s *SecondPush) HistoryRuleEdit() {
|
|
|
|
|
|
func GetXlsxs(mMap []map[string]interface{}, fn, email, id, appid string) {
|
|
|
if id != "" {
|
|
|
+ isfile := false
|
|
|
+ isfilehref := false
|
|
|
+ if history.FileTextAppidMap[appid] {
|
|
|
+ isfile = true
|
|
|
+ }
|
|
|
+ if history.NeedFilehrefAppidMap[appid] {
|
|
|
+ isfilehref = true
|
|
|
+ }
|
|
|
query := bson.M{
|
|
|
"_id": bson.ObjectIdHex(id),
|
|
|
}
|
|
@@ -457,6 +465,11 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id, appid string) {
|
|
|
log.Println("fields file not foud", err.Error())
|
|
|
}
|
|
|
newFile := xlsx.NewFile()
|
|
|
+ style := xlsx.NewStyle()
|
|
|
+ style.Font.Size = 12
|
|
|
+ style.Font.Bold = true
|
|
|
+ style.Alignment.Vertical = "center"
|
|
|
+ style.Alignment.Horizontal = "center"
|
|
|
if dataType == 1 {
|
|
|
sh := xf.Sheets[0]
|
|
|
sheetIndex := map[string]int{}
|
|
@@ -509,6 +522,16 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id, appid string) {
|
|
|
//xf.Sheets = xf.Sheets[0:1]
|
|
|
} else if dataType == 2 {
|
|
|
sh := xf.Sheets[1]
|
|
|
+ if isfile {
|
|
|
+ cell := sh.Rows[0].AddCell()
|
|
|
+ cell.SetValue("附件")
|
|
|
+ cell.SetStyle(style)
|
|
|
+ }
|
|
|
+ if isfilehref {
|
|
|
+ cell := sh.Rows[0].AddCell()
|
|
|
+ cell.SetValue("附件链接")
|
|
|
+ cell.SetStyle(style)
|
|
|
+ }
|
|
|
for _, v := range mMap {
|
|
|
if v["item"].(string) == "" {
|
|
|
v["item"] = "其他方式"
|
|
@@ -570,32 +593,31 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id, appid string) {
|
|
|
row.AddCell().SetValue(v["company_email"])
|
|
|
ids := SE.EncodeString(qu.ObjToString(v["id"]))
|
|
|
row.AddCell().SetValue(ids)
|
|
|
- if history.NeedFilehrefAppidMap[appid] == true {
|
|
|
+ if isfile {
|
|
|
+ row.AddCell().SetValue(v["filetext"])
|
|
|
+ }
|
|
|
+ if isfilehref {
|
|
|
if v["filehref"] != nil {
|
|
|
if filelist, ok := v["filehref"].([]interface{}); ok {
|
|
|
index := 0
|
|
|
for _, url := range filelist {
|
|
|
if urlMap, ok := url.(map[string]interface{}); ok {
|
|
|
if urlMap["url"] != nil {
|
|
|
+ style1 := xlsx.NewStyle()
|
|
|
+ style1.Font.Name = "宋体"
|
|
|
+ style1.Font.Size = 12
|
|
|
+ style1.Font.Bold = false
|
|
|
if history.FilterFilehrefAppidMap[appid] {
|
|
|
if strings.Contains(urlMap["url"].(string), "jy-datafile.oss-cn-beijing.aliyuncs.com") {
|
|
|
- if index > 0 {
|
|
|
- cell := row.AddCell()
|
|
|
- //cell.SetStyle(style)
|
|
|
- cell.SetValue(urlMap["url"])
|
|
|
- } else {
|
|
|
- row.AddCell().SetValue(urlMap["url"])
|
|
|
- }
|
|
|
- index++
|
|
|
- }
|
|
|
- } else {
|
|
|
- if index > 0 {
|
|
|
cell := row.AddCell()
|
|
|
- //cell.SetStyle(style)
|
|
|
+ cell.SetStyle(style1)
|
|
|
cell.SetValue(urlMap["url"])
|
|
|
- } else {
|
|
|
- row.AddCell().SetValue(urlMap["url"])
|
|
|
+ index++
|
|
|
}
|
|
|
+ } else {
|
|
|
+ cell := row.AddCell()
|
|
|
+ cell.SetStyle(style1)
|
|
|
+ cell.SetValue(urlMap["url"])
|
|
|
index++
|
|
|
}
|
|
|
}
|