| | |
| | | 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; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | private final IAlarmService alarmService; |
| | | |
| | | private final AnimalHeatService animalHeatService; |
| | | |
| | | private final IOperationService operationService; |
| | | |
| | | private IhealthcodeService ihealthcodeService; |
| | | |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | |
| | | |
| | | 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; |
| | | //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 |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 修改警情类型 |
| | | * 修改警情类型/同时修改人员状态 |
| | | */ |
| | | @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()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | |
| | | } |