ai审批工具修改 添加批量假接口

pull/1/head
lijingtao 1 year ago
parent 1d64a16ffb
commit f504cccdf4

@ -67,4 +67,11 @@ public class OcrAiApprovalTools {
return ResultVoUtil.success(selectaisp);
}
@RequestMapping(value = "/aiApprovaltoolsClearmark", method = RequestMethod.GET)
public ResultVo aiApprovaltoolsClearmark(HttpServletRequest request,@RequestParam(value = "taskid", required = true) String taskid) {
ResultVo clearmark = iocrsearchhistoryservice.clearmark(taskid);
return clearmark;
}
}

@ -22,4 +22,7 @@ public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> {
ResultVo toolscount(String tenantid);
Map<Object,Object> selectaisp(String userid,String id);
ResultVo clearmark(String id);
}

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

@ -81,7 +81,7 @@
<select id="selectaisp" resultType="map">
SELECT
t.packagename,rw.PICTURERESULT as pictureresult,count(length(rw.PICTURERESULT)-length(replace(rw.PICTURERESULT,',',''))+1) as similarcount,t.create_time as createtime
rw.ID as id,rw.OCPICTUREID as ocpictureid,t.packagename,rw.PICTURERESULT as pictureresult,count(length(rw.PICTURERESULT)-length(replace(rw.PICTURERESULT,',',''))+1) as similarcount,t.create_time as createtime
FROM
ocr_taskchild_picture rw
LEFT JOIN ocr_packagetask t ON rw.PACKAGEID = t.ID

Loading…
Cancel
Save