Merge remote-tracking branch 'origin/master'

This commit is contained in:
zyx.net
2022-02-17 14:08:29 +08:00
27 changed files with 1598 additions and 108 deletions
@@ -37,7 +37,7 @@ public class SysDictItemController {
@Autowired
private ISysDictItemService sysDictItemService;
/**
* @功能:查询字典数据
* @param sysDictItem
@@ -49,24 +49,17 @@ public class SysDictItemController {
@RequiresPermissions("sys:dict:list")
@RequestMapping(value = "/page", method = RequestMethod.GET)
public Result<IPage<SysDictItem>> queryPageList(SysDictItem sysDictItem,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) {
Result<IPage<SysDictItem>> result = new Result<IPage<SysDictItem>>();
QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
queryWrapper.orderByAsc("sort_order");
Page<SysDictItem> page = new Page<SysDictItem>(pageNo, pageSize);
if(sysDictItem.getIsTagDict()==0) {
queryWrapper.like("is_tag_dict",0).and(wq->wq.orderByAsc("sort_order"));
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
result.setResult(pageList);
}
else if(sysDictItem.getIsTagDict()==1) {
queryWrapper.like("is_tag_dict",1).and(wq->wq.orderByAsc("sort_order"));
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
result.setResult(pageList);
}
IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* @功能:新增
* @return
@@ -87,7 +80,7 @@ public class SysDictItemController {
}
return result;
}
/**
* @功能:编辑
* @param sysDictItem
@@ -102,21 +95,19 @@ public class SysDictItemController {
SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
if(sysdict==null) {
result.error500("未找到对应实体");
}else {
if(sysDictItem.getIsReadOnly()==2){
result.error("固定字段,不可修改");
}else {
sysDictItem.setUpdateTime(new Date());
boolean ok = sysDictItemService.updateById(sysDictItem);
//TODO 返回false说明什么?
if(ok) {
result.success("编辑成功!");
}
}/*else if(sysDictItem.getIsReadOnly()==1){
result.error("固定字段,不可修改");
}*/else {
sysDictItem.setUpdateTime(new Date());
boolean ok = sysDictItemService.updateById(sysDictItem);
//TODO 返回false说明什么?
if(ok) {
result.success("编辑成功!");
}
}
return result;
}
/**
* @功能:删除字典数据
* @param id
@@ -131,20 +122,17 @@ public class SysDictItemController {
SysDictItem joinSystem = sysDictItemService.getById(id);
if(joinSystem==null) {
result.error500("未找到对应实体");
}else {
if(joinSystem.getIsReadOnly()==2){
result.error("固定字段,不可修改");
}else {
boolean ok = sysDictItemService.removeById(id);
if(ok) {
result.success("删除成功!");
}
}/*else if(joinSystem.getIsReadOnly()==1||joinSystem.getIsTagDict()==1){
result.error("固定字段,不可修改");
}*/else {
boolean ok = sysDictItemService.removeById(id);
if(ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* @功能:批量删除字典数据
* @param ids
@@ -156,16 +144,14 @@ public class SysDictItemController {
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result<SysDictItem> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<SysDictItem> result = new Result<SysDictItem>();
SysDictItem sysDictItem = sysDictItemService.getById(ids);
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
SysDictItem sysDictItem = sysDictItemService.getById(ids);
if(sysDictItem.getIsReadOnly() == 1 || sysDictItem.getIsReadOnly()==2){
result.error("固定字段,不可删除");
}else {
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
result.success("批量删除成功!");
}
}/*else if(sysDictItem.getIsReadOnly() == 1){
result.error("固定字段,不可删除");
}*/else {
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
result.success("批量删除成功!");
}
return result;
}
@@ -198,5 +184,5 @@ public class SysDictItemController {
return Result.error("该值不可用,系统中已存在!");
}
}
}
@@ -1,15 +1,16 @@
package com.jero.modules.system.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
@@ -86,5 +87,18 @@ public class SysDict implements Serializable {
*/
private Date updateTime;
/**是否为标签内容-数据字典(1是 0否)*/
@Excel(name = "是否为标签内容-数据字典(1是 0否)", width = 15)
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
private java.lang.Integer isTagDict;
/**是否是只读(2字段固定,内部可配1固定字段 0非固定字段)*/
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15)
@ApiModelProperty(value = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)")
private java.lang.Integer isReadOnly;
/**表单控件类型*/
@Excel(name = "表单控件类型", width = 15)
@ApiModelProperty(value = "表单控件类型")
private java.lang.String fieldShowType;
}
@@ -1,6 +1,7 @@
package com.jero.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModelProperty;
@@ -63,6 +64,9 @@ public class SysDictItem implements Serializable {
private Integer sortOrder;
@TableField(exist = false)
private String dictCode;
/**
* 状态(1启用 0不启用)
*/
@@ -77,16 +81,18 @@ public class SysDictItem implements Serializable {
private Date updateTime;
/**
* 是否为标签内容-数据字典(1是 0否)
*/
/**是否为标签内容-数据字典(1是 0否)*/
@Excel(name = "是否为标签内容-数据字典(1是 0否)", width = 15)
@ApiModelProperty(value = "是否为标签内容-数据字典(1是 0否)")
private java.lang.Integer isTagDict;
/**是否是只读(2字段固定,内部可配1固定字段 0非固定字段)*/
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15, dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
@Dict(dictTable = "onl_cgform_field", dicText = "is_read_only", dicCode = "is_read_only")
@Excel(name = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)", width = 15)
@ApiModelProperty(value = "是否是只读(2字段固定,内部可配1固定字段 0非固定字段)")
private java.lang.Integer isReadOnly;
/**表单控件类型*/
@Excel(name = "表单控件类型", width = 15)
@ApiModelProperty(value = "表单控件类型")
private java.lang.String fieldShowType;
}
@@ -17,4 +17,7 @@ import java.util.List;
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
@Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
public List<SysDictItem> selectItemsByMainId(String mainId);
@Select("SELECT sys_dict.dict_code,sys_dict_item.* from sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id where status = 1")
List<SysDictItem> selectItemsAll();
}
@@ -15,4 +15,10 @@ import java.util.List;
*/
public interface ISysDictItemService extends IService<SysDictItem> {
public List<SysDictItem> selectItemsByMainId(String mainId);
/**
* 查询所有数据字典信息
* @return
*/
public List<SysDictItem> selectItemsAll();
}
@@ -27,4 +27,13 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
public List<SysDictItem> selectItemsByMainId(String mainId) {
return sysDictItemMapper.selectItemsByMainId(mainId);
}
/**
* 查询所有数据字典信息
* @return
*/
@Override
public List<SysDictItem> selectItemsAll() {
return sysDictItemMapper.selectItemsAll();
}
}
@@ -237,7 +237,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
@AutoLog(value = "编辑数据")
@ApiOperation(value="编辑数据", notes="编辑数据")
@PostMapping(value = "/updateInfo")
public Result<?> updateInfo(Map<String,Object> map) {
public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
try {
bussDocumentLibraryEOService.updateInfo(map);
} catch (Exception e) {
@@ -15,6 +15,8 @@ import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.service.impl.OnlCgformAreaServiceImpl;
import org.apache.commons.lang3.ObjectUtils;
@@ -49,6 +51,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
private BussDocumentLibraryEOMapper bussDocumentLibraryEOMapper;
@Autowired
private IOSSFileService iOSSFileService;
@Autowired
private SysDictItemServiceImpl sysDictItemServiceImpl;
/**
@@ -321,50 +325,45 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
//处理修改人和修改时间
if ("update_by".equals(key)) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
value = sysUser.getUsername();
}
if ("update_time".equals(key)) {
value = new Date();
}
List<OnlCgformField> fieldDate = fieldDateList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
//处理时间类型
if (fieldDate.size() != 0) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (ObjectUtils.isNotEmpty(value)) {
value = "str_to_date('" + sdf.format(value) + "','%Y-%m-%d %H:%i:%s')";
if(ObjectUtils.isNotEmpty(value)){
//处理修改人和修改时间
if ("update_by".equals(key)) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
value = sysUser.getUsername();
}
valuesBuilder.append(value + ",");
} else {
//处理文件类型
List<OnlCgformField> fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
if ("update_time".equals(key)) {
value = new Date();
}
List<OnlCgformField> fieldDate = fieldDateList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
//处理时间类型
if (fieldDate.size() != 0) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (ObjectUtils.isNotEmpty(value)) {
value = "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')";
}
valuesBuilder.append(value + ",");
} else {
//处理文件类型
List<OnlCgformField> fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
String valueTemp = UUID.randomUUID().toString().replace("-", "");
value = valueTemp;
//修改文件表关联信息connect_id
List<OSSFile> oSSFileList = new ArrayList<>();
for (String fileId : value.toString().split(",")) {
OSSFile ossFile = new OSSFile();
ossFile.setId(fileId);
ossFile.setConnectId(valueTemp);
oSSFileList.add(ossFile);
String valueTemp = UUID.randomUUID().toString().replace("-", "");
// value = valueTemp;
//修改文件表关联信息connect_id
List<OSSFile> oSSFileList = new ArrayList<>();
for (String fileId : value.toString().split(",")) {
OSSFile ossFile = new OSSFile();
ossFile.setId(fileId);
ossFile.setConnectId(valueTemp);
oSSFileList.add(ossFile);
}
iOSSFileService.updateFileInfo(oSSFileList);
valuesBuilder.append("'" + value + "'" + ",");
}else{
valuesBuilder.append("'" + value + "'" + ",");
}
iOSSFileService.updateFileInfo(oSSFileList);
}
valuesBuilder.append("'" + value + "'" + ",");
}
fieldsBuilder.append(key + ",");
//处理文件类型
List<OnlCgformField> fieldFile = fieldFileList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
if (fieldFile.size() != 0 && ObjectUtils.isNotEmpty(value)) {
String valueTemp = UUID.randomUUID().toString().replace("-", "");
//修改文件表关联信息connect_id
fieldsBuilder.append(key + ",");
}
}
String insertField = fieldsBuilder.substring(0, fieldsBuilder.length() - 1);
@@ -474,10 +473,55 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
IPage page = new Page(pageNo, pageSize);
IPage infoPage = bussDocumentLibraryEOMapper.getInfoPage(page, " " + StringUtils.join(fieldListNew, ","), conditionSb.toString());
//数据字典
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
//下拉选处理数据字典
List records = infoPage.getRecords();
for (Object record : records) {
Map<String,Object> record1 = (Map) record;
for (Map.Entry<String, Object> entry : record1.entrySet()) {
List<OnlCgformField> collect = fieldList.stream()
.filter(e -> entry.getKey().equals(e.getDictField()))
.collect(Collectors.toList());
//下拉选处理数据字典
dictItem(sysDictItems, entry, collect);
}
}
return infoPage;
}
/**
* 下拉选处理数据字典
* @param sysDictItems
* @param entry
* @param collect
*/
private void dictItem(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, List<OnlCgformField> collect) {
//通过dictField判断字段是否为下拉选(不为空则为下拉选)
if(collect.size() != 0 && StringUtils.isNotBlank(collect.get(0).getDictField())){
String value = (String) entry.getValue();
//数据字典中文
List<String> dictItemsCh = new ArrayList<>();
for (String itemValue : value.split(",")) {
//字段的数据字典
List<SysDictItem> dictItemList = sysDictItems.stream()
.filter(e -> e.getDictCode().equals(entry.getKey()))
.collect(Collectors.toList());
if(dictItemList.size() != 0){
List<SysDictItem> dictItems = dictItemList.stream()
.filter(e -> itemValue.equals(e.getItemValue()))
.collect(Collectors.toList());
if(dictItems.size() != 0){
List<String> itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
dictItemsCh.addAll(itemText);
}
}
}
entry.setValue(StringUtils.join(dictItemsCh, ","));
}
}
}
@@ -0,0 +1,188 @@
package com.jero.modules.ocr.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result;
import com.jero.modules.ocr.entity.OcrRecordEO;
import com.jero.modules.ocr.service.IOcrRecordEOService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: OCR识别转换记录表
* @Author: jero-boot
* @Date: 2022-02-16
* @Version: V1.0
*/
@Api(tags="OCR识别转换记录表")
@RestController
@RequestMapping("/ocr/ocrRecord")
@Slf4j
public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecordEOService> {
@Autowired
private IOcrRecordEOService ocrRecordService;
@Value("${OCR.ocrDownPath}")
private String ocrDownPath;
/**
* 分页列表查询
*
* @param ocrRecordEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "OCR识别转换记录表-分页列表查询")
@ApiOperation(value="OCR识别转换记录表-分页列表查询", notes="OCR识别转换记录表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(OcrRecordEO ocrRecordEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LambdaQueryWrapper<OcrRecordEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtils.isNotEmpty(ocrRecordEO.getStandName()), OcrRecordEO::getStandName, ocrRecordEO.getStandName())
.like(StringUtils.isNotEmpty(ocrRecordEO.getStandNumber()), OcrRecordEO::getStandNumber, ocrRecordEO.getStandNumber())
.eq(StringUtils.isNotEmpty(ocrRecordEO.getResultContent()), OcrRecordEO::getResultContent, ocrRecordEO.getResultContent())
.orderByDesc(OcrRecordEO::getCreateTime);
Page<OcrRecordEO> page = new Page<OcrRecordEO>(pageNo, pageSize);
IPage<OcrRecordEO> pageList = ocrRecordService.page(page, queryWrapper);
List<OcrRecordEO> rows = pageList.getRecords();
for (OcrRecordEO row : rows){
if(StringUtils.isNotEmpty(row.getDocRealName())) {
row.setDocRealFile(ocrDownPath + row.getDocRealName());
}
if(StringUtils.isNotEmpty(row.getJsonRealName())) {
row.setJsonRealFile(ocrDownPath + row.getJsonRealName());
}
}
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "OCR识别转换记录表-列表查询")
@ApiOperation(value="OCR识别转换记录表-列表查询", notes="OCR识别转换记录表-列表查询")
@GetMapping(value = "/list")
public Result<List<OcrRecordEO>> queryList() {
List<OcrRecordEO> list = ocrRecordService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param ocrRecordEO
* @return
*/
@AutoLog(value = "OCR识别转换记录表-添加")
@ApiOperation(value="OCR识别转换记录表-添加", notes="OCR识别转换记录表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OcrRecordEO ocrRecordEO) {
ocrRecordService.add(ocrRecordEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param ocrRecordEO
* @return
*/
@AutoLog(value = "OCR识别转换记录表-编辑")
@ApiOperation(value="OCR识别转换记录表-编辑", notes="OCR识别转换记录表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody OcrRecordEO ocrRecordEO) {
ocrRecordService.editById(ocrRecordEO);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "OCR识别转换记录表-通过id删除")
@ApiOperation(value="OCR识别转换记录表-通过id删除", notes="OCR识别转换记录表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
ocrRecordService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "OCR识别转换记录表-批量删除")
@ApiOperation(value="OCR识别转换记录表-批量删除", notes="OCR识别转换记录表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.ocrRecordService.deleteByIds(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<?> queryById(@RequestParam(name="id",required=true) String id) {
OcrRecordEO ocrRecordEO = ocrRecordService.queryById(id);
if(ocrRecordEO ==null) {
return Result.error("未找到对应数据");
}
return Result.OK(ocrRecordEO);
}
/**
* 导出excel
*
* @param request
* @param ocrRecordEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, OcrRecordEO ocrRecordEO) {
return super.exportXls(request, ocrRecordEO, OcrRecordEO.class, "OCR识别转换记录表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, OcrRecordEO.class);
}
}
@@ -0,0 +1,135 @@
package com.jero.modules.ocr.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
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 lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: OCR识别转换记录表
* @Author: jero-boot
* @Date: 2022-02-16
* @Version: V1.0
*/
@Data
@TableName("ocr_record")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="ocr_record对象", description="OCR识别转换记录表")
public class OcrRecordEO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@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;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@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 updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**标准名称*/
@Excel(name = "标准名称", width = 15)
@ApiModelProperty(value = "标准名称")
private String standName;
/**标准编号*/
@Excel(name = "标准编号", width = 15)
@ApiModelProperty(value = "标准编号")
private String standNumber;
/**文本状态*/
@Excel(name = "文本状态", width = 15, dicCode = "file_type")
@Dict(dicCode = "file_type")
@ApiModelProperty(value = "文本状态")
private String fileType;
/**文件名称*/
@Excel(name = "文件名称", width = 15)
@ApiModelProperty(value = "文件名称")
private String fileName;
/**转换结果*/
@Excel(name = "转换结果", width = 15)
@ApiModelProperty(value = "转换结果")
private String resultContent;
/**doc本地存放全路径*/
@Excel(name = "doc本地存放全路径", width = 15)
@ApiModelProperty(value = "doc本地存放全路径")
private String docName;
/**doc文件名称*/
@Excel(name = "doc文件名称", width = 15)
@ApiModelProperty(value = "doc文件名称")
private String docRealName;
/**doc文件编码*/
@Excel(name = "doc文件编码", width = 15)
@ApiModelProperty(value = "doc文件编码")
private String wordFileCode;
/**json文件本地存放全路径*/
@Excel(name = "json文件本地存放全路径", width = 15)
@ApiModelProperty(value = "json文件本地存放全路径")
private String jsonName;
/**json文件名称*/
@Excel(name = "json文件名称", width = 15)
@ApiModelProperty(value = "json文件名称")
private String jsonRealName;
/**json文件编码*/
@Excel(name = "json文件编码", width = 15)
@ApiModelProperty(value = "json文件编码")
private String jsonFileCode;
/**pdf文件id*/
@Excel(name = "pdf文件id", width = 15)
@ApiModelProperty(value = "pdf文件id")
private String attId;
/**同步状态*/
@Excel(name = "同步状态", width = 15)
@ApiModelProperty(value = "同步状态")
private String syncState;
@TableField(exist = false)
private String docRealFile;
@TableField(exist = false)
private String jsonRealFile;
}
@@ -0,0 +1,36 @@
package com.jero.modules.ocr.enums;
/**
* @Author: liyawei
* @Description:
* @Date: Created in 14:49 2022/2/16
*/
public enum FileSyncStateEnum {
SYNC_NO("未同步","未同步"),
SYNC_YES("已同步","已同步");
String name;
String value;
private FileSyncStateEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -0,0 +1,36 @@
package com.jero.modules.ocr.enums;
/**
* @Author: liyawei
* @Description:
* @Date: Created in 14:49 2022/2/16
*/
public enum FileTypeEnum {
OCR_CONVERTING("转换中","转换中"),
OCR_CONVERT_SUCCESS("转换成功","转换成功"),
OCR_CONVERT_FAIL("转换失败","转换失败");
String name;
String value;
private FileTypeEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -0,0 +1,14 @@
package com.jero.modules.ocr.mapper;
import com.jero.modules.ocr.entity.OcrRecordEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: OCR识别转换记录表
* @Author: jero-boot
* @Date: 2022-02-16
* @Version: V1.0
*/
public interface OcrRecordEOMapper extends BaseMapper<OcrRecordEO> {
}
@@ -0,0 +1,25 @@
<?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="com.jero.modules.ocr.mapper.OcrRecordEOMapper">
<resultMap id="OcrRecordResultMap" type="com.jero.modules.ocr.entity.OcrRecordEO">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="stand_name" property="standName" />
<result column="stand_number" property="standNumber" />
<result column="file_type" property="fileType" />
<result column="file_name" property="fileName" />
<result column="result_content" property="resultContent" />
<result column="doc_name" property="docName" />
<result column="doc_real_name" property="docRealName" />
<result column="word_file_code" property="wordFileCode" />
<result column="json_name" property="jsonName" />
<result column="json_real_name" property="jsonRealName" />
<result column="json_file_code" property="jsonFileCode" />
<result column="att_id" property="attId" />
<result column="sync_state" property="syncState" />
</resultMap>
</mapper>
@@ -0,0 +1,64 @@
package com.jero.modules.ocr.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.modules.ocr.entity.OcrRecordEO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: OCR识别转换记录表
* @Author: jero-boot
* @Date: 2022-02-16
* @Version: V1.0
*/
public interface IOcrRecordEOService extends IService<OcrRecordEO> {
/**
* 保存
*
* @param ocrRecordEO
* @return
*/
void add(OcrRecordEO ocrRecordEO);
/**
* 更新
*
* @param ocrRecordEO
* @return
*/
void editById(OcrRecordEO ocrRecordEO);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
OcrRecordEO queryById(String id);
/**
* 列表查询
*
* @return
*/
List<OcrRecordEO> queryList();
}
@@ -0,0 +1,90 @@
package com.jero.modules.ocr.service.impl;
import com.jero.modules.ocr.entity.OcrRecordEO;
import com.jero.modules.ocr.mapper.OcrRecordEOMapper;
import com.jero.modules.ocr.service.IOcrRecordEOService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: OCR识别转换记录表
* @Author: jero-boot
* @Date: 2022-02-16
* @Version: V1.0
*/
@Service
public class OcrRecordEOServiceImpl extends ServiceImpl<OcrRecordEOMapper, OcrRecordEO> implements IOcrRecordEOService {
/**
* 保存
*
* @param ocrRecordEO
* @return
*/
@Override
public void add(OcrRecordEO ocrRecordEO) {
Date now = new Date();
ocrRecordEO.setCreateTime(now);
ocrRecordEO.setUpdateTime(now);
save(ocrRecordEO);
}
/**
* 更新
*
* @param ocrRecordEO
* @return
*/
@Override
public void editById(OcrRecordEO ocrRecordEO) {
Date now = new Date();
ocrRecordEO.setUpdateTime(now);
saveOrUpdate(ocrRecordEO);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public OcrRecordEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<OcrRecordEO> queryList() {
return list();
}
}
@@ -83,6 +83,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
onlCgformTagService.queryExitData(onlCgformTag);
QueryWrapper<OnlCgformTag> queryWrapper = new QueryWrapper<>();
onlCgformTagService.add(onlCgformTag);
return Result.OK("添加成功!");
}
@@ -60,19 +60,16 @@ public class OnlCgformArea implements Serializable {
/**展示区域(1基本信息,2文本信息,3关联关系)*/
@Excel(name = "展示区域(1基本信息,2文本信息,3关联关系)", width = 15)
@javax.validation.constraints.NotNull(message = "不能为空")
@ApiModelProperty(value = "展示区域(1基本信息,2文本信息,3关联关系)")
private java.lang.String showArea;
/**英文名称*/
@Excel(name = "英文名称", width = 15)
@javax.validation.constraints.Pattern(regexp = "^[A-Za-z]*(\\s[A-Za-z]*)*$",message = "请输入正确的英文名称")
@ApiModelProperty(value = "英文名称")
private java.lang.String enName;
/**所属模块(1文档库,0文档拆分)*/
@Excel(name = "所属模块(1文档库,0文档拆分)", width = 15)
@javax.validation.constraints.NotNull(message = "不能为空")
@ApiModelProperty(value = "所属模块(1文档库,0文档拆分)")
private java.lang.String isModel;
@@ -1,7 +1,6 @@
package com.jero.modules.tag.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.modules.tag.entity.OnlCgformTag;
import java.util.List;
@@ -66,5 +65,5 @@ public interface IOnlCgformTagService extends IService<OnlCgformTag> {
*
* @return
*/
Result<?> queryExitData(OnlCgformTag onlCgformTag) ;
void queryExitData(OnlCgformTag onlCgformTag) ;
}
@@ -2,7 +2,6 @@ package com.jero.modules.tag.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result;
import com.jero.modules.tag.entity.OnlCgformTag;
import com.jero.modules.tag.mapper.OnlCgformTagMapper;
import com.jero.modules.tag.service.IOnlCgformTagService;
@@ -100,14 +99,10 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
* @return
*/
@Override
public Result<?> queryExitData(OnlCgformTag onlCgformTag) {
public void queryExitData(OnlCgformTag onlCgformTag) {
QueryWrapper<OnlCgformTag> queryWrapper = new QueryWrapper<>();
queryWrapper.like("isModel",onlCgformTag.getIsModel()).and(wq->wq.like("db_field_txt",onlCgformTag.getDbFieldTxt()));
Integer count = onlCgformTagMapper.selectCount(queryWrapper);
if (count > 0) {
return Result.error("已存在数据,不能重复添加");
}
return Result.OK(onlCgformTag);
}
}
@@ -292,6 +292,30 @@ justauth:
type: default
prefix: 'demo::'
timeout: 1h
# 云端OCR识别集成配置参数
OCR:
#请求OCR转换接口
handleFileUrl: https://sws.trans-cosmos.com.cn/WebService.asmx/FileConversion
#handleFileUrl = https://61.136.1.103:8091/WebService.asmx/FileConversion
# OCR回调接口地址 配置客户本地的IP及端口号
# callBackUrl: http://139.9.235.66:9110/api/ocr/OCRRestful/OcrHandleResult
callBackUrl: http://127.0.0.1:8080/api/ocr/OCRRestful/OcrHandleResult
# OCR认证用户
userId: dayuzhou1234
# OCR认证编码
authCode: 123456
# OCR接口公钥
publicKey: EC4KKA6ZDTCPAOCRBC5M
# OCR文件存储路径
ocrPath: D:/APPSOFT/LAWSOCRDEMO/OCRFILE/
#ocrPath: /data/DeploymentPackage/laws-shanqi/APPSOFT/LAWSOCRDEMO/OCRFILE/
# OCR文件下载地址
# ocrDownPath: http://139.9.235.66:9020/downfile/
ocrDownPath: http://127.0.0.1:9020/downfile/
# OCR接口超时时间
times: 20
# OCR转换类型
convertType: BOTH
## eureka注册中心
eureka:
client:
@@ -183,7 +183,7 @@
</div>
</a-row>
</div>
<uploadFile ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></uploadFile>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model>
</a-spin>
</template>
+148
View File
@@ -0,0 +1,148 @@
<template>
<div class="ocr-upload">
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
<a-upload-dragger
accept='*.*'
:disabled="disabled"
class="ant-upload-list"
name="file"
:file-list="myfileList"
:multiple="true"
:action = 'uploadAction'
:headers="headers"
:before-upload="beforeUpload"
:remove='remove'
@change="handleChange">
<p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">点击上传</p>
</a-upload-dragger>
</a-modal>
</div>
</template>
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
export default {
name: 'ocrUpload',
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType'],
data(){
return{
visible:false,
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
myfileList:[],
fileList:[],
fileTypeSatus:false,
headers:{},
title:'上传文件'
}
},
created(){
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token};
this.containerId = 'container-ty-'+new Date().getTime();
},
mounted(){
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
},
methods:{
beforeUpload(file) {
console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.fileTypeSatus = true;
this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
},
remove(){
this.fileTypeSatus = true;
},
handleChange(info) {
console.log('info',info)
let { file } = info;
const status = info.file.status;
info.fileList.forEach((val,index)=>{
if(val.response && !val.response.result){
this.$message.error(val.response.message);
info.fileList.splice(index,1)
}
})
if (this.fileTypeSatus) {
if (file.size > 100000000) {
this.$message.error(this.errorMessage)
return
}else {
if (status === 'error') {
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error(`${info.file.name} 文件上传失败。`);
} else if (status === 'removed') {
this.myfileList = info.fileList;
this.fileList = []
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
this.$emit('uploadSuccess', this.fileList)
if(this.myfileList.length > 0){
this.$message.destroy()
this.$message.success(`${info.file.name} 删除成功。`);
}
} else if (status === 'done') {
this.fileList = []
this.myfileList = info.fileList;
console.log('file3333',info.fileList)
if (info.fileList.length > 20) {
info.fileList.splice(20)
// this.myfileList = info.fileList;
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
} else {
this.fileList.push(res)
}
})
console.log('file1111',this.fileList)
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.error('最多只能上传二十个');
return
}
console.log('my222',this.myfileList)
this.myfileList.forEach((res) => {
if (res.response) {
this.fileList.push(res.response.result)
console.log('flist',res.response)
} else {
this.fileList.push(res)
}
})
if(this.myfileList.length > 0){
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
}
} else if (status === 'uploading') {
this.myfileList = info.fileList;
this.$emit('uploadSuccess')
// this.$message.success(`${info.file.name} 文件上传成功。`);
}
}
}else{
this.$message.warning('不支持上传该类型的文件!')
}
},
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,508 @@
<template>
<div class="ocr">
<a-card>
<div class="table-page-search-wrapper">
<!-- <search :flag="'1'" :url="url"/>-->
<div class="ocr-search-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.standNumber"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item :label="'标题'">
<j-input :placeholder="'请输入标题'" v-model="queryParams.standName"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="'转换结果'">
<a-select v-model="queryParams.transformation" :placeholder="$t('pleaseSelect')">
<a-select-option :value="item.value" v-for="(item) in transOptions">{{item.label}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</div>
<div class="table-operator">
<a-button @click="handleUpload()" type="primary">上传</a-button>
<a-button @click="handleFileExport()" type="primary">调取已入库文件</a-button>
<a-button @click="handleDel()" type="primary">批量删除</a-button>
</div>
<!-- 上传弹框-->
<a-modal
class="show-content"
title="上传文件"
:visible="fileVisible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
v-if="fileVisible"
>
<a-form-model
class="tag-content"
ref="fileForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item ref="file" label="文件" prop="file">
<a-button type="primary" class="button-text"
@click="fileUpload()">
{{ (file === 'null' || file === '' ||
file == null) ? '点击上传' : '查看已上传文件'
}}
</a-button>
<!-- <a-button @click="fileUpload" type="primary">点击上传</a-button>-->
</a-form-model-item>
<a-form-model-item ref="standNumber" label="编号" prop="standNumber">
<a-input
v-model="form.standNumber"
placeholder="请输入编号"
/>
</a-form-model-item>
<a-form-model-item ref="standName" label="名称" prop="standName">
<a-input
v-model="form.standName"
placeholder="请输入名称"
/>
</a-form-model-item>
<a-form-model-item label="文本状态" prop="fileType">
<j-dict-select-tag type="list" v-model="form.fileType" dictCode="file_type" placeholder="请选择文本状态" />
</a-form-model-item>
</a-form-model>
</a-modal>
<!-- 同步弹框-->
<a-modal
class="show-content"
title="同步至文档库"
v-if="toVisible"
:visible="toVisible"
:confirm-loading="confirmLoading"
@ok="handleOkTo"
@cancel="handleCancelTo"
>
<p style="text-align: center">该文件未进行校验,确定要同步至文档库?</p>
</a-modal>
<!-- 校核弹框-->
<a-modal
class="show-content"
title="校核"
v-if="checkVisible"
:visible="checkVisible"
:confirm-loading="confirmLoading"
@ok="handleOkCheck"
@cancel="handleCancelCheck"
>
<p style="text-align: center">确定对该文件未进行校验?</p>
</a-modal>
<div class="table-detail">
<a-table bordered :data-source="dataSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
<a slot="fileName" slot-scope="text, record" @click="fileDetail(record)">{{ text }}</a>
<template slot="action" slot-scope="text, record">
<a class="action action-syn" href="javascript:;" @click="actionSynchron(record)">同步至文档库</a>
<a class="action action-check" href="javascript:;" @click="actionCheck(record)">校核</a>
<a class="action action-down" href="javascript:;" @click="actionDown(record)">下载</a>
<a-popconfirm
v-if="dataSource.length"
title="Sure to delete?"
@confirm="() => actionDelete(record)"
>
<a class="action action-delete" href="javascript:;">删除</a>
</a-popconfirm>
</template>
</a-table>
<div class="page" v-if="dataSource.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
<addForm
ref="addFormRef"
:url="url"
:flag="'1'"
/>
<frameAssembly
:url="url"
ref="frameAssemblyRef"
/>
<doc-table v-if="drawVisible" :drawVisible="drawVisible" :drawTableSorce="drawTableSorce" @visible="docVisible"></doc-table>
<ocr-upload ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></ocr-upload>
<!-- <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>-->
</a-card>
</div>
</template>
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
import addForm from './modules/addForm'
import docTable from './modules/docTable'
import frameAssembly from '@/components/frameAssembly/index'
import ocrUpload from '@/components/ocrUpload/index'
// import uploadFile from '@/components/uploadFile/file'
export default {
name: 'ocr',
components:{
search,
tableData,
addForm,
frameAssembly,
ocrUpload,
docTable
},
data(){
return{
pageSize:10,
labelCol: { span:4 },
wrapperCol: { span: 18 },
disabled:false,
drawVisible:false,
toVisible:false, //同步弹框
checkVisible:false, //校核弹框
file:'',
form:{}, //表单数据
rules:{
file:[
{ required: true, message: '请选择文件', trigger: 'blur' },
],
standNumber:[
{ required: true, message: '请输入编号', trigger: 'blur' },
],
standName:[
{ required: true, message: '请输入名称', trigger: 'blur' },
],
fileType:[
{ required: true, message: '请选择文本状态', trigger: 'blur' },
]
},
url: {
seachList: 'document/bussDocumentLibraryEO/queryCondition', //搜索字段
tableList: 'document/bussDocumentLibraryEO/queryPageInfo', //表格数据
// getAddForm: 'document/bussDocumentLibraryEO/getAddForm', // 表单的字段
// addInfo: 'document/bussDocumentLibraryEO/addInfo', //新增
// updateInfo: 'document/bussDocumentLibraryEO/updateInfo', //编辑
// getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
// deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch' //删除
},
queryParams:{}, //搜索条件
transOptions:[
{
value:1,
label:'转换中',
},
{
value:2,
label:'转换完成',
},
{
value:3,
label:'转换失败',
}
],
//列表数据
dataSource:[],
columns: [
{
title:'标准编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber'
},
{
title:'标准名称',
key: 'standName',
align:"center",
dataIndex: 'standName'
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText'
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName',
slots: { title: 'customTitle' },
scopedSlots: { customRender: 'fileName' },
},
{
title:'转换结果',
key: 'resultContent',
align:"center",
dataIndex: 'resultContent'
},
{
title:'转换时间',
key: 'createTime',
align:"center",
sorter: true,
dataIndex: 'createTime'
},
{
title:'同步情况',
key: 'syncState',
align:"center",
sorter: true,
dataIndex: 'syncState'
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 260
}
],
drawTableSorce:[
{
id: '1',
standNumber: 'sfsf1',
standName:'下拉单选',
fileType_dictText:'单选',
fileName:'123.pdf',
fileInfo:'1',
},
{
id: '2',
standNumber: 'sfsdfd2222',
standName:'aaaa选',
fileType_dictText:'sdf选',
fileName:'sss.word',
fileInfo:'2',
},
],
ipagination: {
defaultPageSize: 10,
defaultCurrent: 1,
pageSizeOptions: ['10', '20', '30', '40', '100'],
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total, range) => `共 ${total} 条`
},
total:0,
selectedRowKeys:[],
fileVisible:false,
confirmLoading: false,
queryParams:{
pageNo:1,
pageSize:10
},
selectedIds:'', //选择行id
}
},
props:{
},
mounted() {
this.loadData()
},
methods:{
//获取列表数据
loadData(){
console.log('22222')
let params = this.queryParams
console.log('33333')
getAction(`ocr/ocrRecord/page`,params).then(res=> {
if(res.success){
this.total=res.result.total
this.dataSource= [ ...res.result.records ]
}
})
},
//搜索
searchQuery(){
},
//清空搜索
searchReset(){
},
//上传
handleUpload(){
this.fileVisible=true
},
//调取已入库文件
handleFileExport(){
this.drawVisible=true
},
//批量删除
handleDel(){
let param={
ids:this.selectedIds
}
if(this.selectedIds){
this.$confirm({
title: '确认要批量删除?',
content: '',
onOk:
async () => {
deleteAction(`ocr/ocrRecord/deleteBatch`, param).then(res => {
if (res.success) {
this.loadData()
this.selectedRowKeys=[]
}
})
},
onCancel() {},
});
}else{
this.$notification['warning']({
message: '请选择至少一条数据!',
description:'',
});
}
},
//同步
actionSynchron(){
this.toVisible=true
},
//校核
actionCheck(){
this.checkVisible=true
},
//下载
actionDown(){
},
//删除
actionDelete(record){
let params={
id:record.id
}
deleteAction(`ocr/ocrRecord/delete`,params).then(res=> {
if(res.success){
this.loadData()
// console.log('res',res)
}
})
},
onDelete(){
},
onSelectChange(selectedRowKeys,selectedRows){
this.selectedRowKeys = selectedRowKeys;
// console.log('selectedRows',selectedRowKeys,selectedRows)
let ids=[]
selectedRows.forEach(item=>{
ids.push(item.id)
})
this.selectedIds=ids.join(',')
// console.log('seIds',this.selectedIds)
},
//上传确定按钮
handleOk(){
this.$refs.fileForm.validate((valid)=>{
if(valid){
console.log('succ')
}
})
},
handleCancel(){
this.fileVisible=false
},
//上传文件
uploadSuccess(data) {
console.log('updata',data)
let attIdList = []
// data.map(item => {
// attIdList.push(item.id || data.name)
// })
// // /** 赋值给当前对应的表单文件 */
// this.file = attIdList.join(',')
},
fileUpload(){
this.$refs.uploadFile.visible=true
},
//同步至文档库确认
handleOkTo(){
this.toVisible=false
},
//同步至文档库取消
handleCancelTo(){
this.toVisible=false
},
//校核确认
handleOkCheck(){
this.checkVisible=false
},
//校核取消
handleCancelCheck(){
this.checkVisible=false
},
docVisible(val){
this.drawVisible=val
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
//文件详情跳转
fileDetail(val){
console.log('valtext',val)
}
}
}
</script>
<style lang="less" scoped>
.ocr{
.table-detail{
.action{
margin-right: 10px;
}
.action-delete{
color:red;
}
.page{
text-align:right ;
margin-top:20px;
}
}
}
</style>
<style lang="less">
.show-content{
.ant-modal-footer{
text-align: center;
}
}
</style>
@@ -0,0 +1,11 @@
<template>
</template>
<script>
export default {
name: 'ocraddForm',
}
</script>
<style lang="less" scoped>
</style>
@@ -0,0 +1,151 @@
<template>
<div class="doc-table">
<a-drawer
class="doc-table-drawer"
title="调取已入库文件"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="doc-table-content">
<div class="doc-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.standNumber"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item :label="'标题'">
<j-input :placeholder="'请输入标题'" v-model="queryParams.standName"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</div>
<div class="doc-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="ipagination" >
<span slot="num" slot-scope="text,records,index">
{{ (ipagination.currentPage-1)*ipagination.pageSize+Number(index)+1 }}
</span>
</a-table>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
name: 'docTable',
props:{
drawVisible:Boolean,
drawTableSorce:Array,
},
data(){
return{
visible:false,
queryParams:{
pageNo:1,
pageSize:10
},
currentPage:1,
ipagination: {
defaultPageSize: 10,
defaultCurrent: 1,
currentPage:1,
pageSizeOptions: ['10', '20', '30', '40', '100'],
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total, range) => `显示 ${range[0]} ~ ${range[1]} 条记录,共 ${total} 条记录`
},
total:0,
selectedRowKeys:[],
tableSource:[],
//表头
columns: [
{
title: '序号',
key: 'num',
align:"center",
scopedSlots: { customRender: 'num' },
width:80
},
{
title:'标准编号',
key: 'standNumber',
align:"center",
dataIndex: 'standNumber'
},
{
title:'标题',
key: 'standName',
align:"center",
dataIndex: 'standName'
},
{
title:'文本状态',
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText'
},
{
title:'文件名称',
key: 'fileName',
align:"center",
dataIndex: 'fileName'
},
{
title:'文件信息',
key: 'fileInfo',
align:"center",
dataIndex: 'fileInfo'
},
]
}
},
mounted() {
this.visible=this.drawVisible
this.tableSource= [...this.drawTableSorce]
},
methods: {
afterVisibleChange(val) {
console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
},
//搜索
searchQuery(){
},
//清空
searchReset(){
},
onSelectChange(){
}
},
}
</script>
<style lang="less" scoped>
.doc-table-drawer{
.ant-drawer-content-wrapper{
}
}
</style>
@@ -31,7 +31,7 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="属性类型" prop="fieldShowType">
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="attribute_type" placeholder="请选择属性类型" />
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" placeholder="请选择属性类型" />
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="isTagContent">