|
@@ -47,6 +47,7 @@ import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.OutputStream;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -79,6 +80,17 @@ public class MsgAlarmController extends BaseController {
|
|
|
@Autowired
|
|
|
private ISysDictDataService dictDataService;
|
|
|
|
|
|
+ /**
|
|
|
+ * web更多消息
|
|
|
+ */
|
|
|
+ @PostMapping("/messageMore")
|
|
|
+ @ApiOperation("更多消息")
|
|
|
+ public AjaxResult messageMore(@RequestBody MsgAlarmVo msgAlarmVo) {
|
|
|
+ String userId = getUserId();
|
|
|
+ IPage messageMore = msgWebPushService.messageMore(userId, msgAlarmVo);
|
|
|
+ return AjaxResult.success(messageMore);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* web报警未读消息个数+未读消息列表
|
|
|
*/
|
|
@@ -94,7 +106,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
* web消息已读
|
|
|
*/
|
|
|
@PostMapping("/read")
|
|
|
- @ApiOperation(value = "预报警信息分页")
|
|
|
+ @ApiOperation(value = "web消息已读")
|
|
|
public AjaxResult read(@RequestBody MsgWebPush msgWebPush) {
|
|
|
if (StringUtils.isEmpty(msgWebPush) || StringUtils.isEmpty(msgWebPush.getId())) {
|
|
|
return AjaxResult.error("主键ID不能为空!");
|
|
@@ -111,7 +123,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
@ApiOperation(value = "报警信息分页")
|
|
|
@PostMapping("/list")
|
|
|
public AjaxResult selectMsgAlarm(@RequestBody MsgAlarmVo msgAlarmVo) {
|
|
|
- List<BaseCameraManagement> baseCameraManagementList=new ArrayList<>();
|
|
|
+ List<BaseCameraManagement> baseCameraManagementList = new ArrayList<>();
|
|
|
LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getRailwayCode())) {
|
|
|
wrapper.eq(BaseCameraManagement::getRailwayCode, msgAlarmVo.getRailwayCode());
|
|
@@ -122,7 +134,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
wrapper.le(BaseCameraManagement::getEndMile, msgAlarmVo.getEndMile());
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(msgAlarmVo.getRailwayCode())||!ObjectUtils.isEmpty(msgAlarmVo.getBeginMile())||!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarmVo.getRailwayCode()) || !ObjectUtils.isEmpty(msgAlarmVo.getBeginMile()) || !ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
baseCameraManagementList = baseCameraManagementService.list(wrapper);
|
|
|
}
|
|
|
List<String> userIds = baseCameraManagementService.getUserIds(getUserId());
|
|
@@ -133,14 +145,14 @@ public class MsgAlarmController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getLineDir())) {
|
|
|
lw.eq(MsgAlarm::getLineDir, msgAlarmVo.getLineDir());
|
|
|
}
|
|
|
- if (baseCameraManagementList.size()>0) {
|
|
|
+ if (baseCameraManagementList.size() > 0) {
|
|
|
List<String> collect = baseCameraManagementList.stream().map(BaseCameraManagement::getCameraCode).collect(Collectors.toList());
|
|
|
lw.in(MsgAlarm::getCameraCode, collect);
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getAlarmType())) {
|
|
|
lw.eq(MsgAlarm::getAlarmType, msgAlarmVo.getAlarmType());
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(msgAlarmVo.getAlarmMile())&& msgAlarmVo.getAlarmMile() != 0) {
|
|
|
+ if (!ObjectUtils.isEmpty(msgAlarmVo.getAlarmMile()) && msgAlarmVo.getAlarmMile() != 0) {
|
|
|
lw.eq(MsgAlarm::getAlarmMile, msgAlarmVo.getAlarmMile());
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getBeginAlarmTime())) {
|
|
@@ -153,8 +165,11 @@ public class MsgAlarmController extends BaseController {
|
|
|
lw.eq(MsgAlarm::getIsLock, msgAlarmVo.getIsLock());
|
|
|
}
|
|
|
IPage<MsgAlarm> page = msgAlarmService.page(new Page<>(msgAlarmVo.getPageNum(), msgAlarmVo.getPageSize()), lw);
|
|
|
- if(!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())){
|
|
|
+ if (!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())) {
|
|
|
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());
|
|
@@ -173,7 +188,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
o.setEndMile(end);
|
|
|
String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
|
|
|
o.setBeginMile(begin);
|
|
|
- o.setAlarmCount((int) msgAlarmFrequencyService.count()+1);
|
|
|
+ o.setAlarmCount((int) msgAlarmFrequencyService.count() + 1);
|
|
|
return o;
|
|
|
}).collect(Collectors.toList());
|
|
|
page.setRecords(dto1);
|
|
@@ -201,15 +216,14 @@ public class MsgAlarmController extends BaseController {
|
|
|
msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
|
|
|
String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
|
|
|
String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
|
|
|
- String endMile=begin+"-"+end;
|
|
|
+ String endMile = begin + "-" + end;
|
|
|
msgAlarmResp.setBeginMile(endMile);
|
|
|
String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
|
|
|
msgAlarmResp.setAlarmMile(mile);
|
|
|
- msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude()+","+baseCameraManagement.getInstallLatitude());
|
|
|
+ msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
|
|
|
return AjaxResult.success(msgAlarmResp);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@PutMapping(value = "/{id}")
|
|
|
@ApiOperation("根据报警信息ID解除报警")
|
|
|
public AjaxResult updateIsLock(@PathVariable Long id) {
|