| | |
| | | import org.springblade.jfpt.healthcode.service.IhealthcodeService; |
| | | import org.springblade.jfpt.parcel.service.ParcelService; |
| | | import org.springblade.jfpt.parcel.util.DateUtils; |
| | | import org.springblade.jfpt.parcel.vo.ConditionVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | if (alarm.getAlarmTime() != null && alarm.getAlarmTime().equals("")){ |
| | | alarm.setAlarmTime(null); |
| | | } |
| | | return R.status(alarmService.saveOrUpdate(alarm)); |
| | | if (alarm.getCid() != null && alarm.getCid().equals("")){ |
| | | alarm.setCid("0"); |
| | | } |
| | | |
| | | |
| | | //警情分发测试代码 |
| | | //查询所有在线的接警员 |
| | | 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)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 一周警情统计 2021-3-16 arsn |
| | | * 主动报警统计 饼图展示 |
| | | * @param response |
| | | * @param conditionVo status 0:本日 1:本月 2:本月 |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectAlarmSum") |
| | | public R selectAlarmSum(HttpServletResponse response, ConditionVo conditionVo) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | //返回数据 |
| | | return R.data(alarmService.selectAlarmSum(conditionVo)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 一周警情统计(主动报警+被动报警类型(体温异常,红码,违禁品)) 2021-3-16 arsn 柱状图展示 |
| | | * @param response |
| | | * @return |
| | | */ |