diff --git a/src/main/java/com/saye/hospitalgd/controller/HisDetailController.java b/src/main/java/com/saye/hospitalgd/controller/HisDetailController.java index fcf9b33..d779c18 100644 --- a/src/main/java/com/saye/hospitalgd/controller/HisDetailController.java +++ b/src/main/java/com/saye/hospitalgd/controller/HisDetailController.java @@ -160,12 +160,12 @@ public class HisDetailController { List> list = hisDetailService.findHisDetail(map); - // 支付方式 - List pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE"); - HashMap peyTypeMap = new HashMap<>(); - for (Dicinfo dicinfo : pay_type) { - peyTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname()); - } + // 支付方式 - 不再使用字典转换,直接显示原始值 + // List pay_type = dicinfoService.findDicinfoTreeNodeList("PAY_TYPE"); + // HashMap peyTypeMap = new HashMap<>(); + // for (Dicinfo dicinfo : pay_type) { + // peyTypeMap.put(dicinfo.getDicvalue(), dicinfo.getDicname()); + // } // 业务类型 List biz_type = dicinfoService.findDicinfoTreeNodeList("BIZ_TYPE"); @@ -175,36 +175,37 @@ public class HisDetailController { } for (HashMap hashMap : list) { - String paymethod = StringDUtil.changeNullToEmpty(hashMap.get("VISITZORG")); + String paymethod = StringDUtil.changeNullToEmpty(hashMap.get("PAYMETHOD")); if ("1".equals(paymethod)) { - hashMap.put("VISITZORG", "门诊"); + hashMap.put("PAYMETHOD", "门诊"); } else if ("2".equals(paymethod)) { - hashMap.put("VISITZORG", "住院"); + hashMap.put("PAYMETHOD", "住院"); } else { - hashMap.put("VISITZORG", ""); + hashMap.put("PAYMETHOD", ""); } - String tradingStatus = StringDUtil.changeNullToEmpty(hashMap.get("H_JYLX")); + String tradingStatus = StringDUtil.changeNullToEmpty(hashMap.get("TRADINGSTATUS")); if ("1".equals(tradingStatus)) { - hashMap.put("H_JYLX", "收款记录"); + hashMap.put("TRADINGSTATUS", "收款记录"); } else if ("2".equals(tradingStatus)) { - hashMap.put("H_JYLX", "退款记录"); + hashMap.put("TRADINGSTATUS", "退款记录"); } else { - hashMap.put("H_JYLX", ""); + hashMap.put("TRADINGSTATUS", ""); } String biztype = StringDUtil.changeNullToEmpty(hashMap.get("BIZTYPE")); hashMap.put("BIZTYPE", bizTypeMap.get(biztype)); - String paytype = StringDUtil.changeNullToEmpty(hashMap.get("PAYTYPE")); - hashMap.put("PAYTYPE", peyTypeMap.get(paytype)); + // 支付方式 - 直接使用原始值,不进行字典转换 + // String paytype = StringDUtil.changeNullToEmpty(hashMap.get("PAYTYPE")); + // hashMap.put("PAYTYPE", peyTypeMap.get(paytype)); } if (list.size() > 0) { // 定义标题头和文件名 - String[] DISTANCE_HEADERNAME = {"交易状态", "业务类型", "支付方式", "交易时间", "交易日期", "操作员", "总金额", "平台交易号", "his订单号", "患者id", "患者姓名", "来源"}; - String[] sqlKey = {"TRADINGSTATUS", "BIZTYPE", "PAYTYPE", "TRADETIME", "TRADE_DATE", "HISOPERCODE", "AMOUNT", "PLATFORMTRANSID", "HISTRANSID", "PATIENTID", "PATIENTNAME", "SOURCE"}; + String[] DISTANCE_HEADERNAME = {"交易状态", "业务类型", "支付方式", "交易时间", "交易日期", "操作员", "总金额", "平台交易号", "his订单号", "HIS交易ID", "患者id", "患者姓名", "来源"}; + String[] sqlKey = {"TRADINGSTATUS", "BIZTYPE", "PAYTYPE", "TRADETIME", "TRADE_DATE", "HISOPERCODE", "AMOUNT", "PLATFORMTRANSID", "HISTRANSID", "HISTRANSID", "PATIENTID", "PATIENTNAME", "SOURCE"}; List rulList = new ArrayList(list); diff --git a/src/main/java/com/saye/hospitalgd/controller/ThirdDetailController.java b/src/main/java/com/saye/hospitalgd/controller/ThirdDetailController.java index 94bba07..66e446f 100644 --- a/src/main/java/com/saye/hospitalgd/controller/ThirdDetailController.java +++ b/src/main/java/com/saye/hospitalgd/controller/ThirdDetailController.java @@ -225,17 +225,17 @@ public class ThirdDetailController { } for (HashMap hashMap : list) { - String i_fxk = StringDUtil.changeNullToEmpty(hashMap.get("I_FXK")); - hashMap.put("I_FXK", peyTypeMap.get(i_fxk)); + String c_zffs = StringDUtil.changeNullToEmpty(hashMap.get("C_ZFFS")); + hashMap.put("C_ZFFS", peyTypeMap.get(c_zffs)); } HashMap tjMap = new HashMap<>(); - tjMap.put("I_JZRQ", "合计:"); - tjMap.put("I_YHLSH", "交易笔数共" + thirdDetailCount.get(0).get("NUM") + "笔,汇总金额" + thirdDetailCount.get(0).get("MONEY") + "元"); + tjMap.put("C_QSRQ", "合计:"); + tjMap.put("C_LSH", "交易笔数共" + thirdDetailCount.get(0).get("NUM") + "笔,汇总金额" + thirdDetailCount.get(0).get("MONEY") + "元"); list.add(tjMap); if (list.size() > 0) { //定义标题头和文件名 - String[] DISTANCE_HEADERNAME = {"交易时间", "交易日期", "记账日期", "银行流水号", "商户流水号", "订单号", "订单状态", "付款方账号/客户号", "付款方户名", "订单金额", "交易金额", "手续费", "结算金额", "柜台代码", "发卡行/通道", "支付卡种", "交易类型", "期数", "授权号", "项目号", "基本户", "备注一"}; - String[] sqlKey = {"I_JYSJ", "I_JYRQ", "I_JZRQ", "I_YHLSH", "I_SHLSH", "I_DDH", "I_DDZT", "I_FKFZH", "I_FKFHM", "I_DDJE", "I_JYJE", "I_SXF", "I_JSJE", "I_GTDM", "I_FXK", "I_ZFKZ", "I_JYLX", "I_QS", "I_SQH", "I_XMH", "I_JBH", "I_BZ"}; + String[] DISTANCE_HEADERNAME = {"交易日期", "交易时间", "清算日期", "流水号", "商户订单号", "银商订单号", "交易类型", "卡号", "发卡行", "交易金额", "清算金额", "手续费", "实际支付金额", "终端号", "支付方式", "卡类型", "交易类型", "分期期数"}; + String[] sqlKey = {"C_JYRQ", "C_JYSJ", "C_QSRQ", "C_LSH", "C_SHDDH", "C_YSDDH", "C_JYLX", "C_CARD", "C_FKH", "C_JYJE", "C_QSJE", "C_SXF", "C_SJZFJE", "C_ZDH", "C_ZFFS", "C_KLX", "C_JYLX", "C_FQQS"}; List rulList = new ArrayList(list); @@ -267,10 +267,6 @@ public class ThirdDetailController { exportXLS.modifyWidthOfHeader("10000", 15); exportXLS.modifyWidthOfHeader("6000", 16); exportXLS.modifyWidthOfHeader("5000", 17); - exportXLS.modifyWidthOfHeader("5000", 18); - exportXLS.modifyWidthOfHeader("5000", 19); - exportXLS.modifyWidthOfHeader("5000", 20); - exportXLS.modifyWidthOfHeader("5000", 21); // 文件名称 //产生4位长度的随机码(由字母和数字组成) diff --git a/src/main/java/com/saye/hospitalgd/mapper/HisDetailMapper.java b/src/main/java/com/saye/hospitalgd/mapper/HisDetailMapper.java index 3c75516..eba6709 100644 --- a/src/main/java/com/saye/hospitalgd/mapper/HisDetailMapper.java +++ b/src/main/java/com/saye/hospitalgd/mapper/HisDetailMapper.java @@ -10,6 +10,8 @@ public interface HisDetailMapper { List> findHisDetail(HashMap map) throws Exception; + long findHisDetailCount(HashMap map) throws Exception; + void deleteHisBillOriginalByParam(HashMap deleteMap) throws Exception; void deleteHisBillByParam(HashMap deleteMap) throws Exception; diff --git a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/HISGetDataMethodByJH.java b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/HISGetDataMethodByJH.java index 393e47c..077ef17 100644 --- a/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/HISGetDataMethodByJH.java +++ b/src/main/java/com/saye/hospitalgd/scheduler/jobMethod/HISGetDataMethodByJH.java @@ -153,6 +153,10 @@ public class HISGetDataMethodByJH { //数据类型 1-门诊 2-住院 无需修改 String payMethod = StringDUtil.changeNullToEmpty(hisBillHashMap.get("visitzOrg")); + + // 添加调试日志,查看payMethod的值和来源 + log.info("患者: {}, 从visitzOrg获取的payMethod值: {}", + StringDUtil.changeNullToEmpty(hisBillHashMap.get("patientName")), payMethod); //业务类型 0发病历1办卡2就诊卡充值3当日挂号-3 挂号退费4门诊缴费-4 单据退费5现场预约-5 预约退费6预约取号7住院缴费-7出院结算退费-77 预存作废退费 String bizType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("bizType")); @@ -191,6 +195,7 @@ public class HISGetDataMethodByJH { //交易日期 String thistrade_date = StringDUtil.changeNullToEmpty(hisBillHashMap.get("trade_date")); + //接口厂商 HashMap addMap=new HashMap<>(); addMap.put("payMethod",payMethod); @@ -206,6 +211,10 @@ public class HISGetDataMethodByJH { addMap.put("patientName",patientName); addMap.put("trade_date",thistrade_date); addMap.put("his_wsdl_id",his_wsdl_id); + + //新增HisTransId字段,使用ReceiptNO + String hisTransId = StringDUtil.changeNullToEmpty(hisBillHashMap.get("receiptNO")); + addMap.put("hisTransId", hisTransId); //如果是现金记录先放进现金集合内 if (cash_code.equals(payType)){ @@ -243,6 +252,7 @@ public class HISGetDataMethodByJH { addMap.put("patientName",""); addMap.put("trade_date",trade_date); addMap.put("his_wsdl_id",his_wsdl_id); + addMap.put("hisTransId",""); // 现金记录HisTransId为空 cashMap.put(hisOperCode+"_"+payMethod,addMap); }else { @@ -284,6 +294,7 @@ public class HISGetDataMethodByJH { addMap.put("patientName",""); addMap.put("trade_date",trade_date); addMap.put("his_wsdl_id",his_wsdl_id); + addMap.put("hisTransId",""); // 支票记录HisTransId为空 zhipiaoMap.put(hisOperCode+"_"+payMethod,addMap); }else { diff --git a/src/main/java/com/saye/hospitalgd/service/HisDetailService.java b/src/main/java/com/saye/hospitalgd/service/HisDetailService.java index 94e89e2..5ed4e8f 100644 --- a/src/main/java/com/saye/hospitalgd/service/HisDetailService.java +++ b/src/main/java/com/saye/hospitalgd/service/HisDetailService.java @@ -7,6 +7,8 @@ public interface HisDetailService { List> findHisDetail(HashMap map) throws Exception; + long findHisDetailCount(HashMap map) throws Exception; + void insertHisBillOriginal(List> list, String trade_date, String his_wsdl_id) throws Exception; void insertHisBillOriginalWN(List> list, String trade_date, String his_wsdl_id) throws Exception; diff --git a/src/main/java/com/saye/hospitalgd/service/impl/HisDetailServiceImpl.java b/src/main/java/com/saye/hospitalgd/service/impl/HisDetailServiceImpl.java index f93d38e..2cb75d7 100644 --- a/src/main/java/com/saye/hospitalgd/service/impl/HisDetailServiceImpl.java +++ b/src/main/java/com/saye/hospitalgd/service/impl/HisDetailServiceImpl.java @@ -28,6 +28,11 @@ public class HisDetailServiceImpl implements HisDetailService { return hisDetailMapper.findHisDetail(map); } + @Override + public long findHisDetailCount(HashMap map) throws Exception { + return hisDetailMapper.findHisDetailCount(map); + } + /** * @description: 中联的原始记录表添加 * @author thuang diff --git a/src/main/java/com/saye/hospitalgd/util/HisUtil.java b/src/main/java/com/saye/hospitalgd/util/HisUtil.java index 945d2fd..d1866b4 100644 --- a/src/main/java/com/saye/hospitalgd/util/HisUtil.java +++ b/src/main/java/com/saye/hospitalgd/util/HisUtil.java @@ -782,6 +782,7 @@ public class HisUtil { addMap.put("hisTime", hisTime); addMap.put("hisOperCode", hisOperNum); // 修改字段名以匹配HISGetDataMethodByJH中的使用 addMap.put("powerTranID", powerTranID); + addMap.put("hisTransId", receiptNO); // 新增HisTransId字段,使用ReceiptNO的值 addList.add(addMap); } diff --git a/src/main/resources/mapper/HisDetailMapper.xml b/src/main/resources/mapper/HisDetailMapper.xml index 3da4142..802656a 100644 --- a/src/main/resources/mapper/HisDetailMapper.xml +++ b/src/main/resources/mapper/HisDetailMapper.xml @@ -3,21 +3,21 @@ + + + delete from hisbill_original where trade_date=#{trade_date} @@ -86,18 +106,15 @@ ) - + insert into - hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id) + hisbill_history(PayMethod,TradingStatus,BizType,PayType,TradeTime,HisOperCode,Amount,remarks,PlatformTransId,PatientId,PatientName,trade_date,his_wsdl_id,HisTransId) values ( #{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.patientName},#{itm.trade_date},#{itm.his_wsdl_id},#{itm.hisTransId} ) @@ -116,37 +133,36 @@ diff --git a/src/main/resources/templates/financialReconciliation/hisDetail.html b/src/main/resources/templates/financialReconciliation/hisDetail.html index 99aebcd..bfb7058 100644 --- a/src/main/resources/templates/financialReconciliation/hisDetail.html +++ b/src/main/resources/templates/financialReconciliation/hisDetail.html @@ -141,12 +141,10 @@ sort: false, templet: function (d) { let result = ""; - for (let i = 0; i < payTypeList.length; i++) { - let obj = payTypeList[i]; - if (d.PAYMETHOD === obj.dicvalue) { - result = obj.dicname; - break; - } + if (d.PAYMETHOD === '1') { + result = '门诊'; + } else if (d.PAYMETHOD === '2') { + result = '住院'; } return result; } @@ -190,18 +188,7 @@ align: 'center', title: '支付方式', width: 120, - sort: false, - templet: function (d) { - let result = ""; - for (let i = 0; i < payTypeList.length; i++) { - let obj = payTypeList[i]; - if (d.PAYTYPE === obj.dicvalue) { - result = obj.dicname; - break; - } - } - return result; - } + sort: false }, @@ -209,6 +196,7 @@ {field: 'AMOUNT', align: 'center', title: '金额 ', width: 120, sort: false}, {field: 'PLATFORMTRANSID', align: 'center', title: '平台订单号 ', width: 120, sort: false}, {field: 'HISTRANSID', align: 'center', title: 'his订单号 ', width: 120, sort: false}, + {field: 'HISTRANSID', align: 'center', title: 'HIS交易ID', width: 120, sort: false}, {field: 'PATIENTID', align: 'center', title: '患者id ', width: 120, sort: false}, {field: 'PATIENTNAME', align: 'center', title: '患者姓名 ', width: 120, sort: false}, {field: 'TRADE_DATE', align: 'center', title: '交易时间', width: 120, sort: false}, @@ -266,7 +254,7 @@ let url = "/hisDetail/exportHisDetail"; let param = {}; - param.payType = $("#searchPayType").val(); + param.payType = $("#payType").val(); param.likeFiled = $("#likeFiled").val(); let date = $("#searchDate").val(); if (date !== '') { diff --git a/src/main/resources/templates/financialReconciliation/thirdDetail.html b/src/main/resources/templates/financialReconciliation/thirdDetail.html index 7a412ab..a7dca5d 100644 --- a/src/main/resources/templates/financialReconciliation/thirdDetail.html +++ b/src/main/resources/templates/financialReconciliation/thirdDetail.html @@ -133,31 +133,31 @@ //size:'lg', 默认普通尺寸 sm 小 lg 大 cols: [ [ - {field: 'I_JYRQ', align: 'center', title: '交易日期', width: 180, sort: false}, - {field: 'I_JYSJ', align: 'center', title: '交易时间', width: 180, sort: false}, - {field: 'I_JZRQ', align: 'center', title: '记账日期', width: 180, sort: false}, - {field: 'I_YHLSH', align: 'center', title: '银行流水号', width: 120, sort: false}, - {field: 'I_SHLSH', align: 'center', title: '商户流水号', width: 120, sort: false}, - {field: 'I_DDH', align: 'center', title: '订单号', width: 120, sort: false}, - {field: 'I_DDZT', align: 'center', title: '订单状态', width: 120, sort: false}, - {field: 'I_FKFZH', align: 'center', title: '付款方账号', width: 120, sort: false}, - {field: 'I_FKFHM', align: 'center', title: '付款方户名', width: 120, sort: false}, - {field: 'I_DDJE', align: 'center', title: '订单金额', width: 150, sort: false}, - {field: 'I_JYJE', align: 'center', title: '交易金额', width: 120, sort: false}, - {field: 'I_SXF', align: 'center', title: '手续费', width: 120, sort: false}, - {field: 'I_JSJE', align: 'center', title: '结算金额', width: 240, sort: false}, - {field: 'I_GTDM', align: 'center', title: '柜台代码', width: 180, sort: false}, + {field: 'C_JYRQ', align: 'center', title: '交易日期', width: 180, sort: false}, + {field: 'C_JYSJ', align: 'center', title: '交易时间', width: 180, sort: false}, + {field: 'C_QSRQ', align: 'center', title: '清算日期', width: 180, sort: false}, + {field: 'C_LSH', align: 'center', title: '流水号', width: 120, sort: false}, + {field: 'C_SHDDH', align: 'center', title: '商户订单号', width: 120, sort: false}, + {field: 'C_YSDDH', align: 'center', title: '银商订单号', width: 120, sort: false}, + {field: 'C_JYLX', align: 'center', title: '交易类型', width: 120, sort: false}, + {field: 'C_CARD', align: 'center', title: '卡号', width: 120, sort: false}, + {field: 'C_FKH', align: 'center', title: '发卡行', width: 120, sort: false}, + {field: 'C_JYJE', align: 'center', title: '交易金额', width: 150, sort: false}, + {field: 'C_QSJE', align: 'center', title: '清算金额', width: 120, sort: false}, + {field: 'C_SXF', align: 'center', title: '手续费', width: 120, sort: false}, + {field: 'C_SJZFJE', align: 'center', title: '实际支付金额', width: 240, sort: false}, + {field: 'C_ZDH', align: 'center', title: '终端号', width: 180, sort: false}, { - field: 'I_FXK', + field: 'C_ZFFS', align: 'center', - title: '发卡行/通道', + title: '支付方式', width: 120, sort: false, templet: function (d) { let result = ""; for (let i = 0; i < payTypeList.length; i++) { let obj = payTypeList[i]; - if (d.I_FXK === obj.dicvalue) { + if (d.C_ZFFS === obj.dicvalue) { result = obj.dicname; break; } @@ -165,18 +165,18 @@ return result; } }, - {field: 'I_ZFKZ', align: 'center', title: '卡种', width: 120, sort: false}, + {field: 'C_KLX', align: 'center', title: '卡类型', width: 120, sort: false}, { - field: 'I_JYLX', + field: 'C_JYLX', align: 'center', title: '交易类型', width: 100, sort: false, templet: function (d) { - return d.I_JYLX === '1' ? '消费' : '消费撤销'; + return d.C_JYLX === '1' ? '消费' : '消费撤销'; } }, - {field: 'I_QS', align: 'center', title: '分期期数', width: 120, sort: false}, + {field: 'C_FQQS', align: 'center', title: '分期期数', width: 120, sort: false}, ] ], data: [] @@ -244,7 +244,7 @@ let url = "/thirdDetail/exportThirdDetail"; let param = {}; - param.payType = $("#searchPayType").val(); + param.c_zffs = $("#c_zffs").val(); param.likeFiled = $("#likeFiled").val(); let date = $("#searchDate").val(); if (date !== '') {