| | |
| | | import org.springblade.jfpt.alarm.vo.AlarmVO; |
| | | import org.springblade.jfpt.alarm.wrapper.AlarmWrapper; |
| | | import org.springblade.jfpt.animalheat.service.AnimalHeatService; |
| | | import org.springblade.jfpt.alarm.vo.AlarmExcel; |
| | | import org.springblade.jfpt.animalheat.vo.AnimalHeatExcel; |
| | | import org.springblade.common.entity.AlarmExcel; |
| | | 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; |
| | |
| | | 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.getSecurityArr()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | return R.success("修改成功"); |
| | |
| | | List<AlarmExcel> list = alarmService.exportAlarm(alarmVO); |
| | | ExcelUtil.export(response, "主动报警数据" + DateUtil.time(), "主动报警数据表", list, AlarmExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * APP查询警情 |
| | | * @param alarmVO |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @PostMapping("/APP-getAlarm") |
| | | public R getAlarm(AlarmVO alarmVO, 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"); |
| | | return R.data(alarmService.getAlarm(alarmVO)); |
| | | } |
| | | |
| | | /** |
| | | * APP已接警情 |
| | | * @param alarmVO |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @PostMapping("/APP-getAlarming") |
| | | public R getAlarming(AlarmVO alarmVO, 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"); |
| | | return R.data(alarmService.getAlarming(alarmVO)); |
| | | } |
| | | |
| | | /** |
| | | * APP警情接受 |
| | | * @param alarmVO |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @PostMapping("/APP-setAlarm") |
| | | public R setAlarm(AlarmVO alarmVO, 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"); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间 |
| | | sdf.applyPattern("yyyy-MM-dd HH:mm:ss");// a为am/pm的标记 |
| | | Date date = new Date();// 获取当前时间 |
| | | |
| | | Operation operation = new Operation(); |
| | | operation.setJid(alarmVO.getId().toString()); |
| | | operation.setSnumber(alarmVO.getSecurityId()); |
| | | operation.setZc("接受任务"); |
| | | operation.setSname(alarmVO.getAlarmPeople()); |
| | | |
| | | operation.setZctime(sdf.format(date)); |
| | | operationService.save(operation); |
| | | |
| | | |
| | | return R.status(alarmService.setAlarm(alarmVO)); |
| | | } |
| | | |
| | | } |