| | |
| | | if (rows > 0) { |
| | | List<ApsGasPipelinePrediction> list = new ArrayList<>(); |
| | | Set<String> keys = new HashSet<>(); |
| | | /*数据列从1开始*/ |
| | | /*数据行从1开始*/ |
| | | for (int i = rows; i > 0; --i) { |
| | | Row row = sheet.getRow(i); |
| | | if (row.getCell(0) == null) { |
| | |
| | | Iterator<ApsGasPipelinePrediction> it = list.iterator(); |
| | | while (it.hasNext()) { |
| | | ApsGasPipelinePrediction item = it.next(); |
| | | long count = facCodeKey.stream() |
| | | .filter(map -> map.get("key").equals(item.getKey())) |
| | | .peek(row -> { |
| | | item.setId((Long) row.get("id")); |
| | | item.setCreateBy(null); |
| | | item.setCreateTime(null); |
| | | item.setUpdateBy(SecurityUtils.getUsername()); |
| | | item.setUpdateTime(new Timestamp(System.currentTimeMillis())); |
| | | apsGasPipelinePredictionMapper.updateById(item); |
| | | }).count(); |
| | | int count = 0; |
| | | for (Map<String, Object> map : facCodeKey) { |
| | | if (map.get("key").equals(item.getKey())) { |
| | | item.setId((Long) map.get("id")); |
| | | item.setCreateBy(null); |
| | | item.setCreateTime(null); |
| | | item.setUpdateBy(SecurityUtils.getUsername()); |
| | | item.setUpdateTime(new Timestamp(System.currentTimeMillis())); |
| | | apsGasPipelinePredictionMapper.updateById(item); |
| | | count++; |
| | | } |
| | | } |
| | | if (count > 0){ |
| | | it.remove(); |
| | | } |