master
周文涛 2 years ago
parent fdc9480961
commit 9c009bdf66

@ -175,8 +175,8 @@ public class OcrMetadataConfigController extends JeecgController<OcrMetadataConf
//@AutoLog(value = "元数据配置-通过id查询") //@AutoLog(value = "元数据配置-通过id查询")
@ApiOperation(value="元数据配置-通过id查询", notes="元数据配置-通过id查询") @ApiOperation(value="元数据配置-通过id查询", notes="元数据配置-通过id查询")
@GetMapping(value = "/queryById") @GetMapping(value = "/queryById")
public Result<OcrMetadataConfig> queryById(@RequestParam(name="id",required=true) String id) { public Result<OcrMetadataConfigVo> queryById(@RequestParam(name="id",required=true) String id) {
OcrMetadataConfig ocrMetadataConfig = ocrMetadataConfigService.getById(id); OcrMetadataConfigVo ocrMetadataConfig = ocrMetadataConfigService.findById(id);
if(ocrMetadataConfig==null) { if(ocrMetadataConfig==null) {
return Result.error("未找到对应数据"); return Result.error("未找到对应数据");
} }

@ -48,4 +48,6 @@ public interface IOcrMetadataConfigService extends IService<OcrMetadataConfig> {
IPage<OcrMetadataConfigVo> pageVo(Page<OcrMetadataConfig> page, OcrMetadataConfig ocrMetadataConfig); IPage<OcrMetadataConfigVo> pageVo(Page<OcrMetadataConfig> page, OcrMetadataConfig ocrMetadataConfig);
List<OcrMetadataConfigVo> allList(); List<OcrMetadataConfigVo> allList();
OcrMetadataConfigVo findById(String id);
} }

@ -12,6 +12,7 @@ import org.jeecg.modules.ocr.model.OcrMetadataConfigSaveModel;
import org.jeecg.modules.ocr.service.IOcrMetadataConfigDetailService; import org.jeecg.modules.ocr.service.IOcrMetadataConfigDetailService;
import org.jeecg.modules.ocr.service.IOcrMetadataConfigService; import org.jeecg.modules.ocr.service.IOcrMetadataConfigService;
import org.jeecg.modules.ocr.vo.OcrMetadataConfigVo; import org.jeecg.modules.ocr.vo.OcrMetadataConfigVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -149,4 +150,18 @@ public class OcrMetadataConfigServiceImpl extends ServiceImpl<OcrMetadataConfigM
} }
return allList; return allList;
} }
@Override
public OcrMetadataConfigVo findById(String id) {
OcrMetadataConfigVo copyEntityVo=new OcrMetadataConfigVo();
OcrMetadataConfig ocrMetadataConfig = this.getById(id);
BeanUtils.copyProperties(ocrMetadataConfig,copyEntityVo);
List<OcrMetadataConfigDetail> list = ocrMetadataConfigDetailService.list(new LambdaQueryWrapper<OcrMetadataConfigDetail>().eq(OcrMetadataConfigDetail::getMetadataConfigId, id));
String fieldName = list.stream().map(o -> o.getFieldName()).collect(Collectors.joining(","));
String getField = list.stream().map(o -> o.getGetField()).collect(Collectors.joining(","));
copyEntityVo.setResultName(fieldName);
copyEntityVo.setGetField(getField);
copyEntityVo.setOcrMetadataConfigDetailList(list);
return copyEntityVo;
}
} }

Loading…
Cancel
Save