企业级-pdf分页数据推送接收解析保存

1、ArchiveFilesFrom

java 复制代码
package com.gwssi.archiv.entity;

import java.util.List;

/**
 * @program: market_admin
 * @ClassName ArchiveFilesFrom
 * @description:
 * @author: liubiao
 * @create: 2021-11-10 14:41
 **/
public class ArchiveFilesFrom {
    private List<ElecFileItem> elecFileItemList;


    public List<ElecFileItem> getElecFileItemList() {
        return elecFileItemList;
    }

    public void setElecFileItemList(List<ElecFileItem> elecFileItemList) {
        this.elecFileItemList = elecFileItemList;
    }
}

2、submitArchiveFiles 接口

java 复制代码
@RequestMapping(value = "/submitArchiveFiles", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public String submitArchiveFiles(@RequestBody ArchiveFilesFrom archiveFilesFrom){
        if (archiveFilesFrom.getElecFileItemList() == null){
            return ResultUtil.paramsIsNull("电子文件材料不能为空");
        }

        try {
            return  archivElecFileService.saveArchiveFiles(archiveFilesFrom);
        }catch (Exception e){
            LOG.error("===》》》申请材料保存异常,业务号:{},异常信息:\n",archiveFilesFrom.getGid(), e);
            return ResultUtil.sysException();
        }
    }

3、保存方法saveArchiveFiles

java 复制代码
/**
     * 申请材料接收
     *
     * @param archiveFilesFrom
     * @return
     */
    public String saveArchiveFiles(ArchiveFilesFrom archiveFilesFrom) {
        IEntityDao entityDao = DaoManager.getEntityDao();
        IBaseDao baseDao = TorchDaoManager.getDao();
        String gid = archiveFilesFrom.getGid();
        //防止数据重复,每次先删除
        baseDao.exeSQL("delete from archiv_elec_file where gid=? ", gid);
        List<ElecFileItem> elecFileItemList = archiveFilesFrom.getElecFileItemList();
        for (ElecFileItem e : elecFileItemList) {
            List<InnerfileItem> innerfileItemList = e.getInnerfileItemList();
            ArchivElecFileBo bo = new ArchivElecFileBo();
            String uuid = UUIDUtil.getUUID();
            bo.setId(uuid);
            bo.setGid(gid);
            bo.setElecfileid(e.getElecFileID());
            bo.setElecfilename(e.getElecFileName());
            bo.setElecfilesavepath(e.getElecFileSavePath());
            bo.setElecfiletype(e.getElecFileType());
            bo.setTimestamp(new Date());
            entityDao.insert(bo);
            for (InnerfileItem in : innerfileItemList) {
                ArchivElecFileBo bo2 = new ArchivElecFileBo();
                bo2.setId(UUIDUtil.getUUID());
                bo2.setGid(gid);
                bo2.setParentid(uuid);
                bo2.setElecfileid(e.getElecFileID());
                bo2.setElecfilename(e.getElecFileName());
                bo2.setElecfilesavepath(e.getElecFileSavePath());
                bo2.setElecfiletype(e.getElecFileType());
                bo2.setInnerfiletitle(in.getInnerfileTitle());
                bo2.setBeginpagenum(in.getBeginPageNum());
                bo2.setEndpagenum(in.getEndPageNum());
                bo2.setTimestamp(new Date());
                entityDao.insert(bo2);
            }
        }
        LOG.info("横琴准入接收网办申请材料成功!,业务号:{}", archiveFilesFrom.getGid());
        return ResultUtil.returnResult("200", "成功", null);
    }

4、数据表archiv_elec_file

sql 复制代码
create table archiv_elec_file
(
    ID               varchar(40)   not null
        primary key,
    GID              varchar(40)   not null,
    ElecFileID       varchar(40)   null,
    ElecFileName     varchar(200)  not null,
    ElecFileSavePath varchar(1000) null,
    ElecFileType     varchar(20)   null,
    ParentId         varchar(40)   null,
    InnerfileTitle   varchar(200)  null,
    BeginPageNum     int           null,
    EndPageNum       int           null,
    Timestamp        timestamp     null
);

create index archiv_elec_file_GID_index
    on archiv_elec_file (GID);
相关推荐
湖南罗泽南4 分钟前
Windows C++ TCP/IP 两台电脑上互相传输字符串数据
c++·windows·tcp/ip
小奥超人18 分钟前
PPT技巧:如何合并PPT文件?
windows·经验分享·microsoft·powerpoint·办公技巧
MarcoAI1 小时前
github SSH连接(windows)
windows·ssh·github
v'sir3 小时前
POI word转pdf乱码问题处理
java·spring boot·后端·pdf·word
棱角~~4 小时前
10款PDF合并工具讲解与推荐!!!
人工智能·经验分享·其他·pdf·学习方法
数据智研4 小时前
【数据分享】空间天气公报(2004-2021)(又名太阳数据活动公报) PDF
大数据·pdf
网络安全指导员13 小时前
恶意PDF文档分析记录
网络·安全·web安全·pdf
晴天飛 雪15 小时前
SpringBoot 实现 PDF 添加水印
spring boot·后端·pdf
天幕繁星16 小时前
docker desktop es windows解决vm.max_map_count [65530] is too low 问题
windows·elasticsearch·docker·docker desktop
百锦再17 小时前
详解基于C#开发Windows API的SendMessage方法的鼠标键盘消息发送
windows·c#·计算机外设