|
@@ -1,97 +1,97 @@
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
-import com.ydtech.modules.admin.model.SysUser;
|
|
|
|
|
-import com.ydtech.modules.ins.model.ya.ExtendInfoDto;
|
|
|
|
|
-import com.ydtech.modules.inv.model.InvPayableStatement;
|
|
|
|
|
-import com.ydtech.security.utils.PasswordEncoder;
|
|
|
|
|
-import com.ydtech.security.utils.PasswordUtils;
|
|
|
|
|
-import com.ydtech.utils.SnowFlakeUtil;
|
|
|
|
|
-import com.ydtech.utils.idgen.IdGenerate;
|
|
|
|
|
-import org.mapstruct.factory.Mappers;
|
|
|
|
|
-import org.xbill.DNS.utils.base64;
|
|
|
|
|
-import sun.misc.BASE64Encoder;
|
|
|
|
|
-
|
|
|
|
|
-import java.io.File;
|
|
|
|
|
-import java.io.FileInputStream;
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
-import java.util.regex.Matcher;
|
|
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * @author qinfenglong
|
|
|
|
|
- * @version 1.0.0
|
|
|
|
|
- * @description Test
|
|
|
|
|
- * @since 2021/3/18 10:09
|
|
|
|
|
- */
|
|
|
|
|
-public class Test {
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
|
-
|
|
|
|
|
-// Pattern pattern = Pattern.compile("href=\"(.+?)\"");
|
|
|
|
|
-// Matcher matcher = pattern.matcher("<a href=\"index.html\">主页</a>");
|
|
|
|
|
-// if(matcher.find()){
|
|
|
|
|
-// System.out.println(matcher.group(1));
|
|
|
|
|
-// }
|
|
|
|
|
-// System.out.println(UUID.randomUUID());
|
|
|
|
|
|
|
+//import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+//import com.ydtech.modules.admin.model.SysUser;
|
|
|
|
|
+//import com.ydtech.modules.ins.model.ya.ExtendInfoDto;
|
|
|
|
|
+//import com.ydtech.modules.inv.model.InvPayableStatement;
|
|
|
|
|
+//import com.ydtech.security.utils.PasswordEncoder;
|
|
|
|
|
+//import com.ydtech.security.utils.PasswordUtils;
|
|
|
|
|
+//import com.ydtech.utils.SnowFlakeUtil;
|
|
|
|
|
+//import com.ydtech.utils.idgen.IdGenerate;
|
|
|
|
|
+//import org.mapstruct.factory.Mappers;
|
|
|
|
|
+//import org.xbill.DNS.utils.base64;
|
|
|
|
|
+//import sun.misc.BASE64Encoder;
|
|
|
|
|
+//
|
|
|
|
|
+//import java.io.File;
|
|
|
|
|
+//import java.io.FileInputStream;
|
|
|
|
|
+//import java.io.IOException;
|
|
|
|
|
+//import java.util.*;
|
|
|
|
|
+//import java.util.regex.Matcher;
|
|
|
|
|
+//import java.util.regex.Pattern;
|
|
|
|
|
+//import java.util.stream.Collectors;
|
|
|
//
|
|
//
|
|
|
-// System.out.println("9fcae42d-c965-42b3-86cc-fc36asbe6c90f".replace("-","").length());
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// try{
|
|
|
|
|
-//// String result = java.net.URLEncoder.encode("1X7K0pmwPVBqkw+aK91hVA==", "UTF-8");
|
|
|
|
|
-//// System.out.println(result);
|
|
|
|
|
|
|
+///**
|
|
|
|
|
+// * @author qinfenglong
|
|
|
|
|
+// * @version 1.0.0
|
|
|
|
|
+// * @description Test
|
|
|
|
|
+// * @since 2021/3/18 10:09
|
|
|
|
|
+// */
|
|
|
|
|
+//public class Test {
|
|
|
|
|
+// public static void main(String[] args) {
|
|
|
|
|
+//
|
|
|
|
|
+//// Pattern pattern = Pattern.compile("href=\"(.+?)\"");
|
|
|
|
|
+//// Matcher matcher = pattern.matcher("<a href=\"index.html\">主页</a>");
|
|
|
|
|
+//// if(matcher.find()){
|
|
|
|
|
+//// System.out.println(matcher.group(1));
|
|
|
|
|
+//// }
|
|
|
|
|
+//// System.out.println(UUID.randomUUID());
|
|
|
////
|
|
////
|
|
|
-//// String result2 = java.net.URLDecoder.decode("1X7K0pmwPVBqkw%2BaK91hVA%3D%3D", "UTF-8");
|
|
|
|
|
-//// System.out.println(result2);
|
|
|
|
|
|
|
+//// System.out.println("9fcae42d-c965-42b3-86cc-fc36asbe6c90f".replace("-","").length());
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//// try{
|
|
|
|
|
+////// String result = java.net.URLEncoder.encode("1X7K0pmwPVBqkw+aK91hVA==", "UTF-8");
|
|
|
|
|
+////// System.out.println(result);
|
|
|
|
|
+//////
|
|
|
|
|
+////// String result2 = java.net.URLDecoder.decode("1X7K0pmwPVBqkw%2BaK91hVA%3D%3D", "UTF-8");
|
|
|
|
|
+////// System.out.println(result2);
|
|
|
|
|
+//////
|
|
|
|
|
+//////
|
|
|
|
|
+////// String idno = "140110198506261034";
|
|
|
|
|
+////// System.out.println(idno.substring(6,14));
|
|
|
|
|
+////// System.out.println(idno.substring(16,17));
|
|
|
|
|
+//////
|
|
|
|
|
+////// System.out.println("02468".indexOf("0"));
|
|
|
////
|
|
////
|
|
|
|
|
+////// imageToStr("F:/a.png");
|
|
|
////
|
|
////
|
|
|
-//// String idno = "140110198506261034";
|
|
|
|
|
-//// System.out.println(idno.substring(6,14));
|
|
|
|
|
-//// System.out.println(idno.substring(16,17));
|
|
|
|
|
|
|
+//// String base64 = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYA";
|
|
|
|
|
+//// String img = "";
|
|
|
|
|
+//// if(base64.contains("data:image")){
|
|
|
|
|
+//// img = base64.substring(base64.indexOf("data:image/")+11, base64.indexOf(";base64"));
|
|
|
|
|
+//// base64 = base64.substring(base64.indexOf("base64,")+7);
|
|
|
|
|
+//// }
|
|
|
|
|
+//// System.out.println(img);
|
|
|
|
|
+//// System.out.println(base64);
|
|
|
////
|
|
////
|
|
|
-//// System.out.println("02468".indexOf("0"));
|
|
|
|
|
-//
|
|
|
|
|
-//// imageToStr("F:/a.png");
|
|
|
|
|
|
|
+//// //加密后文件字符串iVBORw0KGgoAAAANSUhEUgAAAPcAAAD3C
|
|
|
|
|
+////
|
|
|
|
|
+//// }catch(Exception e){
|
|
|
|
|
+////
|
|
|
|
|
+//// }
|
|
|
|
|
+// }
|
|
|
//
|
|
//
|
|
|
-// String base64 = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYA";
|
|
|
|
|
-// String img = "";
|
|
|
|
|
-// if(base64.contains("data:image")){
|
|
|
|
|
-// img = base64.substring(base64.indexOf("data:image/")+11, base64.indexOf(";base64"));
|
|
|
|
|
-// base64 = base64.substring(base64.indexOf("base64,")+7);
|
|
|
|
|
|
|
+// public static String imageToStr(String imgUrl) {
|
|
|
|
|
+// File file = new File(imgUrl);
|
|
|
|
|
+// FileInputStream fis = null;
|
|
|
|
|
+// String fileByteStr = "";
|
|
|
|
|
+// try {
|
|
|
|
|
+// fis = new FileInputStream(file);
|
|
|
|
|
+// byte[] bytes = new byte[(int) file.length()];
|
|
|
|
|
+// fis.read(bytes);
|
|
|
|
|
+// BASE64Encoder encoder = new BASE64Encoder();
|
|
|
|
|
+// fileByteStr = encoder.encode(bytes);
|
|
|
|
|
+// System.out.println("加密后文件字符串" + fileByteStr);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// } finally {
|
|
|
|
|
+// if (null != fis) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// fis.close();
|
|
|
|
|
+// } catch (IOException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
// }
|
|
// }
|
|
|
-// System.out.println(img);
|
|
|
|
|
-// System.out.println(base64);
|
|
|
|
|
-//
|
|
|
|
|
-// //加密后文件字符串iVBORw0KGgoAAAANSUhEUgAAAPcAAAD3C
|
|
|
|
|
-//
|
|
|
|
|
-// }catch(Exception e){
|
|
|
|
|
-//
|
|
|
|
|
// }
|
|
// }
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public static String imageToStr(String imgUrl) {
|
|
|
|
|
- File file = new File(imgUrl);
|
|
|
|
|
- FileInputStream fis = null;
|
|
|
|
|
- String fileByteStr = "";
|
|
|
|
|
- try {
|
|
|
|
|
- fis = new FileInputStream(file);
|
|
|
|
|
- byte[] bytes = new byte[(int) file.length()];
|
|
|
|
|
- fis.read(bytes);
|
|
|
|
|
- BASE64Encoder encoder = new BASE64Encoder();
|
|
|
|
|
- fileByteStr = encoder.encode(bytes);
|
|
|
|
|
- System.out.println("加密后文件字符串" + fileByteStr);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- } finally {
|
|
|
|
|
- if (null != fis) {
|
|
|
|
|
- try {
|
|
|
|
|
- fis.close();
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return fileByteStr;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+//
|
|
|
|
|
+// return fileByteStr;
|
|
|
|
|
+// }
|
|
|
|
|
+//}
|