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