项目优化,构建文件Lombok异常问题修复

This commit is contained in:
2026-06-29 13:55:42 +08:00
parent 53b3b2c989
commit 0799f9cb4d
47 changed files with 1034 additions and 865 deletions
@@ -1,66 +0,0 @@
///**
// * Copyright (c) 2018 人人开源 All rights reserved.
// *
// * https://www.renren.io
// *
// * 版权所有,侵权必究!
// */
//
//package io.weather.modules.job.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
//
//import javax.sql.DataSource;
//import java.util.Properties;
//
///**
// * 定时任务配置(备注:集群需要打开注释)
// *
// * @author 123
// */
//@Configuration
//public class ScheduleConfig {
//
// @Bean
// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) {
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
// factory.setDataSource(dataSource);
//
// //quartz参数
// Properties prop = new Properties();
// prop.put("org.quartz.scheduler.instanceName", "RenrenScheduler");
// prop.put("org.quartz.scheduler.instanceId", "AUTO");
// //线程池配置
// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
// prop.put("org.quartz.threadPool.threadCount", "20");
// prop.put("org.quartz.threadPool.threadPriority", "5");
// //JobStore配置
// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
// //集群配置
// prop.put("org.quartz.jobStore.isClustered", "true");
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
//
// prop.put("org.quartz.jobStore.misfireThreshold", "12000");
// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
//
// //PostgreSQL数据库,需要打开此注释
// //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
//
// factory.setQuartzProperties(prop);
//
// factory.setSchedulerName("RenrenScheduler");
// //延时启动
// factory.setStartupDelay(30);
// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
// //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
// factory.setOverwriteExistingJobs(true);
// //设置自动启动,默认为true
// factory.setAutoStartup(true);
//
// return factory;
// }
//}
@@ -8,6 +8,7 @@ import com.weather.common.utils.SpringContextUtils;
import com.weather.modules.job.entity.ScheduleJobEntity;
import com.weather.modules.job.entity.ScheduleJobLogEntity;
import com.weather.modules.job.service.ScheduleJobLogService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,6 +23,7 @@ import java.util.Date;
*
* @author 123
*/
@DisallowConcurrentExecution
public class ScheduleJob extends QuartzJobBean {
private Logger logger = LoggerFactory.getLogger(getClass());
@@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.weather.modules.security.password;
/**
@@ -15,8 +15,9 @@ import jakarta.validation.constraints.Null;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 部门管理
@@ -25,9 +26,9 @@ import java.util.Date;
* @since 1.0.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@Schema(title = "部门管理")
public class SysDeptDTO extends TreeNode implements Serializable {
public class SysDeptDTO implements TreeNode<SysDeptDTO> {
private static final long serialVersionUID = 1L;
@Schema(title = "id")
@@ -39,6 +40,9 @@ public class SysDeptDTO extends TreeNode implements Serializable {
@NotNull(message="{sysdept.pid.require}", groups = DefaultGroup.class)
private Long pid;
@Schema(title = "子部门列表")
private List<SysDeptDTO> children = new ArrayList<>();
@Schema(title = "部门名称")
@NotBlank(message="{sysdept.name.require}", groups = DefaultGroup.class)
private String name;
@@ -16,8 +16,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 菜单管理
@@ -26,9 +27,9 @@ import java.util.Date;
* @since 1.0.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode
@Schema(title = "菜单管理")
public class SysMenuDTO extends TreeNode<SysMenuDTO> implements Serializable {
public class SysMenuDTO implements TreeNode<SysMenuDTO> {
private static final long serialVersionUID = 1L;
@Schema(title = "id")
@@ -40,6 +41,9 @@ public class SysMenuDTO extends TreeNode<SysMenuDTO> implements Serializable {
@NotNull(message="{sysmenu.pid.require}", groups = DefaultGroup.class)
private Long pid;
@Schema(title = "子菜单列表")
private List<SysMenuDTO> children = new ArrayList<>();
@Schema(title = "菜单名称")
@NotBlank(message="sysmenu.name.require", groups = DefaultGroup.class)
private String name;
@@ -1,11 +1,3 @@
/**
* Copyright (c) 2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package com.weather.modules.sys.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -1,11 +1,3 @@
/**
* Copyright (c) 2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package com.weather.modules.sys.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -39,7 +39,7 @@ public class WeatherDataListener extends AnalysisEventListener<WeatherExcelVO> {
try {
LocalDate localDate = LocalDate.of(data.getYear(), data.getMonth(), data.getDay());
entity.setObserveDate(Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
entity.setObserveDate(Date.from(localDate.atStartOfDay(ZoneId.of("GMT+8")).toInstant()));
} catch (Exception e) {
log.warn("第{}行日期转换失败: {}年{}月{}日,已跳过", context.readRowHolder().getRowIndex(),
data.getYear(), data.getMonth(), data.getDay());
@@ -55,7 +55,7 @@ public class WeatherSummarizeCacheTask implements ITask {
.collect(Collectors.groupingBy(dto -> String.valueOf(dto.getStationId())));
String key = RedisKeys.getWeatherSummarizeKey(month, day);
redisUtils.set(key, grouped, RedisUtils.NOT_EXPIRE);
redisUtils.set(key, grouped, RedisUtils.HOUR_SIX_EXPIRE);
log.info("天气汇总缓存刷新完成,共 {} 条记录,{} 个站点", list.size(), grouped.size());
} catch (Exception e) {
@@ -61,10 +61,10 @@ public class WeatherExcelVO {
@ExcelProperty("最大风速出现时间")
private Integer maxWindTime;
@ExcelProperty("极大风速的风向(角度)")
@ExcelProperty("极大风速")
private BigDecimal extremeWindSpeed;
@ExcelProperty("极大风速")
@ExcelProperty("极大风速的风向(角度)")
private Integer extremeWindDirection;
@ExcelProperty("极大风速出现时间")
@@ -2,7 +2,7 @@ spring:
data:
redis:
database: 0
host: 127.0.0.1
host: 192.168.2.186
port: 6379
password: # 密码(默认为空)
timeout: 6000ms # 连接超时时长(毫秒)
@@ -16,7 +16,7 @@ spring:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
url: jdbc:mysql://192.168.2.186:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
username: root
password: root
initial-size: 10
@@ -51,17 +51,3 @@ spring:
project-options:
redis:
open: true
##多数据源的配置,需要引用renren-dynamic-datasource
#dynamic:
# datasource:
# slave1:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://123456:1433;DatabaseName=renren_security
# username: sa
# password: 123456
# slave2:
# driver-class-name: org.postgresql.Driver
# url: jdbc:postgresql://123456:5432/renren_security
# username: postgres
# password: 123456
@@ -2,7 +2,7 @@ spring:
data:
redis:
database: 0
host: 127.0.0.1
host: 192.168.2.186
port: 6379
password: # 生产环境请设置密码
timeout: 6000ms # 连接超时时长(毫秒)
@@ -16,7 +16,7 @@ spring:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
url: jdbc:mysql://192.168.2.186:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
username: weather
password: 123456
initial-size: 10
@@ -2,7 +2,7 @@ spring:
data:
redis:
database: 0
host: 127.0.0.1
host: 192.168.2.186
port: 6379
password: # 密码(默认为空)
timeout: 6000ms # 连接超时时长(毫秒)
@@ -16,7 +16,7 @@ spring:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
url: jdbc:mysql://192.168.2.186:3306/weather_data_system?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
username: weather
password: 123456
initial-size: 10
@@ -5,7 +5,7 @@ server:
threads:
max: 1000
min-spare: 30
port: 8080
port: 48080
servlet:
context-path: /system-admin
session:
@@ -8,14 +8,14 @@
<springProfile name="dev,test">
<logger name="org.springframework.web" level="TRACE"/>
<logger name="org.springboot.sample" level="TRACE" />
<logger name="io.renren" level="DEBUG" />
<logger name="com.weather" level="DEBUG" />
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR" />
<logger name="io.renren" level="ERROR" />
<logger name="com.weather" level="ERROR" />
</springProfile>
</configuration>