From 216cba88cb9ed400416994cbea87bc1202a8da8e Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Mon, 4 Nov 2024 11:48:46 +0800 Subject: [PATCH] =?UTF-8?q?--=E6=B0=94=E8=B1=A1=E9=A2=84=E8=AD=A6=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=A2=9E=E5=8A=A0=E5=BB=BA=E8=AE=AE=E7=94=A8=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcNoStakeWarningTableServiceImpl.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java index 71dac816..15a7f420 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java @@ -1,18 +1,22 @@ package com.zc.business.service.impl; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.PageUtils; import com.zc.business.domain.DcNoStakeWarningTable; +import com.zc.business.enums.UniversalEnum; import com.zc.business.mapper.DcNoStakeWarningTableMapper; import com.zc.business.service.IDcNoStakeWarningTableService; +import com.zc.business.utils.WeatherTrafficProposeUtil; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * 无桩号预警Service业务层处理 @@ -98,9 +102,27 @@ public class DcNoStakeWarningTableServiceImpl extends ServiceImpl pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime) { - // 分页 + // 启动分页 PageUtils.startPage(); - return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable,endTime,startTime)); + + // 获取分页后的数据 + List resultList = list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable, endTime, startTime)); + + // 处理数据 + resultList.forEach(warningTable -> { + if ("2".equals(warningTable.getWarningType())) { + JSONObject otherConfig = JSONObject.parseObject(warningTable.getOtherConfig()); + String earlyWorningSignal = otherConfig.getString("earlyWorningSignal"); + String[] split = earlyWorningSignal.split(UniversalEnum.YJ_STRING.getValue()); + String content = WeatherTrafficProposeUtil.content( + Integer.parseInt(split[UniversalEnum.ONE.getNumber()]), + split[UniversalEnum.ZERO.getNumber()] + ); + warningTable.setWarningDescription(warningTable.getWarningDescription() + "\n" + content); + } + }); + + return resultList; } @Override