瀏覽代碼

爬虫、任务导入

maxiaoshan 3 年之前
父節點
當前提交
08b97d5363
共有 2 個文件被更改,包括 8 次插入7 次删除
  1. 6 6
      src/front/front.go
  2. 2 1
      src/taskManager/taskManager.go

+ 6 - 6
src/front/front.go

@@ -554,12 +554,13 @@ func (f *Front) Importfile() {
 							o["urgency"] = 0
 						}
 						o["platform"] = cells[9].Value
-						estimate, _ := cells[10].Int()
-						weigh, _ := cells[11].Int()
-						o["estimate"] = estimate
+						o["area"] = cells[10].Value
+						o["city"] = cells[11].Value
+						o["district"] = cells[12].Value
+						weigh, _ := cells[13].Int()
 						o["weight"] = weigh
 						//存储表
-						o["coll"] = cells[12].Value
+						o["coll"] = cells[14].Value
 						//导入默认字段
 						o["spidercompete"] = true
 						o["pendstate"] = 0
@@ -667,7 +668,7 @@ func pf(o map[string]interface{}) (bool, string) {
 	configModel := util.Config.Model[s_model]
 	model := map[string]interface{}{}
 	for k, _ := range configModel {
-		model[k] = ""
+		model[k] = qu.ObjToString(o[k])
 	}
 	param["model"] = model
 	param["next"] = o["next"]
@@ -684,7 +685,6 @@ func pf(o map[string]interface{}) (bool, string) {
 	param["spiderhistorymaxpage"] = 1
 	param["platform"] = o["platform"]
 	param["spidercompete"] = o["spidercompete"]
-	param["estimate"] = o["estimate"]
 	param["weight"] = o["weight"]
 	param["pendstate"] = o["pendstate"]
 	//qu.Debug("param---", param)

+ 2 - 1
src/taskManager/taskManager.go

@@ -138,8 +138,9 @@ func (t *TaskM) Taskfile() {
 							o["s_code"] = code
 							o["s_descript"] = cells[1].Value //描述
 							o["s_urgency"] = urgency
-							o["s_stype"] = stype
+							o["s_type"] = stype
 							o["l_complete"] = completeTime
+							o["i_pendstate"] = 0
 							mgdb.Save("task", o)
 							//清空map
 							o = map[string]interface{}{}