| | |
| | | |
| | | // 人员违规预警接口 |
| | | @Override |
| | | public void alarmperson(JSONObject jsonObject) throws ApiException, IOException { |
| | | public void alarmperson(JSONObject jsonObject) throws Exception { |
| | | JSONArray dataArr = jsonObject.getJSONArray("data"); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | Timestamp warnTime; |
| | | try { |
| | | Date warningTime = sdf.parse(warningTimeStr); |
| | | //不接收时间超过现在的数据 |
| | | if (warningTime.after(new Date())) { |
| | | throw new Exception("柜子时间发生错误"); |
| | | } |
| | | warnTime = new Timestamp(warningTime.getTime()); |
| | | sysAlarmPerson.setWarningTime(warnTime); |
| | | } catch (ParseException e) { |
| | | throw new ApiException(ApiStatus.PARAM_ERR); |
| | | } |
| | | // 将人员违规预警记录保存到数据库表 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new Exception(e.getMessage()); |
| | | } |
| | | // 将人员违规预警记录保存到数据库表 |
| | | int count = sysAlarmPersonDao.repeatedJudgment(containerCode, warningLevelInt, warnTime); |
| | | if (count<1){ |
| | | //获取实验室条码和具体地点 |