Browse Source

中间库事件经纬度

develop
lau572 6 months ago
parent
commit
54a964d782
  1. 15
      zc-business/src/main/java/com/zc/business/domain/MdEvent.java
  2. 3
      zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java
  3. 32
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  4. 4
      zc-business/src/main/resources/mapper/business/DcStakeMarkMapper.xml

15
zc-business/src/main/java/com/zc/business/domain/MdEvent.java

@ -675,6 +675,9 @@ public class MdEvent
this.lane = dcEvent.getLang(); this.lane = dcEvent.getLang();
//方向:1-上 2-中 3-下 //方向:1-上 2-中 3-下
this.direction = dcEvent.getDirection(); this.direction = dcEvent.getDirection();
//经纬度
this.longitude = dcEvent.getLongitude();
this.latitude = dcEvent.getDimension();
//事件来源编码 //事件来源编码
this.eventSourceCode = dcEvent.getEventSource(); this.eventSourceCode = dcEvent.getEventSource();
//事件来源编码 1-96659,2-交警转接,3-道路巡查,4-视频巡查,5-视频AI,6-一键救援,7-其他 //事件来源编码 1-96659,2-交警转接,3-道路巡查,4-视频巡查,5-视频AI,6-一键救援,7-其他
@ -693,6 +696,18 @@ public class MdEvent
this.eventSource = "一键救援"; this.eventSource = "一键救援";
} else if (dcEvent.getEventSource() == 7){ } else if (dcEvent.getEventSource() == 7){
this.eventSource = "其他"; this.eventSource = "其他";
} else if (dcEvent.getEventSource() == 8){
this.eventSource = "雷达识别";
} else if (dcEvent.getEventSource() == 9){
this.eventSource = "锥桶";
} else if (dcEvent.getEventSource() == 10){
this.eventSource = "护栏碰撞";
} else if (dcEvent.getEventSource() == 11){
this.eventSource = "扫码报警";
} else if (dcEvent.getEventSource() == 12){
this.eventSource = "非机预警";
} else if (dcEvent.getEventSource() == 13){
this.eventSource = "气象检测器";
} }
} }
//事件状态:0-待确认,1-处理中,2-已完成 //事件状态:0-待确认,1-处理中,2-已完成

3
zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcDevice;
import com.zc.business.domain.DcStakeMark; import com.zc.business.domain.DcStakeMark;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -18,4 +19,6 @@ public interface DcStakeMarkMapper extends BaseMapper<DcStakeMark> {
boolean batchInsert(List<DcStakeMark> dcStakeMarkList); boolean batchInsert(List<DcStakeMark> dcStakeMarkList);
DcStakeMark selectByDirection(@Param("stakeMark") String stakeMark,@Param("direction") String direction);
} }

32
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -85,6 +85,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
@Autowired @Autowired
private DcPublishManageMapper dcPublishManageMapper; private DcPublishManageMapper dcPublishManageMapper;
@Autowired
private DcStakeMarkMapper dcStakeMarkMapper;
private final String HAPPEN = "发生"; private final String HAPPEN = "发生";
private final String EVENT = "事件"; private final String EVENT = "事件";
private final String SUBEVENT = "0"; private final String SUBEVENT = "0";
@ -584,6 +587,14 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
//设置事件Id UUID无下划线格式32 //设置事件Id UUID无下划线格式32
String uuid = dcEvent.getId(); String uuid = dcEvent.getId();
int i7 = dcEventMapper.insertDcEvent(dcEvent); int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (StringUtils.isNotEmpty(dcEvent.getStakeMark()) && StringUtils.isNotEmpty(dcEvent.getDirection())){
DcStakeMark dcStakeMark = dcStakeMarkMapper.selectByDirection(dcEvent.getStakeMark(),dcEvent.getDirection());
if (dcStakeMark != null){
dcEvent.setLongitude(dcStakeMark.getLongitude());
dcEvent.setDimension(dcStakeMark.getLatitude());
}
}
if (i7 > 0) { if (i7 > 0) {
//中间库 //中间库
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
@ -734,6 +745,13 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
List<DcEventProcess> dcEventProcessList = new ArrayList<>(); List<DcEventProcess> dcEventProcessList = new ArrayList<>();
for (DcEvent dcEvent : dcEventList) { for (DcEvent dcEvent : dcEventList) {
if (StringUtils.isNotEmpty(dcEvent.getStakeMark()) && StringUtils.isNotEmpty(dcEvent.getDirection())){
DcStakeMark dcStakeMark = dcStakeMarkMapper.selectByDirection(dcEvent.getStakeMark(),dcEvent.getDirection());
if (dcStakeMark != null){
dcEvent.setLongitude(dcStakeMark.getLongitude());
dcEvent.setDimension(dcStakeMark.getLatitude());
}
}
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
mdEventList.add(mdEvent); mdEventList.add(mdEvent);
@ -883,6 +901,13 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
//中间库 //中间库
if (StringUtils.isNotEmpty(dcEvent.getStakeMark()) && StringUtils.isNotEmpty(dcEvent.getDirection())){
DcStakeMark dcStakeMark = dcStakeMarkMapper.selectByDirection(dcEvent.getStakeMark(),dcEvent.getDirection());
if (dcStakeMark != null){
dcEvent.setLongitude(dcStakeMark.getLongitude());
dcEvent.setDimension(dcStakeMark.getLatitude());
}
}
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent); middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
@ -1200,6 +1225,13 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id);
//中间库 //中间库
if (StringUtils.isNotEmpty(dcEvent.getStakeMark()) && StringUtils.isNotEmpty(dcEvent.getDirection())){
DcStakeMark dcStakeMark = dcStakeMarkMapper.selectByDirection(dcEvent.getStakeMark(),dcEvent.getDirection());
if (dcStakeMark != null){
dcEvent.setLongitude(dcStakeMark.getLongitude());
dcEvent.setDimension(dcStakeMark.getLatitude());
}
}
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent); middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);

4
zc-business/src/main/resources/mapper/business/DcStakeMarkMapper.xml

@ -38,4 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
<select id="selectByDirection" resultType="com.zc.business.domain.DcStakeMark">
select stake_mark stakeMark, longitude,latitude,direction,location,section_id sectionId,mileage
from dc_stake_mark where stake_mark = #{stakeMark} and direction = #{direction}
</select>
</mapper> </mapper>

Loading…
Cancel
Save