|
|
|
@ -10,6 +10,8 @@ import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
@ -25,6 +27,7 @@ import cn.jyjz.xiaoyao.ocr.service.IOcrTaskchildDubiousFileService;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ocr控制器
|
|
|
|
@ -49,40 +52,76 @@ public class OcrTaskchildDubiousFileController {
|
|
|
|
|
@Autowired
|
|
|
|
|
OcrPictureService ocrpictureservice;
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 分页查询
|
|
|
|
|
// * @param request
|
|
|
|
|
// * @param start 起始页
|
|
|
|
|
// * @param limit 每页显示多少条 默认10 条
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value = "", method = RequestMethod.GET)
|
|
|
|
|
// public ResponseEntity<?> list(HttpServletRequest request,
|
|
|
|
|
// @RequestParam(value = "start", required = false, defaultValue = "0") int start,
|
|
|
|
|
// @RequestParam(value = "limit", required = false, defaultValue = "10") int limit) {
|
|
|
|
|
// //条件查询
|
|
|
|
|
// EntityWrapper<OcrTaskchildDubiousFile> entityWrapper = new EntityWrapper<OcrTaskchildDubiousFile>();
|
|
|
|
|
// //执行查询方法
|
|
|
|
|
// Page<OcrTaskchildDubiousFile> pageVO = ocrTaskchildDubiousFileService.selectPage(new Page<OcrTaskchildDubiousFile>(start, limit), entityWrapper);
|
|
|
|
|
// return new ResponseEntity<Object>(pageVO, HttpStatus.OK);
|
|
|
|
|
// }
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/dubiousfilelist", method = RequestMethod.GET)
|
|
|
|
|
public ResultVo dubiousfilelist(HttpServletRequest request,
|
|
|
|
|
@RequestParam(value = "pageNo", required = false, defaultValue = "0") int pageNo,
|
|
|
|
|
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize) {
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
QueryWrapper<OcrTaskchildDubiousFile> dubiouswrapper = new QueryWrapper<>();
|
|
|
|
|
dubiouswrapper.eq("userid",userToken.getUserid());
|
|
|
|
|
List<OcrTaskchildDubiousFile> list = ocrTaskchildDubiousFileService.list(dubiouswrapper);
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 通过ID 删除
|
|
|
|
|
// * @param request
|
|
|
|
|
// * @param id
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value = "", method = RequestMethod.DELETE)
|
|
|
|
|
// public ResponseEntity<?> deleteById(HttpServletRequest request, @PathVariable("id") Integer id) {
|
|
|
|
|
// //获取用户信息
|
|
|
|
|
// User user = userService.getUserInfo(request);
|
|
|
|
|
// //根据具体情况 判断 是否需要 进行数据返回, 默认不返回数据
|
|
|
|
|
// ocrTaskchildDubiousFileService.deleteById(id);
|
|
|
|
|
// return new ResponseEntity<Object>(HttpStatus.NO_CONTENT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (OcrTaskchildDubiousFile ocrtaskchilddubiousfile:list){
|
|
|
|
|
// ocrtaskchilddubiousfile.getPictureId()
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
IPage<OcrPicture> iPage = new Page<>(Integer.valueOf(pageNo),Integer.valueOf(pageSize));
|
|
|
|
|
|
|
|
|
|
QueryWrapper<OcrPicture> wrapper = new QueryWrapper<>();
|
|
|
|
|
wrapper.in("ID",list.stream().map(i->i.getPictureId()).collect(Collectors.toList()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//执行查询方法
|
|
|
|
|
IPage<OcrPicture> page = ocrpictureservice.page(iPage, wrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/dubiousfileyc", method = RequestMethod.GET)
|
|
|
|
|
public ResultVo dubiousfileyc(HttpServletRequest request, @RequestParam(value = "pictureid", required = true) String pictureid) {
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
String[] cps = pictureid.split(",");
|
|
|
|
|
|
|
|
|
|
List<OcrPicture> saveList = new ArrayList<>();
|
|
|
|
|
List<OcrTaskchildDubiousFile> fileList = new ArrayList<>();
|
|
|
|
|
for (String childpictureid : cps) {
|
|
|
|
|
OcrPicture ocrPicture = ocrpictureservice.selectDtoById(Long.parseLong(childpictureid));
|
|
|
|
|
ocrPicture.setSuspiciousfile(0);
|
|
|
|
|
ocrPicture.setUpdateTime(System.currentTimeMillis());
|
|
|
|
|
saveList.add(ocrPicture);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<OcrTaskchildDubiousFile> dubiouswrapper = new QueryWrapper<>();
|
|
|
|
|
dubiouswrapper.eq("userid",userToken.getUserid()).eq("picture_id",childpictureid);
|
|
|
|
|
OcrTaskchildDubiousFile one = ocrTaskchildDubiousFileService.getOne(dubiouswrapper);
|
|
|
|
|
fileList.add(one);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ocrpictureservice.updateBatchById(saveList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据具体情况 判断 是否需要 进行数据返回, 默认不返回数据
|
|
|
|
|
boolean b = ocrTaskchildDubiousFileService.removeByIds(fileList);
|
|
|
|
|
return ResultVoUtil.success(b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 通过 ID 查询 单条 信息
|
|
|
|
|
// *
|
|
|
|
|