| | |
| | | //未设置支付参数,则使用默认支付参数 |
| | | config = getOne(Wrappers.lambdaQuery(WxConfigEntity.class).eq(WxConfigEntity::getClientId, pole.getClientId()).eq(WxConfigEntity::getState, 1)); |
| | | // if (pole.getClientId() == null) { |
| | | // config = getById(15); // todo 暂时写死,后续需要改成配置文件 |
| | | //没有归属的灯杆使用默认配置 |
| | | // config = getById(15); |
| | | // } |
| | | if (config == null) { |
| | | throw new BusinessException("用户未配置支付配置,请配置后重试"); |
| | |
| | | return config; |
| | | } |
| | | |
| | | public WxConfigEntity getConfigByAppId(String appId) { |
| | | if (appId == null) { |
| | | throw new BusinessException("回调失败,未解析到appid"); |
| | | } |
| | | WxConfigEntity config; |
| | | //未设置支付参数,则使用默认支付参数 |
| | | config = getOne(Wrappers.lambdaQuery(WxConfigEntity.class).eq(WxConfigEntity::getAppappid, appId).eq(WxConfigEntity::getState, 1)); |
| | | |
| | | public static UsrWxPayConfigService getBean() { |
| | | return (UsrWxPayConfigService) SpringContextUtil.getBean("UsrWxPayConfigService"); |
| | | if (config == null) { |
| | | throw new BusinessException("未找到支付配置或配置未启用,请联系管理员!"); |
| | | } |
| | | // if (pole.getClientId() == null) { |
| | | //没有归属的灯杆使用默认配置 |
| | | // config = getById(15); |
| | | // } |
| | | return config; |
| | | } |
| | | |
| | | |
| | |
| | | ); |
| | | } |
| | | List<WxConfigEntity> list = list(wrapper); |
| | | list.forEach( |
| | | wxConfigEntity -> { |
| | | //设置支付参数中的appid和appappid mchId和privateKey中的部分替换为* |
| | | wxConfigEntity.setAppid(wxConfigEntity.getAppid().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | wxConfigEntity.setAppappid(wxConfigEntity.getAppappid().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | wxConfigEntity.setMchId(wxConfigEntity.getMchId().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | wxConfigEntity.setPrivateKey(wxConfigEntity.getPrivateKey().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | wxConfigEntity.setAppSecret(wxConfigEntity.getAppSecret().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | } |
| | | ); |
| | | // list.forEach( |
| | | // wxConfigEntity -> { |
| | | // //设置支付参数中的appid和appappid mchId和privateKey中的部分替换为* |
| | | // wxConfigEntity.setAppid(wxConfigEntity.getAppid().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | // wxConfigEntity.setAppappid(wxConfigEntity.getAppappid().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | // wxConfigEntity.setMchId(wxConfigEntity.getMchId().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | // wxConfigEntity.setPrivateKey(wxConfigEntity.getPrivateKey().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | // wxConfigEntity.setAppSecret(wxConfigEntity.getAppSecret().replaceAll("(?<=.{4}).*(?=.{4})", "*")); |
| | | // } |
| | | // ); |
| | | return list; |
| | | } |
| | | |