|
@@ -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"} {
|