xuzhiheng 1 vuosi sitten
vanhempi
commit
03af8effb9

+ 86 - 85
CMPlatform/history/util_history.go

@@ -10,9 +10,10 @@ import (
 	"strings"
 	"time"
 
+	"log"
+
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/go-xweb/log"
 	"app.yhyue.com/moapp/jybase/mail"
 	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/redis"
@@ -300,7 +301,7 @@ func GetIdRange() (bson.M, bool) {
 				return tmpRange, true
 			}
 		} else { //结束id不大于起始id 退出
-			log.Debug("Search End ID Range Error. Sid:", util.LatestId, "Eid:", endId)
+			log.Println("Search End ID Range Error. Sid:", util.LatestId, "Eid:", endId)
 			break
 		}
 	}
@@ -534,7 +535,7 @@ func MergeDatas(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep b
 	item2 := common.ObjToString(tmp["item"])
 	history["item"] = MergeField(item1, item2)
 	history["itemdist"].(map[string]interface{})[item2] = matchkey2
-	log.Debug("组装后的item:", history["item"], history["itemdist"])
+	log.Println("组装后的item:", history["item"], history["itemdist"])
 
 	if isTagRule { //标签模式 tagname、tagid合并
 		tagname1 := common.ObjToString(history["tagname"])
@@ -611,9 +612,9 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 	if dataTable == 2 {
 		isExist, err := redis.Exists("other", "entexportdata_"+id+"_"+fmt.Sprintln(entId))
 		if err != nil {
-			log.Debug("企业订阅数据导出redis判重失败")
+			log.Println("企业订阅数据导出redis判重失败")
 		} else if isExist {
-			log.Debug("数据重复,id ", id, "entid ", entId)
+			log.Println("数据重复,id ", id, "entid ", entId)
 			return
 		}
 	}
@@ -642,7 +643,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 			if !isOk {
 				util.MgoSave.Save(util.SaveCollProject, tmp)
 			}
-			log.Debug("项目id去重,项目id:", projectId, isOk)
+			log.Println("项目id去重,项目id:", projectId, isOk)
 		}
 	} else {
 		tmp["projectId"] = ""
@@ -789,7 +790,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 							}
 						}
 					}
-					log.Debug("查询附件结果:", id, "附件数量:", len(filesArr))
+					log.Println("查询附件结果:", id, "附件数量:", len(filesArr))
 					if len(filesArr) > 0 {
 						if FilterFilehrefAppidMap[appid] {
 							filesArrs := []map[string]interface{}{}
@@ -846,7 +847,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 								}
 							}
 						}
