| 
					
				 | 
			
			
				@ -20,6 +20,7 @@ import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -46,33 +47,40 @@ public class YlzService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     *药柜预缴金充值--易慧 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param orgCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param operatorId 自助机编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param equ_num 药柜设备号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param ssc 社保卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param depositType 支付方式ALI_QR 支付宝二维码支付;WX_QR微信二维码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param amount 金额 单位元 2位小数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param outChargeNo 流水号 后续查询结果需要用到 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param hisCustId 患者his系统编号 可传身份证 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param userName 患者名字 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param notifyUrl 后端回调地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param returnUrl 支付成功后中转地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject hlwyyRecharge(String orgCode,String operatorId,String ssc,String depositType,String amount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    String outChargeNo,String hisCustId,String userName,String notifyUrl,String returnUrl){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject hlwyyRecharge(String orgCode,String equ_num,String ssc,String depositType,String amount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    String hisCustId,String userName,String returnUrl){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,String> param = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("orgCode",orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("operatorId",operatorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("equ_num",equ_num); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("ssc",ssc); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("depositType",depositType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("amount",amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("outChargeNo",outChargeNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("outChargeNo",uuid);//流水号 后续查询结果需要用到 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isBlank(hisCustId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            hisCustId = ssc; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("hisCustId",hisCustId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("userName",userName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(notifyUrl)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            param.put("notifyUrl",userName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = " select dict_code from wlyy_hospital_sys_dict where dict_name='ylz_notifyUrl' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<String> notifyUrls = jdbcTemplate.queryForList(sql,String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (notifyUrls.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            param.put("notifyUrl",notifyUrls.get(0));//notifyUrl 后端回调地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(returnUrl)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            param.put("returnUrl",returnUrl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            param.put("returnUrl","http://10.95.22.10:9660/"+returnUrl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject re = wlyyHttpService.sendWlyyMes("hlwyyRecharge", null,param); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -90,15 +98,15 @@ public class YlzService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     *智慧药柜预缴金充值结果查询--易慧 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param orgCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param operatorId 自助机编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param equ_num 药柜设备号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param tradeType 充值:hop.trade.recharge 退费:hop.trade.refund 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param outTradeNo 流水号 对应充值接口outChargeNo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject hlwyyQueryDetail(String orgCode,String operatorId,String tradeType,String outTradeNo){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject hlwyyQueryDetail(String orgCode,String equ_num,String tradeType,String outTradeNo){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,String> param = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("orgCode",orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("operatorId",operatorId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("equ_num",equ_num); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("tradeType",tradeType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        param.put("outTradeNo",outTradeNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -115,7 +123,7 @@ public class YlzService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 药柜自助机-医保接口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 药柜自助机-医保接口(弃用) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param apiStr 接口名称 如:fsi.terminal.readcard 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param orgCode 药柜索要机构编码 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param dataInfo 医保参数data信息 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -256,4 +264,16 @@ public class YlzService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void hlwyyRechargeNotify(String response)throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setCode("hlwyyRecharge_NotifyUrl"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setRequest(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setResponse(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setName("智能药柜预缴金充值回调数据接收"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setStatus("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        wlyyHttpLogDO.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        httpLogDao.save(wlyyHttpLogDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("回调参数:{}", response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |