|
@@ -2,10 +2,13 @@ package com.iotechn.unimall.admin.api.gubi.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.iotechn.unimall.data.component.CacheComponent;
|
|
|
import com.iotechn.unimall.data.domain.gubi.GubiTypeSecond;
|
|
|
import com.iotechn.unimall.data.domain.gubi.GubiTypeThree;
|
|
|
import com.iotechn.unimall.data.mapper.gubi.GubiTypeSecondMapper;
|
|
|
import com.iotechn.unimall.data.mapper.gubi.GubiTypeThreeMapper;
|
|
|
+import com.iotechn.unimall.data.util.Const;
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -39,7 +42,18 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
|
|
|
private GubiTypeSecondMapper gubiTypeSecondMapper;
|
|
|
@Autowired
|
|
|
private GubiTypeThreeMapper gubiTypeThreeMapper;
|
|
|
+ @Autowired
|
|
|
+ private CacheComponent cacheComponent;
|
|
|
+
|
|
|
|
|
|
+ //清理所有Redis缓存
|
|
|
+ public void clearCache() {
|
|
|
+ cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
|
|
|
+ cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
|
|
|
+ cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
|
|
|
+ cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
|
|
|
+ cacheComponent.delPrefixKey(Const.ADMIN_BI_INFO);
|
|
|
+ }
|
|
|
@Override
|
|
|
public Boolean add(GubiTypeInfo gubiTypeInfo, Long adminId) throws ServiceException {
|
|
|
Date now = new Date();
|
|
@@ -86,6 +100,10 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
|
|
|
}
|
|
|
|
|
|
public List<GubiTypeInfo> listInfo() {
|
|
|
+ List<GubiTypeInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO, GubiTypeInfo.class);
|
|
|
+ if (listRedis != null && listRedis.size() > 0) {
|
|
|
+ return listRedis;
|
|
|
+ }
|
|
|
List<GubiTypeInfo> list = gubiTypeInfoMapper.selectList(new EntityWrapper<GubiTypeInfo>()
|
|
|
.eq("delete_flag", "0")
|
|
|
.orderBy("postion"));
|
|
@@ -108,6 +126,8 @@ public class GubiTypeInfoServiceImpl implements IGubiTypeInfoService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ cacheComponent.putRaw(Const.ADMIN_BI_INFO , JSONObject.toJSONString(list), 60 * 60);
|
|
|
+
|
|
|
return list;
|
|
|
}
|
|
|
|