소스 검색

Merge branch 'dev-ent_v1.1' of ssh://192.168.3.207:10022/qmx/datatag into dev-ent_v1.1

zouyuxuan 5 년 전
부모
커밋
7515d2173b

+ 3 - 3
src/history/historytask.go

@@ -211,10 +211,10 @@ func (this *HistoryData) ProductData() {
 		hid := this.GetString("hid")
 		dep_rules, _ := Mgo.FindById("historylog", hid, `{"dep_rules:1"}`)
 		var tag = map[string]interface{}{}
-		if len(*dep_rules)!=0&&dep_rules!=nil{
-			for _,v := range (*dep_rules)["dep_rules"].([]interface{}){
+		if len(*dep_rules) != 0 && dep_rules != nil {
+			for _, v := range (*dep_rules)["dep_rules"].([]interface{}) {
 				dep_rule := qu.ObjToMap(v)
-				if (*dep_rule)["_id"] == qu.StringTOBsonId(id){
+				if (*dep_rule)["_id"] == mongoutil.StringTOBsonId(id) {
 					tag = *dep_rule
 				}
 			}

+ 51 - 1
src/history/util_history.go

@@ -924,7 +924,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					}
 				}
 				xf.Sheets = xf.Sheets[1:2]
-			} else {
+			} else if dataType == 3 {
 				sh := xf.Sheets[2]
 				if isfile {
 					cell := sh.Rows[0].AddCell()
@@ -974,6 +974,56 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool)
 					}
 				}
 				xf.Sheets = xf.Sheets[2:3]
+			} else if dataType == 4 {
+				sh := xf.Sheets[3]
+				for i, v := range mMap {
+					row := sh.AddRow()
+					row.AddCell().SetInt(i + 1)
+					row.AddCell().SetValue(v["departname"])
+					row.AddCell().SetValue(v["rulename"])
+					row.AddCell().SetValue(v["matchkey"])
+					row.AddCell().SetValue(v["area"])
+					row.AddCell().SetValue(v["city"])
+					row.AddCell().SetValue(v["title"])
+					row.AddCell().SetValue(v["subtype"])
+					row.AddCell().SetValue(v["detail"])
+					if v["publishtime"] != nil {
+						row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
+					} else {
+						row.AddCell()
+					}
+					row.AddCell().SetValue(v["href"])
+					row.AddCell().SetValue(v["s_jyhref"])
+					row.AddCell().SetValue(v["projectcode"])
+					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectscope"])
+					if v["budget"] != nil {
+						row.AddCell().SetFloat(qu.Float64All(v["budget"]) / 10000)
+					} else {
+						row.AddCell()
+					}
+					if v["bidamount"] != nil {
+						row.AddCell().SetFloat(qu.Float64All(v["bidamount"]) / 10000)
+					} else {
+						row.AddCell()
+					}
+					if v["bidopentime"] != nil {
+						row.AddCell().SetValue(time.Unix(qu.Int64All(v["bidopentime"]), 0).Format("2006-01-02"))
+					} else {
+						row.AddCell()
+					}
+					row.AddCell().SetValue(v["buyer"])
+					row.AddCell().SetValue(v["buyerperson"])
+					row.AddCell().SetValue(v["buyertel"])
+					row.AddCell().SetValue(v["agency"])
+					row.AddCell().SetValue(v["winner"])
+					row.AddCell().SetValue(v["winnerperson"])
+					row.AddCell().SetValue(v["winnertel"])
+					row.AddCell().SetValue(v["legal_person"])
+					row.AddCell().SetValue(v["company_phone"])
+					row.AddCell().SetValue(v["company_email"])
+				}
+				xf.Sheets = xf.Sheets[3:4]
 			}
 			//生文件
 			t := strconv.FormatInt(time.Now().Unix(), 10)

+ 53 - 3
src/service/second_push.go

@@ -299,7 +299,7 @@ func UpdateHistoryState(state int, s_pushid string, count int) {
 			"$set": map[string]interface{}{
 				"state":        state,
 				"result_count": count,
-				"finishtime":time.Now().Unix(),
+				"finishtime":   time.Now().Unix(),
 			},
 		}, false, false)
 		return
