wutt 5 سال پیش
والد
کامیت
f643f64fb3
17فایلهای تغییر یافته به همراه1597 افزوده شده و 0 حذف شده
  1. 14 0
      fhKeeper/formulahousekeeper/.gitignore
  2. 74 0
      fhKeeper/formulahousekeeper/management-platform/pom.xml
  3. 17 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/PlatformStartApplication.java
  4. 73 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CRC16Util.java
  5. 217 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java
  6. 35 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeUtil.java
  7. 155 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java
  8. 72 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/FileCopyToFolderUtil.java
  9. 27 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/FileUtil.java
  10. 293 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/HttpKit.java
  11. 39 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/HttpRespMsg.java
  12. 147 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ListUtil.java
  13. 95 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/MD5Util.java
  14. 61 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/PageUtil.java
  15. 48 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/UploadFileToFileNameUtil.java
  16. 57 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  17. 173 0
      fhKeeper/formulahousekeeper/pom.xml

+ 14 - 0
fhKeeper/formulahousekeeper/.gitignore

@@ -0,0 +1,14 @@
+# Created by .ignore support plugin (hsz.mobi)
+### Example user template template
+### Example user template
+
+# IntelliJ project files
+.idea
+*.iml
+out
+gen
+/.idea/compiler.xml
+/.idea/misc.xml
+/.idea/vcs.xml
+/.idea/workspace.xml
+/.idea/encodings.xml

+ 74 - 0
fhKeeper/formulahousekeeper/management-platform/pom.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>formulahousekeeper</artifactId>
+        <groupId>com.hssx.parent</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.hssx.parent</groupId>
+    <artifactId>management-platform</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <!-- mybatis-plus代码生成器依赖 -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+
+        <!-- velocity模板引擎 -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+        </dependency>
+
+        <!-- freemarker 模板引擎-->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+
+    </dependencies>
+
+
+</project>

+ 17 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/PlatformStartApplication.java

@@ -0,0 +1,17 @@
+package com.management.platform;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * Author: 吴涛涛
+ * Date : 2019 - 12 - 31 9:23
+ * Description:<描述>
+ * Version: 1.0
+ */
+@SpringBootApplication
+public class PlatformStartApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(PlatformStartApplication.class,args);
+    }
+}

+ 73 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CRC16Util.java

@@ -0,0 +1,73 @@
+package com.management.platform.util;
+public class CRC16Util {
+    /**
+     * 计算CRC16校验码
+     *
+     * @param data 需要校验的字符串
+     * @return 校验码
+     */
+    public static String getCRC(String data) {
+        data = data.replace(" ", "");
+        int len = data.length();
+        if (!(len % 2 == 0)) {
+            return "0000";
+        }
+        int num = len / 2;
+        byte[] para = new byte[num];
+        for (int i = 0; i < num; i++) {
+            int value = Integer.valueOf(data.substring(i * 2, 2 * (i + 1)), 16);
+            para[i] = (byte) value;
+        }
+        return getCRC(para);
+    }
+ 
+ 
+    /**
+     * 计算CRC16校验码
+     *
+     * @param bytes 字节数组
+     * @return {@link String} 校验码
+     * @since 1.0
+     */
+    public static String getCRC(byte[] bytes) {
+        //CRC寄存器全为1
+        int CRC = 0x0000ffff;
+        //多项式校验值
+        int POLYNOMIAL = 0x0000a001;
+        int i, j;
+        for (i = 0; i < bytes.length; i++) {
+            CRC ^= ((int) bytes[i] & 0x000000ff);
+            for (j = 0; j < 8; j++) {
+                if ((CRC & 0x00000001) != 0) {
+                    CRC >>= 1;
+                    CRC ^= POLYNOMIAL;
+                } else {
+                    CRC >>= 1;
+                }
+            }
+        }
+        System.out.println("CRC"+CRC);
+        //结果转换为16进制
+        String result = Integer.toHexString(CRC).toUpperCase();
+        System.out.println("result"+result);
+        if (result.length() != 4) {
+            StringBuffer sb = new StringBuffer("0000");
+            result = sb.replace(4 - result.length(), 4, result).toString();
+        }
+//        return result;
+//        交换高低位
+        return result.substring(2, 4) + result.substring(0, 2);//高位在前,低位在后
+    }
+ 
+ 
+    public static void main(String[] args) {
+        //01 03 20 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 8C 45
+        //01 03 00 00 00 08 44 0C
+        //01 03 10 00 8F 02 4E 00 91 02 44 00 92 02 5A 00 8B 02 47 40 D8
+//        System.out.println(getCRC("01 03 20 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF 7F FF"));
+//        System.out.println(getCRC("01 03 00 00 00 08"));
+//        System.out.println(getCRC("01 03 10 00 8F 02 4E 00 91 02 44 00 92 02 5A 00 8B 02 47"));
+    	String crc = getCRC("FA AF 00 07 01 1e 78 1e 50 00 3C");
+        System.out.println(crc);
+    }
+}

+ 217 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java

