From 17caebabf7a6a529b7039c71e21e5a324e31ea20 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 27 九月 2024 16:23:42 +0800 Subject: [PATCH] 代理新功能完善 --- src/test/java/com/taoke/autopay/KeyTest.java | 79 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/taoke/autopay/KeyTest.java b/src/test/java/com/taoke/autopay/KeyTest.java index e7b5802..f201baf 100644 --- a/src/test/java/com/taoke/autopay/KeyTest.java +++ b/src/test/java/com/taoke/autopay/KeyTest.java @@ -3,14 +3,16 @@ import com.taoke.autopay.dao.KeyOrderMapper; import com.taoke.autopay.dto.DYOrderDto; import com.taoke.autopay.entity.KeyOrder; +import com.taoke.autopay.entity.OrderCountTypeEnum; import com.taoke.autopay.entity.SystemConfigKeyEnum; +import com.taoke.autopay.entity.WxUserSettings; 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.service.*; import com.taoke.autopay.utils.AlipayOrderUtil; +import com.taoke.autopay.utils.Constant; import com.taoke.autopay.utils.TimeUtil; import com.taoke.autopay.vo.SubmitKeyInfo; import org.junit.jupiter.api.Test; @@ -18,6 +20,7 @@ import org.yeshi.utils.UrlUtils; import javax.annotation.Resource; +import java.util.Collections; import java.util.Date; import java.util.List; @@ -36,6 +39,9 @@ @Resource private KeyOrderService keyOrderService; + + @Resource + private KeyOrderMapper keyOrderMapper; @Resource private OrderPayFailProcessor orderPayFailProcessor; @@ -71,7 +77,7 @@ throw new Exception("鍙d护鍐呭鑾峰彇澶辫触"); } // 楠岃瘉鍐呭 - DYOrderDto dto = keyOrderService.verifyKey(tradeInfo.getGoodsTitle(), orderStatus, tradeInfo.getItemRealAmount()); + DYOrderDto dto = keyOrderService.verifyKey(tradeInfo.getGoodsTitle(), orderStatus, tradeInfo.getItemRealAmount(),null, null); } catch (KeyVerifyException ee) { throw ee; } catch (Exception e) { @@ -83,9 +89,13 @@ @Test public void test1() { SubmitKeyInfo keyInfo = new SubmitKeyInfo(); - keyInfo.setKey("銆愭敮fu`瀵炽�戜翰锛屽鍒� Q:/dYsUzQV77s5 p:/S ZH2412 2020/11/27鎵撳紑鏀粯瀹濆氨鍙互甯垜馃彯浠樻鍟︷煉猦ttps://ur.alipay.com/_Ig4toHTlLHbBqiJqb3dpC"); + keyInfo.setKey("銆愭敮.f.u.瀹濄�戜翰锛屽鍒� m:/AYyvvyJ32pG Y:/e CA8474 2021/01/18鎵撳紑鏀粯瀹漒uD83C\uDFEE灏卞彲浠ュ府鎴慭uD83C\uDFEE浠樻鍟uD83C\uDFEEhttps://ur.alipay.com/_1kIJISKdMN6PREE9laoYWS"); try { addKey(keyInfo, 1L); + KeyOrder keyOrder=new KeyOrder(); + keyOrder.setId("test21123123"); + keyOrder.setKey(keyInfo.getKey()); + keyOrderMapper.insertSelective(keyOrder); } catch (KeyVerifyException e) { e.printStackTrace(); } catch (KeyOrderException e) { @@ -116,4 +126,65 @@ System.out.println(list); } + @Test + public void repaire(){ + KeyOrderMapper.DaoQuery query=new KeyOrderMapper.DaoQuery(); + query.state=3; + query.minCreateTime=new Date(TimeUtil.convertToTimeTemp("2024-08-02","yyyy-MM-dd")); + query.stateDesc="璁㈠崟宸叉敮浠�"; + query.count = 1000; + List<KeyOrder> list = keyOrderService.list(query); + for(KeyOrder o:list){ + KeyOrder update=new KeyOrder(); + update.setId(o.getId()); + update.setState(KeyOrder.STATE_PAY); + update.setPayTime(o.getExcutePayTime()); + keyOrderService.update(update); + } + + } + + @Resource + private ClientInfoService clientInfoService; + + @Test + public void test2(){ + List<Long> clientIds = clientInfoService.getRePayClientIds(); + if (clientIds!=null&&clientIds.size()>0) { + Collections.shuffle(clientIds); + // 鏌ヨ璁惧鏈墽琛岀殑鏁伴噺 + for(Long cuid:clientIds) { + KeyOrderMapper.DaoQuery daoQuery = new KeyOrderMapper.DaoQuery(); + daoQuery.distributeClientUid =cuid; + daoQuery.state = KeyOrder.STATE_NOT_PAY; + daoQuery.minCreateTime=new Date(System.currentTimeMillis() - 1000*60*30L); + long count = keyOrderService.count(daoQuery); + if(count <=1){ + // 鍒嗛厤 + System.out.println( cuid); + } + } + } + + + } + + @Resource + private WxUserSettingService wxUserSettingService; + + @Resource + private WxUserOrderCountService wxUserOrderCountService; + + @Test + public void testCount() throws Exception{ + + + } + + @Test + public void testSettle(){ + keyOrderService.statisticChannelOrders(5L,new Date(TimeUtil.convertToTimeTemp("20240809","yyyyMMdd")),new Date(TimeUtil.convertToTimeTemp("20240810","yyyyMMdd"))); + } + + } -- Gitblit v1.8.0