From 8fca402ad743c884d106c0977cb792ca26bd5617 Mon Sep 17 00:00:00 2001
From: gdg <764716047@qq.com>
Date: Mon, 25 Jan 2021 11:11:43 +0800
Subject: [PATCH] add
---
src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 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..ddf7301 100644
--- a/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java
+++ b/src/main/java/com/nanometer/smartlab/service/InterfaceServiceImpl.java
@@ -1030,8 +1030,16 @@
if (containerCode==null||containerCode.isEmpty()) {
throw new ApiException(ApiStatus.PARAM_NO_EXIST, ApiStatus.PARAM_NO_EXIST.getRetMsg() + "[containerCode]");
}
-
- return sysUserDao.getUserListByContainerCodeNew(containerCode, startTime, endTime);
+ List<String> projects = sysLaboratoryContainer.selectProjectsByContainerCode(containerCode);
+ List<SysUser> userList = null;
+ if (projects != null) {
+ userList = new ArrayList<>();
+ for (String project : projects) {
+ List<SysUser> dataList = sysUserDao.getUserListByProject(project, startTime, endTime);
+ userList.addAll(dataList);
+ }
+ }
+ return userList;
}
@@ -1261,6 +1269,10 @@
logger.error("The containerCode has not been exists!");
}
}
+ //-1 状态
+ if (status.equals(-1)){
+ continue;
+ }
opeReagentStatusDao.syncOpeReagentStatus(params);
}
@@ -1347,7 +1359,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 +1418,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