Browse Source

no message

jianghan7 1 year ago
parent
commit
c01ffc94d1
5 changed files with 73 additions and 20 deletions
  1. 12 3
      isrepeat/main.go
  2. 1 1
      src/config.json
  3. 8 7
      src/front/front.go
  4. 25 9
      src/front/project.go
  5. 27 0
      src/web/templates/project/check_detail.html

+ 12 - 3
isrepeat/main.go

@@ -19,7 +19,7 @@ var (
 
 func init() {
 	Mgo = &mgo.MongodbSim{
-		MongodbAddr: "127.0.0.1:27086", // 127.0.0.1:27084
+		MongodbAddr: "127.0.0.1:27084", // 127.0.0.1:27084
 		Size:        5,
 		DbName:      "jyqykhfw",
 	}
@@ -54,7 +54,7 @@ func main() {
 				task1(p)
 			}
 		} else if flag == 2 {
-			fmt.Println("导入推送数据.")
+			fmt.Println("推送数据...")
 			task2()
 		} else if flag == 3 {
 			fmt.Println("请输入文档地址,进行数据判重.")
@@ -117,6 +117,7 @@ func task1(path string) {
 		c1 := 0 // 多包第n条数据
 		for rn, row := range sheet.Rows {
 			update := make(map[string]interface{})
+			del := make(map[string]interface{})
 			if rn == 0 {
 				for index, cell := range row.Cells {
 					if cell.Value == "唯一标识" || cell.Value == "标讯编码(infoID)" { //id所在列
@@ -144,6 +145,10 @@ func task1(path string) {
 						} else {
 							update[fmt.Sprintf("v_baseinfo.%s", f)] = val
 						}
+					} else {
+						if f != "is_push" {
+							del[fmt.Sprintf("v_baseinfo.%s", f)] = "1"
+						}
 					}
 				}
 				if qu.IntAll(update["v_baseinfo.multipackage"]) == 1 {
@@ -201,7 +206,11 @@ func task1(path string) {
 				update["tag"] = "临时"
 				lastid = id
 				qu.Debug(update)
-				Mgo.UpdateById("f_sourceinfo_chinaunicom_zb_data", id, bson.M{"$set": update})
+				if len(del) > 0 {
+					Mgo.UpdateById("f_sourceinfo_chinaunicom_zb_data", id, bson.M{"$set": update, "$unset": del})
+				} else {
+					Mgo.UpdateById("f_sourceinfo_chinaunicom_zb_data", id, bson.M{"$set": update})
+				}
 			}
 		}
 		qu.Debug(fmt.Sprintf("更新数据成功,更新: %d条", count))

+ 1 - 1
src/config.json

@@ -16,7 +16,7 @@
     },
     "extract":{
         "addr": "192.168.3.166:27082",
-        "db": "mxs",
+        "db": "datacheck",
         "coll1": "extract",
         "coll2": "extract2",
         "projectcoll": "projectset",

+ 8 - 7
src/front/front.go

@@ -69,13 +69,14 @@ type Front struct {
 	projectGroupTaskList     xweb.Mapper `xweb:"/front/project/task/list"`         //用户组任务分发列表
 	projectGroupTaskRetrieve xweb.Mapper `xweb:"/front/project/task/retrieve"`     //用户组任务收回
 	projectGroupTaskRepulse  xweb.Mapper `xweb:"/front/project/task/repulse"`      //用户组任务打回
-	projectGroupTaskClose    xweb.Mapper `xweb:"/front/project/task/close"`        //用户组任务关闭
-	taskSyncJy               xweb.Mapper `xweb:"/front/project/task/syncjycm"`     //数据推送剑鱼客户管理平台
-	projectGetEntnameList    xweb.Mapper `xweb:"/front/project/getEntnameList"`    //模糊查询公司名称
-	projectIsExists          xweb.Mapper `xweb:"/front/project/isExists"`          //判断项目名称是否存在
-	projectCheckSuc          xweb.Mapper `xweb:"/front/project/check/success"`     //项目达标数据质检通过
-	projectPassSuc           xweb.Mapper `xweb:"/front/project/pass/success"`      //项目数据通过
-	projectTagNum            xweb.Mapper `xweb:"/front/project/tagNum"`            //项目标注数据量
+	dataRepulse              xweb.Mapper `xweb:"/front/task/data/repulse"`
+	projectGroupTaskClose    xweb.Mapper `xweb:"/front/project/task/close"`     //用户组任务关闭
+	taskSyncJy               xweb.Mapper `xweb:"/front/project/task/syncjycm"`  //数据推送剑鱼客户管理平台
+	projectGetEntnameList    xweb.Mapper `xweb:"/front/project/getEntnameList"` //模糊查询公司名称
+	projectIsExists          xweb.Mapper `xweb:"/front/project/isExists"`       //判断项目名称是否存在
+	projectCheckSuc          xweb.Mapper `xweb:"/front/project/check/success"`  //项目达标数据质检通过
+	projectPassSuc           xweb.Mapper `xweb:"/front/project/pass/success"`   //项目数据通过
+	projectTagNum            xweb.Mapper `xweb:"/front/project/tagNum"`         //项目标注数据量
 	projectData              xweb.Mapper `xweb:"/front/project/data"`
 
 	//user task

+ 25 - 9
src/front/project.go

@@ -657,6 +657,30 @@ func (f *Front) ProjectGroupTaskRepulse() {
 	f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
 }
 
+// DataRepulse 单条数据打回
+func (f *Front) DataRepulse() {
+	defer qu.Catch()
+	if f.Method() == "POST" {
+		//tid := f.GetString("tid")
+		did := f.GetString("s_infoid")
+		//更新数据源
+		success := util.Mgo.UpdateById(util.DATACOLLNAME, did, bson.M{
+			"$set": map[string]interface{}{
+				"b_istag":      false,
+				"b_check":      false, // 质检标记
+				"i_ckdata":     0,
+				"i_updatetime": time.Now().Unix(),
+			},
+			"$unset": map[string]interface{}{
+				"v_taginfo":   "",
+				"v_checkinfo": "",
+			},
+		})
+		//util.Mgo.UpdateById(util.TASKCOLLNAME, tid, bson.M{"s_status"})
+		f.ServeJson(map[string]interface{}{"success": success, "msg": ""})
+	}
+}
+
 // ProjectGroupTaskRetrieve 用户组任务收回
 func (f *Front) ProjectGroupTaskRetrieve() {
 	defer qu.Catch()
@@ -1150,14 +1174,7 @@ func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *s
 			if len(*m) > 0 {
 				appid := qu.ObjArrToStringArr((*m)["appid"].([]interface{}))
 				if !strings.Contains(strings.Join(appid, ","), qu.ObjToString(tmp["appid"])) {
-					if s1 := qu.ObjToString(tmp["matchkey"]); s1 != "" {
-						if s1 != qu.ObjToString((*m)["matchkey"]) {
-							s1 = qu.ObjToString((*m)["matchkey"]) + "," + s1
-						}
-						util.Mgo.UpdateById(util.DATACOLLNAME, id, bson.M{"$set": bson.M{"matchkey": s1}, "$push": bson.M{"appid": qu.ObjToString(tmp["appid"])}})
-					} else {
-						util.Mgo.UpdateById(util.DATACOLLNAME, id, bson.M{"$push": bson.M{"appid": qu.ObjToString(tmp["appid"])}})
-					}
+					util.Mgo.UpdateById(util.DATACOLLNAME, id, bson.M{"$push": bson.M{"appid": qu.ObjToString(tmp["appid"])}})
 				}
 			} else {
 				//markData, _ := util.MgoHM.FindById("bidding", id, nil)
@@ -1233,7 +1250,6 @@ func GetDataById(idInfoArr []util.Data, importType string, success *bool, msg *s
 					// 6.项目合并信息
 					project, _ := util.MgoE.Find(util.ProjectColl, bson.M{"ids": id}, nil, nil, true, -1, -1)
 					if project != nil && len((*project)[0]) > 0 {
-						qu.Debug(*project)
 						ids := qu.ObjArrToStringArr((*project)[0]["ids"].([]interface{}))
 						if len(ids) > 0 {
 							var infolist []map[string]interface{}

+ 27 - 0
src/web/templates/project/check_detail.html

@@ -375,6 +375,7 @@
                 <!--                 <button  class="code" @click.stop="open(1)" style="width:100px">全部验证</button> -->
 <!--                <button class="code" @click.stop="open(2)" style="width:100px">字段验证</button>-->
                 <button  class="code" @click.stop="open(2)" style="width:100px">保存</button>&nbsp;&nbsp;
+                <button  class="code" @click.stop="dataBack" style="width:100px">打回</button>&nbsp;&nbsp;
                 <button class="code" @click.stop="openHref" style="width:100px">下一条</button>
                 <!--<button  class="code" @click.stop="window.location.href='/'" style="width:100px">下一条</button>-->
             </div>
@@ -1349,6 +1350,32 @@
                     }).catch(() => {
                     });
                 },
+                // 数据打回
+                dataBack:function () {
+                    var _this = this
+                    $.ajax({
+                        url: "/front/task/data/repulse",
+                        type: "POST",
+                        data: {"s_infoid": did, "pid": pid, "tid": tid},
+                        success: function(res) {
+                            console.log(1)
+                            console.log(res)
+                            if (res) {
+                                _this.$message({
+                                    message: '打回成功',
+                                    type: 'success',
+                                    duration: 1000,
+                                    offset: 300
+                                });
+                                issave = true//保存成功
+                            }
+                        },
+                        error: function(err) {
+                            console.log(err)
+                            alert(err);
+                        }
+                    });
+                },
                 //保存事件
                 upChange: function (stype) {
                     console.log(this.editData)