parent
ad00f96e3e
commit
72f4f7bbea
@ -0,0 +1,178 @@
|
||||
package org.jeecg.modules.ocr.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.ocr.entity.OcrIdentifyCallbackLog;
|
||||
import org.jeecg.modules.ocr.service.IOcrIdentifyCallbackLogService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: ocr识别无量云回调记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-08-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="ocr识别无量云回调记录")
|
||||
@RestController
|
||||
@RequestMapping("/ocr/ocrIdentifyCallbackLog")
|
||||
@Slf4j
|
||||
public class OcrIdentifyCallbackLogController extends JeecgController<OcrIdentifyCallbackLog, IOcrIdentifyCallbackLogService> {
|
||||
@Autowired
|
||||
private IOcrIdentifyCallbackLogService ocrIdentifyCallbackLogService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param ocrIdentifyCallbackLog
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "ocr识别无量云回调记录-分页列表查询")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-分页列表查询", notes="ocr识别无量云回调记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<OcrIdentifyCallbackLog>> queryPageList(OcrIdentifyCallbackLog ocrIdentifyCallbackLog,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OcrIdentifyCallbackLog> queryWrapper = QueryGenerator.initQueryWrapper(ocrIdentifyCallbackLog, req.getParameterMap());
|
||||
Page<OcrIdentifyCallbackLog> page = new Page<OcrIdentifyCallbackLog>(pageNo, pageSize);
|
||||
IPage<OcrIdentifyCallbackLog> pageList = ocrIdentifyCallbackLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param ocrIdentifyCallbackLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "ocr识别无量云回调记录-添加")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-添加", notes="ocr识别无量云回调记录-添加")
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody OcrIdentifyCallbackLog ocrIdentifyCallbackLog) {
|
||||
ocrIdentifyCallbackLogService.save(ocrIdentifyCallbackLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param ocrIdentifyCallbackLog
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "ocr识别无量云回调记录-编辑")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-编辑", notes="ocr识别无量云回调记录-编辑")
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody OcrIdentifyCallbackLog ocrIdentifyCallbackLog) {
|
||||
ocrIdentifyCallbackLogService.updateById(ocrIdentifyCallbackLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "ocr识别无量云回调记录-通过id删除")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-通过id删除", notes="ocr识别无量云回调记录-通过id删除")
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
ocrIdentifyCallbackLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "ocr识别无量云回调记录-批量删除")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-批量删除", notes="ocr识别无量云回调记录-批量删除")
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.ocrIdentifyCallbackLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "ocr识别无量云回调记录-通过id查询")
|
||||
@ApiOperation(value="ocr识别无量云回调记录-通过id查询", notes="ocr识别无量云回调记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<OcrIdentifyCallbackLog> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
OcrIdentifyCallbackLog ocrIdentifyCallbackLog = ocrIdentifyCallbackLogService.getById(id);
|
||||
if(ocrIdentifyCallbackLog==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(ocrIdentifyCallbackLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param ocrIdentifyCallbackLog
|
||||
*/
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, OcrIdentifyCallbackLog ocrIdentifyCallbackLog) {
|
||||
return super.exportXls(request, ocrIdentifyCallbackLog, OcrIdentifyCallbackLog.class, "ocr识别无量云回调记录");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("ocr:ocr_identify_callback_log:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, OcrIdentifyCallbackLog.class);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package org.jeecg.modules.ocr.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: ocr识别无量云回调记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-08-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("ocr_identify_callback_log")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ocr_identify_callback_log对象", description="ocr识别无量云回调记录")
|
||||
public class OcrIdentifyCallbackLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**请求开始时间*/
|
||||
@Excel(name = "请求开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "请求开始时间")
|
||||
private java.util.Date startTime;
|
||||
/**请求结束时间*/
|
||||
@Excel(name = "请求结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "请求结束时间")
|
||||
private java.util.Date endTime;
|
||||
/**ocr识别任务主键*/
|
||||
@Excel(name = "ocr识别任务主键", width = 15)
|
||||
@ApiModelProperty(value = "ocr识别任务主键")
|
||||
private java.lang.String identifyId;
|
||||
/**请求结果 0失败 1成功*/
|
||||
@Excel(name = "请求结果 0失败 1成功", width = 15)
|
||||
@ApiModelProperty(value = "请求结果 0失败 1成功")
|
||||
private java.lang.Integer status;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.jeecg.modules.ocr.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.ocr.entity.OcrIdentifyCallbackLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: ocr识别无量云回调记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-08-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface OcrIdentifyCallbackLogMapper extends BaseMapper<OcrIdentifyCallbackLog> {
|
||||
|
||||
List<String> findIdentifyIdGroupLeCount(@Param(value = "autoPushNoticeMaxNum") Integer autoPushNoticeMaxNum);
|
||||
List<String> findIdentifyIdGroupGtCount(@Param(value = "autoPushNoticeMaxNum") Integer autoPushNoticeMaxNum);
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?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="org.jeecg.modules.ocr.mapper.OcrIdentifyCallbackLogMapper">
|
||||
|
||||
<select id="findIdentifyIdGroupLeCount" resultType="java.lang.String">
|
||||
SELECT c.identify_id FROM (SELECT count(id)as num,identify_id FROM ocr_identify_callback_log
|
||||
GROUP BY identify_id)c
|
||||
WHERE c.num <#{autoPushNoticeMaxNum}
|
||||
</select>
|
||||
<select id="findIdentifyIdGroupGtCount" resultType="java.lang.String">
|
||||
SELECT c.identify_id FROM (SELECT count(id)as num,identify_id FROM ocr_identify_callback_log where state='0'
|
||||
GROUP BY identify_id)c
|
||||
WHERE c.num >#{autoPushNoticeMaxNum}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,19 @@
|
||||
package org.jeecg.modules.ocr.service;
|
||||
|
||||
import org.jeecg.modules.ocr.entity.OcrIdentifyCallbackLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: ocr识别无量云回调记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-08-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IOcrIdentifyCallbackLogService extends IService<OcrIdentifyCallbackLog> {
|
||||
|
||||
List<String> findIdentifyIdGroupLeCount(Integer autoPushNoticeMaxNum);
|
||||
|
||||
public List<String> findIdentifyIdGroupGtCount(Integer autoPushNoticeMaxNum);
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package org.jeecg.modules.ocr.service.impl;
|
||||
|
||||
import org.jeecg.modules.ocr.entity.OcrIdentifyCallbackLog;
|
||||
import org.jeecg.modules.ocr.mapper.OcrIdentifyCallbackLogMapper;
|
||||
import org.jeecg.modules.ocr.service.IOcrIdentifyCallbackLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: ocr识别无量云回调记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2023-08-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class OcrIdentifyCallbackLogServiceImpl extends ServiceImpl<OcrIdentifyCallbackLogMapper, OcrIdentifyCallbackLog> implements IOcrIdentifyCallbackLogService {
|
||||
|
||||
@Override
|
||||
public List<String> findIdentifyIdGroupLeCount(Integer autoPushNoticeMaxNum) {
|
||||
return baseMapper.findIdentifyIdGroupLeCount(autoPushNoticeMaxNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findIdentifyIdGroupGtCount(Integer autoPushNoticeMaxNum) {
|
||||
return baseMapper.findIdentifyIdGroupGtCount(autoPushNoticeMaxNum);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue