shenhao 2 lat temu
rodzic
commit
d41a803029

+ 11 - 1
pom.xml

@@ -172,7 +172,7 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel</artifactId>
-            <version>3.0.5</version>
+            <version>3.1.1</version>
         </dependency>
 
 
@@ -257,6 +257,16 @@
             <artifactId>wechatpay-apache-httpclient</artifactId>
             <version>0.2.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.20</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.13</version>
+        </dependency>
 
     </dependencies>
 

+ 40 - 0
src/main/java/com/aijia/aijiamanager/bean/vacation/VersionConfig.java

@@ -0,0 +1,40 @@
+package com.aijia.aijiamanager.bean.vacation;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className VersionConfig
+ * @description 版本信息
+ * @date 2022/11/29
+ */
+public class VersionConfig implements Serializable {
+    private static final long serialVersionUID = 1534056643006312407L;
+    private String versionName;
+    private String courseName;
+    private int versionType;
+
+    public String getVersionName() {
+        return versionName;
+    }
+
+    public void setVersionName(String versionName) {
+        this.versionName = versionName;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public int getVersionType() {
+        return versionType;
+    }
+
+    public void setVersionType(int versionType) {
+        this.versionType = versionType;
+    }
+}

+ 1 - 0
src/main/java/com/ssj/framework/basic/config/service/ConfigService.java

@@ -44,4 +44,5 @@ public interface ConfigService extends BaseService<Config, String> {
     
     public Config findConfigByParamCode(String paramCode);
 
+    void refushCache(String paramCode);
 }

+ 37 - 0
src/main/java/com/ssj/framework/basic/config/service/impl/ConfigServiceImpl.java

@@ -1,11 +1,14 @@
 package com.ssj.framework.basic.config.service.impl;
 
 import com.ssj.framework.basic.config.bean.Config;
+import com.ssj.framework.basic.config.bean.VersionConfig;
 import com.ssj.framework.basic.config.dao.ConfigDao;
 import com.ssj.framework.basic.config.service.ConfigService;
 import com.ssj.framework.core.common.service.BaseServiceImpl;
 import com.ssj.framework.core.persistence.DynamicSpecifications;
 import com.ssj.framework.core.persistence.SearchFilter;
+import com.ssj.framework.core.security.manager.TokenManager;
+import com.ssj.framework.core.util.SystemResourceLocator;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.domain.Page;
@@ -32,6 +35,21 @@ public class ConfigServiceImpl extends BaseServiceImpl<Config, String> implement
     @Autowired
     public ConfigDao configDao;
 
+    @Autowired
+    private TokenManager tokenManager;
+    /**
+     * 数学
+     */
+    private static String versionKey1="VERSION_M";
+    /**
+     * 语文
+     */
+    private static String versionKey2="VERSION_C";
+    /**
+     * 英语
+     */
+    private static String versionKey3="VERSION_E";
+
     @Override
     public PagingAndSortingRepository<Config, String> getDao() {
         return configDao;
@@ -105,4 +123,23 @@ public class ConfigServiceImpl extends BaseServiceImpl<Config, String> implement
 	public Config findConfigByParamCode(String paramCode) {
 		return configDao.findByParamCode(paramCode);
 	}
+
+    @Override
+    public void refushCache(String paramCode) {
+        String courseName = getCourseName(paramCode);
+        Map<String,List<VersionConfig>> map = SystemResourceLocator.getVersionList(courseName);
+        List<VersionConfig> list = map.get(courseName);
+//        tokenManager.hset(courseName,courseName,list);
+    }
+
+    private String getCourseName(String paramCode){
+        if(paramCode.contains(versionKey2)){
+            return "语文";
+        }else if(paramCode.contains(versionKey1)){
+            return "数学";
+        }else{
+            return "英语";
+        }
+    }
+
 }

+ 6 - 1
src/main/java/com/ssj/sys/controller/ConfigController.java

@@ -89,8 +89,13 @@ public class ConfigController extends BaseController {
     @RequestMapping(value = "/deleteConfig", method = RequestMethod.POST)
     @ResponseBody
     public Response delete(String id) throws Exception{
-    	configService.delete(id);
+
+		Config  config= configService.getById(id);
+		configService.delete(id);
+		//删除key值
+		tokenManager.delString(config.getParamCode());
     	configService.clearConfigCache();
+		configService.refushCache(config.getParamCode());
     	Response response = new  Response();
     	response.success();
         return response;

+ 8 - 4
src/main/resources/application-common-dev.properties

@@ -31,18 +31,21 @@ spring.redis.cluster.pool.max-wait=-1
 spring.redis.cluster.pool.max-idle=8
 spring.redis.cluster.pool.min-idle=0
 spring.redis.block-when-exhausted=true
-spring.redis.password=dc1qazxsw2!@
+spring.redis.password=0987wgU!%*
 spring.redis.timeout=3000
-spring.redis.cluster.nodes=47.106.111.166:6380,47.106.111.166:6381,47.106.111.166:6382,47.106.111.166:6383,47.106.111.166:6384,47.106.111.166:6385
+spring.redis.cluster.nodes=47.115.61.147:7000,47.115.61.147:7001,47.115.61.147:7002,47.115.61.147:7003,47.115.61.147:7004,47.115.61.147:7005
 spring.redis.cluster.timeout=30
 
 
+
+
 #spring.redis.database=0
-#spring.redis.password=dc1qazxsw2!@
+#spring.redis.password=
 #spring.redis.timeout=3000
 #spring.redis.block-when-exhausted=true
-#spring.redis.cluster.nodes=120.79.142.152:6380
+#spring.redis.cluster.nodes=localhost:6379
 #spring.redis.cluster.timeout=30
+#spring.redis.clu
 #
 #spring.redis.cluster.pool.max-active=8
 #spring.redis.cluster.pool.max-wait=-1
@@ -58,6 +61,7 @@ spring.rabbitmq.username=admin1
 spring.rabbitmq.password=admin1
 spring.rabbitmq.publisher-confirms=true  
 spring.rabbitmq.publisher-returns=true
+spring.rabbitmq.listener.simple.auto-startup=false
 
 #/**\u6CE8\u610F\u8FD9\u91CC\u7684\u6CE8\u89E3\u662Fdubbo\u7684\u6CE8\u89E3\uFF0C\u8FD9\u91CC\u6CA1\u6709\u4F7F\u7528\u6CE8\u518C\u4E2D\u5FC3\uFF0C\u4E3A\u76F4\u8FDE\u65B9\u5F0F\uFF0C\u5404\u81EA\u672C\u5730\u5F00\u53D1\u53EF\u4EE5\u653E\u5F00 \uFF08dubbo://ip:\u670D\u52A1\u7AEF\u53E3\uFF09
 #dubbo.reference.url = dubbo://127.0.0.1:9394

+ 1 - 1
src/main/resources/templates/sys/error/errorList.html

@@ -90,7 +90,7 @@
 				    <td th:utext="${item.errorReasonCode eq '0' } ?'答案识别失败':'答案识别错误'" ></td>
 					<td  th:text="${#calendars.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
 					<td  class="imgtd">
-						<img th:onclick="'updateById(\''+${item.fileKey}+'\')'"  th:if="${item.fileKey}!=null" th:src="${imgUrl}+''+${item.fileKey}" style="width: 50px;height: 50px;" />
+						<img th:onclick="'updateById(\''+${item.fileKey}+'\')'"  th:if="${item.fileKey}!=null" th:src="${imgUrl}+''+${item.fileKey}+'?x-oss-process=image/resize,h_1080,m_lfit' " style="width: 50px;height: 50px;" />
 					</td>
 				<td  th:text="${#calendars.format(item.uploadTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
 				<td>