|
@@ -76,11 +76,9 @@ import java.util.stream.Collectors;
|
|
|
public class MsgAlarmController extends BaseController {
|
|
|
private static final Logger log = LoggerFactory.getLogger(MsgAlarmController.class);
|
|
|
@Resource
|
|
|
- MsgAlarmService msgAlarmService;
|
|
|
+ MsgAlarmCloudService msgAlarmCloudService;
|
|
|
@Resource
|
|
|
- MsgAlarmMapper msgAlarmMapper;
|
|
|
- @Resource
|
|
|
- MsgAlarmFrequencyService msgAlarmFrequencyService;
|
|
|
+ MsgAlarmFrequencyCloudService msgAlarmFrequencyCloudService;
|
|
|
@Autowired
|
|
|
BaseCameraManagementService baseCameraManagementService;
|
|
|
@Autowired
|
|
@@ -106,7 +104,6 @@ public class MsgAlarmController extends BaseController {
|
|
|
@PostMapping("/messageMoreNum")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.SELECT)
|
|
|
public AjaxResult messageMoreNum(@RequestBody MsgAlarmVo msgAlarmVo) {
|
|
|
- // MsgAlarmVo msgAlarmVo1 = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
|
|
|
Map<String, Integer> messageMore = msgWebPushService.messageMoreNum(getUserId());
|
|
|
return AjaxResult.success(messageMore);
|
|
|
}
|
|
@@ -117,12 +114,11 @@ public class MsgAlarmController extends BaseController {
|
|
|
@PostMapping("/messageMore")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.SELECT)
|
|
|
public AjaxResult messageMore(@RequestBody MsgAlarmVo msgAlarmVo) {
|
|
|
- // MsgAlarmVo msgAlarmVo1 = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
|
|
|
String userId = getUserId();
|
|
|
if (!StringUtils.isEmpty(userId)) {
|
|
|
msgAlarmVo.setUserId(userId);
|
|
|
}
|
|
|
- IPage<MsgAlarm> messageMore = msgWebPushService.messageMore(msgAlarmVo);
|
|
|
+ IPage<MsgAlarmCloud> messageMore = msgWebPushService.messageMore(msgAlarmVo);
|
|
|
return AjaxResult.success(messageMore);
|
|
|
}
|
|
|
|
|
@@ -132,7 +128,6 @@ public class MsgAlarmController extends BaseController {
|
|
|
@GetMapping("/webAlarm")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.SELECT)
|
|
|
public AjaxResult webAlarmNum() {
|
|
|
- // MsgAlarmVo msgAlarm = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), new MsgAlarmVo());
|
|
|
Map webAlarm = msgWebPushService.webAlarm(getUserId());
|
|
|
return AjaxResult.success(webAlarm);
|
|
|
}
|
|
@@ -178,12 +173,12 @@ public class MsgAlarmController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
msgAlarmVo.setEndMile(msgAlarmVo.getEndMile() * 1000);
|
|
|
}
|
|
|
- IPage<MsgAlarm> page = msgAlarmService.queryPageHome(msgAlarmVo);
|
|
|
+ IPage<MsgAlarmCloud> page = msgAlarmCloudService.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 -> {
|
|
|
+ List<MsgAlarmCloud> dto1 = page.getRecords().stream().map(o -> {
|
|
|
String[] split = o.getImageUrl().split(";");
|
|
|
ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
|
|
|
o.setImageUrls(objects);
|
|
@@ -212,11 +207,11 @@ public class MsgAlarmController extends BaseController {
|
|
|
String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
|
|
|
o.setBeginMile(begin);
|
|
|
}
|
|
|
- LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
|
|
|
+ LambdaQueryWrapper<MsgAlarmFrequencyCloud> wrapper = new LambdaQueryWrapper<MsgAlarmFrequencyCloud>();
|
|
|
if (!ObjectUtils.isEmpty(o.getAlarmId())) {
|
|
|
- wrapper.eq(MsgAlarmFrequency::getAlarmId, o.getAlarmId());
|
|
|
+ wrapper.eq(MsgAlarmFrequencyCloud::getAlarmId, o.getAlarmId());
|
|
|
}
|
|
|
- o.setAlarmCount((int) msgAlarmFrequencyService.count(wrapper));
|
|
|
+ o.setAlarmCount((int) msgAlarmFrequencyCloudService.count(wrapper));
|
|
|
if (!ObjectUtils.isEmpty(o.getReleasedType())) {
|
|
|
o.setReleasedTypeName(o.getReleasedType() == 1 ? "实报" : "误报");
|
|
|
}
|
|
@@ -251,13 +246,13 @@ public class MsgAlarmController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
msgAlarmVo.setEndMile(msgAlarmVo.getEndMile() * 1000);
|
|
|
}
|
|
|
- IPage<MsgAlarm> page = msgAlarmService.queryPage(msgAlarmVo);
|
|
|
+ IPage<MsgAlarmCloud> page = msgAlarmCloudService.queryPage(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 -> {
|
|
|
+ List<MsgAlarmCloud> dto1 = page.getRecords().stream().map(o -> {
|
|
|
String[] split = o.getImageUrl().split(";");
|
|
|
ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
|
|
|
o.setImageUrls(objects);
|
|
@@ -288,11 +283,11 @@ public class MsgAlarmController extends BaseController {
|
|
|
String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
|
|
|
o.setBeginMile(begin);
|
|
|
}
|
|
|
- LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
|
|
|
+ LambdaQueryWrapper<MsgAlarmFrequencyCloud> wrapper = new LambdaQueryWrapper<MsgAlarmFrequencyCloud>();
|
|
|
if (!ObjectUtils.isEmpty(o.getAlarmId())) {
|
|
|
- wrapper.eq(MsgAlarmFrequency::getAlarmId, o.getAlarmId());
|
|
|
+ wrapper.eq(MsgAlarmFrequencyCloud::getAlarmId, o.getAlarmId());
|
|
|
}
|
|
|
- o.setAlarmCount((int) msgAlarmFrequencyService.count(wrapper));
|
|
|
+ o.setAlarmCount((int) msgAlarmFrequencyCloudService.count(wrapper));
|
|
|
if (!ObjectUtils.isEmpty(o.getReleasedType())) {
|
|
|
o.setReleasedTypeName(o.getReleasedType() == 1 ? "实报" : "误报");
|
|
|
}
|
|
@@ -326,8 +321,8 @@ public class MsgAlarmController extends BaseController {
|
|
|
if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
|
|
|
msgAlarmVo.setEndMile(msgAlarmVo.getEndMile() * 1000);
|
|
|
}
|
|
|
- List<MsgAlarm> msgAlarmList = msgAlarmService.msgAlarmList(msgAlarmVo);
|
|
|
- for (MsgAlarm msgAlarm : msgAlarmList) {
|
|
|
+ List<MsgAlarmCloud> msgAlarmList = msgAlarmCloudService.msgAlarmList(msgAlarmVo);
|
|
|
+ for (MsgAlarmCloud msgAlarm : msgAlarmList) {
|
|
|
String[] split = msgAlarm.getImageUrl().split(";");
|
|
|
ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
|
|
|
msgAlarm.setImageUrls(objects);
|
|
@@ -358,11 +353,11 @@ public class MsgAlarmController extends BaseController {
|
|
|
String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
|
|
|
msgAlarm.setBeginMile(begin);
|
|
|
}
|
|
|
- LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
|
|
|
+ LambdaQueryWrapper<MsgAlarmFrequencyCloud> wrapper = new LambdaQueryWrapper<MsgAlarmFrequencyCloud>();
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm.getAlarmId())) {
|
|
|
- wrapper.eq(MsgAlarmFrequency::getAlarmId, msgAlarm.getAlarmId());
|
|
|
+ wrapper.eq(MsgAlarmFrequencyCloud::getAlarmId, msgAlarm.getAlarmId());
|
|
|
}
|
|
|
- msgAlarm.setAlarmCount((int) msgAlarmFrequencyService.count(wrapper));
|
|
|
+ msgAlarm.setAlarmCount((int) msgAlarmFrequencyCloudService.count(wrapper));
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm.getReleasedType())) {
|
|
|
msgAlarm.setReleasedTypeName(msgAlarm.getReleasedType() == 1 ? "实报" : "误报");
|
|
|
}
|
|
@@ -387,14 +382,14 @@ public class MsgAlarmController extends BaseController {
|
|
|
"大小" + split1[4] + "×" + split1[5];
|
|
|
msgAlarm.setAlarmAttr(stringBuilder);
|
|
|
}
|
|
|
- ExcelUtil<MsgAlarm> util = new ExcelUtil<>(MsgAlarm.class);
|
|
|
+ ExcelUtil<MsgAlarmCloud> util = new ExcelUtil<>(MsgAlarmCloud.class);
|
|
|
util.exportExcel(response, msgAlarmList, "报警信息管理");
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/getByAlarmId/{alarmId}")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.MESSAGE)
|
|
|
public AjaxResult getByAlarmId(@PathVariable String alarmId) {
|
|
|
- MsgAlarm msgAlarm = msgAlarmService.getByAlarmId(alarmId);
|
|
|
+ MsgAlarmCloud msgAlarm = msgAlarmCloudService.getByAlarmId(alarmId);
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm)) {
|
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm.getCameraCode())) {
|
|
@@ -438,7 +433,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
@GetMapping(value = "/{id}")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.MESSAGE)
|
|
|
public AjaxResult getInfo(@PathVariable Long id) {
|
|
|
- MsgAlarm msgAlarm = msgAlarmService.getById(id);
|
|
|
+ MsgAlarmCloud msgAlarm = msgAlarmCloudService.getById(id);
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm)) {
|
|
|
LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
|
|
|
if (!ObjectUtils.isEmpty(msgAlarm.getCameraCode())) {
|
|
@@ -495,7 +490,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
public AjaxResult updateIsLock(@RequestParam(value = "id") Long id,
|
|
|
@RequestParam(value = "releasedType", required = false) Integer releasedType,
|
|
|
@RequestParam(value = "releasedReason", required = false) String releasedReason) {
|
|
|
- MsgAlarm msgAlarm = msgAlarmService.getById(id);
|
|
|
+ MsgAlarmCloud msgAlarm = msgAlarmCloudService.getById(id);
|
|
|
if (msgAlarm.getIsLock() == 1) {
|
|
|
return AjaxResult.error("501", "报警已解除");
|
|
|
}
|
|
@@ -525,7 +520,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
// log.info("updateIsLock-------url" + url);
|
|
|
// msgAlarm.setReleasedUrl(url);
|
|
|
log.info("updateIsLock----------msgAlarm" + msgAlarm);
|
|
|
- boolean b = msgAlarmService.updateById(msgAlarm);
|
|
|
+ boolean b = msgAlarmCloudService.updateById(msgAlarm);
|
|
|
// LambdaQueryWrapper<MsgAppPush> wrapper = new LambdaQueryWrapper<>();
|
|
|
// wrapper.eq(MsgAppPush::getAlarmId, msgAlarm.getAlarmId());
|
|
|
// MsgAppPush app = new MsgAppPush();
|
|
@@ -547,16 +542,16 @@ public class MsgAlarmController extends BaseController {
|
|
|
@GetMapping(value = "/alarmHistoricalAlarm/{alarmId}")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.SELECT)
|
|
|
public AjaxResult alarmHistoricalAlarm(@PathVariable String alarmId) {
|
|
|
- QueryWrapper<MsgAlarm> queryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<MsgAlarmCloud> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("alarm_id", alarmId);
|
|
|
- MsgAlarm one = msgAlarmService.getOne(queryWrapper);
|
|
|
+ MsgAlarmCloud one = msgAlarmCloudService.getOne(queryWrapper);
|
|
|
if (ObjectUtils.isEmpty(one)) {
|
|
|
return error("报警表没有此报警唯一标识的报警数据");
|
|
|
}
|
|
|
- QueryWrapper<MsgAlarmFrequency> wrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<MsgAlarmFrequencyCloud> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("alarm_id", alarmId);
|
|
|
wrapper.orderByDesc("alarm_time");
|
|
|
- List<MsgAlarmFrequency> list = msgAlarmFrequencyService.list(wrapper);
|
|
|
+ List<MsgAlarmFrequencyCloud> list = msgAlarmFrequencyCloudService.list(wrapper);
|
|
|
if (list.size() > 0) {
|
|
|
if (one.getIsLock() == 1) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -567,7 +562,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- for (MsgAlarmFrequency msgAlarmFrequency : list) {
|
|
|
+ for (MsgAlarmFrequencyCloud msgAlarmFrequency : list) {
|
|
|
msgAlarmFrequency.setIsLock(2);
|
|
|
}
|
|
|
}
|
|
@@ -580,12 +575,12 @@ public class MsgAlarmController extends BaseController {
|
|
|
@GetMapping(value = "/videoHistoricalAlarm/{cameraCode}")
|
|
|
@Log(title = "报警信息管理", businessType = BusinessType.SELECT)
|
|
|
public AjaxResult videoHistoricalAlarm(@PathVariable String cameraCode) {
|
|
|
- QueryWrapper<MsgAlarm> wrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<MsgAlarmCloud> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("camera_code", cameraCode);
|
|
|
wrapper.orderByDesc("alarm_time");
|
|
|
- List<MsgAlarm> list = msgAlarmService.list(wrapper);
|
|
|
+ List<MsgAlarmCloud> list = msgAlarmCloudService.list(wrapper);
|
|
|
// if (list.size() > 0) {
|
|
|
-// for (MsgAlarm msgAlarm : list) {
|
|
|
+// for (MsgAlarmCloud msgAlarm : list) {
|
|
|
// msgAlarm.setFailureToAlarm(1);
|
|
|
// }
|
|
|
// return AjaxResult.success(list);
|
|
@@ -603,7 +598,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
@PostMapping("/dataStatistic")
|
|
|
public AjaxResult dataStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
|
|
|
alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
|
|
|
- IPage<AlarmStatisticVo> page = msgAlarmService.list(alarmStatisticResVo);
|
|
|
+ IPage<AlarmStatisticVo> page = msgAlarmCloudService.list(alarmStatisticResVo);
|
|
|
page.setTotal(page.getTotal());
|
|
|
page.setCurrent(page.getCurrent());
|
|
|
page.setPages(page.getPages());
|
|
@@ -662,7 +657,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
Integer listSize;
|
|
|
List<AlarmStatisticMonthDto> list = null;
|
|
|
if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
|
|
|
- list = msgAlarmService.getCount(alarmStatisticResVo);
|
|
|
+ list = msgAlarmCloudService.getCount(alarmStatisticResVo);
|
|
|
listSize = 12;
|
|
|
} else {
|
|
|
if (alarmStatisticResVo.getCurrentMonth().equals(2)) {//2
|
|
@@ -673,7 +668,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
} else {//1,3,5,7,8,10,12
|
|
|
listSize = 31;
|
|
|
}
|
|
|
- list = msgAlarmService.getDayCount(alarmStatisticResVo);
|
|
|
+ list = msgAlarmCloudService.getDayCount(alarmStatisticResVo);
|
|
|
}
|
|
|
for (int i = 1; i <= listSize; i++) {
|
|
|
numbs.add(i);
|
|
@@ -718,7 +713,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
public void exportDataStatistic(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
|
|
|
alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
|
|
|
try {
|
|
|
- List<AlarmStatisticDto> list = msgAlarmService.exportExcel(alarmStatisticResVo);
|
|
|
+ List<AlarmStatisticDto> list = msgAlarmCloudService.exportExcel(alarmStatisticResVo);
|
|
|
if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
|
|
|
list.forEach(l -> {
|
|
|
if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
|
|
@@ -777,7 +772,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
Integer listSize;
|
|
|
List<AlarmStatisticMonthDto> list = null;
|
|
|
if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
|
|
|
- list = msgAlarmService.getCount(alarmStatisticResVo);
|
|
|
+ list = msgAlarmCloudService.getCount(alarmStatisticResVo);
|
|
|
listSize = 12;
|
|
|
} else {
|
|
|
sheetName = "报警月统计数据";
|
|
@@ -789,7 +784,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
} else {//1,3,5,7,8,10,12
|
|
|
listSize = 31;
|
|
|
}
|
|
|
- list = msgAlarmService.getDayCount(alarmStatisticResVo);
|
|
|
+ list = msgAlarmCloudService.getDayCount(alarmStatisticResVo);
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
|
|
|
for (int i = 1; i <= listSize; i++) {
|
|
@@ -839,7 +834,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
public AjaxResult alarmStatistics() {
|
|
|
MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
|
|
|
MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo1);
|
|
|
- return msgAlarmService.alarmStatistics(msgAlarmVo);
|
|
|
+ return msgAlarmCloudService.alarmStatistics(msgAlarmVo);
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/alarmCountSort")
|
|
@@ -847,7 +842,7 @@ public class MsgAlarmController extends BaseController {
|
|
|
public AjaxResult alarmCountSort() {
|
|
|
MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
|
|
|
MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo1);
|
|
|
- return msgAlarmService.alarmCountSort(msgAlarmVo);
|
|
|
+ return msgAlarmCloudService.alarmCountSort(msgAlarmVo);
|
|
|
}
|
|
|
|
|
|
}
|