| | |
| | | import org.springblade.jfpt.alarm.wrapper.AlarmWrapper; |
| | | import org.springblade.jfpt.animalheat.service.AnimalHeatService; |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.operation.entity.Operation; |
| | | import org.springblade.jfpt.operation.service.IOperationService; |
| | | import org.springblade.jfpt.operation.vo.OperationVO; |
| | | import org.springblade.jfpt.parcel.service.ParcelService; |
| | | import org.springblade.jfpt.parcel.util.DateUtils; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | |
| | | private final IAlarmService alarmService; |
| | | |
| | | private final AnimalHeatService animalHeatService; |
| | | |
| | | private final IOperationService operationService; |
| | | |
| | | private IhealthcodeService ihealthcodeService; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | //警情分发测试代码 |
| | | //查询所有在线的接警员 |
| | | 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)); |
| | | } |
| | | } |
| | | |
| | | int size = 0; |
| | | if (online_police.size() == 0){ |
| | | online_police = policeList; |
| | | size = policeList.size(); |
| | | }else { |
| | | size = online_police.size(); |
| | | } |
| | | |
| | | int num=(int)(Math.random()*(size)); |
| | | String name = (String) online_police.get(num).get("real_name"); |
| | | String id = (String) online_police.get(num).get("id"); |
| | | |
| | | alarm.setAlarmPeople(name); |
| | | alarm.setAlarmId(name); |
| | | |
| | | return null; |
| | | //return R.status(alarmService.saveOrUpdate(alarm)); |
| | |
| | | types = Arrays.asList(type); |
| | | //获取时间集合数据(今天及今天之前6天的日期) |
| | | times = DateUtils.pastDay(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); |
| | | //1.统计7天内一键求助警情数量数据 |
| | | //1.统计7天内一键求助警情数量数据 3-20 修改展示紧急求助 |
| | | Map<String,Object> alarmData = alarmService.selectAlarmData(); |
| | | alarmData.put("name","一键求助"); |
| | | //2.统计7天内违禁品的数量数据 |
| | |
| | | |
| | | |
| | | /** |
| | | * 修改警情类型 |
| | | * 修改警情类型/同时修改人员状态 |
| | | */ |
| | | @PostMapping("/updateJtype") |
| | | public R updateJtype(String id, String czTime, String bz, HttpServletResponse response) { |
| | | public R updateJtype(OperationVO operation, HttpServletResponse response) { |
| | | 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(id,czTime,bz); |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz(),operation.getZctime()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | |
| | | } |