liujie
7 天以前 af4b8add9d103889472a75973847871b7dcdf3c8
0908
3个文件已修改
33 ■■■■ 已修改文件
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/netty/server/NettyHandle.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/server/WarnMsgService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WarnServiceImpl.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.dataInterchange.api.feignClient.UPWarnMsgAdptInfoClient;
@@ -21,6 +22,7 @@
import com.ruoyi.system.service.IEnterpriseService;
import com.ruoyi.system.service.IWarnService;
import com.ruoyi.system.util.GDMapGeocodingUtil;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -74,6 +76,7 @@
        List<Driver> driverList = driverService.list(new LambdaQueryWrapper<Driver>().eq(Driver::getStatus, 1));
        List<Car> carList = carService.list();
        List<Warn> warns = new ArrayList<>();
        List<Warn> updateWarns = new ArrayList<>();
        for (UPWarnMsgAdptInfoVo vo : list) {
            long count = this.count(new LambdaQueryWrapper<Warn>().eq(Warn::getObjectId, vo.getInfoId()));
            if(0 != count){
@@ -159,14 +162,30 @@
            warn.setObjectId(vo.getInfoId());
            warn.setVehicleNumber(vo.getVehicleNo());
            warn.setPicUrl(vo.getPicUrl());
            warns.add(warn);
            List<Warn> list2 = this.list(new LambdaQueryWrapper<Warn>().eq(Warn::getObjectId, vo.getInfoId()));
            if (!list2.isEmpty()) {
                Warn warn1 = list2.get(0);
                // 比较2个时间大小
                String startTime = warn1.getStartTime();
                String startTime1 = warn.getStartTime();
                if (DateUtils.parseDate(startTime).getTime()>DateUtils.parseDate(startTime1).getTime()) {
                    warn1.setStartTime(startTime1);
                    warn1.setEndTime(startTime);
                }else {
                    warn1.setEndTime(startTime1);
        }
        if (warns.size() > 0) {
            this.saveBatch(warns);
                this.updateById(warn1);
            }else {
                this.save(warn);
            }
        }
    }
    
    
    /**
     * 定时保存车辆id和司机id
     */
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/netty/server/NettyHandle.java
@@ -66,6 +66,7 @@
    
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object object) throws Exception {
        log.info("收到客户端发送消息111:{}", object.toString());
        OuterPacket outerPacket = (OuterPacket) object;
        int id = outerPacket.getId();
        serviceRouting(DataType.getDataType(id), ctx, outerPacket);
ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/server/WarnMsgService.java
@@ -163,8 +163,10 @@
        log.info("上报报警信息cz1({}):{}", DataType.UP_WARN_MSG_ADPT_INFO.getCode(), JSON.toJSONString(upWarnMsgAdptInfo));
        switch (inferiorPlatformId) {
            case 17458936:
                if(!fl_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
                    return;
                }
                if(0x001==upWarnMsgAdptInfo.getLevel()){
                    return;
                }
                break;
@@ -172,6 +174,9 @@
                if(!jh_warnType.contains(upWarnMsgAdptInfo.getWarnType())){
                    return;
                }
                if(0x001==upWarnMsgAdptInfo.getLevel()){
                    return;
                }
                break;
            case 17235341:
                log.info("上报报警信息cz88888({}):{}:{}", DataType.UP_WARN_MSG_ADPT_INFO.getCode(), JSON.toJSONString(upWarnMsgAdptInfo),upWarnMsgAdptInfo.getWarnType());