Commit e239b1e5 authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 11eaf58c 0f7d15f8
...@@ -14,7 +14,7 @@ import java.util.Date; ...@@ -14,7 +14,7 @@ import java.util.Date;
* @create: 2020-05-28 13:57 * @create: 2020-05-28 13:57
**/ **/
public class DateUtils { public class DateUtils {
public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm"; public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm";
public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss";
...@@ -23,6 +23,7 @@ public class DateUtils { ...@@ -23,6 +23,7 @@ public class DateUtils {
public static final String YEAR_PATTERN = "yyyy"; public static final String YEAR_PATTERN = "yyyy";
public static final String MINUTE_ONLY_PATTERN = "mm"; public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH"; public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_TIME_T_PATTERN = "yyyy-MM-dd'T'HH:mm:ss";
/** /**
* 获取当前时间 * 获取当前时间
* *
...@@ -183,7 +184,7 @@ public class DateUtils { ...@@ -183,7 +184,7 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static Date dateParse(String dateTimeString, String pattern) throws ParseException { public static Date dateParse(String dateTimeString, String pattern) throws ParseException {
if (StringUtils.isNotEmpty(pattern)) { if (StringUtils.isEmpty(pattern)) {
pattern = DateUtils.DATE_PATTERN; pattern = DateUtils.DATE_PATTERN;
} }
SimpleDateFormat sdf = new SimpleDateFormat(pattern); SimpleDateFormat sdf = new SimpleDateFormat(pattern);
......
...@@ -94,15 +94,17 @@ public class MonitorViewController { ...@@ -94,15 +94,17 @@ public class MonitorViewController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询视图下的视频列表") @ApiOperation(value = "分页查询视图下的视频列表")
@RequestMapping(value = "/video/page", method = RequestMethod.GET) @RequestMapping(value = "/video/page", method = RequestMethod.GET)
public ResponseModel<Page<VideoListVo>> queryUncheckedVideoList(@RequestParam(value = "viewId") Long viewId, public ResponseModel<Page<VideoListVo>> queryVideoPage(@RequestParam(value = "viewId") Long viewId,
@RequestParam(value = "videoName", required = false) String videoName, @RequestParam(value = "nodeId") Long nodeId,
@RequestParam(value = "videoCode", required = false) String videoCode, @RequestParam(value = "nodeType") String nodeType,
@RequestParam(value = "current") int current, @RequestParam(value = "size") int size) throws Exception { @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception {
Page<VideoListVo> page = new Page<VideoListVo>(); Page<VideoListVo> page = new Page<VideoListVo>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper return ResponseHelper
.buildResponse(monitorViewService.queryVideoPageByViewId(page, viewId, videoName, videoCode)); .buildResponse(monitorViewService.queryVideoPageByViewId(page, nodeId, nodeType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -37,6 +37,7 @@ public class SourceFileController { ...@@ -37,6 +37,7 @@ public class SourceFileController {
* @Date 2020/12/18 14:12 * @Date 2020/12/18 14:12
*/ */
@GetMapping("/list") @GetMapping("/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public List<SourceFile> findBySourceId(@RequestParam Long sourceId) { public List<SourceFile> findBySourceId(@RequestParam Long sourceId) {
return sourceFileService.findBySourceId(sourceId); return sourceFileService.findBySourceId(sourceId);
} }
......
...@@ -186,7 +186,7 @@ public class VideoController extends AbstractBaseController { ...@@ -186,7 +186,7 @@ public class VideoController extends AbstractBaseController {
@RequestMapping(value = "/pageVideo", method = RequestMethod.GET) @RequestMapping(value = "/pageVideo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "视频分页资源查询", notes = "视频分页资源查询") @ApiOperation(httpMethod = "GET", value = "视频分页资源查询", notes = "视频分页资源查询")
public ResponseModel pageVideo(Integer pageNum, Integer pageSize, Double longitude, Double latitude, Double distance) { public ResponseModel<Page<VideoListVo>> pageVideo(Integer pageNum, Integer pageSize, Double longitude, Double latitude, Double distance) {
if (null == pageNum || null == pageSize) { if (null == pageNum || null == pageSize) {
pageNum = 1; pageNum = 1;
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.dto.AlarmDTO; import com.yeejoin.equipmanage.common.entity.dto.AlarmDTO;
import com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO;
import com.yeejoin.equipmanage.common.entity.vo.VideoVO; import com.yeejoin.equipmanage.common.entity.vo.VideoVO;
...@@ -21,27 +45,17 @@ import com.yeejoin.equipmanage.common.vo.AlarmDataVO; ...@@ -21,27 +45,17 @@ import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO; import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO; import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.common.vo.EquipmentAlarmDownloadVO; import com.yeejoin.equipmanage.common.vo.EquipmentAlarmDownloadVO;
import com.yeejoin.equipmanage.mapper.*; import com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IVideoService; import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.utils.ExcelUtil; import com.yeejoin.equipmanage.utils.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/** /**
* @author DELL * @author DELL
...@@ -164,6 +178,11 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -164,6 +178,11 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
x.put("typeCode", type); x.put("typeCode", type);
x.put("type", AlarmTypeEnum.getTypeByCode(String.valueOf(type))); x.put("type", AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
} }
try {
x.put("createDate", DateUtils.dateParse(String.valueOf(x.get("createDate")),DateUtils.DATE_TIME_T_PATTERN));
} catch (ParseException e) {
e.printStackTrace();
}
x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")))); x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType"))));
x.put("fireEquipmentName", x.get("fireEquipmentName")); x.put("fireEquipmentName", x.get("fireEquipmentName"));
}); });
...@@ -179,9 +198,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -179,9 +198,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
if (mybatisResult.getSize() > 0) { if (mybatisResult.getSize() > 0) {
mybatisResult.getRecords().forEach(x -> { mybatisResult.getRecords().forEach(x -> {
AlarmListDataVO dataVO = new AlarmListDataVO(); AlarmListDataVO dataVO = new AlarmListDataVO();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
try { try {
dataVO.setAlarmTime(simpleDateFormat.parse(String.valueOf(x.get("createDate")))); dataVO.setAlarmTime(DateUtils.dateParse(String.valueOf(x.get("createDate")),DateUtils.DATE_TIME_T_PATTERN));
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -793,7 +793,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -793,7 +793,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
data = saveIntegrationPageSysData(systemCode); data = saveIntegrationPageSysData(systemCode);
} else { } else {
if (redisUtils.hasKey(systemCode)) { if (redisUtils.hasKey(systemCode)) {
data = JSON.parseObject(redisUtils.get(systemCode).toString()); data = JSONObject.parseObject(redisUtils.get(systemCode).toString(),Map.class);
} else { } else {
data = saveIntegrationPageSysData(systemCode); data = saveIntegrationPageSysData(systemCode);
} }
......
...@@ -230,8 +230,8 @@ public class MonitorViewService ...@@ -230,8 +230,8 @@ public class MonitorViewService
* @param viewId * @param viewId
* @return * @return
*/ */
public Page<VideoListVo> queryVideoPageByViewId(Page<VideoListVo> page, Long viewId, public Page<VideoListVo> queryVideoPageByViewId(Page<VideoListVo> page, Long nodeId,
String videoName, String videoCode) String nodeType)
{ {
//获取所有行为分析视频 //获取所有行为分析视频
List<VideoListVo> videoList = videoService.listByType(VideoTypeEnum.BEHAVIOURAL.getName()); List<VideoListVo> videoList = videoService.listByType(VideoTypeEnum.BEHAVIOURAL.getName());
...@@ -240,17 +240,27 @@ public class MonitorViewService ...@@ -240,17 +240,27 @@ public class MonitorViewService
{ {
videoListVoMap.put(videoListVo.getId(), videoListVo); videoListVoMap.put(videoListVo.getId(), videoListVo);
} }
//分页获取视图下视频
Page<MonitorViewVideoDto> monitorViewVideoDtos = monitorViewVideoService.queryForPage(page, viewId);
List<MonitorViewVideoDto> monitorViewVideoDtoList = monitorViewVideoDtos.getRecords();
List<VideoListVo> viewVideoList = new ArrayList<>(); List<VideoListVo> viewVideoList = new ArrayList<>();
for (MonitorViewVideoDto monitorViewVideoDto : monitorViewVideoDtoList) long total = 0;
if (nodeType.equals("video") && !ValidationUtil.isEmpty(videoListVoMap.get(nodeId)))
{ {
viewVideoList.add(videoListVoMap.get(monitorViewVideoDto.getVideoId())); viewVideoList.add(videoListVoMap.get(nodeId));
} total = 1;
}else
if (nodeType.equals("view"))
{
//分页获取视图下视频
Page<MonitorViewVideoDto> monitorViewVideoDtos = monitorViewVideoService.queryForPage(page, nodeId);
List<MonitorViewVideoDto> monitorViewVideoDtoList = monitorViewVideoDtos.getRecords();
for (MonitorViewVideoDto monitorViewVideoDto : monitorViewVideoDtoList)
{
viewVideoList.add(videoListVoMap.get(monitorViewVideoDto.getVideoId()));
}
total = monitorViewVideoDtos.getTotal();
}
page.setRecords(viewVideoList); page.setRecords(viewVideoList);
page.setTotal(monitorViewVideoDtos.getTotal()); page.setTotal(total);
return page; return page;
} }
......
...@@ -301,21 +301,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -301,21 +301,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
BeanUtils.copyProperties(equipmentSpecificIndex, equipmentSpeIndex); BeanUtils.copyProperties(equipmentSpecificIndex, equipmentSpeIndex);
String value = iotDataVO.getValue().toString(); String value = iotDataVO.getValue().toString();
equipmentSpeIndex.setValue(value); equipmentSpeIndex.setValue(value);
equipmentSpecificIndex.setValue(value);
String enumStr = equipmentSpecificIndex.getValueEnum(); String enumStr = equipmentSpecificIndex.getValueEnum();
if (!ObjectUtils.isEmpty(enumStr)) { if (!ObjectUtils.isEmpty(enumStr)) {
try { try {
JSONArray jsonArray = JSONArray.parseArray(enumStr); JSONArray jsonArray = JSONArray.parseArray(enumStr);
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i); JSONObject jsonObject = jsonArray.getJSONObject(i);
if (jsonObject.get("key").equals(equipmentSpecificIndex.getValue())) { if (jsonObject.get("key").equals(value)) {
equipmentSpeIndex.setValueLabel(jsonObject.getString("label")); equipmentSpeIndex.setValueLabel(jsonObject.getString("label"));
} equipmentSpecificIndex.setValueLabel(jsonObject.getString("label"));
} }
} catch (Exception e) { }
} catch (Exception e) {
}
} }
}
equipmentSpecificIndexList.add(equipmentSpeIndex); equipmentSpecificIndexList.add(equipmentSpeIndex);
......
...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl; ...@@ -9,10 +9,12 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RequestPart;
...@@ -168,9 +170,12 @@ public class ExcelController extends BaseController { ...@@ -168,9 +170,12 @@ public class ExcelController extends BaseController {
@ApiOperation(value = "导出值班模板", notes = "导出值班模板") @ApiOperation(value = "导出值班模板", notes = "导出值班模板")
@PostMapping (value = "/duty_template") @PostMapping (value = "/duty_template")
public void dutyCarTemplate(HttpServletResponse response, @RequestParam("beginDate") String beginDate, public void dutyCarTemplate(HttpServletResponse response, @RequestParam("beginDate") String beginDate,
@RequestParam("endDate") String endDate, ExcelDto excelDto, @RequestParam("ids") String ids) { @RequestParam("endDate") String endDate, ExcelDto excelDto, @RequestBody String ids) {
try { try {
excelService.dutyTemplateExport(response, beginDate, endDate, excelDto, ids); if(org.apache.commons.lang3.StringUtils.isNotEmpty(ids)) {
ids = ids.substring(1,ids.length()-1);
excelService.dutyTemplateExport(response, beginDate, endDate, excelDto, ids);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
......
...@@ -1724,7 +1724,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1724,7 +1724,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo.setMsgType(this.msgType); pushMessageWebAndAppRo.setMsgType(this.msgType);
pushMessageWebAndAppRo.setTerminal(RuleConstant.APP_WEB); pushMessageWebAndAppRo.setTerminal(RuleConstant.APP_WEB);
Map<String,String> map= new HashMap<String,String>(); Map<String,String> map= new HashMap<String,String>();
map.put("url", "disasterPage"); //map.put("url", "disasterPage");
map.put("sequenceNbr", besidesMap.get("alterId")); map.put("sequenceNbr", besidesMap.get("alterId"));
if(AlertBusinessTypeEnum.警情结案.getCode().equals(type)) { if(AlertBusinessTypeEnum.警情结案.getCode().equals(type)) {
...@@ -1751,7 +1751,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1751,7 +1751,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
pushMessageWebAndAppRo.setRuleType("followReportAlert"); pushMessageWebAndAppRo.setRuleType("followReportAlert");
} }
if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) { if(AlertBusinessTypeEnum.力量调派.getCode().equals(type)) {
map.put("url", "powerInformationPage"); //map.put("url", "powerInformationPage");
pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.力量调派.getName()); pushMessageWebAndAppRo.setName(AlertBusinessTypeEnum.力量调派.getName());
pushMessageWebAndAppRo.setCompanyName(smsParams.get("resourcesNum")); pushMessageWebAndAppRo.setCompanyName(smsParams.get("resourcesNum"));
pushMessageWebAndAppRo.setAddress(smsParams.get("address")); pushMessageWebAndAppRo.setAddress(smsParams.get("address"));
......
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
wle.address , wle.address ,
wle.longitude, wle.longitude,
<if test='longitude!=null and latitude!=null '> <if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
</if> </if>
wle.latitude wle.latitude
FROM wl_video wle FROM wl_video wle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment