Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 9 months ago
parent
commit
9e2f01b07d
  1. 5
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  2. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java
  3. 46
      zc-business/src/main/java/com/zc/business/domain/MdEvent.java
  4. 5
      zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java
  5. 1
      zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java
  6. 13
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  7. 18
      zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java
  8. 9
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml
  9. 7
      zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml

5
zc-business/src/main/java/com/zc/business/domain/DcEvent.java

@ -235,11 +235,6 @@ public class DcEvent extends BaseEntity {
* 2014/2/21新增
*/
@ApiModelProperty("所属预案")
private Long emergencyPlansId;
/**
*
*/

2
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java

@ -82,6 +82,8 @@ public class DcEventTrafficCongestion extends BaseEntity
private Integer locationType;
@ApiModelProperty("地点描述")
private String locationDescription;
@ApiModelProperty("终止桩号")
private String endStakeMark;
@ApiModelProperty("事件信息实体")

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

@ -647,11 +647,51 @@ public class MdEvent
// 10-异常天气
// 11-其他事件
String eventType = dcEvent.getEventType().toString();
/*if ("1".equals(eventType)){
if ("1".equals(eventType)){
DcEventAccident dcEventAccident = dcEvent.getDcEventAccident();
//事故天气情况
this.accidentWeather = dcEventAccident.getWeatherCondition();
this.accidentQueue = dcEventAccident.getTrafficJam();
}*/
//事故压车(公里)
this.accidentQueue = new BigDecimal(Float.toString(dcEventAccident.getTrafficJam()));
} else if ("2".equals(eventType)){
DcEventVehicleAccident dcEventVehicleAccident = dcEvent.getDcEventVehicleAccident();
//事故天气情况
this.accidentWeather = dcEventVehicleAccident.getWeatherCondition();
//事故压车(公里)
this.accidentQueue = new BigDecimal(Float.toString(dcEventVehicleAccident.getTrafficJam()));
} else if ("3".equals(eventType)){
DcEventTrafficControl dcEventTrafficControl = dcEvent.getDcEventTrafficControl();
//管制分类
this.controlCategory = dcEventTrafficControl.getControlType();
//管制原因类型
this.controlReasonType = dcEventTrafficControl.getControlCause().toString();
//管制出入口
this.controlStation = dcEventTrafficControl.getFacilityId();
//管制措施
this.controlStrategy = dcEventTrafficControl.getMeasure();
//管制限制类型
this.controlType = dcEventTrafficControl.getLimitedType();
//管制车辆类型
this.controlVehicleType = dcEventTrafficControl.getVehicleType();
} else if ("4".equals(eventType)){
DcEventTrafficCongestion dcEventTrafficCongestion = dcEvent.getDcEventTrafficCongestion();
//拥堵里程(公里)
this.congestionPile = dcEventTrafficCongestion.getCongestionMileage().longValue();
//拥堵原因
this.congestionReason = dcEventTrafficCongestion.getCongestionCause();
} else if ("7".equals(eventType)){
DcEventConstruction dcEventConstruction = dcEvent.getDcEventConstruction();
//管制分类
this.controlCategory = dcEventConstruction.getControlMode();
} else if ("8".equals(eventType)){
DcEventServiceArea dcEventServiceArea = dcEvent.getDcEventServiceArea();
//管制出入口
this.controlStation = dcEventServiceArea.getFacilityId();
} else if ("10".equals(eventType)){
DcEventAbnormalWeather dcEventAbnormalWeather = dcEvent.getDcEventAbnormalWeather();
}
}
}

5
zc-business/src/main/java/com/zc/business/mapper/MiddleDatabaseMapper.java

