gdg
2020-12-29 b06e4004a2ff3c4562da8b6d44decffa643b686b
问题:人员预警时间
修改:超过现在时间 不做操作
已修改2个文件
11 ■■■■ 文件已修改
src/main/java/com/nanometer/smartlab/service/InterfaceService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/nanometer/smartlab/service/InterfaceService.java
@@ -24,7 +24,7 @@
    public void alarm(JSONObject jsonObject) throws ApiException;
    
    public void alarmperson(JSONObject jsonObject) throws ApiException, IOException;
    public void alarmperson(JSONObject jsonObject) throws Exception;
    public void cabinetData(JSONArray jsonObject) throws ApiException;
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,10 +1406,17 @@
            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);