@ -7,6 +7,7 @@ import cn.jyjz.xiaoyao.common.redis.cache.constants.CacheConstants;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture ;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory ;
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService ;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import org.apache.commons.lang3.StringUtils ;
import org.springframework.stereotype.Service ;
@ -32,6 +33,9 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
@Resource
ICacheManager iCacheManager ;
@Resource
private OcrPictureService ocrPictureService ;
@Override
public Map < Object , List < Map < String , String > > > selectsearch ( String search , String assignee ) {
List < Map < String , String > > strings1 = ocrsearchhistorymapper . selectsearch1 ( search ) ;
@ -82,6 +86,7 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
}
Map < Object , Object > map = new HashMap < > ( ) ;
map . put ( "taskid" , id ) ;
map . put ( "tenantusername" , selectaiuser ) ;
map . put ( "packagename" , selectaisp . get ( "packagename" ) ) ;
map . put ( "tasks" , "基线任务" ) ;
@ -91,4 +96,29 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
return map ;
}
@Override
public ResultVo clearmark ( String id ) {
Map < Object , Object > selectaisp = ocrsearchhistorymapper . selectaisp ( id ) ;
String [ ] cps = selectaisp . get ( "ocpictureid" ) . toString ( ) . split ( "," ) ;
List < OcrPicture > saveList = new ArrayList < > ( ) ;
for ( String childpictureid : cps ) {
OcrPicture ocrPicture = this . ocrPictureService . selectDtoById ( Long . parseLong ( childpictureid ) ) ;
if ( ocrPicture . getSimilarityscore ( ) > = 90 ) {
ocrPicture . setJudgeid ( null ) ;
ocrPicture . setJudgedesc ( null ) ;
ocrPicture . setIztrueorfalse ( 0 ) ;
ocrPicture . setUpdateTime ( System . currentTimeMillis ( ) ) ;
saveList . add ( ocrPicture ) ;
}
}
return this . ocrPictureService . updateBatchById ( saveList ) ? ResultVoUtil . success ( ) : ResultVoUtil . error ( ) ;
}
}