| | |
| | | String refery = DataAcquisition.getRefer(v.get(config).getRefery()); |
| | | if (refery.equals(DCResistanceMqttConstants.NSDQCS_DQCS_DZZ)){ |
| | | // 查询对应委托编号的数据 |
| | | // Object value = RedisUtil.get(refery); |
| | | String[] splits = entrustCode.split("-"); |
| | | String newEntrustCode = splits.length>1 ?splits[1]:""; |
| | | CollectBridge collectBridge = collectBridgeMapper.selectOne(Wrappers.<CollectBridge>lambdaQuery() |
| | | .eq(CollectBridge::getEntrustCode,newEntrustCode) |
| | | .eq(CollectBridge::getDeviceCode,device.getManagementNumber()) |
| | | .and(i-> |
| | | i.eq(CollectBridge::getEntrustCode,newEntrustCode) |
| | | .or() |
| | | .eq(CollectBridge::getEntrustCode,lotBatchNo) |
| | | .eq(CollectBridge::getEntrustCode,lotBatchNo)) |
| | | .last("limit 1")); |
| | | if(Objects.isNull(collectBridge)){ |
| | | throw new ErrorException("直流电阻数采异常:没有找到委托编号为【"+entrustCode+"】的数据"); |
| | | throw new ErrorException("设备"+device.getManagementNumber()+"数采异常:没有找到SN号为【"+entrustCode+"或"+lotBatchNo+"】的数据"); |
| | | } |
| | | list.add(0,1);//测试长度,默认1 |
| | | list.add(1,Objects.isNull(collectBridge.getCollectTemperature())?0.0:collectBridge.getCollectTemperature()); |
| | | list.add(2,collectBridge.getCollectValue());//实际电阻值 |
| | | }else { |
| | | // 从 Redis 中获取列表数据 |
| | | Set<Object> objectList = RedisUtil.getZSetRange(refery, 0, -1,"DESC"); |
| | | Set<Object> objectList = RedisUtil.getZSetRange(refery+"."+device.getManagementNumber(), 0, -1,"DESC"); |
| | | list.addAll(objectList); |
| | | } |
| | | numberOfDataEntries.getAndIncrement(); |