jiaojiao7 4 years ago
parent
commit
c7cb2da63f

+ 0 - 15
src/history/historytask.go

@@ -141,21 +141,6 @@ func (this *HistoryData) HistoryTask(history_id string) {
 			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*/
 	} else {
 		log.Println("初始化客户信息失败")
 	}

+ 7 - 7
src/history/util_history.go

@@ -493,12 +493,13 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 	}
 	isOk := true
 	//if ProjectAppidMap[appid] {
+	log.Println("是否根据项目去重", isFilter)
 	if isFilter == 1 {
 		//log.Println("补充信息中根据项目id去重。。。。")
 		projectId := GetProjectId(id)
 		if projectId != "" {
 			projectIds := strings.Split(projectId, ",")
-			tmp["projectId"] = projectId
+				tmp["projectId"] = projectId
 			for _, v := range projectIds {
 				if _, ok := projectIdMap.Load(v); ok {
 					isOk = false
@@ -511,12 +512,14 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 			}
 		}
 	}
+	log.Println("根据项目去重", isOk)
 	//河南移动/盈峰科技
 	if NeedProjectidAppidMap[appid] {
 		projectId := GetProjectId(id)
 		if projectId != "" {
 			//projectIds := strings.Split(projectId, ",")
-			tmp["projectId"] = SE.EncodeString(projectId)
+			//tmp["projectId"] = SE.EncodeString(projectId)
+			tmp["projectId"] = projectId
 		} else {
 			tmp["projectId"] = ""
 		}
@@ -626,7 +629,6 @@ 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
@@ -1063,8 +1065,6 @@ 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 {
@@ -1319,7 +1319,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
 					row.AddCell().SetValue(v["company_email"])      //中标企业邮箱
 					ids := SE.EncodeString(qu.ObjToString(v["id"])) //唯一标识
 					row.AddCell().SetValue(ids)
-					row.AddCell().SetValue(v["projectId"]) //项目标识
+					row.AddCell().SetValue(SE.EncodeString(qu.ObjToString(v["projectId"]))) //项目标识
 					row.AddCell().SetValue(v["jybxhref"])  //剑鱼标讯地址
 
 					//row.AddCell().SetValue(v["projectcode"])
@@ -1510,7 +1510,7 @@ func saveMysqlPush(tmp map[string]interface{}, entId int, ) bool {
 		saveMap["toptype"] = qu.IntAll(BuryClassType[toptype])
 	}
 	if subtype != "" {
-		saveMap["toptype"] = qu.IntAll(BuryClassType[subtype])
+		saveMap["subtype"] = qu.IntAll(BuryClassType[subtype])
 	}
 	b := JyMysql.Insert("pushentniche", saveMap)
 	if b <= 0 {

+ 34 - 25
src/web/templates/private/customer_history.html

@@ -70,7 +70,7 @@
                                                         <option value=0>全局模式</option>
                                                         <option value=1>部门模式</option>
                                                         <option value=2>标签模式</option>
-<!--                                                        <option value=3>部门+标签模式</option>-->
+                                                        <!--                                                        <option value=3>部门+标签模式</option>-->
                                                         <option value=4 selected>规则模式</option>
                                                     </select>
                                                 </div>
@@ -109,14 +109,23 @@
                                                 <div class="col-sm-2">
                                                     <select class="form-control selectpicker" id="dataTableSelect">
                                                         <option value="0" selected>历史数据表</option>
-                                                        <option value="1">接口数据表</option>
+                                                        <option value="1">API数据表</option>
                                                         <option value="2">商机管理数据表</option>
                                                     </select>
-                                                    {{/*<script>
-                                                    $('#extfiledselect').on("change", function () {
-                                                        dataMap["i_datatable"] = $('#dataTableSelect option:selected').val();
-                                                    })
-                                                </script>*/}}
+                                                    <script>
+                                                        $('#dataTableSelect').on("change", function () {
+                                                            var val = $('#dataTableSelect option:selected').val();
+                                                            console.log("表的选择:", val)
+                                                            if (val == 2) {
+                                                                $("#pushIsDup option[value='" + 1 + "']").attr("selected", true);
+                                                                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("是");
+                                                            } else {
+                                                                $("#pushIsDup option[value='" + 1 + "']").attr("selected", false);
+                                                                $("#pushIsDup option[value='" + 0 + "']").attr("selected", true);
+                                                                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("否");
+                                                            }
+                                                        })
+                                                    </script>
                                                 </div>
                                             </div>
                                             <div class="form-group">
@@ -151,11 +160,11 @@
                                                         <option value="4">高级字段包+部门名称+规则名称</option>
                                                         <option value="5">河南移动字段包</option>
                                                     </select>
-<!--                                                    <script>-->
-<!--                                                        $('#extfiledselect').on("change", function () {-->
-<!--                                                            dataMap["i_extfieldstype"] = $('#extfiledselect option:selected').val();-->
-<!--                                                        })-->
-<!--                                                    </script>-->
+                                                    <!--                                                    <script>-->
+                                                    <!--                                                        $('#extfiledselect').on("change", function () {-->
+                                                    <!--                                                            dataMap["i_extfieldstype"] = $('#extfiledselect option:selected').val();-->
+                                                    <!--                                                        })-->
+                                                    <!--                                                    </script>-->
                                                 </div>
                                             </div>
                                         </div>
@@ -365,13 +374,13 @@
             } else {
                 $('#pushSwitch').bootstrapSwitch('state', false);
             }
-            if (dataMap.i_pushmodel != undefined){
+            if (dataMap.i_pushmodel != undefined) {
                 $('#pushModelSelect').val(dataMap.i_pushmodel);
             }
-            if (dataMap.i_extfieldstype != undefined){
+            if (dataMap.i_extfieldstype != undefined) {
                 $('#extfiledselect').val(dataMap.i_extfieldstype);
             }
-            if (dataMap.i_pushtype != undefined){
+            if (dataMap.i_pushtype != undefined) {
                 $('#pushTypeSelect').val(dataMap.i_pushtype);
             }
             // if (dataMap.i_pushtype == 0) {
@@ -388,14 +397,9 @@
                 $('#expandSelect').find("option[value = enterpise]").attr("selected", "selected");
             }
             $("#sendMail").val(dataMap.sendMail);
-            if (dataMap.isDup != undefined){
+            if (dataMap.isDup != undefined) {
                 $("#pushIsDup").val(dataMap.isDup);
             }
-            if (dataMap.isDup == 1) {
-                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("是");
-            } else {
-                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("否");
-            }
             if (dataMap.i_projectdup == 1) {
                 $("button[data-id=projectIsDup]").find(".filter-option-inner-inner").text("是");
             } else {
@@ -404,14 +408,19 @@
             if (dataMap.i_datatable == 2) {
                 $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("商机管理数据表");
             } else if (dataMap.i_datatable == 1) {
-                $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("接口数据表");
+                $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("API数据表");
             } else {
                 $("button[data-id=dataTableSelect]").find(".filter-option-inner-inner").text("历史数据表");
             }
-            if (dataMap.i_datatable != undefined){
+            if (dataMap.i_datatable != undefined) {
                 $('#dataTableSelect').val(dataMap.i_datatable);
             }
-            console.log(dataMap.isDup, dataMap.i_projectdup, dataMap.i_datatable)
+            if (dataMap.isDup == 1) {
+                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("是");
+            } else {
+                $("button[data-id=pushIsDup]").find(".filter-option-inner-inner").text("否");
+            }
+            // console.log(dataMap.isDup, dataMap.i_projectdup, dataMap.i_datatable)
             $("#pushIsDup option[value='" + dataMap.isDup + "']").attr("selected", true);
             $("#projectIsDup option[value='" + dataMap.i_projectdup + "']").attr("selected", true);
             $("#dataTableSelect option[value='" + dataMap.i_datatable + "']").attr("selected", true);
@@ -542,7 +551,7 @@
 
     function saveCuser() {
         // dataMap.send_mode = document.getElementById("pushModelSelect").selectedIndex;
-        dataMap.send_mode =$("#pushModelSelect option:selected").val();
+        dataMap.send_mode = $("#pushModelSelect option:selected").val();
         dataMap.push_type = document.getElementById("pushTypeSelect").selectedIndex;
         // dataMap.s_extends = document.getElementById("expandSelect").selectedIndex;
         dataMap.isDup = $("#pushIsDup option:selected").val();

+ 3 - 0
src/web/templates/private/history_rule_edit.html

@@ -1449,6 +1449,9 @@
             showMsg(msg);
             return
         }
+        dataMap.s_globaladdkey = $('#g_addkey').val();
+        dataMap.s_globalnotkey = $('#g_notkey').val();
+        dataMap.s_globalclearkey = $('#s_globalclearkey').val();
         //通用规则采购单位类型和关键词中的采购单位类型只能存在一个
         if (o_rules && o_rules.length > 0) {
             let tag = false;