Browse Source

1、部署配置调整
2、公益图改为不显示
3、轮播计划改为不播公益图

wangwx 1 năm trước cách đây
mục cha
commit
07b902fabe

+ 20 - 5
ruoyi-admin/src/main/resources/application-prod.yml

@@ -1,6 +1,14 @@
 ruoyi:
     # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-    profile: /home/ruoyi/uploadPath
+    profile: /home/subway_simple/uploadPath
+server:
+    # 服务器的HTTP端口,默认为8080
+    port: 9101
+    servlet:
+        # 应用的访问路径
+        context-path: /
+yml:
+    log-path: /home/subway_simple/logs
 # 数据源配置
 spring:
     datasource:
@@ -64,7 +72,7 @@ spring:
         # 端口,默认为6379
         port: 6379
         # 数据库索引
-        database: 6
+        database: 10
         # 密码
         password: RYgBBk=jXnN]VdQ5}r1B
         # 连接超时时间
@@ -84,13 +92,20 @@ spring:
 mcu:
     socket:
         # 监听端口
-        socketPort: 8088
+        socketPort: 9102
         # 缓冲区大小
         bufferSize: 4096
         #处理收发数据的线程数,默认为2
-        dealThreadQuantity: 8
+        dealThreadQuantity: 2
+    socket25:
         # 监听端口
-        socketPortTest: 8083
+        socketPort: 9103
+        # 缓冲区大小
+        bufferSize: 4096
+        #处理收发数据的线程数,默认为2
+        dealThreadQuantity: 2
+        # 25寸图片下载
+        httpServer: http://139.196.196.226:9101/httpServer/
 
 #复旦微通信 RSA秘钥
 se:

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 183 - 185
ruoyi-admin/src/main/resources/application.yml


+ 94 - 93
ruoyi-admin/src/main/resources/logback.xml

@@ -1,93 +1,94 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-    <!-- 日志存放路径 -->
-	<property name="log.path" value="/project_subway/logs" />
-    <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
-
-	<!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-	</appender>
-	
-	<!-- 系统日志输出 -->
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-info.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-		</rollingPolicy>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>INFO</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-	</appender>
-	
-	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-error.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>ERROR</level>
-			<!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-	
-	<!-- 用户访问日志输出  -->
-    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
-		<file>${log.path}/sys-user.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 按天回滚 daily -->
-            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-	
-	<!-- 系统模块日志级别控制  -->
-	<logger name="com.ruoyi" level="info" />
-	<!-- Spring日志级别控制  -->
-	<logger name="org.springframework" level="warn" />
-
-	<root level="info">
-		<appender-ref ref="console" />
-	</root>
-	
-	<!--系统操作日志-->
-    <root level="info">
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
-    </root>
-	
-	<!--系统用户操作日志-->
-    <logger name="sys-user" level="info">
-        <appender-ref ref="sys-user"/>
-    </logger>
-</configuration>
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <springProperty scope="context" name="logPath" source="yml.log-path" defaultValue="/home/ruoyi/logs" />
+    <!-- 日志存放路径 -->
+	<property name="log.path" value="${logPath}" />
+    <!-- 日志输出格式 -->
+	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+	<!-- 控制台输出 -->
+	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+	</appender>
+	
+	<!-- 系统日志输出 -->
+	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+	</appender>
+	
+	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+			<!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+	
+	<!-- 用户访问日志输出  -->
+    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${log.path}/sys-user.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 按天回滚 daily -->
+            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+	
+	<!-- 系统模块日志级别控制  -->
+	<logger name="com.ruoyi" level="info" />
+	<!-- Spring日志级别控制  -->
+	<logger name="org.springframework" level="warn" />
+
+	<root level="info">
+		<appender-ref ref="console" />
+	</root>
+	
+	<!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+    </root>
+	
+	<!--系统用户操作日志-->
+    <logger name="sys-user" level="info">
+        <appender-ref ref="sys-user"/>
+    </logger>
+</configuration>

+ 6 - 0
ruoyi-system/pom.xml

@@ -81,6 +81,12 @@
             <artifactId>bcprov-jdk15to18</artifactId>
         </dependency>
 
+        <!--图片压缩-->
+        <dependency>
+            <groupId>net.coobird</groupId>
+            <artifactId>thumbnailator</artifactId>
+            <version>0.4.19</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/advertiser/service/impl/CarouselPlanServiceImpl.java