@@ -467,7 +467,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 					row.AddCell().SetValue(v["company_email"])
 				}
 				xf.Sheets = xf.Sheets[1:2]
-			} else {
+			} else if dataType == 3 {
 				sh := xf.Sheets[2]
 				for i, v := range mMap {
 					row := sh.AddRow()
@@ -507,6 +507,56 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 					row.AddCell().SetValue(v["id"])
 				}
 				xf.Sheets = xf.Sheets[2:3]
+			} else if dataType == 4 {
+				sh := xf.Sheets[3]
+				for i, v := range mMap {
+					row := sh.AddRow()
+					row.AddCell().SetInt(i + 1)
+					row.AddCell().SetValue(v["departname"])
+					row.AddCell().SetValue(v["rulename"])
+					row.AddCell().SetValue(v["matchkey"])
+					row.AddCell().SetValue(v["area"])
+					row.AddCell().SetValue(v["city"])
+					row.AddCell().SetValue(v["title"])
+					row.AddCell().SetValue(v["subtype"])
+					row.AddCell().SetValue(v["detail"])
+					if v["publishtime"] != nil {
+						row.AddCell().SetValue(time.Unix(qu.Int64All(v["publishtime"]), 0).Format("2006-01-02"))
+					} else {
+						row.AddCell()
+					}
+					row.AddCell().SetValue(v["href"])
+					row.AddCell().SetValue(v["s_jyhref"])
+					row.AddCell().SetValue(v["projectcode"])
+					row.AddCell().SetValue(v["projectname"])
+					row.AddCell().SetValue(v["projectscope"])
+					if v["budget"] != nil {
+						row.AddCell().SetFloat(qu.Float64All(v["budget"]) / 10000)
+					} else {
+						row.AddCell()
+					}
+					if v["bidamount"] != nil {
+						row.AddCell().SetFloat(qu.Float64All(v["bidamount"]) / 10000)
+					} else {
+						row.AddCell()
+					}
+					if v["bidopentime"] != nil {
+						row.AddCell().SetValue(time.Unix(qu.Int64All(v["bidopentime"]), 0).Format("2006-01-02"))
+					} else {
+						row.AddCell()
+					}
+					row.AddCell().SetValue(v["buyer"])
+					row.AddCell().SetValue(v["buyerperson"])
+					row.AddCell().SetValue(v["buyertel"])
+					row.AddCell().SetValue(v["agency"])
+					row.AddCell().SetValue(v["winner"])
+					row.AddCell().SetValue(v["winnerperson"])
+					row.AddCell().SetValue(v["winnertel"])
+					row.AddCell().SetValue(v["legal_person"])
+					row.AddCell().SetValue(v["company_phone"])
+					row.AddCell().SetValue(v["company_email"])
+				}
+				xf.Sheets = xf.Sheets[3:4]
 			}
 			//生文件
 			t := strconv.FormatInt(time.Now().Unix(), 10)
@@ -585,7 +635,7 @@ func (s *SecondPush) SecondPushClone(hid string) {
 		(*data)["result_count"] = nil
 		(*data)["createtime"] = time.Now().Unix()
 		(*data)["updatetime"] = time.Now().Unix()
-		delete((*data),"finishtime")
+		delete((*data), "finishtime")
 		Mgo.Save("second_push", *data)
 	}
 }

BIN
src/web/res/fields.xlsx


+ 1 - 0
src/web/templates/private/customer_history.html

@@ -115,6 +115,7 @@
                                                         <option value="2">高级字段包</option>
                                                         <option value="1">标准字段包</option>
                                                         <option value="3">深信服字段包</option>
+                                                        <option value="4">高级字段包+部门名称+规则名称</option>
                                                     </select>
                                                     <script>
                                                         $('#extfiledselect').on("change", function () {

+ 1 - 0
src/web/templates/private/second_push_create.html

@@ -67,6 +67,7 @@
                                                         <option value="2">高级字段包</option>
                                                         <option value="1">标准字段包</option>
                                                         <option value="3">深信服字段包</option>
+                                                        <option value="4">高级字段包+部门名称+规则名称</option>
                                                     </select>
                                                 </div>
                                             </div>