mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
Merge branch 'stat' of https://codeup.aliyun.com/6265f483e4166464dc2f9c14/boeu/baseservers into stat
This commit is contained in:
@@ -324,9 +324,6 @@ public class CasesServiceImpl implements ICasesService {
|
|||||||
caseRankingDto.setId((String) o[0]);
|
caseRankingDto.setId((String) o[0]);
|
||||||
caseRankingDto.setTitle((String) o[1]);
|
caseRankingDto.setTitle((String) o[1]);
|
||||||
caseRankingDto.setCount((Integer) o[2]);
|
caseRankingDto.setCount((Integer) o[2]);
|
||||||
if(caseRankingDto.getCount()==0){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
caseRankingDto.setAuthorName((String) o[3]);
|
caseRankingDto.setAuthorName((String) o[3]);
|
||||||
caseRankingDto.setImages((String) o[4]);
|
caseRankingDto.setImages((String) o[4]);
|
||||||
caseRankingDto.setSummary((String) o[5]);
|
caseRankingDto.setSummary((String) o[5]);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xboe.module.interaction.service.impl;
|
package com.xboe.module.interaction.service.impl;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -137,6 +138,8 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
|||||||
Set<String> caseList = new HashSet<>();
|
Set<String> caseList = new HashSet<>();
|
||||||
// Map<String,FavoriteTotalDto> map = new HashMap<>();
|
// Map<String,FavoriteTotalDto> map = new HashMap<>();
|
||||||
|
|
||||||
|
Set<String> noteList = new HashSet<>();
|
||||||
|
|
||||||
for (Favorites f: page.getList()) {
|
for (Favorites f: page.getList()) {
|
||||||
FavoriteTotalDto favoriteTotalDto = new FavoriteTotalDto();
|
FavoriteTotalDto favoriteTotalDto = new FavoriteTotalDto();
|
||||||
favoriteTotalDto.setFavoritesTime(f.getSysCreateTime());
|
favoriteTotalDto.setFavoritesTime(f.getSysCreateTime());
|
||||||
@@ -158,6 +161,11 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
|||||||
if(f.getObjType()==3){
|
if(f.getObjType()==3){
|
||||||
caseList.add(f.getObjId());
|
caseList.add(f.getObjId());
|
||||||
}
|
}
|
||||||
|
if(f.getObjType()==6){
|
||||||
|
noteList.add(f.getObjId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -254,6 +262,32 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!noteList.isEmpty()){
|
||||||
|
StringBuilder ids=new StringBuilder();
|
||||||
|
for (String s:noteList) {
|
||||||
|
ids.append("'");
|
||||||
|
ids.append(s);
|
||||||
|
ids.append("'");
|
||||||
|
ids.append(",");
|
||||||
|
}
|
||||||
|
ids.deleteCharAt(ids.length()-1);
|
||||||
|
String sql="select id,course_name,content,sys_create_aid,sys_create_by,sys_create_time from boe_note_info where id in("+ids+")";
|
||||||
|
List<Object[]> list1 = dao.sqlFindList(sql);
|
||||||
|
for (Object[] o:list1){
|
||||||
|
for (FavoriteTotalDto favoriteTotalDto : list.getList()) {
|
||||||
|
if(o[0].equals(favoriteTotalDto.getId())){
|
||||||
|
favoriteTotalDto.setTitle((String) o[1]);
|
||||||
|
favoriteTotalDto.setContent((String) o[2]);
|
||||||
|
favoriteTotalDto.setAuthorId((String) o[3]);
|
||||||
|
favoriteTotalDto.setAuthorName((String) o[4]);
|
||||||
|
Timestamp time = (Timestamp)o[5];
|
||||||
|
|
||||||
|
favoriteTotalDto.setPublishTime(time.toLocalDateTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.setCount(page.getCount());
|
list.setCount(page.getCount());
|
||||||
list.setPageSize(pageSize);
|
list.setPageSize(pageSize);
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.cache.annotation.Caching;
|
import org.springframework.cache.annotation.Caching;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -56,6 +57,9 @@ public class UserServiceImpl implements IUserService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
OrganizationDao organizationDao;
|
OrganizationDao organizationDao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
RedisTemplate redisTemplate;
|
||||||
|
|
||||||
public List<User> findByNameOrCode(String word){
|
public List<User> findByNameOrCode(String word){
|
||||||
return dao.findList(FieldFilters.or(FieldFilters.eq("name", word),FieldFilters.eq("userNo", word)));
|
return dao.findList(FieldFilters.or(FieldFilters.eq("name", word),FieldFilters.eq("userNo", word)));
|
||||||
@@ -120,7 +124,18 @@ public class UserServiceImpl implements IUserService {
|
|||||||
@Caching(evict = {@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER + "'+#id"),
|
@Caching(evict = {@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER + "'+#id"),
|
||||||
@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER_FILED + "'+#id")})
|
@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER_FILED + "'+#id")})
|
||||||
public void updateSign(String id, String sign) {
|
public void updateSign(String id, String sign) {
|
||||||
|
//name 清掉name 和 sysId的换成
|
||||||
dao.updateFieldById(id,"sign",sign);
|
dao.updateFieldById(id,"sign",sign);
|
||||||
|
User old = dao.get(id);
|
||||||
|
Boolean hasKey = redisTemplate.hasKey(CacheName.KEY_USER_NAME + old.getName());
|
||||||
|
if(hasKey!=null &&hasKey) {
|
||||||
|
redisTemplate.delete(CacheName.KEY_USER_NAME + old.getName());
|
||||||
|
}
|
||||||
|
Boolean hasKey1 = redisTemplate.hasKey(CacheName.KEY_USER_SYSID);
|
||||||
|
if(hasKey1!=null && hasKey1){
|
||||||
|
redisTemplate.delete(CacheName.KEY_USER_SYSID + old.getSysId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -128,6 +143,16 @@ public class UserServiceImpl implements IUserService {
|
|||||||
@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER_FILED + "'+#id")})
|
@CacheEvict(value = CacheName.NAME_USER, key = "'" + CacheName.KEY_USER_FILED + "'+#id")})
|
||||||
public void updateDynamic(String id, Integer dynamic) {
|
public void updateDynamic(String id, Integer dynamic) {
|
||||||
dao.updateFieldById(id,"dynamic",dynamic);
|
dao.updateFieldById(id,"dynamic",dynamic);
|
||||||
|
User old = dao.get(id);
|
||||||
|
Boolean hasKey = redisTemplate.hasKey(CacheName.KEY_USER_NAME + old.getName());
|
||||||
|
if(hasKey!=null &&hasKey) {
|
||||||
|
redisTemplate.delete(CacheName.KEY_USER_NAME + old.getName());
|
||||||
|
}
|
||||||
|
Boolean hasKey1 = redisTemplate.hasKey(CacheName.KEY_USER_SYSID);
|
||||||
|
if(hasKey1!=null && hasKey1){
|
||||||
|
redisTemplate.delete(CacheName.KEY_USER_SYSID + old.getSysId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user