业务修改

main
252535409 2 years ago
parent 00f2e08187
commit 87fdfba63a

@ -2,6 +2,7 @@ package org.jeecg.modules.ai.service;
import org.jeecg.modules.ai.entity.YsDirectoryMaterial;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
/**
@ -19,5 +20,5 @@ public interface IYsDirectoryMaterialService extends IService<YsDirectoryMateria
* @param ocrResult
* @return
*/
public String getReviewResult(String materialCode,String ocrResult);
public JSONObject getReviewResult(String materialCode,String templateId,String savePath);
}

@ -5,8 +5,10 @@ import javax.annotation.Resource;
import org.jeecg.modules.ai.entity.YsDirectoryMaterial;
import org.jeecg.modules.ai.mapper.YsDirectoryMaterialMapper;
import org.jeecg.modules.ai.service.IYsDirectoryMaterialService;
import org.jeecg.modules.system.util.RecognizeGeneralTextSolution;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -30,12 +32,22 @@ public class YsDirectoryMaterialServiceImpl extends ServiceImpl<YsDirectoryMater
* @return
*/
@Override
public String getReviewResult(String materialCode,String ocrResult) {
public JSONObject getReviewResult(String materialCode,String templateId,String savePath) {
JSONObject json = new JSONObject();
LambdaQueryWrapper<YsDirectoryMaterial> queryWrapper = new LambdaQueryWrapper<YsDirectoryMaterial>();
queryWrapper.eq(YsDirectoryMaterial::getMaterialCode, materialCode);
YsDirectoryMaterial ysDirectoryMaterial = ysDirectoryMaterialMapper.selectOne(queryWrapper);
return "通过";
String ocrResult = null;
if(ysDirectoryMaterial.getRulesExist().intValue()==1) {
//调用接口识别
ocrResult = RecognizeGeneralTextSolution.recognizeGeneralTextSolution(savePath, templateId);
//根据规则校验数据
}
json.put("ocrResult", ocrResult);
json.put("reviewResult", "通过");
return json;
}
}

@ -174,13 +174,11 @@ public class AiAPIController {
MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象
String savePath = preReviewRecordsDetailService.uploadLocal(file, "upload");
if(oConvertUtils.isNotEmpty(savePath)){
//调用接口识别
String ocrResult = RecognizeGeneralTextSolution.recognizeGeneralTextSolution(savePath, templateId);
//根据规则判断预审结果
String reviewResult = iYsDirectoryMaterialService.getReviewResult(materialCode, ocrResult);
JSONObject reviewResult = iYsDirectoryMaterialService.getReviewResult(materialCode, templateId, savePath);
json.put("imagePath", savePath);
json.put("ocrResult", ocrResult);
json.put("reviewResult", reviewResult);
json.put("ocrResult", reviewResult.getString("ocrResult"));
json.put("reviewResult", reviewResult.getString("reviewResult"));
return Result.OK(json.toString());
}else {
return Result.error("上传失败");

@ -45,6 +45,8 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
private WebSocket webSocket;
@Value(value = "${openmeetings_url}")
private String OPENMEETINGS_URL;
@Value(value = "${openmeetings_url_room}")
private String OPENMEETINGS_URL_ROOM;
@Transactional
@Override
@ -133,7 +135,7 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
//生成房间地址
String result = WebServiceUtil.send("协助人", roomId, OPENMEETINGS_URL);
String roomUrl = OPENMEETINGS_URL + "/openmeetings/hash?secure=" + JSONObject.parseObject(result).getString("message");
String roomUrl = OPENMEETINGS_URL_ROOM + "/openmeetings/hash?secure=" + JSONObject.parseObject(result).getString("message");
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setTitile("远程协助请求");
sysAnnouncement.setMsgContent("有用户请求远程协助,请登录:"+roomUrl);

@ -114,9 +114,9 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
multi-datasource1:
url: jdbc:mysql://47.103.213.109:3306/openmeetings?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
url: jdbc:mysql://222.128.10.207:13306/openmeetings?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username: root
password: Wang5322570..
password: h~Ik0j$8[OJz_(91gK
driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
@ -261,4 +261,5 @@ aliyun:
accessKey: 123
accessKeySecret: 456
message_receive_id: 1000000
openmeetings_url: http://gxb.v1.idcfengye.com
openmeetings_url: http://aixt.ricitech.com:8083
openmeetings_url_room: https://aixt.ricitech.com:8082

@ -261,4 +261,5 @@ aliyun:
accessKey: 123
accessKeySecret: 456
message_receive_id: 1000000
openmeetings_url: http://gxb.v1.idcfengye.com
openmeetings_url: http://aixt.ricitech.com:8083
openmeetings_url_room: https://aixt.ricitech.com:8082
Loading…
Cancel
Save