@@ -51,7 +51,7 @@ public class WarningController { | |||
* 预警确认 | |||
*/ | |||
@PostMapping("/confirm") | |||
public JsonResult confirm(@RequestBody WarningConfirmRequest request){ | |||
public JsonResult confirm(WarningConfirmRequest request){ | |||
return warningService.confirm(request); | |||
} | |||
@@ -222,16 +222,19 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, | |||
@Override | |||
public AirWeatherVO getWeather(Integer airportId) throws ServiceException { | |||
log.info("获取天气信息信息"); | |||
log.info("获取天气信息"); | |||
log.info("获取天气信息, tenantId={}", ShiroUtils.getTenantId()); | |||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||
log.info("获取天气信息, tenant={}", tenant); | |||
log.info("获取天气信息, airportUrl={}", tenant.getAirportUrl()); | |||
//这边需要配置到yml文件里面 | |||
String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather"; | |||
String param = "airportId=" + airportId; | |||
log.info("获取天气信息信息,调用机场接口"); | |||
log.info("获取天气信息信息,url={}", url); | |||
log.info("获取天气信息信息,param={}", param); | |||
log.info("获取天气信息,调用机场接口"); | |||
log.info("获取天气信息,url={}", url); | |||
log.info("获取天气信息,param={}", param); | |||
String weatherStr = HttpUtils.sendGet(url, param); | |||
log.info("获取天气信息信息,调用机场接口结束,weatherStr={}", weatherStr); | |||
log.info("获取天气信息,调用机场接口结束,weatherStr={}", weatherStr); | |||
JsonResult jsonResult; | |||
try { | |||
jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class); |
@@ -57,7 +57,7 @@ public class WarningConfirmService { | |||
*/ | |||
private JsonResult check(Integer tenantId, WarningConfirmRequest request) { | |||
// 判断预警id是否为空 | |||
if (ObjectUtil.isNotNull(request.getId())) { | |||
if (ObjectUtil.isNull(request.getId())) { | |||
throw new ServiceException("预警ID为空"); | |||
} | |||
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() |
@@ -57,7 +57,7 @@ public class WarningIgnoreService { | |||
*/ | |||
private JsonResult check(Integer tenantId, Integer id) { | |||
// 判断预警id是否为空 | |||
if (ObjectUtil.isNotNull(id)) { | |||
if (ObjectUtil.isNull(id)) { | |||
throw new ServiceException("预警ID为空"); | |||
} | |||
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() |
@@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
</select> | |||
<update id="confirm" parameterType="hashmap"> | |||
update th_inspection_file | |||
update th_warning | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | |||
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
</update> | |||
<update id="ignore" parameterType="hashmap"> | |||
update th_inspection_file | |||
update th_warning | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> |