当前位置: 首页 > wzjs >正文

jsp动态网站开发论文seo外链招聘

jsp动态网站开发论文,seo外链招聘,找公司做网站有什么好处,wordpress增强搜索pdf解析法院协助单特定字段,开源项目,结合若依项目进行开发,不连互联网,本地开发部署,前端使用vue3技术,后端用若依分离版spring botot技术,实现将pdf法院协助执行通知书中的特定字段如:时间、文…

pdf解析法院协助单特定字段,开源项目,结合若依项目进行开发,不连互联网,本地开发部署,前端使用vue3技术,后端用若依分离版spring botot技术,实现将pdf法院协助执行通知书中的特定字段如:时间、文号、户名、开户行、账号、划扣金额、保单号等识别出来,并插入数据库表。

1. 后端开发

(1) 添加 Maven 依赖
在若依分离版项目的 pom.xml 中添加必要的依赖项:

<dependencies><!-- Apache PDFBox --><dependency><groupId>org.apache.pdfbox</groupId><artifactId>pdfbox</artifactId><version>2.0.27</version></dependency><!-- 其他必要依赖 -->
</dependencies>

(2) 创建 PDF 解析服务
创建一个服务类用于解析 PDF 文件并提取特定字段。

package com.ruoyi.system.service.impl;import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.springframework.stereotype.Service;import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;@Service
public class PdfParseService {/*** 解析 PDF 文件并提取特定字段*/public Map<String, String> extractFieldsFromPdf(File pdfFile) throws Exception {Map<String, String> fields = new HashMap<>();try (PDDocument document = PDDocument.load(pdfFile)) {PDFTextStripper pdfStripper = new PDFTextStripper();String content = pdfStripper.getText(document);// 提取特定字段(根据实际模板调整正则表达式)fields.put("notice_time", extractField(content, "通知时间:(\\S+)"));fields.put("document_number", extractField(content, "文号:(\\S+)"));fields.put("account_name", extractField(content, "户名:(\\S+)"));fields.put("bank_name", extractField(content, "开户行:(\\S+)"));fields.put("account_number", extractField(content, "账号:(\\S+)"));fields.put("amount", extractField(content, "划扣金额:(\\S+)"));fields.put("policy_number", extractField(content, "保单号:(\\S+)"));}return fields;}/*** 使用正则表达式提取字段*/private String extractField(String text, String regex) {Pattern pattern = Pattern.compile(regex);Matcher matcher = pattern.matcher(text);return matcher.find() ? matcher.group(1) : null;}
}```
(3) 创建数据库操作服务
编写一个服务类将解析结果插入数据库。```csharp
package com.ruoyi.system.service.impl;import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.CourtNoticeMapper;
import com.ruoyi.system.domain.CourtNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.Map;@Service
public class CourtNoticeService {@Autowiredprivate CourtNoticeMapper courtNoticeMapper;/*** 插入解析结果到数据库*/public void saveToDatabase(Map<String, String> fields) {CourtNotice notice = new CourtNotice();notice.setNoticeTime(DateUtils.parseDate(fields.get("notice_time")));notice.setDocumentNumber(fields.get("document_number"));notice.setAccountName(fields.get("account_name"));notice.setBankName(fields.get("bank_name"));notice.setAccountNumber(fields.get("account_number"));notice.setAmount(Double.parseDouble(fields.getOrDefault("amount", "0")));notice.setPolicyNumber(fields.get("policy_number"));notice.setCreateTime(DateUtils.getNowDate());courtNoticeMapper.insertCourtNotice(notice);}
}

(4) 创建 Controller 接口
编写一个接口接收上传的 PDF 文件并调用上述服务。

package com.ruoyi.system.controller;import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.PdfParseService;
import com.ruoyi.system.service.CourtNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;@RestController
@RequestMapping("/api/pdf")
public class PdfController extends BaseController {@Autowiredprivate PdfParseService pdfParseService;@Autowiredprivate CourtNoticeService courtNoticeService;@PostMapping("/parse")public AjaxResult parsePdf(@RequestParam("file") MultipartFile file) {try {// 保存上传的文件到临时目录File tempFile = File.createTempFile("upload", ".pdf");try (FileOutputStream fos = new FileOutputStream(tempFile)) {fos.write(file.getBytes());}// 解析 PDF 并提取字段var fields = pdfParseService.extractFieldsFromPdf(tempFile);// 将解析结果插入数据库courtNoticeService.saveToDatabase(fields);return success("解析成功!");} catch (Exception e) {e.printStackTrace();return error("解析失败:" + e.getMessage());}}
}

(5) 数据库表设计
创建一个用于存储解析结果的表。例如:

