| | |
| | | return retJSON.toJSONString(); |
| | | } |
| | | |
| | | // 报送试剂最新信息接口 |
| | | // 报送试剂最新信息接口 只更新试剂状态ope_regeant_status表 0, "领用" 1, "入库" 2, "存入" 3, "报废" -1, "领用待入库" |
| | | @ResponseBody |
| | | @RequestMapping(value = "/synchAllCabinet") |
| | | public String synchAllCabinet(HttpServletRequest request) throws IOException { |
| | |
| | | retJSON.put("message", e.getErrorMessage()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | retJSON.put("code", ApiStatus.SYS_ERR.getRetCode()); |
| | | StackTraceElement[] stackTraceElements = e.getStackTrace(); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(e.toString()); |
| | | for (StackTraceElement stackTraceElement : stackTraceElements) { |
| | | sb.append("\n"); |
| | | sb.append(stackTraceElement.toString()); |
| | | } |
| | | retJSON.put("message", ApiStatus.SYS_ERR.getRetMsg() + "--" + sb.toString()); |
| | | } |
| | | return retJSON.toJSONString(); |
| | | } |
| | | |
| | | // 出入库记录信息接口 更新试剂流向ope_use_flow表 |
| | | // 操作状态 2 领用 |
| | | // 操作状态 4 错误存放 |
| | | // 操作状态 1 错误入库 |
| | | // 操作状态 6 转移 智能柜试剂转移到另一个柜子 |
| | | // 操作状态 5 报废 |
| | | // 操作状态 3 存放 |
| | | // 操作状态 0 入库 |
| | | // 操作状态 11 仓库领用 |
| | | // 操作状态 10 仓库入库 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/cabinetData") |
| | | public String cabinetData(HttpServletRequest request) throws IOException { |
| | | BufferedReader br = request.getReader(); |
| | | String str, data = ""; |
| | | while((str = br.readLine()) != null){ |
| | | data += str; |
| | | } |
| | | JSONObject retJSON = new JSONObject(); |
| | | logger.info("cabinetData" + data); |
| | | String userId = request.getHeader("userId"); |
| | | |
| | | // Body参数 |
| | | JSONObject bodyJSONObject = new JSONObject(); |
| | | bodyJSONObject = JSONObject.parseObject(data); |
| | | |
| | | // 主控条码 |
| | | String controllerCode = bodyJSONObject.getString("controllerCode"); |
| | | |
| | | try { |
| | | // 数据 |
| | | String dataStr = bodyJSONObject.getString("data"); |
| | | JSONArray dataJSONArray = JSONArray.parseArray(dataStr); |
| | | logger.info("dataJSONArray: " + dataJSONArray); |
| | | |
| | | |
| | | if( dataJSONArray.size() !=0 ){ |
| | | interfaceService.cabinetData(dataJSONArray); |
| | | } |
| | | |
| | | retJSON.put("code", ApiStatus.OK.getRetCode()); |
| | | retJSON.put("message", ApiStatus.OK.getRetMsg()); |
| | | } catch (ApiException e) { |
| | | retJSON.put("code", e.getApiStatus().getRetCode()); |
| | | retJSON.put("message", e.getErrorMessage()); |
| | | } catch (Exception e) { |
| | | retJSON.put("code", ApiStatus.SYS_ERR.getRetCode()); |
| | | StackTraceElement[] stackTraceElements = e.getStackTrace(); |
| | | |
| | |
| | | return retJSON.toJSONString(); |
| | | } |
| | | |
| | | // 出入库记录信息接口 |
| | | @ResponseBody |
| | | @RequestMapping(value = "/cabinetData") |
| | | public String cabinetData(HttpServletRequest request) throws IOException { |
| | | BufferedReader br = request.getReader(); |
| | | String str, data = ""; |
| | | while((str = br.readLine()) != null){ |
| | | data += str; |
| | | } |
| | | JSONObject retJSON = new JSONObject(); |
| | | logger.info("cabinetData" + data); |
| | | String userId = request.getHeader("userId"); |
| | | |
| | | // Body参数 |
| | | JSONObject bodyJSONObject = new JSONObject(); |
| | | bodyJSONObject = JSONObject.parseObject(data); |
| | | |
| | | // 主控条码 |
| | | String controllerCode = bodyJSONObject.getString("controllerCode"); |
| | | |
| | | try { |
| | | // 数据 |
| | | String dataStr = bodyJSONObject.getString("data"); |
| | | JSONArray dataJSONArray = JSONArray.parseArray(dataStr); |
| | | logger.info("dataJSONArray: " + dataJSONArray); |
| | | |
| | | |
| | | if( dataJSONArray.size() !=0 ){ |
| | | interfaceService.cabinetData(dataJSONArray); |
| | | } |
| | | |
| | | retJSON.put("code", ApiStatus.OK.getRetCode()); |
| | | retJSON.put("message", ApiStatus.OK.getRetMsg()); |
| | | } catch (ApiException e) { |
| | | retJSON.put("code", e.getApiStatus().getRetCode()); |
| | | retJSON.put("message", e.getErrorMessage()); |
| | | } catch (Exception e) { |
| | | retJSON.put("code", ApiStatus.SYS_ERR.getRetCode()); |
| | | StackTraceElement[] stackTraceElements = e.getStackTrace(); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append(e.toString()); |
| | | for (StackTraceElement stackTraceElement : stackTraceElements) { |
| | | sb.append("\n"); |
| | | sb.append(stackTraceElement.toString()); |
| | | } |
| | | retJSON.put("message", ApiStatus.SYS_ERR.getRetMsg() + "--" + sb.toString()); |
| | | } |
| | | return retJSON.toJSONString(); |
| | | } |
| | | |
| | | //http://[URL]/smartlab/api/service/containerInfo |
| | | @ResponseBody |