Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
fd4b578153
5 changed files with 13 additions and 10 deletions
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java
  2. +8
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  3. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/confirm/WarningConfirmService.java
  4. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/ignore/WarningIgnoreService.java
  5. +2
    -2
      tuoheng-admin/src/main/resources/mapper/WarningMapper.xml

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java View File

* 预警确认 * 预警确认
*/ */
@PostMapping("/confirm") @PostMapping("/confirm")
public JsonResult confirm(@RequestBody WarningConfirmRequest request){
public JsonResult confirm(WarningConfirmRequest request){
return warningService.confirm(request); return warningService.confirm(request);
} }



+ 8
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File



@Override @Override
public AirWeatherVO getWeather(Integer airportId) throws ServiceException { public AirWeatherVO getWeather(Integer airportId) throws ServiceException {
log.info("获取天气信息信息");
log.info("获取天气信息");
log.info("获取天气信息, tenantId={}", ShiroUtils.getTenantId());
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
log.info("获取天气信息, tenant={}", tenant);
log.info("获取天气信息, airportUrl={}", tenant.getAirportUrl());
//这边需要配置到yml文件里面 //这边需要配置到yml文件里面
String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather"; String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather";
String param = "airportId=" + airportId; 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); String weatherStr = HttpUtils.sendGet(url, param);
log.info("获取天气信息信息,调用机场接口结束,weatherStr={}", weatherStr);
log.info("获取天气信息,调用机场接口结束,weatherStr={}", weatherStr);
JsonResult jsonResult; JsonResult jsonResult;
try { try {
jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class); jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class);

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/confirm/WarningConfirmService.java View File

*/ */
private JsonResult check(Integer tenantId, WarningConfirmRequest request) { private JsonResult check(Integer tenantId, WarningConfirmRequest request) {
// 判断预警id是否为空 // 判断预警id是否为空
if (ObjectUtil.isNotNull(request.getId())) {
if (ObjectUtil.isNull(request.getId())) {
throw new ServiceException("预警ID为空"); throw new ServiceException("预警ID为空");
} }
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>()

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/ignore/WarningIgnoreService.java View File

*/ */
private JsonResult check(Integer tenantId, Integer id) { private JsonResult check(Integer tenantId, Integer id) {
// 判断预警id是否为空 // 判断预警id是否为空
if (ObjectUtil.isNotNull(id)) {
if (ObjectUtil.isNull(id)) {
throw new ServiceException("预警ID为空"); throw new ServiceException("预警ID为空");
} }
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>()

+ 2
- 2
tuoheng-admin/src/main/resources/mapper/WarningMapper.xml View File

</select> </select>


<update id="confirm" parameterType="hashmap"> <update id="confirm" parameterType="hashmap">
update th_inspection_file
update th_warning
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="status != null"> status = #{status}, </if> <if test="status != null"> status = #{status}, </if>
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> <if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if>
</update> </update>


<update id="ignore" parameterType="hashmap"> <update id="ignore" parameterType="hashmap">
update th_inspection_file
update th_warning
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="status != null"> status = #{status}, </if> <if test="status != null"> status = #{status}, </if>
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> <if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if>

Loading…
Cancel
Save