 CREATE TABLE court_notice (id BIGINT AUTO_INCREMENT PRIMARY KEY,notice_time DATETIME NOT NULL COMMENT '通知时间',document_number VARCHAR(50) NOT NULL COMMENT '文号',account_name VARCHAR(100) NOT NULL COMMENT '户名',bank_name VARCHAR(100) NOT NULL COMMENT '开户行',account_number VARCHAR(50) NOT NULL COMMENT '账号',amount DECIMAL(10, 2) NOT NULL COMMENT '划扣金额',policy_number VARCHAR(50) COMMENT '保单号',create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'
);

2. 前端开发

(1) 安装 Axios
确保前端项目中已经安装了 axios:
(2) 创建上传组件
在若依分离版的前端项目中,创建一个页面用于上传 PDF 文件并与后端交互。

<template><div><el-uploadclass="upload-demo"dragaction="/api/pdf/parse":headers="headers":on-success="handleSuccess":on-error="handleError"accept=".pdf"><i class="el-icon-upload"></i><div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div><template #tip><div class="el-upload__tip">只能上传 PDF 文件</div></template></el-upload><div v-if="message">{{ message }}</div></div>
</template><script>
import { ref } from 'vue';
import axios from 'axios';export default {setup() {const message = ref('');const token = localStorage.getItem('token'); // 获取用户的登录令牌const headers = {Authorization: `Bearer ${token}`, // 若依分离版需要携带 JWT Token};const handleSuccess = (response) => {console.log('成功响应:', response);message.value = '解析成功!';};const handleError = (error) => {console.error('错误信息:', error);message.value = '解析失败:' + error.message;};return {message,headers,handleSuccess,handleError,};},
};
</script><style scoped>
.upload-demo {width: 50%;margin: auto;
}
</style>

3. 测试与部署

后端测试:
确保 PDF 文件上传接口正常工作。
验证解析逻辑是否能正确提取字段并插入数据库。
前端测试:
在前端页面上传 PDF 文件,验证解析结果和提示信息。
部署:
打包后端 Spring Boot 项目为 JAR 文件,并部署到服务器。
打包前端 Vue 项目为静态资源文件,并部署到 Nginx 或其他 Web 服务器。

http://www.dtcms.com/wzjs/128500.html

相关文章:

  • 有效的网站建设公优化关键词哪家好
  • 搭建网站都需要什么信息流广告优秀案例
  • 做网站卖菜刀需要什么手续交换友情链接的要求有
  • 网站开发 方案windows优化大师自动安装
  • 公司网站建设与管理的作用免费制作网页的网站
  • 网站建设需要注意哪些问题友情链接作用
  • js获取网站广告点击量怎么做设计好看的网站
  • wordpress html5主题seo排名点击工具
  • 济南做网站外贸网络推广
  • 做头像的网站seo优化师就业前景
  • 建设政府网站的成本新郑网络推广公司
  • 公司网站改版要怎么做如何设计网站的首页
  • linux apache发布php网站百度竞价排名怎么做
  • 有没有电脑做兼职的网站吗aso推广方案
  • 设计素材网站哪个好抖音seo排名系统哪个好用
  • 国内网站推广网站策划书案例
  • 怎么自己做彩票网站吗安卓优化大师旧版本
  • 搜狗站长线上销售渠道有哪几种
  • 化妆品网站栏目设计免费软件下载网站有哪些
  • 那个餐饮网站seo诊断报告怎么写
  • 南昌模板建站公司常州seo第一人
  • wordpress 头像插件快推达seo
  • 网站代码上传到服务器后要怎么做的网站seo综合查询
  • 找人做购物网站搜索引擎优化公司排行
  • 网站动画用什么做seo如何建立优化网站
  • 做网站开发学什么语言高端网站设计公司
  • 团购网站推广怎么做做网站优化哪家公司好
  • 张家界做网站公司良品铺子网络营销策划书
  • 东莞信科网站建设网店代运营公司哪家好
  • 网站用户体验是什么百度企业网盘