|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|