| | |
| | | |
| | | @Resource |
| | | private OpeUseFlowService opeUseFlowService; |
| | | @Resource |
| | | private SysWarningService sysWarningService; |
| | | |
| | | @Resource(name = "sysWarehouseDao") |
| | | SysWarehouseDao sysWarehouseDao; |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | |
| | | logger.error("The containerCode has not been exists!"); |
| | | } |
| | | } |
| | | //-1 状态 |
| | | if (status.equals(-1)){ |
| | | continue; |
| | | } |
| | | opeReagentStatusDao.syncOpeReagentStatus(params); |
| | | |
| | | } |
| | |
| | | |
| | | // 人员违规预警接口 |
| | | @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){ |
| | | //获取实验室条码和具体地点 |
| | |
| | | } |
| | | //给daping系统发送信息 |
| | | |
| | | if(!"".equals(alarmUrl) && ("1".equals(warningId) || "2".equals(warningId)|| "6".equals(warningId)) ) { |
| | | if(!"".equals(alarmUrl) && ("1".equals(warningId) || "2".equals(warningId))){ |
| | | JSONObject json = new JSONObject(); |
| | | json.put("barCode", location.get("barCode")); |
| | | json.put("type", alarmType); |
| | |
| | | public JSONObject getUserInfo(JSONObject jsonObject) { |
| | | return null; |
| | | } |
| | | |
| | | // 人员违规预警接口 |
| | | @Override |
| | | public void delalarmperson(JSONObject jsonObject) throws Exception { |
| | | String containerCode = jsonObject.getString("containerCode"); |
| | | String warningId = jsonObject.getString("warningId"); |
| | | // 货柜条码 containerCode String ○ |
| | | // 报警类别 warningId Integer ○ |
| | | if (StringUtils.isBlank(containerCode) || StringUtils.isBlank(warningId)) { |
| | | throw new ApiException(ApiStatus.PARAM_NO_EXIST); |
| | | } |
| | | Map<String, String> metaMap = new HashMap<>(); |
| | | metaMap.put("groupId", "user_violate_type"); |
| | | metaMap.put("metaKey", warningId); |
| | | |
| | | List<BaseMeta> baseMetaList = baseMetaDao.getBaseMetaList(metaMap); |
| | | if (baseMetaList == null || baseMetaList.size() != 1) { |
| | | throw new ApiException(ApiStatus.PARAM_ERR, ApiStatus.PARAM_ERR.getRetMsg() + "[warningId]"); |
| | | } |
| | | |
| | | SysAlarmPerson sysAlarmPerson = new SysAlarmPerson(); |
| | | sysAlarmPerson.setContainerCode(containerCode); |
| | | sysAlarmPerson.setWarningId(baseMetaList.get(0).getId()); |
| | | |
| | | List<SysAlarmPerson> sysAlarmPersonList = sysAlarmPersonDao.selectByCode(containerCode, baseMetaList.get(0).getId()); |
| | | // 将人员违规预警记录保存到数据库表 |
| | | for (SysAlarmPerson sysAlarm : sysAlarmPersonList) { |
| | | if (!"".equals(alarmUrl) && StringUtils.isNotBlank(sysAlarm.getRefId()) && ("1".equals(warningId) || "2".equals(warningId))) { |
| | | SysWarning sysWarning = new SysWarning(); |
| | | sysWarning.setId(String.valueOf(sysAlarm.getId())); |
| | | sysWarning.setStatus(1); |
| | | sysWarning.setAlarmId(sysAlarm.getRefId()); |
| | | sysWarningService.updateSysWarning(sysWarning); |
| | | } |
| | | } |
| | | } |
| | | } |