Browse Source

2.0.0 修改报表导入提示

feature/v.2.0.0
peihao 3 years ago
parent
commit
4b08cf2171
  1. 6
      air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java
  2. 2
      air/src/main/java/com/air/utils/ExcelUtil.java

6
air/src/main/java/com/air/land/service/impl/LandListedServiceImpl.java

@ -112,9 +112,10 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
dataList = ExcelUtil.importExcel(file.getInputStream(), 0, 1, 0, LandListed.class, "config/landListed-config.json");
} catch (Exception e) {
log.error("导入已挂牌地块数据出错", e);
throw new BusinessException("导入已挂牌地块数据出错");
throw new BusinessException(e.getMessage());
}
if (CollectionUtil.isNotEmpty(dataList)) {
try {
dataList.forEach(landListed -> {
landListed.setLandListedId(DateUtil.landListedIdfromDate(LocalDateTime.now(), "yyyyMMdd", this.selectId()));
//土地出让面积,计算土地出让面积(亩)(出让面积/2000*3)
@ -161,6 +162,9 @@ public class LandListedServiceImpl extends ServiceImpl<LandListedMapper, LandLis
.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
}
});
} catch (Exception e) {
log.error("数据计算出错:",e);
}
}
return this.saveBatch(dataList);
}

2
air/src/main/java/com/air/utils/ExcelUtil.java

@ -155,7 +155,7 @@ public class ExcelUtil {
map.put(excelConfig.getFieldName(), value);
} catch (Exception e) {
log.error("解析出错:", e);
throw new BusinessException("第" + i + "行,第" + excelConfig.getFieldName() + "列数据解析出现错误");
throw new BusinessException("第" + (i+1) + "行,第" + excelConfig.getTitleName() + "列数据解析出现错误");
}
}
mapList.add(map);

Loading…
Cancel
Save