月球大数据地理空间分析展示平台-【后端】-月球后台服务
1
13693261870
2024-11-17 796b44ea813a1133beae4f3a67f1c0263510c0c7
1
已修改53个文件
1763 ■■■■■ 文件已修改
src/main/java/com/moon/server/helper/HttpHelper.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/helper/WordHelper.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/LayerMapper.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/ReportMapper.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/ResLogMapper.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/ResMapper.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/RoleResMapper.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/BaseQueryService.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/BaseUploadService.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/CommonsFileuploadService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/PermsService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/RedisService.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/ScheduleService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/SignService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/SysService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/TestService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/UploadAttachService.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/all/WebSocketService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/ColortabService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/DataQueryService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/DictService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/DomainService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/DownloadService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/FmeService.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/MetaService.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/PublishService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/ReadRasterService.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/SlopeAnalysisService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/data/UploadService.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/ApplyService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/DataLibService.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/ExportService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/FlowService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/InquiryService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/MarkService.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/ModelService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/show/PipelineService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/ArgsService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/AttachService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/BlacklistService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/DownlogService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/MenuAuthService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/MetaDownService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/ProxyService.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/ReportService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/ResLogService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/ResService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/RoleLayerService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/RoleResService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/service/sys/RoleUserService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/moon/server/helper/HttpHelper.java
@@ -26,10 +26,7 @@
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;
/**
 * Http帮助类
 * @author WWW
 */
