update:建行龙支付对账

This commit is contained in:
Yuan
2025-11-03 11:42:55 +08:00
parent 34065c1c8b
commit 3b60a2d495
2 changed files with 28 additions and 26 deletions

View File

@@ -599,19 +599,13 @@ public class BankGetDataMethodByJHLZF {
if (dateTimeParts.length == 2) {
jyrq = dateTimeParts[0]; // 日期部分
jysj = dateTimeParts[1]; // 时间部分
log.info("从日期列提取时间 - 日期: [" + jyrq + "], 时间: [" + jysj + "]");
}
} else {
// 如果还是空,设置默认值
jysj = "00:00:00";
log.debug("交易时间为空,设置默认值: 00:00:00");
}
}
// 调试日志:输出交易日期、时间和支付方式
String debugZffs = s1.length > 16 ? s1[16] : "";
log.info("" + (i + 1) + " 行 - 交易日期(列13): [" + jyrq + "], 交易时间(列15): [" + jysj + "], 支付方式(列16): [" + debugZffs + "]");
bankbillHistory.setCJyrq(jyrq); // N列(索引13): 交易日期
bankbillHistory.setCJysj(jysj); // P列(索引15): 交易时间
bankbillHistory.setCJyje(s1.length > 20 ? s1[20] : "0"); // U列(索引20): 交易金额
@@ -654,8 +648,7 @@ public class BankGetDataMethodByJHLZF {
// EFGH列(索引4): 发卡行
bankbillHistory.setCFkh(s1.length > 4 ? s1[4] : ""); // 发卡行
// 支付方式固定为"建行龙支付"
bankbillHistory.setCZffs("建行龙支付"); // 支付方式
// 支付方式已经在前面设置从第16列读取这里不再覆盖
// VW列(索引21): 小费
bankbillHistory.setCSxf(s1.length > 21 ? s1[21] : "0"); // 小费
@@ -1201,8 +1194,21 @@ public class BankGetDataMethodByJHLZF {
try {
// 使用SimpleDateFormat格式化日期时间
java.util.Date dateValue = cell.getDateCellValue();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
cellValue = sdf.format(dateValue);
// 检查是否只有时间日期部分为1899-12-31或1900-01-01
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.setTime(dateValue);
int year = cal.get(java.util.Calendar.YEAR);
if (year == 1899 || year == 1900) {
// 只有时间,格式化为 HH:mm:ss
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("HH:mm:ss");
cellValue = sdf.format(dateValue);
} else {
// 完整的日期时间,格式化为 yyyy-MM-dd HH:mm:ss
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
cellValue = sdf.format(dateValue);
}
} catch (Exception e) {
cellValue = cell.getDateCellValue().toString();
}