bugfix:对账完成

This commit is contained in:
Yuan
2025-12-07 11:46:49 +08:00
parent 3f931c2e29
commit 66620d51ae
23 changed files with 664 additions and 124 deletions

View File

@@ -70,6 +70,10 @@ public class RefundStatisticsController {
List<Dicinfo> refundType = dicinfoService.findDicinfoTreeNodeList("REFUND_TYPE"); List<Dicinfo> refundType = dicinfoService.findDicinfoTreeNodeList("REFUND_TYPE");
modelMap.addAttribute("refundTypeList", refundType); modelMap.addAttribute("refundTypeList", refundType);
//业务类型
List<Dicinfo> bizType = dicinfoService.findDicinfoTreeNodeList("BIZ_TYPE");
modelMap.addAttribute("bizTypeList", bizType);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -89,6 +93,7 @@ public class RefundStatisticsController {
@ApiParam("开始时间") String startTime, @ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime, @ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType, @ApiParam("支付方式") String payType,
@ApiParam("业务类型") String bizType,
@ApiParam("退款类型") String refundType, @ApiParam("退款类型") String refundType,
@ApiParam("统计维度") String dimension, @ApiParam("统计维度") String dimension,
@ApiParam("页码") int page, @ApiParam("页码") int page,
@@ -101,6 +106,7 @@ public class RefundStatisticsController {
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("payType", payType); map.put("payType", payType);
map.put("bizType", bizType);
map.put("refundType", refundType); map.put("refundType", refundType);
map.put("dimension", dimension); map.put("dimension", dimension);
@@ -133,6 +139,7 @@ public class RefundStatisticsController {
@ApiParam("开始时间") String startTime, @ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime, @ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType, @ApiParam("支付方式") String payType,
@ApiParam("业务类型") String bizType,
@ApiParam("退款类型") String refundType) { @ApiParam("退款类型") String refundType) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>(); HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
@@ -142,6 +149,7 @@ public class RefundStatisticsController {
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("payType", payType); map.put("payType", payType);
map.put("bizType", bizType);
map.put("refundType", refundType); map.put("refundType", refundType);
HashMap<Object, Object> summaryData = refundStatisticsService.getRefundSummary(map); HashMap<Object, Object> summaryData = refundStatisticsService.getRefundSummary(map);
@@ -171,6 +179,7 @@ public class RefundStatisticsController {
@ApiParam("开始时间") String startTime, @ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime, @ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType, @ApiParam("支付方式") String payType,
@ApiParam("业务类型") String bizType,
@ApiParam("退款类型") String refundType) { @ApiParam("退款类型") String refundType) {
HashMap<Object, Object> responseMap = new HashMap<Object, Object>(); HashMap<Object, Object> responseMap = new HashMap<Object, Object>();
@@ -180,6 +189,7 @@ public class RefundStatisticsController {
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("payType", payType); map.put("payType", payType);
map.put("bizType", bizType);
map.put("refundType", refundType); map.put("refundType", refundType);
List<HashMap<Object, Object>> trendData = refundStatisticsService.getRefundTrend(map); List<HashMap<Object, Object>> trendData = refundStatisticsService.getRefundTrend(map);
@@ -209,6 +219,7 @@ public class RefundStatisticsController {
@ApiParam("开始时间") String startTime, @ApiParam("开始时间") String startTime,
@ApiParam("结束时间") String endTime, @ApiParam("结束时间") String endTime,
@ApiParam("支付方式") String payType, @ApiParam("支付方式") String payType,
@ApiParam("业务类型") String bizType,
@ApiParam("退款类型") String refundType, @ApiParam("退款类型") String refundType,
@ApiParam("统计维度") String dimension) { @ApiParam("统计维度") String dimension) {
@@ -219,6 +230,7 @@ public class RefundStatisticsController {
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("payType", payType); map.put("payType", payType);
map.put("bizType", bizType);
map.put("refundType", refundType); map.put("refundType", refundType);
map.put("dimension", dimension); map.put("dimension", dimension);
@@ -236,5 +248,3 @@ public class RefundStatisticsController {
return responseMap; return responseMap;
} }
} }

View File

@@ -76,7 +76,9 @@ public class HisDetailController {
@ApiOperation(value = "查询his详细记录", notes = "") @ApiOperation(value = "查询his详细记录", notes = "")
@GetMapping("/findHisDetail") @GetMapping("/findHisDetail")
@ResponseBody @ResponseBody
public HashMap<Object, Object> findHisDetail(@ApiParam(value = "付款方式") String payType, String startTime, String endTime, String likeFiled, int page, int limit) { public HashMap<Object, Object> findHisDetail(@ApiParam(value = "付款方式") String payType,
@ApiParam(value = "业务类型") String bizType,
String startTime, String endTime, String likeFiled, int page, int limit) {
HashMap<Object, Object> responseMap = new HashMap<>(); HashMap<Object, Object> responseMap = new HashMap<>();
try { try {
@@ -85,6 +87,7 @@ public class HisDetailController {
map.put("startTime", startTime); map.put("startTime", startTime);
map.put("endTime", endTime); map.put("endTime", endTime);
map.put("likeFiled", likeFiled); map.put("likeFiled", likeFiled);
map.put("bizType", bizType);
PageHelper.startPage(page, limit); PageHelper.startPage(page, limit);
PageInfo<HashMap<Object, Object>> pageInfo = new PageInfo<HashMap<Object, Object>>(hisDetailService.findHisDetail(map)); PageInfo<HashMap<Object, Object>> pageInfo = new PageInfo<HashMap<Object, Object>>(hisDetailService.findHisDetail(map));

View File

@@ -9,6 +9,7 @@ import com.saye.hospitalgd.service.BankbillHistoryService;
import com.saye.hospitalgd.service.TransactionDetailService; import com.saye.hospitalgd.service.TransactionDetailService;
import com.saye.hospitalgd.service.system.DicinfoService; import com.saye.hospitalgd.service.system.DicinfoService;
import com.saye.hospitalgd.service.system.ServiceParamsService; import com.saye.hospitalgd.service.system.ServiceParamsService;
import com.saye.hospitalgd.service.FinancialReconciliation.TenpaySummaryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -49,6 +50,9 @@ public class PaymentStatisticsController {
@Autowired @Autowired
private ServiceParamsService serviceParamsService; private ServiceParamsService serviceParamsService;
@Autowired
private TenpaySummaryService tenpaySummaryService;
@RequestMapping("/toPaymentStatistics") @RequestMapping("/toPaymentStatistics")
public String toPaymentStatistics(ModelMap modelMap) { public String toPaymentStatistics(ModelMap modelMap) {
return "paymentStatistics/paymentStatistics"; return "paymentStatistics/paymentStatistics";
@@ -259,6 +263,27 @@ public class PaymentStatisticsController {
return "paymentStatistics/summary"; return "paymentStatistics/summary";
} }
@RequestMapping("/toTenpaySummary")
@ApiOperation("财付通汇款汇总表")
public String toTenpaySummary(HttpServletRequest request, ModelMap modelMap) {
String trade_date = StringDUtil.changeNullToEmpty(request.getParameter("trade_date"));
if ("".equals(trade_date)) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, -1);
Date startDate = calendar.getTime();
String startTime = DateDUtil.DateToStr(DateDUtil.yyyy_MM_dd, startDate);
String endTime = DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd);
modelMap.addAttribute("startTime", startTime);
modelMap.addAttribute("endTime", endTime);
} else {
modelMap.addAttribute("startTime", trade_date);
modelMap.addAttribute("endTime", trade_date);
modelMap.addAttribute("isClick", "1");
}
return "paymentStatistics/tenpaySummary";
}
/** /**
* @description: 查询汇总表数据 * @description: 查询汇总表数据
* @author thuang * @author thuang
@@ -421,4 +446,26 @@ public class PaymentStatisticsController {
return resultMap; return resultMap;
} }
@RequestMapping("/findTenpaySummary")
@ResponseBody
@ApiOperation("查询财付通汇款汇总数据")
public HashMap<Object, Object> findTenpaySummary(String startTime, String endTime) {
HashMap<Object, Object> response = new HashMap<>();
try {
HashMap<Object, Object> map = new HashMap<>();
map.put("startTime", startTime);
map.put("endTime", endTime);
List<HashMap<Object, Object>> bankList = tenpaySummaryService.findTenpayBankSummary(map);
List<HashMap<Object, Object>> hisList = tenpaySummaryService.findTenpayHisSummary(map);
response.put("code", 0);
response.put("msg", "OK");
response.put("bankData", bankList);
response.put("hisData", hisList);
} catch (Exception e) {
response.put("code", 1);
response.put("msg", e.getMessage());
}
return response;
}
} }

View File

@@ -0,0 +1,10 @@
package com.saye.hospitalgd.mapper.FinancialReconciliation;
import java.util.HashMap;
import java.util.List;
public interface TenpaySummaryMapper {
List<HashMap<Object, Object>> findTenpaySummary(HashMap<Object, Object> map);
List<HashMap<Object, Object>> findTenpayBankSummary(HashMap<Object, Object> map);
List<HashMap<Object, Object>> findTenpayHisSummary(HashMap<Object, Object> map);
}

View File

@@ -149,12 +149,7 @@ public class HISGetDataMethodByHY {
//业务类型 0发病历1办卡2就诊卡充值3当日挂号-3 挂号退费4门诊缴费-4 单据退费5现场预约-5 预约退费6预约取号7住院缴费-7出院结算退费-77 预存作废退费 //业务类型 0发病历1办卡2就诊卡充值3当日挂号-3 挂号退费4门诊缴费-4 单据退费5现场预约-5 预约退费6预约取号7住院缴费-7出院结算退费-77 预存作废退费
String bizType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("bizType")); String bizType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("bizType"));
String tradingStatus="1"; String tradingStatus = "1";
//如果业务类型是负数 那就是退款记录
int i1 = new BigDecimal(0).compareTo(new BigDecimal(bizType));
if (i1>0){
tradingStatus="2";
}
//支付方式 修改为字典表对应 //支付方式 修改为字典表对应
String payType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("payType")); String payType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("payType"));
@@ -167,6 +162,13 @@ public class HISGetDataMethodByHY {
//交易金额 //交易金额
String amount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("amount")); String amount = StringDUtil.changeNullToEmpty(hisBillHashMap.get("amount"));
try {
if (new BigDecimal(amount).compareTo(BigDecimal.ZERO) < 0) {
tradingStatus = "2";
}
} catch (Exception ex) {
tradingStatus = "1";
}
//说明 //说明
String remarks = ""; String remarks = "";

View File

@@ -184,11 +184,13 @@ public class HISGetDataMethodByJH {
//业务类型 0发病历1办卡2就诊卡充值3当日挂号-3 挂号退费4门诊缴费-4 单据退费5现场预约-5 预约退费6预约取号7住院缴费-7出院结算退费-77 预存作废退费 //业务类型 0发病历1办卡2就诊卡充值3当日挂号-3 挂号退费4门诊缴费-4 单据退费5现场预约-5 预约退费6预约取号7住院缴费-7出院结算退费-77 预存作废退费
String bizType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("bizType")); String bizType = StringDUtil.changeNullToEmpty(hisBillHashMap.get("bizType"));
String tradingStatus="1"; String tradingStatus = "1";
//如果业务类型是负数 那就是退款记录 try {
int i1 = new BigDecimal(0).compareTo(new BigDecimal(bizType)); if (new BigDecimal(amount).compareTo(BigDecimal.ZERO) < 0) {
if (i1>0){ tradingStatus = "2";
tradingStatus="2"; }
} catch (Exception ex) {
tradingStatus = "1";
} }
//支付方式 严格按照字典表转换 //支付方式 严格按照字典表转换

View File

@@ -95,9 +95,21 @@ public class MedicalInsuranceReconciliationMethod {
LogUtil.info(this.getClass(), "查询到医保分组数据:" + medicalRecords.size() + ""); LogUtil.info(this.getClass(), "查询到医保分组数据:" + medicalRecords.size() + "");
// 删除当天旧的对账结果 // 先查询当日已存在的结果(用于判断是否为二次核对)
MedicalInsuranceReconciliationService reconciliationService = MedicalInsuranceReconciliationService reconciliationService =
GetBeanUtil.getBean(MedicalInsuranceReconciliationServiceImpl.class); GetBeanUtil.getBean(MedicalInsuranceReconciliationServiceImpl.class);
HashMap<Object, Object> prevQueryMap = new HashMap<>();
prevQueryMap.put("trade_date", trade_date);
List<HashMap<Object, Object>> prevResults = reconciliationService.findMedicalInsuranceReconciliationResult(prevQueryMap);
HashMap<String, String> prevStatusMap = new HashMap<>();
if (prevResults != null) {
for (HashMap<Object, Object> prev : prevResults) {
String key = StringDUtil.changeNullToEmpty(prev.get("insutype")) + "|" + StringDUtil.changeNullToEmpty(prev.get("clr_type"));
prevStatusMap.put(key, StringDUtil.changeNullToEmpty(prev.get("stmt_rslt")));
}
}
// 删除当天旧的对账结果,再写入新结果
HashMap<Object, Object> deleteMap = new HashMap<>(); HashMap<Object, Object> deleteMap = new HashMap<>();
deleteMap.put("trade_date", trade_date); deleteMap.put("trade_date", trade_date);
reconciliationService.deleteMedicalInsuranceReconciliationResult(deleteMap); reconciliationService.deleteMedicalInsuranceReconciliationResult(deleteMap);
@@ -140,8 +152,20 @@ public class MedicalInsuranceReconciliationMethod {
resultMap.put("acct_pay", acct_pay); resultMap.put("acct_pay", acct_pay);
resultMap.put("fixmedins_setl_cnt", fixmedins_setl_cnt); resultMap.put("fixmedins_setl_cnt", fixmedins_setl_cnt);
resultMap.put("setl_optins", callResult.get("setl_optins")); resultMap.put("setl_optins", callResult.get("setl_optins"));
resultMap.put("stmt_rslt", callResult.get("stmt_rslt")); String newStmtRslt = StringDUtil.changeNullToEmpty(callResult.get("stmt_rslt"));
resultMap.put("stmt_rslt", newStmtRslt);
resultMap.put("stmt_rslt_dscr", callResult.get("stmt_rslt_dscr")); resultMap.put("stmt_rslt_dscr", callResult.get("stmt_rslt_dscr"));
// 二次核对标志计算
String key = insutype + "|" + clrType;
String prevStmt = prevStatusMap.get(key);
String recheckFlag = ("1".equals(prevStmt) && "0".equals(newStmtRslt)) ? "1" : "0";
int checkRound = prevStatusMap.containsKey(key) ? 2 : 1;
resultMap.put("execute_type", "manual");
resultMap.put("check_round", checkRound);
resultMap.put("recheck_flag", recheckFlag);
resultMap.put("prev_stmt_rslt", prevStmt);
resultMap.put("recheck_time", "1".equals(recheckFlag) ? DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss) : null);
resultMap.put("recheck_user", "");
resultMap.put("infcode", callResult.get("infcode")); resultMap.put("infcode", callResult.get("infcode"));
resultMap.put("err_msg", callResult.get("err_msg")); resultMap.put("err_msg", callResult.get("err_msg"));
resultMap.put("warn_msg", callResult.get("warn_msg")); resultMap.put("warn_msg", callResult.get("warn_msg"));
@@ -170,6 +194,12 @@ public class MedicalInsuranceReconciliationMethod {
resultMap.put("fixmedins_setl_cnt", fixmedins_setl_cnt); resultMap.put("fixmedins_setl_cnt", fixmedins_setl_cnt);
resultMap.put("stmt_rslt", "9"); resultMap.put("stmt_rslt", "9");
resultMap.put("stmt_rslt_dscr", "调用医保局接口失败:" + e.getMessage()); resultMap.put("stmt_rslt_dscr", "调用医保局接口失败:" + e.getMessage());
resultMap.put("execute_type", "manual");
resultMap.put("check_round", prevStatusMap.size() > 0 ? 2 : 1);
resultMap.put("recheck_flag", "0");
resultMap.put("prev_stmt_rslt", "");
resultMap.put("recheck_time", null);
resultMap.put("recheck_user", "");
resultMap.put("api_result", "ERROR"); resultMap.put("api_result", "ERROR");
resultMap.put("create_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); resultMap.put("create_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
resultMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); resultMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
@@ -355,4 +385,3 @@ public class MedicalInsuranceReconciliationMethod {
return result; return result;
} }
} }

View File

@@ -180,7 +180,7 @@ public class ReconciliationMethod {
//数据库中对比完是只有三种状态 his单边 三方单边 差异 分别判断3种账单实际情况 如单边是因为跨天 //数据库中对比完是只有三种状态 his单边 三方单边 差异 分别判断3种账单实际情况 如单边是因为跨天
//err_type 1 his单边 2 三方单边 3 差异 //err_type 1 his单边 2 三方单边 3 差异
if ("1".equals(check_result) && "1".equals(err_type)) { if (("1".equals(check_result) || "2".equals(check_result)) && "1".equals(err_type)) {
//his单边账 查询历史单边账表是否是否已有记录 有不动 没有添加 //his单边账 查询历史单边账表是否是否已有记录 有不动 没有添加
List<HashMap<Object, Object>> unilateralList = null; List<HashMap<Object, Object>> unilateralList = null;
HashMap<Object, Object> noCashSearchMap = new HashMap<>(); HashMap<Object, Object> noCashSearchMap = new HashMap<>();
@@ -256,19 +256,23 @@ public class ReconciliationMethod {
//修改该记录状态为自动核销 //修改该记录状态为自动核销
updateHisMap.put("is_manager", "0"); updateHisMap.put("is_manager", "1");
updateHisMap.put("remark", "系统自动核销"); updateHisMap.put("remark", "系统自动核销");
updateHisMap.put("manager_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); updateHisMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisMap.put("tranID", tranid); updateHisMap.put("tranID", tranid);
updateHisMap.put("h_jylx", h_jylx); updateHisMap.put("h_jylx", h_jylx);
updateHisMap.put("trade_date", thistrade_date);
updateHisMap.put("check_result", "2"); updateHisMap.put("check_result", "2");
updateThirdMap.put("is_manager", "0"); updateThirdMap.put("is_manager", "1");
updateThirdMap.put("remark", "系统自动核销"); updateThirdMap.put("remark", "系统自动核销");
updateThirdMap.put("manager_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateThirdMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); updateThirdMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateThirdMap.put("i_ddh", tranid); updateThirdMap.put("i_ddh", tranid);
updateThirdMap.put("i_jylx", h_jylx); updateThirdMap.put("i_jylx", h_jylx);
updateThirdMap.put("trade_date", thistrade_date);
updateThirdMap.put("check_result", "2"); updateThirdMap.put("check_result", "2");
// updateThirdMap.put("is_manager", "0"); // updateThirdMap.put("is_manager", "0");
@@ -488,18 +492,22 @@ public class ReconciliationMethod {
//如果两边金额相同 设置核销 更新关联明细表为核销 //如果两边金额相同 设置核销 更新关联明细表为核销
if (AmountUtil.isAmountEqual(hisJe, i_jyje)) { if (AmountUtil.isAmountEqual(hisJe, i_jyje)) {
//修改该记录状态为自动核销 //修改该记录状态为自动核销
updateHisMap.put("is_manager", "0"); updateHisMap.put("is_manager", "1");
updateHisMap.put("remark", "系统自动核销"); updateHisMap.put("remark", "系统自动核销");
updateHisMap.put("manager_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); updateHisMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisMap.put("tranID", i_ddh); updateHisMap.put("tranID", i_ddh);
updateHisMap.put("h_jylx", h_jylx); updateHisMap.put("h_jylx", h_jylx);
updateHisMap.put("trade_date", thistrade_date);
updateHisMap.put("check_result", "2"); updateHisMap.put("check_result", "2");
updateThirdMap.put("is_manager", "0"); updateThirdMap.put("is_manager", "1");
updateThirdMap.put("remark", "系统自动核销"); updateThirdMap.put("remark", "系统自动核销");
updateThirdMap.put("manager_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateThirdMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss)); updateThirdMap.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateThirdMap.put("i_ddh", i_ddh); updateThirdMap.put("i_ddh", i_ddh);
updateThirdMap.put("i_jylx", i_jylx); updateThirdMap.put("i_jylx", i_jylx);
updateThirdMap.put("trade_date", thistrade_date);
updateThirdMap.put("check_result", "2"); updateThirdMap.put("check_result", "2");
@@ -509,6 +517,14 @@ public class ReconciliationMethod {
//修改单边账记录表 //修改单边账记录表
unilateralService.updateUnilateral(updateThirdMap); unilateralService.updateUnilateral(updateThirdMap);
HashMap<Object, Object> updateHisUnilateral = new HashMap<>();
updateHisUnilateral.put("is_manager", "1");
updateHisUnilateral.put("remark", "系统自动核销");
updateHisUnilateral.put("manager_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisUnilateral.put("modify_time", DateDUtil.getCurrentDate(DateDUtil.yyyy_MM_dd_HH_mm_ss));
updateHisUnilateral.put("tranID", i_ddh);
updateHisUnilateral.put("h_jylx", h_jylx);
unilateralService.updateUnilateral(updateHisUnilateral);
} }
} }

View File

@@ -0,0 +1,10 @@
package com.saye.hospitalgd.service.FinancialReconciliation;
import java.util.HashMap;
import java.util.List;
public interface TenpaySummaryService {
List<HashMap<Object, Object>> findTenpaySummary(HashMap<Object, Object> map);
List<HashMap<Object, Object>> findTenpayBankSummary(HashMap<Object, Object> map);
List<HashMap<Object, Object>> findTenpayHisSummary(HashMap<Object, Object> map);
}

View File

@@ -0,0 +1,31 @@
package com.saye.hospitalgd.service.impl.FinancialReconciliation;
import com.saye.hospitalgd.mapper.FinancialReconciliation.TenpaySummaryMapper;
import com.saye.hospitalgd.service.FinancialReconciliation.TenpaySummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
@Service
public class TenpaySummaryServiceImpl implements TenpaySummaryService {
@Autowired
private TenpaySummaryMapper tenpaySummaryMapper;
@Override
public List<HashMap<Object, Object>> findTenpaySummary(HashMap<Object, Object> map) {
return tenpaySummaryMapper.findTenpaySummary(map);
}
@Override
public List<HashMap<Object, Object>> findTenpayBankSummary(HashMap<Object, Object> map) {
return tenpaySummaryMapper.findTenpayBankSummary(map);
}
@Override
public List<HashMap<Object, Object>> findTenpayHisSummary(HashMap<Object, Object> map) {
return tenpaySummaryMapper.findTenpayHisSummary(map);
}
}

View File

@@ -75,6 +75,23 @@
<if test="likeFiled!=null and likeFiled!=''"> <if test="likeFiled!=null and likeFiled!=''">
and C_YSDDH like concat('%',concat(#{likeFiled},'%')) and C_YSDDH like concat('%',concat(#{likeFiled},'%'))
</if> </if>
and C_SHDDH in (
select C_SHDDH
from bankbill_history
<where>
<if test="startTime!=null and startTime!=''">
and C_JYRQ &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and C_JYRQ &lt;= #{endTime}
</if>
<if test="c_zffs!=null and c_zffs!=''">
and C_ZFFS = #{c_zffs}
</if>
</where>
group by C_SHDDH
having ROUND(SUM(CAST(C_JYJE AS DECIMAL(18,2))), 2) != 0
)
</where> </where>
order by C_JYRQ,C_JYSJ order by C_JYRQ,C_JYSJ
</select> </select>

View File

@@ -14,6 +14,10 @@
PayType as dimension_value, PayType as dimension_value,
'按支付方式' as dimension_name '按支付方式' as dimension_name
</when> </when>
<when test="dimension == 'bizType'">
BizType as dimension_value,
'按业务类型' as dimension_name
</when>
<when test="dimension == 'refundType'"> <when test="dimension == 'refundType'">
TradingStatus as dimension_value, TradingStatus as dimension_value,
'按退款类型' as dimension_name '按退款类型' as dimension_name
@@ -41,6 +45,9 @@
<if test="payType != null and payType != ''"> <if test="payType != null and payType != ''">
AND PayType = #{payType} AND PayType = #{payType}
</if> </if>
<if test="bizType != null and bizType != ''">
AND BizType = #{bizType}
</if>
<choose> <choose>
<when test="dimension == 'time'"> <when test="dimension == 'time'">
GROUP BY DATE_FORMAT(trade_date, '%Y-%m-%d') GROUP BY DATE_FORMAT(trade_date, '%Y-%m-%d')
@@ -50,6 +57,10 @@
GROUP BY PayType GROUP BY PayType
ORDER BY total_refund_amount DESC ORDER BY total_refund_amount DESC
</when> </when>
<when test="dimension == 'bizType'">
GROUP BY BizType
ORDER BY total_refund_amount DESC
</when>
<when test="dimension == 'refundType'"> <when test="dimension == 'refundType'">
GROUP BY TradingStatus GROUP BY TradingStatus
ORDER BY total_refund_amount DESC ORDER BY total_refund_amount DESC
@@ -80,6 +91,9 @@
<if test="payType != null and payType != ''"> <if test="payType != null and payType != ''">
AND PayType = #{payType} AND PayType = #{payType}
</if> </if>
<if test="bizType != null and bizType != ''">
AND BizType = #{bizType}
</if>
</select> </select>
<!-- 获取退款趋势数据 --> <!-- 获取退款趋势数据 -->
@@ -100,6 +114,9 @@
<if test="payType != null and payType != ''"> <if test="payType != null and payType != ''">
AND PayType = #{payType} AND PayType = #{payType}
</if> </if>
<if test="bizType != null and bizType != ''">
AND BizType = #{bizType}
</if>
GROUP BY DATE_FORMAT(trade_date, '%Y-%m-%d') GROUP BY DATE_FORMAT(trade_date, '%Y-%m-%d')
ORDER BY DATE_FORMAT(trade_date, '%Y-%m-%d') ASC ORDER BY DATE_FORMAT(trade_date, '%Y-%m-%d') ASC
</select> </select>

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.saye.hospitalgd.mapper.FinancialReconciliation.TenpaySummaryMapper">
<select id="findTenpayBankSummary" parameterType="HashMap" resultType="HashMap">
SELECT '微信支付' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(C_JYJE AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM bankbill_history
<where>
<if test="startTime != null and startTime != ''">
AND C_JYRQ &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND C_JYRQ &lt;= #{endTime}
</if>
AND bill_table_name = '微信支付账单'
AND C_JYLX = '1'
</where>
UNION ALL
SELECT '支付宝支付' AS PAY_NAME,
0 AS CNT,
CAST(0 AS DECIMAL(19,2)) AS AMT
UNION ALL
SELECT '刷卡支付' AS PAY_NAME,
0 AS CNT,
CAST(0 AS DECIMAL(19,2)) AS AMT
UNION ALL
SELECT '退款' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(C_JYJE AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM bankbill_history
<where>
<if test="startTime != null and startTime != ''">
AND C_JYRQ &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND C_JYRQ &lt;= #{endTime}
</if>
AND bill_table_name = '微信支付账单'
AND C_JYLX = '2'
</where>
UNION ALL
SELECT '合计' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(C_JYJE AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM bankbill_history
<where>
<if test="startTime != null and startTime != ''">
AND C_JYRQ &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND C_JYRQ &lt;= #{endTime}
</if>
AND bill_table_name = '微信支付账单'
AND C_JYLX IN ('1','2')
</where>
</select>
<select id="findTenpayHisSummary" parameterType="HashMap" resultType="HashMap">
SELECT '微信支付' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(Amount AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM hisbill_history
<where>
<if test="startTime != null and startTime != ''">
AND trade_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND trade_date &lt;= #{endTime}
</if>
AND LOWER(HisOperCode) = 'wx'
AND TradingStatus = '1'
</where>
UNION ALL
SELECT '支付宝支付' AS PAY_NAME,
0 AS CNT,
CAST(0 AS DECIMAL(19,2)) AS AMT
UNION ALL
SELECT '刷卡支付' AS PAY_NAME,
0 AS CNT,
CAST(0 AS DECIMAL(19,2)) AS AMT
UNION ALL
SELECT '退款' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(Amount AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM hisbill_history
<where>
<if test="startTime != null and startTime != ''">
AND trade_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND trade_date &lt;= #{endTime}
</if>
AND LOWER(HisOperCode) = 'wx'
AND TradingStatus = '2'
</where>
UNION ALL
SELECT '合计' AS PAY_NAME,
COUNT(1) AS CNT,
CAST(IFNULL(SUM(CAST(Amount AS DECIMAL(19,2))),0) AS DECIMAL(19,2)) AS AMT
FROM hisbill_history
<where>
<if test="startTime != null and startTime != ''">
AND trade_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND trade_date &lt;= #{endTime}
</if>
AND LOWER(HisOperCode) = 'wx'
AND TradingStatus IN ('1','2')
</where>
</select>
</mapper>

View File

@@ -26,6 +26,9 @@
<if test="payType!=null and payType!=''"> <if test="payType!=null and payType!=''">
and PayType = #{payType} and PayType = #{payType}
</if> </if>
<if test="bizType!=null and bizType!=''">
and BizType = #{bizType}
</if>
<if test="startTime!=null and startTime!=''"> <if test="startTime!=null and startTime!=''">
and trade_date &gt;= #{startTime} and trade_date &gt;= #{startTime}
</if> </if>
@@ -47,6 +50,9 @@
<if test="payType!=null and payType!=''"> <if test="payType!=null and payType!=''">
and PayType = #{payType} and PayType = #{payType}
</if> </if>
<if test="bizType!=null and bizType!=''">
and BizType = #{bizType}
</if>
<if test="startTime!=null and startTime!=''"> <if test="startTime!=null and startTime!=''">
and trade_date &gt;= #{startTime} and trade_date &gt;= #{startTime}
</if> </if>
@@ -247,16 +253,20 @@
</where> </where>
</select> </select>
<!-- 医保对账:按险种和清算类别分组统计(按ReceiptNO去重即HisTransId <!-- 医保对账:按险种和清算类别分组统计(去重规则HisTransId + ZFAmount 都相同才视为同一记录
1. 医疗总金额MEDFEE_SUMAMT统计同一收据号HisTransId下的自费总额取该收据号的ZFAmount并按组求和 1. 医疗总金额MEDFEE_SUMAMT统计同一收据号HisTransId且同一自费金额ZFAmount下的金额累计统筹 + 非退款账户 + 自费
2. 统筹金额FUND_PAY_SUMAMT和账户金额ACCT_PAY只统计PayType为9和10的记录按收据号合并 2. 统筹金额FUND_PAY_SUMAMT:累计统筹金额(不受退款影响)
3. 按HisTransId去重合并统计金额 --> 3. 账户金额ACCT_PAY累计账户金额包含退款 -->
<select id="findMedicalInsuranceGroupData" parameterType="HashMap" resultType="HashMap"> <select id="findMedicalInsuranceGroupData" parameterType="HashMap" resultType="HashMap">
select select
t.insutype as INSUTYPE, t.insutype as INSUTYPE,
t.clr_type as CLR_TYPE, t.clr_type as CLR_TYPE,
count(distinct t.HisTransId) as FIXMEDINS_SETL_CNT, count(distinct t.HisTransId) as FIXMEDINS_SETL_CNT,
cast(IFNULL(sum(t.ybtc),0) + IFNULL(sum(t.ybzh),0) + IFNULL(sum(t.zf),0) as decimal(19,2)) as MEDFEE_SUMAMT, cast(
IFNULL(sum(t.ybtc),0)
+ IFNULL(sum(case when t.is_inpatient = 1 then 0 else t.ybzh_non_refund end),0)
+ IFNULL(sum(t.zf),0)
as decimal(19,2)) as MEDFEE_SUMAMT,
cast(IFNULL(sum(t.ybtc),0) as decimal(19,2)) as FUND_PAY_SUMAMT, cast(IFNULL(sum(t.ybtc),0) as decimal(19,2)) as FUND_PAY_SUMAMT,
cast(IFNULL(sum(t.ybzh),0) as decimal(19,2)) as ACCT_PAY cast(IFNULL(sum(t.ybzh),0) as decimal(19,2)) as ACCT_PAY
from ( from (
@@ -266,7 +276,9 @@
HisTransId, HisTransId,
max(cast(IFNULL(ybtcAmount,0) as decimal(19,2))) as ybtc, max(cast(IFNULL(ybtcAmount,0) as decimal(19,2))) as ybtc,
max(cast(IFNULL(ybzhAmount,0) as decimal(19,2))) as ybzh, max(cast(IFNULL(ybzhAmount,0) as decimal(19,2))) as ybzh,
max(cast(IFNULL(zfAmount,0) as decimal(19,2))) as zf max(case when TradingStatus != '2' then cast(IFNULL(ybzhAmount,0) as decimal(19,2)) else 0 end) as ybzh_non_refund,
max(cast(IFNULL(zfAmount,0) as decimal(19,2))) as zf,
max(case when PayMethod = '2' then 1 else 0 end) as is_inpatient
from hisbill_history from hisbill_history
where trade_date = #{trade_date} where trade_date = #{trade_date}
and insutype is not null and insutype is not null
@@ -275,7 +287,7 @@
and clr_type != '' and clr_type != ''
and HisTransId is not null and HisTransId is not null
and HisTransId != '' and HisTransId != ''
group by insutype, clr_type, HisTransId group by insutype, clr_type, HisTransId, cast(IFNULL(zfAmount,0) as decimal(19,2))
) as t ) as t
group by t.insutype, t.clr_type group by t.insutype, t.clr_type
order by t.insutype, t.clr_type order by t.insutype, t.clr_type

View File

@@ -111,17 +111,7 @@
0 as BANK_AMOUNT 0 as BANK_AMOUNT
from hisbill_history from hisbill_history
where PayMethod = '2' where PayMethod = '2'
and PayType != '5' <!-- 排除现金支付 --> and PayType = '2'
and PayType != '3' <!-- 排除军保支付(医院垫支) -->
and PayType != '7' <!-- 排除预交金 -->
and PayType != '9' <!-- 排除统筹支付 -->
and PayType != '10' <!-- 排除账户支付 -->
<if test="military_payment_code != null and military_payment_code != ''">
and PayType != #{military_payment_code}
</if>
<if test="check_payment_code != null and check_payment_code != ''">
and PayType != #{check_payment_code}
</if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
and trade_date &gt;= #{startTime} and trade_date &gt;= #{startTime}
</if> </if>

View File

@@ -14,6 +14,12 @@
<result column="fixmedins_setl_cnt" property="fixmedins_setl_cnt" jdbcType="INTEGER"/> <result column="fixmedins_setl_cnt" property="fixmedins_setl_cnt" jdbcType="INTEGER"/>
<result column="stmt_rslt" property="stmt_rslt" jdbcType="VARCHAR"/> <result column="stmt_rslt" property="stmt_rslt" jdbcType="VARCHAR"/>
<result column="stmt_rslt_dscr" property="stmt_rslt_dscr" jdbcType="VARCHAR"/> <result column="stmt_rslt_dscr" property="stmt_rslt_dscr" jdbcType="VARCHAR"/>
<result column="execute_type" property="execute_type" jdbcType="VARCHAR"/>
<result column="check_round" property="check_round" jdbcType="INTEGER"/>
<result column="recheck_flag" property="recheck_flag" jdbcType="VARCHAR"/>
<result column="prev_stmt_rslt" property="prev_stmt_rslt" jdbcType="VARCHAR"/>
<result column="recheck_time" property="recheck_time" jdbcType="VARCHAR"/>
<result column="recheck_user" property="recheck_user" jdbcType="VARCHAR"/>
<result column="api_result" property="api_result" jdbcType="VARCHAR"/> <result column="api_result" property="api_result" jdbcType="VARCHAR"/>
<result column="create_time" property="create_time" jdbcType="VARCHAR"/> <result column="create_time" property="create_time" jdbcType="VARCHAR"/>
<result column="modify_time" property="modify_time" jdbcType="VARCHAR"/> <result column="modify_time" property="modify_time" jdbcType="VARCHAR"/>
@@ -24,13 +30,15 @@
insert into medical_insurance_reconciliation_result ( insert into medical_insurance_reconciliation_result (
id, trade_date, insutype, clr_type, id, trade_date, insutype, clr_type,
medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt, medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt,
stmt_rslt, stmt_rslt_dscr, api_result, stmt_rslt, stmt_rslt_dscr,
create_time, modify_time execute_type, check_round, recheck_flag, prev_stmt_rslt, recheck_time, recheck_user,
api_result, create_time, modify_time
) values ( ) values (
#{id}, #{trade_date}, #{insutype}, #{clr_type}, #{id}, #{trade_date}, #{insutype}, #{clr_type},
#{medfee_sumamt}, #{fund_pay_sumamt}, #{acct_pay}, #{fixmedins_setl_cnt}, #{medfee_sumamt}, #{fund_pay_sumamt}, #{acct_pay}, #{fixmedins_setl_cnt},
#{stmt_rslt}, #{stmt_rslt_dscr}, #{api_result}, #{stmt_rslt}, #{stmt_rslt_dscr},
#{create_time}, #{modify_time} #{execute_type}, #{check_round}, #{recheck_flag}, #{prev_stmt_rslt}, nullif(#{recheck_time}, ''), #{recheck_user},
#{api_result}, #{create_time}, #{modify_time}
) )
</insert> </insert>
@@ -39,15 +47,17 @@
insert into medical_insurance_reconciliation_result ( insert into medical_insurance_reconciliation_result (
id, trade_date, insutype, clr_type, id, trade_date, insutype, clr_type,
medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt, medfee_sumamt, fund_pay_sumamt, acct_pay, fixmedins_setl_cnt,
stmt_rslt, stmt_rslt_dscr, api_result, stmt_rslt, stmt_rslt_dscr,
create_time, modify_time execute_type, check_round, recheck_flag, prev_stmt_rslt, recheck_time, recheck_user,
api_result, create_time, modify_time
) values ) values
<foreach collection="list" index="index" item="itm" separator=","> <foreach collection="list" index="index" item="itm" separator=",">
( (
#{itm.id}, #{itm.trade_date}, #{itm.insutype}, #{itm.clr_type}, #{itm.id}, #{itm.trade_date}, #{itm.insutype}, #{itm.clr_type},
#{itm.medfee_sumamt}, #{itm.fund_pay_sumamt}, #{itm.acct_pay}, #{itm.fixmedins_setl_cnt}, #{itm.medfee_sumamt}, #{itm.fund_pay_sumamt}, #{itm.acct_pay}, #{itm.fixmedins_setl_cnt},
#{itm.stmt_rslt}, #{itm.stmt_rslt_dscr}, #{itm.api_result}, #{itm.stmt_rslt}, #{itm.stmt_rslt_dscr},
#{itm.create_time}, #{itm.modify_time} #{itm.execute_type}, #{itm.check_round}, #{itm.recheck_flag}, #{itm.prev_stmt_rslt}, nullif(#{itm.recheck_time}, ''), #{itm.recheck_user},
#{itm.api_result}, #{itm.create_time}, #{itm.modify_time}
) )
</foreach> </foreach>
</insert> </insert>
@@ -65,6 +75,12 @@
fixmedins_setl_cnt, fixmedins_setl_cnt,
stmt_rslt, stmt_rslt,
stmt_rslt_dscr, stmt_rslt_dscr,
execute_type,
check_round,
recheck_flag,
prev_stmt_rslt,
DATE_FORMAT(recheck_time, '%Y-%m-%d %H:%i:%s') as recheck_time,
recheck_user,
api_result, api_result,
DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') as create_time, DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') as create_time,
DATE_FORMAT(modify_time, '%Y-%m-%d %H:%i:%s') as modify_time DATE_FORMAT(modify_time, '%Y-%m-%d %H:%i:%s') as modify_time
@@ -105,5 +121,3 @@
</delete> </delete>
</mapper> </mapper>

View File

@@ -232,7 +232,19 @@
</if> </if>
) a ) a
right join right join
(select * from bankbill_history where C_JYRQ = #{trade_date} and (is_inpatient is null or is_inpatient = '0')) b -- 排除住院订单 (
select * from bankbill_history
where C_JYRQ = #{trade_date}
and (is_inpatient is null or is_inpatient = '0')
and C_SHDDH in (
select C_SHDDH
from bankbill_history
where C_JYRQ = #{trade_date}
and (is_inpatient is null or is_inpatient = '0')
group by C_SHDDH
having ROUND(SUM(CAST(C_JYJE AS DECIMAL(18,2))), 2) != 0
)
) b -- 排除住院订单且排除同订单号正负抵消为0的记录
on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2) on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2)
where a.PlatformTransId is null where a.PlatformTransId is null
</insert> </insert>
@@ -651,8 +663,10 @@
PatientID = #{patientid}, PatientID = #{patientid},
PatientName = #{patientname}, PatientName = #{patientname},
sort_date = #{sort_date}, sort_date = #{sort_date},
err_type = #{err_type}, err_type = case when ROUND(CAST(#{amount} AS DECIMAL(18,2)), 2) = ROUND(CAST(I_JYJE AS DECIMAL(18,2)), 2)
check_result = #{check_result} and #{h_jylx} = I_JYLX then '' else '3' end,
check_result = case when ROUND(CAST(#{amount} AS DECIMAL(18,2)), 2) = ROUND(CAST(I_JYJE AS DECIMAL(18,2)), 2)
and #{h_jylx} = I_JYLX then '0' else '1' end
where trade_date = #{trade_date} where trade_date = #{trade_date}
and I_DDH = #{i_ddh} and I_DDH = #{i_ddh}
</update> </update>

View File

@@ -3,31 +3,40 @@
<mapper namespace="com.saye.hospitalgd.mapper.UnilateralMapper"> <mapper namespace="com.saye.hospitalgd.mapper.UnilateralMapper">
<select id="findAllUnilateral" parameterType="HashMap" resultType="HashMap"> <select id="findAllUnilateral" parameterType="HashMap" resultType="HashMap">
select id select u.id
,PayType ,u.PayType
,TranID ,u.TranID
,H_JYLX ,u.H_JYLX
,trade_date ,u.trade_date
,HisOperNum ,u.HisOperNum
,Amount ,u.Amount
,I_JYJE ,u.I_JYJE
,I_JYLX ,u.I_JYLX
,I_DDH ,u.I_DDH
,I_JYQD ,u.I_JYQD
,TradeTime ,u.TradeTime
,is_manager ,u.is_manager
,manager_time ,u.manager_time
,err_type ,u.err_type
,remark ,u.remark
,create_time ,u.create_time
,modify_time ,u.modify_time
,managerType ,u.managerType
from unmanger_unilateral u
inner join (
select COALESCE(TranID,'') as TranID,
COALESCE(H_JYLX,'') as H_JYLX,
COALESCE(I_DDH,'') as I_DDH,
COALESCE(I_JYLX,'') as I_JYLX,
COALESCE(is_manager,'') as is_manager,
trade_date,
max(modify_time) as modify_time
from unmanger_unilateral from unmanger_unilateral
<where> <where>
<if test="startTime!=null and startTime!=''"> <if test="startTime!=null and startTime!=''">
and trade_date &gt;=#{startTime} and trade_date &gt;=#{startTime}
</if> </if>
<if test="startTime!=null and startTime!=''"> <if test="endTime!=null and endTime!=''">
and trade_date &lt;=#{endTime} and trade_date &lt;=#{endTime}
</if> </if>
<if test="payType!=null and payType!=''"> <if test="payType!=null and payType!=''">
@@ -43,7 +52,16 @@
and is_manager=#{is_manager} and is_manager=#{is_manager}
</if> </if>
</where> </where>
order by trade_date group by COALESCE(TranID,''), COALESCE(H_JYLX,''), COALESCE(I_DDH,''), COALESCE(I_JYLX,''), COALESCE(is_manager,''), trade_date
) g
on u.TranID = g.TranID
and u.H_JYLX = g.H_JYLX
and COALESCE(u.I_DDH,'') = g.I_DDH
and COALESCE(u.I_JYLX,'') = g.I_JYLX
and COALESCE(u.is_manager,'') = g.is_manager
and u.trade_date = g.trade_date
and u.modify_time = g.modify_time
order by u.trade_date
</select> </select>
<insert id="insertUnilateral" parameterType="HashMap"> <insert id="insertUnilateral" parameterType="HashMap">
@@ -100,6 +118,9 @@
<if test="h_jylx!=null and h_jylx!=''"> <if test="h_jylx!=null and h_jylx!=''">
and H_JYLX=#{h_jylx} and H_JYLX=#{h_jylx}
</if> </if>
<if test="trade_date!=null and trade_date!=''">
and trade_date=#{trade_date}
</if>
<if test="i_jylx!=null and i_jylx!=''"> <if test="i_jylx!=null and i_jylx!=''">
and I_JYLX=#{i_jylx} and I_JYLX=#{i_jylx}
</if> </if>

View File

@@ -69,6 +69,16 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-inline">
<label class="layui-form-label">业务类型</label>
<div class="layui-input-inline formWidthTwo">
<select id="bizType" class="">
<option value="">请选择业务类型</option>
<option th:each="bizTypeObj : ${bizTypeList}" th:value="${bizTypeObj.dicvalue}"
th:text="${bizTypeObj.dicname}"></option>
</select>
</div>
</div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">日期选择</label> <label class="layui-form-label">日期选择</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
@@ -236,6 +246,8 @@
let payType = $("#payType").val(); let payType = $("#payType").val();
param.payType = payType; param.payType = payType;
let bizType = $("#bizType").val();
param.bizType = bizType;
param.likeFiled = $("#likeFiled").val(); param.likeFiled = $("#likeFiled").val();
let date = $("#searchDate").val(); let date = $("#searchDate").val();
if (date !== '') { if (date !== '') {
@@ -266,6 +278,7 @@
let param = {}; let param = {};
param.payType = $("#payType").val(); param.payType = $("#payType").val();
param.bizType = $("#bizType").val();
param.likeFiled = $("#likeFiled").val(); param.likeFiled = $("#likeFiled").val();
let date = $("#searchDate").val(); let date = $("#searchDate").val();
if (date !== '') { if (date !== '') {

View File

@@ -167,6 +167,10 @@
<td style="font-weight: bold;">接口调用结果</td> <td style="font-weight: bold;">接口调用结果</td>
<td id="detail_api_result"></td> <td id="detail_api_result"></td>
</tr> </tr>
<tr>
<td style="font-weight: bold;">备注</td>
<td id="detail_remark"></td>
</tr>
<tr> <tr>
<td style="font-weight: bold;">创建时间</td> <td style="font-weight: bold;">创建时间</td>
<td id="detail_create_time"></td> <td id="detail_create_time"></td>
@@ -220,6 +224,9 @@
{field: 'fund_pay_sumamt', title: '基金支付总额', align: 'center', width: 130}, {field: 'fund_pay_sumamt', title: '基金支付总额', align: 'center', width: 130},
{field: 'acct_pay', title: '账户支付金额', align: 'center', width: 130}, {field: 'acct_pay', title: '账户支付金额', align: 'center', width: 130},
{field: 'fixmedins_setl_cnt', title: '结算笔数', align: 'center', width: 100}, {field: 'fixmedins_setl_cnt', title: '结算笔数', align: 'center', width: 100},
{field: 'remark', title: '备注', align: 'center', width: 120, templet: function(d){
return d.recheck_flag === '1' ? '<span style="color:#409EFF;">二次核对</span>' : '';
}},
{field: 'stmt_rslt', title: '对账结果', align: 'center', width: 100, templet: function(d){ {field: 'stmt_rslt', title: '对账结果', align: 'center', width: 100, templet: function(d){
if(d.stmt_rslt === '0') { if(d.stmt_rslt === '0') {
return '<span style="color: green;">平</span>'; return '<span style="color: green;">平</span>';
@@ -410,6 +417,7 @@
$("#detail_stmt_rslt_dscr").text(data.stmt_rslt_dscr || '-'); $("#detail_stmt_rslt_dscr").text(data.stmt_rslt_dscr || '-');
$("#detail_api_result").text(data.api_result || '-'); $("#detail_api_result").text(data.api_result || '-');
$("#detail_remark").text(data.recheck_flag === '1' ? '二次核对' : '');
$("#detail_create_time").text(data.create_time || '-'); $("#detail_create_time").text(data.create_time || '-');
layer.open({ layer.open({
@@ -472,5 +480,3 @@
} }
</script> </script>
</html> </html>

View File

@@ -122,6 +122,16 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-inline">
<label class="layui-form-label">业务类型</label>
<div class="layui-input-inline">
<select id="searchBizType" lay-filter="searchBizType">
<option value="">全部</option>
<option th:each="bizTypeObj : ${bizTypeList}" th:value="${bizTypeObj.dicvalue}"
th:text="${bizTypeObj.dicname}"></option>
</select>
</div>
</div>
<div class="layui-inline"> <div class="layui-inline">
<label class="layui-form-label">日期选择</label> <label class="layui-form-label">日期选择</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
@@ -180,6 +190,7 @@
<li class="layui-this" lay-id="all">全部统计</li> <li class="layui-this" lay-id="all">全部统计</li>
<li lay-id="time">按日期统计</li> <li lay-id="time">按日期统计</li>
<li lay-id="payType">按支付方式统计</li> <li lay-id="payType">按支付方式统计</li>
<li lay-id="bizType">按业务类型统计</li>
<li lay-id="refundType">按退款类型统计</li> <li lay-id="refundType">按退款类型统计</li>
</ul> </ul>
</div> </div>
@@ -197,6 +208,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
let payTypeList = [[${payTypeList}]]; let payTypeList = [[${payTypeList}]];
let refundTypeList = [[${refundTypeList}]]; let refundTypeList = [[${refundTypeList}]];
let bizTypeList = [[${bizTypeList}]];
let layer, laydate, table, form, element; let layer, laydate, table, form, element;
let currentDimension = 'all'; // 当前统计维度 let currentDimension = 'all'; // 当前统计维度
let trendChart; // ECharts实例 let trendChart; // ECharts实例
@@ -225,7 +237,23 @@
cols: [ cols: [
[ [
{field: 'DIMENSION_NAME', align: 'center', title: '统计维度', width: 120}, {field: 'DIMENSION_NAME', align: 'center', title: '统计维度', width: 120},
{field: 'DIMENSION_VALUE', align: 'center', title: '维度值', width: 150}, {field: 'DIMENSION_VALUE', align: 'center', title: '维度值', width: 180, templet: function(d){
function getDicName(list, val){
if(!list || !val) return val;
for(let i=0;i<list.length;i++){
if(list[i].dicvalue === val){ return list[i].dicname; }
}
return val;
}
if(currentDimension === 'payType'){
return getDicName(payTypeList, d.DIMENSION_VALUE);
} else if(currentDimension === 'refundType'){
return getDicName(refundTypeList, d.DIMENSION_VALUE);
} else if(currentDimension === 'bizType'){
return getDicName(bizTypeList, d.DIMENSION_VALUE);
}
return d.DIMENSION_VALUE;
}},
{field: 'REFUND_COUNT', align: 'center', title: '退款笔数', width: 120, sort: true}, {field: 'REFUND_COUNT', align: 'center', title: '退款笔数', width: 120, sort: true},
{ {
field: 'TOTAL_REFUND_AMOUNT', field: 'TOTAL_REFUND_AMOUNT',
@@ -463,6 +491,7 @@
function getSearchParams() { function getSearchParams() {
let param = {}; let param = {};
param.payType = $("#searchPayType").val(); param.payType = $("#searchPayType").val();
param.bizType = $("#searchBizType").val();
param.refundType = $("#searchRefundType").val(); param.refundType = $("#searchRefundType").val();
let date = $("#searchDate").val(); let date = $("#searchDate").val();
@@ -511,4 +540,3 @@
}); });
</script> </script>
</html> </html>

View File

@@ -361,27 +361,19 @@
$("#third_num_" + key).html(thirdNumData[key]); $("#third_num_" + key).html(thirdNumData[key]);
} }
//三方扫码支付的金额相加 $("#diff_1").html("");
let smzfMoney = (Number(thirdMoneyData["1_1"]) + Number(thirdMoneyData["1_2"]) + Number(thirdMoneyData["1_3"]) + Number(thirdMoneyData["1_4"])).toFixed(2); $("#diff_2").html("");
$("#diff_3").html("");
for (let i = 1; i <= 5; i++) { $("#diff_4").html("");
if (i === 1) { $("#diff_5").html("");
let money = Math.abs(smzfMoney - Number(hisMoneyData["" + i])).toFixed(2);
$("#diff_" + i).html(formatAmount(money));
} else {
let money = Math.abs(Number(thirdMoneyData["" + i]) - Number(hisMoneyData["" + i])).toFixed(2);
$("#diff_" + i).html(formatAmount(money));
}
}
$("#allHisNum").html(allHisNum); $("#allHisNum").html(allHisNum);
$("#allHisMoney").html(formatAmount(allHisMoney.toFixed(2))); $("#allHisMoney").html(formatAmount(allHisMoney.toFixed(2)));
$("#allThirdNum").html(allThirdNum); $("#allThirdNum").html(allThirdNum);
$("#allThirdMoney").html(formatAmount(allThirdMoney.toFixed(2))); $("#allThirdMoney").html(formatAmount(allThirdMoney.toFixed(2)));
let allDiff = Math.abs(allHisMoney - allThirdMoney).toFixed(2); let allDiff = (allThirdMoney - allHisMoney).toFixed(2);
$("#allDiff").html(formatAmount(allDiff));
/*$("#allDiff").html(formatAmount(allDiff));*/
} else { } else {
layer.alert(result.errMsg); layer.alert(result.errMsg);
} }

View File

@@ -0,0 +1,141 @@
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>财付通汇款汇总表</title>
<link rel="stylesheet" th:href="@{/layui/css/layui.css}">
<link rel="stylesheet" th:href="@{/css/common.css}">
<script th:src="@{/js/common.js}"></script>
<script th:src="@{/js/html2canvas.js}"></script>
<script th:src="@{/layui/jquery-3.4.1.min.js}"></script>
<script th:src="@{/layui/layui.js}"></script>
<style>
.tableTitle {height: 20px;margin-top: 10px;margin-bottom: 10px;}
.tableName {border-left: 3px solid #0000FF;padding-left: 5px;font-size: 16px;font-weight: bold;}
.selectDate {font-size: 14px;color: rgba(0, 0, 0, 0.65)}
.printHeader {border:1px solid #000; width: 95%; margin: 10px auto; padding: 10px 0;}
.printHeader .title {text-align:center; font-size: 22px; font-weight: bold; line-height: 32px;}
.printHeader .time {padding-left: 12px; font-size: 16px;}
</style>
<script th:inline="none">
let layer, laydate, table;
layui.use(['table','laydate','layer'], function(){
table = layui.table; laydate = layui.laydate; layer = layui.layer;
laydate.render({elem: '#searchDate', type: 'date', range: '~'});
table.render({
elem: '#demo', height: 480, title: '财付通汇款汇总表', page: false, id: 'test', even: 'true',
url: '/paymentStatistics/findTenpaySummary', method: 'get',
cols: [[
{field: 'PAY_NAME', title: '支付方式', align: 'center', width: 180},
{field: 'BANK_CNT', title: '银行笔数', align: 'center', width: 120},
{field: 'BANK_AMT', title: '银行金额(元)', align: 'center', width: 160, templet: function(d){
return d.BANK_AMT ? parseFloat(d.BANK_AMT).toFixed(2) : '0.00';
}},
{field: 'HIS_CNT', title: 'HIS笔数', align: 'center', width: 120},
{field: 'HIS_AMT', title: 'HIS金额', align: 'center', width: 160, templet: function(d){
return d.HIS_AMT ? parseFloat(d.HIS_AMT).toFixed(2) : '0.00';
}}
]],
parseData: function(res){
var rows = [];
if(res.code === 0){
var bank = res.bankData || [];
var his = res.hisData || [];
var names = ['微信支付','支付宝支付','刷卡支付','退款','合计'];
function find(list,name){
for(var i=0;i<list.length;i++){ if(list[i].PAY_NAME===name) return list[i]; }
return {PAY_NAME:name, CNT:0, AMT:0};
}
for(var i=0;i<names.length;i++){
var b=find(bank,names[i]);
var h=find(his,names[i]);
rows.push({
PAY_NAME:names[i],
BANK_CNT:b.CNT||0,
BANK_AMT:b.AMT||0,
HIS_CNT:h.CNT||0,
HIS_AMT:h.AMT||0
});
}
}
return {code: res.code, msg: res.msg || '', count: rows.length, data: rows};
}
});
search();
});
function getParams(){
let param = {}; let date = $('#searchDate').val();
if(date){ let t = date.split('~'); param.startTime = t[0].trim(); param.endTime = t[1].trim(); }
return param;
}
function search(){
let param = getParams();
table.reload('test',{where:param});
let date = $('#searchDate').val(); if(date){ $('.selectDate').text(date); $('#statRange').text(date); }
}
function printById(id){
var range = $('#statRange').text() || '';
var rows = (layui.table && layui.table.cache && layui.table.cache['test']) ? layui.table.cache['test'] : [];
var printWindow = window.open('', '', 'height=800,width=1200');
var styles = '<style>\n' +
'table{width:95%;margin:10px auto;border-collapse:collapse;}\n' +
'th,td{border:1px solid #000;padding:8px;text-align:center;}\n' +
'.title{font-size:22px;font-weight:bold;line-height:32px;text-align:center;}\n' +
'.time{font-size:16px;text-align:left;padding-left:12px;}\n' +
'</style>';
var html = '<table class="printTable">' +
'<thead>' +
'<tr><th class="title" colspan="5">武警宁夏总队医院财付通汇总表</th></tr>' +
'<tr><th class="time" colspan="5">统计时间:'+ range +'</th></tr>' +
'<tr>' +
'<th>支付方式</th><th>银行笔数</th><th>银行金额(元)</th><th>HIS笔数</th><th>HIS金额</th>' +
'</tr>' +
'</thead><tbody>';
function fmt(v){ return v ? parseFloat(v).toFixed(2) : '0.00'; }
for(var i=0;i<rows.length;i++){
var r = rows[i] || {};
html += '<tr>' +
'<td>' + (r.PAY_NAME||'') + '</td>' +
'<td>' + (r.BANK_CNT||0) + '</td>' +
'<td>' + fmt(r.BANK_AMT) + '</td>' +
'<td>' + (r.HIS_CNT||0) + '</td>' +
'<td>' + fmt(r.HIS_AMT) + '</td>' +
'</tr>';
}
html += '</tbody></table>';
printWindow.document.write('<html><head><title>打印</title>'+styles+'</head><body>'+html+'<script>window.print();window.close();<\/script></body></html>');
printWindow.document.close();
}
</script>
</head>
<body class="layui-layout-body">
<div style="left:8px;right:8px;bottom:8px;top:8px;position:absolute;overflow-y:auto;">
<div class="toolbar" id="titleDiv">
<div style="display:inline-block;">
<form class="layui-form">
<div class="layui-inline">
<label class="layui-form-label">日期选择</label>
<div class="layui-input-inline">
<input type="text" class="layui-input formWidthTwo" id="searchDate" placeholder=" ~ " th:value="${startTime+' ~ '+endTime}">
</div>
</div>
<div class="layui-inline">
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="search()"><i class="layui-icon layui-icon-search"></i>查询</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="printById('tableContent')"><i class="layui-icon layui-icon-print"></i>打印</button>
</div>
</form>
</div>
</div>
<div class="content">
<div id="printHeader" class="printHeader">
<div class="title">武警宁夏总队医院财付通汇总表</div>
<div class="time">统计时间:<span id="statRange"></span></div>
</div>
<div id="tableContent">
<table id="demo" lay-filter="test"></table>
</div>
</div>
</div>
</body>
</html>