@SuppressWarnings("ALL")
public class HttpHelper {
    private final static String HTTP_SLASH2 = "://";
src/main/java/com/moon/server/helper/WordHelper.java
@@ -9,16 +9,10 @@
import java.util.List;
import java.util.Map;
/**
 * Word帮助类
 * @author WWW
 */
@SuppressWarnings("ALL")
public class WordHelper {
    private final static Log log = LogFactory.getLog(WordHelper.class);
    /**
     * 通过word模板生成word的主方法
     */
    public static void generateWord(String inputFile, String outPutFile, Map<String, String> insertTextMap, List<String[]> addList) {
        FileInputStream inputStream = null;
        FileOutputStream outputStream = null;
@@ -27,18 +21,14 @@
            inputStream = new FileInputStream(inputFile);
            outputStream = new FileOutputStream(outPutFile);
            // 获取docx解析对象
            XWPFDocument xwpfDocument = new XWPFDocument(inputStream);
            // 处理所有文段数据,除了表格
            if (null != insertTextMap && insertTextMap.size() > 0) {
                handleParagraphs(xwpfDocument, insertTextMap);
            }
            // 处理表格数据
            handleTable(xwpfDocument, insertTextMap, addList);
            // 写入数据
            xwpfDocument.write(outputStream);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
@@ -56,24 +46,17 @@
        }
    }
    /**
     * 处理所有文段数据,除了表格
     */
    public static void handleParagraphs(XWPFDocument xwpfDocument, Map<String, String> insertTextMap) {
        for (XWPFParagraph paragraph : xwpfDocument.getParagraphs()) {
            String text = paragraph.getText();
            if (isReplacement(text)) {
                for (XWPFRun run : paragraph.getRuns()) {
                    // 判断带有 ${} 的run
                    run.setText(matchesValue(run.text(), insertTextMap), 0);
                }
            }
        }
    }
    /**
     * 处理表格数据方法
     */
    public static void handleTable(XWPFDocument xwpfDocument, Map<String, String> map, List<String[]> addList) {
        List<XWPFTable> tables = xwpfDocument.getTables();
        for (XWPFTable table : tables) {
@@ -94,9 +77,6 @@
        }
    }
    /**
     * 替换数据
     */
    private static void replaceData(List<XWPFTableRow> rows, Map<String, String> map) {
        for (XWPFTableRow row : rows) {
            List<XWPFTableCell> tableCells = row.getTableCells();
@@ -114,9 +94,6 @@
        }
    }
    /**
     * 插入数据
     */
    private static void insertData(XWPFTable table, List<String[]> addList) {
        for (int i = 1, c = addList.size(); i < c; i++) {
            table.createRow();
@@ -142,9 +119,6 @@
        }
    }
    /**
     * 设置单元格文本
     */
    private static void setCellText(XWPFTableCell cell, String text) {
        List<XWPFParagraph> paragraphs = cell.getParagraphs();
        for (XWPFParagraph paragraph : paragraphs) {
@@ -155,13 +129,6 @@
        }
    }
    /**
     * 有${}的值匹配出替换的数据,没有${}就返回原来的数据
     *
     * @param wordValue ${...} 带${}的变量
     * @param map       存储需要替换的数据
     * @return java.lang.String
     */
    public static String matchesValue(String wordValue, Map<String, String> map) {
        for (String s : map.keySet()) {
            String s1 = "${" + s + "}";
@@ -173,16 +140,10 @@
        return wordValue;
    }
    /**
     * 测试是否包含需要替换的数据
     */
    public static boolean isReplacement(String text) {
        return text.contains("$");
    }
    /**
     * 复制模板行的属性
     */
    private static void setCellText(XWPFTableCell tmpCell, XWPFTableCell cell, String text) {
        CTTc cttc2 = tmpCell.getCTTc();
        CTTcPr ctPr2 = cttc2.getTcPr();
@@ -207,10 +168,8 @@
        XWPFRun cellR = cellP.createRun();
        cellR.setText(text);
        // 复制字体信息
        copyFontInfo(cellR, tmpR);
        // 复制段落信息
        cellP.setAlignment(tmpP.getAlignment());
        cellP.setVerticalAlignment(tmpP.getVerticalAlignment());
        cellP.setBorderBetween(tmpP.getBorderBetween());
@@ -224,17 +183,11 @@
            CTPPr tmpPpr = tmpP.getCTP().getPPr();
            CTPPr cellPpr = cellP.getCTP().getPPr() != null ? cellP.getCTP().getPPr() : cellP.getCTP().addNewPPr();
            // 复制段落间距信息
            copySpacing(tmpPpr, cellPpr);
            // 复制段落缩进信息
            copyParagraph(tmpPpr, cellPpr);
        }
    }
    /**
     * 复制字体信息
     */
    private static void copyFontInfo(XWPFRun cellR, XWPFRun tmpR) {
        if (tmpR == null) {
            return;
@@ -274,9 +227,6 @@
        }
    }
    /**
     * 复制段落间距信息
     */
    private static void copySpacing(CTPPr tmpPpr, CTPPr cellPpr) {
        CTSpacing tmpSpacing = tmpPpr.getSpacing();
        if (tmpSpacing != null) {
@@ -310,9 +260,6 @@
        }
    }
    /**
     * 复制段落缩进信息
     */
    private static void copyParagraph(CTPPr tmpPpr, CTPPr cellPpr) {
        CTInd tmpInd = tmpPpr.getInd();
        if (tmpInd != null) {
src/main/java/com/moon/server/mapper/sys/LayerMapper.java
@@ -6,132 +6,37 @@
import java.util.List;
/**
 * 图层
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface LayerMapper {
    /**
     * 根据用户ID查询图层列表
     *
     * @param uid 用户ID
     * @return 图层列表
     */
    public List<LayerEntity> selectLayers(String uid);
    /**
     * 根据用户ID查询图投影层列表
     *
     * @param uid 用户ID
     * @return 投影图层列表
     */
    public List<LayerEntity> selectProjectLayers(String uid);
    /**
     * 查询记录数
     *
     * @param name 名称
     * @return 记录数
     */
    public Integer selectCount(String name);
    /**
     * 分页查询
     *
     * @param name   名称
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @param flag 图层标识
     * @return
     */
    public List<LayerEntity> selectAll(Integer flag);
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public LayerEntity selectById(int id);
    /**
     * 根据名称查询ID
     *
     * @param name 名称
     * @return ID
     */
    public Integer selectIdByName(String name);
    /**
     * 根据pid查询最大排序数
     *
     * @param pid 父类ID
     * @return 最大排序数
     */
    public Integer selectMaxOrderNumByPid(Integer pid);
    /**
     * 根据资源ID查询图层
     *
     * @param resid 资源ID
     * @return 图层
     */
    public LayerEntity selectByResId(Integer resid);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(LayerEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<LayerEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(LayerEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<LayerEntity> list);
}
src/main/java/com/moon/server/mapper/sys/ReportMapper.java
@@ -7,128 +7,37 @@
import java.util.List;
/**
 * 报告模板
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface ReportMapper {
    /**
     * 查询记录数
     *
     * @param name 名称
     * @param code 编码
     * @return 记录数
     */
    public Integer selectCount(String name, String code);
    /**
     * 分页查询
     *
     * @param name   名称
     * @param code   编码
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<ReportEntity> selectByPage(String name, String code, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<ReportEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public ReportEntity selectById(int id);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(ReportEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<ReportEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(ReportEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<ReportEntity> list);
    /**
     * 数据量统计
     *
     * @return
     */
    public List<CountEntity> countSizes();
    /**
     * 按文件类型统计
     *
     * @return
     */
    public List<CountEntity> countSizesByType();
    /**
     * 服务调用量统计
     *
     * @return
     */
    public List<CountEntity> countServices();
    /**
     * 用户流量统计
     *
     * @return
     */
    public List<CountEntity> countOperates();
    /**
     * 按项目统计数据
     *
     * @return
     */
    public List<CountEntity> countSizesByPrj();
}
src/main/java/com/moon/server/mapper/sys/ResLogMapper.java
@@ -6,91 +6,27 @@
import java.util.List;
/**
 * 资源日志
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface ResLogMapper {
    /**
     * 查询记录数
     *
     * @param resid 资源ID
     * @return 记录数
     */
    public Integer selectCount(Integer resid);
    /**
     * 分页查询
     *
     * @param resid   资源ID
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<ResLogEntity> selectByPage(Integer resid, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<ResLogEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public ResLogEntity selectById(int id);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(ResLogEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<ResLogEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(ResLogEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<ResLogEntity> list);
}
src/main/java/com/moon/server/mapper/sys/ResMapper.java
@@ -6,125 +6,33 @@
import java.util.List;
/**
 * 资源
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface ResMapper {
    /**
     * 查询记录数
     *
     * @param name     名称
     * @param status   状态
     * @param category 服务类别
     * @param type     服务类型
     * @param data     数据类型
     * @return 记录数
     */
    public Integer selectCount(String name, Integer status, Integer category, Integer type, Integer data);
    /**
     * 分页查询
     *
     * @param name     名称
     * @param status   状态
     * @param category 服务类别
     * @param type     服务类型
     * @param data     数据类型
     * @param limit    记录数
     * @param offset   偏移量
     * @return 列表
     */
    public List<ResEntity> selectByPage(String name, Integer status, Integer category, Integer type, Integer data, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<ResEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public ResEntity selectById(int id);
    /**
     * 根据发布ID查询
     *
     * @param pubid 发布ID
     * @return
     */
    public ResEntity selectByPubid(Integer pubid);
    /**
     * 根据角色查询记录数
     *
     * @param roleid
     * @return
     */
    public Integer selectCountForRole(Integer roleid);
    /**
     * 根据角色分页查询
     *
     * @param roleid
     * @param limit
     * @param offset
     * @return
     */
    public List<ResEntity> selectByPageForRole(Integer roleid, Integer limit, Integer offset);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(ResEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<ResEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(String ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(ResEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<ResEntity> list);
}
src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java
@@ -6,99 +6,29 @@
import java.util.List;
/**
 * 角色-图层
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface RoleLayerMapper {
    /**
     * 根据角色查询图层
     *
     * @param roleid 角色ID
     * @return 列表
     */
    public List<RoleLayerEntity> selectLayersByRole(Integer roleid);
    /**
     * 查询记录数
     *
     * @param roleid 角色ID
     * @return 记录数
     */
    public Integer selectCount(Integer roleid);
    /**
     * 分页查询
     *
     * @param roleid 角色ID
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<RoleLayerEntity> selectByPage(Integer roleid, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<RoleLayerEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public RoleLayerEntity selectById(int id);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(RoleLayerEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<RoleLayerEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(RoleLayerEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<RoleLayerEntity> list);
}
src/main/java/com/moon/server/mapper/sys/RoleResMapper.java
@@ -6,99 +6,29 @@
import java.util.List;
/**
 * 角色-资源
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface RoleResMapper {
    /**
     * 根据角色ID查询资源
     *
     * @param roleid
     * @return
     */
    public List<RoleResEntity> selectResByRole(Integer roleid);
    /**
     * 查询记录数
     *
     * @param roleid 角色ID
     * @return 记录数
     */
    public Integer selectCount(Integer roleid);
    /**
     * 分页查询
     *
     * @param roleid 角色ID
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<RoleResEntity> selectByPage(Integer roleid, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<RoleResEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public RoleResEntity selectById(int id);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(RoleResEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<RoleResEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(RoleResEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<RoleResEntity> list);
}
src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java
@@ -6,91 +6,27 @@
import java.util.List;
/**
 * 角色-用户
 * @author WWW
 */
@Mapper
@Repository
@SuppressWarnings("ALL")
public interface RoleUserMapper {
    /**
     * 查询记录数
     *
     * @param roleid 角色ID
     * @return 记录数
     */
    public Integer selectCount(Integer roleid);
    /**
     * 分页查询
     *
     * @param roleid   角色ID
     * @param limit  记录数
     * @param offset 偏移量
     * @return 列表
     */
    public List<RoleUserEntity> selectByPage(Integer roleid, Integer limit, Integer offset);
    /**
     * 查询所有
     *
     * @return
     */
    public List<RoleUserEntity> selectAll();
    /**
     * 根据ID查询
     *
     * @param id
     * @return
     */
    public RoleUserEntity selectById(int id);
    /**
     * 插入一条
     *
     * @param entity
     * @return
     */
    public Integer insert(RoleUserEntity entity);
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer inserts(List<RoleUserEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
    public Integer delete(int id);
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
    public Integer deletes(List<Integer> ids);
    /**
     * 更新一条
     *
     * @param entity
     * @return
     */
    public Integer update(RoleUserEntity entity);
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
    public Integer updates(List<RoleUserEntity> list);
}
src/main/java/com/moon/server/service/all/BaseQueryService.java
@@ -22,11 +22,8 @@
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * 父查询服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class BaseQueryService implements BaseQueryMapper {
    @Autowired
    BaseQueryMapper baseQueryMapper;
@@ -34,17 +31,8 @@
    @Autowired
    RedisService redisService;
    /**
     * 表名Map
     */
    private static final Map<String, String> TAB_MAP = new HashMap<>(3);
    /**
     * 添加过滤条件:(?i)and
     *
     * @param wrapper QueryWrapper
     * @param filter  原始过滤条件字符串
     */
    public <T> void addFilterWrapper(QueryWrapper<T> wrapper, String filter) {
        if (StringHelper.isEmpty(filter)) {
            return;
@@ -75,9 +63,6 @@
        }
    }
    /**
     * 驼峰转换为下划线
     */
    public static String camelToUnderline(String str) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0, c = str.length(); i < c; i++) {
@@ -92,9 +77,6 @@
        return sb.toString().replaceAll("_+", "_");
    }
    /**
     * 下划线转换为驼峰
     */
    public static String underlineToCamel(String str) {
        StringBuilder sb = new StringBuilder();
@@ -116,12 +98,6 @@
        return sb.toString();
    }
    /**
     * 获取值对象
     *
     * @param val 值
     * @return 对象
     */
    private Object getObjectVal(String express, String val) {
        if (StringHelper.isInteger(val)) {
            return Long.parseLong(val);
@@ -136,14 +112,6 @@
        return val.replace("'", "");
    }
    /**
     * 添加包装器
     *
     * @param wrapper QueryWrapper
     * @param field   字段
     * @param express 表达式
     * @param val     值
     */
    private <T> void addWrapper(QueryWrapper<T> wrapper, String field, String express, Object val) {
        if (StringHelper.isDate(val.toString())) {
            wrapper.apply(String.format("%s %s '%s'", field, express, val));
@@ -185,16 +153,10 @@
        }
    }
    /**
     * 获取字符串列表
     */
    private List<String> getStringList(String val) {
        return Arrays.asList(val.replace(StaticData.SINGLE_QUOTES, "").split(StaticData.COMMA));
    }
    /**
     * 获取整数列表
     */
    private List<Integer> getIntegerList(String val) {
        List<Integer> list = new ArrayList<>();
        for (String str : val.split(StaticData.COMMA)) {
@@ -204,14 +166,6 @@
        return list;
    }
    /**
     * 添加空间过滤条件
     *
     * @param basicMapper 父Mapper
     * @param wrapper     QueryWrapper
     * @param wkt         WKT(著名文本)
     * @throws Exception 异常
     */
    public void addGeomWrapper(BasicMapper basicMapper, QueryWrapper wrapper, String wkt) throws Exception {
        if (basicMapper instanceof GeomBaseMapper && !StringHelper.isEmpty(wkt)) {
            wkt = AesHelper.decrypt(wkt);
@@ -221,12 +175,6 @@
        }
    }
    /**
     * 获取几何对象的空间参考
     *
     * @param basicMapper 空间基础Mapper
     * @return SRID
     */
    public Integer getSrid(GeomBaseMapper basicMapper) {
        String tab = getTabName(basicMapper);
        String key = RedisCacheKey.sridKey(tab);
@@ -245,12 +193,6 @@
        return srid;
    }
    /**
     * 根据Mapper获取表名
     *
     * @param basicMapper Mapper
     * @return 表名
     */
    public static String getTabName(BasicMapper basicMapper) {
        String className = ClassHelper.getClassName(basicMapper);
        if (TAB_MAP.containsKey(className)) {
@@ -260,12 +202,6 @@
        return getTabName(className);
    }
    /**
     * 根据Mapper获取表名
     *
     * @param className Mapper类名
     * @return 表名
     */
    private static String getTabName(String className) {
        Class clazz = ClassHelper.getEntityClass(className);
        if (clazz == null) {
@@ -282,13 +218,6 @@
        return tabName;
    }
    /**
     * 添加缓冲区过滤条件
     *
     * @param baseMapper 父Mapper
     * @param wrapper    QueryWrapper
     * @param wkt        WKT(著名文本)
     */
    public void addBufferWrapper(GeomBaseMapper baseMapper, QueryWrapper wrapper, String wkt, double buffer) {
        Integer srid = getSrid(baseMapper);
        // buffer = buffer * 0.00000899928
src/main/java/com/moon/server/service/all/BaseUploadService.java
@@ -21,11 +21,8 @@
import java.sql.Timestamp;
import java.util.*;
/**
 * 父上传服务
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class BaseUploadService {
    @Autowired
    protected DirService dirService;
@@ -35,16 +32,10 @@
    public final Log log = LogFactory.getLog(getClass());
    /**
     * 查询目录
     */
    public String selectPath() {
        return pathHelper.getTempPathName();
    }
    /**
     * 上传文件
     */
    public <T> List<MetaFileEntity> uploadData(T t, String path, boolean isGetGuid, HttpServletRequest req, HttpServletResponse res) throws Exception {
        StandardMultipartHttpServletRequest request = (StandardMultipartHttpServletRequest) req;
        req.setCharacterEncoding("utf-8");
@@ -57,9 +48,6 @@
        return getFiles(path, isGetGuid, request);
    }
    /**
     * 设置实体类
     */
    private <T> void setEntity(T t, StandardMultipartHttpServletRequest req) {
        Enumeration<String> enumeration = req.getParameterNames();
        while (enumeration.hasMoreElements()) {
@@ -94,9 +82,6 @@
        }
    }
    /**
     * 获取文件
     */
    public List<MetaFileEntity> getFiles(String subPath, boolean isGetGuid, StandardMultipartHttpServletRequest req) throws Exception {
        List<MetaFileEntity> list = new ArrayList<>();
@@ -126,9 +111,6 @@
        return list;
    }
    /**
     * 查询文件
     */
    public List<MetaFileEntity> selectFiles(String subPath, boolean hasMd5) {
        String root = pathHelper.getConfig().getTempPath() + File.separator + subPath;
@@ -164,9 +146,6 @@
        return list;
    }
    /**
     * 删除文件
     */
    public Integer deleteFiles(List<MetaFileEntity> list) {
        String root = pathHelper.getConfig().getTempPath();
@@ -186,9 +165,6 @@
        return count;
    }
    /**
     * 查询映射
     */
    public List<MetaFileEntity> selectMappers(UserEntity ue, String path, DirEntity dir, VerEntity ver) {
        List<MetaFileEntity> metas = selectFiles(path, true);
        if (null == metas || metas.isEmpty()) {
@@ -219,9 +195,6 @@
        return list;
    }
    /**
     * 获取映射文件
     */
    private List<MetaFileEntity> getMapperFiles(String path, DirEntity dir, List<DirEntity> dirs, MetaFileEntity meta) {
        String tempPath = pathHelper.getConfig().getTempPath();
        String zipFile = tempPath + File.separator + meta.getPath();
@@ -245,9 +218,6 @@
        return getMapperFiles(files, dir, dirs, meta, tempPath.length() + 1);
    }
    /**
     * 根据路径获取文件
     */
    private void getFilesByPath(List<File> list, String path) {
        File file = new File(path);
        if (!file.isDirectory()) {
@@ -277,9 +247,6 @@
        }
    }
    /**
     * 文件是/否有效
     */
    private boolean isFileValid(String fileName) {
        String extName = FileHelper.getExtension(fileName);
        if (fileName.startsWith(StaticData.TILDE) || !StaticData.ALL_EXTENSION.contains(extName)) {
@@ -296,9 +263,6 @@
        return true;
    }
    /**
     * 获取映射文件
     */
    private List<MetaFileEntity> getMapperFiles(List<File> files, DirEntity dir, List<DirEntity> dirs, MetaFileEntity meta, int start) {
        List<MetaFileEntity> list = new ArrayList<>();
        for (File f : files) {
@@ -337,9 +301,6 @@
        return list;
    }
    /**
     * 创建元数据文件实体类
     */
    private MetaFileEntity createMetaFileEntity(File f, MetaFileEntity meta, String fileName, String extName) {
        boolean isShp = StaticData.SHP.equals(extName);
@@ -361,9 +322,6 @@
        return mf;
    }
    /**
     * 创建元数据文件实体类
     */
    private MetaFileEntity createMetaFileEntity(MetaFileEntity meta) {
        MetaFileEntity mf = new MetaFileEntity();
        mf.setDircode(meta.getDircode());
@@ -375,9 +333,6 @@
        return mf;
    }
    /**
     * 根据文件路径获取目录ID
     */
    private String getDirByPath(String filePath,String fileName, DirEntity dir, List<DirEntity> dirs) {
        if (0 != dir.getPid() || null == dirs || dirs.isEmpty()) {
            return dir.getCode();
@@ -397,9 +352,6 @@
        return dir.getCode();
    }
    /**
     * 获取SHP文件集合
     */
    private List<String> getShpFiles(String shpPath) {
        List<String> list = new ArrayList<>();
        list.add(shpPath);
@@ -416,9 +368,6 @@
        return list;
    }
    /**
     * 获取GDB文件集合
     */
    private List<String> getGdbFiles(String path) {
        List<String> list = new ArrayList<>();
@@ -433,9 +382,6 @@
        return list;
    }
    /**
     * 获取多文件的MD5
     */
    private String getFilesMd5(List<String> files) {
        List<String> list = new ArrayList<>();
        for (String file : files) {
@@ -453,9 +399,6 @@
        return StringHelper.getGuid();
    }
    /**
     * 获取多文件的大小
     */
    private double getFilesSize(List<String> files) {
        long size = 0L;
        for (String file : files) {
@@ -468,9 +411,6 @@
        return FileHelper.sizeToMb(size);
    }
    /**
     * 获取GDB文件映射
     */
    private List<MetaFileEntity> getGdbMappers(File f, MetaFileEntity meta, String dircode, int start) {
        List<String> tabs = GdbHelper.getTabNames(f.getPath());
        if (null == tabs || tabs.size() == 0) {
@@ -502,9 +442,6 @@
        return list;
    }
    /**
     * 是/否为GDB文件
     */
    private boolean isGdbFile(File f) {
        if (f.isDirectory() && f.getName().toLowerCase().endsWith(StaticData.GDB)) {
            File gdb = new File(f.getPath() + File.separator + "gdb");
@@ -515,9 +452,6 @@
        return false;
    }
    /**
     * 设置元数据文件的类型
     */
    private void setMetaType(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
            if (null != mf.getExtName()) {
@@ -526,9 +460,6 @@
        }
    }
    /**
     * 处理目录
     */
    public void copePath(List<MetaFileEntity> list) {
        String basePath = pathHelper.getConfig().getTempPath() + File.separator;
        for (MetaFileEntity mf : list) {
@@ -536,9 +467,6 @@
        }
    }
    /**
     * 是/否为OSGB文件
     */
    private boolean isOsgbFile(File f) {
        if (f.isDirectory()) {
            File meta = new File(f.getPath() + File.separator + "metadata.xml");
@@ -550,10 +478,6 @@
        return false;
    }
    /**
     * 获取OSGB文件映射
     */
    private MetaFileEntity getOsgbMapper(File f,  MetaFileEntity meta, String dircode, int start) {
        String fileName = FileHelper.getFileName(f.getPath());
@@ -576,11 +500,6 @@
        return mf;
    }
    /**
     * 获取参数 *
     * Enumeration<String> headers = req.getHeaderNames();
     * Enumeration<String> attributes = req.getAttributeNames();
     */
    public Map<String, String> getParams(StandardMultipartHttpServletRequest req) {
        Map<String, String> map = new HashMap<>(3);
src/main/java/com/moon/server/service/all/CommonsFileuploadService.java
@@ -20,11 +20,8 @@
import java.util.List;
import java.util.Map;
/**
 * CommonsFileupload上传服务
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class CommonsFileuploadService {
    @Autowired
    PathHelper pathHelper;
@@ -37,38 +34,26 @@
        return copeFileItems(items, req);
    }
    /**
     * 获取文件项
     */
    private List<FileItem> getFileItem(HttpServletRequest req, HttpServletResponse res) throws Exception {
        // 处理中文乱码问题
        req.setCharacterEncoding("utf-8");
        // text/html;charset=utf-8
        res.setContentType("application/json;charset=utf-8");
        // 检查请求是/否为multipart/form-data类型
        if (!ServletFileUpload.isMultipartContent(req)) {
            throw new RuntimeException("表单的enctype属性不是multipart/form-data类型");
        }
        // 创建上传所需要的两个对象:磁盘文件对象+文件上传对象
        DiskFileItemFactory factory = new DiskFileItemFactory();
        ServletFileUpload sfu = new ServletFileUpload(factory);
        ServletRequestContext ctx = new ServletRequestContext(req);
        // 设置编码方式
        sfu.setHeaderEncoding("utf-8");
        factory.setSizeThreshold(4096);
        // 获取表单中的所有数据信息
        List<FileItem> list = sfu.parseRequest(ctx);
        return list;
    }
    /**
     * 处理解析内容:处理普通表单域和文件表单域
     */
    private Object copeFileItems(List<FileItem> items, HttpServletRequest req) throws Exception {
        Map<String, String> map = new HashMap<String, String>(3);
        List<FileInfoEntity> list = new ArrayList<FileInfoEntity>();
@@ -91,12 +76,8 @@
        return map;
    }
    /**
     * 处理文件
     */
    private FileInfoEntity copeFile(FileItem item, String path, HttpServletRequest req) {
        try {
            // 获取文件名,判断是否合法
            FileInfoEntity fi = new FileInfoEntity(item.getName());
            if (StringHelper.isEmpty(fi.getFileName())) {
                return null;
src/main/java/com/moon/server/service/all/PermsService.java
@@ -10,11 +10,8 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
 * 授权服务
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class PermsService implements PermsMapper {
    @Resource
    PermsMapper permsMapper;
@@ -130,30 +127,18 @@
        return permsMapper.selectMenuRecursive(id, uid);
    }
    /**
     * 清除资源缓存
     */
    public void clearResCache() {
        redisService.clearKeys(RedisCacheKey.permsResKey(""));
    }
    /**
     * 清除图层缓存
     */
    public void clearLayerCache() {
        redisService.clearKeys(RedisCacheKey.permsLayerKey(""));
    }
    /**
     * 清除授权缓存
     */
    public void clearPermsCache() {
        redisService.clearKeys(RedisCacheKey.permsRootKey());
    }
    /**
     * 清除所有缓存
     */
    public void clearAllCache() {
        redisService.clearAll();
    }
src/main/java/com/moon/server/service/all/RedisService.java
@@ -7,82 +7,39 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
 * Redis服务类
 * @author WWW
 */
@Service("redisService")
@SuppressWarnings("ALL")
public class RedisService {
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    /**
     * 获取Redis模板
     *
     * @return
     */
    public RedisTemplate<String, Object> getRedisTemplate() {
        return redisTemplate;
    }
    /**
     * 设置值到redis中
     *
     * @param key   键
     * @param value 值
     */
    public void put(String key, Object value) {
        redisTemplate.opsForValue().set(key, value);
    }
    /**
     * 设置值到redis中,并设置过期时间
     *
     * @param key     键
     * @param value   值
     * @param timeout 时间
     * @param unit    单位
     */
    public void put(String key, Object value, long timeout, TimeUnit unit) {
        redisTemplate.opsForValue().set(key, value, timeout, unit);
    }
    /**
     * 根据key获取value
     *
     * @param key 键
     * @return
     */
    public Object get(String key) {
        return redisTemplate.opsForValue().get(key);
    }
    /**
     * 是否存在key
     *
     * @param key 键
     * @return
     */
    public boolean hasKey(String key) {
        return redisTemplate.hasKey(key);
    }
    /**
     * 移除key
     *
     * @param key 键
     */
    public void delete(String key) {
        if (hasKey(key)) {
            redisTemplate.delete(key);
        }
    }
    /**
     * 清空指定键前缀
     *
     * @param subKeyString 键前缀
     */
    public void clearKeys(String subKeyString) {
        Set<String> keys = redisTemplate.keys(subKeyString + "*");
        if (null != keys && keys.size() > 0) {
@@ -90,9 +47,6 @@
        }
    }
    /**
     * 清空所有
     */
    public void clearAll() {
        Set<String> keys = redisTemplate.keys("*");
        if (null != keys && keys.size() > 0) {
src/main/java/com/moon/server/service/all/ScheduleService.java
@@ -31,11 +31,8 @@
import oshi.hardware.CentralProcessor;
import oshi.hardware.GlobalMemory;
/**
 * 日程服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ScheduleService {
    @Autowired
    private ResService resService;
@@ -51,9 +48,6 @@
    private static final Log log = LogFactory.getLog(ScheduleService.class);
    /**
     * 查询服务器状态
     */
    public JSONObject selectServerStatus() throws InterruptedException {
        JSONObject json = new JSONObject();
        json.put("cpuInfo", selectCpuInfo());
@@ -62,15 +56,11 @@
        return json;
    }
    /**
     * 查询Cpu信息
     */
    public JSONObject selectCpuInfo() throws InterruptedException {
        SystemInfo systemInfo = new SystemInfo();
        CentralProcessor processor = systemInfo.getHardware().getProcessor();
        long[] prevTicks = processor.getSystemCpuLoadTicks();
        // 睡眠1s
        TimeUnit.SECONDS.sleep(1);
        long[] ticks = processor.getSystemCpuLoadTicks();
        long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()];
@@ -93,18 +83,13 @@
        return map;
    }
    /**
     * 查询内存信息
     */
    public JSONObject selectMemInfo() {
        JSONObject map = new JSONObject();
        SystemInfo systemInfo = new SystemInfo();
        GlobalMemory memory = systemInfo.getHardware().getMemory();
        // 总内存
        long totalByte = memory.getTotal();
        // 剩余
        long surplusByte = memory.getAvailable();
        map.put("totalMem", FileHelper.formatByte(totalByte));
        map.put("use", FileHelper.formatByte(totalByte - surplusByte));
@@ -114,9 +99,6 @@
        return map;
    }
    /**
     * 查询在线用户
     */
    public List<JSONObject> selectOnlineUsers() {
        List<JSONObject> list = new ArrayList<JSONObject>();
@@ -138,27 +120,18 @@
        return list;
    }
    /**
     * 统计在线用户数
     */
    public int countOnlineUsers() {
        Set<String> keys = redisTemplate.keys(RedisCacheKey.signUserKey("*"));
        return null == keys ? 0 : keys.size();
    }
    /**
     * 查询服务资源状态
     */
    public List<ResEntity> selectResStatus() {
        List<ResEntity> resList = resService.selectAll();
        return testResStatus(resList);
    }
    /**
     * 测试资源状态
     */
    private List<ResEntity> testResStatus(List<ResEntity> resList) {
        List<ResEntity> list = new ArrayList<>();
        for (ResEntity re : resList) {
@@ -172,7 +145,6 @@
                URI uri = new URI(re.getUrl());
                SocketAddress add = new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort());
                // Ping通地址
                socket.connect(add, 2000);
            } catch (Exception e) {
                // log.error(e.getMessage())
@@ -189,26 +161,17 @@
        return list;
    }
    /**
     * 统计服务资源状态
     */
    public JSONObject countResStatus() {
        List<ResEntity> resList = resService.selectAll();
        List<ResEntity> unableList = testResStatus(resList);
        JSONObject jsonObject = new JSONObject();
        // 资源可用
        jsonObject.put("resAbleCount", resList.size() - unableList.size());
        // 资源不可用
        jsonObject.put("resUnableCount", unableList.size());
        return jsonObject;
    }
    /**
     * 资源操作状态
     */
    public JSONObject operateCount() {
        List<OperateEntity> list = operateService.operateCount();
        JSONObject jsonObject = new JSONObject();
@@ -227,9 +190,6 @@
        }
    }
    /**
     * 用户登录状态
     */
    public JSONObject userLoginCount() {
        List<LoginEntity> list = loginService.selectLoginCounts();
        if (list == null || list.isEmpty()) {
src/main/java/com/moon/server/service/all/SignService.java
@@ -21,20 +21,14 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 签名服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class SignService {
    @Autowired
    PropertiesConfig propertiesConfig;
    private final static String SUCCESS = "success";
    /**
     * 自动登录Druid
     */
    public void loginDruid(HttpServletRequest req, HttpServletResponse res) throws Exception {
        List<NameValuePair> list = new ArrayList<>();
        list.add(new BasicNameValuePair("loginUsername", propertiesConfig.getDruidUser()));
src/main/java/com/moon/server/service/all/SysService.java
@@ -5,11 +5,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 系统服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class SysService {
    @Autowired
    public TokenService tokenService;
src/main/java/com/moon/server/service/all/TestService.java
@@ -22,10 +22,6 @@
import java.util.List;
import java.util.Map;
/**
 * 测试服务类
 * @author WWW
 */
@Service
@SuppressWarnings("AlibabaRemoveCommentedCode")
public class TestService {
src/main/java/com/moon/server/service/all/UploadAttachService.java
@@ -28,11 +28,8 @@
import java.lang.reflect.Field;
import java.util.*;
/**
 * 上传附件服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class UploadAttachService {
    @Autowired
    PathHelper pathHelper;
@@ -49,16 +46,10 @@
    private final static Log log = LogFactory.getLog(UploadAttachService.class);
    /**
     * 获取表名
     */
    public static String getTabs() {
        return tabs;
    }
    /**
     * 初始化附件表
     */
    public static void init(String cfg) {
        if (StringHelper.isEmpty(cfg)) {
            return;
@@ -81,9 +72,6 @@
        tabs = StringHelper.join(keys, ",");
    }
    /**
     * 上传文件
     */
    public ResponseMsg<String> upload(UserEntity ue, String tab, MultipartFile file, BaseController ctrl) {
        try {
            if (file == null && file.isEmpty()) {
@@ -93,14 +81,12 @@
                return ctrl.fail(String.format("文件大于 %d MB", SettingData.MAX_FILE_SIZE / 1024 / 1024), null);
            }
            // 传输文件
            String oldName = file.getOriginalFilename();
            String filePath = pathHelper.getTempPath() + File.separator + oldName;
            File newFile = new File(filePath);
            file.transferTo(newFile);
            double sizes = FileHelper.sizeToMb(file.getSize());
            // 获取MD5
            String md5 = FileHelper.getFileMd5(filePath);
            AttachEntity entity = attachService.selectByGuid(md5);
            if (entity != null) {
@@ -120,9 +106,6 @@
        }
    }
    /**
     * 获取附件实体类
     */
    protected AttachEntity getAttachEntity(UserEntity ue, String tab, String oldName, String md5, double sizes) {
        AttachEntity entity = new AttachEntity();
        entity.setName(oldName);
@@ -138,16 +121,10 @@
        return entity;
    }
    /**
     * 下载文件
     */
    public void download(String guid, HttpServletResponse res) {
        download(guid, false, res);
    }
    /**
     * 下载文件
     */
    public void download(String guid, boolean inline, HttpServletResponse res) {
        try {
            if (StringHelper.isEmpty(guid)) {
@@ -174,9 +151,6 @@
        }
    }
    /**
     * 上传Excel附件
     */
    public List<KeyValueEntity> uploadXlsAnnex(UserEntity ue, List<MetaEntity> ms, List<MetaFileEntity> list, String path) {
        List<String> files = getAttachFiles(list, path);
        if (files.size() == 0) {
@@ -192,9 +166,6 @@
        return rs;
    }
    /**
     * 获取附件文件
     */
    private List<String> getAttachFiles(List<MetaFileEntity> list, String path) {
        List<String> files = new ArrayList<>();
@@ -213,9 +184,6 @@
        return files;
    }
    /**
     * 获取zip中的文件
     */
    private List<String> getZipFiles(MetaFileEntity mf, String path) {
        File file = new File(mf.getPath());
        if (!file.exists() || file.isDirectory()) {
@@ -236,9 +204,6 @@
        return files;
    }
    /**
     * 根据路径获取文件
     */
    private void getFilesByPath(List<String> list, String path) {
        File file = new File(path);
        if (!file.isDirectory()) {
@@ -260,9 +225,6 @@
        }
    }
    /**
     * 上传Excel附件
     */
    private int uploadXlsAnnex(UserEntity ue, MetaEntity meta, List<String> files) {
        List<?> list = queryXlsData(meta);
        if (null == list || list.size() == 0) {
@@ -292,9 +254,6 @@
        return rows;
    }
    /**
     * 获取名称
     */
    public static String[] getNames(String str) {
        if (StringHelper.isEmpty(str)) {
            return null;
@@ -303,9 +262,6 @@
        return str.replace(";", ",").replace(",", ",").split(",");
    }
    /**
     * 查询Excel数据
     */
    private List<?> queryXlsData(MetaEntity meta) {
        String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase();
        BasicMapper basicMapper = ClassHelper.getBasicMapper(entity);
@@ -327,9 +283,6 @@
        return list;
    }
    /**
     * 获取附件字段
     */
    public static Field getAnnexField(Object obj, String tab) {
        try {
            String str = ATTACH_TABS.get(tab);
@@ -343,9 +296,6 @@
        }
    }
    /**
     * 获取附件名称
     */
    public static String getAnnexName(Object obj, Field field) {
        try {
            Object val = field.get(obj);
@@ -356,9 +306,6 @@
        }
    }
    /**
     * 查找附件文件
     */
    private String findAnnexFile(String name, String folder, List<String> files) {
        name = File.separator + name.split("\\.")[0].trim().toLowerCase();
        for (String file : files) {
@@ -375,9 +322,6 @@
        return null;
    }
    /**
     * 插入Excel附件
     */
    private int insertXlsAnnex(UserEntity ue, MetaEntity meta, BaseEntity be, String file) {
        File f = new File(file);
        if (!f.exists() || f.isDirectory()) {
@@ -405,9 +349,6 @@
        return attachService.insert(ae);
    }
    /**
     * 获取附件实体类
     */
    protected AttachEntity getAttachEntity(UserEntity ue, String tabName, String eventid, String fileName, String md5, double sizes) {
        AttachEntity entity = new AttachEntity();
        entity.setTab(tabName);
@@ -424,27 +365,18 @@
        return entity;
    }
    /**
     * 请求下载
     */
    public String downloadReqForGuids(UserEntity ue, List<String> guids) {
        List<AttachEntity> list = attachService.selectByGuids(guids);
        return downloadReq(ue, list);
    }
    /**
     * 请求下载
     */
    public String downloadReqForTabGuids(UserEntity ue, String tab, List<String> guids) {
        List<AttachEntity> list = attachService.selectByTabGuids(tab, guids);
        return downloadReq(ue, list);
    }
    /**
     * 请求下载
     */
    protected String downloadReq(UserEntity ue, List<AttachEntity> list) {
        if (null == list || list.isEmpty()) {
            return null;
@@ -463,9 +395,6 @@
        return rows > 0 ? downloadEntity.getGuid() : null;
    }
    /**
     * 添加Zip文件
     */
    private void addZipFiles(ZipFile zip, ZipParameters params, List<AttachEntity> list) {
        int i = 1;
        String uploadPath = pathHelper.getConfig().getUploadPath();
@@ -489,9 +418,6 @@
        }
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
src/main/java/com/moon/server/service/all/WebSocketService.java
@@ -11,12 +11,9 @@
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * WebSocket服务类
 * @author WWW
 */
@ServerEndpoint(value = "/ws/select")
@Component
@SuppressWarnings("ALL")
@ServerEndpoint(value = "/ws/select")
public class WebSocketService {
    @PostConstruct
    public void init() {
@@ -27,14 +24,8 @@
    private static final AtomicInteger ONLINE_COUNT = new AtomicInteger(0);
    /**
     * 用来存放每个客户端对应的Session对象(线程安全Set)
     */
    private final static CopyOnWriteArraySet<Session> SESSION_SET = new CopyOnWriteArraySet<Session>();
    /**
     * 连接建立成功调用的方法
     */
    @OnOpen
    public void onOpen(Session session) {
        SESSION_SET.add(session);
@@ -44,9 +35,6 @@
        sendMessage(session, "连接成功");
    }
    /**
     * 连接关闭调用的方法
     */
    @OnClose
    public void onClose(Session session) {
        SESSION_SET.remove(session);
@@ -55,28 +43,17 @@
        log.info("有连接关闭,当前连接数为:{}", cnt);
    }
    /**
     * 收到客户端消息后调用的方法
     *
     * @param message 客户端发送过来的消息
     */
    @OnMessage
    public void onMessage(String message, Session session) {
        log.info("来自客户端的消息:{}", message);
        sendMessage(session, "收到消息,消息内容:" + message);
    }
    /**
     * 出现错误
     */
    @OnError
    public void onError(Session session, Throwable error) {
        log.error("发生错误:{},Session ID: {}", error.getMessage(), session.getId());
    }
    /**
     * 发送消息,实践表明,每次浏览器刷新,session会发生变化。
     */
    public static void sendMessage(Session session, String message) {
        try {
            // session.getAsyncRemote().sendText(message)
@@ -88,9 +65,6 @@
        }
    }
    /**
     * 群发消息
     */
    public static void broadCastInfo(String message) throws IOException {
        for (Session session : SESSION_SET) {
            if (session.isOpen()) {
@@ -99,9 +73,6 @@
        }
    }
    /**
     * 指定Session发送消息
     */
    public static void sendMessage(String message, String sessionId) throws IOException {
        Session session = null;
        for (Session s : SESSION_SET) {
src/main/java/com/moon/server/service/data/ColortabService.java
@@ -8,11 +8,8 @@
import javax.annotation.Resource;
import java.util.List;
/**
 * 颜色
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ColortabService implements ColortabMapper {
    @Resource
    ColortabMapper colortabMapper;
src/main/java/com/moon/server/service/data/DataQueryService.java
@@ -16,11 +16,8 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 数据检索服务
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DataQueryService {
    @Autowired
    PathHelper pathHelper;
@@ -28,9 +25,6 @@
    @Autowired
    AttachService attachService;
    /**
     * 上传文件
     */
    public Integer uploadFiles(UserEntity ue, String tabName, String eventid, MultipartFile[] files, HttpServletRequest req) throws IOException {
        List<AttachEntity> list = new ArrayList<AttachEntity>();
        for (MultipartFile file : files) {
@@ -38,14 +32,12 @@
                continue;
            }
            // 传输文件
            String fileName = file.getOriginalFilename();
            String filePath = pathHelper.getTempPath() + File.separator + fileName;
            File newFile = new File(filePath);
            file.transferTo(newFile);
            double sizes = FileHelper.sizeToMb(file.getSize());
            // 获取MD5
            String md5 = FileHelper.getFileMd5(filePath);
            AttachEntity entity = attachService.selectByGuid(md5);
@@ -71,9 +63,6 @@
        return attachService.inserts(list);
    }
    /**
     * 获取附件实体类
     */
    protected AttachEntity getAttachEntity(UserEntity ue, String tabName, String eventid, String fileName, String md5, double sizes) {
        AttachEntity entity = new AttachEntity();
        entity.setTab(tabName);
src/main/java/com/moon/server/service/data/DictService.java
@@ -9,11 +9,8 @@
import java.util.List;
/**
 * 字典
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DictService implements DictMapper {
    @Autowired
    DictMapper dictMapper;
src/main/java/com/moon/server/service/data/DomainService.java
@@ -8,11 +8,8 @@
import java.util.List;
/**
 * 值域
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DomainService implements DomainMapper {
    @Autowired
    DomainMapper domainMapper;
src/main/java/com/moon/server/service/data/DownloadService.java
@@ -15,11 +15,8 @@
import java.io.File;
import java.util.*;
/**
 * 下载记录
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DownloadService implements DownloadMapper {
    @Autowired
    PathHelper pathHelper;
@@ -102,22 +99,10 @@
        return downloadMapper.updates(list);
    }
    /**
     * 获取下载文件路径
     *
     * @param de 下载实体类
     * @return 下载文件路径
     */
    public String getDownloadFilePath(DownloadEntity de) {
        return pathHelper.getConfig().getDownloadPath() + File.separator + de.getUrl();
    }
    /**
     * 解密
     *
     * @param entity 密码抽象类
     * @return 是/否解密成功
     */
    public static boolean decryptPwd(AbstractPwdEntity entity) {
        try {
            String pwd = RsaHelper.decrypt(entity.getPwd());
@@ -134,12 +119,6 @@
        }
    }
    /**
     * 解密
     *
     * @param pe 管道分析实体类
     * @return 是/否解密成功
     */
    public static boolean decryptPwd(PipelineEntity pe) {
        try {
            String pwd = RsaHelper.decrypt(pe.getPwd());
@@ -156,12 +135,6 @@
        }
    }
    /**
     * 解密
     *
     * @param pwd 加密密码
     * @return 原始密码
     */
    public static String decryptPwd(String pwd) {
        try {
            return RsaHelper.decrypt(pwd);
src/main/java/com/moon/server/service/data/FmeService.java
@@ -15,34 +15,22 @@
import java.util.Date;
import java.util.List;
/**
 * FME服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class FmeService {
    @Value("${sys.fmeUrl}")
    private String fmeUrl;
    /**
     * 获取任务状态
     */
    public Object getTaskStatus(String id, HttpServletRequest req) {
        String url = getUrl("datax/task/get", req) + "&id=" + id;
        return RestHelper.getForRest(url, Object.class);
    }
    /**
     * 下载质检错误结果
     */
    public String getDownloadUrl(String id, HttpServletRequest req) {
        return getUrl("datax/task/downloadResult", req) + "&id=" + id;
    }
    /**
     * 1.OSGB检查:.osgb + *倾斜摄影*.xls/.xlsx
     */
    public String checkOsgb(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A8成果质检_OSGB检查", req);
@@ -54,9 +42,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 2.表格数据检查:.xls/.xlsx(排除元数据)
     */
    public String checkXls(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A3成果质检_表格数据检查", req);
@@ -68,9 +53,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 3.点云检查:.laz + *激光点云*.xls/.xlsx
     */
    public String checkLaz(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A9成果质检_点云检查", req);
@@ -82,9 +64,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 4.高程检查:.tif/.prj/.tfw/.tif.ovr + *地形图*.dwg
     */
    public String checkDem(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A6成果质检_高程检查", req);
@@ -97,9 +76,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 5.属性检查:*dlg*.gdb + *地形图*.dwg
     */
    public String checkAttrs(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A5成果质检_属性检查", req);
@@ -111,9 +87,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 6.拓扑检查:*地形图*.dwg
     */
    public String checkTopology(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A4成果质检_拓扑检查", req);
@@ -131,9 +104,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 7.图面整饰检查:.dwg
     */
    public String checkDecorate(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A10成果质检_图面整饰检查", req);
@@ -146,9 +116,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 8.原点检查:*剖面图*.dwg
     */
    public String checkOrigin(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A11成果质检_原点检查", req);
@@ -159,9 +126,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 9.栅格检查:.tif/.prj/.tfw/.tif.ovr + .xls/.xlsx
     */
    public String checkDom(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/A7成果质检_栅格检查", req);
@@ -175,9 +139,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 10.数学基础检查:.shp, .gdb, *元数据*.xls/.xlsx
     */
    public String checkMath(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B1入库质检_数学基础检查", req);
@@ -189,9 +150,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 11.元数据检查:*元数据*.xls/.xlsx
     */
    public String checkMeta(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B5入库质检_元数据检查", req);
@@ -203,9 +161,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 12.总质检:.zip/.7z + .xls/.xlsx
     */
    public String checkMain(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B0入库质检__总", req);
@@ -220,9 +175,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 13.逻辑一致性检查:.dwg/.xls/.xlsx
     */
    public String checkLogical(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B3入库质检_逻辑一致性检查", req);
@@ -234,9 +186,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * 14.单项成果完整性检查:.*
     */
    public String checkSingleIntegrity(FmeReqEntity fme, HttpServletRequest req) {
        String url = getUrl("datax/task/run/B6入库质检_单项成果完整性检查", req);
@@ -249,9 +198,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * a.表格入库:S_RKBG、dirid、parentid,多个以英文逗号隔开
     */
    public String excelLoader(MetaFileEntity meta, HttpServletRequest req) {
        String url = getUrl("datax/task/run/表格入库", req);
@@ -267,9 +213,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * b.CRDS平台交付
     */
    public String crdsPackaging(String dirCode, String major, String isCut, HttpServletRequest req) {
        // datax/task/run/CRDS平台交付_测试
        String url = getUrl("datax/task/run/CRDS平台交付_code测试", req);
@@ -282,9 +225,6 @@
        return RestHelper.postForRest(url, list);
    }
    /**
     * c.服务注册
     */
    public RegisterEntity serverRegister(String name, String serverUri, String type, HttpServletRequest req) {
        String url = getUrl("resource/res/item", req);
@@ -296,9 +236,6 @@
        return entity;
    }
    /**
     * d.服务申请
     */
    public void serverApply(String id, Integer pubid, HttpServletRequest req) {
        String url = getUrl("resource/res/request", req) + "&resourceid=" + id;
@@ -307,27 +244,18 @@
        RestHelper.postForRest(url, entity);
    }
    /**
     * e.删除资源
     */
    public void deleteRes(String id, HttpServletRequest req) {
        String url = getUrl("resource/res/hashid", req) + "&hashid=" + id;
        RestHelper.deleteForRest(url);
    }
    /**
     * 获取Url
     */
    public String getUrl(String subUrl, HttpServletRequest req) {
        String token = WebHelper.getToken(req);
        return fmeUrl + subUrl + "?token=" + token;
    }
    /**
     * 获取名称值对集合
     */
    public List<NameValueEntity> getKeyValues(String name) {
        List<NameValueEntity> list = new ArrayList<>();
        list.add(new NameValueEntity("_name", String.format("%s_%s", name, StringHelper.YMDHMS2_FORMAT.format(new Date()))));
src/main/java/com/moon/server/service/data/MetaService.java
@@ -27,11 +27,8 @@
import java.io.FileInputStream;
import java.util.*;
/**
 * 元数据
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class MetaService implements MetaMapper {
    @Autowired
    PathHelper pathHelper;
@@ -187,9 +184,6 @@
        return metaMapper.updates(list);
    }
    /**
     * 删除元数据
     */
    public Integer deletes(List<Integer> list) {
        String ids = StringHelper.join(list, ",");
@@ -202,9 +196,6 @@
        return deletes(sql, ids);
    }
    /**
     * 获取删除表记录SQL
     */
    public String getDelTabsSql(List<MetaEntity> metas) {
        List<String> list = getTabDeletes(metas, metas.get(0).getTab());
        addCascadDeletes(list);
@@ -214,9 +205,6 @@
        return StringHelper.join(list, ";");
    }
    /**
     * 获取删除表记录SQL
     */
    private List<String> getTabDeletes(List<MetaEntity> metas, String tab) {
        List<String> list = new ArrayList<>();
@@ -239,9 +227,6 @@
        return list;
    }
    /**
     * 添加级联删除
     */
    private void addCascadDeletes(List<String> list) {
        int i = 0, c = list.size();
        while (i < c) {
@@ -261,9 +246,6 @@
        }
    }
    /**
     * 添加附件删除
     */
    private void addAttachDeletes(List<String> list) {
        int i = 0, c = list.size();
        while (i < c) {
@@ -277,9 +259,6 @@
        }
    }
    /**
     * 查看文件
     */
    public void downloadForView(String guid, boolean inline, HttpServletResponse res) {
        try {
            if (StringHelper.isEmpty(guid)) {
@@ -306,23 +285,12 @@
        }
    }
    /**
     * 查询元数据中溢出的单位ID
     */
    public List<String> selectMetaOverflowDep(UserEntity ue, DownloadReqEntity dr) {
        String ids = StringHelper.join(dr.getIds(), ",");
        return selectMetaOverflowDep(ids, ue.getDepcode());
    }
    /**
     * 请求元数据下载
     *
     * @param ue 用户实体
     * @param dr 请求下载实体
     * @return 下载文件GUID
     * @throws Exception 异常
     */
    public String downloadMeteReq(UserEntity ue, DownloadReqEntity dr) throws Exception {
        List<MetaEntity> list = selectMetaFiles(dr.getIds());
        if (null == list || list.isEmpty()) {
@@ -367,9 +335,6 @@
        return rows > 0 ? de.getGuid() : null;
    }
    /**
     * 获取数据表
     */
    private Map<String, List<String>> getTabs(List<MetaEntity> list) {
        Map<String, List<String>> tabs = new HashMap<>(2);
        for (MetaEntity meta : list) {
@@ -390,9 +355,6 @@
        return tabs;
    }
    /**
     * 移除重复的元数据文件
     */
    private void rmRepeatMetas(List<MetaEntity> list) {
        List<String> guidList = new ArrayList<>();
@@ -409,9 +371,6 @@
        }
    }
    /**
     * 查询数据
     */
    private void queryData(Map<String, List<String>> tabs, Map<String, List<?>> dataMap, Map<String, List<AttachEntity>> annexMap) {
        for (String tab : tabs.keySet()) {
            try {
@@ -429,9 +388,6 @@
        }
    }
    /**
     * 添加数据
     */
    public void addData(String entity, BasicMapper baseMapper, QueryWrapper wrapper, Map<String, List<?>> dataMap, Map<String, List<AttachEntity>> annexMap) {
        List list = baseMapper.selectList(wrapper);
        if (null == list || list.size() == 0) {
@@ -463,9 +419,6 @@
        }
    }
    /**
     * 创建查询包装器
     */
    private <T> QueryWrapper<T> createQueryWrapper(BasicMapper baseMapper, List<String> ids) {
        for (int i = 0, c = ids.size(); i < c; i++) {
            ids.set(i, "'" + ids.get(i) + "'");
@@ -481,9 +434,6 @@
        return wrapper;
    }
    /**
     * 添加附件
     */
    public void addAnnex(ZipFile zip, ZipParameters params, Map<String, List<AttachEntity>> annexMap) {
        List<String> files = new ArrayList<>();
        String uploadPath = pathHelper.getConfig().getUploadPath();
@@ -508,9 +458,6 @@
        }
    }
    /**
     * 添加元数据文件至Zip包
     */
    private void addMetaFiles(ZipFile zip, ZipParameters params, List<MetaEntity> list) {
        List<String> names = new ArrayList<>();
        String uploadPath = pathHelper.getConfig().getUploadPath();
@@ -559,9 +506,6 @@
        }
    }
    /**
     * 添加目录文件
     */
    private void addFolderFile(String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params) throws Exception {
        File file = new File(uploadPath + File.separator + mf.getPath());
        if (!file.exists() || !file.isDirectory()) {
@@ -576,9 +520,6 @@
        }
    }
    /**
     * 添加多文件
     */
    private void addMultiFile(String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params, List<String> extList) throws Exception {
        addSingleFile(uploadPath, mf, zip, params);
@@ -597,9 +538,6 @@
        }
    }
    /**
     * 添加单文件
     */
    private void addSingleFile(String uploadPath, MetaEntity mf, ZipFile zip, ZipParameters params) throws Exception {
        File file = new File(uploadPath + File.separator + mf.getPath());
        if (!file.exists() || file.isDirectory()) {
@@ -614,9 +552,6 @@
        }
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
@@ -635,9 +570,6 @@
        return de;
    }
    /**
     * 插入元数据-下载表
     */
    private void insertMetaDown(UserEntity ue, List<MetaEntity> metas, DownloadEntity de) {
        List<MetaDownEntity> list = new ArrayList<>();
        for (MetaEntity me : metas) {
@@ -652,9 +584,6 @@
        metaDownService.inserts(list);
    }
    /**
     * 获取空间过滤
     */
    public String getGeometryFilter(String wkt) throws Exception {
        if (StringHelper.isEmpty(wkt)) {
            return null;
src/main/java/com/moon/server/service/data/PublishService.java
@@ -22,11 +22,8 @@
import java.util.List;
import java.util.Map;
/**
 * 数据发布
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class PublishService implements PublishMapper {
    @Value("${sys.exportServer}")
    private String exportServer;
@@ -145,9 +142,6 @@
        return publishMapper.selectMetasByPage(depcode, dircode, verid, types, name, limit, offset);
    }
    /**
     * 发送发布请求
     */
    public long postForPub(PubEntity entity, String method, HttpServletRequest req) {
        Map<String, Object> map = getMapData(entity);
@@ -164,9 +158,6 @@
        return msg.getCount();
    }
    /**
     * 获取Map数据
     */
    private Map<String, Object> getMapData(PubEntity entity) {
        Map<String, Object> map = new HashMap<>(3);
@@ -189,9 +180,6 @@
        return map;
    }
    /**
     * 发送发布请求
     */
    public long postForPub(PubEntity entity, String method) {
        Map<String, Object> map = getMapData(entity);
src/main/java/com/moon/server/service/data/ReadRasterService.java
@@ -19,18 +19,11 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 读取栅格服务
 * @author WWW
 * @date 2023-08-25
 */
@Service
@SuppressWarnings("ALL")
public class ReadRasterService {
    private final static Log log = LogFactory.getLog(ReadRasterService.class);
    /**
     * 读取栅格信息
     */
    public void readRasterInfo(MetaFileEntity mf, String file) {
        Dataset ds = null;
        try {
@@ -45,33 +38,23 @@
            }
            SpatialReference sr = ds.GetSpatialRef();
            // 坐标系统
            mf.setCoorSys(sr.GetName());
            if (StaticData.MOON200.equals(mf.getCoorSys())) {
                // EPSG编码
                mf.setEpsg("ESRI:" + StaticData.I104903);
            } else {
                // EPSG编码:PROJCS、GEOGCS、GEOGCS|UNIT 或 NULL
                String code = sr.GetAuthorityCode(null);
                mf.setEpsg(StringHelper.isEmpty(code) ? null : "EPSG:" + code);
            }
            // 行列数
            mf.setGridsize(String.format("%d,%d", ds.getRasterXSize(), ds.getRasterYSize()));
            // 波段数
            mf.setBands(String.valueOf(ds.getRasterCount()));
            // 数据类型
            int dataType = ds.GetRasterBand(1).GetRasterDataType();
            mf.setBandType(getDataType(dataType));
            // 数据颜色表
            ColorTable colorTable = ds.GetRasterBand(1).GetRasterColorTable();
            mf.setCt(null == colorTable ? null : colorTable.toString());
            // 高程基准
            mf.sethDatum(null);
            // 设置最值
            setMinAndMax(ds, mf);
            // 分辨率
            double[] tr = new double[6];
            ds.GetGeoTransform(tr);
            mf.setResolution(String.format("%f,%f", tr[1], Math.abs(tr[5])));
@@ -86,7 +69,6 @@
            double xmax = maxPoint.GetX(0);
            double ymax = maxPoint.GetY(0);
            // 四至范围
            String geom = String.format("ST_GeomFromText('POLYGON ((%f %f,%f %f,%f %f,%f %f,%f %f))')", xmin, ymax, xmax, ymax, xmax, ymin, xmin, ymin, xmin, ymax);
            mf.setGeom(geom);
        } catch (Exception ex) {
@@ -98,9 +80,6 @@
        }
    }
    /**
     * 获取数据类型
     */
    private String getDataType(int dataType) {
        if (dataType == gdalconst.GDT_Byte) {
            return "GDT_Byte";
@@ -139,9 +118,6 @@
        return null;
    }
    /**
     * 获取Dataset的最小点
     */
    private Geometry getMinPoint(Dataset ds) {
        double[] transform = new double[6];
        ds.GetGeoTransform(transform);
@@ -155,19 +131,7 @@
        return transform(ds, point);
    }
    /**
     * 获取Dataset的最大点
     */
    private Geometry getMaxPoint(Dataset ds) {
        /*
         * transform[0] 左上角x坐标
         * transform[1] 东西方向分辨率
         * transform[2] 旋转角度, 0表示图像 "北方朝上"
         *
         * transform[3] 左上角y坐标
         * transform[4] 旋转角度, 0表示图像 "北方朝上"
         * transform[5] 南北方向分辨率
         */
        double[] transform = new double[6];
        ds.GetGeoTransform(transform);
@@ -180,9 +144,6 @@
        return transform(ds, point);
    }
    /**
     * 坐标转换
     */
    private Geometry transform(Dataset ds, Geometry point) {
        point.AssignSpatialReference(ds.GetSpatialRef());
        if (ds.GetSpatialRef().IsGeographic() > 0) {
@@ -200,10 +161,6 @@
        return point;
    }
    /**
     * 设置最值
     * GDALRasterBand::GetHistogram ​​统计直方图
     */
    private void setMinAndMax(Dataset ds, MetaFileEntity mf) {
        List<Double> minList = new ArrayList<>();
        List<Double> maxList = new ArrayList<>();
src/main/java/com/moon/server/service/data/SlopeAnalysisService.java
@@ -18,12 +18,8 @@
import java.io.IOException;
import java.util.*;
/**
 * 栅格分析服务
 * @author WWW
 * @date 2023-11-16
 */
@Service
@SuppressWarnings("ALL")
public class SlopeAnalysisService {
    @Value("${sys.path.slopFile}")
    private String filePath;
@@ -35,9 +31,6 @@
    private final static Log log = LogFactory.getLog(SlopeAnalysisService.class);
    /**
     * 获取Excel模板
     */
    private String getXlsTemplate() throws IOException {
        if (null == xlsTemplate) {
            xlsTemplate = FileHelper.getClassPathForWar() + File.separator + "config" + File.separator + "slope.xlsx";
@@ -46,9 +39,6 @@
        return xlsTemplate;
    }
    /**
     * 下载坡度分析Excel
     */
    public void downloadSlopXls(Geometry polygon, HttpServletResponse res) throws Exception {
        Dataset ds = null;
        try {
@@ -76,9 +66,6 @@
        }
    }
    /**
     * 分析多边形
     */
    public List<PointEntity> analysisPolygon(Geometry geo, Dataset ds) {
        double[] transform = ds.GetGeoTransform();
        int xSize = ds.getRasterXSize(), ySize = ds.getRasterYSize();
@@ -114,9 +101,6 @@
        return list;
    }
    /**
     * 创建Excel
     */
    public String createXls(List<PointEntity> list, String template) {
        String target = pathHelper.getTempPath() + File.separator + "slope_" + StringHelper.YMD2_FORMAT.format(new Date()) + ".xlsx";
src/main/java/com/moon/server/service/data/UploadService.java
@@ -22,12 +22,8 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 数据上传服务类
 *
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class UploadService extends BaseUploadService implements UploadMapper {
    @Autowired
    UploadMapper uploadMapper;
@@ -67,9 +63,6 @@
        return uploadMapper.selectFmeLog(parentid);
    }
    /**
     * 插入文件
     */
    public void insertFiles(UserEntity ue, List<MetaFileEntity> list, HttpServletRequest req) {
        checkMetaFiles(ue, list);
        readRasterInfo(list);
@@ -78,9 +71,6 @@
        insertMetas(list);
    }
    /**
     * 检查元数据文件
     */
    private void checkMetaFiles(UserEntity ue, List<MetaFileEntity> list) {
        Timestamp createTime = WebHelper.getCurrentTimestamp();
        String tempPath = pathHelper.getConfig().getTempPath();
@@ -107,9 +97,6 @@
        }
    }
    /**
     * 读取栅格信息
     */
    private void readRasterInfo(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
            if (null != mf.getMsg()) {
@@ -122,9 +109,6 @@
        }
    }
    /**
     * 获取目录编码
     */
    private String getDirCode(MetaFileEntity mf) {
        if (StringHelper.isEmpty(mf.getDircode())) {
            return null;
@@ -133,9 +117,6 @@
        return StringHelper.getRightLike(mf.getDircode().substring(0, 2));
    }
    /**
     * 获取Excel元数据文件
     */
    private List<MetaFileEntity> getExcelFiles(List<MetaFileEntity> list) {
        List<MetaFileEntity> xlsList = new ArrayList<>();
        for (MetaFileEntity mf : list) {
@@ -157,16 +138,10 @@
        return xlsList;
    }
    /**
     * 是/否为Excel
     */
    private boolean isExcel(MetaFileEntity mf) {
        return StaticData.XLS.equals(mf.getExtName()) || StaticData.XLSX.equals(mf.getExtName());
    }
    /**
     * 获取Xls目录
     */
    private String getXlsPath(String filePath) {
        String tempPath = pathHelper.getConfig().getTempPath() + File.separator;
        String subPath = filePath.substring(tempPath.length());
@@ -180,9 +155,6 @@
        return subPath;
    }
    /**
     * 复制Xls文件
     */
    private String copyXlsFile(String xlsBasePath, int i, MetaFileEntity mf) {
        try {
            String xlsPath = xlsBasePath + File.separator + i;
@@ -203,9 +175,6 @@
        }
    }
    /**
     * 加载数据
     */
    private void loadData(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
            if (null != mf.getMsg() || StringHelper.isEmpty(mf.getEntity())) {
@@ -217,9 +186,6 @@
        }
    }
    /**
     * 加载空间数据
     */
    public void loadSpatialData(MetaFileEntity mf) {
        BasicMapper basicMapper = ClassHelper.getBasicMapper(mf.getEntity());
        if (null == basicMapper) {
@@ -265,9 +231,6 @@
        }
    }
    /**
     * 批量插入
     */
    private <T> int batchInserts(BasicMapper basicMapper, List<T> list) {
        int rows = 0;
        //int count = (int) Math.ceil(list.size() / StaticData.D100)
@@ -283,9 +246,6 @@
        return rows;
    }
    /**
     * 设置创建信息
     */
    private <T> void setCreateInfo(List<T> list, MetaFileEntity mf) {
        try {
            if (!(list.get(0) instanceof BaseEntity)) {
@@ -307,9 +267,6 @@
        }
    }
    /**
     * 复制文件
     */
    private void copyFiles(List<MetaFileEntity> list) {
        List<String> gdbList = new ArrayList<>();
        for (MetaFileEntity mf : list) {
@@ -361,9 +318,6 @@
        }
    }
    /**
     * 复制单个文件
     */
    private int copySingleFile(MetaFileEntity mf) {
        File file = new File(mf.getPath());
        if (!file.exists()) {
@@ -396,9 +350,6 @@
        return 1;
    }
    /**
     * 设置旧元数据信息
     */
    private void setOldMeta(MetaFileEntity mf, MetaEntity old) {
        mf.setPath(old.getPath());
        mf.setTab(old.getTab());
@@ -406,9 +357,6 @@
        mf.setEntity(old.getEventid());
    }
    /**
     * 复制多个文件
     */
    private void copyMultiFile(MetaFileEntity mf, List<String> extList) {
        String path = mf.getPath();
        int status = copySingleFile(mf);
@@ -441,9 +389,6 @@
        }
    }
    /**
     * 复制文件夹文件
     */
    private void copyFolderFile(MetaFileEntity mf) {
        File file = new File(mf.getPath());
        if (!file.exists()) {
@@ -479,9 +424,6 @@
        mf.setPath(subPath);
    }
    /**
     * 根据GUID查找路径
     */
    private String findPathByGuid(List<MetaFileEntity> list, MetaFileEntity mf) {
        for (MetaFileEntity meta : list) {
            if (meta.getGuid().equals(mf.getGuid()) && !meta.getPath().equals(mf.getPath())) {
@@ -492,17 +434,11 @@
        return null;
    }
    /**
     * 创建文件链接
     */
    private void createFileLink(String source, String target) {
        String cmd = String.format("cmd /c mklink \"%s\" \"%s\"", target, source);
        WebHelper.exec(cmd);
    }
    /**
     * 插入元数据
     */
    private void insertMetas(List<MetaFileEntity> list) {
        int metaId = insertParentMeta(list);
@@ -527,9 +463,6 @@
        }
    }
    /**
     * 创建元数据
     */
    private MetaEntity createMeta(MetaFileEntity mf, int metaId) {
        MetaEntity me = new MetaEntity();
        me.setMetaid(metaId);
@@ -568,9 +501,6 @@
        return me;
    }
    /**
     * 插入父元数据
     */
    private int insertParentMeta(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
            if (null != mf.getMsg() || !mf.getIsMeta()) {
@@ -588,9 +518,6 @@
        return 0;
    }
    /**
     * Excel入库
     */
    private String excelLoader(List<MetaFileEntity> xlsList, HttpServletRequest req) {
        try {
            MetaFileEntity xlsMeta = getExcelMeta(xlsList);
@@ -604,9 +531,6 @@
        return null;
    }
    /**
     * 获取Excel的元数据
     */
    private MetaFileEntity getExcelMeta(List<MetaFileEntity> xlsList) {
        if (null == xlsList || xlsList.isEmpty()) {
            return null;
src/main/java/com/moon/server/service/show/ApplyService.java
@@ -21,11 +21,8 @@
import java.util.Arrays;
import java.util.List;
/**
 * 数据申请
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ApplyService implements ApplyMapper {
    @Autowired
    ApplyMapper applyMapper;
@@ -133,9 +130,6 @@
        return applyMapper.updateForReject(userid, applyid, flowId);
    }
    /**
     * 插入数据申请
     */
    public Integer insertApply(UserEntity ue, DownloadReqEntity dr) throws Exception {
        ApplyEntity apply = getApplyEntity(ue, dr);
        int rows = applyMapper.insert(apply);
@@ -152,9 +146,6 @@
        return flowService.inserts(list);
    }
    /**
     * 获取数据申请实体类
     */
    private ApplyEntity getApplyEntity(UserEntity ue, DownloadReqEntity dr) throws Exception {
        // String dbPwd = Md5Helper.reverse(Md5Helper.generate(dr.getPwd()))
        String aesPwd = AesHelper.encrypt(dr.getPwd());
@@ -179,9 +170,6 @@
        return apply;
    }
    /**
     * 获取表名
     */
    private String getTabs(DownloadReqEntity dr) {
        if (!StaticData.SYS_META.equals(dr.getEntities().get(0))) {
            return StringHelper.join(dr.getTabs(), ",");
@@ -206,9 +194,6 @@
        return sb.toString();
    }
    /**
     * 获取申请流程实体类集合
     */
    private List<FlowEntity> getFlowEntities(Integer applyId, UserEntity ue, DownloadReqEntity dr) {
        List<FlowEntity> list = new ArrayList<>();
        for (String depcode : dr.getDepcodes()) {
@@ -231,9 +216,6 @@
        return list;
    }
    /**
     * 打包DB数据
     */
    public void zipDbData(UserEntity ue, ApplyEntity entity) {
        try {
            List<String> entities = Arrays.asList(entity.getEntities().split(StaticData.COMMA));
@@ -258,9 +240,6 @@
        }
    }
    /**
     * 获取ID集合
     */
    private List<Integer> getIds(String gids) {
        if (StringHelper.isEmpty(gids)) {
            return null;
src/main/java/com/moon/server/service/show/DataLibService.java
@@ -21,11 +21,8 @@
import java.io.File;
import java.util.*;
/**
 * 资料馆
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DataLibService {
    @Autowired
    PathHelper pathHelper;
@@ -41,9 +38,6 @@
    private final static Log log = LogFactory.getLog(DataLibService.class);
    /**
     * 查询DB中溢出的单位编码
     */
    public List<String> selectDbOverflowDep(UserEntity ue, DownloadReqEntity dr) {
        if (!StringHelper.isEmpty(dr.getWkt())) {
            return selectDbOverflowDep4Wkt(ue, dr);
@@ -52,9 +46,6 @@
        return selectDbOverflowDep4Prop(ue, dr);
    }
    /**
     * 查询DB中溢出的单位编码-空间查询
     */
    public List<String> selectDbOverflowDep4Wkt(UserEntity ue, DownloadReqEntity dr) {
        List<String> rs = new ArrayList<>();
        for (String entity : dr.getEntities()) {
@@ -74,9 +65,6 @@
        return rs;
    }
    /**
     * 查询DB中溢出的单位编码-属性查询
     */
    public List<String> selectDbOverflowDep4Prop(UserEntity ue, DownloadReqEntity dr) {
        List<String> rs = new ArrayList<>();
        BasicMapper<?> baseMapper = ClassHelper.getBasicMapper(dr.getEntities().get(0));
@@ -91,9 +79,6 @@
        return rs;
    }
    /**
     * 查询DB中溢出单位编码的查询包装器
     */
    private <T> QueryWrapper<T> getWrapper4DbOverflow(UserEntity ue, DownloadReqEntity dr) {
        QueryWrapper<T> wrapper = new QueryWrapper<T>();
        wrapper.select("depid");
@@ -117,9 +102,6 @@
        return wrapper;
    }
    /**
     * 添加单位编码
     */
    private void addDepCodes(List<String> rs, List<String> ids) {
        if (null == ids || ids.isEmpty()) {
            return;
@@ -135,9 +117,6 @@
        }
    }
    /**
     * 请求DB数据下载
     */
    public String downloadDbReq(UserEntity ue, DownloadReqEntity dr) throws Exception {
        Map<String, List<?>> dataMap = new HashMap<>(2);
        Map<String, List<AttachEntity>> annexMap = new HashMap<>(2);
@@ -170,9 +149,6 @@
        return rows > 0 ? de.getGuid() : null;
    }
    /**
     * 查询数据+附件
     */
    private void queryData(DownloadReqEntity dr, Map<String, List<?>> dataMap, Map<String, List<AttachEntity>> annexMap) {
        for (String entity : dr.getEntities()) {
            try {
@@ -189,9 +165,6 @@
        }
    }
    /**
     * 创建查询包装器
     */
    private <T> QueryWrapper<T> createQueryWrapper(BasicMapper baseMapper, DownloadReqEntity dr) {
        QueryWrapper<T> wrapper = new QueryWrapper<T>();
@@ -219,9 +192,6 @@
        return wrapper;
    }
    /**
     * 创建附件 *
     */
    private void createAnnex(String annexPath, Map<String, List<AttachEntity>> annexMap) {
        if (annexMap.size() == 0) {
            return;
@@ -255,9 +225,6 @@
        }
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
@@ -276,9 +243,6 @@
        return de;
    }
    /**
     * 处理编码
     */
    public static String copeCodes(String codes, String field) {
        if (StringHelper.isEmpty(codes) || StringHelper.isSqlInjection(codes)) {
            return null;
@@ -291,9 +255,6 @@
        return "(" + StringHelper.join(list, " or ") + ")";
    }
    /**
     * 单位编码转集合
     */
    private static List<String> codesAsList(String codes) {
        List<String> list = Arrays.asList(codes.split(","));
        Set set = new HashSet(list);
@@ -304,9 +265,6 @@
        return newList;
    }
    /**
     * 处理目录编码
     */
    private static List<String> copeDirCodes(List<String> list) {
        List<String> prjList = getDirCodesByLen(list, 0, 2);
        List<String> appList = getDirCodesByLen(list, 3, 30);
@@ -323,9 +281,6 @@
        return filterCodes(prjList, appList);
    }
    /**
     * 根据长度获取单位编码
     */
    private static List<String> getDirCodesByLen(List<String> list, int start, int end) {
        List<String> rs = new ArrayList<>();
        for (String code : list) {
@@ -341,9 +296,6 @@
        return rs;
    }
    /**
     * 过滤项目编码
     */
    private static List<String> filterCodes(List<String> prjList, List<String> appList) {
        int i = 0;
        while (i < appList.size()) {
@@ -365,9 +317,6 @@
        return appList;
    }
    /**
     * 设置 右like
     */
    private static void setRightLike(List<String> list, String field) {
        if (list.isEmpty()) {
            list.add("1 = 2");
src/main/java/com/moon/server/service/show/ExportService.java
@@ -20,11 +20,8 @@
import java.util.HashMap;
import java.util.Map;
/**
 * 在线制图
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ExportService {
    @Value("${sys.exportServer}")
    private String exportServer;
@@ -35,14 +32,6 @@
    @Autowired
    DownloadService downloadService;
    /**
     * POST请求出图服务
     *
     * @param ue     用户类
     * @param entity 在线制图类
     * @return 成功
     * @throws Exception
     */
    public String post(UserEntity ue, ExportEntity entity) throws Exception {
        Map<String, Object> map = getMapData(entity);
        String url = exportServer + "/Export/Start";
@@ -69,9 +58,6 @@
        return rows > 0 ? de.getGuid() : null;
    }
    /**
     * 获取Map数据
     */
    private Map<String, Object> getMapData(ExportEntity entity) {
        Map<String, Object> map = new HashMap<String, Object>(3);
@@ -94,9 +80,6 @@
        return map;
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, ExportEntity entity, String file) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
src/main/java/com/moon/server/service/show/FlowService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 申请流程
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class FlowService implements FlowMapper {
    @Autowired
    FlowMapper flowMapper;
src/main/java/com/moon/server/service/show/InquiryService.java
@@ -23,11 +23,8 @@
import java.util.Date;
import java.util.List;
/**
 * 查询服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class InquiryService {
    @Resource
    PathHelper pathHelper;
@@ -40,9 +37,6 @@
    private final static Log log = LogFactory.getLog(InquiryService.class);
    /**
     * 读取Shp第一条记录的WKT
     */
    public ShpRecordEntity readShpFirstRecord(List<MetaFileEntity> list) {
        String fileName = null;
        for (MetaFileEntity mf : list) {
@@ -61,9 +55,6 @@
        return sr;
    }
    /**
     * 打包瓦片
     */
    public String zipTiles(DownloadTileEntity dt, PublishEntity pub, UserEntity ue) {
        if (!isTilePathExist(pub)) {
            return null;
@@ -91,9 +82,6 @@
        return rows > 0 ? de.getGuid() : null;
    }
    /**
     * 瓦片路径是否存在
     */
    private boolean isTilePathExist(PublishEntity pub) {
        String tilePath = pathHelper.getConfig().getTilePath() + pub.getPath();
@@ -107,9 +95,6 @@
        return true;
    }
    /**
     * 查找瓦片
     */
    private List<File> findTiles(DownloadTileEntity dt, PublishEntity pub) {
        List<File> list = new ArrayList<>();
@@ -128,9 +113,6 @@
        return list;
    }
    /**
     * 根据层次查找瓦片
     */
    private List<File> findTilesByZoom(DownloadTileEntity dt, PublishEntity pub, int zoom) {
        List<File> list = new ArrayList<>();
        File f = new File(pub.getPath() + File.separator + zoom);
@@ -155,9 +137,6 @@
        return list;
    }
    /**
     * 角度转数值
     */
    private int[] deg2num(int zoom, double x, double y) {
        double yRad = Math.toRadians(y);
        double n = Math.pow(2.0, zoom);
@@ -168,9 +147,6 @@
        return new int[]{xTile, yTile};
    }
    /**
     * 添加文件至压缩包
     */
    private void addFiles(ZipFile zip, ZipParameters params, List<File> list, String basePath) {
        for (File f : list) {
            try {
@@ -182,9 +158,6 @@
        }
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
@@ -203,9 +176,6 @@
        return de;
    }
    /**
     * 插入数据发布-下载表
     */
    private void insertPubDown(PublishEntity pub, DownloadEntity de, UserEntity ue) {
        publishService.insertPubDown(pub.getId(), de.getId(), ue.getId());
    }
src/main/java/com/moon/server/service/show/MarkService.java
@@ -17,11 +17,8 @@
import java.util.Date;
import java.util.List;
/**
 * 标绘
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class MarkService implements MarkMapper {
    @Resource
    MarkMapper markMapper;
@@ -86,14 +83,6 @@
        return markMapper.updates(list);
    }
    /**
     * 下载ShapeFile文件
     *
     * @param ue   用户实体
     * @param list 标绘JSON实体类集合
     * @return GUID
     * @throws Exception 异常
     */
    public String downloadShp(UserEntity ue, List<MarkJsonEntity> list) throws Exception {
        String path = pathHelper.getTempPath();
        createShapeFiles(ue, list, path);
@@ -119,9 +108,6 @@
        return rows > 0 ? de.getGuid() : null;
    }
    /**
     * 创建shp文件
     */
    private String createShapeFiles(UserEntity ue, List<MarkJsonEntity> list, String path) {
        List<MarkJsonEntity> points = getMarkByType(list, "POINT");
        if (points.size() > 0) {
@@ -139,9 +125,6 @@
        return path;
    }
    /**
     * 获取shp目录
     */
    private String getShpDir(UserEntity ue, String parent) {
        String path = parent + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date());
@@ -153,9 +136,6 @@
        return path;
    }
    /**
     * 获取标绘类型
     */
    private List<MarkJsonEntity> getMarkByType(List<MarkJsonEntity> list, String type) {
        List<MarkJsonEntity> rs = new ArrayList<>();
        for (MarkJsonEntity mark : list) {
@@ -170,9 +150,6 @@
        return rs;
    }
    /**
     * 获取zip路径
     */
    private String getZipPath() {
        String path = pathHelper.getDownloadFullPath() + File.separator + StringHelper.YMDHMS2_FORMAT.format(new Date()) + ".zip";
@@ -184,9 +161,6 @@
        return path;
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
@@ -205,16 +179,10 @@
        return de;
    }
    /**
     * 获取下载文件路径
     */
    public String getDownloadFilePath(DownloadEntity de) {
        return pathHelper.getConfig().getDownloadPath() + File.separator + de.getUrl();
    }
    /**
     * 读取ShapeFile文件获取Mark实体类
     */
    public List<MarkJsonEntity> readShpForMarks(List<MetaFileEntity> list) {
        String fileName = null;
        for (MetaFileEntity mf : list) {
src/main/java/com/moon/server/service/show/ModelService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 模型
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ModelService implements ModelMapper {
    @Autowired
    ModelMapper modelMapper;
src/main/java/com/moon/server/service/show/PipelineService.java
@@ -23,11 +23,8 @@
import java.util.List;
import java.util.Map;
/**
 * 管道分析服务类
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class PipelineService implements PipelineMapper {
    @Autowired
    PathHelper pathHelper;
@@ -57,14 +54,6 @@
        return pipelineMapper.selectPipeAnalysis(tab, gid);
    }
    /**
     * 创建Zip包
     *
     * @param ue  用户实体
     * @param map 管道分析数据集合
     * @param pwd 密码
     * @return 下载文件GUID
     */
    public String createZipFile(UserEntity ue, Map<String, List<PipelineEntity>> map, String pwd) throws Exception {
        String tempName = StringHelper.YMDHMS2_FORMAT.format(new Date());
        String tempPath = pathHelper.getTempPath(tempName);
@@ -90,9 +79,6 @@
        return rows > 0 ? downloadEntity.getGuid() : null;
    }
    /**
     * 创建GDB
     */
    public static void createGdb(String filePath, Map<String, List<PipelineEntity>> map) throws Exception {
        Driver driver = null;
        DataSource dataSource = null;
@@ -136,9 +122,6 @@
        }
    }
    /**
     * 创建图层
     */
    private static Layer createLayer(DataSource dataSource, String tab, PipelineEntity pe) {
        int geomType = pe.getWkt().contains("POINT") ? ogr.wkbMultiPoint : ogr.wkbMultiLineString;
@@ -148,9 +131,6 @@
        return dataSource.CreateLayer(tab, sr, geomType, null);
    }
    /**
     * 获取字段
     */
    private static void getFields(Class clazz, List<Field> list) {
        try {
            Field[] fields = clazz.getDeclaredFields();
@@ -171,9 +151,6 @@
        }
    }
    /**
     * 设置图层数据
     */
    private static void setLayerData(Layer layer, List<Field> fields, List<PipelineEntity> list) throws Exception {
        for (PipelineEntity t : list) {
            Feature f = new Feature(layer.GetLayerDefn());
@@ -191,9 +168,6 @@
        }
    }
    /**
     * 添加Zip文件
     */
    private void addZipFiles(ZipFile zip, ZipParameters params, File[] files) {
        if (null == files || files.length == 0) {
            return;
@@ -208,9 +182,6 @@
        }
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file, String pwd) throws Exception {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
src/main/java/com/moon/server/service/sys/ArgsService.java
@@ -10,11 +10,8 @@
import java.lang.reflect.Field;
import java.util.List;
/**
 * 参数设置
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ArgsService implements ArgsMapper {
    @Autowired
    ArgsMapper argsMapper;
@@ -78,9 +75,6 @@
        return argsMapper.updates(list);
    }
    /**
     * 初始化设置值
     */
    public void initSettingData() throws Exception {
        List<ArgsEntity> list = selectAll();
        if (list == null || list.isEmpty()) {
@@ -92,9 +86,6 @@
        }
    }
    /**
     * 更新设置值
     */
    public void updateSettingData(ArgsEntity entity) throws Exception {
        Field field = SettingData.class.getField(entity.getMark());
        // field.setAccessible(true)
src/main/java/com/moon/server/service/sys/AttachService.java
@@ -15,11 +15,8 @@
import java.lang.reflect.Field;
import java.util.List;
/**
 * 附件
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class AttachService implements AttachMapper {
    @Autowired
    AttachMapper attachMapper;
@@ -110,9 +107,6 @@
        return attachMapper.selectFmeLogs(tabs);
    }
    /**
     * 查询FME日志
     */
    public List<FmeLogEntity> selectFmeLogs() {
        if (StringHelper.isEmpty(tabs)) {
            tabs = UploadAttachService.getTabs().replace("'", "");
@@ -131,9 +125,6 @@
        return attachMapper.insertAttachByMeta(tab, tabGuid, metaName, dirid);
    }
    /**
     * 同步附件
     */
    public void syncAttaches(FmeLogEntity entity) {
        String tab = entity.getPgNs() + "." + entity.getTcdm();
        String fieldName = UploadAttachService.ATTACH_TABS.get(tab);
@@ -165,9 +156,6 @@
        }
    }
    /**
     * 获取目录编码
     */
    private String getDirid(BaseEntity be) {
        if (StringHelper.isEmpty(be.getDirid())) {
            return null;
@@ -178,9 +166,6 @@
        return StringHelper.getRightLike(dirid);
    }
    /**
     * 根据父ID查询记录
     */
    private List<?> selectRowsByParentid(String entity, String parentid, String field) {
        BasicMapper baseMapper = ClassHelper.getBasicMapper(entity);
        if (null == baseMapper) {
src/main/java/com/moon/server/service/sys/BlacklistService.java
@@ -12,11 +12,8 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
 * 黑名单
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class BlacklistService implements BlacklistMapper {
    @Autowired
    BlacklistMapper blacklistMapper;
@@ -70,9 +67,6 @@
        return list;
    }
    /**
     * 清空缓存
     */
    public void clearCache() {
        redisService.clearKeys(RedisCacheKey.blacklistKey(""));
    }
src/main/java/com/moon/server/service/sys/DownlogService.java
@@ -14,11 +14,8 @@
import java.sql.Timestamp;
import java.util.List;
/**
 * 下载日志
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class DownlogService implements DownlogMapper {
    @Autowired
    DownlogMapper downlogMapper;
@@ -80,9 +77,6 @@
        return downlogMapper.updates(list);
    }
    /**
     * 更新下载信息
     */
    public void updateInfos(UserEntity ue, DownloadEntity de, HttpServletRequest req) {
        de.setDcount(de.getDcount() + 1);
        de.setDownloadUser(ue.getId());
src/main/java/com/moon/server/service/sys/MenuAuthService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 菜单-权限
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class MenuAuthService implements MenuAuthMapper {
    @Autowired
    MenuAuthMapper menuAuthMapper;
src/main/java/com/moon/server/service/sys/MetaDownService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 元数据-下载
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class MetaDownService implements MetaDownMapper {
    @Autowired
    MetaDownMapper metaDownMapper;
src/main/java/com/moon/server/service/sys/ProxyService.java
@@ -23,12 +23,8 @@
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;
/**
 * 代理服务类
 * @author WWW
 * @date 2023-07-11
 */
@Service
@SuppressWarnings("ALL")
public class ProxyService {
    @Resource
    RedisService redisService;
@@ -44,16 +40,12 @@
    public static final String ILLEGAL_RESOURCE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.UNAUTHORIZED, "没有资源访问权限"));
    /**
     * URL代理
     */
    public void proxyUrl(String token, int resId, boolean isRest, HttpServletRequest req, HttpServletResponse res) throws Exception {
        // 3.获取用户
        UserEntity ue = getUser(req, res, token);
        if (null == ue) {
            return;
        }
        // 9.获取资源实体,status:0-禁用,1-启用原始地址,2-启用代理地址
        ResEntity entity = getResEntity(ue, resId);
        if (null == entity || StaticData.I1 > entity.getStatus() || StringHelper.isNull(entity.getProxy()) || StringHelper.isNull(entity.getUrl())) {
            WebHelper.writeStr2Page(res, ILLEGAL_RESOURCE);
@@ -66,9 +58,6 @@
        forward(req, res, entity, url);
    }
    /**
     * 获取用户
     */
    private UserEntity getUser(HttpServletRequest req, HttpServletResponse res, String token) {
        String key = RedisCacheKey.permsProxy(token);
        Object obj = redisService.get(key);
@@ -90,30 +79,22 @@
        return ue;
    }
    /**
     * 检查
     */
    private boolean check(HttpServletRequest req, HttpServletResponse res, UserEntity ue, String token) {
        // 4.获取IP
        String ip = WebHelper.getIpAddress(req);
        if (StringHelper.isEmpty(ip)) {
            return WebHelper.writeStr2Page(res, AuthInterceptor.IP_NULL);
        }
        // 5.检查黑名单
        if (!checkBlackList(ip, req)) {
            return WebHelper.writeStr2Page(res, AuthInterceptor.BLACK_LIST);
        }
        // 6.admin跳过权限检测
        if (StaticData.ADMIN.equals(ue.getUid())) {
            return true;
        }
        // 7.检查白名单和IP一致性
        if (!checkWhiteList(ip, req)) {
            if (!checkIpSource(ip, token)) {
                return WebHelper.writeStr2Page(res, AuthInterceptor.ILLEGAL_TOKEN);
            }
        }
        // 8.检查用户ID是否禁用
        if (sysService.tokenService.isUidDisable(ue)) {
            return WebHelper.writeStr2Page(res, AuthInterceptor.USER_LOCK);
        }
@@ -121,9 +102,6 @@
        return true;
    }
    /**
     * 检查黑名单
     */
    private boolean checkBlackList(String ip, HttpServletRequest request) {
        List<String> blackList = sysService.blacklistService.selectIpList(1);
        if (blackList == null || blackList.isEmpty()) {
@@ -133,9 +111,6 @@
        return !blackList.contains(ip);
    }
    /**
     * 检查白名单
     */
    private boolean checkWhiteList(String ip, HttpServletRequest request) {
        List<String> whiteList = sysService.blacklistService.selectIpList(2);
        if (whiteList == null || whiteList.isEmpty()) {
@@ -145,18 +120,12 @@
        return whiteList.contains(ip);
    }
    /**
     * 检查IP一致性:固定令牌不检查
     */
    private boolean checkIpSource(String ip, String token) {
        TokenEntity te = sysService.tokenService.getEntityByToken(token);
        return StaticData.I1 == te.getType() || te.getIp().equals(ip);
    }
    /**
     * 检查资源权限
     */
    private ResEntity getResEntity(UserEntity ue, int resId) {
        List<ResEntity> rs = StaticData.ADMIN.equals(ue.getUid()) ? permsService.selectAllRes() : permsService.selectRes(ue.getUid());
        if (null == rs || rs.isEmpty()) {
@@ -172,9 +141,6 @@
        return null;
    }
    /**
     * 插入日志
     */
    private void insertLog(HttpServletRequest req, UserEntity ue, int resId) {
        String ip = WebHelper.getIpAddress(req);
@@ -194,11 +160,7 @@
        });
    }
    /**
     * 获取请求类别
     */
    private int getRequestType(String method) {
        // 请求类:1-GET,2-POST,3-PUT,4-DELETE,5-TRACE,6-HEAD,7-OPTIONS,8-CONNECT';
        switch (method) {
            case "GET":
                return 1;
@@ -221,9 +183,6 @@
        }
    }
    /**
     * 获取Url
     */
    private String getUrl(HttpServletRequest req, UserEntity ue, ResEntity entity, String token, boolean isRest) {
        String proxyUrl = entity.getProxy().replace("{token}", token);
        int end = req.getRequestURL().indexOf(proxyUrl) + proxyUrl.length();
@@ -247,9 +206,6 @@
        return url;
    }
    /**
     * 获取GeoServer地址
     */
    private String getGeoServerUrl(HttpServletRequest req, UserEntity ue, ResEntity entity, String url) {
        if (null == req.getQueryString()) {
            return url;
@@ -275,9 +231,6 @@
        return url + (url.contains("?") ? "&" : "?") + str;
    }
    /**
     * 过滤GeoServer图层
     */
    private String filterGeoLayers(UserEntity ue, String layers) {
        List<String> tabs = StaticData.ADMIN.equals(ue.getUid()) ? permsService.selectAllTabs() : permsService.selectTabs(ue.getUid());
        if (null == tabs || tabs.isEmpty() || StringHelper.isEmpty(layers)) {
@@ -296,9 +249,6 @@
        return sb.toString();
    }
    /**
     * 转发请求
     */
    private void forward(HttpServletRequest request, HttpServletResponse response, ResEntity entity, String url) throws Exception {
        HttpHelper httpHelper = new HttpHelper();
        httpHelper.service(request, response, entity, url);
src/main/java/com/moon/server/service/sys/ReportService.java
@@ -16,11 +16,8 @@
import java.io.File;
import java.util.*;
/**
 * 报告模板
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ReportService implements ReportMapper {
    @Autowired
    ReportMapper reportMapper;
@@ -113,9 +110,6 @@
        return reportMapper.countSizesByPrj();
    }
    /**
     * 创建报告
     */
    public void createReport(UserEntity ue, ReportEntity re, HttpServletResponse res) throws Exception {
        AttachEntity ae = attachService.selectByGuid(re.getGuid());
        if (null == ae) {
@@ -144,9 +138,6 @@
        }
    }
    /**
     * 生成报告
     */
    private void generateReport(String source, String target, ReportEntity re) {
        if (StaticData.S1.equals(re.getType())) {
            switch (re.getCode()) {
@@ -179,9 +170,6 @@
        }
    }
    /**
     * 创建 用户流量统计 Word
     */
    public void createCountOperatesWord(String source, String target) {
        List<CountEntity> list = countOperates();
        if (null == list || list.isEmpty()) {
@@ -198,9 +186,6 @@
        WordHelper.generateWord(source, target, null, addList);
    }
    /**
     * 创建 服务调用量统计 Word
     */
    public void createCountServicesWord(String source, String target) {
        List<CountEntity> list = countServices();
        if (null == list || list.isEmpty()) {
@@ -217,9 +202,6 @@
        WordHelper.generateWord(source, target, null, addList);
    }
    /**
     * 创建 数据量统计 Word
     */
    public void createCountSizesWord(String source, String target) {
        List<CountEntity> list = countSizes();
        if (null == list || list.isEmpty()) {
@@ -236,9 +218,6 @@
        WordHelper.generateWord(source, target, null, addList);
    }
    /**
     * 创建 用户流量统计 Excel
     */
    public void createCountOperatesExcel(String source, String target) {
        List<CountEntity> list = countOperates();
        if (null == list || list.isEmpty()) {
@@ -256,9 +235,6 @@
        ExcelHelper.writeToTemplate(source, target, map);
    }
    /**
     * 创建 服务调用量统计 Excel
     */
    public void createCountServicesExcel(String source, String target) {
        List<CountEntity> list = countServices();
        if (null == list || list.isEmpty()) {
@@ -276,9 +252,6 @@
        ExcelHelper.writeToTemplate(source, target, map);
    }
    /**
     * 创建 数据量统计 Excel
     */
    public void createCountSizesExcel(String source, String target) {
        List<CountEntity> list = countSizes();
        if (null == list || list.isEmpty()) {
@@ -297,9 +270,6 @@
        ExcelHelper.writeToTemplate(source, target, map);
    }
    /**
     * 获取下载实体类
     */
    private DownloadEntity getDownloadEntity(UserEntity ue, String file) {
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
src/main/java/com/moon/server/service/sys/ResLogService.java
@@ -8,11 +8,8 @@
import java.util.List;
/**
 * 资源日志
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ResLogService implements ResLogMapper {
    @Autowired
    ResLogMapper resLogMapper;
src/main/java/com/moon/server/service/sys/ResService.java
@@ -8,11 +8,8 @@
import java.util.List;
/**
 * 资源
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class ResService implements ResMapper {
    @Autowired
    ResMapper resMapper;
src/main/java/com/moon/server/service/sys/RoleLayerService.java
@@ -8,11 +8,8 @@
import java.util.List;
/**
 * 角色-图层
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class RoleLayerService implements RoleLayerMapper {
    @Autowired
    RoleLayerMapper roleLayerMapper;
src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 角色-菜单
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class RoleMenuAuthService implements RoleMenuAuthMapper {
    @Autowired
    RoleMenuAuthMapper roleMenuAuthMapper;
src/main/java/com/moon/server/service/sys/RoleResService.java
@@ -7,11 +7,8 @@
import javax.annotation.Resource;
import java.util.List;
/**
 * 角色-资源
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class RoleResService implements RoleResMapper {
    @Resource
    RoleResMapper roleResMapper;
src/main/java/com/moon/server/service/sys/RoleUserService.java
@@ -7,11 +7,8 @@
import java.util.List;
/**
 * 角色-用户
 * @author WWW
 */
@Service
@SuppressWarnings("ALL")
public class RoleUserService implements RoleUserMapper {
    @Autowired
    RoleUserMapper roleUserMapper;