From 475cc8f4f41552f06d061a0876a37c4852db1dc9 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Fri, 31 Oct 2025 11:17:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=AF=BC=E5=85=A5=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvoiceNameRecognitionBillPlugin.java | 5 +- .../zcdev/zcdev/pr/utils/InvoiceTypeEnum.java | 60 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/utils/InvoiceTypeEnum.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InvoiceNameRecognitionBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InvoiceNameRecognitionBillPlugin.java index e39b7a2..c1d476b 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InvoiceNameRecognitionBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InvoiceNameRecognitionBillPlugin.java @@ -19,8 +19,8 @@ import kd.ec.basedata.common.enums.DefaultEnum; import kd.ec.basedata.common.invoicecloud.InvoiceDataHandleHelper; import kd.ec.basedata.common.invoicecloud.bean.InvoiceItemVO; import kd.ec.basedata.common.invoicecloud.bean.InvoiceVO; -import kd.ec.basedata.common.invoicecloud.enumeration.InvoiceTypeEnum; import kd.ec.basedata.common.utils.TextHelper; +import zcgj.zcdev.zcdev.pr.utils.InvoiceTypeEnum; import java.math.BigDecimal; import java.text.ParseException; @@ -28,6 +28,9 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; +/** + * 发票导入名称识别 + */ public class InvoiceNameRecognitionBillPlugin extends InvoiceDataHandleHelper { private static final Log log = LogFactory.getLog(InvoiceNameRecognitionBillPlugin.class); public static DynamicObject generateInvoiceByVO(InvoiceVO invoiceVO, MainEntityType dt, long id, long userID, long orgID, Date date, DynamicObject currency) { diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/utils/InvoiceTypeEnum.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/utils/InvoiceTypeEnum.java new file mode 100644 index 0000000..3b470fa --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/utils/InvoiceTypeEnum.java @@ -0,0 +1,60 @@ +package zcgj.zcdev.zcdev.pr.utils; + +import kd.ec.basedata.common.enums.MultiLangEnumBridge; +import org.apache.commons.lang3.StringUtils; + +public enum InvoiceTypeEnum { + OE("1", new MultiLangEnumBridge("普通电子发票", "InvoiceTypeEnum_0", "ec-ecbd-common")), + SE("2", new MultiLangEnumBridge("电子发票专票", "InvoiceTypeEnum_1", "ec-ecbd-common")), + OP("3", new MultiLangEnumBridge("普通纸质发票", "InvoiceTypeEnum_2", "ec-ecbd-common")), + SP("4", new MultiLangEnumBridge("专用纸质发票", "InvoiceTypeEnum_3", "ec-ecbd-common")), + OPR("5", new MultiLangEnumBridge("普通纸质卷票", "InvoiceTypeEnum_4", "ec-ecbd-common")), + OM("7", new MultiLangEnumBridge("通用机打", "InvoiceTypeEnum_5", "ec-ecbd-common")), + TAXI("8", new MultiLangEnumBridge("的士票", "InvoiceTypeEnum_6", "ec-ecbd-common")), + TRAIN("9", new MultiLangEnumBridge("火车票", "InvoiceTypeEnum_7", "ec-ecbd-common")), + PLANE("10", new MultiLangEnumBridge("飞机票", "InvoiceTypeEnum_8", "ec-ecbd-common")), + OTHER("11", new MultiLangEnumBridge("其他", "InvoiceTypeEnum_9", "ec-ecbd-common")), + MOTOR("12", new MultiLangEnumBridge("机动车", "InvoiceTypeEnum_10", "ec-ecbd-common")), + UC("13", new MultiLangEnumBridge("二手车", "InvoiceTypeEnum_11", "ec-ecbd-common")), + QUOTA("14", new MultiLangEnumBridge("定额发票", "InvoiceTypeEnum_12", "ec-ecbd-common")), + PASS("15", new MultiLangEnumBridge("通行费", "InvoiceTypeEnum_13", "ec-ecbd-common")), + PT("16", new MultiLangEnumBridge("客运发票", "InvoiceTypeEnum_14", "ec-ecbd-common")), + PB("17", new MultiLangEnumBridge("过路过桥费", "InvoiceTypeEnum_15", "ec-ecbd-common")), + DPP("19", new MultiLangEnumBridge("完税证明", "InvoiceTypeEnum_16", "ec-ecbd-common")), + SHIP("20", new MultiLangEnumBridge("轮船票", "InvoiceTypeEnum_17", "ec-ecbd-common")), + CUSTOMS("21", new MultiLangEnumBridge("海关缴款书", "InvoiceTypeEnum_18", "ec-ecbd-common")), + OME("23", new MultiLangEnumBridge("通用机打电子发票", "InvoiceTypeEnum_19", "ec-ecbd-common")), + TBP("24", new MultiLangEnumBridge("火车票退票凭证", "InvoiceTypeEnum_20", "ec-ecbd-common")), + FE("25", new MultiLangEnumBridge("财政电子票据", "InvoiceTypeEnum_21", "ec-ecbd-common")), + DOE("26", new MultiLangEnumBridge("数电发票(普通发票)", "InvoiceTypeEnum_26", "ec-ecbd-common")),//参考 发票类型(发票云) + DSP("27", new MultiLangEnumBridge("数电发票(增值税专用发票)", "InvoiceTypeEnum_27", "ec-ecbd-common"));//参考 发票类型(发票云) + + + public String value; + public MultiLangEnumBridge name; + + private InvoiceTypeEnum(String value, MultiLangEnumBridge name) { + this.value = value; + this.name = name; + } + + public String getValue() { + return this.value; + } + + public String getName() { + return this.name.loadKDString(); + } + + public static InvoiceTypeEnum getEnumByValue(Object value) { + if (value != null) { + for(InvoiceTypeEnum enums : values()) { + if (StringUtils.equals(value.toString(), enums.getValue())) { + return enums; + } + } + } + + return null; + } +} \ No newline at end of file