parent
210b52ab68
commit
8989940d1f
@ -0,0 +1,19 @@ |
|||||||
|
package com.dxhy.order.consumer.modules.manager.model; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class OcrResultToyxVo { |
||||||
|
private String companyId; // 公司代码
|
||||||
|
private String source; // 来源
|
||||||
|
private String InvoiceCode; // 发票代码
|
||||||
|
private String InvoiceNumber; // 发票号码
|
||||||
|
private String totalAmount; // 合计金额
|
||||||
|
private String buyerName; // 购买方名称
|
||||||
|
private String sellerName; // 销售方名称
|
||||||
|
private String fileName; // 文件名称
|
||||||
|
private String fileType; // 文件类型
|
||||||
|
private String fileByte; //Byte[]; 文件流
|
||||||
|
private String email; // 邮箱
|
||||||
|
private String employeeId; // 员工号
|
||||||
|
} |
@ -0,0 +1,63 @@ |
|||||||
|
package com.dxhy.order.consumer.modules.manager.model; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
|
||||||
|
@AllArgsConstructor |
||||||
|
public enum SnpjInvoiceTypeEnum { |
||||||
|
|
||||||
|
|
||||||
|
ELECTRONIC_INVOICE("51","102","增值税电子普通发票"), |
||||||
|
|
||||||
|
// ELECTRONIC_INVOICE_QUKUAILIAN("119","区块链发票", ""),
|
||||||
|
// PLACE_AIRCRAFT_INVOICE("120","浙江通用机打发票", ""),
|
||||||
|
ELECTRONIC_OFD_INVOICE("52","121","增值税电子专用发票"), |
||||||
|
ELECTRONIC_TAX_SPECIAL_INVOICE("31","130","电子发票(增值税专用发票)"), |
||||||
|
ELECTRONIC_TAX_INVOICE("32","131","电子发票(普通发票)"), |
||||||
|
// FINAL_STATEMENT("200","结算单", ""),
|
||||||
|
// RECEIPT_OF_RECEIPT("201","验收单", ""),
|
||||||
|
; |
||||||
|
|
||||||
|
private String key; |
||||||
|
|
||||||
|
private String value; |
||||||
|
|
||||||
|
private String msg; |
||||||
|
|
||||||
|
public String getKey() { |
||||||
|
return key; |
||||||
|
} |
||||||
|
|
||||||
|
public void setKey(String key) { |
||||||
|
this.key = key; |
||||||
|
} |
||||||
|
|
||||||
|
public String getValue() { |
||||||
|
return value; |
||||||
|
} |
||||||
|
|
||||||
|
public void setValue(String value) { |
||||||
|
this.value = value; |
||||||
|
} |
||||||
|
|
||||||
|
public String getMsg() { |
||||||
|
return msg; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMsg(String msg) { |
||||||
|
this.msg = msg; |
||||||
|
} |
||||||
|
|
||||||
|
public static String getVal(String key) { |
||||||
|
for (SnpjInvoiceTypeEnum typeEnum : SnpjInvoiceTypeEnum.values()) { |
||||||
|
if (typeEnum.key.equals(key)) { |
||||||
|
return typeEnum.getValue(); |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
String val = getVal("00"); |
||||||
|
System.out.println(val); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,84 @@ |
|||||||
|
package com.dxhy.order.consumer.utils; |
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets; |
||||||
|
import java.security.MessageDigest; |
||||||
|
import java.security.NoSuchAlgorithmException; |
||||||
|
|
||||||
|
public class MD5 { |
||||||
|
|
||||||
|
/** |
||||||
|
* 获得随机数字 |
||||||
|
* |
||||||
|
* @param num |
||||||
|
* 位数 |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
public static String getRandom(int num) { |
||||||
|
double key = Math.random() * 100000; |
||||||
|
StringBuilder result = new StringBuilder(Integer.toString((int)key)); |
||||||
|
if (result.length() > num) { |
||||||
|
result = new StringBuilder(result.substring(result.length() - num)); |
||||||
|
} else { |
||||||
|
for (int i = num - result.length(); i > 0; i--) { |
||||||
|
result.insert(0, "0"); |
||||||
|
} |
||||||
|
} |
||||||
|
return result.toString(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取Md5码 |
||||||
|
* |
||||||
|
* @param key |
||||||
|
* @return String |
||||||
|
* @throws NoSuchAlgorithmException |
||||||
|
*/ |
||||||
|
public static String getEncode(String key) throws NoSuchAlgorithmException { |
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5"); |
||||||
|
messageDigest.update(key.getBytes(StandardCharsets.UTF_8)); |
||||||
|
byte[] digest = messageDigest.digest(); |
||||||
|
int j = digest.length; |
||||||
|
char[] str = new char[j * 2]; |
||||||
|
int k = 0; |
||||||
|
for (byte byte0 : digest) { |
||||||
|
str[k++] = hexDigits[byte0 >>> 4 & 0xf]; |
||||||
|
str[k++] = hexDigits[byte0 & 0xf]; |
||||||
|
} |
||||||
|
|
||||||
|
return new String(str); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getEncode(byte[] key) throws NoSuchAlgorithmException { |
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5"); |
||||||
|
messageDigest.update(key); |
||||||
|
byte[] digest = messageDigest.digest(); |
||||||
|
int j = digest.length; |
||||||
|
char[] str = new char[j * 2]; |
||||||
|
int k = 0; |
||||||
|
for (byte byte0 : digest) { |
||||||
|
str[k++] = hexDigits[byte0 >>> 4 & 0xf]; |
||||||
|
str[k++] = hexDigits[byte0 & 0xf]; |
||||||
|
} |
||||||
|
|
||||||
|
return new String(str); |
||||||
|
} |
||||||
|
|
||||||
|
public static String getMd5Encode(String key) throws NoSuchAlgorithmException { |
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5"); |
||||||
|
messageDigest.update(key.getBytes(StandardCharsets.UTF_8)); |
||||||
|
byte[] digest = messageDigest.digest(); |
||||||
|
int j = digest.length; |
||||||
|
char[] str = new char[j * 2]; |
||||||
|
int k = 0; |
||||||
|
for (byte byte0 : digest) { |
||||||
|
str[k++] = hex[byte0 >>> 4 & 0xf]; |
||||||
|
str[k++] = hex[byte0 & 0xf]; |
||||||
|
} |
||||||
|
|
||||||
|
return new String(str); |
||||||
|
} |
||||||
|
|
||||||
|
static final char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; |
||||||
|
static final char[] hex = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue