|
|
|
@ -9,6 +9,7 @@ import cn.jyjz.xiaoyao.ocr.dto.OcrTaskPackageDto;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.*;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>
|
|
|
|
@ -38,6 +40,8 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private OcrTaskPackageMapper taskPackageMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private OcrFieldService fieldService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultVo saveTaskPackage(OcrTaskPackageDto ocrTaskPackage) {
|
|
|
|
@ -59,16 +63,22 @@ public class OcrTaskPackageServiceImpl extends ServiceImpl<OcrTaskPackageMapper,
|
|
|
|
|
public Page<Map<String, Object>> getPackageList(Integer pageNo, Integer pageSize, String packageName) {
|
|
|
|
|
Page<Map<String, Object>> page = new Page<>(pageNo, pageSize);
|
|
|
|
|
Page<Map<String, Object>> result = taskPackageMapper.getPackageList(page, packageName);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(result.getRecords())){
|
|
|
|
|
if (CollectionUtils.isNotEmpty(result.getRecords())) {
|
|
|
|
|
List<OcrField> list = fieldService.list(new LambdaQueryWrapper<OcrField>().eq(OcrField::getReviewType, 1));
|
|
|
|
|
List<Map<String, Object>> records = result.getRecords();
|
|
|
|
|
List<String> fieldName = list.stream().map(OcrField::getName).collect(Collectors.toList());
|
|
|
|
|
for (Map<String, Object> record : records) {
|
|
|
|
|
record.put("id",record.get("id").toString());
|
|
|
|
|
record.put("checkDuplicateId",record.get("checkDuplicateId").toString());
|
|
|
|
|
record.put("id", record.get("id").toString());
|
|
|
|
|
record.put("checkDuplicateId", record.get("checkDuplicateId").toString());
|
|
|
|
|
Object search = record.getOrDefault("search", null);
|
|
|
|
|
if(search!=null){
|
|
|
|
|
if (search != null) {
|
|
|
|
|
Map map = JSONObject.parseObject(search.toString(), Map.class);
|
|
|
|
|
for (String field : fieldName) {
|
|
|
|
|
if (!map.containsKey(field)) {
|
|
|
|
|
map.put(field, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
record.putAll(map);
|
|
|
|
|
record.put("searchTime",map.getOrDefault("submit_date_timestamp","").toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|