admin
2024-06-24 5d3b3b74afd2ac4cf21697fc38367b2f88170e9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.taoke.autopay;
 
import com.taoke.autopay.entity.KeyOrder;
import org.junit.jupiter.api.Test;
import org.yeshi.utils.generater.mybatis.MyBatisMapperUtil;
 
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
/**
 * @author hxh
 * @title: MapperTest
 * @description: TODO
 * @date 2024/6/14 18:25
 */
public class MapperTest {
 
    @Test
    public void test() {
//        MyBatisMapperUtil.createMapper(ClientInfo.class);
//        MyBatisMapperUtil.createMapper(KeyOrder.class);
        String orderNoStr = "抖音电商商家 即时到账--抖音电商-订单编号6931067415405008690";
        Pattern pattern = Pattern.compile("\\d+"); // 匹配连续的数字
        Matcher matcher = pattern.matcher(orderNoStr);
        while (matcher.find()) {
            String number = matcher.group(); // 获取匹配到的数字字符串
            if(number.length()>10){
                orderNoStr = number;
                break;
            }
        }
        System.out.println(orderNoStr);
 
 
    }
 
}