Jianghan 1 năm trước cách đây
mục cha
commit
249d3b0ef3

+ 1 - 1
src/main.go

@@ -38,7 +38,7 @@ func init() {
 	xweb.AddAction(&service.App{}) // 程序
 	xweb.AddAction(&lua.Lua{})
 	xweb.RootApp().AppConfig.SessionTimeout = 1 * time.Hour
-	xweb.RootApp().Logger.SetOutputLevel(1)
+	xweb.RootApp().Logger.SetOutputLevel(2)
 
 	//xweb.AddTmplVar("add", func(a, b int) int { return a + b })
 	//InitTask("5ecf56ed92b4ee16ffd7e21e")

+ 20 - 0
src/service/repair_pro_service.go

@@ -3,6 +3,7 @@ package service
 import (
 	"encoding/json"
 	mu "mfw/util"
+	"mongodb"
 	"net"
 	qu "qfw/util"
 	"time"
@@ -93,3 +94,22 @@ func (jy *RepairRule) RepairProSave() {
 		}
 	}
 }
+
+func (jy *RepairRule) RepairPid() {
+	defer qu.Catch()
+	if jy.Method() == "POST" {
+		sid := jy.GetString("sid")
+		data, _ := JyProMgo.FindOneByField(JyProColl, map[string]interface{}{"ids": sid}, map[string]interface{}{"ids": 1})
+		qu.Debug(*data)
+		if len(*data) > 0 {
+			jy.ServeJson(map[string]interface{}{
+				"rep": true,
+				"pid": mongodb.BsonIdToSId((*data)["_id"]),
+			})
+		} else {
+			jy.ServeJson(map[string]interface{}{
+				"rep": false,
+			})
+		}
+	}
+}

+ 2 - 1
src/service/repair_service.go

@@ -58,6 +58,7 @@ type RepairRule struct {
 
 	repairPro       xweb.Mapper `xweb:"/service/jy/repair/pro"`
 	repairFindPro   xweb.Mapper `xweb:"/service/jy/repair/queryPro"`
+	repairPid       xweb.Mapper `xweb:"/service/jy/repair/queryPid"`
 	repairProSave   xweb.Mapper `xweb:"/service/jy/repair/pro/save"`
 	repairProRecord xweb.Mapper `xweb:"/service/jy/repair/pro/record"`
 
@@ -808,7 +809,7 @@ func (jy *RepairRule) SearchSha() {
 	if jy.Method() == "POST" {
 		sha := jy.GetString("sha")
 		if sha != "" {
-			info, _ := JYMgo.Find("bidding", bson.M{"s_sha": sha}, nil, nil, false, -1, -1)
+			info, _ := JYMgo.Find("bidding", bson.M{"s_sha": sha}, nil, bson.M{"title": 1, "publishtime": 1, "href": 1}, false, 0, 20)
 			if len(*info) > 0 {
 				jy.ServeJson(map[string]interface{}{
 					"orgColl": JyCollNameOne,

+ 2 - 3
src/util/config.go

@@ -124,7 +124,6 @@ func initJYMgo() {
 		Password:    qu.ObjToString(Sysconfig["upwd"]),
 	}
 	EntMgo.InitPool()
-	
 
 }
 
@@ -219,8 +218,8 @@ func initEs() {
 	JyEs = &Elastic{
 		S_esurl:  qu.ObjToString(Sysconfig["elasticsearch"]),
 		I_size:   qu.IntAllDef(qu.Int64All(Sysconfig["elasticPoolSize"]), 30),
-		Username: "es_all",
-		Password: "TopJkO2E_d1x",
+		Username: "jianyuGr",
+		Password: "we3g8glKfe#",
 	}
 	JyEs.InitElasticSize()
 

+ 51 - 0
src/web/templates/repair/jy_pro_repair.html

@@ -9,6 +9,7 @@
         <h1>剑鱼项目数据维护
             <small>
                 <button class="btn btn-instagram btn-sm" onclick="modifySingle()"><i class="fa fa-fw fa-edit fa-lg"></i>单条修改</button>
+                <button class="btn btn-instagram btn-sm" onclick="findPid()"><i class="fa fa-fw fa-edit fa-lg"></i>查询项目id</button>
                 <form style="display:none" id='uploadform' method='post'>
                     <input type='file' name='xlsx' id='file'/>
                 </form>
@@ -99,6 +100,31 @@
         </div><!-- /.modal-content -->
     </div><!-- /.modal -->
 </div>
+<div class="modal fade" id="modal-proid" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                    <div class="edit-form">
+                        <div class="edit-info">
+                            <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
+                            <span>输入标讯id</span>
+                        </div>
+                        <div class="col-sm-12">
+                            <input type="text" class="form-control" id="input_pid_f" placeholder="请输入查询项目id"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <input type="button" onclick="findPidF()" class="btn btn-primary saveBtn" value="查询">
+                    <input type="button" onclick="cancelModel()" class="btn btn-default" style="margin-left: 24px"
+                           value="取消">
+                </div>
+            </div>
+        </div><!-- /.modal-content -->
+    </div><!-- /.modal -->
+</div>
 {{include "com/footer.html"}}
 <script>
     menuActive("/service/jy/repair/pro");
@@ -165,6 +191,7 @@
     function cancelModel() {
         $('#modal-pro-id').modal("hide")
         $('#modal-pro-modify').modal("hide")
+        $('#modal-proid').modal("hide")
     }
     function confirmModel() {
         var pid = $('#input_pid').val()
@@ -238,4 +265,28 @@
             })
         });
     }
+
+    function findPid() {
+        $('#modal-proid').modal("show")
+    }
+    function findPidF() {
+        var sid = $('#input_pid_f').val()
+        if (sid === "") {
+            showTip("请输入标讯id")
+            return
+        }
+        $.ajax({
+            url: "/service/jy/repair/queryPid",
+            type: 'POST',
+            data: {"sid": sid},
+            success: function (r) {
+                $('#modal-proid').modal("hide")
+                if (r.rep) {
+                    showMsg("查询到项目:\n"+r.pid)
+                } else {
+                    showTip("未查询到项目信息")
+                }
+            }
+        })
+    }
 </script>