-						log.Debug("查询附件结果:", id, "附件数量:", len(filesArr))
+						log.Println("查询附件结果:", id, "附件数量:", len(filesArr))
 						if len(filesArr) > 0 {
 							if FilterFilehrefAppidMap[appid] {
 								filesArrs := []map[string]interface{}{}
@@ -1027,7 +1028,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 	}
 	if noticeFilter == 1 && (dataTable == 0 || dataTable == 1) && isOk {
 		ok := checkBidId(appid, id, dataTable)
-		log.Debug("公告去重结果", id, dataTable, ok)
+		log.Println("公告去重结果", id, dataTable, ok)
 		if !ok {
 			isOk = false
 			tmp["chongfu"] = id
@@ -1290,7 +1291,7 @@ func SaveMgo() {
 
 // 数据存库
 func SaveUsermailMgo() {
-	log.Debug("Mgo Save Usermail...")
+	log.Println("Mgo Save Usermail...")
 	arru := make([]map[string]interface{}, 500)
 	indexu := 0
 	counts := 0
@@ -1329,84 +1330,84 @@ func SaveUsermailMgo() {
 
 // 打印初始化信息
 func PrintLog(cus *Customer) {
-	log.Debug("----------------------打标签规则----------------------------")
+	log.Println("----------------------打标签规则----------------------------")
 	for i, tr := range cus.TagRules {
-		log.Debug("tagrules:", i, tr.ID, tr.Name, tr.CustomerId, tr.DepartRuleIds, tr.Fields)
+		log.Println("tagrules:", i, tr.ID, tr.Name, tr.CustomerId, tr.DepartRuleIds, tr.Fields)
 		for j, kw := range tr.KW {
-			log.Debug("kw_matchkey---", kw.MatchType, len(kw.MatchType))
-			log.Debug("------------CReg--------------")
+			log.Println("kw_matchkey---", kw.MatchType, len(kw.MatchType))
+			log.Println("------------CReg--------------")
 			for ck1, cr := range kw.KeyReg.CReg {
-				log.Debug("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
+				log.Println("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
 			}
-			log.Debug("------------AReg--------------")
+			log.Println("------------AReg--------------")
 			for ck1, ar := range kw.KeyReg.AReg {
-				log.Debug("AR---", ck1, ar.CsVal)
+				log.Println("AR---", ck1, ar.CsVal)
 				for _, arc := range ar.AndRegKid {
-					log.Debug("ARC---", arc.CrVal, arc.IsLetter)
+					log.Println("ARC---", arc.CrVal, arc.IsLetter)
 				}
 			}
-			log.Debug("+++++++++++++++++++++AW++++++++++++++++++++++")
-			log.Debug("aw_matchkey---", tr.AW[j].MatchType, len(tr.AW[j].MatchType))
-			log.Debug("------------CReg--------------")
+			log.Println("+++++++++++++++++++++AW++++++++++++++++++++++")
+			log.Println("aw_matchkey---", tr.AW[j].MatchType, len(tr.AW[j].MatchType))
+			log.Println("------------CReg--------------")
 			for ck2, cr := range tr.AW[j].KeyReg.CReg {
-				log.Debug("CR---", ck2, cr.CrVal, cr.CsVal, cr.IsLetter)
+				log.Println("CR---", ck2, cr.CrVal, cr.CsVal, cr.IsLetter)
 			}
-			log.Debug("------------AReg--------------")
+			log.Println("------------AReg--------------")
 			for ck2, ar := range tr.AW[j].KeyReg.AReg {
-				log.Debug("AR---", ck2, ar.CsVal)
+				log.Println("AR---", ck2, ar.CsVal)
 				for _, arc := range ar.AndRegKid {
-					log.Debug("ARC---", arc.CrVal, arc.IsLetter)
+					log.Println("ARC---", arc.CrVal, arc.IsLetter)
 				}
 			}
-			log.Debug("++++++++++++++++++++NW+++++++++++++++++++++++")
-			log.Debug("nw_matchkey---", tr.NW[j].MatchType, len(tr.NW[j].MatchType))
-			log.Debug("------------CReg--------------")
+			log.Println("++++++++++++++++++++NW+++++++++++++++++++++++")
+			log.Println("nw_matchkey---", tr.NW[j].MatchType, len(tr.NW[j].MatchType))
+			log.Println("------------CReg--------------")
 			for ck1, cr := range tr.NW[j].KeyReg.CReg {
-				log.Debug("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
+				log.Println("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
 			}
-			log.Debug("------------AReg--------------")
+			log.Println("------------AReg--------------")
 			for ck1, ar := range tr.NW[j].KeyReg.AReg {
-				log.Debug("AR---", ck1, ar.CsVal)
+				log.Println("AR---", ck1, ar.CsVal)
 				for _, arc := range ar.AndRegKid {
-					log.Debug("ARC---", arc.CrVal, arc.IsLetter)
+					log.Println("ARC---", arc.CrVal, arc.IsLetter)
 				}
 			}
-			log.Debug("tagname-------------", tr.TagNames[j])
-			log.Debug("-------------------------------------------------")
+			log.Println("tagname-------------", tr.TagNames[j])
+			log.Println("-------------------------------------------------")
 		}
 	}
-	log.Debug("----------------------查询规则----------------------------")
+	log.Println("----------------------查询规则----------------------------")
 	for i, dm := range cus.Departments {
-		log.Debug("deparment:", i, dm.ID, dm.Name, dm.CustomerID)
+		log.Println("deparment:", i, dm.ID, dm.Name, dm.CustomerID)
 		for j, sr := range dm.Rules {
-			log.Debug("ck---", j, sr.ID, sr.Name, sr.CustomerID, sr.DepartmentID, sr.GCW.KeyReg, len(sr.GCW.KeyReg), sr.GCW.MatchType, len(sr.GCW.MatchType), sr.Fields, len(sr.Fields), sr.EsQuery)
+			log.Println("ck---", j, sr.ID, sr.Name, sr.CustomerID, sr.DepartmentID, sr.GCW.KeyReg, len(sr.GCW.KeyReg), sr.GCW.MatchType, len(sr.GCW.MatchType), sr.Fields, len(sr.Fields), sr.EsQuery)
 			for j, kw := range sr.KW {
-				log.Debug("kw_matchkey---", kw.MatchType, len(kw.MatchType))
-				log.Debug("------------CReg--------------")
+				log.Println("kw_matchkey---", kw.MatchType, len(kw.MatchType))
+				log.Println("------------CReg--------------")
 				for ck1, cr := range kw.KeyReg.CReg {
-					log.Debug("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
+					log.Println("CR---", ck1, cr.CrVal, cr.CsVal, cr.IsLetter)
 				}
-				log.Debug("------------AReg--------------")
+				log.Println("------------AReg--------------")
 				for ck1, ar := range kw.KeyReg.AReg {
-					log.Debug("AR---", ck1, ar.CsVal)
+					log.Println("AR---", ck1, ar.CsVal)
 					for _, arc := range ar.AndRegKid {
-						log.Debug("ARC---", arc.CrVal, arc.IsLetter)
+						log.Println("ARC---", arc.CrVal, arc.IsLetter)
 					}
 				}
-				log.Debug("+++++++++++++++++++++AW++++++++++++++++++++++")
-				log.Debug("aw_matchkey---", sr.AW[j].MatchType, len(sr.AW[j].MatchType))
-				log.Debug("------------CReg--------------")
+				log.Println("+++++++++++++++++++++AW++++++++++++++++++++++")
+				log.Println("aw_matchkey---", sr.AW[j].MatchType, len(sr.AW[j].MatchType))
+				log.Println("------------CReg--------------")
 				for ck2, cr := range sr.AW[j].KeyReg.CReg {
-					log.Debug("CR---", ck2, cr.CrVal, cr.CsVal, cr.IsLetter)
+					log.Println("CR---", ck2, cr.CrVal, cr.CsVal, cr.IsLetter)
 				}
-				log.Debug("------------AReg--------------")
+				log.Println("------------AReg--------------")
 				for ck2, ar := range sr.AW[j].KeyReg.AReg {
-					log.Debug("AR---", ck2, ar.CsVal)
+					log.Println("AR---", ck2, ar.CsVal)
 					for _, arc := range ar.AndRegKid {
-						log.Debug("ARC---", arc.CrVal, arc.IsLetter)
+						log.Println("ARC---", arc.CrVal, arc.IsLetter)
 					}
 				}
-				log.Debug("--------------------------------------------------------------------------------------")
+				log.Println("--------------------------------------------------------------------------------------")
 			}
 		}
 	}
@@ -1415,25 +1416,25 @@ func PrintLog(cus *Customer) {
 // 匹配
 func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg *Reg, matchKey map[string]bool, matchKeyType map[string]bool, goon, isAddWord bool) (match bool) {
 	defer common.Catch()
-	log.Debug("matchType---", matchType)
+	log.Println("matchType---", matchType)
 	if len(matchType) == 0 && isAddWord { //特殊处理附加词为空的情况
 		match = true
 		return
 	}
 	for _, mt := range matchType {
 		if text := common.ObjToString(fieldText[mt]); text != "" {
-			log.Debug("匹配方式---", mt, "text---", text)
-			log.Debug("--------------开始查找逗号分隔----------------", len(matchReg.CReg))
+			log.Println("匹配方式---", mt, "text---", text)
+			log.Println("--------------开始查找逗号分隔----------------", len(matchReg.CReg))
 			for i, cr := range matchReg.CReg { //逗号分隔,任意一个匹配表示匹配成功
-				log.Debug("iiii---", i, cr.CrVal, goon, matchKey)
+				log.Println("iiii---", i, cr.CrVal, goon, matchKey)
 				if goon && matchKey[cr.CsVal] { //matchkey已存在不在匹配
 					continue
 				}
 				if indexArr := cr.CrVal.FindAllStringIndex(text, -1); len(indexArr) > 0 { //匹配成功
 					if !cr.IsLetter { //reg无字母
-						log.Debug("goon---", goon)
+						log.Println("goon---", goon)
 						if goon {
-							log.Debug("key++++++++++ ++++++++++", cr.CsVal)
+							log.Println("key++++++++++ ++++++++++", cr.CsVal)
 							matchKey[cr.CsVal] = true
 							matchKeyType[mt] = true
 							match = true
@@ -1442,9 +1443,9 @@ func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg
 							return
 						}
 					} else if cr.IsLetter && CheckLetter(text, cr.CrVal, indexArr) { //reg有字母,判断是否是包含关系(AAAIBBB or AI){//
-						log.Debug("goon---", goon)
+						log.Println("goon---", goon)
 						if goon {
-							log.Debug("key++++++++++++++++++++", cr.CsVal)
+							log.Println("key++++++++++++++++++++", cr.CsVal)
 							matchKey[cr.CsVal] = true
 							matchKeyType[mt] = true
 							match = true
@@ -1455,16 +1456,16 @@ func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg
 					}
 				}
 			}
-			log.Debug("--------------开始查找&&分隔----------------", len(matchReg.AReg))
+			log.Println("--------------开始查找&&分隔----------------", len(matchReg.AReg))
 			for j, ar := range matchReg.AReg { //&&分割,所有匹配表示匹配成功
-				log.Debug("jjjj---", j, ar.CsVal, goon, matchKey)
+				log.Println("jjjj---", j, ar.CsVal, goon, matchKey)
 				if goon && matchKey[ar.CsVal] {
 					continue
 				}
 				IsAregMatch := false
-				log.Debug("ar.AndRegKid---", j, ar.AndRegKid, len(ar.AndRegKid))
+				log.Println("ar.AndRegKid---", j, ar.AndRegKid, len(ar.AndRegKid))
 				for n, arc := range ar.AndRegKid { //ar.AndRegKid若有值必不小于2
-					log.Debug("nnnn---", n, arc.CrVal, arc.IsLetter)
+					log.Println("nnnn---", n, arc.CrVal, arc.IsLetter)
 					if indexArr := arc.CrVal.FindAllStringIndex(text, -1); len(indexArr) < 1 { //匹配失败(ar.AndRegKid中任意一个未匹配则失败)
 						break
 					} else { //匹配成功,判断字母
@@ -1476,11 +1477,11 @@ func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg
 						IsAregMatch = true
 					}
 				}
-				log.Debug("IsAregMatch---", IsAregMatch)
+				log.Println("IsAregMatch---", IsAregMatch)
 				if IsAregMatch {
-					log.Debug("goon---", goon)
+					log.Println("goon---", goon)
 					if goon {
-						log.Debug("key++++++++++++++++++++", ar.CsVal)
+						log.Println("key++++++++++++++++++++", ar.CsVal)
 						matchKey[ar.CsVal] = true
 						matchKeyType[mt] = true
 						match = true
@@ -1545,7 +1546,7 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 			if dataSource == 1 {
 				xf, err := xlsx.OpenFile("web/res/fields.xlsx")
 				if err != nil {
-					log.Error("fields file not foud", err.Error())
+					log.Println("fields file not foud", err.Error())
 				}
 				style := xlsx.NewStyle()
 				style.Font.Size = 12
@@ -2273,21 +2274,21 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 				if b, _ := PathExists(dir); !b {
 					err1 := os.MkdirAll(dir, os.ModePerm)
 					if err1 != nil {
-						log.Debug("mkdir err", dir)
+						log.Println("mkdir err", dir)
 					}
 					//fname := t + ".xlsx"
 				}
 				fname := fmt.Sprintf("%s_%s_%s.xlsx", fn, t, common.GetRandom(4))
-				log.Debug("fname", fname)
+				log.Println("fname", fname)
 				err = xf.Save(dir + fname)
 				if err != nil {
-					log.Debug("xls error", fname)
+					log.Println("xls error", fname)
 				} else {
 					for i := 0; i < len(Gmails); i++ {
 						gmail := Gmails[i]
 						status := mail.GSendMail_q("剑鱼标讯", email, "", "", fn, "", dir+fname, fname, gmail)
 						if status {
-							log.Debug("send mail success", fname, email)
+							log.Println("send mail success", fname, email)
 							break
 						}
 					}
@@ -2295,7 +2296,7 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 			} else {
 				xf, err := xlsx.OpenFile("web/res/full_field.xlsx")
 				if err != nil {
-					log.Debug("fields file not foud", err.Error())
+					log.Println("fields file not foud", err.Error())
 				}
 				style := xlsx.NewStyle()
 				style.Font.Size = 12
@@ -2326,21 +2327,21 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 				if b, _ := PathExists(dir); !b {
 					err1 := os.MkdirAll(dir, os.ModePerm)
 					if err1 != nil {
-						log.Debug("mkdir err", dir)
+						log.Println("mkdir err", dir)
 					}
 				}
 				//fname := t + ".xlsx"
 				fname := fmt.Sprintf("%s_%s_%s.xlsx", fn, t, common.GetRandom(4))
-				log.Debug("fname", fname)
+				log.Println("fname", fname)
 				err = xf.Save(dir + fname)
 				if err != nil {
-					log.Debug("xls error", fname)
+					log.Println("xls error", fname)
 				} else {
 					for i := 0; i < len(Gmails); i++ {
 						gmail := Gmails[i]
 						status := mail.GSendMail_q("剑鱼标讯", email, "", "", fn, "", dir+fname, fname, gmail)
 						if status {
-							log.Debug("send mail success", fname, email)
+							log.Println("send mail success", fname, email)
 							break
 						}
 					}
@@ -2383,10 +2384,10 @@ func GetProjectId(id string) (string, int64, int64) {
 			}
 		}
 		projectId = strings.Join(projectIdArr, ",")
-		log.Debug("projectId", projectId)
+		log.Println("projectId", projectId)
 		//
 	} else {
-		log.Debug("ES未查到项目id", id)
+		log.Println("ES未查到项目id", id)
 	}
 	return projectId, zbtime, yitime
 }
@@ -2396,7 +2397,7 @@ func InitProjectId(appid string) {
 	count := 0
 	defer func() {
 		util.MgoSave.DestoryMongoConn(session)
-		log.Debug("本次共取到%d个projectId\n", count)
+		log.Println("本次共取到%d个projectId\n", count)
 	}()
 	save := util.Sysconfig["save"].(map[string]interface{})
 	query := map[string]interface{}{"appid": appid}
@@ -2421,7 +2422,7 @@ func InitUsermailProjectId(appid string) {
 	count := 0
 	defer func() {
 		util.MgoCus.DestoryMongoConn(session)
-		log.Debug("本次共取到%d个projectId\n", count)
+		log.Println("本次共取到%d个projectId\n", count)
 	}()
 	customer := util.Sysconfig["customer"].(map[string]interface{})
 	query := map[string]interface{}{"appid": appid}
@@ -2446,14 +2447,14 @@ func checkBidId(appid, id string, dataTable int) bool {
 	if dataTable == 1 {
 		countData, ok := util.MgoSave.FindOne(util.SaveUserMail, map[string]interface{}{"appid": appid, "id": id})
 		if ok && countData != nil && len(*countData) > 0 {
-			log.Debug("用户 ", appid, " 在 ", util.SaveUserMail, " 中找到重复公告id ", id)
+			log.Println("用户 ", appid, " 在 ", util.SaveUserMail, " 中找到重复公告id ", id)
 			isOk = false
 		}
 	}
 	if dataTable == 0 {
 		countData, ok := util.MgoSave.FindOne(util.SaveColl, map[string]interface{}{"appid": appid, "id": id})
 		if ok && countData != nil && len(*countData) > 0 {
-			log.Debug("用户 ", appid, " 在 ", util.SaveColl, " 中找到重复公告id ", id)
+			log.Println("用户 ", appid, " 在 ", util.SaveColl, " 中找到重复公告id ", id)
 			isOk = false
 		}
 	}
@@ -2520,7 +2521,7 @@ func GetWinnerStyle(s_winner string, v map[string]interface{}) {
 		for _, vw := range strings.Split(s_winner, ",") {
 			//j := 1
 			for _, key := range keyList {
-				log.Debug("中标类型匹配", key)
+				log.Println("中标类型匹配", key)
 				vvs := util.Sysconfig["winner_style_match"].(map[string]interface{})[key].(map[string]interface{})
 				keyWord := common.ObjToString(vvs["keyWord"])
 				name := common.ObjToString(vvs["name"])
@@ -2552,7 +2553,7 @@ func GetWinnerStyle(s_winner string, v map[string]interface{}) {
 				}
 			}
 		}
-		log.Debug("中标类型:", wname)
+		log.Println("中标类型:", wname)
 		v["winner_style"] = wname
 	} else {
 		v["winner_style"] = ""
@@ -2603,7 +2604,7 @@ func saveMysqlPush(tmp map[string]interface{}, entId int) bool {
 	}
 	b := util.JyMysql.Insert("pushentniche", saveMap)
 	if b <= 0 {
-		log.Debug("数据插入pushentniche表失败,id ", common.ObjToString(tmp["id"]), "entid ", entId)
+		log.Println("数据插入pushentniche表失败,id ", common.ObjToString(tmp["id"]), "entid ", entId)
 		return false
 	} else {
 		redis.Put("other", "entexportdata_"+infoid+"_"+fmt.Sprintln(entId), 1, -1)

+ 3 - 2
CMPlatform/push/push.go

@@ -11,9 +11,10 @@ import (
 
 	"app.yhyue.com/moapp/jybase/mongodb"
 
+	"log"
+
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/go-xweb/log"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"app.yhyue.com/moapp/jybase/redis"
 	"github.com/tealeg/xlsx"
@@ -361,7 +362,7 @@ func ttCRM(dataSource, historyId string) string {
 			delete(v, "createtime")
 			delete(v, "historyId")
 			errStr = postTT(dataSource, v)
-			if strings.Contains(errStr, "失败") {
+			if strings.Contains(errStr, "失败") || strings.Contains(errStr, "错误") {
 				return errStr
 			}
 		}

+ 9 - 8
CMPlatform/service/customer_service.go

@@ -1,16 +1,9 @@
 package service
 
 import (
-	"app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/go-xweb/log"
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
-	"app.yhyue.com/moapp/jybase/mongodb"
 	"cmplatform/util"
 	"encoding/json"
 	"fmt"
-	"github.com/lauyoume/gopinyin"
-	"go.mongodb.org/mongo-driver/bson"
 	"io"
 	"net/http"
 	"net/rpc"
@@ -18,6 +11,14 @@ import (
 	"strconv"
 	"strings"
 	"time"
+
+	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/go-xweb/log"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"github.com/lauyoume/gopinyin"
+	"go.mongodb.org/mongo-driver/bson"
 )
 
 type Customer struct {
@@ -459,7 +460,7 @@ func (c *Customer) SynEuser() {
 		})
 		return
 	}
-	b = util.Mgo.Update("euser", bson.M{"_id": mongodb.StringTOBsonId(_id)}, cuser, true, false)
+	b = util.Mgo.Update("euser", bson.M{"_id": mongodb.StringTOBsonId(_id)}, bson.M{"$set": cuser}, true, false)
 	if !b {
 		c.ServeJson(map[string]interface{}{
 			"rep": b,