jianghan7 1 år sedan
förälder
incheckning
c13e402aa8
3 ändrade filer med 24 tillägg och 8 borttagningar
  1. 1 1
      CMPlatform/config.json
  2. 20 5
      CMPlatform/service/data_ent.go
  3. 3 2
      CMPlatform/service/rpc_serveice.go

+ 1 - 1
CMPlatform/config.json

@@ -295,5 +295,5 @@
   "filter_owner_appid": [
   ],
   "rpcServer_jy": "192.168.3.206:8699",
-  "rpcServer_project": "192.168.3.206:7979"
+  "rpcServer_project": "127.0.0.1:7979"
 }

+ 20 - 5
CMPlatform/service/data_ent.go

@@ -3,11 +3,11 @@ package service
 import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
-	"app.yhyue.com/moapp/jybase/encrypt"
 	elastic "app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/go-xweb/log"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"app.yhyue.com/moapp/jybase/mongodb"
+	"cmplatform/push"
 	"cmplatform/util"
 	"fmt"
 	es "github.com/olivere/elastic/v7"
@@ -121,7 +121,7 @@ func ImportDataByExcel(mf multipart.File, eid int64, entid string) (int, int64,
 					if mongodb.IsObjectIdHex(val) {
 						tmp["infoid"] = val
 					} else {
-						tmp["infoid"] = encrypt.SE.DecodeString(val) //解密后id
+						tmp["infoid"] = push.SE.DecodeString(val) //解密后id
 					}
 				} else if fMap[index] == "region" {
 					// 业务地区
@@ -131,6 +131,11 @@ func ImportDataByExcel(mf multipart.File, eid int64, entid string) (int, int64,
 						id := util.EntMysql.Insert("d_yys_analyze_dimensions", bson.M{"ent_id": eid, "name": val,
 							"type": 1})
 						tmp[fMap[index]] = id
+						info := util.EntMysql.FindOne("customer_data_yys_permission_elements", bson.M{"ent_id": eid, "element_field": "region", "pcode": nil}, "", "")
+						if info != nil && len(*info) > 0 {
+							util.EntMysql.Insert("customer_data_yys_permission_elements", bson.M{"name": val, "ent_id": eid,
+								"element_field": "region", "pcode": common.IntAll((*info)["code"]), "element_value": id})
+						}
 					}
 				} else if fMap[index] == "industry" {
 					// 行业
@@ -140,6 +145,11 @@ func ImportDataByExcel(mf multipart.File, eid int64, entid string) (int, int64,
 						id := util.EntMysql.Insert("d_yys_analyze_dimensions", bson.M{"ent_id": eid, "name": val,
 							"type": 2})
 						tmp[fMap[index]] = id
+						info := util.EntMysql.FindOne("customer_data_yys_permission_elements", bson.M{"ent_id": eid, "element_field": "industry", "pcode": nil}, "", "")
+						if info != nil && len(*info) > 0 {
+							util.EntMysql.Insert("customer_data_yys_permission_elements", bson.M{"name": val, "ent_id": eid,
+								"element_field": "industry", "pcode": common.IntAll((*info)["code"]), "element_value": id})
+						}
 					}
 				} else if fMap[index] == "winner_tag" {
 					// 中标单位标签
@@ -149,6 +159,11 @@ func ImportDataByExcel(mf multipart.File, eid int64, entid string) (int, int64,
 						id := util.EntMysql.Insert("d_yys_analyze_dimensions", bson.M{"ent_id": eid, "name": val,
 							"type": 3})
 						tmp[fMap[index]] = id
+						info := util.EntMysql.FindOne("customer_data_yys_permission_elements", bson.M{"ent_id": eid, "element_field": "winner_tag", "pcode": nil}, "", "")
+						if info != nil && len(*info) > 0 {
+							util.EntMysql.Insert("customer_data_yys_permission_elements", bson.M{"name": val, "ent_id": eid,
+								"element_field": "winner_tag", "pcode": common.IntAll((*info)["code"]), "element_value": id})
+						}
 					}
 				} else {
 					if fMap[index] != "" {
@@ -271,8 +286,8 @@ func (e *EntData) DelData() {
 		id, _ := e.GetInt("id")
 		eid, _ := e.GetInt("eid")
 		// todo rpc
-		go DelFuc(id, eid)
-		b := util.EntMysql.Update("customer_data", bson.M{"id": id}, bson.M{"status": -2, "projectId": nil})
+		DelFuc(id, eid)
+		b := util.EntMysql.Update("customer_data", bson.M{"id": id}, bson.M{"status": -2})
 		util.Es.DelById("bidding_customer", "", fmt.Sprint(id))
 		if b {
 			e.ServeJson(map[string]interface{}{"rep": true})
@@ -306,7 +321,7 @@ func detailFuc(infoid string) string {
 func esSaveFuc(tmp map[string]interface{}, detail string, saveEsArr *[]map[string]interface{}) {
 	saveEs := make(map[string]interface{})
 	for _, f := range []string{"id", "tagname", "publishtime", "toptype", "subtype", "area", "city", "district", "title", "buyerclass",
-		"detail", "ent_id", "matchkey", "region", "industry", "winning_tag", "buyer", "budget", "s_winner", "bidamount", "pici"} {
+		"detail", "ent_id", "matchkey", "region", "industry", "winner_tag", "buyer", "budget", "s_winner", "bidamount", "pici"} {
 		if f == "tagname" {
 			var a1 []string
 			for _, i := range []string{"tagname", "tagname2", "tagname3"} {

+ 3 - 2
CMPlatform/service/rpc_serveice.go

@@ -16,7 +16,7 @@ type DelResponse struct {
 	Msg    string
 }
 
-func DelFuc(eid, infoid int64) {
+func DelFuc(infoid, eid int64) {
 	conn, err := rpc.DialHTTP("tcp", util.RpcProServer)
 	if err != nil {
 		log.Debug("dailing error: ", err)
@@ -26,10 +26,11 @@ func DelFuc(eid, infoid int64) {
 		InfoId: infoid,
 	}
 	var res DelResponse
+	log.Debug(req.Eid, req.InfoId)
 	err = conn.Call("JyService.InfoDel", req, &res)
 	if err != nil {
 		log.Debug("JyService error: ", err)
 	}
-	log.Debug(res)
+	log.Debug(res.Msg, res.Status)
 	_ = conn.Close()
 }