Browse Source

Merge branch 'dev1.4' of http://192.168.3.207:10080/qmx/datatag into dev1.4

fuwencai 4 years ago
parent
commit
03c3e6bac7

+ 22 - 7
src/history/historytask.go

@@ -49,6 +49,7 @@ func (this *HistoryData) HistoryTask(history_id string) {
 		noticeFilter := qu.IntAll(c["isDup"])        //公告是否去重
 		isFilter := qu.IntAll(c["i_projectdup"])     //是否根据项目id去重
 		dataTable := qu.IntAll(c["i_datatable"])     //数据存储位置
+		i_pushtype := qu.IntAll(c["i_pushtype"])     //邮箱或者存表
 
 		isfile := false
 		isHenanMobile := false
@@ -119,9 +120,9 @@ func (this *HistoryData) HistoryTask(history_id string) {
 			if xlsxCount > 0 {
 				go UpdateJyqyfwDatacount(appId, xlsxCount)
 			}
-
-		} else if dataTable == 0 {
-			//发邮件
+		}
+		//发邮件
+		if i_pushtype == 0 {
 			go func() {
 				time.Sleep(3 * time.Second)
 				log.Println("xlsxArr", len(xlsxArr))
@@ -130,17 +131,31 @@ func (this *HistoryData) HistoryTask(history_id string) {
 					log.Println("excel数据量错误")
 				}
 				GetXlsxs(xlsxArr, customer_name, email, history_id, isfile, isHenanMobile)
-
-				//xlsxArr = []map[string]interface{}{}
-				//xlsxCount = 0
+				go UpdateHistoryState(2, history_id, xlsxCount)
+				xlsxArr = []map[string]interface{}{}
+				xlsxCount = 0
 			}()
 			projectIdMap = sync.Map{}
+		} else {
+			go UpdateHistoryState(2, history_id, xlsxCount)
+			xlsxArr = []map[string]interface{}{}
+			xlsxCount = 0
+		}
+
+		/*if dataTable == 2 {
+			//使用pc商机管理的企业,数据存入mysql表,扣除数据量
+			if xlsxCount > 0 {
+				go UpdateJyqyfwDatacount(appId, xlsxCount)
+			}
+
+		} else if dataTable == 0 {
+
 		} else if dataTable == 1 {
 			log.Println("数据存入usermail appid:"+appId, "数据量:", xlsxCount)
 		}
 		go UpdateHistoryState(2, history_id, xlsxCount)
 		xlsxArr = []map[string]interface{}{}
-		xlsxCount = 0
+		xlsxCount = 0*/
 	} else {
 		log.Println("初始化客户信息失败")
 	}

+ 3 - 0
src/history/util_history.go

@@ -626,6 +626,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 			MgoSave.Save(SaveCollbid, tmp)
 		}
 	}
+	log.Println("", dataTable, isOk)
 	if isOk {
 		if dataTable == 0 { //存到usermail_history
 			MgoSaveCache <- tmp
@@ -1062,6 +1063,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
 			style.Font.Bold = true
 			style.Alignment.Vertical = "center"
 			style.Alignment.Horizontal = "center"
+			log.Println("字段包", dataType)
+			log.Println("Excel数据:", len(mMap))
 			if dataType == 1 {
 				sh := xf.Sheets[0]
 				if isfile {

+ 2 - 3
src/web/templates/private/customer_history.html

@@ -77,8 +77,8 @@
                                                 <label class="col-sm-2 control-label"><span style="color:red;">* </span>推送方式</label>
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" id="pushTypeSelect">
-                                                        <option value=0 code="email" selected>邮箱</option>
-                                                        <option value=1 code="interface">接口</option>
+                                                        <option value=0 code="email">邮箱</option>
+                                                        <option value=1 code="interface">数据库</option>
                                                     </select>
                                                 </div>
                                                 <label class="col-sm-2 control-label">发送邮箱</label>
@@ -142,7 +142,6 @@
                                                         })
                                                     </script>
                                                 </div>
-
                                                 <label class="col-sm-2 control-label ">字段包</label>
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" id="extfiledselect">