@@ -83,6 +83,9 @@ public class CarouselPlanServiceImpl implements ICarouselPlanService {
         // 图片素材
         Long[] morning = Convert.toLongArray(adCarouselPlanDto.getMorningPeakMaterialIds().split(";"));
         List<MaterialUrlDto> allPic = materialMapper.selectMaterialByIds(morning);
+        if (allPic.size()==0){
+            allPic = materialMapper.selectMaterialByIds(new Long[]{Long.valueOf(SubwayConstant.AD_PUBLIC_BENEFIT_MATERIAL)});
+        }
         // 计算地铁运营开始和结束时间
         Date stationStartDate = Convert.toDate(SubwayConstant.STATION_START_TIME);
         Date stationEndDate = Convert.toDate(SubwayConstant.STATION_END_TIME);

+ 16 - 0
ruoyi-system/src/main/java/com/ruoyi/advertiser/service/impl/MaterialServiceImpl.java

@@ -18,6 +18,8 @@ import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.setsm.service.SeActivatingService;
 import lombok.extern.slf4j.Slf4j;
+import net.coobird.thumbnailator.Thumbnailator;
+import net.coobird.thumbnailator.Thumbnails;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.client.HttpClientErrorException;
@@ -57,6 +59,20 @@ public class MaterialServiceImpl implements IMaterialService {
         material.setStatus(MaterialStatusEnum.WAIT_SUBMIT.getCode());
         material.setCreateBy(SecurityUtils.getUsername());
         material.setCreateTime(DateUtils.getNowDate());
+        // 添加缩略图
+//        try {
+//            String orgPath = material.getOriginalPicUrl();
+//            String localPath = RuoYiConfig.getUploadPath() + orgPath.split("/profile/upload")[1];
+//            Thumbnails.of(localPath)
+//                    .size(500,374)
+//                    .outputQuality(0.8f)
+//                    .outputFormat("png")
+//                    .toFile(localPath.substring(0, localPath.lastIndexOf(".")) + "_thumbnail.png");
+//            material.setOriginalPicUrl(orgPath.substring(0,orgPath.lastIndexOf(".")) + "_thumbnail.png");
+//        } catch (Exception e){
+//            e.printStackTrace();
+//            return 0;
+//        }
         return materialMapper.insertMaterial(material);
     }
 

+ 0 - 1
ruoyi-system/src/main/java/com/ruoyi/mcu/config/McuSocketConfig.java

@@ -30,5 +30,4 @@ public class McuSocketConfig {
      */
     private int dealThreadQuantity = 2;
 
-    private int socketPortTest = 8082;
 }

+ 3 - 4
ruoyi-system/src/main/resources/mapper/advertiser/MaterialMapper.xml

@@ -26,10 +26,9 @@
 
     <select id="selectMaterialList" parameterType="com.ruoyi.advertiser.domain.Material" resultMap="MaterialResult">
         <include refid="selectMaterialVo"/>
-        <where>
-            <if test="status != null  and status != ''">and status = #{status}</if>
-            <if test="picShow != null  and picShow != ''">and pic_show = #{picShow}</if>
-        </where>
+        where id > 10
+        <if test="status != null  and status != ''">and status = #{status}</if>
+        <if test="picShow != null  and picShow != ''">and pic_show = #{picShow}</if>
         order by pic_sort
     </select>
 

+ 0 - 5
ruoyi-system25/src/main/java/com/ruoyi/mcu25/config/McuSocketConfig25.java

@@ -30,11 +30,6 @@ public class McuSocketConfig25 {
      */
     private int dealThreadQuantity = 2;
 
-    /**
-     * 测试端口
-     */
-    private int socketPortTest = 8082;
-
     /**
      * 图片下载地址
      */

+ 1 - 1
ruoyi-system25/src/main/java/com/ruoyi/mcu25/server/HttpServer25.java

@@ -181,7 +181,7 @@ public class HttpServer25 {
                     rf.seek(start);
                 }
                 downLength = (int) (end - start) + 1;
-                // If-None-Match-ETag:相同则返回304,让客户端使用本地缓存
+                // If-None-Match-ETag:相同则返回304,让客户端使用本地缓存--优化
             }
             if (downLength == 0){
                 downLength = (int) fileMaxSize + 1;

+ 1 - 1
ruoyi-ui/src/views/advertising/material/index.vue

@@ -38,7 +38,7 @@
 
     <el-row :gutter="10">
       <el-col :span="8" v-for="material in materialList" :key="material.id">
-        <el-card :class="{'active': materialSelected[material.id]}">
+        <el-card v-if="material.id != 1" :class="{'active': materialSelected[material.id]}">
           <el-image :src="material.originalPicUrl" fit="cover" @click="handleClick(material.id)" style="max-width:500px;max-height: 380px;"></el-image>
           <div>
             <div class="bottom">