Browse Source

修改 事件删除接口

develop
王兴琳 7 months ago
parent
commit
1ad78f56f9
  1. 6
      zc-business/src/main/java/com/zc/business/controller/DcEventController.java
  2. 2
      zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java
  3. 2
      zc-business/src/main/java/com/zc/business/service/IDcEventService.java
  4. 107
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  5. 8
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

6
zc-business/src/main/java/com/zc/business/controller/DcEventController.java

@ -140,10 +140,10 @@ public class DcEventController extends BaseController
@ApiOperation("删除事件信息")
// @PreAuthorize("@ss.hasPermi('system:event:remove')")
@Log(title = "事件信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{eventType}/{ids}")
public AjaxResult remove(@PathVariable int eventType,@PathVariable String[] ids )
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids )
{
return toAjax(dcEventService.deleteDcEventByIds(eventType,ids));
return toAjax(dcEventService.deleteDcEventByIds(ids));
}
@ApiOperation("事件数量统计")
// @PreAuthorize("@ss.hasPermi('system:event:list')")

2
zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java

@ -27,6 +27,8 @@ public interface DcEventMapper extends BaseMapper<DcEvent>
* @return 事件信息
*/
public DcEvent selectDcEventById(String id);
//查询事件主类信息
public DcEvent selectDcEventMainById(String id);
/**
* 查询事件信息列表

2
zc-business/src/main/java/com/zc/business/service/IDcEventService.java

@ -69,7 +69,7 @@ public interface IDcEventService
* @param ids 需要删除的事件信息主键集合
* @return 结果
*/
public int deleteDcEventByIds(int eventType,String[] ids);
public int deleteDcEventByIds(String[] ids);
/**
* 删除事件信息信息

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

@ -677,13 +677,10 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条
@Override
public int updateDcEvent(DcEvent dcEvent) {
DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(),dcEvent.getId());
dcEvent.setUpdateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.updateDcEvent(dcEvent);
if (i7 > 0) {
String context = comparisonInfo(oldEvent,dcEvent);
//事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId());
@ -691,7 +688,6 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条
dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess);
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
@ -760,59 +756,62 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条
* @return 结果
*/
@Override
public int deleteDcEventByIds(int eventType, String[] ids) {
int i7 = dcEventMapper.deleteDcEventByIds(ids);
if (i7 > 0) {
switch (eventType) {
//交通事故
case 1:
int i1 = dcEventAccidentMapper.deleteDcEventAccidentByIds(ids);
break;
//车辆事故
case 2:
int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentByIds(ids);
break;
//交通管制
case 3:
int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlByIds(ids);
break;
//交通拥堵
case 4:
int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionByIds(ids);
public int deleteDcEventByIds(String[] ids) {
int i7=-1;
for (String id : ids) {
DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id);
int eventType = Math.toIntExact(dcEvent.getEventType());
i7 = dcEventMapper.deleteDcEventById(id);
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
int i2 = dcEventConstructionMapper.deleteDcEventConstructionByIds(ids);
break;
//服务区异常
case 8:
int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids);
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids);
break;
//其他事件
case 11:
break;
//
default:
break;
switch (eventType) {
//交通事故
case 1:
int i1 = dcEventAccidentMapper.deleteDcEventAccidentById(id);
break;
//车辆事故
case 2:
int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentById(id);
break;
//交通管制
case 3:
int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlById(id);
break;
//交通拥堵
case 4:
int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionById(id);
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
int i2 = dcEventConstructionMapper.deleteDcEventConstructionById(id);
break;
//服务区异常
case 8:
int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaById(id);
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherById(id);
break;
//其他事件
case 11:
break;
//
default:
break;
}
}
return i7;
} else {
return -1;
}
}
/**

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

@ -144,9 +144,9 @@
-->
<!-- <sql id="selectDcEventVo">
<sql id="selectDcEventMainVo">
select id, dept_id, stake_mark, direction, user_id, start_time, end_time, estimated_end_time, event_level, event_type, event_subclass, event_cause, description, event_state, event_source, event_nature, remark, create_time, update_time, event_source_tips, in_tunnel from dc_event
</sql> -->
</sql>
<sql id="selectDcEventVo">
SELECT id,
dc_event.dept_id as dept_id,
@ -500,6 +500,10 @@
where dc_event.id = #{id}
</select>
<select id="selectDcEventMainById" parameterType="string" resultMap="DcEventResult">
<include refid="selectDcEventMainVo"/>
where dc_event.id = #{id}
</select>
<insert id="insertDcEvent" parameterType="DcEvent">

Loading…
Cancel
Save