From a7d9b3d3ea2e54a272fd42153e3ecb3b38b171b4 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 27 Jun 2024 16:38:07 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=A4=A9=E6=B0=94=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/weather/WeatherApplication.java | 19 ++---- .../weather/service/IDailyHeWeatherService.java | 3 +- .../hzims/weather/service/IStationService.java | 2 +- .../service/impl/DailyHeWeatherServiceImpl.java | 17 +----- .../weather/service/impl/HeWeatherServiceImpl.java | 5 -- .../service/impl/HeWeatherWeatherServiceImpl.java | 19 ------ .../weather/service/impl/StationServiceImpl.java | 4 +- .../service/impl/StationWeatherServiceImpl.java | 3 - .../weather/src/main/resources/application-dev.yml | 10 ---- .../src/main/resources/application-test.yml | 50 ---------------- .../weather/src/main/resources/application.yml | 11 ---- .../src/main/resources/template/template.yml | 69 +++++++--------------- 12 files changed, 29 insertions(+), 183 deletions(-) delete mode 100644 hzims-service/weather/src/main/resources/application-dev.yml delete mode 100644 hzims-service/weather/src/main/resources/application-test.yml delete mode 100644 hzims-service/weather/src/main/resources/application.yml diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/WeatherApplication.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/WeatherApplication.java index 3bb02f5..0f4fdbe 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/WeatherApplication.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/WeatherApplication.java @@ -1,30 +1,21 @@ package com.hnac.hzims.weather; -import com.hnac.hzims.hzimsweather.HeWeatherInitialize; import com.hnac.hzims.hzimsweather.constants.WeatherConstant; import org.mybatis.spring.annotation.MapperScan; -import org.springblade.core.cloud.feign.EnableBladeFeign; import org.springblade.core.launch.BladeApplication; -import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; -import org.springframework.cloud.client.SpringCloudApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; /** * @author hx */ -@EnableBladeFeign -@SpringCloudApplication -@MapperScan("com.hnac.hzims.weather.**.mapper.**") +@SpringBootApplication(scanBasePackages = {"org.springblade", "com.hnac.*"}) +@MapperScan(basePackages = {"com.hnac.hzinfo.**.mapper","com.hnac.hzims.**.mapper"}) +@EnableFeignClients(basePackages = {"org.springblade", "com.hnac"}) public class WeatherApplication extends SpringBootServletInitializer { public static void main(String[] args) { BladeApplication.run(WeatherConstant.APP_NAME, WeatherApplication.class, args); } - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { - return BladeApplication.createSpringApplicationBuilder(builder, WeatherConstant.APP_NAME, WeatherApplication.class); - } -} +} \ No newline at end of file diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IDailyHeWeatherService.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IDailyHeWeatherService.java index df6bcce..53ef643 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IDailyHeWeatherService.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IDailyHeWeatherService.java @@ -1,10 +1,9 @@ package com.hnac.hzims.weather.service; +import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.hzimsweather.entity.DailyHeWeatherEntity; -import com.hnac.hzims.hzimsweather.vo.DailyHeWeatherVo; import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo; - import java.util.List; /** diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IStationService.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IStationService.java index d794301..82160d6 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IStationService.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IStationService.java @@ -1,8 +1,8 @@ package com.hnac.hzims.weather.service; +import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.hzimsweather.entity.VStationEntity; - import java.util.List; /** diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/DailyHeWeatherServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/DailyHeWeatherServiceImpl.java index d48f28e..062b4b9 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/DailyHeWeatherServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/DailyHeWeatherServiceImpl.java @@ -1,29 +1,14 @@ package com.hnac.hzims.weather.service.impl; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hnac.hzims.hzimsweather.constants.WeatherConstant; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.hzimsweather.entity.DailyHeWeatherEntity; -import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; -import com.hnac.hzims.hzimsweather.vo.DailyHeWeatherVo; import com.hnac.hzims.hzimsweather.vo.RainFallCountByMonthVo; import com.hnac.hzims.weather.mapper.DailyHeWeatherMapper; -import com.hnac.hzims.weather.service.HeWeatherWeatherService; import com.hnac.hzims.weather.service.IDailyHeWeatherService; -import jodd.util.StringUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.time.LocalDate; import java.util.List; /** diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherServiceImpl.java index 18f544d..e09e438 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherServiceImpl.java @@ -1,13 +1,11 @@ package com.hnac.hzims.weather.service.impl; -import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherHourlyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherNowResponse; import com.hnac.hzims.hzimsweather.response.weather.Hourly; import com.hnac.hzims.weather.service.HeWeatherWeatherService; import com.hnac.hzims.weather.service.IHeWeatherService; -import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.CollectionUtil; @@ -15,10 +13,7 @@ import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; -import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.chrono.ChronoLocalDate; import java.util.List; import java.util.stream.Collectors; diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherWeatherServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherWeatherServiceImpl.java index e6dbd84..78b23a2 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherWeatherServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherWeatherServiceImpl.java @@ -1,6 +1,5 @@ package com.hnac.hzims.weather.service.impl; -import com.alibaba.fastjson.JSONObject; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Strings; @@ -8,8 +7,6 @@ import com.google.common.collect.Multimap; import com.hnac.hzims.hzimsweather.common.ApiEnum; import com.hnac.hzims.hzimsweather.common.LangEnum; import com.hnac.hzims.hzimsweather.common.StatusEnum; -import com.hnac.hzims.hzimsweather.constants.WeatherConstant; -import com.hnac.hzims.hzimsweather.response.HeWeatherResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherDailyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherHourlyResponse; import com.hnac.hzims.hzimsweather.response.weather.HeWeatherWeatherNowResponse; @@ -18,28 +15,12 @@ import com.hnac.hzims.weather.service.HeWeatherBaseService; import com.hnac.hzims.weather.service.HeWeatherWeatherService; import com.hnac.hzims.weather.util.HttpUtil; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.map.HashedMap; -import org.apache.poi.ss.formula.functions.T; -import org.springblade.core.http.HttpRequest; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.core.tool.utils.SpringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; -import javax.servlet.http.HttpServletRequest; import java.io.IOException; -import java.lang.reflect.Method; -import java.time.Duration; -import java.time.LocalDate; -import java.time.Period; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationServiceImpl.java index dd43a21..210d897 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationServiceImpl.java @@ -2,13 +2,11 @@ package com.hnac.hzims.weather.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.hzimsweather.entity.VStationEntity; import com.hnac.hzims.weather.mapper.StationMapper; import com.hnac.hzims.weather.service.IStationService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationWeatherServiceImpl.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationWeatherServiceImpl.java index 22957d1..379ec41 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationWeatherServiceImpl.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationWeatherServiceImpl.java @@ -3,7 +3,6 @@ package com.hnac.hzims.weather.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.google.common.collect.Lists; -import com.hnac.hzims.hzimsweather.constants.WeatherConstant; import com.hnac.hzims.hzimsweather.entity.DailyHeWeatherEntity; import com.hnac.hzims.hzimsweather.entity.VStationEntity; import com.hnac.hzims.hzimsweather.response.weather.Daily; @@ -21,8 +20,6 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; import org.springframework.util.Assert; -import java.time.LocalDate; -import java.time.Period; import java.time.YearMonth; import java.time.format.DateTimeFormatter; import java.util.Arrays; diff --git a/hzims-service/weather/src/main/resources/application-dev.yml b/hzims-service/weather/src/main/resources/application-dev.yml deleted file mode 100644 index 56b22dd..0000000 --- a/hzims-service/weather/src/main/resources/application-dev.yml +++ /dev/null @@ -1,10 +0,0 @@ -#服务器端口 -server: - port: 8200 - -#数据源配置 -spring: - datasource: - url: ${blade.datasource.prod.url} - username: ${blade.datasource.prod.username} - password: ${blade.datasource.prod.password} diff --git a/hzims-service/weather/src/main/resources/application-test.yml b/hzims-service/weather/src/main/resources/application-test.yml deleted file mode 100644 index f5c6be7..0000000 --- a/hzims-service/weather/src/main/resources/application-test.yml +++ /dev/null @@ -1,50 +0,0 @@ -#服务器端口 -server: - port: 8300 - -#数据源配置 -spring: - #排除DruidDataSourceAutoConfigure - autoconfigure: - exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure - datasource: - url: jdbc:mysql://175.6.40.67:5816/dev_hzims_weather?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true - username: root - password: 123 - - redis: - ##redis 单机环境配置 - host: 192.168.1.68 - port: 3577 - password: 1qaz2WSX@redis - database: 0 - ssl: false - -#mybatis-plus配置 -mybatis-plus: - mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.hnac.hzims.**.entity - -xxl: - job: - accessToken: '' - admin: - addresses: http://192.168.1.68:7009/xxl-job-admin - executor: - appname: hzims-weather - ip: 192.168.1.68 - logpath: /data/applogs/xxl-job/jobhandler - logretentiondays: -1 - port: 28300 - -#swagger扫描路径配置 -swagger: - base-packages: - - org.springbalde - - com.hnac - -hzims: - weather: - public-id: HE2206121654341891 - private-key: 0779937e923d4e46b3be9a08bf2e5d45 diff --git a/hzims-service/weather/src/main/resources/application.yml b/hzims-service/weather/src/main/resources/application.yml deleted file mode 100644 index 43c185c..0000000 --- a/hzims-service/weather/src/main/resources/application.yml +++ /dev/null @@ -1,11 +0,0 @@ -#mybatis-plus配置 -mybatis-plus: - mapper-locations: classpath:com/hnac/hzims/**/mapper/*Mapper.xml - #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.hnac.hzims.**.entity - -#swagger扫描路径配置 -swagger: - base-packages: - - org.springbalde - - com.hnac diff --git a/hzims-service/weather/src/main/resources/template/template.yml b/hzims-service/weather/src/main/resources/template/template.yml index a23c283..22feda7 100644 --- a/hzims-service/weather/src/main/resources/template/template.yml +++ b/hzims-service/weather/src/main/resources/template/template.yml @@ -1,31 +1,16 @@ #服务器端口 server: - port: 8200 - -#oss配置 -oss: - endpoint: "${hzinfo.oss.endpoint}" - access-key: "${hzinfo.oss.access-key}" - secret-key: "${hzinfo.oss.secret-key}" + port: 8300 #数据源配置 spring: #排除DruidDataSourceAutoConfigure autoconfigure: - exclude: com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DruidDataSourceAutoConfigure - dynamic: - primary: hzims - datasource: - hzims: - url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/hzims?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true - username: ${hzinfo.db.busines.username} - password: ${hzinfo.db.busines.password} -# -# datasource: -# url: "jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/hzims?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true" -# username: "${hzinfo.db.busines.username}" -# password: "${hzinfo.db.busines.password}" - + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + url: "jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/test_hzims_weather?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true" + username: "${hzinfo.db.busines.username}" + password: "${hzinfo.db.busines.password}" #mybatis-plus配置 mybatis-plus: @@ -33,41 +18,27 @@ mybatis-plus: #实体扫描,多个package用逗号或者分号分隔 typeAliasesPackage: com.hnac.hzims.**.entity -#swagger扫描路径配置 -swagger: - base-packages: com.hnac.hzims.safeproduct - xxl: job: accessToken: '' admin: addresses: "http://${hzims.server.ip}:7009/xxl-job-admin" executor: - appname: hzims-safeproduct - ip: "${hzims.server.ip}" + appname: hzims-weather + ip: 172.31.0.12 logpath: /data/applogs/xxl-job/jobhandler logretentiondays: 7 - port: 28200 + port: 28300 +#swagger扫描路径配置 +swagger: + base-packages: + - org.springbalde + - com.hnac hzims: - tenantId: 200000 - #ops-push - jgPushCode: ops-push - safeProduct: - safeTool: - filePath: /data/hzims/safeProduct/pdf/file - modulePath: /data/hzims/safeProduct/pdf/template/SafeToolTemplate.html - sadeToolKey: hzims:safeProduct:safeToolType - sms-code: aliyun-safeTool-push - rehearsal: - savePath: /data/hzims/safeproduct/rehearsal - train: - savePath: /data/hzims/safeproduct/train - conference: - savePath: /data/hzims/safeproduct/conference - hygiene: - savePath: /data/hzims/safeproduct/hygiene - car: - savePath: /data/hzims/safeproduct/car - risk: - save-path: /data/hzims/file/safeproduct/pdf \ No newline at end of file + weather: + public-id: HE2205190840061231 + private-key: e283b41e3dc64fe094d3d1ad20ffb8b5 + # 备用 + # public-id: HE2206221832121153 + # private-key: bc3059aff68f49f0ba57970973405a1b