Просмотр исходного кода

部门统计、签单统计缓存处理

anderx лет назад: 4
Родитель
Сommit
ee989a1b11

+ 14 - 11
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -11,6 +11,7 @@ import javax.annotation.Resource;
 
 
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import com.goafanti.admin.bo.AdminContacts;
 import com.goafanti.admin.bo.AdminContacts;
@@ -54,7 +55,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	private OrganizationManagementMapper	organizationManagementMapper;
 	private OrganizationManagementMapper	organizationManagementMapper;
 	@Resource(name = "passwordUtil")
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
 	private PasswordUtil					passwordUtil;
-	
+
 	@Override
 	@Override
 	public List<Admin> selectAllAdmin() {
 	public List<Admin> selectAllAdmin() {
 		return adminMapper.selectAllAdmin(null);
 		return adminMapper.selectAllAdmin(null);
@@ -234,7 +235,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 
 	@Override
 	@Override
 	public List<AdminListBo> selectDepartmentStaff(String departmentId, String name) {
 	public List<AdminListBo> selectDepartmentStaff(String departmentId, String name) {
-		
+
 		return adminMapper.selectDepartmentStaff( departmentId,  name);
 		return adminMapper.selectDepartmentStaff( departmentId,  name);
 	}
 	}
 
 
@@ -266,7 +267,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		}
 		}
 		return count;
 		return count;
 	}
 	}
-	
+
 	  /*
 	  /*
      * List分割
      * List分割
      */
      */
@@ -284,7 +285,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
         }
         }
         return listGroup;
         return listGroup;
     }
     }
-  
+
 
 
 	@Override
 	@Override
 	public List<Admin> getListDefaultPassword(String depId) {
 	public List<Admin> getListDefaultPassword(String depId) {
@@ -360,10 +361,12 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(startTime)) params.put("startTime", startTime);
 		if (StringUtils.isNotBlank(startTime)) params.put("startTime", startTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		return (Pagination<AdminCustomerBo>)findPage("selectAdminCustomerList", "selectAdminCustomerCount", params, pageNo, pageSize); 
+		return (Pagination<AdminCustomerBo>)findPage("selectAdminCustomerList", "selectAdminCustomerCount", params, pageNo, pageSize);
 	}
 	}
-	
+
 	@Override
 	@Override
+	@Cacheable(cacheNames = "selectAllUser#500",key = "'selectAllUser:depId:'+#depId+'startTime:'+#startTime+" +
+			"'endTime:'+#endTime+'aName:'+#aName")
 	public depCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
 	public depCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
 		depCountBo acb=new depCountBo();
 		depCountBo acb=new depCountBo();
 		endTime=endTime+" 23:59:59";
 		endTime=endTime+" 23:59:59";
@@ -372,7 +375,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 			acb.setName("科德集团");
 			acb.setName("科德集团");
 //			organizationManagementMapper.getDepAll("科德集团",null,startTime,  endTime);
 //			organizationManagementMapper.getDepAll("科德集团",null,startTime,  endTime);
 			deps=organizationManagementMapper.selectBysuperName("科德集团");
 			deps=organizationManagementMapper.selectBysuperName("科德集团");
-			
+
 		}else {
 		}else {
 			OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
 			OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
 			acb.setName(oo.getName());
 			acb.setName(oo.getName());
@@ -407,7 +410,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		return res;
 		return res;
 	}
 	}
 	/**
 	/**
-	 * 
+	 *
 	 * @param ab
 	 * @param ab
 	 * @param type 0 部门计算 1人员计算
 	 * @param type 0 部门计算 1人员计算
 	 */
 	 */
@@ -445,7 +448,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		ab.setNewCount(newCount);
 		ab.setNewCount(newCount);
 		ab.setChannelNewCount(channelNewCount);
 		ab.setChannelNewCount(channelNewCount);
 		ab.setChannelCompleteCount(channelCompleteCount);
 		ab.setChannelCompleteCount(channelCompleteCount);
