| | |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int upDeviceParameter(Device itemParameter) { |
| | | // 删除数采集配置数据 |
| | | dataConfigService.deleteDataConfig(); |
| | | // 需要同时更改 device表 |
| | | |
| | | |
| | | return deviceMapper.updateById(itemParameter); |
| | | } |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |
| | |
| | | DeviceMaintenance deviceMaintenance = deviceMaintenanceList.get(i); |
| | | DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | // 维修日期 |
| | | deviceMetricRecordAndMaintenanceDto.setMaintenanceDateString(deviceMaintenance.getDate().format(dateTimeFormatter)); |
| | | deviceMetricRecordAndMaintenanceDto.setMaintenanceDateString(deviceMaintenance.getMaintenanceDate().format(dateTimeFormatter)); |
| | | // 处理方法 |
| | | deviceMetricRecordAndMaintenanceDto.setHandlingMethod(deviceMaintenance.getContent()); |
| | | deviceMetricRecordAndMaintenanceDto.setHandlingMethod(deviceMaintenance.getMaintenanceContent()); |
| | | // 备注 |
| | | deviceMetricRecordAndMaintenanceDto.setComments(deviceMaintenance.getComments()); |
| | | deviceMetricRecordAndMaintenanceDto.setComments(deviceMaintenance.getRemark()); |
| | | } |
| | | |
| | | deviceMetricRecordAndMaintenanceDtoList.add(deviceMetricRecordAndMaintenanceDto); |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |