|
@@ -1,11 +1,14 @@
|
|
|
package fcb.project.manager.base.utils;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.security.MessageDigest;
|
|
|
+import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -14,6 +17,7 @@ import java.util.*;
|
|
|
* @desciption
|
|
|
*/
|
|
|
@Component
|
|
|
+@Log4j2
|
|
|
public class DataUtils {
|
|
|
|
|
|
public static BigDecimal getBigDecimalObj(Object data) {
|
|
@@ -134,4 +138,36 @@ public class DataUtils {
|
|
|
});
|
|
|
return treemap;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 生成MD5 32位小写字符的密码串
|
|
|
+ * */
|
|
|
+ public static String encryption(String OrderNo) {
|
|
|
+ String result = OrderNo+"354039456123789"+"andriod";
|
|
|
+ String re_md5 = new String();
|
|
|
+ try {
|
|
|
+ MessageDigest md = MessageDigest.getInstance("MD5");
|
|
|
+ md.update(result.getBytes());
|
|
|
+ byte b[] = md.digest();
|
|
|
+ StringBuffer buf = new StringBuffer("");
|
|
|
+ int i;
|
|
|
+ for (int offset = 0; offset < b.length; offset++) {
|
|
|
+ i = b[offset];
|
|
|
+ if (i < 0){
|
|
|
+ i += 256;
|
|
|
+ }
|
|
|
+ if (i < 16){
|
|
|
+ buf.append("0");
|
|
|
+ }
|
|
|
+ buf.append(Integer.toHexString(i));
|
|
|
+ }
|
|
|
+ re_md5 = buf.toString();
|
|
|
+ } catch (NoSuchAlgorithmException e) {
|
|
|
+ log.info("生成MD5密码出错了:{}" , e);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return re_md5.toLowerCase();
|
|
|
+ }
|
|
|
+
|
|
|
}
|