From e21830598f6c55f1196c519fd9005704c82a0fb3 Mon Sep 17 00:00:00 2001 From: gdg <764716047@qq.com> Date: 星期三, 30 十二月 2020 15:49:09 +0800 Subject: [PATCH] 修改:idCard改成8位输入或者20位输入,转换大写 原因:扫码扫出8位,数据库和柜子使用的是20位 提出:秦老师 --- src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java b/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java index 5c4d719..1e79b44 100644 --- a/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java +++ b/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java @@ -1347,7 +1347,7 @@ // 人员违规预警接口 @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"); @@ -1406,12 +1406,19 @@ 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){ //获取实验室条码和具体地点 -- Gitblit v1.9.2