diff --git a/bgd/PP-StructureV3.yaml b/bgd/PP-StructureV3.yaml new file mode 100644 index 00000000..62278e98 --- /dev/null +++ b/bgd/PP-StructureV3.yaml @@ -0,0 +1,235 @@ + +pipeline_name: PP-StructureV3 + +batch_size: 8 + +use_doc_preprocessor: False +use_seal_recognition: False +use_table_recognition: True +use_formula_recognition: True +use_chart_recognition: False +use_region_detection: True +format_block_content: False +markdown_ignore_labels: + - number + - footnote + - header + - header_image + - footer + - footer_image + - aside_text + +SubModules: + LayoutDetection: + module_name: layout_detection + model_name: PP-DocLayout_plus-L + model_dir: null + batch_size: 8 + threshold: + 0: 0.3 # paragraph_title + 1: 0.5 # image + 2: 0.4 # text + 3: 0.5 # number + 4: 0.5 # abstract + 5: 0.5 # content + 6: 0.5 # figure_table_chart_title + 7: 0.3 # formula + 8: 0.5 # table + 9: 0.5 # reference + 10: 0.5 # doc_title + 11: 0.5 # footnote + 12: 0.5 # header + 13: 0.5 # algorithm + 14: 0.5 # footer + 15: 0.45 # seal + 16: 0.5 # chart + 17: 0.5 # formula_number + 18: 0.5 # aside_text + 19: 0.5 # reference_content + layout_nms: True + layout_unclip_ratio: [1.0, 1.0] + layout_merge_bboxes_mode: + 0: "large" # paragraph_title + 1: "large" # image + 2: "union" # text + 3: "union" # number + 4: "union" # abstract + 5: "union" # content + 6: "union" # figure_table_chart_title + 7: "large" # formula + 8: "union" # table + 9: "union" # reference + 10: "union" # doc_title + 11: "union" # footnote + 12: "union" # header + 13: "union" # algorithm + 14: "union" # footer + 15: "union" # seal + 16: "large" # chart + 17: "union" # formula_number + 18: "union" # aside_text + 19: "union" # reference_content + ChartRecognition: + module_name: chart_recognition + model_name: PP-Chart2Table + model_dir: null + batch_size: 1 + RegionDetection: + module_name: layout_detection + model_name: PP-DocBlockLayout + model_dir: null + layout_nms: True + layout_merge_bboxes_mode: "small" + +SubPipelines: + DocPreprocessor: + pipeline_name: doc_preprocessor + batch_size: 8 + use_doc_orientation_classify: True + use_doc_unwarping: True + SubModules: + DocOrientationClassify: + module_name: doc_text_orientation + model_name: PP-LCNet_x1_0_doc_ori + model_dir: null + batch_size: 8 + DocUnwarping: + module_name: image_unwarping + model_name: UVDoc + model_dir: null + + GeneralOCR: + pipeline_name: OCR + batch_size: 8 + text_type: general + use_doc_preprocessor: False + use_textline_orientation: True + SubModules: + TextDetection: + module_name: text_detection + model_name: PP-OCRv5_server_det + model_dir: null + limit_side_len: 736 + limit_type: min + max_side_limit: 4000 + thresh: 0.3 + box_thresh: 0.6 + unclip_ratio: 1.5 + TextLineOrientation: + module_name: textline_orientation + model_name: PP-LCNet_x1_0_textline_ori + model_dir: null + batch_size: 8 + TextRecognition: + module_name: text_recognition + model_name: PP-OCRv5_server_rec + model_dir: null + batch_size: 8 + score_thresh: 0.0 + + + TableRecognition: + pipeline_name: table_recognition_v2 + use_layout_detection: False + use_doc_preprocessor: False + use_ocr_model: False + SubModules: + TableClassification: + module_name: table_classification + model_name: PP-LCNet_x1_0_table_cls + model_dir: null + + WiredTableStructureRecognition: + module_name: table_structure_recognition + model_name: SLANeXt_wired + model_dir: null + + WirelessTableStructureRecognition: + module_name: table_structure_recognition + model_name: SLANet_plus + model_dir: null + + WiredTableCellsDetection: + module_name: table_cells_detection + model_name: RT-DETR-L_wired_table_cell_det + model_dir: null + + WirelessTableCellsDetection: + module_name: table_cells_detection + model_name: RT-DETR-L_wireless_table_cell_det + model_dir: null + + TableOrientationClassify: + module_name: doc_text_orientation + model_name: PP-LCNet_x1_0_doc_ori + model_dir: null + SubPipelines: + GeneralOCR: + pipeline_name: OCR + text_type: general + use_doc_preprocessor: False + use_textline_orientation: True + SubModules: + TextDetection: + module_name: text_detection + model_name: PP-OCRv5_server_det + model_dir: null + limit_side_len: 736 + limit_type: min + max_side_limit: 4000 + thresh: 0.3 + box_thresh: 0.4 + unclip_ratio: 1.5 + TextLineOrientation: + module_name: textline_orientation + model_name: PP-LCNet_x1_0_textline_ori + model_dir: null + batch_size: 8 + TextRecognition: + module_name: text_recognition + model_name: PP-OCRv5_server_rec + model_dir: null + batch_size: 8 + score_thresh: 0.0 + + SealRecognition: + pipeline_name: seal_recognition + batch_size: 8 + use_layout_detection: False + use_doc_preprocessor: False + SubPipelines: + SealOCR: + pipeline_name: OCR + batch_size: 8 + text_type: seal + use_doc_preprocessor: False + use_textline_orientation: False + SubModules: + TextDetection: + module_name: seal_text_detection + model_name: PP-OCRv4_server_seal_det + model_dir: null + limit_side_len: 736 + limit_type: min + max_side_limit: 4000 + thresh: 0.2 + box_thresh: 0.6 + unclip_ratio: 0.5 + TextRecognition: + module_name: text_recognition + model_name: PP-OCRv5_server_rec + model_dir: null + batch_size: 8 + score_thresh: 0 + + FormulaRecognition: + pipeline_name: formula_recognition + batch_size: 8 + use_layout_detection: False + use_doc_preprocessor: False + SubModules: + FormulaRecognition: + module_name: formula_recognition + model_name: PP-FormulaNet_plus-L + model_dir: null + batch_size: 8 diff --git a/bgd/11.pdf b/bgd/file/11.pdf similarity index 100% rename from bgd/11.pdf rename to bgd/file/11.pdf diff --git a/bgd/22-1.pdf b/bgd/file/22-1.pdf similarity index 100% rename from bgd/22-1.pdf rename to bgd/file/22-1.pdf diff --git a/bgd/33-1.pdf b/bgd/file/33-1.pdf similarity index 100% rename from bgd/33-1.pdf rename to bgd/file/33-1.pdf diff --git a/bgd/44-1.pdf b/bgd/file/44-1.pdf similarity index 100% rename from bgd/44-1.pdf rename to bgd/file/44-1.pdf diff --git a/bgd/55-1.pdf b/bgd/file/55-1.pdf similarity index 100% rename from bgd/55-1.pdf rename to bgd/file/55-1.pdf diff --git a/bgd/66-1.pdf b/bgd/file/66-1.pdf similarity index 100% rename from bgd/66-1.pdf rename to bgd/file/66-1.pdf diff --git a/bgd/77-1.pdf b/bgd/file/77-1.pdf similarity index 100% rename from bgd/77-1.pdf rename to bgd/file/77-1.pdf diff --git a/bgd/990400报.pdf b/bgd/file/990400报.pdf similarity index 100% rename from bgd/990400报.pdf rename to bgd/file/990400报.pdf diff --git a/bgd/EGLV072100006229-裕锦出库报关单.pdf b/bgd/file/EGLV072100006229-裕锦出库报关单.pdf similarity index 100% rename from bgd/EGLV072100006229-裕锦出库报关单.pdf rename to bgd/file/EGLV072100006229-裕锦出库报关单.pdf diff --git a/bgd/HDMUCGPA26415100报.pdf b/bgd/file/HDMUCGPA26415100报.pdf similarity index 100% rename from bgd/HDMUCGPA26415100报.pdf rename to bgd/file/HDMUCGPA26415100报.pdf diff --git a/bgd/I20210000769540727.pdf b/bgd/file/I20210000769540727.pdf similarity index 100% rename from bgd/I20210000769540727.pdf rename to bgd/file/I20210000769540727.pdf diff --git a/bgd/I20210000769558253.pdf b/bgd/file/I20210000769558253.pdf similarity index 100% rename from bgd/I20210000769558253.pdf rename to bgd/file/I20210000769558253.pdf diff --git a/bgd/I20220000786622159.pdf b/bgd/file/I20220000786622159.pdf similarity index 100% rename from bgd/I20220000786622159.pdf rename to bgd/file/I20220000786622159.pdf diff --git a/bgd/bgd-01.pdf b/bgd/file/bgd-01.pdf similarity index 100% rename from bgd/bgd-01.pdf rename to bgd/file/bgd-01.pdf diff --git a/bgd/bgd-02.pdf b/bgd/file/bgd-02.pdf similarity index 100% rename from bgd/bgd-02.pdf rename to bgd/file/bgd-02.pdf diff --git a/bgd/bgd-03.pdf b/bgd/file/bgd-03.pdf similarity index 100% rename from bgd/bgd-03.pdf rename to bgd/file/bgd-03.pdf diff --git a/bgd/bgd-04.pdf b/bgd/file/bgd-04.pdf similarity index 100% rename from bgd/bgd-04.pdf rename to bgd/file/bgd-04.pdf diff --git a/bgd/bgd-05.pdf b/bgd/file/bgd-05.pdf similarity index 100% rename from bgd/bgd-05.pdf rename to bgd/file/bgd-05.pdf diff --git a/bgd/bgd-06.pdf b/bgd/file/bgd-06.pdf similarity index 100% rename from bgd/bgd-06.pdf rename to bgd/file/bgd-06.pdf diff --git a/bgd/bgd-07.pdf b/bgd/file/bgd-07.pdf similarity index 100% rename from bgd/bgd-07.pdf rename to bgd/file/bgd-07.pdf diff --git a/bgd/bgd.pdf b/bgd/file/bgd.pdf similarity index 100% rename from bgd/bgd.pdf rename to bgd/file/bgd.pdf diff --git a/bgd/报关单.pdf b/bgd/file/报关单.pdf similarity index 100% rename from bgd/报关单.pdf rename to bgd/file/报关单.pdf diff --git a/code/container-ocr/ocr-springboot/src/main/java/cn/g3soft/exception/GlobalExceptionHandler.java b/code/container-ocr/ocr-springboot/src/main/java/cn/g3soft/exception/GlobalExceptionHandler.java index bdfb5f97..e9a92755 100644 --- a/code/container-ocr/ocr-springboot/src/main/java/cn/g3soft/exception/GlobalExceptionHandler.java +++ b/code/container-ocr/ocr-springboot/src/main/java/cn/g3soft/exception/GlobalExceptionHandler.java @@ -15,13 +15,7 @@ public class GlobalExceptionHandler { public Result handleException(Exception ex, HttpServletRequest request) { ExceptionDetailInfo info = ExceptionUtils.extractExceptionInfo(ex, request, "cn.g3soft"); - log.error("异常发生在 {}#{}({}:{}),ID: {},信息: {}", - info.getClassName(), - info.getMethodName(), - info.getFileName(), - info.getLineNumber(), - info.getId(), - info.getSummary()); + log.error("系统异常: {}", info); ex.printStackTrace(); diff --git a/code/container-ocr/ocr-springboot/src/main/resources/application.yml b/code/container-ocr/ocr-springboot/src/main/resources/application.yml index 38dff4da..0e5ca111 100644 --- a/code/container-ocr/ocr-springboot/src/main/resources/application.yml +++ b/code/container-ocr/ocr-springboot/src/main/resources/application.yml @@ -16,7 +16,7 @@ spring: time-zone: "Asia/Shanghai" date-format: yyyy-MM-dd HH:mm:ss profiles: - active: dev + active: build file: base-dir: D:/data/file diff --git a/code/container-ocr/ocr-springboot/src/main/resources/dbconfigs/g3hd.properties b/code/container-ocr/ocr-springboot/src/main/resources/dbconfigs/g3hd.properties index 8d6733ef..05bead7b 100644 --- a/code/container-ocr/ocr-springboot/src/main/resources/dbconfigs/g3hd.properties +++ b/code/container-ocr/ocr-springboot/src/main/resources/dbconfigs/g3hd.properties @@ -1,10 +1,10 @@ -url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3BoxOCR -username=sa -password=zhang520.. -driver=com.microsoft.sqlserver.jdbc.SQLServerDriver - -#url=jdbc:sqlserver://127.0.0.1:1433;databaseName=G3ContainerOCR +#url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3BoxOCR #username=sa -#password=123456@aaa +#password=zhang520.. #driver=com.microsoft.sqlserver.jdbc.SQLServerDriver +url=jdbc:sqlserver://127.0.0.1:1433;databaseName=G3ContainerOCR +username=sa +password=123456@aaa +driver=com.microsoft.sqlserver.jdbc.SQLServerDriver + diff --git a/code/container-ocr/ocr-uniapp/src/pages-sub/upload/index.vue b/code/container-ocr/ocr-uniapp/src/pages-sub/upload/index.vue index 7212ebf9..692d0e74 100644 --- a/code/container-ocr/ocr-uniapp/src/pages-sub/upload/index.vue +++ b/code/container-ocr/ocr-uniapp/src/pages-sub/upload/index.vue @@ -28,18 +28,30 @@ const subFileList2 = ref([]) // 发货单、签收单、过磅单 const tipContainerNo = ref('') +const initialized = ref(false) + onLoad(async () => { toast.loading('正在初始化中...', { overlay: true, }) - await getUniqueIdApi().then((res) => { + try { + const res = await getUniqueIdApi() if (res.success) { form.value.b_id = res.data + initialized.value = true } - }) - - toast.hide() + else { + toast.fail('初始化失败,请重试') + } + } + catch (err) { + console.error('初始化失败:', err) + toast.fail('初始化失败,请重试') + } + finally { + toast.hide() + } }) function handleBeforeChoose({ fileList, resolve }) { @@ -156,6 +168,11 @@ function handleBeforeRemove({ file, fileList, resolve }) { } async function handleConfirm() { + if (!initialized.value) { + toast.fail('系统初始化未完成,请重试') + return + } + if (!boxImage.value) { toast.fail('集装箱号图片不能为空') return @@ -348,12 +365,31 @@ function validateContainerNo(containerNo) { } async function continueAdd() { - const idRes = await getUniqueIdApi() + initialized.value = false - if (idRes.success) { - resetForm() - form.value.b_id = idRes.data - tipContainerNo.value = '' + toast.loading('正在初始化中...', { + overlay: true, + }) + + try { + const idRes = await getUniqueIdApi() + + if (idRes.success) { + resetForm() + form.value.b_id = idRes.data + tipContainerNo.value = '' + initialized.value = true + } + else { + toast.fail('初始化失败,请重试') + } + } + catch (err) { + console.error('初始化失败:', err) + toast.fail('初始化失败,请重试') + } + finally { + toast.hide() } } @@ -509,7 +545,6 @@ const templateCollapse = ref(['template1']) multiple :accept="fileMode" :max-size="50 * 1024 * 1024" - :before-choose="handleBeforeChoose" /> diff --git a/demo.txt b/demo.txt deleted file mode 100644 index 22a9624f..00000000 --- a/demo.txt +++ /dev/null @@ -1,33 +0,0 @@ -配置一: -CPU:270KPlus -散热:华硕升旗360 -主板:华硕z890pwifi -内存:芝奇幻锋戟 16*2 6800 adie -硬盘:TIPlus 7100 1TB -显卡:华硕prime5070ti -电源:华硕TUF850W -机箱风扇:普通的海景房+风扇 -合计:15299元 - -配置二: -CPU:270KPlus -散热:钛担SJ-A080360黑色一体式CPU水冷散热器 -主板:华硕z890pwifi -内存:宏碁掠夺者冰刃16*2 DDR5 8000频率C36 RGB灯条 -硬盘:宏碁掠夺者GM71TB PCIE4.0 TLC颗粒 -显卡:华硕prime5070ti -电源:先马GT850850W金牌模组ATX3黑色 -机箱风扇:普通的海景房+风扇 -合计:8076元 + 显卡(抖音买可能7000元)= 15076元 - -配置三: -CPU:270KPlus -散热:瓦尔基里B360-GT三排ARGB黑色一体式水冷3.95吋IPS液晶屏 -主板:华硕z890pwifi -内存:金百达刃C3232GDDR56800灯条16G*2根海力士A代 -硬盘:雷克沙ARES战神M.21TB读速7400MB/S TLC颗粒 -显卡:华硕prime5070ti -电源:华硕TUF850W -机箱风扇:乔思伯X400深空灰海景房+钛游FM360三联排风扇*2套FM240双联排风扇*1套 -合计:8049元 + 显卡(抖音买可能7000元)= 15049元 - diff --git a/test.xlsx b/test.xlsx deleted file mode 100644 index 09554815..00000000 Binary files a/test.xlsx and /dev/null differ