Преглед изворни кода

sql提交,天气接口请求地址抽取

jingyuanchao пре 2 година
родитељ
комит
ed6df162ca

+ 9 - 0
project_data/sql/0.0.3/soc/soc.sql

@@ -463,6 +463,12 @@ update sys_menu set menu_name='调阅情况跟踪' where menu_name='监控调阅
 -- 教育培训菜单名称变更
 update sys_menu set menu_name='教育培训' where menu_name='教育培训管理' limit 1;
 update sys_menu set menu_name='培训任务下发' where menu_name='培训计划管理' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务新增' WHERE t.menu_name = '教育培训计划新增' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务修改' WHERE t.menu_name = '教育培训计划修改' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务删除' WHERE t.menu_name = '教育培训计划删除' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务下发' WHERE t.menu_name = '教育培训计划下发' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务查询' WHERE t.menu_name = '教育培训计划查询' limit 1;
+UPDATE sys_menu t SET t.menu_name = '教育培训任务导出' WHERE t.menu_name = '教育培训计划导出' limit 1;
 update sys_menu set menu_name='培训登记跟踪' where menu_name='培训任务管理' limit 1;
 update sys_menu set `menu_name`='履职情况跟踪' WHERE  `menu_name`='履职情况查询';
 update sys_menu set `menu_name`='布撤防情况跟踪',parent_id=2000 WHERE  `menu_name`='布撤防状态监管';
@@ -581,3 +587,6 @@ INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_paren
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (17, 'M37000000', NULL, NULL, 2, 'M46000000', NULL, NULL, NULL, NULL);
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (18, 'M38000000', NULL, NULL, 2, 'M47000000', NULL, NULL, NULL, NULL);
 INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (19, 'M41000000', 'M32000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+-- 天气接口配置
+delete from sys_config where config_key='WEATHER_URL';
+INSERT INTO sys_config (config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES (191, '天气接口', 'WEATHER_URL', 'https://ali-weather.showapi.com', 'Y', NULL, now(), NULL, now(), NULL);

+ 5 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/SystemParameterConstant.java

@@ -117,4 +117,9 @@ public class SystemParameterConstant {
      */
     public static final String FORCE_DELETE_PLAN_DATA = "FORCE_DELETE_PLAN_DATA";
 
+    /**
+     * 天气接口参数key
+     */
+    public static final String WEATHER_URL = "WEATHER_URL";
+
 }

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/weather/service/impl/WeatherWarningServiceImpl.java

@@ -1,6 +1,5 @@
 package com.xunmei.core.weather.service.impl;
 
-import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -12,7 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.ErrorMsgConstants;
 import com.xunmei.common.core.constant.SecurityConstants;
-import com.xunmei.common.core.domain.R;
+import com.xunmei.common.core.constant.SystemParameterConstant;
 import com.xunmei.common.core.domain.weather.domain.WeatherWarning;
 import com.xunmei.common.core.domain.weather.dto.WeatherWarningDto;
 import com.xunmei.common.core.domain.weather.vo.CityInfoVo;
@@ -152,7 +151,8 @@ public class WeatherWarningServiceImpl extends ServiceImpl<WeatherWarningMapper,
     }
 
     private  String getWeathDatafromApi(String areaId,String appCode){
-        String host = "https://ali-weather.showapi.com";
+
+        String host = systemParameService.findSysConfigByCode(SystemParameterConstant.WEATHER_URL, SecurityConstants.INNER).getConfigValue();
         String path = "/area-to-weather";
         String method = "GET";
         //String appcode = "6d7d4fa382234e36893f4226f9dd3379";