1
This commit is contained in:
@@ -589,6 +589,8 @@ public class TencentDocServiceImpl implements ITencentDocService {
|
||||
list = result.getJSONArray("sheets");
|
||||
}
|
||||
if (list == null) {
|
||||
log.debug("getSheetRowTotal 未找到 properties/sheets 列表 - fileId: {}, sheetId: {}, resultKeys: {}",
|
||||
fileId, sheetId, result != null ? result.keySet() : "null");
|
||||
return 0;
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -598,16 +600,21 @@ public class TencentDocServiceImpl implements ITencentDocService {
|
||||
continue;
|
||||
}
|
||||
String sid = props.getString("sheetId");
|
||||
if (!sheetId.equals(sid)) {
|
||||
if (sid == null || !sheetId.equals(sid)) {
|
||||
continue;
|
||||
}
|
||||
// rowTotal 可能为 rowTotal 或 row_total
|
||||
// rowTotal 可能为 rowTotal、row_total 或 rowCount(腾讯文档 API 多种返回格式)
|
||||
if (props.containsKey("rowTotal")) {
|
||||
return Math.max(0, props.getIntValue("rowTotal"));
|
||||
}
|
||||
if (props.containsKey("row_total")) {
|
||||
return Math.max(0, props.getIntValue("row_total"));
|
||||
}
|
||||
if (props.containsKey("rowCount")) {
|
||||
return Math.max(0, props.getIntValue("rowCount"));
|
||||
}
|
||||
log.debug("getSheetRowTotal 找到 sheetId 但无 rowTotal/rowCount - fileId: {}, sheetId: {}, propsKeys: {}",
|
||||
fileId, sheetId, props.keySet());
|
||||
}
|
||||
return 0;
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user