把制造单位名称赋值给监测机构名称

master
tyc 6 months ago
parent 021b14e6b0
commit 69ef6b958f
  1. 10
      yudao-server/src/main/java/cn/iocoder/yudao/server/controller/OcrProcessController.java
  2. 62
      yudao-server/src/main/java/cn/iocoder/yudao/server/service/SpeicalCertificateService.java
  3. 3
      yudao-server/src/main/java/cn/iocoder/yudao/server/service/SupervisionService.java
  4. 6
      yudao-server/src/main/resources/application-local.yaml
  5. 4
      yudao-server/src/main/resources/application.yaml

@ -3,10 +3,8 @@ package cn.iocoder.yudao.server.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.server.controller.vo.OcrReqVO;
import cn.iocoder.yudao.server.controller.vo.OcrResVO;
import cn.iocoder.yudao.server.controller.vo.OcrResponseVo;
import cn.iocoder.yudao.server.service.OcrProcessingService;
import cn.iocoder.yudao.server.service.SupervisionService;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -14,16 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.security.PermitAll;
import javax.imageio.ImageIO;
import javax.validation.Valid;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Base64;
import java.util.Map;
import java.util.Objects;
/**
* 默认 Controller解决部分 module 未开启时的 404 提示

@ -1,62 +0,0 @@
package cn.iocoder.yudao.server.service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class SpeicalCertificateService {
/**
* 监督检验证书
* @param texts
* @return
*/
public Map<String, Object> extractSpeicalCertificateInfo(List<String> texts){
Map<String, Object> data = new HashMap<>();
ArrayList<String> arrayList = new ArrayList<>();
extractManufacturerName(texts, data);
getSpeicalCertificateName(texts, data);
extractManufacturerTime(texts, data);
return data;
}
/**
* 提取监督检验证书的制造单位名称
* @param text
* @param data
*/
private static void extractManufacturerName(List<String> texts, Map<String, Object> data) {
boolean hasCCTZ = texts.stream().anyMatch(t -> t.contains("长春致远新能源装备股份有限公司"));
if (hasCCTZ) {
data.put("制造单位名称","长春致远新能源装备股份有限公司");
}
}
private static void getSpeicalCertificateName(List<String> texts, Map<String, Object> data) {
boolean hasCCTZ = texts.stream().anyMatch(t -> t.contains("长春特种设备检测研究院"));
if (hasCCTZ) {
data.put("监督检验机构名称","长春特种设备检测研究院");
}
}
private static void extractManufacturerTime(List<String> texts, Map<String, Object> data) {
boolean hasCCTZ = texts.stream().anyMatch(t -> t.contains("长春特种设备检测研究院"));
if (hasCCTZ) {
for (int i = 0; i < texts.size(); i++) {
String current = texts.get(i);
// 提取产品批号
if ("产品批号".equals(current) && i + 2 < texts.size()) {
data.put("产品批号",texts.get(i + 2));
}
// 提取制造日期
if ("制造日期".equals(current) && i + 1 < texts.size()) {
data.put("制造日期",texts.get(i + 1));
}
}
}
}
}

@ -120,8 +120,6 @@ public class SupervisionService {
}
//车用气瓶安装合格证
boolean CertificateOfApproval = texts.stream().anyMatch(t -> t.contains("安装合格证") || t.contains("安装单位") || t.contains("安装单位名称"));
// || t.contains("充装介质") || t.contains("水溶机")
// || t.contains("燃气系统安装出厂检验质量证明书")
if (CertificateOfApproval) {
equipmentRegistryRespVO = certificateOfApprovalService.getCertificateOfApproval(texts, postfix);
if (null == equipmentRegistryRespVO) {
@ -134,7 +132,6 @@ public class SupervisionService {
boolean productQualified = texts.stream().anyMatch(t -> t.equals("产品合格证") || t.contains("公称工作压力:") || t.contains("水溶机") ||
t.equals("实测水溶机:") || t.equals("工作压力")
);
// || t.contains("燃气系统安装出厂检验质量证明书")
if (productQualified) {
equipmentRegistryRespVO = productQualifiedService.getCertificateOfApproval(texts, postfix);
if (null == equipmentRegistryRespVO) {

@ -48,7 +48,7 @@ spring:
primary: master
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/lq_ocr?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.130.153:3306/lq_ocr?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
@ -66,7 +66,7 @@ spring:
# password: Yudao@2024 # OpenGauss 连接的示例
slave: # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
url: jdbc:mysql://192.168.130.153:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
username: root
password: 123456
# tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!)
@ -79,7 +79,7 @@ spring:
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 127.0.0.1 # 地址
host: 192.168.130.153 # 地址
port: 6379 # 端口
database: 0 # 数据库索引
password: root # 密码,建议生产环境开启

@ -271,7 +271,7 @@ yudao:
front-type: 20 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类
unit-test-enable: false # 是否生成单元测试
tenant: # 多租户相关配置项
enable: true
enable: false
ignore-urls:
- /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
- /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
@ -361,4 +361,4 @@ yudao:
debug: false
# 插件配置 TODO 芋艿:【IOT】需要处理下
pf4j:
pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录
pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录

Loading…
Cancel
Save