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("删除事件信息") @ApiOperation("删除事件信息")
// @PreAuthorize("@ss.hasPermi('system:event:remove')") // @PreAuthorize("@ss.hasPermi('system:event:remove')")
@Log(title = "事件信息", businessType = BusinessType.DELETE) @Log(title = "事件信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{eventType}/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable int eventType,@PathVariable String[] ids ) public AjaxResult remove(@PathVariable String[] ids )
{ {
return toAjax(dcEventService.deleteDcEventByIds(eventType,ids)); return toAjax(dcEventService.deleteDcEventByIds(ids));
} }
@ApiOperation("事件数量统计") @ApiOperation("事件数量统计")
// @PreAuthorize("@ss.hasPermi('system:event:list')") // @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 事件信息 * @return 事件信息
*/ */
public DcEvent selectDcEventById(String id); 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 需要删除的事件信息主键集合 * @param ids 需要删除的事件信息主键集合
* @return 结果 * @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 @Override
public int updateDcEvent(DcEvent dcEvent) { public int updateDcEvent(DcEvent dcEvent) {
DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(),dcEvent.getId()); DcEvent oldEvent = selectEventSubclassById(dcEvent.getEventType().intValue(),dcEvent.getId());
dcEvent.setUpdateTime(DateUtils.getNowDate()); dcEvent.setUpdateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.updateDcEvent(dcEvent); int i7 = dcEventMapper.updateDcEvent(dcEvent);
if (i7 > 0) { if (i7 > 0) {
String context = comparisonInfo(oldEvent,dcEvent); String context = comparisonInfo(oldEvent,dcEvent);
//事件处置流程记录 //事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess(); DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(dcEvent.getId()); dcEventProcess.setEventId(dcEvent.getId());
@ -691,7 +688,6 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条
dcEventProcess.setContext(context); dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess); dcEventProcessService.insertDcEventProcess(dcEventProcess);
//中间库 //中间库
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent); middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
@ -760,59 +756,62 @@ if (eventType !=3 &&dcEventId == null){//非 事件处置 和收费站等多条
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteDcEventByIds(int eventType, String[] ids) { public int deleteDcEventByIds(String[] ids) {
int i7 = dcEventMapper.deleteDcEventByIds(ids); int i7=-1;
if (i7 > 0) { for (String id : ids) {
switch (eventType) { DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id);
//交通事故 int eventType = Math.toIntExact(dcEvent.getEventType());
case 1: i7 = dcEventMapper.deleteDcEventById(id);
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);
break; switch (eventType) {
//非法上路 //交通事故
case 5: case 1:
break; int i1 = dcEventAccidentMapper.deleteDcEventAccidentById(id);
//路障清除 break;
case 6: //车辆事故
break; case 2:
//施工建设 int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentById(id);
case 7: break;
int i2 = dcEventConstructionMapper.deleteDcEventConstructionByIds(ids); //交通管制
break; case 3:
//服务区异常 int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlById(id);
case 8: break;
int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids); //交通拥堵
break; case 4:
//设施设备隐患 int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionById(id);
case 9:
break; break;
//异常天气 //非法上路
case 10: case 5:
int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids); break;
break; //路障清除
//其他事件 case 6:
case 11: break;
break; //施工建设
// case 7:
default: int i2 = dcEventConstructionMapper.deleteDcEventConstructionById(id);
break; 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; 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 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"> <sql id="selectDcEventVo">
SELECT id, SELECT id,
dc_event.dept_id as dept_id, dc_event.dept_id as dept_id,
@ -500,6 +500,10 @@
where dc_event.id = #{id} where dc_event.id = #{id}
</select> </select>
<select id="selectDcEventMainById" parameterType="string" resultMap="DcEventResult">
<include refid="selectDcEventMainVo"/>
where dc_event.id = #{id}
</select>
<insert id="insertDcEvent" parameterType="DcEvent"> <insert id="insertDcEvent" parameterType="DcEvent">

Loading…
Cancel
Save