| | |
| | | package org.lxzn; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.io.file.FileReader; |
| | | import cn.hutool.core.io.file.FileWriter; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.system.util.SM3Util; |
| | | import org.junit.Test; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.*; |
| | |
| | | System.out.println(startDate); |
| | | } |
| | | |
| | | @Test |
| | | public void test45() { |
| | | List<Integer> list= new ArrayList<>(); |
| | | list.add(1); |
| | | list.add(2); |
| | | list.add(3); |
| | | list.add(4); |
| | | int i = 2; |
| | | for (Integer integer : list) { |
| | | if (integer == i) { |
| | | continue; |
| | | } |
| | | System.out.println(integer); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void test46() { |
| | | String date = LocalDate.now().minusDays(1).toString(); |
| | | System.out.println(date); |
| | | } |
| | | |
| | | @Test |
| | | public void test47() { |
| | | String date = LocalDate.now().minusDays(1).toString(); |
| | | String replace = date.replace("-", ""); |
| | | System.out.println(replace); |
| | | } |
| | | |
| | | @Test |
| | | public void test48() throws IOException { |
| | | List<String> list = new ArrayList<>(); |
| | | list.add("test1"); |
| | | list.add("test2"); |
| | | FileWriter writer = new FileWriter("D:\\data\\test.xml"); |
| | | writer.writeLines(list); |
| | | } |
| | | |
| | | @Test |
| | | public void test49() { |
| | | String token = ""; |
| | | if (StringUtils.isNotBlank(token)) { |
| | | System.out.println("不为空"); |
| | | } else { |
| | | System.out.println("为空"); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void test50() { |
| | | String fileName = "0120241224000001.xml"; |
| | | String substring = fileName.substring(fileName.length() - 10, fileName.length() - 4); |
| | | String substring2 = fileName.substring(fileName.length() - 18, fileName.length() - 10); |
| | | System.out.println(substring); |
| | | System.out.println(substring2); |
| | | } |
| | | |
| | | @Test |
| | | public void test51() { |
| | | String pwd = "123"; |
| | | String encrypt = SM3Util.encrypt(pwd); |
| | | System.out.println(encrypt); |
| | | } |
| | | |
| | | @Test |
| | | public void test52() { |
| | | String loFilePath = "D:\\data\\0120241226000001.xml"; |
| | | FileReader fileReader = new FileReader(loFilePath); |
| | | String s1 = fileReader.readString(); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | } |