From 796b44ea813a1133beae4f3a67f1c0263510c0c7 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期日, 17 十一月 2024 09:45:07 +0800 Subject: [PATCH] 1 --- src/main/java/com/moon/server/service/data/PublishService.java | 14 src/main/java/com/moon/server/service/sys/ArgsService.java | 11 src/main/java/com/moon/server/service/data/ReadRasterService.java | 45 - src/main/java/com/moon/server/service/show/ExportService.java | 19 src/main/java/com/moon/server/service/all/BaseUploadService.java | 83 -- src/main/java/com/moon/server/service/sys/ProxyService.java | 54 - src/main/java/com/moon/server/service/all/CommonsFileuploadService.java | 21 src/main/java/com/moon/server/service/show/MarkService.java | 34 - src/main/java/com/moon/server/service/all/PermsService.java | 17 src/main/java/com/moon/server/service/sys/MetaDownService.java | 5 src/main/java/com/moon/server/service/data/DataQueryService.java | 13 src/main/java/com/moon/server/service/sys/ResLogService.java | 5 src/main/java/com/moon/server/service/data/FmeService.java | 74 -- src/main/java/com/moon/server/service/sys/BlacklistService.java | 8 src/main/java/com/moon/server/service/all/RedisService.java | 50 - src/main/java/com/moon/server/service/data/UploadService.java | 78 -- src/main/java/com/moon/server/service/show/FlowService.java | 5 src/main/java/com/moon/server/mapper/sys/ResMapper.java | 94 --- src/main/java/com/moon/server/service/data/DownloadService.java | 29 src/main/java/com/moon/server/service/all/WebSocketService.java | 33 - src/main/java/com/moon/server/service/sys/RoleLayerService.java | 5 src/main/java/com/moon/server/service/show/ModelService.java | 5 src/main/java/com/moon/server/mapper/sys/ReportMapper.java | 93 --- src/main/java/com/moon/server/mapper/sys/ResLogMapper.java | 66 -- src/main/java/com/moon/server/service/all/SysService.java | 5 src/main/java/com/moon/server/service/sys/AttachService.java | 17 src/main/java/com/moon/server/helper/WordHelper.java | 55 - src/main/java/com/moon/server/service/show/InquiryService.java | 32 - src/main/java/com/moon/server/service/data/DomainService.java | 5 src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java | 5 src/main/java/com/moon/server/service/all/BaseQueryService.java | 73 -- src/main/java/com/moon/server/service/sys/DownlogService.java | 8 src/main/java/com/moon/server/service/sys/MenuAuthService.java | 5 src/main/java/com/moon/server/service/all/ScheduleService.java | 42 - src/main/java/com/moon/server/service/data/SlopeAnalysisService.java | 18 src/main/java/com/moon/server/mapper/sys/LayerMapper.java | 97 --- src/main/java/com/moon/server/service/show/ApplyService.java | 23 src/main/java/com/moon/server/service/sys/ReportService.java | 32 - src/main/java/com/moon/server/service/sys/ResService.java | 5 src/main/java/com/moon/server/service/sys/RoleResService.java | 5 src/main/java/com/moon/server/service/data/ColortabService.java | 5 src/main/java/com/moon/server/service/data/MetaService.java | 73 -- src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java | 72 -- src/main/java/com/moon/server/helper/HttpHelper.java | 5 src/main/java/com/moon/server/service/all/UploadAttachService.java | 76 -- src/main/java/com/moon/server/service/sys/RoleUserService.java | 5 src/main/java/com/moon/server/service/all/SignService.java | 8 src/main/java/com/moon/server/service/data/DictService.java | 5 src/main/java/com/moon/server/mapper/sys/RoleResMapper.java | 72 -- src/main/java/com/moon/server/service/show/DataLibService.java | 53 - src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java | 66 -- src/main/java/com/moon/server/service/all/TestService.java | 4 src/main/java/com/moon/server/service/show/PipelineService.java | 31 - 53 files changed, 55 insertions(+), 1,708 deletions(-) diff --git a/src/main/java/com/moon/server/helper/HttpHelper.java b/src/main/java/com/moon/server/helper/HttpHelper.java index 1c02ea0..b31e8d7 100644 --- a/src/main/java/com/moon/server/helper/HttpHelper.java +++ b/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 = "://"; diff --git a/src/main/java/com/moon/server/helper/WordHelper.java b/src/main/java/com/moon/server/helper/WordHelper.java index fc1d69a..03c7469 100644 --- a/src/main/java/com/moon/server/helper/WordHelper.java +++ b/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瑙f瀽瀵硅薄 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()) { - // 鍒ゆ柇甯︽湁 ${} 鐨剅un 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) { diff --git a/src/main/java/com/moon/server/mapper/sys/LayerMapper.java b/src/main/java/com/moon/server/mapper/sys/LayerMapper.java index 54b0544..5fd37d0 100644 --- a/src/main/java/com/moon/server/mapper/sys/LayerMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/mapper/sys/ReportMapper.java b/src/main/java/com/moon/server/mapper/sys/ReportMapper.java index fe77531..3e03ad6 100644 --- a/src/main/java/com/moon/server/mapper/sys/ReportMapper.java +++ b/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(); } diff --git a/src/main/java/com/moon/server/mapper/sys/ResLogMapper.java b/src/main/java/com/moon/server/mapper/sys/ResLogMapper.java index aa841ed..205eae4 100644 --- a/src/main/java/com/moon/server/mapper/sys/ResLogMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/mapper/sys/ResMapper.java b/src/main/java/com/moon/server/mapper/sys/ResMapper.java index 185a070..17c4d4a 100644 --- a/src/main/java/com/moon/server/mapper/sys/ResMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java b/src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java index 808dca9..6b7973d 100644 --- a/src/main/java/com/moon/server/mapper/sys/RoleLayerMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/mapper/sys/RoleResMapper.java b/src/main/java/com/moon/server/mapper/sys/RoleResMapper.java index b442ffd..ba9da21 100644 --- a/src/main/java/com/moon/server/mapper/sys/RoleResMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java b/src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java index ad38a15..0e1c8f7 100644 --- a/src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java +++ b/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); } diff --git a/src/main/java/com/moon/server/service/all/BaseQueryService.java b/src/main/java/com/moon/server/service/all/BaseQueryService.java index bbef592..99aa21e 100644 --- a/src/main/java/com/moon/server/service/all/BaseQueryService.java +++ b/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 鐖禡apper - * @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 鐖禡apper - * @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 diff --git a/src/main/java/com/moon/server/service/all/BaseUploadService.java b/src/main/java/com/moon/server/service/all/BaseUploadService.java index 958b26b..172aca6 100644 --- a/src/main/java/com/moon/server/service/all/BaseUploadService.java +++ b/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); diff --git a/src/main/java/com/moon/server/service/all/CommonsFileuploadService.java b/src/main/java/com/moon/server/service/all/CommonsFileuploadService.java index 2f30828..d895cf8 100644 --- a/src/main/java/com/moon/server/service/all/CommonsFileuploadService.java +++ b/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("琛ㄥ崟鐨別nctype灞炴�т笉鏄痬ultipart/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; } - /** - * 澶勭悊瑙f瀽鍐呭锛氬鐞嗘櫘閫氳〃鍗曞煙鍜屾枃浠惰〃鍗曞煙 - */ 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; diff --git a/src/main/java/com/moon/server/service/all/PermsService.java b/src/main/java/com/moon/server/service/all/PermsService.java index c22b7ec..e857200 100644 --- a/src/main/java/com/moon/server/service/all/PermsService.java +++ b/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(); } diff --git a/src/main/java/com/moon/server/service/all/RedisService.java b/src/main/java/com/moon/server/service/all/RedisService.java index a07b4c4..8a3d81b 100644 --- a/src/main/java/com/moon/server/service/all/RedisService.java +++ b/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) { diff --git a/src/main/java/com/moon/server/service/all/ScheduleService.java b/src/main/java/com/moon/server/service/all/ScheduleService.java index 4703e28..819b365 100644 --- a/src/main/java/com/moon/server/service/all/ScheduleService.java +++ b/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()) { diff --git a/src/main/java/com/moon/server/service/all/SignService.java b/src/main/java/com/moon/server/service/all/SignService.java index 2eefeee..66c4f0e 100644 --- a/src/main/java/com/moon/server/service/all/SignService.java +++ b/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())); diff --git a/src/main/java/com/moon/server/service/all/SysService.java b/src/main/java/com/moon/server/service/all/SysService.java index 374fc2d..f4e7003 100644 --- a/src/main/java/com/moon/server/service/all/SysService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/all/TestService.java b/src/main/java/com/moon/server/service/all/TestService.java index 0e89a2f..2d5244e 100644 --- a/src/main/java/com/moon/server/service/all/TestService.java +++ b/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 { diff --git a/src/main/java/com/moon/server/service/all/UploadAttachService.java b/src/main/java/com/moon/server/service/all/UploadAttachService.java index 0780ff3..1c65162 100644 --- a/src/main/java/com/moon/server/service/all/UploadAttachService.java +++ b/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)); diff --git a/src/main/java/com/moon/server/service/all/WebSocketService.java b/src/main/java/com/moon/server/service/all/WebSocketService.java index 6066f89..97126c8 100644 --- a/src/main/java/com/moon/server/service/all/WebSocketService.java +++ b/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瀵硅薄锛堢嚎绋嬪畨鍏⊿et锛� - */ 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("鍙戠敓閿欒锛歿}锛孲ession ID锛� {}", error.getMessage(), session.getId()); } - /** - * 鍙戦�佹秷鎭紝瀹炶返琛ㄦ槑锛屾瘡娆℃祻瑙堝櫒鍒锋柊锛宻ession浼氬彂鐢熷彉鍖栥�� - */ 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) { diff --git a/src/main/java/com/moon/server/service/data/ColortabService.java b/src/main/java/com/moon/server/service/data/ColortabService.java index 9c05f5c..c17e148 100644 --- a/src/main/java/com/moon/server/service/data/ColortabService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/data/DataQueryService.java b/src/main/java/com/moon/server/service/data/DataQueryService.java index 914e417..04cb0c6 100644 --- a/src/main/java/com/moon/server/service/data/DataQueryService.java +++ b/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); diff --git a/src/main/java/com/moon/server/service/data/DictService.java b/src/main/java/com/moon/server/service/data/DictService.java index c599ca7..c7a8ced 100644 --- a/src/main/java/com/moon/server/service/data/DictService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/data/DomainService.java b/src/main/java/com/moon/server/service/data/DomainService.java index a18e467..ebdb1ce 100644 --- a/src/main/java/com/moon/server/service/data/DomainService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/data/DownloadService.java b/src/main/java/com/moon/server/service/data/DownloadService.java index 09f7dce..5a2bf1f 100644 --- a/src/main/java/com/moon/server/service/data/DownloadService.java +++ b/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(); } - /** - * 瑙e瘑 - * - * @param entity 瀵嗙爜鎶借薄绫� - * @return 鏄�/鍚﹁В瀵嗘垚鍔� - */ public static boolean decryptPwd(AbstractPwdEntity entity) { try { String pwd = RsaHelper.decrypt(entity.getPwd()); @@ -134,12 +119,6 @@ } } - /** - * 瑙e瘑 - * - * @param pe 绠¢亾鍒嗘瀽瀹炰綋绫� - * @return 鏄�/鍚﹁В瀵嗘垚鍔� - */ public static boolean decryptPwd(PipelineEntity pe) { try { String pwd = RsaHelper.decrypt(pe.getPwd()); @@ -156,12 +135,6 @@ } } - /** - * 瑙e瘑 - * - * @param pwd 鍔犲瘑瀵嗙爜 - * @return 鍘熷瀵嗙爜 - */ public static String decryptPwd(String pwd) { try { return RsaHelper.decrypt(pwd); diff --git a/src/main/java/com/moon/server/service/data/FmeService.java b/src/main/java/com/moon/server/service/data/FmeService.java index 12db7fc..9d5457b 100644 --- a/src/main/java/com/moon/server/service/data/FmeService.java +++ b/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.琛ㄦ牸鍏ュ簱锛歋_RKBG銆乨irid銆乸arentid锛屽涓互鑻辨枃閫楀彿闅斿紑 - */ 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())))); diff --git a/src/main/java/com/moon/server/service/data/MetaService.java b/src/main/java/com/moon/server/service/data/MetaService.java index 6d209c3..30bcdb6 100644 --- a/src/main/java/com/moon/server/service/data/MetaService.java +++ b/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); } - /** - * 鑾峰彇鍒犻櫎琛ㄨ褰昐QL - */ 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, ";"); } - /** - * 鑾峰彇鍒犻櫎琛ㄨ褰昐QL - */ 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 @@ } } - /** - * 鏌ヨ鍏冩暟鎹腑婧㈠嚭鐨勫崟浣岻D - */ 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; diff --git a/src/main/java/com/moon/server/service/data/PublishService.java b/src/main/java/com/moon/server/service/data/PublishService.java index 2e479da..09939dd 100644 --- a/src/main/java/com/moon/server/service/data/PublishService.java +++ b/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); diff --git a/src/main/java/com/moon/server/service/data/ReadRasterService.java b/src/main/java/com/moon/server/service/data/ReadRasterService.java index c88a932..8ea5206 100644 --- a/src/main/java/com/moon/server/service/data/ReadRasterService.java +++ b/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缂栫爜锛歅ROJCS銆丟EOGCS銆丟EOGCS|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] 宸︿笂瑙抶鍧愭爣 - * transform[1] 涓滆タ鏂瑰悜鍒嗚鲸鐜� - * transform[2] 鏃嬭浆瑙掑害, 0琛ㄧず鍥惧儚 "鍖楁柟鏈濅笂" - * - * transform[3] 宸︿笂瑙抷鍧愭爣 - * 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<>(); diff --git a/src/main/java/com/moon/server/service/data/SlopeAnalysisService.java b/src/main/java/com/moon/server/service/data/SlopeAnalysisService.java index 862ebec..9c161de 100644 --- a/src/main/java/com/moon/server/service/data/SlopeAnalysisService.java +++ b/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"; diff --git a/src/main/java/com/moon/server/service/data/UploadService.java b/src/main/java/com/moon/server/service/data/UploadService.java index 7262adc..71ebfba 100644 --- a/src/main/java/com/moon/server/service/data/UploadService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/show/ApplyService.java b/src/main/java/com/moon/server/service/show/ApplyService.java index 282614d..cef71fa 100644 --- a/src/main/java/com/moon/server/service/show/ApplyService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/show/DataLibService.java b/src/main/java/com/moon/server/service/show/DataLibService.java index cac2014..2a99022 100644 --- a/src/main/java/com/moon/server/service/show/DataLibService.java +++ b/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; } - /** - * 璁剧疆 鍙砽ike - */ private static void setRightLike(List<String> list, String field) { if (list.isEmpty()) { list.add("1 = 2"); diff --git a/src/main/java/com/moon/server/service/show/ExportService.java b/src/main/java/com/moon/server/service/show/ExportService.java index 2b26972..0f4c6ea 100644 --- a/src/main/java/com/moon/server/service/show/ExportService.java +++ b/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)); diff --git a/src/main/java/com/moon/server/service/show/FlowService.java b/src/main/java/com/moon/server/service/show/FlowService.java index 6e2100f..ba75f1a 100644 --- a/src/main/java/com/moon/server/service/show/FlowService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/show/InquiryService.java b/src/main/java/com/moon/server/service/show/InquiryService.java index 9feec70..92b6bde 100644 --- a/src/main/java/com/moon/server/service/show/InquiryService.java +++ b/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()); } diff --git a/src/main/java/com/moon/server/service/show/MarkService.java b/src/main/java/com/moon/server/service/show/MarkService.java index 3f9f5e7..a22cfd0 100644 --- a/src/main/java/com/moon/server/service/show/MarkService.java +++ b/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) { diff --git a/src/main/java/com/moon/server/service/show/ModelService.java b/src/main/java/com/moon/server/service/show/ModelService.java index 63b55e2..f043cc8 100644 --- a/src/main/java/com/moon/server/service/show/ModelService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/show/PipelineService.java b/src/main/java/com/moon/server/service/show/PipelineService.java index 0d358f8..83f7aa4 100644 --- a/src/main/java/com/moon/server/service/show/PipelineService.java +++ b/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)); diff --git a/src/main/java/com/moon/server/service/sys/ArgsService.java b/src/main/java/com/moon/server/service/sys/ArgsService.java index 82d7435..c454d57 100644 --- a/src/main/java/com/moon/server/service/sys/ArgsService.java +++ b/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) diff --git a/src/main/java/com/moon/server/service/sys/AttachService.java b/src/main/java/com/moon/server/service/sys/AttachService.java index 61d4aac..4b2efa2 100644 --- a/src/main/java/com/moon/server/service/sys/AttachService.java +++ b/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); } - /** - * 鏍规嵁鐖禝D鏌ヨ璁板綍 - */ private List<?> selectRowsByParentid(String entity, String parentid, String field) { BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); if (null == baseMapper) { diff --git a/src/main/java/com/moon/server/service/sys/BlacklistService.java b/src/main/java/com/moon/server/service/sys/BlacklistService.java index 0f51ba9..f71dedb 100644 --- a/src/main/java/com/moon/server/service/sys/BlacklistService.java +++ b/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("")); } diff --git a/src/main/java/com/moon/server/service/sys/DownlogService.java b/src/main/java/com/moon/server/service/sys/DownlogService.java index 99f963d..966cb64 100644 --- a/src/main/java/com/moon/server/service/sys/DownlogService.java +++ b/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()); diff --git a/src/main/java/com/moon/server/service/sys/MenuAuthService.java b/src/main/java/com/moon/server/service/sys/MenuAuthService.java index 10640a8..52d7e3f 100644 --- a/src/main/java/com/moon/server/service/sys/MenuAuthService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/MetaDownService.java b/src/main/java/com/moon/server/service/sys/MetaDownService.java index e02841a..bb14690 100644 --- a/src/main/java/com/moon/server/service/sys/MetaDownService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/ProxyService.java b/src/main/java/com/moon/server/service/sys/ProxyService.java index a633514..8fa7c8e 100644 --- a/src/main/java/com/moon/server/service/sys/ProxyService.java +++ b/src/main/java/com/moon/server/service/sys/ProxyService.java @@ -23,12 +23,8 @@ import java.util.TimerTask; import java.util.concurrent.TimeUnit; -/** - * 浠g悊鏈嶅姟绫� - * @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浠g悊 - */ 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.鑾峰彇璧勬簮瀹炰綋锛宻tatus锛�0-绂佺敤锛�1-鍚敤鍘熷鍦板潃锛�2-鍚敤浠g悊鍦板潃 + 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.妫�鏌ョ櫧鍚嶅崟鍜孖P涓�鑷存�� if (!checkWhiteList(ip, req)) { if (!checkIpSource(ip, token)) { return WebHelper.writeStr2Page(res, AuthInterceptor.ILLEGAL_TOKEN); } } - // 8.妫�鏌ョ敤鎴稩D鏄惁绂佺敤 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); } - /** - * 妫�鏌P涓�鑷存�э細鍥哄畾浠ょ墝涓嶆鏌� - */ 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); diff --git a/src/main/java/com/moon/server/service/sys/ReportService.java b/src/main/java/com/moon/server/service/sys/ReportService.java index 0ac0c20..6c8c423 100644 --- a/src/main/java/com/moon/server/service/sys/ReportService.java +++ b/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)); diff --git a/src/main/java/com/moon/server/service/sys/ResLogService.java b/src/main/java/com/moon/server/service/sys/ResLogService.java index fec97c3..ea9bb65 100644 --- a/src/main/java/com/moon/server/service/sys/ResLogService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/ResService.java b/src/main/java/com/moon/server/service/sys/ResService.java index a47da15..0667a43 100644 --- a/src/main/java/com/moon/server/service/sys/ResService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/RoleLayerService.java b/src/main/java/com/moon/server/service/sys/RoleLayerService.java index 3fce15f..06a26bb 100644 --- a/src/main/java/com/moon/server/service/sys/RoleLayerService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java b/src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java index 6a7041a..809ae90 100644 --- a/src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/RoleResService.java b/src/main/java/com/moon/server/service/sys/RoleResService.java index 92bcc7d..9792013 100644 --- a/src/main/java/com/moon/server/service/sys/RoleResService.java +++ b/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; diff --git a/src/main/java/com/moon/server/service/sys/RoleUserService.java b/src/main/java/com/moon/server/service/sys/RoleUserService.java index 010f65f..5f92327 100644 --- a/src/main/java/com/moon/server/service/sys/RoleUserService.java +++ b/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; -- Gitblit v1.9.3