From f318c9c7c127b00f353bf45f273096d1dc4b424f Mon Sep 17 00:00:00 2001
From: admin <1101184511@qq.com>
Date: 星期三, 20 八月 2025 01:10:48 +0800
Subject: [PATCH] 功能完善

---
 src/test/java/com/taoke/autopay/AutopayApplicationTests.java |   59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/src/test/java/com/taoke/autopay/AutopayApplicationTests.java b/src/test/java/com/taoke/autopay/AutopayApplicationTests.java
index 5547e41..326e584 100644
--- a/src/test/java/com/taoke/autopay/AutopayApplicationTests.java
+++ b/src/test/java/com/taoke/autopay/AutopayApplicationTests.java
@@ -3,9 +3,13 @@
 import com.taoke.autopay.dao.ClientInfoMapper;
 import com.taoke.autopay.dao.KeyOrderMapper;
 import com.taoke.autopay.entity.ClientInfo;
+import com.taoke.autopay.entity.KeyOrder;
+import com.taoke.autopay.entity.OrderCountTypeEnum;
 import com.taoke.autopay.entity.OrderDistributeCountInfo;
 import com.taoke.autopay.exception.KeyOrderException;
+import com.taoke.autopay.service.ClientInfoService;
 import com.taoke.autopay.service.KeyOrderService;
+import com.taoke.autopay.utils.Constant;
 import com.taoke.autopay.utils.StringUtil;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -14,11 +18,14 @@
 import java.util.Date;
 import java.util.List;
 
-//@SpringBootTest
+@SpringBootTest
 class AutopayApplicationTests {
 
     @Resource
     private ClientInfoMapper mapper;
+
+    @Resource
+    private ClientInfoService clientInfoService;
 
     @Resource
     private KeyOrderService keyOrderService;
@@ -27,21 +34,53 @@
     private KeyOrderMapper keyOrderMapper;
 
     @Test
-    void test2() throws KeyOrderException {
+    void addClientInfo() {
+        for (int i = 4; i < 50; i++) {
+            ClientInfo info = new ClientInfo();
+            info.setRule(0);
+            info.setAccount("c" + i);
+            info.setPwd("e10adc3949ba59abbe56e057f20f883e");
+            info.setCreateTime(new Date());
+            info.setName("瀹㈡埛绔�" + i);
+            mapper.insertSelective(info);
+        }
+    }
 
-        keyOrderService.addKeyOrder("銆怽uD83D\uDC4D z h`i浠樺疂\uD83D\uDC4D銆戜翰锛屽鍒� T:/TQEx7jy96Gr  o:/b CA5742 2020/12/07鎵撳紑鏀粯瀹濆氨鍙互甯垜\uD83C\uDFEE浠樻鍟uD83D\uDCAAhttps://ur.alipay.com/_72G9ZwXA6jz28jdJUNhUx7");
+
+    @Test
+    void test4() {
+        clientInfoService.logout(3L);
     }
 
     @Test
     void test3() throws Exception {
+        for (int i = 0; i < 100; i++) {
+            Long uid = keyOrderService.getCanDistributeUid(Constant.MAX_PAY_ACCOUNT_QUEUE_SIZE);
+            System.out.println(uid);
+        }
+    }
 
-        Long uid =  keyOrderService.getCanDistributeUid();
-        System.out.println(uid);
+    @Test
+    void testOrder(){
+        String id="63f06977c49d0c5ec2b4c556010cea4b";
+        KeyOrder old = keyOrderMapper.selectByPrimaryKeyForUpdate(id);
+        if(old==null){
+            return;
+        }
+
+        KeyOrder orderUpdate = new KeyOrder();
+        orderUpdate.setId(id);
+        orderUpdate.setState(KeyOrder.STATE_PAY);
+        orderUpdate.setStateDesc("鏀粯鎴愬姛");
+        if(old.getPayTime()==null){
+            orderUpdate.setPayTime(new Date());
+        }
+        keyOrderService.update(orderUpdate);
     }
 
     @Test
     void contextLoads() {
-        ClientInfo info=new ClientInfo();
+        ClientInfo info = new ClientInfo();
         info.setName("瓒呯骇绠$悊鍛�");
         info.setAccount("admin");
         info.setPwd(StringUtil.Md5("123456"));
@@ -49,11 +88,11 @@
         info.setRule(ClientInfo.RULE_ADMIN);
         mapper.insertSelective(info);
 
-        ClientInfoMapper.DaoQuery query=new ClientInfoMapper.DaoQuery();
-        query.count=10;
+        ClientInfoMapper.DaoQuery query = new ClientInfoMapper.DaoQuery();
+        query.count = 10;
         query.start = 0;
-       List<ClientInfo> list = mapper.list(query);
-       System.out.println(list.size());
+        List<ClientInfo> list = mapper.list(query);
+        System.out.println(list.size());
 
     }
 

--
Gitblit v1.8.0