Browse Source

修改事件 同一事件状态已被修改 返回成功

develop
王兴琳 7 months ago
parent
commit
e220381919
  1. 5
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  2. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  3. 3
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

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

@ -69,6 +69,9 @@ public class DcEvent {
@ApiModelProperty("处理人员")
private Long userId;
@ApiModelProperty("事件子类")
private String eventSubclas;
/**
* 开始时间
*/
@ -133,7 +136,7 @@ public class DcEvent {
* 3-3 立交封闭和限行
* 3-4 服务区封闭和限行
*/
@Excel(name = "事件类型")
@Excel(name = "事件类型字符串")
@ApiModelProperty("事件子类 例:事件子类:* 1-1 追尾* 1-2 侧翻* 1-3 撞护栏* 1-4 自然* 1-5 其他事故* 2-1 车辆故障")
private String eventSubclass;

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

@ -960,8 +960,18 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
@Override
public int updateDcEventState(String id, int state) {
//多次修改请求
DcEvent dcEvent1 = dcEventMapper.selectDcEventById(id);
//事件删除 后 返回成功
if (dcEvent1 ==null){
return 1;
}
//事件状态已被修改 返回成功
if (dcEvent1.getEventState()==state){
return 1;
}
int i = dcEventMapper.updateDcEventState(id, state);
int i = dcEventMapper.updateDcEventState(id, state);
if (i > 0) {
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id);

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

@ -36,6 +36,7 @@
<result property="dimension" column="dimension"/>
<result property="longitude" column="longitude"/>
<result property="linkId" column="link_id"/>
<result property="eventSubclas" column="event_subclas"/>
</resultMap>
<resultMap type="map" id="countMap">
@ -166,6 +167,7 @@
longitude,
dimension,
event_title,
event_subclass as event_subclas,
link_id,
is_perceived,
CASE event_type
@ -406,6 +408,7 @@
dc_event.event_title,
dc_event.occurrence_time,
dc_event.event_type AS event_type,
dc_event.event_subclass AS event_subclas,
CASE dc_event.event_type
WHEN '1' THEN '交通事故'
WHEN '2' THEN '车辆故障'

Loading…
Cancel
Save