|
|
@@ -4207,7 +4207,10 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
|
StringBuffer group = new StringBuffer("group by pr_kind, pr_kindid");
|
|
|
StringBuffer countSql = new StringBuffer("select count(pr_id) ").append(where);
|
|
|
+ long l = System.currentTimeMillis();
|
|
|
Integer totalRowCount = commonDao.queryForObject(countSql.toString(), Integer.class);
|
|
|
+ long l1 = System.currentTimeMillis();
|
|
|
+ logger.info("统计需要导出的数据耗时:" + (l1 - l));
|
|
|
|
|
|
StringBuffer sql = new StringBuffer("select pr_kind as thirdKind, pr_kindid as kindId, count(1) as count").append(where).append(group).append(" order by count desc limit %d, %d");
|
|
|
|
|
|
@@ -4219,13 +4222,17 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
@Override
|
|
|
public void writeExcelData(Sheet eachSheet, Integer startRowCount, Integer endRowCount, Integer currentPage, Integer pageSize) throws Exception {
|
|
|
Integer startNumber = (currentPage - 1) * ExcelConstant.PER_WRITE_ROW_COUNT;
|
|
|
+ long l2 = System.currentTimeMillis();
|
|
|
List<KindHierarchicalCount> kindHierarchicals = jdbcTemplate.query(String.format(sql.toString(), startNumber, pageSize), new BeanPropertyRowMapper<>(KindHierarchicalCount.class));
|
|
|
+ long l3 = System.currentTimeMillis();
|
|
|
+ logger.info("获取KindHierarchicalCount需要多少时间:" + (l3 - l2));
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
for (KindHierarchicalCount kindHierarchical : kindHierarchicals) {
|
|
|
if (kindHierarchical.getKindId() != null) {
|
|
|
ids.add(kindHierarchical.getKindId());
|
|
|
}
|
|
|
}
|
|
|
+ long l4 = System.currentTimeMillis();
|
|
|
Map<String, List<Long>> map = null;
|
|
|
for (int i = 0; (i < 3) && CollectionUtils.isNotEmpty(ids); i++) {
|
|
|
// i = 0 时表示 获取本级, = 1 时代表获取第二层,= 2 时代表获取顶层
|
|
|
@@ -4264,6 +4271,8 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ long l5 = System.currentTimeMillis();
|
|
|
+ logger.info("需要消耗的时间是:" + (l5 - l4));
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(kindHierarchicals)) {
|
|
|
for (int i = startRowCount; i <= endRowCount; i++) {
|