update:建行账单接入
This commit is contained in:
@@ -43,4 +43,9 @@ public interface HisDetailMapper {
|
||||
void insertAllHisBillOriginalHY(List<HashMap<Object, Object>> addList) throws Exception;
|
||||
|
||||
List<HashMap<Object, Object>> findMedicalInsuranceGroupData(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询有自费金额的HIS账单记录(用于混合支付对账)
|
||||
*/
|
||||
List<HashMap<Object, Object>> findHisDetailWithZfAmount(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
@@ -75,4 +75,14 @@ public interface TransactionDetailMapper {
|
||||
void deleteHisAndThirdJoinDataByParamAndNotUnique(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
void addNotUniqueData(List<HashMap<Object, Object>> list) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据三方信息更新关联表记录(用于自费对账自动核销)
|
||||
*/
|
||||
void updateJoinDateByThird(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据三方信息删除关联表记录
|
||||
*/
|
||||
void deleteJoinDataByThird(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
@@ -28,4 +28,14 @@ public interface UnilateralMapper {
|
||||
void deleteUnilateralByJoinIdNotNull(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
void deleteUnilateralByIdandStatus(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据ID更新单边账记录(用于自费对账自动核销)
|
||||
*/
|
||||
void updateUnilateralById(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据ID删除单边账记录
|
||||
*/
|
||||
void deleteUnilateralById(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -140,10 +140,6 @@ public class HISGetDataMethodByJH {
|
||||
//将原始的转换成统一格式
|
||||
List<HashMap<Object,Object>> newAddList= new ArrayList<>();
|
||||
|
||||
List<HashMap<Object,Object>> cashList= new ArrayList<>();
|
||||
|
||||
List<HashMap<Object,Object>> zhipiaoList= new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < hisBillList.size(); i++) {
|
||||
HashMap<Object, Object> hisBillHashMap = hisBillList.get(i);
|
||||
|
||||
@@ -158,11 +154,12 @@ public class HISGetDataMethodByJH {
|
||||
String amount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("amount"));
|
||||
String tradeTime = StringDUtil.changeNullToEmpty(hisBillHashMap.get("tradeTime"));
|
||||
|
||||
// 提取新增字段:清算类别、险种类型、医保账户金额、医保统筹金额
|
||||
// 提取新增字段:清算类别、险种类型、医保账户金额、医保统筹金额、自费金额
|
||||
String clrType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("clrType"));
|
||||
String insutype = StringDUtil.changeNullToEmpty(hisBillHashMap.get("insutype"));
|
||||
String ybzhAmount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("ybzhAmount"));
|
||||
String ybtcAmount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("ybtcAmount"));
|
||||
String zfAmount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("zfAmount"));
|
||||
|
||||
// 只有当缺少关键业务信息时才跳过(患者ID、金额、交易时间都为空)
|
||||
if ("".equals(patientId) && "".equals(amount) && "".equals(tradeTime)){
|
||||
@@ -232,104 +229,12 @@ public class HISGetDataMethodByJH {
|
||||
addMap.put("insutype",insutype); // 险种类型
|
||||
addMap.put("ybzhAmount",ybzhAmount); // 医保账户金额
|
||||
addMap.put("ybtcAmount",ybtcAmount); // 医保统筹金额
|
||||
addMap.put("zfAmount",zfAmount); // 自费金额(混合支付中的自费部分)
|
||||
|
||||
//如果是现金记录先放进现金集合内
|
||||
if (cash_code.equals(payType)){
|
||||
cashList.add(addMap);
|
||||
}else if (zhipiao.equals(payType)){
|
||||
zhipiaoList.add(addMap);
|
||||
}else{
|
||||
newAddList.add(addMap);
|
||||
}
|
||||
}
|
||||
|
||||
//循环现金记录 合并同操作员同交易日期 同类别的(门诊,住院) his获取,记录应该就是前一天的。
|
||||
HashMap<String,HashMap<Object,Object>> cashMap=new HashMap<>();
|
||||
for (int i = 0; i < cashList.size(); i++) {
|
||||
HashMap<Object, Object> hashMap = cashList.get(i);
|
||||
|
||||
String hisOperCode = StringDUtil.changeNullToEmpty(hashMap.get("hisOperCode"));
|
||||
String payMethod = StringDUtil.changeNullToEmpty(hashMap.get("payMethod"));
|
||||
String amount = StringDUtil.changeNullToEmpty(hashMap.get("amount"));
|
||||
|
||||
HashMap<Object, Object> map = cashMap.get(hisOperCode+"_"+payMethod);
|
||||
|
||||
if (map==null){
|
||||
HashMap<Object,Object> addMap=new HashMap<>();
|
||||
addMap.put("payMethod",payMethod);
|
||||
addMap.put("tradingStatus","");
|
||||
addMap.put("bizType","");
|
||||
addMap.put("payType",cash_code);
|
||||
addMap.put("tradeTime",trade_date+" 00:00:00");
|
||||
addMap.put("hisOperCode",hisOperCode);
|
||||
addMap.put("amount",amount);
|
||||
addMap.put("remarks","");
|
||||
addMap.put("platformTransId","");
|
||||
addMap.put("patientId","");
|
||||
addMap.put("patientName","");
|
||||
addMap.put("trade_date",trade_date);
|
||||
addMap.put("his_wsdl_id",his_wsdl_id);
|
||||
addMap.put("clrType",""); // 现金记录没有清算类别
|
||||
addMap.put("insutype",""); // 现金记录没有险种类型
|
||||
addMap.put("ybzhAmount","0"); // 现金记录没有医保账户金额
|
||||
addMap.put("ybtcAmount","0"); // 现金记录没有医保统筹金额
|
||||
|
||||
cashMap.put(hisOperCode+"_"+payMethod,addMap);
|
||||
}else {
|
||||
String oldAmount = StringDUtil.changeNullToEmpty(map.get("amount"));
|
||||
String newAmount = new BigDecimal(oldAmount).add(new BigDecimal(amount)).toString();
|
||||
map.put("amount",newAmount);
|
||||
}
|
||||
}
|
||||
|
||||
//循环map 把记录放入要添加的集合
|
||||
for (String key:cashMap.keySet()){
|
||||
newAddList.add(cashMap.get(key));
|
||||
}
|
||||
|
||||
//循环支票的记录 和现金相同处理
|
||||
HashMap<String,HashMap<Object,Object>> zhipiaoMap=new HashMap<>();
|
||||
for (int i = 0; i < zhipiaoList.size(); i++) {
|
||||
HashMap<Object, Object> hashMap = zhipiaoList.get(i);
|
||||
|
||||
String hisOperCode = StringDUtil.changeNullToEmpty(hashMap.get("hisOperCode"));
|
||||
String payMethod = StringDUtil.changeNullToEmpty(hashMap.get("payMethod"));
|
||||
String amount = StringDUtil.changeNullToEmpty(hashMap.get("amount"));
|
||||
String payType = StringDUtil.changeNullToEmpty(hashMap.get("payType"));
|
||||
|
||||
HashMap<Object, Object> map = zhipiaoMap.get(hisOperCode+"_"+payMethod);
|
||||
|
||||
if (map==null){
|
||||
HashMap<Object,Object> addMap=new HashMap<>();
|
||||
addMap.put("payMethod",payMethod);
|
||||
addMap.put("tradingStatus","");
|
||||
addMap.put("bizType","");
|
||||
addMap.put("payType",payType);
|
||||
addMap.put("tradeTime",trade_date+" 00:00:00");
|
||||
addMap.put("hisOperCode",hisOperCode);
|
||||
addMap.put("amount",amount);
|
||||
addMap.put("remarks","");
|
||||
addMap.put("platformTransId","");
|
||||
addMap.put("patientId","");
|
||||
addMap.put("patientName","");
|
||||
addMap.put("trade_date",trade_date);
|
||||
addMap.put("his_wsdl_id",his_wsdl_id);
|
||||
addMap.put("clrType",""); // 支票记录没有清算类别
|
||||
addMap.put("insutype",""); // 支票记录没有险种类型
|
||||
addMap.put("ybzhAmount","0"); // 支票记录没有医保账户金额
|
||||
addMap.put("ybtcAmount","0"); // 支票记录没有医保统筹金额
|
||||
|
||||
zhipiaoMap.put(hisOperCode+"_"+payMethod,addMap);
|
||||
}else {
|
||||
String oldAmount = StringDUtil.changeNullToEmpty(map.get("amount"));
|
||||
String newAmount = new BigDecimal(oldAmount).add(new BigDecimal(amount)).toString();
|
||||
map.put("amount",newAmount);
|
||||
}
|
||||
}
|
||||
|
||||
//循环map 把记录放入要添加的集合
|
||||
for (String key:zhipiaoMap.keySet()){
|
||||
newAddList.add(zhipiaoMap.get(key));
|
||||
// 不再合并现金和支票记录,直接保留原始数据
|
||||
// 因为有些医保账户余额不足时会用现金支付,但仍然属于医保相关记录
|
||||
// 合并会导致清算类别(clrType)和险种(insutype)信息丢失
|
||||
newAddList.add(addMap);
|
||||
}
|
||||
|
||||
//存一份his针对要调整的字段修改的
|
||||
|
||||
@@ -799,6 +799,9 @@ public class ReconciliationMethod {
|
||||
|
||||
//!!!!
|
||||
managerReconciliation(transactionDetailService, searchMap);
|
||||
|
||||
// 处理混合支付中的自费部分对账
|
||||
processZfAmountReconciliation(transactionDetailService, unilateralService, searchMap, trade_date);
|
||||
} else {
|
||||
errCode = "999";
|
||||
errMsg = "生成对账信息失败,原因:his或三方有记录没有获取到。";
|
||||
@@ -952,5 +955,113 @@ public class ReconciliationMethod {
|
||||
reconciliationResultService.insertReconciliationResult(addMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理混合支付中自费部分与三方的对账
|
||||
* @description: 当HIS账单中zfAmount不为0时,使用该金额与三方账单进行对账,匹配成功则消除对应的三方单边账
|
||||
* @author thuang
|
||||
* @date 2025/10/27
|
||||
* @version 1.0
|
||||
*/
|
||||
public static void processZfAmountReconciliation(TransactionDetailService transactionDetailService,
|
||||
UnilateralService unilateralService,
|
||||
HashMap<Object, Object> searchMap,
|
||||
String trade_date) throws Exception {
|
||||
|
||||
// 1. 查询当日有zfAmount且不为0的HIS账单
|
||||
HisDetailService hisDetailService = GetBeanUtil.getBean(HisDetailServiceImpl.class);
|
||||
HashMap<Object, Object> zfAmountSearchMap = new HashMap<>();
|
||||
zfAmountSearchMap.put("trade_date", trade_date);
|
||||
zfAmountSearchMap.put("has_zf_amount", "1"); // 标识查询有自费金额的记录
|
||||
|
||||
List<HashMap<Object, Object>> hisZfAmountList = hisDetailService.findHisDetailWithZfAmount(zfAmountSearchMap);
|
||||
|
||||
if (hisZfAmountList == null || hisZfAmountList.size() == 0) {
|
||||
System.out.println("当日没有自费金额记录,跳过zfAmount对账");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("开始处理自费金额对账,共" + hisZfAmountList.size() + "条记录");
|
||||
|
||||
// 2. 查询当日的三方单边账
|
||||
HashMap<Object, Object> thirdUnilateralSearchMap = new HashMap<>();
|
||||
thirdUnilateralSearchMap.put("trade_date", trade_date);
|
||||
thirdUnilateralSearchMap.put("err_type", "2"); // 三方单边账
|
||||
thirdUnilateralSearchMap.put("is_manager", "0"); // 未处理的
|
||||
|
||||
List<HashMap<Object, Object>> thirdUnilateralList = unilateralService.findUnilateralByParam(thirdUnilateralSearchMap);
|
||||
|
||||
if (thirdUnilateralList == null || thirdUnilateralList.size() == 0) {
|
||||
System.out.println("当日没有三方单边账,跳过zfAmount对账");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("当日三方单边账共" + thirdUnilateralList.size() + "条");
|
||||
|
||||
int matchedCount = 0;
|
||||
|
||||
// 3. 遍历每条有自费金额的HIS记录(包括正数和负数)
|
||||
for (HashMap<Object, Object> hisRecord : hisZfAmountList) {
|
||||
String zfAmount = StringDUtil.changeNullToEmpty(hisRecord.get("ZFAMOUNT"));
|
||||
String platformTransId = StringDUtil.changeNullToEmpty(hisRecord.get("PLATFORMTRANSID"));
|
||||
String tradingStatus = StringDUtil.changeNullToEmpty(hisRecord.get("TRADINGSTATUS"));
|
||||
|
||||
// 跳过金额为0的记录,但保留负数
|
||||
if ("".equals(zfAmount) || "0".equals(zfAmount) || "0.00".equals(zfAmount)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
BigDecimal amount = new BigDecimal(zfAmount);
|
||||
if (amount.abs().compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 4. 在三方单边账中查找所有匹配的记录(同一订单号可能有一正一负)
|
||||
Iterator<HashMap<Object, Object>> iterator = thirdUnilateralList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
HashMap<Object, Object> thirdRecord = iterator.next();
|
||||
String thirdAmount = StringDUtil.changeNullToEmpty(thirdRecord.get("I_JYJE"));
|
||||
String thirdOrderNo = StringDUtil.changeNullToEmpty(thirdRecord.get("I_DDH"));
|
||||
String thirdTradingType = StringDUtil.changeNullToEmpty(thirdRecord.get("I_JYLX"));
|
||||
String unilateralId = StringDUtil.changeNullToEmpty(thirdRecord.get("ID"));
|
||||
|
||||
// 检查金额是否匹配(绝对值相等)
|
||||
boolean amountMatch = AmountUtil.isAmountEqual(zfAmount, thirdAmount);
|
||||
|
||||
// 检查订单号和交易类型是否都匹配
|
||||
boolean orderMatch = platformTransId.equals(thirdOrderNo) && tradingStatus.equals(thirdTradingType);
|
||||
|
||||
if (amountMatch && orderMatch) {
|
||||
// 找到匹配的记录,直接删除单边账和关联表记录
|
||||
System.out.println("找到匹配记录并删除 - HIS自费金额: " + zfAmount + ", 三方金额: " + thirdAmount +
|
||||
", 订单号: " + platformTransId + " = " + thirdOrderNo + ", 交易类型: " + tradingStatus);
|
||||
|
||||
// 5. 直接删除三方单边账记录
|
||||
HashMap<Object, Object> deleteMap = new HashMap<>();
|
||||
deleteMap.put("id", unilateralId);
|
||||
unilateralService.deleteUnilateralById(deleteMap);
|
||||
|
||||
// 6. 删除关联表中对应的三方记录
|
||||
HashMap<Object, Object> deleteJoinMap = new HashMap<>();
|
||||
deleteJoinMap.put("i_ddh", thirdOrderNo);
|
||||
deleteJoinMap.put("i_jylx", thirdTradingType);
|
||||
deleteJoinMap.put("trade_date", trade_date);
|
||||
transactionDetailService.deleteJoinDataByThird(deleteJoinMap);
|
||||
|
||||
matchedCount++;
|
||||
|
||||
// 从列表中移除已匹配的记录
|
||||
iterator.remove();
|
||||
// 不使用break,继续查找同一订单号的其他记录(如一正一负)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("自费金额对账完成,成功匹配并删除 " + matchedCount + " 条单边账记录");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,4 +32,9 @@ public interface HisDetailService {
|
||||
List<HashMap<Object, Object>> findHisDetailCountData(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
List<HashMap<Object, Object>> findMedicalInsuranceGroupData(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询有自费金额的HIS账单记录(用于混合支付对账)
|
||||
*/
|
||||
List<HashMap<Object, Object>> findHisDetailWithZfAmount(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
@@ -78,4 +78,14 @@ public interface TransactionDetailService {
|
||||
* @version 1.0
|
||||
*/
|
||||
void addNotUniqueData(List<HashMap<Object, Object>> list) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据三方信息更新关联表记录(用于自费对账自动核销)
|
||||
*/
|
||||
void updateJoinDateByThird(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据三方信息删除关联表记录
|
||||
*/
|
||||
void deleteJoinDataByThird(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
@@ -26,4 +26,14 @@ public interface UnilateralService {
|
||||
void deleteUnilateralByJoinIdNotNull(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
void deleteUnilateralByIdandStatus(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据ID更新单边账记录(用于自费对账自动核销)
|
||||
*/
|
||||
void updateUnilateralById(HashMap<Object, Object> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 根据ID删除单边账记录
|
||||
*/
|
||||
void deleteUnilateralById(HashMap<Object, Object> map) throws Exception;
|
||||
}
|
||||
|
||||
@@ -119,6 +119,43 @@ public class BankbillHistoryServiceImpl implements BankbillHistoryService {
|
||||
zffs = payMethodMap.get("掌医支付");
|
||||
bankbillHistory.setCZffs(zffs);
|
||||
}
|
||||
else if ("建行龙支付对账单".equals(billTableName)){
|
||||
// 建行龙支付对账单的支付方式映射
|
||||
if (cZffs != null && !cZffs.trim().isEmpty()) {
|
||||
String cZffsLower = cZffs.trim();
|
||||
|
||||
// 优先精确匹配
|
||||
zffs = payMethodMap.get(cZffsLower);
|
||||
|
||||
// 如果精确匹配失败,进行模糊匹配
|
||||
if (zffs == null) {
|
||||
// 根据支付方式名称映射到字典值(按优先级匹配)
|
||||
if (cZffsLower.contains("微信退款")) {
|
||||
zffs = payMethodMap.get("微信退款");
|
||||
} else if (cZffsLower.contains("支付宝退款")) {
|
||||
zffs = payMethodMap.get("支付宝退款");
|
||||
} else if (cZffsLower.contains("微信")) {
|
||||
zffs = payMethodMap.get("微信支付");
|
||||
} else if (cZffsLower.contains("支付宝")) {
|
||||
zffs = payMethodMap.get("支付宝支付");
|
||||
} else if (cZffsLower.contains("云闪付")) {
|
||||
zffs = payMethodMap.get("云闪付支付");
|
||||
} else if (cZffsLower.contains("刷卡") || cZffsLower.contains("银联") || cZffsLower.contains("银行卡")) {
|
||||
zffs = payMethodMap.get("刷卡支付");
|
||||
} else {
|
||||
// 都匹配不到,使用其他支付
|
||||
zffs = payMethodMap.get("其他支付");
|
||||
}
|
||||
}
|
||||
|
||||
// 添加调试日志
|
||||
org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass());
|
||||
log.info("建行龙支付映射 - 原始支付方式: [" + cZffsLower + "], 映射后字典值: [" + zffs + "]");
|
||||
} else {
|
||||
zffs = payMethodMap.get("其他支付");
|
||||
}
|
||||
bankbillHistory.setCZffs(zffs);
|
||||
}
|
||||
else{
|
||||
if (zffs==null){
|
||||
zffs = payMethodMap.get("其他支付");
|
||||
|
||||
@@ -184,4 +184,9 @@ public class HisDetailServiceImpl implements HisDetailService {
|
||||
return hisDetailMapper.findMedicalInsuranceGroupData(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<Object, Object>> findHisDetailWithZfAmount(HashMap<Object, Object> map) throws Exception {
|
||||
return hisDetailMapper.findHisDetailWithZfAmount(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -164,5 +164,15 @@ public class TransactionDetailServiceImpl implements TransactionDetailService {
|
||||
transactionDetailMapper.addNotUniqueData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJoinDateByThird(HashMap<Object, Object> map) throws Exception {
|
||||
transactionDetailMapper.updateJoinDateByThird(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteJoinDataByThird(HashMap<Object, Object> map) throws Exception {
|
||||
transactionDetailMapper.deleteJoinDataByThird(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -76,4 +76,14 @@ public class UnilateralServiceImpl implements UnilateralService {
|
||||
public void deleteUnilateralByIdandStatus(HashMap<Object, Object> map) throws Exception {
|
||||
unilateralMapper.deleteUnilateralByIdandStatus(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUnilateralById(HashMap<Object, Object> map) throws Exception {
|
||||
unilateralMapper.updateUnilateralById(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUnilateralById(HashMap<Object, Object> map) throws Exception {
|
||||
unilateralMapper.deleteUnilateralById(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,43 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询有自费金额的HIS账单记录 -->
|
||||
<select id="findHisDetailWithZfAmount" parameterType="HashMap" resultType="HashMap">
|
||||
select
|
||||
PayMethod,
|
||||
TradingStatus,
|
||||
BizType,
|
||||
PayType,
|
||||
TradeTime,
|
||||
HisOperCode,
|
||||
Amount,
|
||||
zfAmount,
|
||||
PlatformTransId,
|
||||
PatientId,
|
||||
PatientName,
|
||||
trade_date,
|
||||
his_wsdl_id,
|
||||
HisTransId,
|
||||
clr_type,
|
||||
insutype,
|
||||
ybzhAmount,
|
||||
ybtcAmount
|
||||
from hisbill_history
|
||||
<where>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date = #{trade_date}
|
||||
</if>
|
||||
<if test="has_zf_amount!=null and has_zf_amount!=''">
|
||||
and zfAmount is not null
|
||||
and zfAmount != ''
|
||||
and zfAmount != '0'
|
||||
and zfAmount != '0.00'
|
||||
and ABS(CAST(zfAmount AS DECIMAL(18,2))) > 0
|
||||
</if>
|
||||
</where>
|
||||
order by TradeTime, PlatformTransId
|
||||
</select>
|
||||
|
||||
<delete id="deleteHisBillOriginalByParam" parameterType="HashMap">
|
||||
delete from hisbill_original where trade_date=#{trade_date}
|
||||
</delete>
|
||||
@@ -114,12 +151,12 @@
|
||||
|
||||
<insert id="insertAllHisBillHistory" parameterType="java.util.List">
|
||||
insert into
|
||||
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount)
|
||||
hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId,clr_type,insutype,ybzhAmount,ybtcAmount,zfAmount)
|
||||
values
|
||||
<foreach collection="list" index="index" item="itm" separator=",">
|
||||
(
|
||||
#{itm.payMethod},#{itm.tradingStatus},#{itm.bizType},#{itm.payType},#{itm.tradeTime},#{itm.hisOperCode},#{itm.amount},#{itm.remarks},#{itm.platformTransId},#{itm.patientId}
|
||||
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId},#{itm.clrType},#{itm.insutype},#{itm.ybzhAmount},#{itm.ybtcAmount}
|
||||
,#{itm.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId},#{itm.clrType},#{itm.insutype},#{itm.ybzhAmount},#{itm.ybtcAmount},#{itm.zfAmount}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -4,17 +4,31 @@
|
||||
|
||||
|
||||
<select id="findReconciliationResultPageList" parameterType="HashMap" resultType="HashMap">
|
||||
select trade_date,third_money,his_money,difference,third_unilateral,his_unilateral,manager_history_unilateral,today_unilateral,unilateral_num,pending_unilateral,pending_unilateral_num,status,area
|
||||
,(case status when '1' then '通过' else '不通过' end) as status_str
|
||||
select DISTINCT
|
||||
trade_date,
|
||||
third_money,
|
||||
his_money,
|
||||
difference,
|
||||
third_unilateral,
|
||||
his_unilateral,
|
||||
manager_history_unilateral,
|
||||
today_unilateral,
|
||||
unilateral_num,
|
||||
pending_unilateral,
|
||||
pending_unilateral_num,
|
||||
status,
|
||||
area,
|
||||
(case status when '1' then '通过' else '不通过' end) as status_str
|
||||
from reconciliation_result
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <#{endTime}
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by trade_date desc
|
||||
</select>
|
||||
|
||||
<insert id="insertReconciliationResult" parameterType="HashMap">
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
inner join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -151,6 +154,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
left join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -186,6 +192,9 @@
|
||||
<if test="military_code != null and military_code != ''">
|
||||
and payType!=#{military_code}
|
||||
</if>
|
||||
<if test="medical_insurance_code != null and medical_insurance_code != ''">
|
||||
and payType!=#{medical_insurance_code}
|
||||
</if>
|
||||
) a
|
||||
right join
|
||||
(select * from bankbill_history where C_JYRQ = #{trade_date}) b
|
||||
@@ -428,7 +437,23 @@
|
||||
where HisOperCode = #{hisOperCode}
|
||||
and trade_date = #{trade_date}
|
||||
and PayType = #{payType}
|
||||
and payMethod = #{payMethod}
|
||||
</update>
|
||||
|
||||
<!-- 根据三方信息更新关联表记录(用于自费对账自动核销) -->
|
||||
<update id="updateJoinDateByThird" parameterType="HashMap">
|
||||
update third_join_his
|
||||
set check_result=#{check_result}
|
||||
<where>
|
||||
<if test="i_ddh!=null and i_ddh!=''">
|
||||
and I_DDH=#{i_ddh}
|
||||
</if>
|
||||
<if test="i_jylx!=null and i_jylx!=''">
|
||||
and I_JYLX=#{i_jylx}
|
||||
</if>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date=#{trade_date}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="updateJoinSetActiveByZhiPiao" parameterType="HashMap">
|
||||
@@ -440,6 +465,21 @@
|
||||
and payMethod = #{payMethod}
|
||||
</update>
|
||||
|
||||
<delete id="deleteJoinDataByThird" parameterType="HashMap">
|
||||
delete from third_join_his
|
||||
<where>
|
||||
<if test="i_ddh!=null and i_ddh!=''">
|
||||
and I_DDH=#{i_ddh}
|
||||
</if>
|
||||
<if test="i_jylx!=null and i_jylx!=''">
|
||||
and I_JYLX=#{i_jylx}
|
||||
</if>
|
||||
<if test="trade_date!=null and trade_date!=''">
|
||||
and trade_date=#{trade_date}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<select id="findAllBankDetailNum" parameterType="HashMap" resultType="HashMap">
|
||||
select count(1) as num
|
||||
from third_join_his
|
||||
|
||||
@@ -202,6 +202,29 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据ID更新单边账记录 -->
|
||||
<update id="updateUnilateralById" parameterType="HashMap">
|
||||
update unmanger_unilateral
|
||||
<set>
|
||||
<if test="is_manager!=null and is_manager!=''">
|
||||
is_manager=#{is_manager},
|
||||
</if>
|
||||
<if test="manager_time!=null and manager_time!=''">
|
||||
manager_time=#{manager_time},
|
||||
</if>
|
||||
<if test="remark!=null and remark!=''">
|
||||
remark=#{remark},
|
||||
</if>
|
||||
<if test="modify_time!=null and modify_time!=''">
|
||||
modify_time=#{modify_time},
|
||||
</if>
|
||||
<if test="managerType!=null and managerType!=''">
|
||||
managerType=#{managerType}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUnilateralByJoinIdNotNull" parameterType="HashMap">
|
||||
delete
|
||||
from unmanger_unilateral
|
||||
@@ -217,4 +240,8 @@
|
||||
and TranID = #{tranID}
|
||||
and H_JYLX = #{h_jylx}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUnilateralById" parameterType="HashMap">
|
||||
delete from unmanger_unilateral where id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -3,21 +3,54 @@
|
||||
<mapper namespace="com.saye.hospitalgd.mapper.historyLog.ReconciliationLogMapper">
|
||||
|
||||
<select id="findReconciliationLogPageList" parameterType="HashMap" resultType="HashMap">
|
||||
select trade_date,modify_time,create_time,manager_num,status,user_name,remark
|
||||
from reconciliation_info
|
||||
|
||||
<where>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
and status=#{status}
|
||||
</if>
|
||||
</where>
|
||||
order by trade_date desc
|
||||
select
|
||||
t.trade_date as TRADE_DATE,
|
||||
t.modify_time as MODIFY_TIME,
|
||||
t.create_time as CREATE_TIME,
|
||||
t.manager_num as MANAGER_NUM,
|
||||
t.status as STATUS,
|
||||
t.user_name as USER_NAME,
|
||||
t.remark as REMARK
|
||||
from (
|
||||
select
|
||||
trade_date,
|
||||
modify_time,
|
||||
create_time,
|
||||
manager_num,
|
||||
status,
|
||||
user_name,
|
||||
remark,
|
||||
ROW_NUMBER() OVER (PARTITION BY trade_date ORDER BY create_time DESC) as rn
|
||||
from reconciliation_info
|
||||
<where>
|
||||
<!-- 确保trade_date是有效的日期格式 -->
|
||||
and trade_date is not null
|
||||
and trade_date != ''
|
||||
and trade_date REGEXP '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
|
||||
<!-- 确保status是有效值 -->
|
||||
and status in ('0', '1')
|
||||
<!-- 确保manager_num是整数且不包含小数点(排除金额数据) -->
|
||||
and manager_num is not null
|
||||
and manager_num not like '%.%'
|
||||
and manager_num REGEXP '^[0-9]+$'
|
||||
and CAST(manager_num AS UNSIGNED) < 10000
|
||||
<!-- 确保时间字段不包含小数点(排除金额数据) -->
|
||||
and (modify_time is null or modify_time not like '%.%')
|
||||
and (create_time is null or create_time not like '%.%')
|
||||
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and trade_date >=#{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
and trade_date <=#{endTime}
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
and status=#{status}
|
||||
</if>
|
||||
</where>
|
||||
) t
|
||||
where t.rn = 1
|
||||
order by t.trade_date desc
|
||||
</select>
|
||||
|
||||
<select id="findReconciliationLogByParam" parameterType="HashMap" resultType="HashMap">
|
||||
|
||||
@@ -117,7 +117,21 @@
|
||||
cols: [
|
||||
[
|
||||
// {field:'AREA',title: '院区', align:'center',rowspan:2,width:120,totalRowText:'合计'},
|
||||
{field: 'TRADE_DATE', title: '日期', align: 'center', rowspan: 2, width: 120, totalRowText: ''},
|
||||
{
|
||||
field: 'TRADE_DATE',
|
||||
title: '日期',
|
||||
align: 'center',
|
||||
rowspan: 2,
|
||||
width: 120,
|
||||
totalRowText: '合计',
|
||||
templet: function(d) {
|
||||
// Layui合计行的特征:TOTAL_NUMS字段存在
|
||||
if (d.TOTAL_NUMS !== undefined) {
|
||||
return '<span style="font-weight: bold; color: #333;">合计</span>';
|
||||
}
|
||||
return d.TRADE_DATE || '';
|
||||
}
|
||||
},
|
||||
{title: '结算金额', align: 'center', colspan: 4},
|
||||
{title: '单边账', align: 'center', colspan: 2},
|
||||
{title: '对账情况', align: 'center', colspan: 2},
|
||||
@@ -169,6 +183,10 @@
|
||||
width: 100,
|
||||
sort: false,
|
||||
templet: function (d) {
|
||||
// 合计行不显示状态
|
||||
if (d.TOTAL_NUMS !== undefined) {
|
||||
return '-';
|
||||
}
|
||||
return d.STATUS === '1' ? '通过' : '不通过';
|
||||
}
|
||||
},
|
||||
@@ -182,12 +200,17 @@
|
||||
let objStr = "";
|
||||
if (dataList.length === 1) {
|
||||
objStr = dataList[0].TRADE_DATE;
|
||||
// 只有一条数据时,隐藏合计行
|
||||
$('.layui-table-total').hide();
|
||||
} else {
|
||||
objStr = dataList[0].TRADE_DATE;
|
||||
objStr = objStr + "~";
|
||||
objStr = objStr + dataList[dataList.length - 1].TRADE_DATE;
|
||||
// 多条数据时,显示合计行并设置第一列文字为"合计"
|
||||
$('.layui-table-total').show();
|
||||
$('.layui-table-total tr.layui-table-sum td').first().find('div').html('<span style="font-weight: bold;">合计</span>');
|
||||
}
|
||||
$('.layui-table-total table td:eq(1) div').html(objStr);
|
||||
$(".selectDate").text(objStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user