master
周文涛 2 years ago
parent 2b7c4a0f04
commit 8744b00a45

@ -280,7 +280,7 @@ public class OcrMetadataConfigController extends JeecgController<OcrMetadataConf
ocrMetadataConfigSaveModel.setConfigName(configVo.getConfigName());
String resultName = configVo.getResultName();
String getField = configVo.getGetField();
ocrMetadataConfigSaveModel.setTaskTypeName(configVo.getTaskType());
ocrMetadataConfigSaveModel.setTaskTypeName(configVo.getTaskType_dictText());
List<String> resultList=new ArrayList<>();
List<String> getFieldList=new ArrayList<>();

@ -72,6 +72,5 @@ public class OcrMetadataConfig implements Serializable {
/**任务类型*/
@ApiModelProperty(value = "任务类型")
@Excel(name = "任务类型", width = 15)
private String taskType;
}

@ -19,4 +19,6 @@ import java.util.Map;
public interface OcrMetadataConfigMapper extends BaseMapper<OcrMetadataConfig> {
IPage<OcrMetadataConfigVo> pageVo(@Param("page") Page<OcrMetadataConfig> page,@Param("o") Map<String,Object> params);
List<OcrMetadataConfigVo> allList(@Param("idList") List<String> idList);
}

@ -27,4 +27,19 @@
order by oc.update_time desc
</select>
<select id="allList" resultType="org.jeecg.modules.ocr.vo.OcrMetadataConfigVo">
SELECT oc.*,
tasktype.type_name as taskType_dictText
FROM ocr_metadata_config oc
LEFT JOIN ocr_task_type tasktype ON tasktype.id = oc.task_type
WHERE 1=1
<if test="idList!=null">
AND oc.id
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</if>
group by oc.id
order by oc.update_time desc
</select>
</mapper>

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

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.modules.ocr.entity.OcrMetadataConfig;
import org.jeecg.modules.ocr.entity.OcrMetadataConfigDetail;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.ArrayList;
import java.util.List;
@ -19,6 +20,7 @@ public class OcrMetadataConfigVo extends OcrMetadataConfig {
/**任务类型_字段中文*/
@ApiModelProperty(value = "任务类型名称")
@TableField(exist = false)
@Excel(name = "任务类型", width = 15)
private String taskType_dictText;
/**配置明细信息*/

Loading…
Cancel
Save