1.警情导出bug修复
2.警情统计接口修改
3.一键报警设备接收报文时修改设备状态
| | |
| | | <if test="alarm.level!=null"> |
| | | and a.level like concat('%',#{alarm.level},'%') |
| | | </if> |
| | | <if test="alarm.waringType!=null"> |
| | | <if test="alarm.waringType!=null and alarm.waringType!='undefined'"> |
| | | and a.waringType like concat('%',#{alarm.waringType},'%') |
| | | </if> |
| | | <if test="alarm.beginTime!=null and alarm.beginTime!=''"> |
| | | <if test="alarm.beginTime!=null and alarm.beginTime!='' and alarm.beginTime!='undefined'"> |
| | | and a.alarmTime>=#{alarm.beginTime} |
| | | </if> |
| | | <if test="alarm.endTime!=null and alarm.endTime!=''"> |
| | | <if test="alarm.endTime!=null and alarm.endTime!='' and alarm.endTime!='undefined'"> |
| | | and a.alarmTime<=#{alarm.endTime} |
| | | </if> |
| | | <if test="alarm.timeDesc!=null and alarm.timeDesc!=''"> |
| | | <if test="alarm.timeDesc!=null and alarm.timeDesc!='' and alarm.timeDesc!='undefined'"> |
| | | <if test="alarm.timeDesc=='30分钟以上'"> |
| | | and czTime-alarmTime>1800 |
| | | </if> |
| | |
| | | ) b |
| | | on |
| | | a.days = b.datetime |
| | | order by days |
| | | </select> |
| | | |
| | | |
| | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.EasyExcelFactory; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 体温监测控制层 |
| | |
| | | * @param response 返回域 |
| | | */ |
| | | @GetMapping("/export-animalHeat") |
| | | public void exportAnimalHeat(AnimalHeatVo animalHeatVo,HttpServletResponse response){ |
| | | public void exportAnimalHeat(AnimalHeatVo animalHeatVo,HttpServletResponse response) throws Exception{ |
| | | List<AnimalHeatExcel> list = animalHeatService.exportAnimalHeat(animalHeatVo); |
| | | // response.setContentType("application/vnd.ms-excel"); |
| | | // response.setCharacterEncoding(Charsets.UTF_8.name()); |
| | | // String fileName = URLEncoder.encode("体温检测数据" + DateUtil.time(), Charsets.UTF_8.name()); |
| | | // response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | // ExcelWriter writer = new ExcelWriterBuilder() |
| | | // .autoCloseStream(true) |
| | | // .file(response.getOutputStream()) |
| | | // .head(AnimalHeatExcel.class) |
| | | // .build(); |
| | | // // xlsx文件上上限是104W行左右,这里如果超过104W需要分Sheet |
| | | // WriteSheet writeSheet = new WriteSheet(); |
| | | // writeSheet.setSheetName("target"); |
| | | // long lastBatchMaxId = 0L; |
| | | // int limit = 500; |
| | | // for (; ; ) { |
| | | // List<AnimalHeatExcel> list = animalHeatService.exportAnimalHeat(animalHeatVo); |
| | | // List list = orderService.queryByScrollingPagination(paymentDateTimeStart, paymentDateTimeEnd, lastBatchMaxId, limit); |
| | | // if (list.isEmpty()) { |
| | | // writer.finish(); |
| | | // break; |
| | | // } else { |
| | | // lastBatchMaxId = list.stream().map(AnimalHeatExcel::getId).max(Long::compareTo).orElse(Long.MAX_VALUE); |
| | | // writer.write(list, writeSheet); |
| | | // } |
| | | // } |
| | | // EasyExcel.write(response.getOutputStream(), AnimalHeatExcel.class).sheet("体温检测数据表").doWrite(list); |
| | | ExcelUtil.export(response, "体温检测数据" + DateUtil.time(), "体温检测数据表", list,AnimalHeatExcel.class ); |
| | | } |
| | | |
| | |
| | | <if test="animalHeatVo.type==2"> |
| | | and date_format(create_time,'%Y%m') = date_format(now(),'%Y%m') |
| | | </if> |
| | | <if test="animalHeatVo.begTime!=null and animalHeatVo.begTime!='' and animalHeatVo.endTime!=null and animalHeatVo.endTime!='' "> |
| | | <if test="animalHeatVo.begTime!=null and animalHeatVo.begTime!='' and animalHeatVo.endTime!=null and animalHeatVo.endTime!='' and animalHeatVo.begTime!='undefined' and animalHeatVo.endTime!='undefined' "> |
| | | and date(create_time) between #{animalHeatVo.begTime} and #{animalHeatVo.endTime} |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc!=null and animalHeatVo.timeDesc!=''"> |
| | | <if test="animalHeatVo.timeDesc!=null and animalHeatVo.timeDesc!='' and animalHeatVo.timeDesc!='undefined'"> |
| | | <if test="animalHeatVo.timeDesc=='0-2'"> |
| | | and hour(create_time)>=0 and hour(create_time) <2 |
| | | </if> |
| | |
| | | <select id="exportAnimalHeat" resultType="org.springblade.common.entity.AnimalHeatExcel"> |
| | | SELECT * FROM blade_animal_heat |
| | | where 1=1 |
| | | <if test="animalHeatVo.status!=null"> |
| | | <if test="animalHeatVo.status!=null and animalHeatVo.status!='' and animalHeatVo.status!='undefined'"> |
| | | and status=#{animalHeatVo.status} |
| | | </if> |
| | | <include refid="animalHeatCondition"></include> |
| | |
| | | return R.data(map); |
| | | } |
| | | |
| | | /** |
| | | * 监控台统计 |
| | | * @author arsn 2021-5-6 |
| | | * @return |
| | | */ |
| | | @PostMapping("/SeleCs") |
| | | public R SeleCs() { |
| | | return R.data(equipmentService.selEqTypeSum()); |
| | | } |
| | | |
| | | } |
| | |
| | | Integer selectEqCd(); |
| | | List<Map<String, Object>> selectEqCy(String time); |
| | | Integer selectEqCg(); |
| | | |
| | | /** |
| | | * 当前预警设备数量 |
| | | * @return |
| | | */ |
| | | Integer selectEqCys(); |
| | | } |
| | |
| | | |
| | | <!--查询设备在线数量--> |
| | | <select id="selectEqCz" resultType="Integer"> |
| | | select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) |
| | | select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1 |
| | | </select> |
| | | |
| | | <!--查询设备掉线数量--> |
| | | <select id="selectEqCd" resultType="Integer"> |
| | | select COUNT(*) from sys_equipment where heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) |
| | | select COUNT(*) from sys_equipment where heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=0 |
| | | </select> |
| | | |
| | | <!--查询预警设备数量--> |
| | |
| | | deviceNumber |
| | | </select> |
| | | |
| | | |
| | | <!--查询预警设备数量--> |
| | | <select id="selectEqCys" resultType="Integer"> |
| | | select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2 |
| | | </select> |
| | | |
| | | <!--查询设故障数量--> |
| | | <select id="selectEqCg" resultType="Integer"> |
| | | select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and state!=null |
| | | select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3 |
| | | </select> |
| | | </mapper> |
| | |
| | | Integer selectEqCd(); |
| | | List<Map<String, Object>> selectEqCy(String time); |
| | | Integer selectEqCg(); |
| | | |
| | | /** |
| | | * 获取各个设备状态统计数量 |
| | | * @return |
| | | */ |
| | | Map<String,Object> selEqTypeSum(); |
| | | } |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | String dType = "3"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | if(state.equals("一键报警")){ |
| | | String dType = "2"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | | } |
| | | if(state.equals("处理完成")){ |
| | | String dType = "1"; |
| | | baseMapper.updateExstate(dType, reason, deviceNumber); |
| | |
| | | public Integer selectEqCg() { |
| | | return baseMapper.selectEqCg(); |
| | | } |
| | | |
| | | /** |
| | | * 获取各个设备状态统计数量 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> selEqTypeSum() { |
| | | //设备在线数量 |
| | | Integer integerz = baseMapper.selectEqCz(); |
| | | //设备掉线数量 |
| | | Integer integerd = baseMapper.selectEqCd(); |
| | | //设备预警数量 |
| | | Integer alarmSum = baseMapper.selectEqCys(); |
| | | //设备故障数量 |
| | | Integer integerg = baseMapper.selectEqCg(); |
| | | //封装数据 |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("zx", integerz); |
| | | map.put("dx", integerd); |
| | | map.put("yj", alarmSum); |
| | | map.put("gz", integerg); |
| | | //返回数据 |
| | | return map; |
| | | } |
| | | } |
| | |
| | | alarm.setWd((String) list.get(0).get("wd"));//纬度 |
| | | alarm.setCid(String.valueOf(a));//警情代码 |
| | | alarm.setJtype("0"); |
| | | //修改设备状态 |
| | | serverHandler.equipmentService.updateExstate("一键报警",null,(String) list.get(0).get("deviceNumber")); |
| | | switch (num) { |
| | | case "00": |
| | | if (fqbm.equals("0")) { |
| | |
| | | //设置页码数 |
| | | conditionVo.setCurrentPage(1); |
| | | conditionVo.setPageSize(1000); |
| | | if(null==conditionVo.getDecisioDiagramResult() || conditionVo.getDecisioDiagramResult()=="" || conditionVo.getDecisioDiagramResult().equals("undefined") ){ |
| | | conditionVo.setDecisioDiagramResult(null); |
| | | } |
| | | if(null==conditionVo.getStartTime() || conditionVo.getStartTime()==""|| conditionVo.getStartTime().equals("undefined") ){ |
| | | conditionVo.setStartTime(null); |
| | | } |
| | | if(null==conditionVo.getEndTime() || conditionVo.getEndTime()=="" || conditionVo.getEndTime().equals("undefined") ){ |
| | | conditionVo.setEndTime(null); |
| | | } |
| | | System.out.println("conditionVo 后 = " + conditionVo); |
| | | //获取数据 |
| | | Map<String,Object> result =(Map<String,Object>)getParcelDataPageList(conditionVo, PARCEL_DETAIL_RUL, PARCEL_KEY, PARCEL_SECRET).get("result"); |
| | | if (null!=result) { |
| | |
| | | ConditionVo vo = new ConditionVo(); |
| | | vo.setCurrentPage(1); |
| | | vo.setPageSize(100); |
| | | vo.setDecisioDiagramResult(conditionVo.getDecisioDiagramResult()); |
| | | vo.setStartTime(conditionVo.getStartTime()); |
| | | vo.setEndTime(conditionVo.getEndTime()); |
| | | if(null!=conditionVo.getDecisioDiagramResult() && conditionVo.getDecisioDiagramResult()!="" && !conditionVo.getDecisioDiagramResult().equals("undefined") ){ |
| | | vo.setDecisioDiagramResult(conditionVo.getDecisioDiagramResult()); |
| | | } |
| | | if(null!=conditionVo.getStartTime() && conditionVo.getStartTime()!="" && !conditionVo.getStartTime().equals("undefined") ) { |
| | | vo.setStartTime(conditionVo.getStartTime()); |
| | | } |
| | | if(null!=conditionVo.getEndTime() && conditionVo.getEndTime()!="" && !conditionVo.getEndTime().equals("undefined") ) { |
| | | vo.setEndTime(conditionVo.getEndTime()); |
| | | } |
| | | Map<String,Object> result =(Map<String,Object>) getParcelDataPageList(vo, PARCEL_KIND_URL, PARCEL_KEY, PARCEL_SECRET).get("result"); |
| | | if (null!=result){ |
| | | String data = result.get("data").toString(); |
| | |
| | | }else { |
| | | conditionVo.setCurrentPage(1); |
| | | conditionVo.setPageSize(100); |
| | | if(null==conditionVo.getDecisioDiagramResult() || conditionVo.getDecisioDiagramResult()=="" || conditionVo.getDecisioDiagramResult().equals("undefined") ){ |
| | | conditionVo.setDecisioDiagramResult(null); |
| | | } |
| | | if(null==conditionVo.getStartTime() || conditionVo.getStartTime()=="" || conditionVo.getStartTime().equals("undefined") ){ |
| | | conditionVo.setStartTime(null); |
| | | } |
| | | if(null==conditionVo.getEndTime() || conditionVo.getEndTime()=="" || conditionVo.getEndTime().equals("undefined") ){ |
| | | conditionVo.setEndTime(null); |
| | | } |
| | | Map<String,Object> result =(Map<String,Object>) getParcelDataPageList(conditionVo, PARCEL_KIND_URL, PARCEL_KEY, PARCEL_SECRET).get("result"); |
| | | //获取违禁品数据 |
| | | if (null!=result) { |