|
@@ -10,6 +10,7 @@ import (
|
|
|
|
|
|
"app.yhyue.com/moapp/jybase/common"
|
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
|
+ "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
|
"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/entity"
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
@@ -49,6 +50,13 @@ var level_map = map[int64]string{
|
|
|
*/
|
|
|
func (this *PowerService) Power(userid string, baseUserId, accountId, entId, positionType, positionId int64) *entity.Power {
|
|
|
logx.Info("-----req------", userid, baseUserId, accountId, entId, positionType, positionId)
|
|
|
+ if positionId == 0 {
|
|
|
+ return &entity.Power{
|
|
|
+ Free: &entity.Free{
|
|
|
+ IsFree: true,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
ent := &entity.Ent{}
|
|
|
entniche := &entity.Entniche{}
|
|
|
vip := &entity.Vip{}
|
|
@@ -62,6 +70,24 @@ func (this *PowerService) Power(userid string, baseUserId, accountId, entId, pos
|
|
|
}
|
|
|
}
|
|
|
if !cacheBl {
|
|
|
+ if userid == "" && positionId > 0 {
|
|
|
+ logx.Info("检测到异常数据:", userid, baseUserId, accountId, entId, positionType, positionId)
|
|
|
+ if baseUserId <= 0 {
|
|
|
+ //获取mongodb的userid
|
|
|
+ pd := this.Conn.BaseMysql.SelectBySql(`select user_id from base_service.base_position where id =? limit 1`, positionId)
|
|
|
+ if pd != nil && len(*pd) > 0 {
|
|
|
+ baseUserId = common.Int64All((*pd)[0]["user_id"])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if baseUserId > 0 {
|
|
|
+ ud, ok := this.Conn.MgoJy.FindOneByField("user", map[string]interface{}{"base_user_id": baseUserId}, `{"_id:1"}`)
|
|
|
+ if ud != nil && ok && len(*ud) > 0 {
|
|
|
+ userid = mongodb.BsonIdToSId((*ud)["_id"])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity.Alert(fmt.Sprintf("检测到异常数据已修复: userId:%s ,positionId:%v ,positionType:%v </br>", userid, positionId, positionType))
|
|
|
+ logx.Info("检测到异常数据修复后:", userid, baseUserId, accountId, entId, positionType, positionId)
|
|
|
+ }
|
|
|
//获取用户本身的注册时间和邮箱、这个与个人、企业无关
|
|
|
mgoUserFields := map[string]interface{}{
|
|
|
"s_myemail": 1,
|