-		
+
 	}
 	}
 
 
 	@SuppressWarnings("unchecked")
 	@SuppressWarnings("unchecked")
@@ -486,6 +489,6 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 
 
 
 
 
-	
-	
+
+
 }
 }

+ 1 - 1
src/main/java/com/goafanti/common/utils/RedisUtil.java

@@ -191,7 +191,7 @@ public class RedisUtil {
 				String value=getString(s);
 				String value=getString(s);
 				if (value.contains(id)){
 				if (value.contains(id)){
 					deleteString(s);
 					deleteString(s);
-					LoggerUtils.debug(this.getClass(),"清除缓存token{%s}",id);
+					LoggerUtils.debug(this.getClass(),"清除缓存{%s,aid=%s}",s,id);
 				}
 				}
 			}
 			}
 		} finally {
 		} finally {

+ 3 - 1
src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java

@@ -23,9 +23,11 @@ public class FastJsonRedisSerializer implements RedisSerializer<Object> {
 		pc.addAccept("com.goafanti.lecture.bo.BigShotLectureListBo");
 		pc.addAccept("com.goafanti.lecture.bo.BigShotLectureListBo");
 		pc.addAccept("com.goafanti.news.bo.NewsPortalList");
 		pc.addAccept("com.goafanti.news.bo.NewsPortalList");
 		pc.addAccept("com.goafanti.common.model.Activity");
 		pc.addAccept("com.goafanti.common.model.Activity");
-		pc.addAccept("com.goafanti.portal.bo.InternationalListBo");
+
+		pc.addAccept("com.goafanti.order.bo.outStatisticsList");
 		pc.addAccept("com.goafanti.weChat.bo.OutPublicStatistics");
 		pc.addAccept("com.goafanti.weChat.bo.OutPublicStatistics");
 		pc.addAccept("com.goafanti.core.mybatis.page.Pagination");
 		pc.addAccept("com.goafanti.core.mybatis.page.Pagination");
+
 	}
 	}
 
 
 	@Override
 	@Override

+ 5 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -33,6 +33,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -1401,6 +1402,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 	}
 
 
 	@Override
 	@Override
+	@Cacheable(cacheNames = "statisticsList#500",key = "'statisticsList:depId:'+#in.depId+'province:'+#in.province+" +
+			"'startCreate:'+#in.startCreate+'endCreate:'+#in.endCreate+'startSign:'+#in.startSign+'endSign:'+#in.endSign+'sort:'+#in.sort")
 	public List<outStatisticsList> statisticsList(InputStatistics in) {
 	public List<outStatisticsList> statisticsList(InputStatistics in) {
 		if(in.getSort()==null)in.setSort(0);
 		if(in.getSort()==null)in.setSort(0);
 		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
 		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
@@ -1409,6 +1412,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 	}
 
 
 	@Override
 	@Override
+	@Cacheable(cacheNames = "provinceStatisticsList#500",key = "'statisticsList:depId:'+#in.depId+'province:'+#in.province+" +
+			"'startCreate:'+#in.startCreate+'endCreate:'+#in.endCreate+'startSign:'+#in.startSign+'endSign:'+#in.endSign+'sort:'+#in.sort")
 	public List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in) {
 	public List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in) {
 		if(in.getSort()==null)in.setSort(0);
 		if(in.getSort()==null)in.setSort(0);
 		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
 		if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");

+ 0 - 1
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -116,7 +116,6 @@ public class UserLoginController extends BaseController {
 		Admin a =adminMapper.selectByMobile(admin.getMobile());
 		Admin a =adminMapper.selectByMobile(admin.getMobile());
 		if (a!=null) {
 		if (a!=null) {
 			a.setLastLoginTime(new Date());
 			a.setLastLoginTime(new Date());
-			a.setToken(TokenManager.getSession().getId().toString());
 			adminMapper.updateByPrimaryKeySelective(a);
 			adminMapper.updateByPrimaryKeySelective(a);
 		}
 		}
 		return res;
 		return res;