管道基础大数据平台系统开发-【后端】-Server
sws
2022-11-24 3cf553e2411c54d78044e6aec6bafc243e718318
2022-11-24
已修改8个文件
77 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/data/DomainController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/MetaController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/show/ExportController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/data/DomainMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DomainService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/DownloadService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/show/ExportService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/data/DomainMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/data/DomainController.java
@@ -82,8 +82,8 @@
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"),
            @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "210"),
            @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "b_hy20w_s23"),
            @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
@@ -121,11 +121,11 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有表")
    @GetMapping(value = "/selectTabs")
    public ResponseMsg<List<TabEntity>> selectTabs() {
    @ApiOperation(value = "查询值域表集合")
    @GetMapping(value = "/selectDomainTabs")
    public ResponseMsg<List<TabEntity>> selectDomainTabs() {
        try {
            List<TabEntity> list = baseQueryService.selectTabs();
            List<TabEntity> list = domainService.selectDomainTabs();
            return success(list);
        } catch (Exception ex) {
src/main/java/com/lf/server/controller/data/MetaController.java
@@ -291,8 +291,11 @@
    @RequestMapping(value = "/downloadFile", method = RequestMethod.GET)
    public void downloadFile(@RequestBody DownloadReqEntity reqEntity, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (null == reqEntity || StringHelper.isEmpty(reqEntity.getPwd())) {
                WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "密码不能为空", res);
            }
            if (StringHelper.isEmpty(reqEntity.getGuid())) {
                WebHelper.writeInfo(HttpStatus.UNAUTHORIZED, "找不到文件ID", res);
                WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "找不到文件ID", res);
                return;
            }
@@ -307,8 +310,8 @@
            de.setDownloadUser(ue.getId());
            int rows = downloadService.update(de);
            //String filePath = exportService.getDownloadFilePath(de);
            //WebHelper.download(filePath, de.getName(), res);
            String filePath = downloadService.getDownloadFilePath(de);
            WebHelper.download(filePath, de.getName(), res);
        } catch (Exception ex) {
            WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res);
        }
src/main/java/com/lf/server/controller/show/ExportController.java
@@ -113,7 +113,7 @@
    public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) {
        try {
            if (StringHelper.isEmpty(guid)) {
                WebHelper.writeInfo(HttpStatus.UNAUTHORIZED, "找不到文件ID", res);
                WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "找不到文件ID", res);
                return;
            }
@@ -128,7 +128,7 @@
            de.setDownloadUser(ue.getId());
            int rows = downloadService.update(de);
            String filePath = exportService.getDownloadFilePath(de);
            String filePath = downloadService.getDownloadFilePath(de);
            WebHelper.download(filePath, de.getName(), res);
        } catch (Exception ex) {
            WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res);
src/main/java/com/lf/server/mapper/data/DomainMapper.java
@@ -1,5 +1,6 @@
package com.lf.server.mapper.data;
import com.lf.server.entity.ctrl.TabEntity;
import com.lf.server.entity.data.DomainEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@@ -51,6 +52,12 @@
    public DomainEntity selectById(int id);
    /**
     * 查询值域表集合
     * @return
     */
    public List<TabEntity> selectDomainTabs();
    /**
     * 插入一条
     *
     * @param entity
src/main/java/com/lf/server/service/data/DomainService.java
@@ -1,5 +1,6 @@
package com.lf.server.service.data;
import com.lf.server.entity.ctrl.TabEntity;
import com.lf.server.entity.data.DomainEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.mapper.data.DomainMapper;
@@ -42,6 +43,11 @@
    }
    @Override
    public List<TabEntity> selectDomainTabs() {
        return domainMapper.selectDomainTabs();
    }
    @Override
    public Integer insert(DomainEntity entity) {
        return domainMapper.insert(entity);
    }
src/main/java/com/lf/server/service/data/DownloadService.java
@@ -1,11 +1,13 @@
package com.lf.server.service.data;
import com.lf.server.entity.data.DownloadEntity;
import com.lf.server.helper.PathHelper;
import com.lf.server.helper.StringHelper;
import com.lf.server.mapper.data.DownloadMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.List;
/**
@@ -14,6 +16,9 @@
 */
@Service
public class DownloadService implements DownloadMapper {
    @Autowired
    PathHelper pathHelper;
    @Autowired
    DownloadMapper downloadMapper;
@@ -89,4 +94,14 @@
    public Integer updates(List<DownloadEntity> list) {
        return downloadMapper.updates(list);
    }
    /**
     * 获取下载文件路径
     *
     * @param de 下载实体类
     * @return 下载文件路径
     */
    public String getDownloadFilePath(DownloadEntity de) {
        return pathHelper.getConfig().getDownloadPath() + File.separator + de.getUrl();
    }
}
src/main/java/com/lf/server/service/show/ExportService.java
@@ -113,14 +113,4 @@
        return de;
    }
    /**
     * 获取下载文件路径
     *
     * @param de 下载实体类
     * @return 下载文件路径
     */
    public String getDownloadFilePath(DownloadEntity de) {
        return pathHelper.getConfig().getDownloadPath() + File.separator + de.getUrl();
    }
}
src/main/resources/mapper/data/DomainMapper.xml
@@ -2,24 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lf.server.mapper.data.DomainMapper">
    <select id="selectCount" resultType="java.lang.Integer">
        select count(a.*) from lf.sys_domain a
        where exists (select * from lf.sys_dict b where b.ns = #{ns}
        select count(a.*) from lf.sys_domain a inner join lf.sys_dict b on a.dom_name = b.domain_na
        where b.ns = #{ns}
        <if test="tab != null">
            and b.tab = #{tab}
        </if>
        )
        <if test="code != null">
            and a.dom_code like #{code}
        </if>
    </select>
    <select id="selectByPage" resultType="com.lf.server.entity.data.DomainEntity">
        select a.* from lf.sys_domain a
        where exists (select * from lf.sys_dict b where b.ns = #{ns}
        select a.* from lf.sys_domain a inner join lf.sys_dict b on a.dom_name = b.domain_na
        where b.ns = #{ns}
        <if test="tab != null">
            and b.tab = #{tab}
        </if>
        )
        <if test="code != null">
            and a.dom_code like #{code}
        </if>
@@ -35,6 +33,10 @@
        select * from lf.sys_domain where id = #{id}
    </select>
    <select id="selectDomainTabs" resultType="com.lf.server.entity.ctrl.TabEntity">
        select distinct ns,tab,tab_desc,tableType from lf.sys_dict where domain_na is not null order by ns,tab
    </select>
    <insert id="insert" parameterType="com.lf.server.entity.data.DomainEntity">
       insert into lf.sys_domain
       (dom_desc,dom_name,dom_code,code_desc,level,orderid,bsm,create_user,create_time,bak)