南昌市物联网技防平台-后台
tangzy
2021-03-22 439480489111ecb1863e2ad0ceb2ff18150366ef
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/nettyServer/ServerHandler.java
@@ -12,6 +12,8 @@
import org.springblade.jfpt.animalheat.service.AnimalHeatService;
import org.springblade.jfpt.catalog.service.catalogService;
import org.springblade.jfpt.equipment.service.IEquipmentService;
import org.springblade.jfpt.operation.service.IOperationService;
import org.springblade.jfpt.operation.vo.OperationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -48,6 +50,9 @@
   @Autowired
   private IAlarmService alarmService;
   @Autowired
   private IOperationService operationService;
   private static ServerHandler serverHandler;
@@ -1738,22 +1743,30 @@
               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));
                  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));
                  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);
               OperationVO operation = new OperationVO();
               operation.setSnumber(alarm.getAlarmId());
               operation.setSname(alarm.getAlarmPeople());
               operation.setJid(alarm.getId().toString());
               operation.setZc("接警");
               operation.setZctime(alarm.getJjTime());
               serverHandler.operationService.save(operation);
               outData.add("LEOK#@");
               long endTime1 = System.currentTimeMillis();    //获取结束时间