Merge remote-tracking branch 'origin/master'
| | |
| | | } |
| | | |
| | | |
| | | //警情分发测试代码 |
| | | //查询所有闲置的接警员 |
| | | List<Map<String, Object>> policeList = alarmService.queryPolice(); |
| | | List<Map<String, Object>> online_police = new ArrayList<>(); |
| | | for (int i = 0; i < policeList.size(); i++) { |
| | | if (policeList.get(i).get("work_status").equals(0)){ |
| | | //System.out.println(policeList.get(i).get("real_name")); |
| | | online_police.add(policeList.get(i)); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (online_police.size() == 0){ |
| | | online_police = policeList; |
| | | } |
| | | |
| | | List policeIdArr = new ArrayList(); |
| | | |
| | | //将闲置状态的人员id存入数组 |
| | | for (int i = 0; i < online_police.size(); i++) { |
| | | policeIdArr.add(online_police.get(i).get("id")); |
| | | } |
| | | |
| | | //通过id计算接警员最后一次接警时间,倒序返回闲置最久的人员,派发任务 |
| | | List<Map<String, Object>> police = alarmService.queryPoliceTime(policeIdArr); |
| | | |
| | | if (police.size() != 0){ |
| | | alarm.setAlarmId((String) police.get(0).get("alarmId")); |
| | | alarm.setAlarmPeople((String) police.get(0).get("alarmPeople")); |
| | | Date date = new Date(); |
| | | SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | alarm.setJjTime(dateFormat.format(date)); |
| | | }else { |
| | | alarm.setAlarmId((String) online_police.get(0).get("id")); |
| | | alarm.setAlarmPeople((String) online_police.get(0).get("name")); |
| | | Date date = new Date(); |
| | | SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | alarm.setJjTime(dateFormat.format(date)); |
| | | } |
| | | |
| | | |
| | | return null; |
| | |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz()); |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz(),operation.getZctime()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | return R.success("修改成功"); |
| | |
| | | private String bz; |
| | | private String cid; |
| | | |
| | | @TableLogic |
| | | private Integer isDeleted; |
| | | // @TableLogic |
| | | // private Integer isDeleted; |
| | | |
| | | |
| | | } |
| | |
| | | void deletejj(String id); |
| | | |
| | | void s(Alarm alarm); |
| | | void updateJtype(String id, String jtype, String bz); |
| | | void updateJtype(String id, String jtype, String bz,String jjtime); |
| | | void updatePoliceStatus(String id, String status); |
| | | void updateOne(Alarm alarm); |
| | | |
| | |
| | | and a.alarmTime<=#{alarm.endTime} |
| | | </if> |
| | | |
| | | and a.waringType NOT IN("系统测试","主机重新上电") |
| | | and a.waringType IN("紧急求救") |
| | | |
| | | ORDER BY |
| | | a.jtype ASC, |
| | |
| | | |
| | | |
| | | <update id="updateJtype"> |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz} where id=#{id} |
| | | update sys_alarm SET jtype=#{jtype},bz=#{bz},jjTime=#{jjtime} where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updatePoliceStatus"> |
| | |
| | | void updateOne(Alarm alarm); |
| | | List<Map<String, Object>> selectScount(String time); |
| | | List<AlarmVO> selectListSe(String beginTime, String endTime); |
| | | void updateJtype(String id, String jtype, String bz); |
| | | void updateJtype(String id, String jtype, String bz, String jjtime); |
| | | |
| | | void updatePoliceStatus(String id, String status); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateJtype(String id,String jtype,String bz) { |
| | | baseMapper.updateJtype(id,jtype,bz); |
| | | public void updateJtype(String id,String jtype,String bz,String jjtime) { |
| | | baseMapper.updateJtype(id,jtype,bz,jjtime); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public void channelRead(ChannelHandlerContext channelHandlerContext, Object info) throws Exception { |
| | | long startTime1 = System.currentTimeMillis(); |
| | | System.out.println("接收到了:" + info); |
| | | ByteBuf buf = (ByteBuf) info; |
| | | byte[] req = new byte[buf.readableBytes()]; |
| | |
| | | List<String> outData = new ArrayList<>(); |
| | | switch (content.substring(0, 2)) { |
| | | case "LA": { |
| | | System.out.println("按下按钮+++++++++++++++++++++++++++++++++"); |
| | | String devId = content.substring(10, 22); |
| | | //String fqbm = content.substring(24, 26); |
| | | String d = content.substring(26, 27); |
| | |
| | | break; |
| | | } |
| | | |
| | | //警情分发测试代码 |
| | | //查询所有闲置的接警员 |
| | | List<Map<String, Object>> policeList = serverHandler.alarmService.queryPolice(); |
| | | List<Map<String, Object>> online_police = new ArrayList<>(); |
| | | for (int i = 0; i < policeList.size(); i++) { |
| | | if (policeList.get(i).get("work_status").equals(0)){ |
| | | //System.out.println(policeList.get(i).get("real_name")); |
| | | online_police.add(policeList.get(i)); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (online_police.size() == 0){ |
| | | online_police = policeList; |
| | | } |
| | | |
| | | List policeIdArr = new ArrayList(); |
| | | |
| | | //将闲置状态的人员id存入数组 |
| | | for (int i = 0; i < online_police.size(); i++) { |
| | | policeIdArr.add(online_police.get(i).get("id")); |
| | | } |
| | | |
| | | //通过id计算接警员最后一次接警时间,倒序返回闲置最久的人员,派发任务 |
| | | List<Map<String, Object>> police = serverHandler.alarmService.queryPoliceTime(policeIdArr); |
| | | |
| | | if (police.size() != 0){ |
| | | alarm.setAlarmId( police.get(0).get("alarmId").toString()); |
| | | alarm.setAlarmPeople( police.get(0).get("alarmPeople").toString()); |
| | | // Date date = new Date(); |
| | | // SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // alarm.setJjTime(dateFormat.format(date)); |
| | | |
| | | serverHandler.alarmService.updatePoliceStatus( police.get(0).get("alarmId").toString(),"1"); |
| | | }else { |
| | | alarm.setAlarmId( online_police.get(0).get("id").toString()); |
| | | alarm.setAlarmPeople(online_police.get(0).get("name").toString()); |
| | | // Date date = new Date(); |
| | | // SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // alarm.setJjTime(dateFormat.format(date)); |
| | | |
| | | serverHandler.alarmService.updatePoliceStatus(online_police.get(0).get("id").toString(),"1"); |
| | | } |
| | | |
| | | serverHandler.alarmService.s(alarm); |
| | | outData.add("LEOK#@"); |
| | | long endTime1 = System.currentTimeMillis(); //获取结束时间 |
| | | |
| | | System.out.println("代码运行时间:" + (endTime1 - startTime1) + "ms"); //输出程序运行时间 |
| | | break; |
| | | } |
| | | case "LD": { |