wangsixiang
5 months ago
18 changed files with 3295 additions and 26 deletions
@ -0,0 +1,117 @@ |
|||
package com.zc.business.controller; |
|||
|
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.zc.business.domain.DcFacility; |
|||
import com.zc.business.domain.DcNoStakeWarningTable; |
|||
import com.zc.business.service.IDcFacilityService; |
|||
import com.zc.business.service.IDcNoStakeWarningTableService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 无桩号预警Controller |
|||
* |
|||
* @author zhaoxianglong |
|||
*/ |
|||
@Api(tags = {"无桩号预警"}) |
|||
@RestController |
|||
@RequestMapping("/business/facility") |
|||
public class DcNoStakeWarningTableController extends BaseController { |
|||
@Resource |
|||
private IDcNoStakeWarningTableService dcNoStakeWarningTableService; |
|||
|
|||
//*********************************路网设施增删改查******************************************
|
|||
|
|||
/** |
|||
* 分页查询无桩号预警列表 |
|||
* |
|||
* @param dcNoStakeWarningTable 请求参数 |
|||
* @return 分页查询结果 |
|||
*/ |
|||
@ApiOperation("分页查询路网设施列表") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:list')") |
|||
@GetMapping("list") |
|||
public TableDataInfo listFacility(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
return getDataTable(dcNoStakeWarningTableService.pageDcNoStakeWarningTable(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
/** |
|||
* 无分页查询无桩号预警列表 |
|||
* |
|||
* @param dcNoStakeWarningTable 请求参数 |
|||
* @return 查询结果 |
|||
*/ |
|||
@ApiOperation("无分页查询路网设施列表") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:query')") |
|||
@GetMapping("query") |
|||
public AjaxResult queryFacility(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
return AjaxResult.success(dcNoStakeWarningTableService.listDcNoStakeWarningTable(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
/** |
|||
* 根据id查询无桩号预警信息 |
|||
* |
|||
* @param id id |
|||
* @return 查询结果 |
|||
*/ |
|||
@ApiOperation("根据id查询路网设施信息") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:query')") |
|||
@GetMapping("{id}") |
|||
public AjaxResult getFacility(@PathVariable String id) { |
|||
return AjaxResult.success(dcNoStakeWarningTableService.getDcNoStakeWarningTable(id)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 新增 |
|||
* |
|||
* @param dcNoStakeWarningTable 新增参数 |
|||
* @return 新增操作结果 |
|||
*/ |
|||
@ApiOperation("新增") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:add')") |
|||
@Log(title = "新增路网设施", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult addFacility(@Valid @RequestBody DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
return toAjax(dcNoStakeWarningTableService.addDcNoStakeWarningTable(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
/** |
|||
* 修改 |
|||
* |
|||
* @param dcNoStakeWarningTable 修改参数 |
|||
* @return 修改操作结果 |
|||
*/ |
|||
@ApiOperation("修改") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:edit')") |
|||
@Log(title = "修改路网设施", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult editFacility(@Valid @RequestBody DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
return toAjax(dcNoStakeWarningTableService.editDcNoStakeWarningTable(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
* |
|||
* @param ids id集 |
|||
* @return 删除操作结果 |
|||
*/ |
|||
@ApiOperation("删除") |
|||
@PreAuthorize("@ss.hasPermi('iot:facility:remove')") |
|||
@Log(title = "删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("{ids}") |
|||
public AjaxResult removeFacility(@PathVariable List<String> ids) { |
|||
return toAjax(dcNoStakeWarningTableService.removeDcNoStakeWarningTable(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.zc.business.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
@ApiModel(value = "DcNoStakeWarningTable", description = "无桩号预警实体") |
|||
public class DcNoStakeWarningTable { |
|||
@ApiModelProperty("ID") |
|||
@Excel(name = "ID") |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
private Long id; |
|||
@ApiModelProperty("预警描述") |
|||
@Excel(name = "预警描述") |
|||
private Long warningDescription; |
|||
@ApiModelProperty("预警类型") |
|||
@Excel(name = "预警类型", readConverterExp = "1=交通流预警,2=气象预警") |
|||
private String warningType; |
|||
@ApiModelProperty("创建时间") |
|||
@Excel(name = "创建时间") |
|||
private Date createTime; |
|||
@ApiModelProperty("预警时间") |
|||
@Excel(name = "预警时间") |
|||
private Date warningTime; |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.zc.business.enums; |
|||
|
|||
/** |
|||
* 情报板车道图标枚举 |
|||
* |
|||
* @author |
|||
*/ |
|||
public enum CauseTypeEnum { |
|||
|
|||
//雨
|
|||
THE_RAIN(3, "3-1", "雨"), |
|||
|
|||
//雪
|
|||
SNOW(3, "3-2", "雪"), |
|||
|
|||
//雾
|
|||
THE_FOG(3, "3-3", "雾"), |
|||
|
|||
//道路积水
|
|||
ROAD_WATER(3, "3-4", "道路积水"), |
|||
|
|||
//道路湿滑
|
|||
SLIPPERY_ROAD(3, "3-5", "道路湿滑"), |
|||
|
|||
//道路结冰
|
|||
ICY_ROADS(3, "3-6", "道路结冰"), |
|||
|
|||
//沙尘暴
|
|||
SANDSTORM(3, "3-7", "沙尘暴"), |
|||
|
|||
// 专项工程施工
|
|||
SPECIAL_PROJECT_CONSTRUCTION(4, "4-1", "专项工程施工"), |
|||
|
|||
// 改扩建工程施工
|
|||
RECONSTRUCTION_AND_EXPANSION_PROJECT_CONSTRUCTION(4, "4-2", "改扩建工程施工"), |
|||
|
|||
// 其他施工
|
|||
OTHER_CONSTRUCTION(4, "4-3", "其他施工"); |
|||
|
|||
private final int type; |
|||
|
|||
private final String subtype; |
|||
|
|||
private final String subtypeName; |
|||
|
|||
|
|||
CauseTypeEnum(int type, String subtype, String subtypeName) { |
|||
this.type = type; |
|||
this.subtype = subtype; |
|||
this.subtypeName = subtypeName; |
|||
} |
|||
|
|||
public int getType() { |
|||
return type; |
|||
} |
|||
|
|||
public String getSubtype() { |
|||
return subtype; |
|||
} |
|||
|
|||
public String getSubtypeName() { |
|||
return subtypeName; |
|||
} |
|||
} |
@ -0,0 +1,191 @@ |
|||
package com.zc.business.enums; |
|||
|
|||
/** |
|||
* 情报板车道图标枚举 |
|||
* |
|||
* @author |
|||
*/ |
|||
public enum EventTypesEnum { |
|||
|
|||
// 追尾
|
|||
REAR_END(1, "1-1", "追尾"), |
|||
|
|||
// 侧翻
|
|||
TURN_ON_ONE_S_SIDE(1, "1-2", "侧翻"), |
|||
|
|||
// 撞护栏
|
|||
CRASH_INTO_THE_BARRIER(1, "1-3", "撞护栏"), |
|||
|
|||
// 自燃
|
|||
SPONTANEOUS_COMBUSTION(1, "1-4", "自燃"), |
|||
|
|||
// 其他事故
|
|||
OTHER_ACCIDENTS(1, "1-5", "其他事故"), |
|||
|
|||
// 车辆故障
|
|||
VEHICLE_FAULT(2, "2-1", "车辆故障"), |
|||
|
|||
//主线封闭和限行
|
|||
THE_MAIN_LINE_IS_CLOSED_AND_RESTRICTED(3, "3-1", "主线封闭和限行"), |
|||
|
|||
//收费站封闭和限行
|
|||
TOLL_BOOTHS_ARE_CLOSED_AND_RESTRICTED(3, "3-2", "收费站封闭和限行"), |
|||
|
|||
//立交封闭和限行
|
|||
THE_INTERCHANGE_IS_CLOSED_AND_RESTRICTED(3, "3-3", "立交封闭和限行"), |
|||
|
|||
//服务区封闭和限行
|
|||
THE_SERVICE_AREA_IS_CLOSED_AND_RESTRICTED(3, "3-4", "服务区封闭和限行"), |
|||
|
|||
// 道路拥堵
|
|||
ROAD_CONGESTION(4, "4-1", "道路拥堵"), |
|||
|
|||
// 立交拥堵
|
|||
INTERCHANGE_CONGESTION(4, "4-2", "立交拥堵"), |
|||
|
|||
// 收费站拥堵
|
|||
TOLL_BOOTHS_ARE_CONGESTED(4, "4-3", "收费站拥堵"), |
|||
|
|||
// 服务区拥堵
|
|||
SERVICE_AREA_CONGESTION(4, "4-4", "服务区拥堵"), |
|||
|
|||
// 行人
|
|||
PEDESTRIAN(5, "5-1", "行人"), |
|||
|
|||
// 非机动车
|
|||
NON_MOTOR_VEHICLE(5, "5-2", "非机动车"), |
|||
|
|||
// 摩托车
|
|||
MOTORCYCLE(5, "5-3", "摩托车"), |
|||
|
|||
// 其他
|
|||
OTHER_FIVE_FOUR(5, "5-4", "其他"), |
|||
|
|||
// 烟雾
|
|||
SMOKE(6, "6-1", "烟雾"), |
|||
|
|||
// 倒伏树木
|
|||
FALLEN_TREE(6, "6-2", "倒伏树木"), |
|||
|
|||
// 撒落物
|
|||
OUTFALL(6, "6-3", "撒落物"), |
|||
|
|||
// 动物
|
|||
ZOON(6, "6-4", "动物"), |
|||
|
|||
// 其他
|
|||
OTHER_SIX_FIVE(6, "6-5", "其他"), |
|||
|
|||
// 道路养护施工
|
|||
ROAD_MAINTENANCE_CONSTRUCTION(7, "7-1", "道路养护施工"), |
|||
|
|||
// 收费站养护施工
|
|||
TOLL_STATION_MAINTENANCE_AND_CONSTRUCTION(7, "7-2", "收费站养护施工"), |
|||
|
|||
// 服务区养护施工
|
|||
MAINTENANCE_CONSTRUCTION_OF_SERVICE_AREA(7, "7-3", "服务区养护施工"), |
|||
|
|||
// 枢纽立交匝道养护施工
|
|||
MAINTENANCE_AND_CONSTRUCTION_OF_INTERCHANGE_RAMP(7, "7-4", "枢纽立交匝道养护施工"), |
|||
|
|||
// 地方道路养护施工
|
|||
LOCAL_ROAD_MAINTENANCE_CONSTRUCTION(7, "7-5", "地方道路养护施工"), |
|||
|
|||
// 道路工程建设施工
|
|||
ROAD_ENGINEERING_CONSTRUCTION(7, "7-6", "道路工程建设施工"), |
|||
|
|||
// 收费站工程建设施工
|
|||
TOLL_STATION_CONSTRUCTION(7, "7-7", "收费站工程建设施工"), |
|||
|
|||
// 服务区工程建设施工
|
|||
SERVICE_AREA_PROJECT_CONSTRUCTION(7, "7-8", "服务区工程建设施工"), |
|||
|
|||
// 枢纽立交匝道工程建设施工
|
|||
JUNCTION_INTERCHANGE_RAMP_PROJECT_CONSTRUCTION(7, "7-9", "枢纽立交匝道工程建设施工"), |
|||
|
|||
// 地方道路工程建设施工
|
|||
LOCAL_ROAD_ENGINEERING_CONSTRUCTION(7, "7-10", "地方道路工程建设施工"), |
|||
|
|||
// 封闭
|
|||
CLOSE(8, "8-1", "封闭、暂停营业"), |
|||
|
|||
// 重要设施停用
|
|||
SHUTDOWN_OF_CRITICAL_FACILITIES(8, "8-2", "重要设施停用"), |
|||
|
|||
// 服务区其他异常
|
|||
OTHERS_IN_THE_SERVICE_AREA_ARE_ABNORMAL(8, "8-3", "服务区其他异常"), |
|||
|
|||
// 摄像机
|
|||
CAMERA(9, "9-1", "摄像机"), |
|||
|
|||
// 护栏
|
|||
GUARDRAIL(9, "9-2", "护栏"), |
|||
|
|||
// 隔离栅
|
|||
ISOLATING_GRID(9, "9-3", "隔离栅"), |
|||
|
|||
// 情报板
|
|||
INTEL_BOARD(9, "9-4", "情报板"), |
|||
|
|||
// 防炫板
|
|||
ANTI_GLARE_PLATE(9, "9-5", "防炫板"), |
|||
|
|||
// 其他
|
|||
OTHER_NINE_SIX(9, "9-6", "其他"), |
|||
|
|||
// 雨
|
|||
THE_RAIN(1, "10-1", "雨"), |
|||
|
|||
// 雪
|
|||
SNOW(1, "10-2", "雪"), |
|||
|
|||
// 雾
|
|||
THE_FOG(1, "10-3", "雾"), |
|||
|
|||
// 大风
|
|||
GALE(1, "10-4", "大风"), |
|||
|
|||
// 低温寒潮
|
|||
LOW_TEMPERATURE_COLD_WAVE(1, "10-5", "低温寒潮"), |
|||
|
|||
// 路面积雪
|
|||
SNOW_ON_PAVEMENT(1, "10-6", "路面积雪"), |
|||
|
|||
// 路面结冰
|
|||
ICY_ROAD(1, "10-7", "路面结冰"), |
|||
|
|||
// 路面积水
|
|||
ROAD_WATER(1, "10-8", "路面积水"), |
|||
|
|||
// 其他
|
|||
OTHER_TEN_TO_NINE(10, "10-9", "其他"), |
|||
|
|||
// 其他事件
|
|||
OTHER_EVENTS(11, "11-1", "其他事件"); |
|||
|
|||
|
|||
private final int type; |
|||
|
|||
private final String subtype; |
|||
|
|||
private final String subtypeName; |
|||
|
|||
|
|||
EventTypesEnum(int type, String subtype, String subtypeName) { |
|||
this.type = type; |
|||
this.subtype = subtype; |
|||
this.subtypeName = subtypeName; |
|||
} |
|||
|
|||
public int getType() { |
|||
return type; |
|||
} |
|||
|
|||
public String getSubtype() { |
|||
return subtype; |
|||
} |
|||
|
|||
public String getSubtypeName() { |
|||
return subtypeName; |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,77 @@ |
|||
package com.zc.business.enums; |
|||
|
|||
/** |
|||
* 情报板车道图标枚举 |
|||
* @author |
|||
*/ |
|||
public enum WeatherEventEnum { |
|||
|
|||
//雨雾
|
|||
RAIN_AND_FOG("1-1","雨雾"), |
|||
|
|||
//雨雪
|
|||
RAIN_AND_SNOW("1-2","雨雪"), |
|||
|
|||
//中雨
|
|||
MODERATE_RAIN("1-3","中雨"), |
|||
|
|||
//小雨
|
|||
SPIT("1-4","小雨"), |
|||
|
|||
//大雨
|
|||
HEAVY_RAIN("1-5","大雨"), |
|||
|
|||
//暴雨
|
|||
RAINSTORM("1-6","暴雨"), |
|||
|
|||
//小雪
|
|||
LIGHT_SNOW("2-1","小雪"), |
|||
|
|||
//中雪
|
|||
MODERATE_SNOW("2-2","中雪"), |
|||
|
|||
//大雪
|
|||
HEAVY_SNOW("2-3","大雪"), |
|||
|
|||
//暴雪
|
|||
BLIZZARD_TWO_FOUR("2-4","暴雪"), |
|||
|
|||
//大暴雪
|
|||
BLIZZARD_TWO_FIVE("2-5","大暴雪"), |
|||
|
|||
//特大暴雪
|
|||
HEAVY_SNOWSTORM("2-6","特大暴雪"), |
|||
|
|||
//轻雾
|
|||
MIST("3-1","轻雾"), |
|||
|
|||
//大雾
|
|||
HEAVY_FOG_THREE_TWO("3-2","大雾"), |
|||
|
|||
//浓雾
|
|||
FOG("3-3","浓雾"), |
|||
|
|||
//强浓雾
|
|||
HEAVY_FOG_THREE_FOUR("3-4","强浓雾"), |
|||
|
|||
//团雾
|
|||
AGGLOMERATE_FOG("3-5","团雾"); |
|||
|
|||
private final String code; |
|||
|
|||
private final String value; |
|||
|
|||
|
|||
WeatherEventEnum(String value, String broadcastLogUrl) { |
|||
this.code = value; |
|||
this.value = broadcastLogUrl; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return this.code; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.zc.business.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.zc.business.domain.DcNoStakeWarningTable; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 无桩号预警Mapper接口 |
|||
* |
|||
* @author zhaoxianglong |
|||
*/ |
|||
@Mapper |
|||
public interface DcNoStakeWarningTableMapper extends BaseMapper<DcNoStakeWarningTable> { |
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.zc.business.service; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.zc.business.domain.DcNoStakeWarningTable; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 无桩号预警Service接口 |
|||
* |
|||
* @author zhaoxianglong |
|||
*/ |
|||
public interface IDcNoStakeWarningTableService extends IService<DcNoStakeWarningTable> { |
|||
/** |
|||
* 添加无桩号预警 |
|||
* |
|||
* @param dcNoStakeWarningTable 设备信息 |
|||
* @return 操作结果 |
|||
*/ |
|||
boolean addDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); |
|||
|
|||
/** |
|||
* 修改无桩号预警 |
|||
* |
|||
* @param dcNoStakeWarningTable 设备信息 |
|||
* @return 操作结果 |
|||
*/ |
|||
boolean editDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); |
|||
|
|||
/** |
|||
* 删除无桩号预警 |
|||
* |
|||
* @param ids 设备ID |
|||
* @return 操作结果 |
|||
*/ |
|||
boolean removeDcNoStakeWarningTable(List<String> ids); |
|||
|
|||
/** |
|||
* 获取无桩号预警列表 |
|||
* |
|||
* @param dcNoStakeWarningTable 参数 |
|||
* @return 结果 |
|||
*/ |
|||
List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); |
|||
|
|||
/** |
|||
* 获取无桩号预警列表 |
|||
* |
|||
* @param dcNoStakeWarningTable 参数 |
|||
* @return 结果 |
|||
*/ |
|||
List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); |
|||
|
|||
|
|||
/** |
|||
* 根据id查询设备信息 |
|||
* |
|||
* @param id 设备ID |
|||
* @return 设备信息 |
|||
*/ |
|||
DcNoStakeWarningTable getDcNoStakeWarningTable(String id); |
|||
} |
@ -0,0 +1,123 @@ |
|||
package com.zc.business.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.ruoyi.common.constant.HttpStatus; |
|||
import com.ruoyi.common.exception.ServiceException; |
|||
import com.ruoyi.common.utils.PageUtils; |
|||
import com.zc.business.domain.DcFacility; |
|||
import com.zc.business.domain.DcNoStakeWarningTable; |
|||
import com.zc.business.mapper.DcFacilityMapper; |
|||
import com.zc.business.mapper.DcNoStakeWarningTableMapper; |
|||
import com.zc.business.service.IDcFacilityService; |
|||
import com.zc.business.service.IDcNoStakeWarningTableService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* 无桩号预警Service业务层处理 |
|||
* |
|||
* @author zhaoxianglong |
|||
*/ |
|||
@Service |
|||
public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarningTableMapper, DcNoStakeWarningTable> implements IDcNoStakeWarningTableService { |
|||
|
|||
public LambdaQueryWrapper<DcNoStakeWarningTable> noStakeWarningTableQueryWrapper(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
|
|||
LambdaQueryWrapper<DcNoStakeWarningTable> queryWrapper = new LambdaQueryWrapper<>(); |
|||
|
|||
// 设备ID
|
|||
if (Objects.nonNull(dcNoStakeWarningTable.getId())) { |
|||
queryWrapper.eq(DcNoStakeWarningTable::getId, dcNoStakeWarningTable.getId()); |
|||
} |
|||
|
|||
// 设备ID
|
|||
if (Objects.nonNull(dcNoStakeWarningTable.getWarningDescription())) { |
|||
queryWrapper.eq(DcNoStakeWarningTable::getWarningDescription, dcNoStakeWarningTable.getWarningDescription()); |
|||
} |
|||
|
|||
// 设备ID
|
|||
if (Objects.nonNull(dcNoStakeWarningTable.getWarningTime())) { |
|||
queryWrapper.eq(DcNoStakeWarningTable::getWarningTime, dcNoStakeWarningTable.getWarningTime()); |
|||
} |
|||
|
|||
// 设备ID
|
|||
if (Objects.nonNull(dcNoStakeWarningTable.getWarningType())) { |
|||
queryWrapper.eq(DcNoStakeWarningTable::getWarningType, dcNoStakeWarningTable.getWarningType()); |
|||
} |
|||
|
|||
// 设备ID
|
|||
if (Objects.nonNull(dcNoStakeWarningTable.getCreateTime())) { |
|||
queryWrapper.eq(DcNoStakeWarningTable::getCreateTime, dcNoStakeWarningTable.getCreateTime()); |
|||
} |
|||
|
|||
// 木桩
|
|||
return queryWrapper; |
|||
} |
|||
|
|||
@Override |
|||
public boolean addDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
|
|||
Long id = dcNoStakeWarningTable.getId(); |
|||
if (Objects.nonNull(id)) { |
|||
DcNoStakeWarningTable noStakeWarningTable = getById(id); |
|||
if (noStakeWarningTable != null) { |
|||
throw new ServiceException("预警ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); |
|||
} |
|||
} |
|||
|
|||
dcNoStakeWarningTable.setCreateTime(new Date()); |
|||
return save(dcNoStakeWarningTable); |
|||
} |
|||
|
|||
@Override |
|||
public boolean editDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
|
|||
Long id = dcNoStakeWarningTable.getId(); |
|||
|
|||
// 检查设备id是否重复
|
|||
DcNoStakeWarningTable noStakeWarningTable = getById(id); |
|||
|
|||
if (Objects.isNull(noStakeWarningTable)) { |
|||
throw new ServiceException("预警ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); |
|||
} |
|||
|
|||
return updateById(dcNoStakeWarningTable); |
|||
} |
|||
|
|||
@Override |
|||
public boolean removeDcNoStakeWarningTable(List<String> ids) { |
|||
return removeByIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
// 分页
|
|||
PageUtils.startPage(); |
|||
return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
@Override |
|||
public List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { |
|||
return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable)); |
|||
} |
|||
|
|||
@Override |
|||
public DcNoStakeWarningTable getDcNoStakeWarningTable(String id) { |
|||
// 检查设备id是否重复
|
|||
DcNoStakeWarningTable dcNoStakeWarningTable = getById(id); |
|||
|
|||
if (Objects.isNull(dcNoStakeWarningTable)) { |
|||
throw new ServiceException("预警ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); |
|||
} |
|||
|
|||
return getById(id); |
|||
} |
|||
|
|||
} |
|||
|
Loading…
Reference in new issue