| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Override |
| | | public Result<?> dataAcquisition(HttpServletRequest request, DeviceCollectionDto dto) { |
| | | |
| | | |
| | | |
| | | // 查询检验项 |
| | | List<Integer> itemIds = dto.getItemIds(); |
| | | if (CollectionUtils.isEmpty(itemIds)) { |
| | |
| | | // 数采返回信息 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | for (Device device : deviceList) { |
| | | |
| | | Device device1 = deviceMapper.selectById(device.getId()); |
| | | dto.setDbUserName(device1.getDbUserName()); |
| | | dto.setDbPassword(device1.getDbPassword()); |
| | | String ip = device.getIp(); |
| | | |
| | | // 根据检验项获取config |
| | | List<DataConfig> list = dataConfigService.list(Wrappers.<DataConfig>lambdaQuery() |
| | | .in(DataConfig::getStructureItemParameterId, itemParameterIds) |
| | |
| | | // 判断设备是否是数字直桥JCZX-ZB-ER02022 |
| | | if (device.getManagementNumber().equals("JCZX-ZB-ER02022")) { |
| | | map.putAll(dataCollectBridge(list, device, dto.getEntrustCode())); |
| | | // list:包含设备配置信息的 DataConfig 列表。 |
| | | // device:当前的设备对象。 |
| | | // dto.getEntrustCode():从 DeviceCollectionDto 对象中获取的委托编码 |
| | | |
| | | } else { |
| | | map.putAll(DataAcquisition.dataAcquisitionEntrance(list, device, dto.getEntrustCode(), dto.getEntrustCode(), ip, insProducts.get(0).getCableTag())); |
| | | // list:包含设备配置信息的 DataConfig 列表。 |
| | | // device:当前的设备对象。 |
| | | // dto.getEntrustCode():委托编码,此处传入两次。 |
| | | // ip:当前设备的 IP 地址。 |
| | | // insProducts.get(0).getCableTag():从 insProducts 列表的第一个元素中获取的电缆标签 |
| | | map.putAll(DataAcquisition.dataAcquisitionEntrance(list, device, dto.getEntrustCode(), dto.getEntrustCode(), ip, insProducts.get(0).getCableTag(),dto.getDbUserName(),dto.getDbPassword())); |
| | | |
| | | } |
| | | } |
| | | |