企业级-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);
相关推荐
gywl1 小时前
openEuler VM虚拟机操作(期末考试)
linux·服务器·网络·windows·http·centos
某柚啊2 小时前
Windows开启IIS后依然出现http error 503.the service is unavailable
windows·http
码农君莫笑2 小时前
信管通低代码信息管理系统应用平台
linux·数据库·windows·低代码·c#·.net·visual studio
蜜獾云5 小时前
linux firewalld 命令详解
linux·运维·服务器·网络·windows·网络安全·firewalld
唐宋元明清21885 小时前
Windows 记录开机后应用启动慢的问题
windows·系统异常
越甲八千7 小时前
重温设计模式--中介者模式
windows·设计模式·中介者模式
网络安全(华哥)9 小时前
X-Forwarded-For注入漏洞
windows·安全·web安全
styshoo10 小时前
wsl安装ubuntu 18.04
运维·windows·ubuntu
BothSavage11 小时前
Knife4j在Gateway下的URI优化以及热刷新
windows·gateway
m0_7482412313 小时前
ElasticPDF-新国产 PDF 编辑器开发框架(基于 pdf.js Web PDF批注开发,实现高亮多边形橡皮擦历史记录保存注释文字)
前端·pdf·编辑器