From a053811c774ac07340e46561f5d2ab4d892282a0 Mon Sep 17 00:00:00 2001 From: Administrator <1101184511@qq.com> Date: 星期一, 29 七月 2024 02:38:40 +0800 Subject: [PATCH] 渠道功能完善 --- src/test/java/com/taoke/autopay/KeyTest.java | 39 ++++++++++++++++++++++++++++++++------- 1 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/taoke/autopay/KeyTest.java b/src/test/java/com/taoke/autopay/KeyTest.java index 4c75ed2..e7b5802 100644 --- a/src/test/java/com/taoke/autopay/KeyTest.java +++ b/src/test/java/com/taoke/autopay/KeyTest.java @@ -1,11 +1,13 @@ package com.taoke.autopay; +import com.taoke.autopay.dao.KeyOrderMapper; import com.taoke.autopay.dto.DYOrderDto; import com.taoke.autopay.entity.KeyOrder; import com.taoke.autopay.entity.SystemConfigKeyEnum; import com.taoke.autopay.exception.KeyOrderException; import com.taoke.autopay.exception.KeyVerifyException; import com.taoke.autopay.exception.WxOrderCountException; +import com.taoke.autopay.manager.OrderPayFailProcessor; import com.taoke.autopay.service.KeyOrderService; import com.taoke.autopay.service.SystemConfigService; import com.taoke.autopay.utils.AlipayOrderUtil; @@ -35,13 +37,16 @@ @Resource private KeyOrderService keyOrderService; + @Resource + private OrderPayFailProcessor orderPayFailProcessor; + private void addKey(SubmitKeyInfo keyInfo, Long wxUid) throws KeyVerifyException, KeyOrderException, WxOrderCountException { // 瑙f瀽閾炬帴 List<String> urllist = UrlUtils.parseUrlsFromText(keyInfo.getKey()); String verifyAlipayKey = systemConfigService.getValueCache(SystemConfigKeyEnum.ALIPAY_KEY_VERIFY); - if(verifyAlipayKey!=null&&verifyAlipayKey.trim().equalsIgnoreCase("1")||true) { + if (verifyAlipayKey != null && verifyAlipayKey.trim().equalsIgnoreCase("1") || true) { try { // 闇�瑕侀獙璇佹敮浠樺疂鍙d护 if (urllist.size() < 1) { @@ -67,18 +72,17 @@ } // 楠岃瘉鍐呭 DYOrderDto dto = keyOrderService.verifyKey(tradeInfo.getGoodsTitle(), orderStatus, tradeInfo.getItemRealAmount()); - }catch(KeyVerifyException ee){ - throw ee; - } - catch(Exception e){ + } catch (KeyVerifyException ee) { + throw ee; + } catch (Exception e) { throw new KeyVerifyException(KeyVerifyException.CODE_COMMON, e.getMessage()); } } } @Test - public void test1() { - SubmitKeyInfo keyInfo=new SubmitKeyInfo(); + public void test1() { + SubmitKeyInfo keyInfo = new SubmitKeyInfo(); keyInfo.setKey("銆愭敮fu`瀵炽�戜翰锛屽鍒� Q:/dYsUzQV77s5 p:/S ZH2412 2020/11/27鎵撳紑鏀粯瀹濆氨鍙互甯垜馃彯浠樻鍟︷煉猦ttps://ur.alipay.com/_Ig4toHTlLHbBqiJqb3dpC"); try { addKey(keyInfo, 1L); @@ -91,4 +95,25 @@ } } + @Test + public void testRePay() throws InterruptedException { + for (int i = 0; i < 10; i++) { + orderPayFailProcessor.processPayFail("2c9d0dd55cd845819c8e6010fe10def4", "璇诲彇鏀粯瀹濈矘璐存澘瓒呮椂"); + Thread.sleep(2000); + orderPayFailProcessor.processFromQueue(); + } + } + + @Test + public void statisticAgentId() { + KeyOrderMapper.DaoQuery query=new KeyOrderMapper.DaoQuery(); + query.hasAgentId=true; + query.hasPayTime = true; + query.state =2; + query.count = 100; + + List<Long> list = keyOrderService.listAgentId(query); + System.out.println(list); + } + } -- Gitblit v1.8.0