|
@@ -164,6 +164,81 @@ public class MsgAlarmController extends BaseController {
|
|
|
return toAjax(msgWebPushService.read(msgWebPush));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 首页报警信息列表
|
|
|
+ * 首页左侧报警默认为全部,先按照未解除、已解除排序,然后再按照时间倒序排序
|
|
|
+ *
|
|
|
+ * @param msgAlarmVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "首页报警信息列表")
|
|
|
+ @PostMapping("/listHome")
|
|
|
+ @Log(title = "首页", businessType = BusinessType.SELECT)
|
|
|
+ public AjaxResult selectMsgAlarmHome(@RequestBody MsgAlarmVo msgAlarmVo) {
|
|
|
+ msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarmVo.getAlarmMile())) {
|
|
|
+ msgAlarmVo.setAlarmMile(msgAlarmVo.getAlarmMile() * 1000);
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarmVo.getBeginMile())) {
|
|
|
+ msgAlarmVo.setBeginMile(msgAlarmVo.getBeginMile() * 1000);
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
+ msgAlarmVo.setEndMile(msgAlarmVo.getEndMile() * 1000);
|
|
|
+ }
|
|
|
+ IPage<MsgAlarm> page = msgAlarmService.queryPageHome(msgAlarmVo);
|
|
|
+ page.setTotal(page.getTotal());
|
|
|
+ page.setCurrent(page.getCurrent());
|
|
|
+ page.setPages(page.getPages());
|
|
|
+ if (!ObjectUtils.isEmpty(page) && page.getRecords().size() > 0) {
|
|
|
+ List<MsgAlarm> dto1 = page.getRecords().stream().map(o -> {
|
|
|
+ String[] split = o.getImageUrl().split(";");
|
|
|
+ ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
|
|
|
+ o.setImageUrls(objects);
|
|
|
+ LambdaQueryWrapper<BaseCameraManagement> cameraManagementLambdaQueryWrapper = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
+ if (!ObjectUtils.isEmpty(o.getCameraCode())) {
|
|
|
+ cameraManagementLambdaQueryWrapper.eq(BaseCameraManagement::getCameraCode, o.getCameraCode());
|
|
|
+ }
|
|
|
+ BaseCameraManagement cameraManagement = baseCameraManagementService.getOne(cameraManagementLambdaQueryWrapper);
|
|
|
+ LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
|
|
|
+ if (!ObjectUtils.isEmpty(cameraManagement.getRailwayCode())) {
|
|
|
+ queryWrapper.eq(BaseRailwayManagement::getRailwayCode, cameraManagement.getRailwayCode());
|
|
|
+ }
|
|
|
+ BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
|
|
|
+ o.setRailwayName(baseRailwayManagement.getRailwayName());
|
|
|
+ if (StringUtils.isNotEmpty(o.getReleasedBy())) {
|
|
|
+ BaseUser user = baseUserService.getUser(o.getReleasedBy());
|
|
|
+ o.setReleasedByName(user.getNickName());
|
|
|
+ }
|
|
|
+ String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
|
|
|
+ o.setAlarmMiles(mils);
|
|
|
+ if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
|
|
|
+ String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
|
|
|
+ o.setEndMile(end);
|
|
|
+ }
|
|
|
+ if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
|
|
|
+ String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
|
|
|
+ o.setBeginMile(begin);
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
|
|
|
+ if (!ObjectUtils.isEmpty(o.getAlarmId())) {
|
|
|
+ wrapper.eq(MsgAlarmFrequency::getAlarmId, o.getAlarmId());
|
|
|
+ }
|
|
|
+ o.setAlarmCount((int) msgAlarmFrequencyService.count(wrapper));
|
|
|
+ if (!ObjectUtils.isEmpty(o.getReleasedType())) {
|
|
|
+ o.setReleasedTypeName(o.getReleasedType() == 1 ? "实报" : "误报");
|
|
|
+ }
|
|
|
+ String[] split1 = o.getAlarmAttr().split(",");
|
|
|
+ String stringBuilder = "画面,大小为" + split1[0] + "×" + split1[1] + "," +
|
|
|
+ "泥石流范围为左上角坐标(" + split1[2] + "," + split1[3] + ")" +
|
|
|
+ "大小" + split1[4] + "×" + split1[5];
|
|
|
+ o.setAlarmAttr(stringBuilder);
|
|
|
+ return o;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ page.setRecords(dto1);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 报警信息分页
|
|
|
*
|