jiaojiao7 4 years ago
parent
commit
a3be0dae2e

+ 2 - 1
src/config.json

@@ -94,7 +94,8 @@
 		"111",
 		"222",
 		"jyPB1XQgsGBQNbQElICQNW",
-		"jyMDBXQQIDCQBeSUdBITNf"
+		"jyMDBXQQIDCQBeSUdBITNf",
+		"jyFzZXQQIECAZYQERAPD93"
 	],
 	"checkbidopen_appid": [
 		"111",

+ 5 - 1
src/history/historytask.go

@@ -53,12 +53,16 @@ func (this *HistoryData) HistoryTask(history_id string) {
 
 		isfile := false
 		isHenanMobile := false
+		isfilehref := false
 		if FileTextAppidMap[appId] {
 			isfile = true
 		}
 		if DisPackageAppidMap[appId] {
 			isHenanMobile = true
 		}
+		if NeedFilehrefAppidMap[appId] {
+			isfilehref = true
+		}
 		cus := &Customer{}
 		cus.SaveDataMap = map[string]map[string]interface{}{}
 		cus.SaveDataArr = []map[string]interface{}{}
@@ -135,7 +139,7 @@ func (this *HistoryData) HistoryTask(history_id string) {
 				if len(xlsxArr) != xlsxCount {
 					log.Println("excel数据量错误")
 				}
-				GetXlsxs(xlsxArr, customer_name, email, history_id, isfile, isHenanMobile, appId)
+				GetXlsxs(xlsxArr, customer_name, email, history_id, isfile, isHenanMobile, isfilehref, appId)
 				go UpdateHistoryState(2, history_id, xlsxCount)
 				xlsxArr = []map[string]interface{}{}
 				xlsxCount = 0

+ 17 - 16
src/history/util_history.go

@@ -1142,7 +1142,7 @@ func SkipData(tmp map[string]interface{}) bool {
 	return false
 }
 
-func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHenanMobile bool, appid string) {
+func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHenanMobile, isfilehref bool, appid string) {
 	if id != "" {
 		query := bson.M{
 			"_id": bson.ObjectIdHex(id),
@@ -1204,6 +1204,11 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
 					cell.SetValue("附件")
 					cell.SetStyle(style)
 				}
+				if isfilehref {
+					cell := sh.Rows[0].AddCell()
+					cell.SetValue("附件链接")
+					cell.SetStyle(style)
+				}
 				for _, v := range mMap {
 					row := sh.AddRow()
 					// row.AddCell().SetInt(i + 1)
@@ -1253,32 +1258,28 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
 					if isfile {
 						row.AddCell().SetValue(v["filetext"])
 					}
-					if NeedFilehrefAppidMap[appid] == true {
+					if isfilehref {
 						if v["filehref"] != nil {
 							if filelist, ok := v["filehref"].([]map[string]interface{}); ok {
 								index := 0
 								for _, url := range filelist {
 									//if urlMap, ok := url.(map[string]interface{}); ok {
 									if url["url"] != nil {
+										style1 := xlsx.NewStyle()
+										style1.Font.Name = "宋体"
+										style1.Font.Size = 12
+										style1.Font.Bold = false
 										if FilterFilehrefAppidMap[appid] {
 											if strings.Contains(url["url"].(string), "jy-datafile.oss-cn-beijing.aliyuncs.com") {
-												if index > 0 {
-													cell := row.AddCell()
-													//cell.SetStyle(style)
-													cell.SetValue(url["url"])
-												} else {
-													row.AddCell().SetValue(url["url"])
-												}
-												index++
-											}
-										} else {
-											if index > 0 {
 												cell := row.AddCell()
-												//cell.SetStyle(style)
+												cell.SetStyle(style1)
 												cell.SetValue(url["url"])
-											} else {
-												row.AddCell().SetValue(url["url"])
+												index++
 											}
+										} else {
+											cell := row.AddCell()
+											cell.SetStyle(style1)
+											cell.SetValue(url["url"])
 											index++
 										}
 									}

+ 37 - 15
src/service/second_push.go

@@ -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++
 												}
 											}

BIN
src/web/res/fields.xlsx


+ 22 - 1
src/web/templates/private/cuser_rule_history_edit.html

@@ -258,6 +258,10 @@
                                         <div class="col-sm-2">
                                             <input class="form-control" type="text" id="s_bidamount_max" placeholder="单位:元/小于">
                                         </div>
+                                        <label class="col-sm-2 control-label">中标金额不存在</label>
+                                        <div class="col-sm-1">
+                                            <input style="margin-top: 10px;" type="checkbox" id="bidamountExist">
+                                        </div>
                                     </div>
                                     <div class="form-group">
                                         <label class="col-sm-2 control-label">全局附加词</label>
@@ -474,6 +478,9 @@
         if (dataMap.i_budgetfieldexist === 1) {
             $("#budgetExist").attr("checked", true)
         }
+        if (dataMap.i_bidamountfieldexist === 1) {
+            $("#bidamountExist").attr("checked", true)
+        }
 
         var btnMatchHtml1 = "";
         var btnMatchHtml2 = "";
@@ -1406,7 +1413,21 @@
                 bidamount = bidamount + ",小于" + $('#s_bidamount_max').val()
             }
         }
-        dataMap["s_bidamountlimit"] = bidamount
+        dataMap["s_bidamountlimit"] = bidamount;
+        if (bidamount !== "") {
+            if ($('#bidamountExist').prop('checked')) {
+                dataMap["i_bidamountfieldexist"] = 1
+            } else {
+                dataMap["i_bidamountfieldexist"] = 0
+            }
+        } else {
+            dataMap["i_bidamountfieldexist"] = 0
+        }
+        //预算限制跟中标金额限制不能同时存在
+        if (bidamount !== "" && budget !== "") {
+            showMsg("保存失败,预算金额限制和中标金额限制不能同时使用,请修改!")
+            return;
+        }
         if ($('#maxnum').val() !== "") {
             dataMap["i_maxnum"] = $('#maxnum').val();
         }