Jianghan 3 ani în urmă
părinte
comite
8f06987a51

+ 2 - 2
src/front/project.go

@@ -170,7 +170,7 @@ func (f *Front) ProjectSave() {
 		}
 	}
 	qu.Debug("Create Project:", success, "importnum:", importDataNum, "successnum:", successNum, "failnum:", int64(importDataNum)-successNum)
-	qu.Debug("Msg:", msg)
+	//qu.Debug("Msg:", msg)
 	//返回信息
 	if stype == "edit" {
 		f.ServeJson(map[string]interface{}{"success": success, "msg": msg})
@@ -1073,7 +1073,7 @@ func GetDataById(idsInfo map[string]map[string]interface{}, importType, s_source
 						(*bidData)["info"] = infolist
 					}
 				} else {
-					qu.Debug("Projectset Find Error", projectId)
+					qu.Debug("Projectset Find Error", projectId, ", tmp--", tmp)
 				}
 				baseInfoMap["id"] = id
 				_id := (*bidData)["_id"]

+ 1 - 0
src/front/remark.go

@@ -604,6 +604,7 @@ func (f *Front) CheckData() {
 		} else {
 			if stype == "notag" {
 				query["b_istagging"] = false // 达标
+				query["b_isgivegroup"] = false
 				query["i_ckdata"] = 2
 			} else if stype == "tag" {
 				query["b_istagging"] = true //未达标

+ 0 - 1
src/front/user.go

@@ -295,7 +295,6 @@ func (f *Front) UserState() {
 func (f *Front) UserAll() {
 	defer qu.Catch()
 	if f.Method() == "POST" {
-
 		start, _ := f.GetInteger("start")
 		limit, _ := f.GetInteger("length")
 		draw, _ := f.GetInteger("draw")

+ 1 - 1
src/util/common.go

@@ -16,7 +16,7 @@ type Task struct {
 
 //oss
 var (
-	ossEndpoint        = "oss-cn-beijing.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
+	ossEndpoint        = "oss-cn-beijing-internal.aliyuncs.com" //正式环境用:oss-cn-beijing-internal.aliyuncs.com 测试:oss-cn-beijing.aliyuncs.com
 	ossAccessKeyId     = "LTAI4G5x9aoZx8dDamQ7vfZi"
 	ossAccessKeySecret = "Bk98FsbPYXcJe72n1bG3Ssf73acuNh"
 	ossBucketName      = "topjy"

+ 10 - 34
src/util/config.go

@@ -3,7 +3,6 @@ package util
 import (
 	"mongodb"
 	qu "qfw/util"
-	"qfw/util/elastic"
 	"sort"
 	"sync"
 )
@@ -28,9 +27,6 @@ var (
 	MgoJy               *mongodb.MongodbSim //jy
 	JyHistory           string
 	JyUser              string
-	Es                  *elastic.Elastic //es
-	Index               string
-	Itype               string
 	CustomerFieldMap_EH map[string]string
 	CustomerFieldMap_HE map[string]string
 	BiaoZhu             map[string]interface{}
@@ -43,7 +39,6 @@ var (
 )
 
 var (
-	Qy_Es                                *elastic.Elastic       //企业es
 	Mgo_QY                               *mongodb.MongodbSim    //企业mgo
 	Qy_Lock                              sync.Mutex             //锁-多线程备用
 	Ext_Type, Ext_From                   map[string]interface{} //抽取来源,方式分
@@ -79,8 +74,8 @@ func InitConfig() {
 		MongodbAddr: qu.ObjToString(bid["addr"]),
 		DbName:      qu.ObjToString(bid["db"]),
 		Size:        qu.IntAll(bid["size"]),
-		//UserName:    qu.ObjToString(bid["username"]),
-		//Password:    qu.ObjToString(bid["password"]),
+		UserName:    qu.ObjToString(bid["username"]),
+		Password:    qu.ObjToString(bid["password"]),
 	}
 	MgoB.InitPool()
 
@@ -107,15 +102,14 @@ func InitConfig() {
 	}
 	MgoJy.InitPool()
 
-	//es
-	//es := Sysconfig["es"].(map[string]interface{})
-	//Index = qu.ObjToString(es["index"])
-	//Itype = qu.ObjToString(es["itype"])
-	//Es = &elastic.Elastic{
-	//	S_esurl: qu.ObjToString(es["addr"]),
-	//	I_size:  qu.IntAll(es["pool"]),
-	//}
-	//Es.InitElasticSize()
+	Mgo_QY = &mongodb.MongodbSim{
+		MongodbAddr: qu.ObjToString(bid["addr"]),
+		DbName:      "mixdata",
+		Size:        qu.IntAll(bid["size"]),
+		UserName:    qu.ObjToString(bid["username"]),
+		Password:    qu.ObjToString(bid["password"]),
+	}
+	Mgo_QY.InitPool()
 
 	//other
 	CustomerFieldMap_EH = map[string]string{}
@@ -206,24 +200,6 @@ func InitConfig() {
 
 //质量相关初始化配置
 func initQuaConfig() {
-	//线上-需替换-172.17.145.163:27083,172.17.4.187:27082,
-	qyxyconf := Quaconfig["qy_mongodb"].(map[string]interface{})
-	Mgo_QY = &mongodb.MongodbSim{
-		MongodbAddr: qyxyconf["qy_addrName"].(string),
-		DbName:      qyxyconf["qy_dbName"].(string),
-		Size:        qu.IntAllDef(qyxyconf["qy_pool"], 5),
-		UserName:    qyxyconf["qy_username"].(string),
-		Password:    qyxyconf["qy_password"].(string),
-	}
-	Mgo_QY.InitPool()
-
-	//查询企业库-可使用es - 也可以mongo  http://172.17.145.170:9800
-	//Qy_Es = &elastic.Elastic{
-	//	S_esurl: qu.ObjToString(Quaconfig["qyxy_es"]),
-	//	I_size:  10,
-	//}
-	//Es.InitElasticSize()
-
 	Ext_Type = Quaconfig["ext_type"].(map[string]interface{})
 	Ext_From = Quaconfig["ext_from"].(map[string]interface{})
 

+ 0 - 8
src/web/qua_res/qua_config.json

@@ -1,12 +1,4 @@
 {
-  "qyxy_es":"http://172.17.145.170:9800",
-  "qy_mongodb": {
-    "qy_addrName": "192.168.3.207:27092",
-    "qy_dbName": "mixdata",
-    "qy_username": "",
-    "qy_password": "",
-    "qy_pool": 5
-  },
   "ext_from": {
     "title": 98,
     "detail": 100,

+ 0 - 1
src/web/templates/project/check_data_list.html

@@ -19,7 +19,6 @@
             <div class="col-xs-12">
                 <div class="box">
                     <div class="box-body">
-
                         <div class="box-body">
                             <h4><i class="glyphicon glyphicon-exclamation-sign" style="margin-right: 6px"></i>数据情况</h4>
                             <div class="form-group" style="margin-left: 10px;margin-top: 10px">

+ 22 - 18
src/web/templates/project/project_clear.html

@@ -459,26 +459,30 @@
     }
 
     function checkMethod(stype) {
-        let num1 = {{ .T.allDataNum }}
-        let num2 = {{ .T.okAllDataNum }}
+        let num1 = {{ .T.okAllDataNum }}
+        let num2 = {{ .T.okNotGiveDataNum }}
         let num3 = {{ .T.IsNotOkIsTagDataNum }}
-        if (stype === "all") {
-            if (num2 <= 0) {
-                showTip("没有可质检的数据")
-                return;
-            }
-        }else if (stype === "notag") {
-            if (num2 <= 0) {
-                showTip("没有可质检的数据")
-                return;
-            }
-        }else if (stype === "tag") {
-            if (num3 <= 0) {
-                showTip("没有可质检的数据")
-                return;
-            }
+        // if (stype === "all") {
+        //     if (num2 <= 0) {
+        //         showTip("没有可质检的数据")
+        //         return;
+        //     }
+        // }else if (stype === "notag") {
+        //     if (num2 <= 0) {
+        //         showTip("没有可质检的数据")
+        //         return;
+        //     }
+        // }else if (stype === "tag") {
+        //     if (num3 <= 0) {
+        //         showTip("没有可质检的数据")
+        //         return;
+        //     }
+        // }
+        if (stype === "notag" && num1 > 0 && num2 > 0) {
+            window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
+        }else {
+            showTip("没有标注数据")
         }
-        window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
     }
 
 </script>

+ 25 - 1
src/web/templates/project/project_list.html

@@ -229,6 +229,15 @@
     </div><!-- /.modal -->
 </div>
 
+<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
+    <div style="width: 200px;height:100px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
+        <div class="progress progress-striped active"
+             style="margin-bottom: 0;height:50px; text-align:center;line-height: 50px;font-size:large;">
+            数据加载中,请稍候......    
+        </div>
+    </div>
+</div>
+
 {{include "com/footer.html"}}
 <script>
     menuActive("project");
@@ -237,6 +246,15 @@
     let fields = {{ .T.fields }}
     let projectmap = {}
 
+    //展示loading框
+    showLoading = function (){
+        $('#loadingModal').modal({backdrop: 'static', keyboard: false});
+    }
+    //隐藏掉loading框
+    hideLoading = function (){
+        $('#loadingModal').modal('hide');
+    }
+
     $(function () {
         ttable = $('#dataTable').dataTable({
             "paging": true,
@@ -387,12 +405,14 @@
                 return;
             }
             projectmap["s_type"] = stype
+            showLoading()
             $.ajax({
                 url: "/front/project/save",
                 type: 'POST',
                 data: projectmap,
                 success: function (r) {
                     if (r.success) {
+                        hideLoading()
                         $("#modal-create-project").modal('hide')
                         ttable.api().ajax.reload();
                     } else {
@@ -411,6 +431,7 @@
             let file = $('#uploadfile')[0].files[0]
             if (file) {
                 formData.append("xlsx", file)
+                showLoading()
                 $.ajax({
                     url: "/front/project/save",
                     type: 'POST',
@@ -419,7 +440,8 @@
                     processData: false,
                     contentType: false,
                     success: function (r) {
-                        if (r.rep) {
+                        if (r.success) {
+                            hideLoading()
                             showTip(r.msg, 3000);
                             $("#modal-create-project").modal('hide')
                             ttable.api().ajax.reload();
@@ -499,12 +521,14 @@
         if (tmp["v_fields"] === undefined) {
             showTip("请设置标注字段")
         }else {
+            showLoading()
             $.ajax({
                 url: "/front/project/qualityAssessment",
                 type: 'POST',
                 data: {"pid": tmp["_id"]},
                 success: function (r) {
                     if (r.success) {
+                        hideLoading()
                         window.location.href="/front/project/task/list?pid=" + tmp["_id"]
                     } else {
                         showTip(r.msg);

+ 4 - 4
src/web/templates/project/task_detail.html

@@ -39,8 +39,8 @@
                                 <div class="col-xs-4 form-group">
                                     <label class="form-inline">操作:
                                         <input type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('0')" value="分发">
-                                        <input type="button" class="btn btn-sm btn-primary" value="质检">
-                                        <input type="button" class="btn btn-sm btn-primary" value="质检结果">
+<!--                                        <a type="button" class="btn btn-sm btn-primary">质检</a>-->
+<!--                                        <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
                                     </label>
                                 </div>
                             </div>
@@ -207,8 +207,8 @@
                     "data": "_id", width: "11%", render: function (val, a, row, pos) {
                         tmp = '<div>' +
                             '<a class="btn btn-sm btn-primary" onclick="retrieveTask(\''+val+'\',\''+row.s_sourceinfo+'\',\''+row.s_status+'\')">收回</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-warning">质检</a>&nbsp;&nbsp;' +
-                            '<a class="btn btn-sm btn-info" onclick="closeTask(\'' + val + '\',\'' + row.s_status + '\',\''+row.s_sourceinfo+'\')">关闭</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" href="/front/user/check/data?pid='+row.s_projectid+'&tid=' + val + '&s_sourceinfo='+row.s_sourceinfo+'">质检</a>&nbsp;&nbsp;' +
+                            '<a class="btn btn-sm btn-primary" onclick="closeTask(\'' + val + '\',\'' + row.s_status + '\',\''+row.s_sourceinfo+'\')">关闭</a>&nbsp;&nbsp;' +
                             '</div>';
                         return tmp
                     }

+ 1 - 1
src/web/templates/user/user_group.html

@@ -118,7 +118,7 @@
                 {"data": "_id", width:"11%",render: function (val, a, row, pos) {
                       tmp = '<div>' +
                           '<a class="btn btn-sm btn-primary" href="/front/group/edit?id='+val+'">编辑</a>&nbsp;&nbsp;'+
-                          '<a class="btn btn-sm btn-primary" href="/front/group/user?id='+val+'">设置</a>&nbsp;&nbsp;'+
+                          '<a class="btn btn-sm btn-primary" href="/front/group/user?id='+val+'&s_sourceinfo='+row.s_sourceinfo+'">设置</a>&nbsp;&nbsp;'+
                           '<a class="btn btn-sm btn-danger" onclick="del(\''+val+'\')">删除</a>'+
                           '</div>';
                       return tmp