|
|
|
@ -15,6 +15,8 @@ import org.jeecg.modules.ocr.service.IOcrMetadataConfigDetailService;
|
|
|
|
|
import org.jeecg.modules.ocr.service.IOcrMetadataConfigService;
|
|
|
|
|
import org.jeecg.modules.ocr.service.IOcrTaskTypeService;
|
|
|
|
|
import org.jeecg.modules.ocr.vo.OcrMetadataConfigVo;
|
|
|
|
|
import org.jeecg.modules.system.service.ISysDictItemService;
|
|
|
|
|
import org.jeecg.modules.system.service.ISysDictService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
@ -39,6 +41,10 @@ public class OcrMetadataConfigServiceImpl extends ServiceImpl<OcrMetadataConfigM
|
|
|
|
|
OcrMetadataConfigMapper ocrMetadataConfigMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
IOcrTaskTypeService ocrTaskTypeService;
|
|
|
|
|
@Resource
|
|
|
|
|
ISysDictItemService sysDictItemService;
|
|
|
|
|
@Resource
|
|
|
|
|
ISysDictService sysDictService;
|
|
|
|
|
@Override
|
|
|
|
|
public boolean existsByConfigName(String configName, String id) {
|
|
|
|
|
LambdaQueryWrapper<OcrMetadataConfig> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
@ -152,30 +158,25 @@ public class OcrMetadataConfigServiceImpl extends ServiceImpl<OcrMetadataConfigM
|
|
|
|
|
@Override
|
|
|
|
|
public List<OcrMetadataConfigVo> allList(List<String> idList) {
|
|
|
|
|
List<OcrMetadataConfigVo> allList=new ArrayList<>();
|
|
|
|
|
List<OcrMetadataConfig> list = new ArrayList<>();
|
|
|
|
|
if (idList!=null && idList.size()>0) {
|
|
|
|
|
list=this.listByIds(idList);
|
|
|
|
|
allList=baseMapper.allList(idList);
|
|
|
|
|
}else{
|
|
|
|
|
list=this.list();
|
|
|
|
|
allList=baseMapper.allList(null);
|
|
|
|
|
}
|
|
|
|
|
OcrMetadataConfigVo copyEntityVo=null;
|
|
|
|
|
List<OcrMetadataConfigDetail> metadataConfigDetails = ocrMetadataConfigDetailService.list();
|
|
|
|
|
List<OcrMetadataConfigDetail> arrayTestList=new ArrayList<>();
|
|
|
|
|
String fieldName=null,getField=null;
|
|
|
|
|
for (OcrMetadataConfig ocrMetadataConfig : list) {
|
|
|
|
|
copyEntityVo = new OcrMetadataConfigVo();
|
|
|
|
|
copyEntityVo.setId(ocrMetadataConfig.getId());
|
|
|
|
|
copyEntityVo.setConfigName(ocrMetadataConfig.getConfigName());
|
|
|
|
|
copyEntityVo.setTaskType(ocrMetadataConfig.getTaskType());
|
|
|
|
|
for (OcrMetadataConfigVo ocrMetadataConfig : allList) {
|
|
|
|
|
ocrMetadataConfig.setId(ocrMetadataConfig.getId());
|
|
|
|
|
ocrMetadataConfig.setConfigName(ocrMetadataConfig.getConfigName());
|
|
|
|
|
if (metadataConfigDetails!=null&&metadataConfigDetails.size()>0) {
|
|
|
|
|
arrayTestList = metadataConfigDetails.stream().filter(m -> m.getMetadataConfigId().equals(ocrMetadataConfig.getId())).collect(Collectors.toList());
|
|
|
|
|
fieldName = arrayTestList.stream().map(o -> o.getFieldName()).collect(Collectors.joining(","));
|
|
|
|
|
getField = arrayTestList.stream().map(o -> o.getGetField()).collect(Collectors.joining(","));
|
|
|
|
|
copyEntityVo.setResultName(fieldName);
|
|
|
|
|
copyEntityVo.setGetField(getField);
|
|
|
|
|
copyEntityVo.setOcrMetadataConfigDetailList(arrayTestList);
|
|
|
|
|
ocrMetadataConfig.setResultName(fieldName);
|
|
|
|
|
ocrMetadataConfig.setGetField(getField);
|
|
|
|
|
ocrMetadataConfig.setOcrMetadataConfigDetailList(arrayTestList);
|
|
|
|
|
}
|
|
|
|
|
allList.add(copyEntityVo);
|
|
|
|
|
}
|
|
|
|
|
return allList;
|
|
|
|
|
}
|
|
|
|
|