Browse Source

#天气升级

zhongwei
yang_shj 7 months ago
parent
commit
a7d9b3d3ea
  1. 17
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/WeatherApplication.java
  2. 3
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IDailyHeWeatherService.java
  3. 2
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/IStationService.java
  4. 17
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/DailyHeWeatherServiceImpl.java
  5. 5
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherServiceImpl.java
  6. 19
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/HeWeatherWeatherServiceImpl.java
  7. 4
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationServiceImpl.java
  8. 3
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/service/impl/StationWeatherServiceImpl.java
  9. 10
      hzims-service/weather/src/main/resources/application-dev.yml
  10. 50
      hzims-service/weather/src/main/resources/application-test.yml
  11. 11
      hzims-service/weather/src/main/resources/application.yml
  12. 67
      hzims-service/weather/src/main/resources/template/template.yml

17
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);
}
}

3
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;
/**

2
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;
/**

17
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;
/**

5
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;

19
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;

4
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;

3
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;

10
hzims-service/weather/src/main/resources/application-dev.yml

@ -1,10 +0,0 @@
#服务器端口
server:
port: 8200
#数据源配置
spring:
datasource:
url: ${blade.datasource.prod.url}
username: ${blade.datasource.prod.username}
password: ${blade.datasource.prod.password}

50
hzims-service/weather/src/main/resources/application-test.yml

@ -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

11
hzims-service/weather/src/main/resources/application.yml

@ -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

67
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
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
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}"
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
weather:
public-id: HE2205190840061231
private-key: e283b41e3dc64fe094d3d1ad20ffb8b5
# 备用
# public-id: HE2206221832121153
# private-key: bc3059aff68f49f0ba57970973405a1b

Loading…
Cancel
Save