|
@@ -428,29 +428,30 @@ func (m *WorkDesktopMenu) CheckCapitalResources(menu *JYMenu, b, p bool, pUrl st
|
|
cb, ce := redis.GetBytes(RedisCode, checkEntKey)
|
|
cb, ce := redis.GetBytes(RedisCode, checkEntKey)
|
|
if ce == nil && len(*cb) > 0 {
|
|
if ce == nil && len(*cb) > 0 {
|
|
ce = json.Unmarshal(*cb, &menuEntInfo)
|
|
ce = json.Unmarshal(*cb, &menuEntInfo)
|
|
|
|
+ if ce == nil && menuEntInfo.EntId > 0 {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if ce != nil || len(*cb) == 0 {
|
|
|
|
- menuEnt := BaseMysql.FindOne("base_service.work_menu_ent", map[string]interface{}{
|
|
|
|
- "menu_id": menuId,
|
|
|
|
- "ent_id": entId,
|
|
|
|
- }, "", "create_date DESC ")
|
|
|
|
- if menuEnt != nil && (*menuEnt) != nil {
|
|
|
|
- mb, err := json.Marshal(*menuEnt)
|
|
|
|
- if err == nil && len(mb) > 0 {
|
|
|
|
- err = json.Unmarshal(mb, &menuEntInfo)
|
|
|
|
- if err == nil {
|
|
|
|
- err = redis.PutBytes(RedisCode, checkEntKey, &mb, 4*60*60)
|
|
|
|
- // 缓存key
|
|
|
|
- ceks := redis.GetStr(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)))
|
|
|
|
- if !strings.Contains(ceks, checkEntKey) {
|
|
|
|
- ceks = fmt.Sprintf("%s,%s", ceks, checkEntKey)
|
|
|
|
- redis.Put(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)), ceks, 5*60*60)
|
|
|
|
- }
|
|
|
|
|
|
+ menuEnt := BaseMysql.FindOne("base_service.work_menu_ent", map[string]interface{}{
|
|
|
|
+ "menu_id": menuId,
|
|
|
|
+ "ent_id": entId,
|
|
|
|
+ }, "", "create_date DESC ")
|
|
|
|
+ if menuEnt != nil && (*menuEnt) != nil {
|
|
|
|
+ mb, err := json.Marshal(*menuEnt)
|
|
|
|
+ if err == nil && len(mb) > 0 {
|
|
|
|
+ err = json.Unmarshal(mb, &menuEntInfo)
|
|
|
|
+ if err == nil {
|
|
|
|
+ err = redis.PutBytes(RedisCode, checkEntKey, &mb, 4*60*60)
|
|
|
|
+ // 缓存key
|
|
|
|
+ ceks := redis.GetStr(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)))
|
|
|
|
+ if !strings.Contains(ceks, checkEntKey) {
|
|
|
|
+ ceks = fmt.Sprintf("%s,%s", ceks, checkEntKey)
|
|
|
|
+ redis.Put(RedisCode, fmt.Sprintf(CheckEntKK, strconv.FormatInt(positionId, 10)), ceks, 5*60*60)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if err != nil {
|
|
|
|
- log.Println("获取 work_menu_ent 信息 异常:", entId, menuId, m.Phone)
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Println("获取 work_menu_ent 信息 异常:", entId, menuId, m.Phone)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return
|
|
return
|