update:修复支付统计页面bug

This commit is contained in:
Yuan
2025-09-22 11:12:27 +08:00
parent f4b2e2a285
commit 9fb2ea9cb4
7 changed files with 442 additions and 41 deletions

View File

@@ -77,9 +77,9 @@ public class HISGetDataMethodByJH {
//全部支付方式
List<Dicinfo> pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE");
HashMap<String,String> payTypeMap=new HashMap<>();
HashMap<String, String> payTypeMap = new HashMap<>();
for (Dicinfo dicinfo : pay_type) {
payTypeMap.put( dicinfo.getDicname(),dicinfo.getDicvalue());
payTypeMap.put(dicinfo.getDicname(), dicinfo.getDicvalue());
}
//开始结束时间
@@ -164,8 +164,9 @@ public class HISGetDataMethodByJH {
tradingStatus="2";
}
//支付方式 修改为字典表对应
String payType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("payType"));
//支付方式 严格按照字典表转换
String originalPayType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("payType"));
String payType = convertPayTypeByDictionary(originalPayType, payTypeMap);
//交易时间
String tradeTime = StringDUtil.changeNullToEmpty(hisBillHashMap.get("tradeTime"));
@@ -346,4 +347,29 @@ public class HISGetDataMethodByJH {
responseMap.put("errMsg",errMsg);
return responseMap;
}
/**
* 严格按照字典表将HIS原始支付方式转换为标准的PayType编码
* @param originalPayType HIS原始支付方式
* @param payTypeMap 支付方式字典映射 (dicname -> dicvalue)
* @return 标准PayType编码
*/
private String convertPayTypeByDictionary(String originalPayType, HashMap<String, String> payTypeMap) {
if (originalPayType == null || originalPayType.trim().isEmpty()) {
return "4"; // 其他(根据用户自定义编码)
}
String payTypeName = originalPayType.trim();
// 严格按照字典表匹配四种支付方式
String payTypeValue = payTypeMap.get(payTypeName);
if (payTypeValue != null && !payTypeValue.isEmpty()) {
return payTypeValue;
}
// 如果字典表中没有精确匹配,记录日志并返回"其他"
log.warn("未在字典表中找到支付方式映射: [{}], 已转换为其他支付方式", payTypeName);
return "4"; // 其他(根据用户自定义编码)
}
}