|
|
|
@ -1,10 +1,15 @@
|
|
|
|
|
package org.jeecg.modules.ocr.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
@ -13,6 +18,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
|
import org.jeecg.common.util.AssertUtils;
|
|
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
|
|
import org.jeecg.config.JeecgBaseConfig;
|
|
|
|
|
import org.jeecg.modules.ocr.entity.OcrMetadataConfig;
|
|
|
|
|
import org.jeecg.modules.ocr.entity.OcrMetadataConfigDetail;
|
|
|
|
|
import org.jeecg.modules.ocr.model.OcrMetadataConfigSaveModel;
|
|
|
|
@ -20,6 +27,9 @@ import org.jeecg.modules.ocr.service.IOcrMetadataConfigService;
|
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
|
import org.jeecg.modules.ocr.utils.DownloadTemplateUtil;
|
|
|
|
|
import org.jeecg.modules.ocr.vo.OcrMetadataConfigVo;
|
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -29,38 +39,40 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 元数据配置
|
|
|
|
|
* @Author: jeecg-boot
|
|
|
|
|
* @Date: 2023-07-14
|
|
|
|
|
* @Date: 2023-07-14
|
|
|
|
|
* @Version: V1.0
|
|
|
|
|
*/
|
|
|
|
|
@Api(tags="元数据配置")
|
|
|
|
|
@Api(tags = "元数据配置")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/ocrMetadataConfig")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class OcrMetadataConfigController extends JeecgController<OcrMetadataConfig, IOcrMetadataConfigService> {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IOcrMetadataConfigService ocrMetadataConfigService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private DownloadTemplateUtil downloadTemplateUtil;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页列表查询
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfig
|
|
|
|
|
* @param pageNo
|
|
|
|
|
* @param pageSize
|
|
|
|
|
* @param req
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//@AutoLog(value = "元数据配置-分页列表查询")
|
|
|
|
|
@ApiOperation(value="元数据配置-分页列表查询", notes="元数据配置-分页列表查询")
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
|
public Result<IPage<OcrMetadataConfigVo>> queryPageList(OcrMetadataConfig ocrMetadataConfig,
|
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
HttpServletRequest req) {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IOcrMetadataConfigService ocrMetadataConfigService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private DownloadTemplateUtil downloadTemplateUtil;
|
|
|
|
|
@Resource
|
|
|
|
|
private JeecgBaseConfig jeecgBaseConfig;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页列表查询
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfig
|
|
|
|
|
* @param pageNo
|
|
|
|
|
* @param pageSize
|
|
|
|
|
* @param req
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//@AutoLog(value = "元数据配置-分页列表查询")
|
|
|
|
|
@ApiOperation(value = "元数据配置-分页列表查询", notes = "元数据配置-分页列表查询")
|
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
|
public Result<IPage<OcrMetadataConfigVo>> queryPageList(OcrMetadataConfig ocrMetadataConfig,
|
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
|
HttpServletRequest req) {
|
|
|
|
|
/*if (StringUtils.isNotBlank(ocrMetadataConfig.getConfigName())){
|
|
|
|
|
ocrMetadataConfig.setConfigName("*"+ocrMetadataConfig.getConfigName()+"*");
|
|
|
|
|
}
|
|
|
|
@ -70,146 +82,175 @@ public class OcrMetadataConfigController extends JeecgController<OcrMetadataConf
|
|
|
|
|
if (StringUtils.isNotBlank(ocrMetadataConfig.getGetField())){
|
|
|
|
|
ocrMetadataConfig.setGetField("*"+ocrMetadataConfig.getGetField()+"*");
|
|
|
|
|
}*/
|
|
|
|
|
//QueryWrapper<OcrMetadataConfig> queryWrapper = QueryGenerator.initQueryWrapper(ocrMetadataConfig, req.getParameterMap());
|
|
|
|
|
Page<OcrMetadataConfig> page = new Page<OcrMetadataConfig>(pageNo, pageSize);
|
|
|
|
|
IPage<OcrMetadataConfigVo> pageList = ocrMetadataConfigService.pageVo(page, ocrMetadataConfig);
|
|
|
|
|
return Result.OK(pageList);
|
|
|
|
|
}
|
|
|
|
|
@ApiOperation(value="元数据配置-下拉列表", notes="元数据配置-下拉列表")
|
|
|
|
|
@GetMapping(value = "/allList")
|
|
|
|
|
public Result<List<OcrMetadataConfigVo>> allList(HttpServletRequest req){
|
|
|
|
|
List<OcrMetadataConfigVo> allList= ocrMetadataConfigService.allList();
|
|
|
|
|
return Result.OK(allList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-添加")
|
|
|
|
|
@ApiOperation(value="元数据配置-添加", notes="元数据配置-添加")
|
|
|
|
|
//QueryWrapper<OcrMetadataConfig> queryWrapper = QueryGenerator.initQueryWrapper(ocrMetadataConfig, req.getParameterMap());
|
|
|
|
|
Page<OcrMetadataConfig> page = new Page<OcrMetadataConfig>(pageNo, pageSize);
|
|
|
|
|
IPage<OcrMetadataConfigVo> pageList = ocrMetadataConfigService.pageVo(page, ocrMetadataConfig);
|
|
|
|
|
return Result.OK(pageList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "元数据配置-下拉列表", notes = "元数据配置-下拉列表")
|
|
|
|
|
@GetMapping(value = "/allList")
|
|
|
|
|
public Result<List<OcrMetadataConfigVo>> allList(HttpServletRequest req) {
|
|
|
|
|
List<OcrMetadataConfigVo> allList = ocrMetadataConfigService.allList(null);
|
|
|
|
|
return Result.OK(allList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-添加")
|
|
|
|
|
@ApiOperation(value = "元数据配置-添加", notes = "元数据配置-添加")
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:add")
|
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result<String> add(@RequestBody OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel) {
|
|
|
|
|
checkSaveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
String configName = ocrMetadataConfigSaveModel.getConfigName();
|
|
|
|
|
boolean existsFlag=ocrMetadataConfigService.existsByConfigName(configName,null);//true 已存在,false不存在
|
|
|
|
|
AssertUtils.notTrue(existsFlag,String.format("[配置名称]-%s 已存在",configName));
|
|
|
|
|
ocrMetadataConfigService.saveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
return Result.OK("添加成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验保存时入参是否可通过
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
*/
|
|
|
|
|
public void checkSaveModel(OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel){
|
|
|
|
|
AssertUtils.notEmpty(ocrMetadataConfigSaveModel.getConfigName(),"[配置名称]不可为空");
|
|
|
|
|
if (ocrMetadataConfigSaveModel.getOcrMetadataConfigDetailList()!=null) {
|
|
|
|
|
for (OcrMetadataConfigDetail detail : ocrMetadataConfigSaveModel.getOcrMetadataConfigDetailList()) {
|
|
|
|
|
AssertUtils.notEmpty(detail.getFieldName(),"[字段名称]不可为空");
|
|
|
|
|
AssertUtils.notEmpty(detail.getGetField(),"[获取字段]不可为空");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 编辑
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-编辑")
|
|
|
|
|
@ApiOperation(value="元数据配置-编辑", notes="元数据配置-编辑")
|
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Result<String> add(@RequestBody OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel) {
|
|
|
|
|
checkSaveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
String configName = ocrMetadataConfigSaveModel.getConfigName();
|
|
|
|
|
boolean existsFlag = ocrMetadataConfigService.existsByConfigName(configName, null);//true 已存在,false不存在
|
|
|
|
|
AssertUtils.notTrue(existsFlag, String.format("[配置名称]-%s 已存在", configName));
|
|
|
|
|
ocrMetadataConfigService.saveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
return Result.OK("添加成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验保存时入参是否可通过
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
*/
|
|
|
|
|
public void checkSaveModel(OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel) {
|
|
|
|
|
AssertUtils.notEmpty(ocrMetadataConfigSaveModel.getConfigName(), "[配置名称]不可为空");
|
|
|
|
|
if (ocrMetadataConfigSaveModel.getOcrMetadataConfigDetailList() != null) {
|
|
|
|
|
for (OcrMetadataConfigDetail detail : ocrMetadataConfigSaveModel.getOcrMetadataConfigDetailList()) {
|
|
|
|
|
AssertUtils.notEmpty(detail.getFieldName(), "[字段名称]不可为空");
|
|
|
|
|
AssertUtils.notEmpty(detail.getGetField(), "[获取字段]不可为空");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 编辑
|
|
|
|
|
*
|
|
|
|
|
* @param ocrMetadataConfigSaveModel
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-编辑")
|
|
|
|
|
@ApiOperation(value = "元数据配置-编辑", notes = "元数据配置-编辑")
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:edit")
|
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
|
public Result<String> edit(@RequestBody OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel) {
|
|
|
|
|
checkSaveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
AssertUtils.notEmpty(ocrMetadataConfigSaveModel.getId(),"[id]不可为空");
|
|
|
|
|
String configName = ocrMetadataConfigSaveModel.getConfigName();
|
|
|
|
|
boolean existsFlag=ocrMetadataConfigService.existsByConfigName(configName,ocrMetadataConfigSaveModel.getId());//true 已存在,false不存在
|
|
|
|
|
AssertUtils.notTrue(existsFlag,String.format("[配置名称]-%s 已存在",configName));
|
|
|
|
|
ocrMetadataConfigService.updateModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
return Result.OK("编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过id删除
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-通过id删除")
|
|
|
|
|
@ApiOperation(value="元数据配置-通过id删除", notes="元数据配置-通过id删除")
|
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
|
|
public Result<String> edit(@RequestBody OcrMetadataConfigSaveModel ocrMetadataConfigSaveModel) {
|
|
|
|
|
checkSaveModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
AssertUtils.notEmpty(ocrMetadataConfigSaveModel.getId(), "[id]不可为空");
|
|
|
|
|
String configName = ocrMetadataConfigSaveModel.getConfigName();
|
|
|
|
|
boolean existsFlag = ocrMetadataConfigService.existsByConfigName(configName, ocrMetadataConfigSaveModel.getId());//true 已存在,false不存在
|
|
|
|
|
AssertUtils.notTrue(existsFlag, String.format("[配置名称]-%s 已存在", configName));
|
|
|
|
|
ocrMetadataConfigService.updateModel(ocrMetadataConfigSaveModel);
|
|
|
|
|
return Result.OK("编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过id删除
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-通过id删除")
|
|
|
|
|
@ApiOperation(value = "元数据配置-通过id删除", notes = "元数据配置-通过id删除")
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:delete")
|
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
|
ocrMetadataConfigService.removeById(id);
|
|
|
|
|
return Result.OK("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-批量删除")
|
|
|
|
|
@ApiOperation(value="元数据配置-批量删除", notes="元数据配置-批量删除")
|
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
|
ocrMetadataConfigService.removeById(id);
|
|
|
|
|
return Result.OK("删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量删除
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@AutoLog(value = "元数据配置-批量删除")
|
|
|
|
|
@ApiOperation(value = "元数据配置-批量删除", notes = "元数据配置-批量删除")
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:deleteBatch")
|
|
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
|
|
this.ocrMetadataConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
|
return Result.OK("批量删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过id查询
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//@AutoLog(value = "元数据配置-通过id查询")
|
|
|
|
|
@ApiOperation(value="元数据配置-通过id查询", notes="元数据配置-通过id查询")
|
|
|
|
|
@GetMapping(value = "/queryById")
|
|
|
|
|
public Result<OcrMetadataConfigVo> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
|
OcrMetadataConfigVo ocrMetadataConfig = ocrMetadataConfigService.findById(id);
|
|
|
|
|
if(ocrMetadataConfig==null) {
|
|
|
|
|
return Result.error("未找到对应数据");
|
|
|
|
|
}
|
|
|
|
|
return Result.OK(ocrMetadataConfig);
|
|
|
|
|
}
|
|
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
|
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
|
this.ocrMetadataConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
|
return Result.OK("批量删除成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过id查询
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
//@AutoLog(value = "元数据配置-通过id查询")
|
|
|
|
|
@ApiOperation(value = "元数据配置-通过id查询", notes = "元数据配置-通过id查询")
|
|
|
|
|
@GetMapping(value = "/queryById")
|
|
|
|
|
public Result<OcrMetadataConfigVo> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
|
OcrMetadataConfigVo ocrMetadataConfig = ocrMetadataConfigService.findById(id);
|
|
|
|
|
if (ocrMetadataConfig == null) {
|
|
|
|
|
return Result.error("未找到对应数据");
|
|
|
|
|
}
|
|
|
|
|
return Result.OK(ocrMetadataConfig);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出excel
|
|
|
|
|
*
|
|
|
|
|
* @param request
|
|
|
|
|
* @param ocrMetadataConfig
|
|
|
|
|
*/
|
|
|
|
|
* 导出excel
|
|
|
|
|
*
|
|
|
|
|
* @param request
|
|
|
|
|
* @param ocrMetadataConfig
|
|
|
|
|
*/
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:exportXls")
|
|
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, OcrMetadataConfig ocrMetadataConfig) {
|
|
|
|
|
return super.exportXls(request, ocrMetadataConfig, OcrMetadataConfig.class, "元数据配置");
|
|
|
|
|
// 过滤选中数据
|
|
|
|
|
String selections = request.getParameter("selections");
|
|
|
|
|
String title = "元数据配置";
|
|
|
|
|
|
|
|
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
|
|
|
|
|
|
|
List<OcrMetadataConfigVo> exportList = new ArrayList<>();
|
|
|
|
|
if (oConvertUtils.isNotEmpty(selections)) {
|
|
|
|
|
List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
|
|
exportList = ocrMetadataConfigService.allList(selectionList);
|
|
|
|
|
}
|
|
|
|
|
if(true){
|
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
// Step.2 获取导出数据
|
|
|
|
|
// Step.3 AutoPoi 导出Excel
|
|
|
|
|
|
|
|
|
|
//此处设置的filename无效 ,前端会重更新设置一下
|
|
|
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
|
|
|
|
mv.addObject(NormalExcelConstants.CLASS, OcrMetadataConfigVo.class);
|
|
|
|
|
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
|
|
ExportParams exportParams = new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
|
|
|
|
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
|
|
|
|
|
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
|
|
|
|
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
|
|
|
|
|
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
|
|
|
|
}
|
|
|
|
|
return mv;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下载模板
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/downloadTemplate")
|
|
|
|
|
public ModelAndView downloadTemplate() {
|
|
|
|
|
return downloadTemplateUtil.downloadTemplate(OcrMetadataConfig.class,"元数据配置");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 下载模板
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/downloadTemplate")
|
|
|
|
|
public ModelAndView downloadTemplate() {
|
|
|
|
|
return downloadTemplateUtil.downloadTemplate(OcrMetadataConfig.class, "元数据配置");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过excel导入数据
|
|
|
|
|
*
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
* 通过excel导入数据
|
|
|
|
|
*
|
|
|
|
|
* @param request
|
|
|
|
|
* @param response
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
// @RequiresPermissions("org.jeecg.modules.ocr:ocr_metadata_config:importExcel")
|
|
|
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
|
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|