| | |
| | | public Result<?> dataAcquisition(HttpServletRequest request, Integer id, String entrustCode, String sampleCode) { |
| | | String ipAddress = request.getRemoteAddr(); |
| | | // 防止回环地址变为IPv6 |
| | | String ip = ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress; |
| | | String ip = ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress; |
| | | List<Device> device = baseMapper.selectList(Wrappers.<Device>lambdaQuery() |
| | | .eq(Device::getIp, ip)); |
| | | if (ObjectUtils.isEmpty(device)) { |
| | |
| | | } |
| | | // 如果存在存储地址,则移动地址 |
| | | if (ObjectUtils.isNotEmpty(device.getStorageUrl())) { |
| | | String s = HTTP + ip + MOVEFILE + "?startFilePath=" + device.getCollectUrl() + "&endFilePath=" + device.getStorageUrl(); |
| | | String s = HTTP + ip + MOVEFILE + "?startFilePath=" + device.getCollectUrl() + "&endFilePath=" + device.getStorageUrl() + "&fileType=" + device.getFileType(); |
| | | String storageUrlResult = HttpUtil.get(s); |
| | | JSONObject storageUrlResultJson = JSON.parseObject(storageUrlResult); |
| | | if (Objects.equals(storageUrlResultJson.get("code"), 1)) { |
| | | if (Objects.equals(storageUrlResultJson.get("code"), 0)) { |
| | | if (ObjectUtils.isEmpty(storageUrlResultJson.get("msg"))) { |
| | | throw new ErrorException("存储地址错误,可能文件路径配置错误!"); |
| | | } else { |
| | |
| | | </select> |
| | | |
| | | <select id="getInspectionItemSubclass" resultType="java.lang.String"> |
| | | SELECT ip.inspection_item_subclass FROM ins_product ip |
| | | SELECT if(ip.inspection_item_subclass is not null and ip.inspection_item_subclass != '', |
| | | ip.inspection_item_subclass, ip.inspection_item) inspection_item_subclass FROM ins_product ip |
| | | where ip.ins_sample_id = #{id} |
| | | </select> |
| | | </mapper> |