parent
b97e03e961
commit
2362043c07
@ -0,0 +1,157 @@
|
|||||||
|
package cn.jyjz.xiaoyao.ocr.controller;
|
||||||
|
|
||||||
|
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
||||||
|
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
||||||
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
||||||
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
||||||
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
||||||
|
import cn.jyjz.xiaoyao.ocr.dataobject.*;
|
||||||
|
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 org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import cn.jyjz.xiaoyao.ocr.service.IOcrTaskchildDubiousFileService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ocr控制器
|
||||||
|
*
|
||||||
|
* @author 你的肉
|
||||||
|
* @Date 2024-03-21 19:00:57
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ocr/dubiousfile")
|
||||||
|
public class OcrTaskchildDubiousFileController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOcrTaskchildDubiousFileService ocrTaskchildDubiousFileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserTokenService userTokenService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
OcrTaskchildPictureService ocrtaskchildpictureservice;
|
||||||
|
|
||||||
|
@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);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 通过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);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 通过 ID 查询 单条 信息
|
||||||
|
// *
|
||||||
|
// * @param request
|
||||||
|
// * @param id 编号
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @RequestMapping(value = "", method = RequestMethod.GET)
|
||||||
|
// public ResponseEntity<?> findById(HttpServletRequest request, @PathVariable("id") Integer id) {
|
||||||
|
// //获取用户信息
|
||||||
|
// User user = userService.getUserInfo(request);
|
||||||
|
// OcrTaskchildDubiousFile ocrTaskchildDubiousFile= ocrTaskchildDubiousFileService.selectById(id);
|
||||||
|
// return new ResponseEntity<OcrTaskchildDubiousFile>(ocrTaskchildDubiousFile, HttpStatus.OK);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /** 修改操作
|
||||||
|
// * @param request
|
||||||
|
// * @param ocrTaskchildDubiousFile
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @RequestMapping(value = "", method = RequestMethod.PATCH)
|
||||||
|
// public ResponseEntity<?> update(HttpServletRequest request, @RequestBody OcrTaskchildDubiousFile ocrTaskchildDubiousFile) {
|
||||||
|
// //获取用户信息
|
||||||
|
// User user = userService.getUserInfo(request);
|
||||||
|
// ocrTaskchildDubiousFileService.insertOrUpdate(ocrTaskchildDubiousFile);
|
||||||
|
// //此处需要手工处理 返回需要将修改后的数据返回
|
||||||
|
// return new ResponseEntity<OcrTaskchildDubiousFile>(HttpStatus.CREATED);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/dubiousfileyd", method = RequestMethod.POST)
|
||||||
|
public ResultVo dubiousfileyd(HttpServletRequest request, @RequestBody Map<String,Object> map) {
|
||||||
|
|
||||||
|
String tenantId = request.getHeader("X-Tenant-Id");
|
||||||
|
if(StringUtils.isBlank(tenantId)){
|
||||||
|
return ResultVoUtil.error("租户主键不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
||||||
|
|
||||||
|
List<OcrTaskchildDubiousFile> list=new ArrayList<>();
|
||||||
|
String[] taskchildid = map.get("taskchildid").toString().split(",");
|
||||||
|
for (String asd:taskchildid){
|
||||||
|
OcrTaskchildDubiousFile ocrtaskchilddubiousfile=new OcrTaskchildDubiousFile();
|
||||||
|
ocrtaskchilddubiousfile.setTaskchildId(Long.parseLong(asd));
|
||||||
|
ocrtaskchilddubiousfile.setTenantid(Long.parseLong(tenantId));
|
||||||
|
ocrtaskchilddubiousfile.setUserid(Long.parseLong(userToken.getUserid()));
|
||||||
|
ocrtaskchilddubiousfile.setCreatedate(System.currentTimeMillis());
|
||||||
|
|
||||||
|
QueryWrapper<OcrTaskchildPicture> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.select("PICTUREID as pictureid").eq("ID",asd);
|
||||||
|
OcrTaskchildPicture one = ocrtaskchildpictureservice.getOne(wrapper);
|
||||||
|
ocrtaskchilddubiousfile.setPictureId(one.getPictureid());
|
||||||
|
|
||||||
|
UpdateWrapper<OcrPicture> updatewrapper = new UpdateWrapper<>();
|
||||||
|
updatewrapper.eq("ID", one.getPictureid()).set("suspiciousfile","1");
|
||||||
|
|
||||||
|
ocrpictureservice.update(updatewrapper);
|
||||||
|
|
||||||
|
list.add(ocrtaskchilddubiousfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean b = ocrTaskchildDubiousFileService.saveBatch(list);
|
||||||
|
|
||||||
|
return ResultVoUtil.success(b);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.jyjz.xiaoyao.ocr.dataDao;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildDubiousFile;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 可疑文件夹 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 你的肉123
|
||||||
|
* @since 2024-03-21
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OcrTaskchildDubiousFileMapper extends BaseMapper<OcrTaskchildDubiousFile> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,117 @@
|
|||||||
|
package cn.jyjz.xiaoyao.ocr.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 可疑文件夹
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 你的肉123
|
||||||
|
* @since 2024-03-21
|
||||||
|
*/
|
||||||
|
@TableName("ocr_taskchild_dubious_file")
|
||||||
|
public class OcrTaskchildDubiousFile extends Model<OcrTaskchildDubiousFile> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可疑文件夹主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
@TableField("taskchild_id")
|
||||||
|
private Long taskchildId;
|
||||||
|
/**
|
||||||
|
* 图片主键
|
||||||
|
*/
|
||||||
|
@TableField("picture_id")
|
||||||
|
private Long pictureId;
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
private Long tenantid;
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userid;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Long createdate;
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTaskchildId() {
|
||||||
|
return taskchildId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskchildId(Long taskchildId) {
|
||||||
|
this.taskchildId = taskchildId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPictureId() {
|
||||||
|
return pictureId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPictureId(Long pictureId) {
|
||||||
|
this.pictureId = pictureId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTenantid() {
|
||||||
|
return tenantid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTenantid(Long tenantid) {
|
||||||
|
this.tenantid = tenantid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserid() {
|
||||||
|
return userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserid(Long userid) {
|
||||||
|
this.userid = userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCreatedate() {
|
||||||
|
return createdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedate(Long createdate) {
|
||||||
|
this.createdate = createdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Serializable pkVal() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "OcrTaskchildDubiousFile{" +
|
||||||
|
"id=" + id +
|
||||||
|
", taskchildId=" + taskchildId +
|
||||||
|
", pictureId=" + pictureId +
|
||||||
|
", tenantid=" + tenantid +
|
||||||
|
", userid=" + userid +
|
||||||
|
", createdate=" + createdate +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.jyjz.xiaoyao.ocr.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildDubiousFile;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 可疑文件夹 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 你的肉123
|
||||||
|
* @since 2024-03-21
|
||||||
|
*/
|
||||||
|
public interface IOcrTaskchildDubiousFileService extends IService<OcrTaskchildDubiousFile> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.jyjz.xiaoyao.ocr.service.impl;
|
||||||
|
|
||||||
|
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildDubiousFileMapper;
|
||||||
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildDubiousFile;
|
||||||
|
import cn.jyjz.xiaoyao.ocr.service.IOcrTaskchildDubiousFileService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 可疑文件夹 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 你的肉123
|
||||||
|
* @since 2024-03-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OcrTaskchildDubiousFileServiceImpl extends ServiceImpl<OcrTaskchildDubiousFileMapper, OcrTaskchildDubiousFile> implements IOcrTaskchildDubiousFileService {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildDubiousFileMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildDubiousFile">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="taskchild_id" property="taskchildId" />
|
||||||
|
<result column="picture_id" property="pictureId" />
|
||||||
|
<result column="tenantid" property="tenantid" />
|
||||||
|
<result column="userid" property="userid" />
|
||||||
|
<result column="createdate" property="createdate" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, taskchild_id AS taskchildId, picture_id AS pictureId, tenantid, userid, createdate
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in new issue