@@ -0,0 +1,217 @@
+package com.management.platform.util;
+
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.FileType;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Scanner;
+
+/**
+ * mybatis-plus代码生成器
+ *  使用该类需要添加以下依赖,在此之前请移除所有与mybatis有关的其他依赖,防止冲突
+ *   <dependency>
+ *      <groupId>com.baomidou</groupId>
+ *       <artifactId>mybatis-plus-generator</artifactId>
+ *       <version>3.1.2</version>
+ *  </dependency>
+ *
+ *  <dependency>
+ *        <groupId>com.baomidou</groupId>
+ *        <artifactId>mybatis-plus-boot-starter</artifactId>
+ *        <version>3.1.2</version>
+ *   </dependency>
+ *
+ */
+// 演示例子,执行 main 方法控制台输入模块表名回车自动生成对应项目目录中
+public class CodeGenerator {
+
+    /**
+     * <p>
+     * 读取控制台内容
+     * </p>
+     */
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotEmpty(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        // 全局配置
+
+
+        // 自定义文件命名,注意 %s 会自动填充表实体属性!
+//        gc.setMapperName("%sDao");
+//        gc.setXmlName("%sMapper");
+//        gc.setServiceName("%sService");
+//        gc.setServiceImplName("%sServiceImap");
+//        gc.setControllerName("%sController");
+        //生成的代码存放到某个路径下,这里是E盘,
+//        gc.setOutputDir("E://");
+        //生成的代码位置为当前项目
+        String projectPath = System.getProperty("user.dir");
+        gc.setOutputDir(projectPath + "/src/main/java");
+        gc.setAuthor("吴涛涛");
+        gc.setOpen(false);
+        gc.setFileOverride(true);
+        gc.setActiveRecord(true);
+        //%s是实体类类名占位符,不配置这行的话,对于User会生成IUserService,配置后即可生成UserService;
+        gc.setServiceName("%sService");
+        // XML 二级缓存
+//      gc.setEnableCache(true);
+        // XML ResultMap
+        gc.setBaseResultMap(true);
+        // XML columList
+        gc.setBaseColumnList(true);
+        //
+        // gc.setSwagger2(true); 实体属性 Swagger2 注解
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setUrl("jdbc:mysql://118.190.47.230:3306/geminidatabridge_yun?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
+//        dsc.setSchemaName("public");
+        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("p011430seya1026");
+        mpg.setDataSource(dsc);
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+        //若果需要在Parent(此处即com.example.plus)下新建模块时打开下面注释,后续在控制台提示输入模块时,输入想要新建的模块名就可以
+//        pc.setModuleName(scanner("模块名"));
+        pc.setParent("com.hssx.centerdata");
+        mpg.setPackageInfo(pc);
+
+        // 自定义配置
+        InjectionConfig cfg = new InjectionConfig() {
+            @Override
+            public void initMap() {
+                // to do nothing
+            }
+        };
+        //以下为两种模板来生成*mapper.xml文件,任选一种即可,不同的模板对应不同的依赖
+        // 如果模板引擎是 freemarker,请添加以下依赖。
+        /**
+         *         <dependency>
+         *             <groupId>org.freemarker</groupId>
+         *             <artifactId>freemarker</artifactId>
+         *             <version>2.3.23</version>
+         *         </dependency>
+         */
+//        String templatePath = "/templates/mapper.xml.ftl";
+        // 如果模板引擎是 velocity 请添加以下依赖。
+        /**
+         *         <dependency>
+         *             <groupId>org.apache.velocity</groupId>
+         *             <artifactId>velocity-engine-core</artifactId>
+         *             <version>2.0</version>
+         *         </dependency>
+         */
+         String templatePath = "/templates/mapper.xml.vm";
+
+        // 自定义输出配置
+        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+        focList.add(new FileOutConfig(templatePath) {
+            @Override
+            public String outputFile(TableInfo tableInfo) {
+                if(pc.getModuleName() == null){
+                    return projectPath + "/src/main/resources/mapper/"
+                            + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+                }else{
+                    // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+                    return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+                            + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+                }
+
+            }
+
+        });
+
+        cfg.setFileCreate(new IFileCreate() {
+            @Override
+            public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
+                // 判断自定义文件夹是否需要创建,这里调用默认的方法
+                checkDir(filePath);
+                //对于已存在的文件,只需重复生成 entity 和 mapper.xml
+                File file = new File(filePath);
+                boolean exist = file.exists();
+                if(exist){
+                    if (filePath.endsWith("Mapper.xml")||FileType.ENTITY==fileType){
+                        return true;
+                    }else {
+                        return false;
+                    }
+                }
+                //不存在的文件都需要创建
+                return  true;
+            }
+        });
+
+        cfg.setFileOutConfigList(focList);
+        mpg.setCfg(cfg);
+        mpg.setTemplate(new TemplateConfig().setXml(null));
+
+        // 配置模板
+//        TemplateConfig templateConfig = new TemplateConfig();
+//
+//        // 配置自定义输出模板
+//        //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
+//        // templateConfig.setEntity("templates/entity2.java");
+//        // templateConfig.setService();
+//        // templateConfig.setController();
+//
+//        templateConfig.setXml(null);
+//        mpg.setTemplate(templateConfig);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+        //若想要生成的实体类继承某个类,则可打开下面注释。写上需要继承的类的位置即可
+//        strategy.setSuperEntityClass("com.baomidou.ant.common.BaseEntity");
+        //【实体】是否为lombok模型(默认 false)
+        strategy.setEntityLombokModel(true);
+        //对控制器生成 @RestController 注解
+        strategy.setRestControllerStyle(true);
+        //是否生成实体时,生成字段注解
+        strategy.setEntityTableFieldAnnotationEnable(true);
+//        strategy.setEntitySerialVersionUID(false)//加此行不生成生成实体类序列化编号,不加默认生成
+        //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
+//        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
+        //此处user是表名,多个英文逗号分割
+//        strategy.setInclude("t_data_size_info_center_storage");
+//        strategy.setExclude();//数据库表全生成
+//        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
+        strategy.setControllerMappingHyphenStyle(true);
+        //数据库表前缀,不配置这行的话,生成的类会带有T如:TUser,配置后即可将前缀去掉
+//        strategy.setTablePrefix("tb_");
+        mpg.setStrategy(strategy);
+//        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+    }
+}

+ 35 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeUtil.java

@@ -0,0 +1,35 @@
+package com.management.platform.util;
+
+import java.util.Random;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 10 - 24 16:23
+ * Description:验证码生成工具
+ * Version: 1.0
+ */
+public class CodeUtil {
+
+
+    public HttpRespMsg getVcode(String mobile) {
+        HttpRespMsg msg = new HttpRespMsg();
+        if (mobile != null) {
+            Random r = new Random();
+            int val = r.nextInt(10000);
+            if (val < 1000) {
+                val += 1000;
+            }
+            String codeValStr = "" + val;
+//            Vcode record = new Vcode();
+//            record.setMobile(mobile);
+//            record.setVcode("" + val);
+//            vcodeMapper.insertSelective(record);
+//            try {
+//                SendSmsResponse sendSmsResponse = SmsDemo.sendSms(mobile, record.getVcode());
+//            } catch (ClientException e) {
+//                e.printStackTrace();
+//            }
+        }
+        return msg;
+    }
+}

+ 155 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java

@@ -0,0 +1,155 @@
+package com.management.platform.util;
+
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.List;
+
+public class ExcelUtil {
+    /**
+     * 简单Excel导出
+     * @param response
+     * @param title     标题
+     * @param list      数据
+     * @return
+     */
+    public static String exportGeneralExcelByTitleAndList(HttpServletResponse response, String title, List<List<String>> list, String downloadPath) {
+        String result="系统提示:Excel文件导出成功!";
+        String fileName= title+".xls";
+        try {
+            response.reset();
+            response.setHeader("Content-disposition",
+                "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
+            //设置文件头编码格式
+            response.setContentType("APPLICATION/OCTET-STREAM;charset=UTF-8");//设置类型
+            response.setHeader("Cache-Control","no-cache");//设置头
+            response.setDateHeader("Expires", 0);//设置日期头
+            // 创建工作簿
+            HSSFWorkbook workBook = new HSSFWorkbook();
+            // 创建工作类
+            HSSFSheet sheet = workBook.createSheet();
+            sheet.setDefaultColumnWidth(16);
+            //设置字体样式
+            HSSFFont headFont = workBook.createFont();
+            headFont.setBold(true);
+            headFont.setFontHeightInPoints((short) 10);
+            headFont.setFontName("黑体");
+
+            HSSFFont titleFont = workBook.createFont();
+            titleFont.setBold(true);
+            titleFont.setFontHeightInPoints((short) 10);
+            titleFont.setFontName("黑体");
+
+            HSSFFont font = workBook.createFont();
+            font.setFontHeightInPoints((short) 10);
+            font.setFontName("宋体");
+
+            //设置单元格样式
+            CellStyle headStyle = workBook.createCellStyle();
+            headStyle.setFont(headFont);
+            headStyle.setAlignment(HorizontalAlignment.CENTER);
+            headStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            headStyle.setWrapText(true);
+            headStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            headStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            headStyle.setBorderTop(BorderStyle.THIN);//上边框
+            headStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            String color = "c0c0c0";    //此处得到的color为16进制的字符串
+            //转为RGB码
+            int r = Integer.parseInt((color.substring(0,2)),16);   //转为16进制
+            int g = Integer.parseInt((color.substring(2,4)),16);
+            int b = Integer.parseInt((color.substring(4,6)),16);
+
+            //自定义cell颜色
+            HSSFPalette palette = workBook.getCustomPalette();
+            //这里的9是索引
+            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
+
+            CellStyle titleStyle = workBook.createCellStyle();
+            titleStyle.setFont(titleFont);
+            titleStyle.setAlignment(HorizontalAlignment.CENTER);
+            titleStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);  //填充单元格
+            titleStyle.setFillForegroundColor((short)9);    //填色
+            titleStyle.setWrapText(true);
+            titleStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            titleStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            titleStyle.setBorderTop(BorderStyle.THIN);//上边框
+            titleStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            CellStyle cellStyle = workBook.createCellStyle();
+            cellStyle.setFont(font);
+            cellStyle.setAlignment(HorizontalAlignment.CENTER);
+            cellStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            cellStyle.setWrapText(true);
+            cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            cellStyle.setBorderTop(BorderStyle.THIN);//上边框
+            cellStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            if(list.size() > 0) {
+                //标题(如果需要在EXCEL内容最上面加标题,请打开下面的注释,修改start)
+                /*
+                HSSFRow titleRow = sheet.createRow(0);
+                titleRow.setHeightInPoints(30);
+                HSSFCell titleCell = titleRow.createCell(0);
+                titleCell.setCellStyle(headStyle);
+                titleCell.setCellValue(title);
+                //合并单元格
+                CellRangeAddress cellRangeAddress = new CellRangeAddress(0,0,0, list.get(0).size() - 1);
+                //加入合并单元格对象
+                sheet.addMergedRegion(cellRangeAddress);
+                //使用RegionUtil类为合并后的单元格添加边框
+			    RegionUtil.setBorderBottom(BorderStyle.THIN, cellRangeAddress, sheet); // 下边框
+                RegionUtil.setBorderLeft(BorderStyle.THIN, cellRangeAddress, sheet); // 左边框
+                RegionUtil.setBorderRight(BorderStyle.THIN, cellRangeAddress, sheet); // 有边框
+                RegionUtil.setBorderTop(BorderStyle.THIN, cellRangeAddress, sheet); // 上边框
+                */
+                int start = 0;
+                for(List<String> rowList : list) {
+                    HSSFRow row = sheet.createRow(start);
+                    row.setHeightInPoints(24);
+                    for(int i = 0; i < rowList.size(); i++) {
+                        HSSFCell cell = row.createCell(i);
+                        if(start == 0) {
+                            cell.setCellStyle(titleStyle);
+                        }else {
+                            cell.setCellStyle(cellStyle);
+                        }
+                        cell.setCellValue(rowList.get(i));
+                    }
+                    start++;
+                }
+            }
+            //用于非传统ajax;
+            String headStr = "attachment; filename=\"" + fileName + "\"";
+            response.setContentType("APPLICATION/OCTET-STREAM");//返回格式为流
+            response.setHeader("Content-Disposition", headStr);
+            //普通下载不需要以上三行,注掉即可
+            OutputStream os = response.getOutputStream();//在线下载
+            File dir = null;
+            dir = new File(downloadPath);
+            // D://cloud/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+//            FileOutputStream os = new FileOutputStream(downloadPath+fileName);//保存到本地
+            workBook.write(os);
+            os.flush();
+            os.close();
+        }catch(Exception e) {
+            System.out.println(result);
+            e.printStackTrace();
+        }
+//        return "/upload/"+fileName;
+        return "";
+    }
+}

+ 72 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/FileCopyToFolderUtil.java

@@ -0,0 +1,72 @@
+package com.management.platform.util;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 08 - 30 13:59
+ * Description:<描述>
+ * Version: 1.0
+ */
+public class FileCopyToFolderUtil {
+    public static void main(String[] args) throws IOException {
+        Date date = new Date();
+        long time1 = date.getTime();
+        List<String>  sourceFileUrls = new ArrayList<>();
+        sourceFileUrls.add("D:\\软件\\ideaIU-2018.1.5.exe");
+        copy(sourceFileUrls, "D:\\775");
+        date = new Date();
+        long time2 = date.getTime();
+        System.out.println("耗时===》"+(time2-time1)/1000);
+        File file = new File("D:\\776");
+        if (file.exists()) {
+            file.delete();
+            //创建文件夹
+            file.mkdirs();
+        } else {
+            file.mkdirs();
+        }
+        System.out.println(file.getPath());
+    }
+    public static String copy(List<String>  sourceFileUrls, String destinationFolder) throws IOException {
+        //新文件夾
+        File file = new File(destinationFolder);
+        if (file.exists()) {
+            file.delete();
+            //创建文件夹
+            file.mkdirs();
+        } else {
+            file.mkdirs();
+        }
+        //如果源文件存在就复制
+        for (String sourceFileUrl : sourceFileUrls) {
+            //目标源文件夹
+            File source = new File(sourceFileUrl);
+            if (source.exists()) {
+                //新文件夹的路径
+                File newFile = new File(file + File.separator + source.getName());
+                if (source.isFile()) {
+                    FileInputStream in = new FileInputStream(source);
+                    BufferedInputStream bis= new BufferedInputStream(in);
+                    FileOutputStream out = new FileOutputStream(newFile);
+                    BufferedOutputStream bos= new BufferedOutputStream(out);
+                    byte[] bs = new byte[4096*10];
+                    int count = 0;
+//循环把源文件的内容写入新文件
+                    while ((count = bis.read(bs, 0, bs.length)) != -1) {
+                        bos.write(bs, 0, count);
+                    }
+//关闭流
+                    out.flush();
+                    out.close();
+                    in.close();
+                }
+            }
+        }
+        return file.getPath();
+    }
+
+}

+ 27 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/FileUtil.java

@@ -0,0 +1,27 @@
+package com.management.platform.util;
+
+public class FileUtil {
+
+	/**
+	 * 获取容易识别的文件大小,比如KB, MB, GB
+	 * @param size
+	 * @return
+	 */
+	public static String getReadableFileSize(long size) {
+		if (size < 1024) {//1K以内
+			return size + "byte";
+		} else if (size < 1024 * 1024) {//1M以内
+			return String.format("%.1fKB", (size*1.0f/1024));
+		} else if (size < 1024 * 1024 * 1024) {//1G以内
+			return String.format("%.1fMB", (size*1.0f/1024/1024));
+		} else {
+			return String.format("%.1fGB", (size*1.0f/1024/1024/1024));
+		}
+	}
+	public static void main(String[] args) {
+		long l = 1024 * 1024 * 1 * 1024;
+		System.out.println(getReadableFileSize(l));
+		String substring = "/upload/af9db74095354187b5ee17bce73b6b82.jpg".substring("/upload/".length());
+		System.out.println(substring);
+	}
+}

+ 293 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/HttpKit.java

@@ -0,0 +1,293 @@
+package com.management.platform.util;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Map;
+import java.util.Map.Entry;
+
+@Slf4j
+public class HttpKit {
+    
+    private static final String DEFAULT_CHARSET = "UTF-8";
+    /**
+     * 发送Get请求
+     * @param url
+     * @return
+     * @throws NoSuchProviderException 
+     * @throws NoSuchAlgorithmException 
+     * @throws IOException 
+     * @throws KeyManagementException 
+     */
+    public static String get(String url) throws NoSuchAlgorithmException, NoSuchProviderException, IOException, KeyManagementException {
+        StringBuffer bufferRes = null;
+        TrustManager[] tm = { new MyX509TrustManager() };  
+        SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");  
+        sslContext.init(null, tm, new java.security.SecureRandom());  
+        // 从上述SSLContext对象中得到SSLSocketFactory对象  
+        SSLSocketFactory ssf = sslContext.getSocketFactory();
+        
+        URL urlGet = new URL(url);
+        HttpsURLConnection http = (HttpsURLConnection) urlGet.openConnection();
+        // 连接超时
+        http.setConnectTimeout(25000);
+        // 读取超时 --服务器响应比较慢,增大时间
+        http.setReadTimeout(25000);
+        http.setRequestMethod("GET");
+        http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
+        http.setSSLSocketFactory(ssf);
+        http.setDoOutput(true);
+        http.setDoInput(true);
+        http.connect();
+        
+        InputStream in = http.getInputStream();
+        BufferedReader read = new BufferedReader(new InputStreamReader(in, DEFAULT_CHARSET));
+        String valueString = null;
+        bufferRes = new StringBuffer();
+        while ((valueString = read.readLine()) != null){
+            bufferRes.append(valueString);
+        }
+        in.close();
+        if (http != null) {
+            // 关闭连接
+            http.disconnect();
+        }
+        return bufferRes.toString();
+    }
+    
+    /**
+     * 发送Get请求
+     * @param url
+     * @return
+     * @throws NoSuchProviderException 
+     * @throws NoSuchAlgorithmException 
+     * @throws IOException 
+     * @throws KeyManagementException 
+     */
+    public static String get(String url,Boolean https) throws NoSuchAlgorithmException, NoSuchProviderException, IOException, KeyManagementException {
+     if(https != null && https){
+      return get(url);
+     }else{
+      StringBuffer bufferRes = null;
+            URL urlGet = new URL(url);
+            HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
+            // 连接超时
+            http.setConnectTimeout(25000);
+            // 读取超时 --服务器响应比较慢,增大时间
+            http.setReadTimeout(25000);
+            http.setRequestMethod("GET");
+            http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
+            http.setDoOutput(true);
+            http.setDoInput(true);
+            http.connect();
+            
+            InputStream in = http.getInputStream();
+            BufferedReader read = new BufferedReader(new InputStreamReader(in, DEFAULT_CHARSET));
+            String valueString = null;
+            bufferRes = new StringBuffer();
+            while ((valueString = read.readLine()) != null){
+                bufferRes.append(valueString);
+            }
+            in.close();
+            if (http != null) {
+                // 关闭连接
+                http.disconnect();
+            }
+            return bufferRes.toString();
+     }
+    }
+    /**
+     *  发送Get请求
+     * @param url
+     * @param params
+     * @return
+     * @throws IOException 
+     * @throws NoSuchProviderException 
+     * @throws NoSuchAlgorithmException 
+     * @throws KeyManagementException 
+     */
+    public static String get(String url, Map<String, String> params) throws KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException, IOException {
+        return get(initParams(url, params));
+    }
+    /**
+     *  发送Post请求
+     * @param url
+     * @param params
+     * @return
+     * @throws IOException 
+     * @throws NoSuchProviderException 
+     * @throws NoSuchAlgorithmException 
+     * @throws KeyManagementException 
+     */
+    public static String post(String url, String params) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException {
+     StringBuffer bufferRes = null;
+        TrustManager[] tm = { new MyX509TrustManager() };
+        SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+        sslContext.init(null, tm, new java.security.SecureRandom());
+        // 从上述SSLContext对象中得到SSLSocketFactory对象  
+        SSLSocketFactory ssf = sslContext.getSocketFactory();
+        URL urlGet = new URL(url);
+        HttpsURLConnection http = (HttpsURLConnection) urlGet.openConnection();
+        // 连接超时
+        http.setConnectTimeout(25000);
+        // 读取超时 --服务器响应比较慢,增大时间
+        http.setReadTimeout(25000);
+        http.setRequestMethod("POST");
+        http.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
+        http.setSSLSocketFactory(ssf);
+        http.setDoOutput(true);
+        http.setDoInput(true);
+        http.connect();
+        OutputStream out = http.getOutputStream();
+        out.write(params.getBytes("UTF-8"));
+        out.flush();
+        out.close();
+        InputStream in = http.getInputStream();
+        BufferedReader read = new BufferedReader(new InputStreamReader(in, DEFAULT_CHARSET));
+        String valueString = null;
+        bufferRes = new StringBuffer();
+        while ((valueString = read.readLine()) != null){
+            bufferRes.append(valueString);
+        }
+        in.close();
+        if (http != null) {
+            // 关闭连接
+            http.disconnect();
+        }
+        return bufferRes.toString();
+    }
+    
+    /**
+     * 上传媒体文件
+     * @param url
+     * @param file
+     * @return
+     * @throws IOException
+     * @throws NoSuchAlgorithmException
+     * @throws NoSuchProviderException
+     * @throws KeyManagementException
+     */
+    public static String upload(String url,File file) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException {
+        String BOUNDARY = "----WebKitFormBoundaryiDGnV9zdZA1eM1yL"; // 定义数据分隔线  
+        StringBuffer bufferRes = null;
+        URL urlGet = new URL(url);
+        HttpURLConnection conn = (HttpURLConnection) urlGet.openConnection();
+        conn.setDoOutput(true);  
+        conn.setDoInput(true);  
+        conn.setUseCaches(false);  
+        conn.setRequestMethod("POST");  
+        conn.setRequestProperty("connection", "Keep-Alive");  
+        conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36");  
+        conn.setRequestProperty("Charsert", "UTF-8");   
+        conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);  
+          
+        OutputStream out = new DataOutputStream(conn.getOutputStream());  
+        byte[] end_data = ("\r\n--" + BOUNDARY + "--\r\n").getBytes();// 定义最后数据分隔线  
+        StringBuilder sb = new StringBuilder();    
+        sb.append("--");    
+        sb.append(BOUNDARY);    
+        sb.append("\r\n");    
+        sb.append("Content-Disposition: form-data;name=\"media\";filename=\""+ file.getName() + "\"\r\n");    
+        sb.append("Content-Type:application/octet-stream\r\n\r\n");    
+        byte[] data = sb.toString().getBytes();  
+        out.write(data);  
+        DataInputStream fs = new DataInputStream(new FileInputStream(file));  
+        int bytes = 0;  
+        byte[] bufferOut = new byte[1024];  
+        while ((bytes = fs.read(bufferOut)) != -1) {  
+            out.write(bufferOut, 0, bytes);  
+        }  
+        out.write("\r\n".getBytes()); //多个文件时,二个文件之间加入这个  
+        fs.close();  
+        out.write(end_data);  
+        out.flush();    
+        out.close();   
+          
+        // 定义BufferedReader输入流来读取URL的响应  
+        InputStream in = conn.getInputStream();
+        BufferedReader read = new BufferedReader(new InputStreamReader(in, DEFAULT_CHARSET));
+        String valueString = null;
+        bufferRes = new StringBuffer();
+        while ((valueString = read.readLine()) != null){
+            bufferRes.append(valueString);
+        }
+        in.close();
+        if (conn != null) {
+            // 关闭连接
+         conn.disconnect();
+        }
+        return bufferRes.toString();
+    }
+    
+    /**
+     * 构造url
+     * @param url
+     * @param params
+     * @return
+     */
+    private static String initParams(String url, Map<String, String> params){
+        if (null == params || params.isEmpty()) {
+            return url;
+        }
+        StringBuilder sb = new StringBuilder(url);
+        if (url.indexOf("?") == -1) {
+            sb.append("?");
+        } else {
+            sb.append("&");
+        }
+        boolean first = true;
+        for (Entry<String, String> entry : params.entrySet()) {
+            if (first) {
+                first = false;
+            } else {
+                sb.append("&");
+            }
+            String key = entry.getKey();
+            String value = entry.getValue();
+            sb.append(key).append("=");
+            if (StringUtils.isNotEmpty(value)) {
+                try {
+                    sb.append(URLEncoder.encode(value, DEFAULT_CHARSET));
+                } catch (UnsupportedEncodingException e) {
+                    e.printStackTrace();
+                    log.error(url,e);
+                }
+            }
+        }
+        return sb.toString();
+    }
+    
+    public static void main(String[] args) {
+     String fname = "dsasdas.mp4";
+     String s = fname.substring(0, fname.lastIndexOf("."));
+     String f = fname.substring(s.length()+1);
+  System.out.println(f);
+ }
+}
+
+/**
+ * 证书管理
+ */
+class MyX509TrustManager implements X509TrustManager {
+    public X509Certificate[] getAcceptedIssuers() {
+        return null;  
+    }
+    @Override
+    public void checkClientTrusted(X509Certificate[] chain, String authType)
+            throws CertificateException {
+    }
+    @Override
+    public void checkServerTrusted(X509Certificate[] chain, String authType)
+            throws CertificateException {
+    }
+}

+ 39 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/HttpRespMsg.java

@@ -0,0 +1,39 @@
+package com.management.platform.util;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import java.io.Serializable;
+
+public class HttpRespMsg implements Serializable {
+
+    //status code, ok or error.
+    public String code;
+
+
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    public String msg;
+
+    //data content, in jsonformat, or zipped string when format is gzip
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    public Object data;
+
+    public HttpRespMsg() {
+        code = "ok";
+    }
+
+    public void setError(String errorMsg) {
+        code = "error";
+        msg = errorMsg;
+    }
+
+
+    public String toJSONStr() {
+        JSONObject json = new JSONObject();
+        json.put("code", code);
+        json.put("data", data);
+        json.put("msg", msg);
+
+        return json.toJSONString();
+    }
+}

+ 147 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ListUtil.java

@@ -0,0 +1,147 @@
+package com.management.platform.util;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 07 - 25 16:56
+ * Description:<描述>处理字符串转成集合的
+ * Version: 1.0
+ */
+
+public class ListUtil {
+	/**
+	 * 
+	 * @param idStr 1,2,3,4,5字符串
+	 * @return List<Long>
+	 */
+	public static List<Long> convertIdsArrayToList(String idStr) {
+		String[] array = idStr.split(",");
+		List<Long> ids = new ArrayList<Long>();
+		for (String a : array) {
+			if (a != null && a.length() > 0) {
+				ids.add(Long.valueOf(a));
+			}
+		}
+		return ids;
+	}
+
+	/**
+	 * Long
+	 * @param idStr  1,2,3,4,5字符串
+	 * @return
+	 */
+	public static List<String> convertLongIdsArrayToList(String idStr) {
+		String[] array = idStr.split(",");
+		List<String> ids = new ArrayList<String>();
+		for (String a : array) {
+			if (a != null && a.length() > 0) {
+				ids.add(a);
+			}
+		}
+		return ids;
+	}
+	/**
+	 * Long
+	 * @param idStr  1,2,3,4,5字符串
+	 * @return
+	 */
+	public static List<Integer> convertIntegerIdsArrayToList(String idStr) {
+		String[] array = idStr.split(",");
+		List<Integer> ids = new ArrayList<Integer>();
+		for (String a : array) {
+			if (a != null && a.length() > 0) {
+				ids.add(Integer.parseInt(a));
+			}
+		}
+		return ids;
+	}
+
+	public static List<Integer> extractIdFromList(List object, String key) {
+		List<Integer> list = new ArrayList<Integer>();
+        for (Object obj : object) {
+            // 得到类对象
+            Class userCla = (Class) obj.getClass();
+            /* 得到类中的所有属性集合 */
+            Field[] fs = userCla.getDeclaredFields();
+            for (int i = 0; i < fs.length; i++) {
+                Field f = fs[i];
+                f.setAccessible(true); // 设置些属性是可以访问的
+                try {
+                    if (f.getName().equals(key)) {
+                        list.add((Integer)f.get(obj));
+                    }
+                } catch (IllegalArgumentException e) {
+                    e.printStackTrace();
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return list;
+	}
+	
+	
+	public static List<String> extractNameFromList(List object, String key) {
+		List<String> list = new ArrayList<String>();
+		for (Object obj : object) {
+			// 得到类对象
+			Class userCla = (Class) obj.getClass();
+			/* 得到类中的所有属性集合 */
+			Field[] fs = userCla.getDeclaredFields();
+			for (int i = 0; i < fs.length; i++) {
+				Field f = fs[i];
+				f.setAccessible(true); // 设置些属性是可以访问的
+				try {
+					if (f.getName().equals(key)) {
+						list.add((String)f.get(obj));
+					}
+				} catch (IllegalArgumentException e) {
+					e.printStackTrace();
+				} catch (IllegalAccessException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+		return list;
+	}
+	
+	public static List<Integer> addList(String ids,List<Integer> idList){
+		String[] joinStr = ids.split(",");
+		boolean isCf = false;
+		for(String id : joinStr){
+			if (id != null && id.length() > 0) {
+				for(int i = 0;i<idList.size();i++){
+					if(Integer.valueOf(id).intValue() != idList.get(i).intValue()){
+						isCf = false;
+					}else{
+						isCf = true;
+						break;
+					}
+				}
+				if(!isCf){
+					idList.add(Integer.valueOf(id));
+				}
+			}
+		}
+		
+		return idList;
+	}
+	
+	//去重
+	public static List removeDuplicateData(List list) {
+		HashSet set = new HashSet();
+		set.addAll(list);
+		list.clear();
+		list.addAll(set);
+		return list;
+	}
+	
+	public static void main(String[] args) {
+		String str = "123|456";
+		System.out.println(str.contains("|"));
+	}
+}

+ 95 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/MD5Util.java

@@ -0,0 +1,95 @@
+package com.management.platform.util;
+
+import org.springframework.util.DigestUtils;
+
+import java.text.ParseException;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 07 - 25 16:56
+ * Description:<描述>MD5加密工具
+ * Version: 1.0
+ */
+public class MD5Util {
+
+    public static String getPassword(String password) {
+        return DigestUtils.md5DigestAsHex(password.getBytes());
+    }
+
+    public static void main(String[] args) throws ParseException {
+
+
+    }
+
+//    public void zipDemo() {
+//        //需要压缩的文件--包括文件地址和文件名
+//        String[] path = {"D:\\666.jpg", "D:\\777.jpg"};
+//        // 要生成的压缩文件地址和文件名称
+//        String desPath = "D:\\new.zip";
+//        File zipFile = new File(desPath);
+//        ZipOutputStream zipStream = null;
+//        FileInputStream zipSource = null;
+//        BufferedInputStream bufferStream = null;
+//        try {
+//            //构造最终压缩包的输出流
+//            zipStream = new ZipOutputStream(new FileOutputStream(zipFile));
+//            for (int i = 0; i < path.length; i++) {
+//                File file = new File(path[i]);
+//                //将需要压缩的文件格式化为输入流
+//                zipSource = new FileInputStream(file);
+//                //压缩条目不是具体独立的文件,而是压缩包文件列表中的列表项,称为条目,就像索引一样
+//                ZipEntry zipEntry = new ZipEntry(i + "2222.jpg");//"2222.jpg"是添加到压缩包里的源文件的名字加i是防止名字相同出错
+//                //定位该压缩条目位置,开始写入文件到压缩包中
+//                zipStream.putNextEntry(zipEntry);
+//                //输入缓冲流
+//                bufferStream = new BufferedInputStream(zipSource, 1024 * 10);
+//                int read = 0;
+//                //创建读写缓冲区
+//                byte[] buf = new byte[1024 * 10];
+//                while ((read = bufferStream.read(buf, 0, 1024 * 10)) != -1) {
+//                    zipStream.write(buf, 0, read);
+//                }
+//            }
+//
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        } finally {
+//            //关闭流
+//            try {
+//                if (null != bufferStream) bufferStream.close();
+//                if (null != zipStream) zipStream.close();
+//                if (null != zipSource) zipSource.close();
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            }
+//        }
+//    }
+//
+//    public static void zip4jDemo(){
+//// 生成的压缩文件
+//        ZipFile zipFile = null;
+//        try {
+//            zipFile = new ZipFile("D:\\aa.zip");
+//
+//        ZipParameters parameters = new ZipParameters();
+//        // 压缩方式
+//        parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
+//        // 压缩级别
+//        parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
+//        // 要打包的文件夹
+//        File currentFile = new File("D:\\666");
+//        File[] fs = currentFile.listFiles();
+//        // 遍历test文件夹下所有的文件、文件夹
+//        for (File f : fs) {
+//            if (f.isDirectory()) {
+//                zipFile.addFolder(f.getPath(), parameters);
+//            } else {
+//                zipFile.addFile(f, parameters);
+//            }
+//        }
+//            zipFile.addFolder("D:\\666", parameters);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+}

+ 61 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/PageUtil.java

@@ -0,0 +1,61 @@
+package com.management.platform.util;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 07 - 27 9:25
+ * Description:<描述> 模仿pagehelper参数的分页封装类
+ * Version: 1.0
+ */
+@Data
+public class PageUtil<T> {
+    private Integer pageNum = 1;
+    private Integer total;
+    private Integer pageSize = 10;
+    private Integer pages;
+    private List<T> list = new ArrayList<>();
+
+    public Integer getPageNum() {
+        return pageNum;
+    }
+
+    public void setPageNum(Integer pageNum) {
+        this.pageNum = pageNum;
+    }
+
+    public Integer getTotal() {
+        return total;
+    }
+
+    public void setTotal(Integer total) {
+        this.total = total;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPages() {
+        return pages;
+    }
+
+    public void setPages(Integer total) {
+        this.pages = total % this.pageSize == 0 ? total / this.pageSize : total / this.pageSize + 1;;
+    }
+
+    public List<T> getList() {
+        return list;
+    }
+
+    public void setList(List<T> list) {
+        this.list = list;
+    }
+}

+ 48 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/UploadFileToFileNameUtil.java

@@ -0,0 +1,48 @@
+package com.management.platform.util;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 10 - 16 13:47
+ * Description:<描述>
+ * Version: 1.0
+ */
+public class UploadFileToFileNameUtil {
+
+    public static String uploadFile(MultipartFile file, String path) {
+        String afterUploadFileName = "";
+        if (file != null) {
+            File dir = null;
+            dir = new File(path);
+            // D://dolphin/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            String fileName = "";
+            if (file != null) {
+                fileName = file.getOriginalFilename();
+                System.out.println("上传文件名称" + file.getName() + ", dir = " + dir.getAbsolutePath());
+                int pos = fileName.lastIndexOf(".");
+                String rand = UUID.randomUUID().toString().replaceAll("-", "");
+                String sufix = fileName.substring(pos);
+                fileName = rand + sufix;
+                afterUploadFileName = "/upload/" + fileName;
+                File saveFile = new File(dir, fileName);
+                try {
+                    saveFile.createNewFile();
+                    file.transferTo(saveFile);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return afterUploadFileName;
+    }
+}

+ 57 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -0,0 +1,57 @@
+server:
+  port: 10010
+  tomcat:
+    uri-encoding: utf-8
+    max-http-form-post-size: -1
+    connection-timeout: 18000000s
+spring:
+  servlet:
+    multipart:
+      # 配置上传文件的大小设置
+      # Single file max size  即单个文件大小
+      max-file-size: 10000MB
+      max-request-size: 10000MB
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://118.190.47.230:3306/geminidatabridge_yun?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    username: root
+    password: p011430seya1026
+    hikari:
+      maximum-pool-size: 10
+      minimum-idle: 3
+      max-lifetime: 30000
+      connection-test-query: SELECT 1
+
+##########日志配置
+logging:
+  level:
+    root: info
+    org.mybatis: debug
+    java.sql: debug
+    org.springframework.web: trace
+    #打印sql语句
+    com.management.platform.mapper: debug
+  path: E:/
+##########
+mybatis-plus:
+#  mapper-locations: classpath:mapper/*/*.xml
+#  #实体扫描,多个package用逗号或者分号分隔
+#  typeAliasesPackage: com.hssx.cloudmodel
+  global-config:
+    #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+    id-type: 0
+    #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+    field-strategy: 2
+    db-column-underline: true
+    refresh-mapper:
+#################插入和更新非null判断
+    db-config:
+      insert-strategy: not_null
+      update-strategy: not_null
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+mybatis:
+  type-aliases-package: com.management.platform.entity
+  mapper-locations: mappers/*Mapper.xml
+######mybstis配置#######

+ 173 - 0
fhKeeper/formulahousekeeper/pom.xml

@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.hssx.parent</groupId>
+    <artifactId>formulahousekeeper</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.11.RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <modules>
+        <module>management-platform</module>
+    </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <poi.version>3.17</poi.version>
+        <freemarker.version>2.3.23</freemarker.version>
+        <commons.fileupload.version>1.3.3</commons.fileupload.version>
+        <mysql.version>8.0.18</mysql.version>
+        <pageHelper.starter.version>1.2.12</pageHelper.starter.version>
+        <mybatis.plus.boot.starter.version>3.1.2</mybatis.plus.boot.starter.version>
+        <mybatis.plus.generator.version>3.1.2</mybatis.plus.generator.version>
+        <velocity.engine.core.version>2.0</velocity.engine.core.version>
+        <fastjson.version>1.2.7</fastjson.version>
+        <commons.lang3.version>3.8.1</commons.lang3.version>
+        <poi.ooxml.version>3.17</poi.ooxml.version>
+        <commons.net.version>3.6</commons.net.version>
+        <lombok.version>1.18.8</lombok.version>
+        <fastjson.version>1.2.7</fastjson.version>
+    </properties>
+    <!--统一管理依赖-->
+    <dependencyManagement>
+        <dependencies>
+            <!-- mysql驱动 -->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-test</artifactId>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-devtools</artifactId>
+                <scope>runtime</scope>
+                <optional>true</optional>
+            </dependency>
+
+            <!-- pagehelper整合mybatis-plus-->
+            <!--Pagehelper 依赖 5.1.10 版本,需要去掉 mybatis 依赖,否则会和 mybatis plus 冲突-->
+            <dependency>
+                <groupId>com.github.pagehelper</groupId>
+                <artifactId>pagehelper-spring-boot-starter</artifactId>
+                <version>${pageHelper.starter.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.mybatis</groupId>
+                        <artifactId>mybatis</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.mybatis</groupId>
+                        <artifactId>mybatis-spring</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+            <!-- mybatis-plus依赖 -->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-boot-starter</artifactId>
+                <version>${mybatis.plus.boot.starter.version}</version>
+            </dependency>
+            <!-- mybatis-plus代码生成器依赖 -->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-generator</artifactId>
+                <version>${mybatis.plus.generator.version}</version>
+            </dependency>
+
+            <!-- velocity模板引擎 -->
+            <dependency>
+                <groupId>org.apache.velocity</groupId>
+                <artifactId>velocity-engine-core</artifactId>
+                <version>${velocity.engine.core.version}</version>
+            </dependency>
+
+            <!-- freemarker 模板引擎-->
+            <dependency>
+                <groupId>org.freemarker</groupId>
+                <artifactId>freemarker</artifactId>
+                <version>${freemarker.version}</version>
+            </dependency>
+
+            <!-- 文件上传 -->
+            <dependency>
+                <groupId>commons-fileupload</groupId>
+                <artifactId>commons-fileupload</artifactId>
+                <version>${commons.fileupload.version}</version>
+            </dependency>
+
+            <!-- fastjson -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+
+            <!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
+            <dependency>
+                <groupId>commons-net</groupId>
+                <artifactId>commons-net</artifactId>
+                <version>${commons.net.version}</version>
+            </dependency>
+
+            <!--读取excel文件-->
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi-ooxml</artifactId>
+                <version>${poi.ooxml.version}</version>
+            </dependency>
+
+            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${commons.lang3.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+            </dependency>
+
+            <!-- fastjson -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>