ocr新按钮查询
This commit is contained in:
+8
@@ -144,4 +144,12 @@ public class SarStandFileEOController extends BaseController<SarStandFileEO> {
|
||||
return Result.success(sarStandFileEOS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询文本信息")
|
||||
@GetMapping("/queryFileInfoNew")
|
||||
public ResponseMessage<List<SarStandFileEO>> queryFileInfoNew(@RequestParam("standId") String standId,@RequestParam("type") String type){
|
||||
|
||||
List<SarStandFileEO> sarStandFileEOS = sarStandFileEOService.selectFileByStandIdOCR(standId,type);
|
||||
return Result.success(sarStandFileEOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -25,4 +25,6 @@ public interface SarStandFileEOService {
|
||||
|
||||
List<SarStandFileEO> selectFileByStandId(String standId);
|
||||
|
||||
List<SarStandFileEO> selectFileByStandIdOCR(String standId,String type);
|
||||
|
||||
}
|
||||
|
||||
+28
-5
@@ -1,6 +1,5 @@
|
||||
package com.adc.da.slrs.standardSplit.service.impl;
|
||||
|
||||
import com.adc.da.slrs.standardSplit.dao.SarStandAttrDetailsEODao;
|
||||
import com.adc.da.slrs.standardSplit.dao.SarStandFileEODao;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarStandFileEO;
|
||||
import com.adc.da.slrs.standardSplit.entity.SarStandFileEOPage;
|
||||
@@ -12,17 +11,16 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class SarStandFileEOServiceImpl implements SarStandFileEOService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandFileEOServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private SarStandFileEODao sarStandFileEODao;
|
||||
@Autowired
|
||||
private SarStandAttrDetailsEODao sarStandAttrDetailsEODao;
|
||||
|
||||
|
||||
@Override
|
||||
public List<SarStandFileEO> getStandFileListByPage(SarStandFileEOPage stand){
|
||||
@@ -80,8 +78,33 @@ public class SarStandFileEOServiceImpl implements SarStandFileEOService {
|
||||
});
|
||||
|
||||
return sarStandFileEOS;
|
||||
}
|
||||
//type == 0 是pdf type==1 是doc
|
||||
@Override
|
||||
public List<SarStandFileEO> selectFileByStandIdOCR(String standId , String type) {
|
||||
QueryWrapper<SarStandFileEO> queryWrapper= new QueryWrapper<>();
|
||||
|
||||
// return sarStandFileEODao.selectFileByStandId(standId);r
|
||||
queryWrapper.eq("STAND_ID",standId);
|
||||
List<SarStandFileEO> sarStandFileEOS = sarStandFileEODao.selectList(queryWrapper);
|
||||
|
||||
if ("0".equals(type)){
|
||||
List<SarStandFileEO> remove=new ArrayList<>();
|
||||
sarStandFileEOS.forEach(sarStandFileEO -> {
|
||||
if (!sarStandFileEO.getFileName().contains(".PDF") && !sarStandFileEO.getFileName().contains(".pdf") ){
|
||||
remove.add(sarStandFileEO);
|
||||
}
|
||||
});
|
||||
sarStandFileEOS.removeAll(remove);
|
||||
}else {
|
||||
List<SarStandFileEO> remove=new ArrayList<>();
|
||||
sarStandFileEOS.forEach(sarStandFileEO -> {
|
||||
if (!sarStandFileEO.getFileName().contains(".DOC") && !sarStandFileEO.getFileName().contains(".doc") ){
|
||||
remove.add(sarStandFileEO);
|
||||
}
|
||||
});
|
||||
sarStandFileEOS.removeAll(remove);
|
||||
}
|
||||
return sarStandFileEOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user