You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					78 lines
				
				2.5 KiB
			
		
		
			
		
	
	
					78 lines
				
				2.5 KiB
			| 
								 
											3 years ago
										 
									 | 
							
								package com.ynxbd.common.dao.his;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import com.ynxbd.common.helper.his.HisEnum;
							 | 
						||
| 
								 | 
							
								import com.ynxbd.common.helper.his.HisHelper;
							 | 
						||
| 
								 | 
							
								import com.ynxbd.common.result.JsonResult;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import java.util.HashMap;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @Author wsq
							 | 
						||
| 
								 | 
							
								 * @Date 2021/4/7 13:29
							 | 
						||
| 
								 | 
							
								 * @Copyright @ 2020 云南新八达科技有限公司 All rights reserved.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								public class HisAccountDao {
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 查询对账报表
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param begTime 开始时间
							 | 
						||
| 
								 | 
							
								     * @param endTime 结束时间
							 | 
						||
| 
								 | 
							
								     * @return list
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    public JsonResult getStatement(String begTime, String endTime) {
							 | 
						||
| 
								 | 
							
								        if (begTime == null || endTime == null) {
							 | 
						||
| 
								 | 
							
								            return HisHelper.createErrorResult("时间范围为空");
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        HashMap<String, Object> params = new HashMap<>();
							 | 
						||
| 
								 | 
							
								        params.put("StartTime", begTime);
							 | 
						||
| 
								 | 
							
								        params.put("EndTime", endTime);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        return HisHelper.getJsonResult(HisEnum.AP_Query_Statement, params);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * 查询交易流水
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param begDate          开始时间
							 | 
						||
| 
								 | 
							
								     * @param endDate          结束时间
							 | 
						||
| 
								 | 
							
								     * @param tradeNo          HIS交易流水号
							 | 
						||
| 
								 | 
							
								     * @param dateType         日期类型:{0:交易日期, 1:就诊日期}
							 | 
						||
| 
								 | 
							
								     * @param isContainsRefund 是否包含负交易:{0:不包含负交易,当使用此参数时,负交易对应的正交易也将不会出现; 1包含负交易 }
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    public JsonResult getTransaction(String begDate, String endDate, String tradeNo, Integer dateType, Integer isContainsRefund) {
							 | 
						||
| 
								 | 
							
								        return HisHelper.getJsonResult(HisEnum.AP_Query_Transaction, params->{
							 | 
						||
| 
								 | 
							
								            params.put("StartDate", begDate);
							 | 
						||
| 
								 | 
							
								            params.put("EndDate", endDate);
							 | 
						||
| 
								 | 
							
								            params.put("TransNo", tradeNo);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            params.put("DateType", dateType == null ? 0 : dateType);
							 | 
						||
| 
								 | 
							
								            params.put("IsContainsRefund", isContainsRefund == null ? 0 : isContainsRefund);
							 | 
						||
| 
								 | 
							
								        });
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * His是否支付过
							 | 
						||
| 
								 | 
							
								     *
							 | 
						||
| 
								 | 
							
								     * @param begDate 开始时间
							 | 
						||
| 
								 | 
							
								     * @param endDate 结束时间
							 | 
						||
| 
								 | 
							
								     * @param tradeNo HIS交易流水号
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    public String isPaid(String begDate, String endDate, String tradeNo) {
							 | 
						||
| 
								 | 
							
								        JsonResult JsonResult = getTransaction(begDate, endDate, tradeNo, 0, 0);
							 | 
						||
| 
								 | 
							
								        if (JsonResult.success() ) { // 已记账不退费
							 | 
						||
| 
								 | 
							
								//            JsonResult.setMessage("His已记账");
							 | 
						||
| 
								 | 
							
								            return "His已记账";
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        if (JsonResult.isTimeout()) { // 超时不退费
							 | 
						||
| 
								 | 
							
								            return "His请求异常";
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        return null;
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								}
							 |