管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-26 2515f9d1070c5abe1dbfb9db30f787ecebbdb94f
1
已修改5个文件
64 ■■■■ 文件已修改
data/db_tab.sql 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/DataLibController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/MetaEntity.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/data/MetaMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/db_tab.sql
@@ -1,6 +1,6 @@
create sequence lf.sys_meta_id_seq increment  by 1 minvalue 1 maxvalue 2147483647 start 1 cache 1;
alter sequence lf.sys_layer_id_seq restart with 1;
vacuum analyze md.md_zxcg;
-- create sequence lf.sys_meta_id_seq increment  by 1 minvalue 1 maxvalue 2147483647 start 1 cache 1;
-- alter sequence lf.sys_layer_id_seq restart with 1;
-- vacuum analyze md.md_zxcg;
----------------------------------------------------------------------------------------------------- 01.菜单表
-- DROP TABLE IF EXISTS lf.sys_menu;
create table lf.sys_menu(
@@ -1198,10 +1198,23 @@
comment on column lf.sys_meta_down.downid is '下载ID';
comment on column lf.sys_meta_down.create_user is '创建人ID';
comment on column lf.sys_meta_down.create_time is '创建时间';
-- insert into lf.sys_role_user (roleid,userid) values (1,1);
/* insert into lf.sys_meta_down (metaid,downid) values (1421,248);
insert into lf.sys_meta_down (metaid,downid) values (1421,245);
insert into lf.sys_meta_down (metaid,downid) values (1420,245);
insert into lf.sys_meta_down (metaid,downid) values (1419,275);
insert into lf.sys_meta_down (metaid,downid) values (1418,241);
insert into lf.sys_meta_down (metaid,downid) values (1417,243); */
select * from lf.sys_meta_down order by id desc;
select * from lf.sys_meta order by id desc;
select * from lf.sys_download order by id desc;
select * from lf.sys_downlog order by id desc;
select * from lf.sys_download where type = 3 order by id desc;
select id,name,type,url,descr,dcount,(select count(*) from lf.sys_downlog b where b.downid=a.id) "count",download_user,download_time from lf.sys_download a where type=3 order by dcount desc;
----------------------------------------------------------------------------------------------------- 
select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName,
    (select coalesce(sum(dcount), 0) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "downCount",
    (select fn_uname(download_user) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id order by download_time desc limit 1) "lastUser",
    (select max(download_time) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "lastTime"
from lf.sys_meta a
order by id desc
limit 10 offset 0;
src/main/java/com/lf/server/controller/show/DataLibController.java
@@ -66,7 +66,7 @@
    @Autowired
    VerService verService;
    @SysLog()
    /*@SysLog()
    @ApiOperation(value = "分页查询源数据 *")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depcode", value = "单位编码", dataType = "String", paramType = "query", example = "00"),
@@ -94,7 +94,7 @@
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    }*/
    @SysLog()
    @ApiOperation(value = "根据目录ID查询版本列表")
src/main/java/com/lf/server/entity/data/MetaEntity.java
@@ -60,6 +60,12 @@
    private String dirName;
    private Integer downCount;
    private String lastUser;
    private Timestamp lastTime;
    public MetaEntity() {
    }
@@ -262,4 +268,28 @@
    public void setDirName(String dirName) {
        this.dirName = dirName;
    }
    public Integer getDownCount() {
        return downCount;
    }
    public void setDownCount(Integer downCount) {
        this.downCount = downCount;
    }
    public String getLastUser() {
        return lastUser;
    }
    public void setLastUser(String lastUser) {
        this.lastUser = lastUser;
    }
    public Timestamp getLastTime() {
        return lastTime;
    }
    public void setLastTime(Timestamp lastTime) {
        this.lastTime = lastTime;
    }
}
src/main/java/com/lf/server/service/data/DownloadService.java
@@ -315,7 +315,7 @@
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception {
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        // 1-Shp文件,2-专题图,3-源数据,4-业务数据,5-管道分析,6-统计报告
src/main/resources/mapper/data/MetaMapper.xml
@@ -59,7 +59,10 @@
    </select>
    <select id="selectMetasForPage" resultType="com.lf.server.entity.data.MetaEntity">
        select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName
        select a.*,fn_uname(a.create_user) uname,fn_get_fullname(a.depcode, 1) depName,fn_ver(a.verid) verName,fn_get_fullname(a.dircode, 2) dirName,
            (select coalesce(sum(dcount), 0) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "downCount",
            (select fn_uname(download_user) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id order by download_time desc limit 1) "lastUser",
            (select max(download_time) from lf.sys_download b inner join lf.sys_meta_down c on b.id = c.downid where c.metaid = a.id) "lastTime"
        from lf.sys_meta a
        <where>
            1 = 1