| | |
| | | |
| | | @ApiModelProperty(value = "采集的检验项id") |
| | | private List<Integer> itemIds; |
| | | |
| | | //数据库用户名 |
| | | @ApiModelProperty(value = "数据库用户名") |
| | | private String dbUserName; |
| | | |
| | | //数据库密码 |
| | | @ApiModelProperty(value = "数据库密码") |
| | | private String dbPassword; |
| | | |
| | | @ApiModelProperty(value = "数据库表") |
| | | private String dbTable; |
| | | |
| | | @ApiModelProperty(value = "批次号") |
| | | private String lotBatchNo; |
| | | } |
| | |
| | | */ |
| | | private void processMultipleValueDataStream(List<DeviceMqttVO> dataList, String dataStream,int maxSize,Double minVal){ |
| | | // 筛选出当前数据流对应的数据 |
| | | // Double value = Double.parseDouble(getValueByDataStream(dataList, dataStream)); |
| | | Double value = BigDecimal.valueOf(Math.random()*100).setScale(7, RoundingMode.HALF_EVEN).doubleValue(); |
| | | Double value = Double.parseDouble(getValueByDataStream(dataList, dataStream)); |
| | | // Double value = BigDecimal.valueOf(Math.random()*100).setScale(7, RoundingMode.HALF_EVEN).doubleValue(); |
| | | //如果最小值不为空且不为-1,获取到的值小于最小值则跳过不做处理 |
| | | if(Objects.nonNull(minVal)&&minVal!=-1&&value<minVal){ |
| | | return; |
| | |
| | | i.setInsProductItem(name); |
| | | }) |
| | | .collect(Collectors.groupingBy(DataConfig::getInsProductItem)); |
| | | map.putAll(getActualResistanceValueAsMap(userMap, device,dto.getEntrustCode())); |
| | | map.putAll(getActualResistanceValueAsMap(userMap, device,dto.getEntrustCode(),dto.getLotBatchNo())); |
| | | }else { |
| | | String dbUserName = StringUtils.isNotBlank(dto.getDbUserName())?dto.getDbUserName():""; |
| | | String dbPassword = StringUtils.isNotBlank(dto.getDbPassword())?dto.getDbPassword():""; |
| | | String dbTable = StringUtils.isNotBlank(dto.getDbTable())?dto.getDbTable():""; |
| | | map.putAll(DataAcquisition.dataAcquisitionEntrance(list, device, dto.getEntrustCode(), dto.getEntrustCode(), ip, insProducts.get(0).getCableTag(),dbUserName,dbPassword,dbTable)); |
| | | map.putAll(DataAcquisition.dataAcquisitionEntrance(list, device, dto.getEntrustCode(), dto.getLotBatchNo(),dto.getLotBatchNo(), ip, insProducts.get(0).getCableTag(),dbUserName,dbPassword,dbTable)); |
| | | if(StringUtils.equals(".mysql",device.getFileType())){ |
| | | |
| | | }else{ |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | * @param device 设备信息 |
| | | * @return 包含实际电阻值处理结果的键值对;若未获取到有效数据则返回空 Map |
| | | */ |
| | | public Map<String, Object> getActualResistanceValueAsMap(Map<String, List<DataConfig>> dataConfig, Device device,String entrustCode) { |
| | | public Map<String, Object> getActualResistanceValueAsMap(Map<String, List<DataConfig>> dataConfig, Device device,String entrustCode,String lotBatchNo) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (ObjectUtils.isEmpty(dataConfig)) { |
| | | return map; |
| | |
| | | if (refery.equals(DCResistanceMqttConstants.NSDQCS_DQCS_DZZ)){ |
| | | // 查询对应委托编号的数据 |
| | | // Object value = RedisUtil.get(refery); |
| | | CollectBridge collectBridge = collectBridgeMapper.selectOne(Wrappers.<CollectBridge>lambdaQuery().eq(CollectBridge::getEntrustCode,entrustCode).last("limit 1")); |
| | | String[] splits = entrustCode.split("-"); |
| | | String newEntrustCode = splits.length>1 ?splits[1]:""; |
| | | CollectBridge collectBridge = collectBridgeMapper.selectOne(Wrappers.<CollectBridge>lambdaQuery() |
| | | .eq(CollectBridge::getEntrustCode,newEntrustCode) |
| | | .or() |
| | | .eq(CollectBridge::getEntrustCode,lotBatchNo) |
| | | .last("limit 1")); |
| | | if(Objects.isNull(collectBridge)){ |
| | | throw new ErrorException("直流电阻数采异常:没有找到委托编号为【"+entrustCode+"】的数据"); |
| | | } |
| | |
| | | * @param device |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> dataAcquisitionEntrance(List<DataConfig> dataConfig, Device device, String entrustCode, String sampleCode, String ip, String cableTag, String dbUserName, String dbPassword,String dbTable) { |
| | | public static Map<String, Object> dataAcquisitionEntrance(List<DataConfig> dataConfig, Device device, String entrustCode,String lotBatchNo, String sampleCode, String ip, String cableTag, String dbUserName, String dbPassword,String dbTable) { |
| | | // 判断是否是影像测量仪 |
| | | if (device.getManagementNumber().equals("JCZX-ZB-OP07001")) { |
| | | if (device.getFileType().equals(".xlsx")) { |
| | |
| | | "&dbFileName=" + dbFileName + |
| | | "&dbUserName=" + dbUserName + |
| | | "&dbPassword=" + dbPassword + |
| | | "&lotBatchNo=" + lotBatchNo + |
| | | "&cableTag=" + cableTag + |
| | | "&dbTable=" + dbTable; |
| | | System.out.println("请求的 URL: " + http); |
| | | String result = null; |