@ -1,5 +1,8 @@
package com.zc.business.mapper;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.zc.business.domain.DcBoardReleaseLog;
import com.zc.business.domain.DcDevice;
import com.zc.business.domain.MdDeviceData;
@ -13,7 +16,7 @@ import java.util.List;
* @author ruoyi
* @date 2024-01-05
*/
public interface MiddleDatabaseMapper
public interface MiddleDatabaseMapper
{
/**

1
zc-business/src/main/java/com/zc/business/service/IMiddleDatabaseService.java

@ -1,5 +1,6 @@
package com.zc.business.service;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcBoardPublish;
import com.zc.business.domain.DcDevice;

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

@ -12,6 +12,7 @@ import com.ruoyi.system.service.ISysDeptService;
import com.zc.business.domain.*;
import com.zc.business.mapper.*;
import com.zc.business.service.IDcEventService;
import com.zc.business.service.IMiddleDatabaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -58,6 +59,8 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
//部门信息
@Autowired
private ISysDeptService deptService;
@Autowired
private IMiddleDatabaseService middleDatabaseService;
@ -131,6 +134,11 @@ dcEvent.setUserId(SecurityUtils.getUserId());
int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (i7>0){
//中间库
// MdEvent mdEvent = new MdEvent(dcEvent);
// middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType){
@ -205,6 +213,11 @@ dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setUpdateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.updateDcEvent(dcEvent);
if (i7>0) {
//中间库
// MdEvent mdEvent = new MdEvent(dcEvent);
// middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType){
//交通事故

18
zc-business/src/main/java/com/zc/business/service/impl/MiddleDatabaseServiceImpl.java

@ -1,5 +1,6 @@
package com.zc.business.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.DataSourceType;
@ -11,6 +12,8 @@ import com.zc.business.mapper.MiddleDatabaseMapper;
import com.zc.business.service.IMiddleDatabaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -21,6 +24,8 @@ import java.util.List;
* @date 2024-01-03
*/
@Service
@DataSource(value = DataSourceType.SLAVE)//切换数据源
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
@ -34,7 +39,7 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
* @param mdDeviceData 气象检测器数据
* @return 结果
*/
@DataSource(value = DataSourceType.SLAVE)//切换数据源
// @DataSource(value = DataSourceType.SLAVE)//切换数据源
@Override
public boolean insertMiddleDatabaseDeviceData(MdDeviceData mdDeviceData)
{
@ -48,7 +53,7 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
* @param listDevice 设备列表
* @return 结果
*/
@DataSource(value = DataSourceType.SLAVE)//切换数据源
// @DataSource(value = DataSourceType.SLAVE)//切换数据源
@Override
public boolean updateMiddleDatabaseDeviceByList(List<DcDevice> listDevice)
{
@ -65,7 +70,7 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
* @param device 设备
* @return 结果
*/
@DataSource(value = DataSourceType.SLAVE)//切换数据源
// @DataSource(value = DataSourceType.SLAVE)//切换数据源
@Override
public boolean updateMiddleDatabaseDevice(DcDevice device)
{
@ -78,13 +83,12 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
* @param mdEvent 事件
* @return 结果
*/
@DataSource(value = DataSourceType.SLAVE)//切换数据源
@Override
public boolean insertMiddleDatabaseEvent(MdEvent mdEvent){
LoginUser loginUser = SecurityUtils.getLoginUser();
/* LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null) {
mdEvent.setCreatorUserId(loginUser.getUserId());
}
}*/
return middleDatabaseMapper.insertMiddleDatabaseEvent(mdEvent);
}
@ -94,7 +98,7 @@ public class MiddleDatabaseServiceImpl implements IMiddleDatabaseService {
* @param mdEvent 事件
* @return 结果
*/
@DataSource(value = DataSourceType.SLAVE)//切换数据源
// @DataSource(value = DataSourceType.SLAVE)//切换数据源
@Override
public boolean updateMiddleDatabaseEvent(MdEvent mdEvent){
LoginUser loginUser = SecurityUtils.getLoginUser();

9
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -32,7 +32,6 @@
<result property="lang" column="lang" />
<result property="eventTitle" column="event_title" />
<result property="occurrenceTime" column="occurrence_time" />
<result property="emergencyPlansId" column="emergency_plans_id" />
</resultMap>
<resultMap type="map" id="countMap">
@ -66,7 +65,6 @@
<result property="nodeNode" column="node_node" />
<result property="roadId" column="road_id" />
<result property="occurrenceTime" column="occurrence_time" />
<result property="emergencyPlansId" column="emergency_plans_id" />
<result property="eventTitle" column="event_title" />
<result property="commonPhrases" column="common_phrases" />
<result property="stringEventType" column="stringEventType" />
@ -154,7 +152,6 @@
event_level,
event_type,
event_title,
emergency_plans_id,
CASE event_type
WHEN '1' THEN '交通事故'
WHEN '2' THEN '车辆故障'
@ -280,7 +277,6 @@
dc_event.in_tunnel,
dc_event.road_id,
dc_event.event_title,
dc_event.emergency_plans_id,
dc_event_type.event_name AS event_name,
dc_process_config.node_node AS node_node,
@ -329,7 +325,6 @@
<if test="eventNature != null "> and event_nature = #{eventNature}</if>
<if test="eventSourceTips != null and eventSourceTips != ''"> and event_source_tips = #{eventSourceTips}</if>
<if test="inTunnel != null "> and in_tunnel = #{inTunnel}</if>
<if test="emergencyPlansId != null "> and emergency_plans_id = #{emergencyPlansId}</if>
</where>
</select>
@ -367,7 +362,6 @@
dc_event.estimated_end_time,
dc_event.event_level,
dc_event.event_title,
dc_event.emergency_plans_id,
dc_event.occurrence_time,
dc_event.event_type AS event_type,
CASE dc_event.event_type
@ -505,7 +499,6 @@
<if test="lang != null">lang,</if>
<if test="eventTitle != null">event_title,</if>
<if test="occurrenceTime != null">occurrence_time,</if>
<if test="emergencyPlansId != null">emergency_plans_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -533,7 +526,6 @@
<if test="lang != null">#{lang},</if>
<if test="eventTitle != null">#{eventTitle},</if>
<if test="occurrenceTime != null">#{occurrenceTime},</if>
<if test="emergencyPlansId != null">#{emergencyPlansId},</if>
</trim>
</insert>
@ -564,7 +556,6 @@
<if test="lang != null">road_id = #{lang},</if>
<if test="eventTitle != null">event_title = #{eventTitle},</if>
<if test="occurrenceTime != null">occurrence_time = #{occurrenceTime},</if>
<if test="emergencyPlansId != null">emergency_plans_id = #{emergencyPlansId},</if>
</trim>
where id = #{id}
</update>

7
zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml

@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="locationDescription" column="location_description" />
<result property="locationType" column="location_type" />
<result property="detailedReasons" column="detailed_reasons" />
<result property="endStakeMark" column="end_stake_mark" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectDcEventTrafficCongestionVo">
select location_type,location_description,detailed_reasons,id, congestion_mileage, congestion_cause, facility_id, ramp_id, location,max_congestion_mileage from dc_event_traffic_congestion
select end_stake_mark,location_type,location_description,detailed_reasons,id, congestion_mileage, congestion_cause, facility_id, ramp_id, location,max_congestion_mileage from dc_event_traffic_congestion
</sql>
<!-- -->
<sql id="selectDcEventTrafficCongestionVoById">
@ -41,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dc_event_traffic_congestion.location_type as location_type,
dc_event_traffic_congestion.location_description as location_description,
dc_event_traffic_congestion.detailed_reasons as detailed_reasons,
dc_event_traffic_congestion.end_stake_mark as end_stake_mark,
dc_facility.other_config as other_config,
dc_facility.remark as remark,
@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationDescription != null">location_description,</if>
<if test="locationType != null">location_type,</if>
<if test="detailedReasons != null">detailed_reasons,</if>
<if test="endStakeMark != null">end_stake_mark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -93,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationDescription != null">#{locationDescription},</if>
<if test="locationType != null">#{locationType},</if>
<if test="detailedReasons != null">#{detailedReasons},</if>
<if test="endStakeMark != null">#{end_stake_mark},</if>
</trim>
</insert>
@ -108,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="locationDescription != null">location_description = #{locationDescription},</if>
<if test="locationType != null">location_type = #{locationType},</if>
<if test="detailedReasons != null">detailed_reasons = #{detailedReasons},</if>
<if test="endStakeMark != null">end_stake_mark = #{endStakeMark},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save