|
|
@@ -115,6 +115,12 @@ public class StatisticsComparisonImageUtil {
|
|
|
buildServiceQualityDataRows(comparison.getServiceQualityData()));
|
|
|
}
|
|
|
|
|
|
+ // 绘制价目表排名数据
|
|
|
+ if (comparison.getPriceListRanking() != null && !comparison.getPriceListRanking().isEmpty()) {
|
|
|
+ currentY = drawPriceListRankingSection(g2d, currentY, "价目表排名",
|
|
|
+ comparison.getPriceListRanking());
|
|
|
+ }
|
|
|
+
|
|
|
g2d.dispose();
|
|
|
|
|
|
// 转换为字节数组
|
|
|
@@ -153,6 +159,10 @@ public class StatisticsComparisonImageUtil {
|
|
|
if (comparison.getServiceQualityData() != null) {
|
|
|
rowCount += 12; // 服务质量数据行数(12个字段)
|
|
|
}
|
|
|
+ if (comparison.getPriceListRanking() != null && !comparison.getPriceListRanking().isEmpty()) {
|
|
|
+ // 价目表数据:每个价目表3个指标(浏览量、访客数、分享数)
|
|
|
+ rowCount += comparison.getPriceListRanking().size() * 3;
|
|
|
+ }
|
|
|
|
|
|
height += rowCount * ROW_HEIGHT;
|
|
|
height += (rowCount / 6 + 4) * SECTION_SPACING; // 区块间距
|
|
|
@@ -631,6 +641,64 @@ public class StatisticsComparisonImageUtil {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 绘制价目表排名数据区块(特殊格式,每个价目表显示3个指标)
|
|
|
+ */
|
|
|
+ private static int drawPriceListRankingSection(Graphics2D g2d, int y, String sectionTitle,
|
|
|
+ List<StoreOperationalStatisticsComparisonVo.PriceListRankingComparison> rankings) {
|
|
|
+ if (rankings == null || rankings.isEmpty()) {
|
|
|
+ return y;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 绘制区块标题
|
|
|
+ Font sectionFont = new Font(FONT_NAME, Font.BOLD, SECTION_TITLE_FONT_SIZE);
|
|
|
+ g2d.setFont(sectionFont);
|
|
|
+ g2d.setColor(SECTION_TITLE_COLOR);
|
|
|
+ g2d.drawString(sectionTitle, PADDING, y);
|
|
|
+ y += 30;
|
|
|
+
|
|
|
+ Font dataFont = new Font(FONT_NAME, Font.PLAIN, DATA_FONT_SIZE);
|
|
|
+ Font labelFont = new Font(FONT_NAME, Font.PLAIN, LABEL_FONT_SIZE);
|
|
|
+
|
|
|
+ // 遍历每个价目表
|
|
|
+ for (StoreOperationalStatisticsComparisonVo.PriceListRankingComparison ranking : rankings) {
|
|
|
+ // 绘制价目表名称(作为子标题)
|
|
|
+ g2d.setFont(new Font(FONT_NAME, Font.BOLD, LABEL_FONT_SIZE));
|
|
|
+ g2d.setColor(new Color(66, 66, 66));
|
|
|
+ String priceListName = ranking.getPriceListItemName() != null ? ranking.getPriceListItemName() :
|
|
|
+ ("价目表ID: " + ranking.getPriceId());
|
|
|
+ g2d.drawString(priceListName, PADDING + 20, y);
|
|
|
+ y += 25;
|
|
|
+
|
|
|
+ // 绘制表头
|
|
|
+ y = drawTableHeader(g2d, y);
|
|
|
+
|
|
|
+ // 绘制该价目表的3个指标
|
|
|
+ List<DataRow> rows = new ArrayList<>();
|
|
|
+ if (ranking.getPageViews() != null) {
|
|
|
+ rows.add(new DataRow("浏览量", ranking.getPageViews().getCurrent(),
|
|
|
+ ranking.getPageViews().getPrevious(), ranking.getPageViews().getChangeRate()));
|
|
|
+ }
|
|
|
+ if (ranking.getVisitors() != null) {
|
|
|
+ rows.add(new DataRow("访客", ranking.getVisitors().getCurrent(),
|
|
|
+ ranking.getVisitors().getPrevious(), ranking.getVisitors().getChangeRate()));
|
|
|
+ }
|
|
|
+ if (ranking.getShares() != null) {
|
|
|
+ rows.add(new DataRow("分享数", ranking.getShares().getCurrent(),
|
|
|
+ ranking.getShares().getPrevious(), ranking.getShares().getChangeRate()));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 绘制数据行
|
|
|
+ for (DataRow row : rows) {
|
|
|
+ y = drawDataRow(g2d, y, row, dataFont, labelFont);
|
|
|
+ }
|
|
|
+
|
|
|
+ y += SECTION_SPACING / 2; // 价目表之间的间距
|
|
|
+ }
|
|
|
+
|
|
|
+ return y + SECTION_SPACING;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 数据行内部类
|
|
|
*/
|
|
|
private static class DataRow {
|