| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> getUserListByContainerCodeNew(String containerCode, String startTime, String endTime) throws ApiException{ |
| | | if (containerCode==null||containerCode.isEmpty()) { |
| | | throw new ApiException(ApiStatus.PARAM_NO_EXIST, ApiStatus.PARAM_NO_EXIST.getRetMsg() + "[containerCode]"); |
| | | } |
| | | |
| | | return sysUserDao.getUserListByContainerCodeNew(containerCode, startTime, endTime); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | |
| | | 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){ |
| | | //获取实验室条码和具体地点 |
| | |
| | | content += "柜门未关"; |
| | | } |
| | | //给daping系统发送信息 |
| | | if("1".equals(warningId) || "2".equals(warningId)|| "6".equals(warningId)) { |
| | | |
| | | if(!"".equals(alarmUrl) && ("1".equals(warningId) || "2".equals(warningId)|| "6".equals(warningId)) ) { |
| | | JSONObject json = new JSONObject(); |
| | | json.put("barCode", location.get("barCode")); |
| | | json.put("type", alarmType); |
| | |
| | | logger.info(resData2); |
| | | } |
| | | } |
| | | sysAlarmPersonDao.insertSysAlarmPerson(sysAlarmPerson); |
| | | |
| | | if(enable && "2".equals(warningId) ) { |
| | | List<Map> personsInCharge = sysLaboratoryContainer.getContainerPersonInCharge(containerCode); |
| | | Map param = new HashMap(); |
| | |
| | | }); |
| | | } |
| | | if (phones.length() >0){ |
| | | phones.deleteCharAt(phones.length() - 1);} |
| | | phones.deleteCharAt(phones.length() - 1); |
| | | |
| | | } |
| | | |
| | | String suffix = String.format("?head=%s&signature=%s&content=%s&telnumber=%s", head, signature, content, phones.toString().replace(" ", "")); |
| | | CloseableHttpClient client = HttpClients.createDefault(); |
| | |
| | | post.setHeader("Content-Type", "application/json;charset=UTF-8"); |
| | | CloseableHttpResponse response = client.execute(post); |
| | | String resData = EntityUtils.toString(response.getEntity(),"UTF-8"); |
| | | client.close(); |
| | | JSONObject res = JSONObject.parseObject(resData); |
| | | if ("200".equals(res.getString("code")) && phones.length() >0){ |
| | | String memo = String.format("短信已发送[%s]", phones); |
| | | sysAlarmPerson.setMemo(memo); |
| | | } |
| | | logger.info(resData); |
| | | |
| | | } |
| | | sysAlarmPersonDao.insertSysAlarmPerson(sysAlarmPerson); |
| | | } |
| | | // 将人员扣分更新到人员表 |
| | | if (warningPoint == null) { |