Browse Source

添加导入excel表

liu 3 years ago
parent
commit
7aadd6d46e
36 changed files with 256 additions and 107 deletions
  1. 41 28
      .idea/workspace.xml
  2. 13 0
      pom.xml
  3. 22 0
      src/main/java/com/video/api/ExcelControllerAPI.java
  4. 15 1
      src/main/java/com/video/api/LogInfoControllerAPI.java
  5. 0 19
      src/main/java/com/video/config/AppConfig.java
  6. 90 0
      src/main/java/com/video/controller/ExcelController.java
  7. 0 5
      src/main/java/com/video/controller/LogInfoController.java
  8. 6 4
      src/main/java/com/video/model/pojo/SystemAuthority.java
  9. 6 4
      src/main/java/com/video/model/pojo/SystemRole.java
  10. 10 5
      src/main/java/com/video/model/pojo/SystemUser.java
  11. 6 4
      src/main/java/com/video/model/pojo/Video.java
  12. 6 4
      src/main/java/com/video/model/pojo/VideoCategory.java
  13. 6 4
      src/main/java/com/video/model/pojo/VideoElse.java
  14. 6 4
      src/main/java/com/video/model/pojo/VideoPlay.java
  15. 6 4
      src/main/java/com/video/model/pojo/VideoShare.java
  16. 4 4
      src/main/resources/application-dev.yml
  17. 4 4
      target/classes/application-dev.yml
  18. BIN
      target/classes/com/video/api/ExcelControllerAPI.class
  19. BIN
      target/classes/com/video/api/LogInfoControllerAPI.class
  20. BIN
      target/classes/com/video/controller/ExcelController.class
  21. BIN
      target/classes/com/video/controller/LogInfoController.class
  22. BIN
      target/classes/com/video/model/pojo/SystemAuthority.class
  23. BIN
      target/classes/com/video/model/pojo/SystemRole.class
  24. BIN
      target/classes/com/video/model/pojo/SystemUser.class
  25. BIN
      target/classes/com/video/model/pojo/Video.class
  26. BIN
      target/classes/com/video/model/pojo/VideoCategory.class
  27. BIN
      target/classes/com/video/model/pojo/VideoElse.class
  28. BIN
      target/classes/com/video/model/pojo/VideoPlay.class
  29. BIN
      target/classes/com/video/model/pojo/VideoShare.class
  30. 2 0
      target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  31. BIN
      target/mybatis_plus-0.0.1-SNAPSHOT.jar
  32. BIN
      target/mybatis_plus-0.0.1-SNAPSHOT.jar.original
  33. 6 6
      target/surefire-reports/TEST-com.video.MybatisPlusApplicationTests.xml
  34. 5 5
      target/surefire-reports/TEST-com.video.WrapperTest.xml
  35. 1 1
      target/surefire-reports/com.video.MybatisPlusApplicationTests.txt
  36. 1 1
      target/surefire-reports/com.video.WrapperTest.txt

+ 41 - 28
.idea/workspace.xml

@@ -5,41 +5,40 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="90566509-127d-40b8-8de7-4bc2f087628c" name="Changes" comment="">
-      <change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/video/api/VideoElseControllerAPI.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/video/config/AppConfig.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/video/model/vo/VideoVo.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/main/java/common/utils/AesUtils.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/video/api/ExcelControllerAPI.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/video/controller/ExcelController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/AutoCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/AutoCode.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/api/VideoControllerAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/api/VideoControllerAPI.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/controller/SendController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/controller/SendController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/controller/VideoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/controller/VideoController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/api/LogInfoControllerAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/api/LogInfoControllerAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/config/AppConfig.java" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/controller/LogInfoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/controller/LogInfoController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemAuthority.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemAuthority.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemRole.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemRole.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemUser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/SystemUser.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/Video.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/Video.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/services/VideoService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/services/VideoService.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/services/impl/SmsCodeServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/services/impl/SmsCodeServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/services/impl/SystemUserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/services/impl/SystemUserServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/services/impl/VideoServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/services/impl/VideoServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/common/utils/JWTUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/common/utils/JWTUtil.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/common/utils/RSAUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/common/utils/RSAUtils.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/AutoCode.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/AutoCode.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/api/VideoControllerAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/api/VideoControllerAPI.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/controller/SendController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/controller/SendController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/controller/VideoController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/controller/VideoController.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoCategory.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoCategory.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoElse.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoElse.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoPlay.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoPlay.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoShare.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/video/model/pojo/VideoShare.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application-dev.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application-dev.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application-dev.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/api/LogInfoControllerAPI.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/api/LogInfoControllerAPI.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/controller/LogInfoController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/controller/LogInfoController.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemAuthority.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemAuthority.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemRole.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemRole.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemUser.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/SystemUser.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/Video.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/Video.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/services/VideoService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/services/VideoService.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/services/impl/SmsCodeServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/services/impl/SmsCodeServiceImpl.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/services/impl/SystemUserServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/services/impl/SystemUserServiceImpl.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/video/services/impl/VideoServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/services/impl/VideoServiceImpl.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/common/utils/JWTUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/common/utils/JWTUtil.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/common/utils/RSAUtils.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/common/utils/RSAUtils.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoCategory.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoCategory.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoElse.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoElse.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoPlay.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoPlay.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoShare.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/video/model/pojo/VideoShare.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/surefire-reports/TEST-com.video.MybatisPlusApplicationTests.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/TEST-com.video.MybatisPlusApplicationTests.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/surefire-reports/TEST-com.video.WrapperTest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/TEST-com.video.WrapperTest.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/surefire-reports/com.video.MybatisPlusApplicationTests.txt" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/com.video.MybatisPlusApplicationTests.txt" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/surefire-reports/com.video.WrapperTest.txt" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/com.video.WrapperTest.txt" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -69,6 +68,9 @@
       </MavenGeneralSettings>
     </option>
   </component>
+  <component name="ProblemsViewState">
+    <option name="selectedTabId" value="CurrentFile" />
+  </component>
   <component name="ProjectId" id="2OtsTChuio6h2p1qCUdiYu4lhN2" />
   <component name="ProjectViewState">
     <option name="showExcludedFiles" value="false" />
@@ -88,7 +90,8 @@
     "node.js.detected.package.tslint": "true",
     "node.js.selected.package.eslint": "(autodetect)",
     "node.js.selected.package.tslint": "(autodetect)",
-    "settings.editor.selected.configurable": "MavenSettings"
+    "settings.editor.selected.configurable": "MavenSettings",
+    "spring.configuration.checksum": "64bf9ba214eb006c40cb35e0f61a7d20"
   }
 }]]></component>
   <component name="RecentsManager">
@@ -137,12 +140,21 @@
       </method>
     </configuration>
     <configuration name="MybatisPlusApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
+      <option name="ACTIVE_PROFILES" />
+      <option name="ALTERNATIVE_JRE_PATH" value="1.8" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
       <module name="mybatis_plus" />
       <option name="SPRING_BOOT_MAIN_CLASS" value="com.video.MybatisPlusApplication" />
       <method v="2">
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <list>
+      <item itemvalue="Application.AesUtils" />
+      <item itemvalue="Application.AutoCode" />
+      <item itemvalue="Application.RSAUtils" />
+      <item itemvalue="Spring Boot.MybatisPlusApplication" />
+    </list>
     <recent_temporary>
       <list>
         <item itemvalue="Application.AutoCode" />
@@ -163,7 +175,8 @@
       <option name="presentableId" value="Default" />
       <updated>1682391219371</updated>
       <workItem from="1682391221559" duration="58000" />
-      <workItem from="1682391287410" duration="13293000" />
+      <workItem from="1682391287410" duration="23732000" />
+      <workItem from="1682478535580" duration="3687000" />
     </task>
     <servers />
   </component>

+ 13 - 0
pom.xml

@@ -21,6 +21,19 @@
 
     <dependencies>
 
+        <!--   读取excel数据     -->
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+
+
         <!-- fastjson -->
         <dependency>
             <groupId>com.alibaba</groupId>

+ 22 - 0
src/main/java/com/video/api/ExcelControllerAPI.java

@@ -0,0 +1,22 @@
+package com.video.api;
+
+import com.video.annotation.PassToken;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.io.File;
+
+@Api(tags = {"ExcelController"}, value = "导入excel表")
+@RequestMapping("/api/excel")
+public interface ExcelControllerAPI {
+
+    @PostMapping("/toExcel")
+    @ApiOperation(value = "导入excel表更新用户",httpMethod = "POST")
+    @PassToken
+    void toExcel(String fileUrl);
+
+}

+ 15 - 1
src/main/java/com/video/api/LogInfoControllerAPI.java

@@ -1,8 +1,22 @@
 package com.video.api;
 
+import com.video.annotation.PassToken;
 import com.video.model.utils.CommonResult;
-
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+@Api(tags = {"LogInfoController"}, value = "登入接口")
+@RequestMapping("/api/logInfo")
 public interface LogInfoControllerAPI {
+
+    @GetMapping("/verify")
+    @ApiOperation(value = "验证手机号phone",httpMethod = "GET")
     CommonResult verifyPhone(String phone);
+
+
+    @PostMapping("/logIn")
+    @ApiOperation(value = "短信验证",httpMethod = "POST")
     CommonResult logInfo(String phone,String code);
 }

+ 0 - 19
src/main/java/com/video/config/AppConfig.java

@@ -1,19 +0,0 @@
-//package com.video.config;
-//
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.web.servlet.config.annotation.CorsRegistry;
-//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-//
-//@Configuration
-//@SuppressWarnings("SpringJavaAutowiredFieldsWarningInspection")
-//public class AppConfig implements WebMvcConfigurer {
-//
-//    @Override
-//    public void addCorsMappings(CorsRegistry registry) {
-//        registry.addMapping("/**")  // 拦截所有的请求
-//                .allowedOrigins("139.199.2.142:3306:8081")  // 可跨域的域名,可以为 *
-//                .allowCredentials(true)
-//                .allowedMethods("*")   // 允许跨域的方法,可以单独配置
-//                .allowedHeaders("*");  // 允许跨域的请求头,可以单独配置
-//    }
-//}

+ 90 - 0
src/main/java/com/video/controller/ExcelController.java

@@ -0,0 +1,90 @@
+package com.video.controller;
+
+import com.video.annotation.PassToken;
+import com.video.api.ExcelControllerAPI;
+import com.video.model.pojo.SystemUser;
+import com.video.services.SystemUserService;
+import org.apache.poi.ss.usermodel.DataFormatter;
+import org.apache.poi.xssf.usermodel.XSSFCell;
+import org.apache.poi.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+@RestController
+public class ExcelController implements ExcelControllerAPI {
+    @Autowired
+    SystemUserService systemUserService;
+
+    /**
+     * .xlsx格式
+     * @param
+     */
+    @Override
+    @PassToken
+    public void toExcel(String fileUrl) {
+        //创建工作簿对象
+        XSSFWorkbook xssfWorkbook = null;
+        try {
+            xssfWorkbook = new XSSFWorkbook(new FileInputStream(fileUrl));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        //获取工作簿下sheet的个数
+        int sheetNum = xssfWorkbook.getNumberOfSheets();
+        //遍历工作簿中的所有数据
+        for (int i = 0; i < sheetNum; i++) {
+            //读取第i个工作表
+            System.out.println("读取第"+(i+1)+"个sheet");
+            XSSFSheet sheet = xssfWorkbook.getSheetAt(i);
+            //获取最后一行的num,即总行数。此处从0开始
+            int maxRow = sheet.getLastRowNum();
+//            从第二行开始获取数据
+            for (int row = 1; row <= maxRow; row++) {
+                //获取最后单元格num,即总单元格数 ***注意:此处从1开始计数***
+                int maxRol = sheet.getRow(row).getLastCellNum();
+                System.out.println("--------第" + row + "行的数据如下--------");
+//                for (int rol = 0; rol < maxRol; rol++){
+//                    System.out.print(sheet.getRow(row).getCell(rol) + "  ");
+//                }
+                DataFormatter dataFormatter = new DataFormatter();
+//                获取手机号
+                XSSFCell cell = sheet.getRow(row).getCell(3);
+//                获取的手机号格式有问题需要转换
+                dataFormatter.addFormat("###########",null);
+                String phone = dataFormatter.formatCellValue(cell);
+//                获取名字
+                String name = sheet.getRow(row).getCell(1).toString();
+//                获取备注
+                String remarks = sheet.getRow(row).getCell(4).toString();
+//                获取性别
+                String genderName = sheet.getRow(row).getCell(2).toString();
+                int gender;
+                if ("女".equals(genderName)) {
+                    gender=1;
+                }else {
+                    gender=2;
+                }
+
+                SystemUser systemUser = new SystemUser();
+                systemUser.setRoleId(Long.valueOf(row));
+                systemUser.setAccountName(name);
+                systemUser.setAccountNumber(row+"");
+                systemUser.setAccountPassword("123456");
+                systemUser.setPhoneNumber(phone);
+                systemUser.setEmail("123456@123456");
+                systemUser.setRemarks(remarks);
+                systemUser.setGender(gender);
+                systemUser.setDeleted(0L);
+                systemUser.setWechatId("123456789");
+
+                systemUserService.save(systemUser);
+
+            }
+        }
+    }
+}

+ 0 - 5
src/main/java/com/video/controller/LogInfoController.java

@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
 @RestController
-@RequestMapping("/api/logInfo")
 public class LogInfoController implements LogInfoControllerAPI {
 
 
@@ -26,16 +25,12 @@ public class LogInfoController implements LogInfoControllerAPI {
 
     @Override
     @PassToken
-    @GetMapping("/verify")
-    @ApiOperation(value = "验证手机号phone",httpMethod = "GET")
     public CommonResult verifyPhone(@RequestParam String phone) {
         return systemUserService.verifyPhone(phone);
     }
 
     @Override
     @PassToken
-    @PostMapping("/logIn")
-    @ApiOperation(value = "短信验证",httpMethod = "POST")
     public CommonResult logInfo(String phone, String code) {
         return smsCodeService.logIn(phone,code);
     }

+ 6 - 4
src/main/java/com/video/model/pojo/SystemAuthority.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -50,15 +48,19 @@ public class SystemAuthority implements Serializable {
     @ApiModelProperty(value = "是否查看 0 未拥有该权限 1 拥有该权限")
     private String isRead;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 6 - 4
src/main/java/com/video/model/pojo/SystemRole.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -35,15 +33,19 @@ public class SystemRole implements Serializable {
     @ApiModelProperty(value = "角色名称")
     private String roleName;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 10 - 5
src/main/java/com/video/model/pojo/SystemUser.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -50,19 +48,26 @@ public class SystemUser implements Serializable {
     @ApiModelProperty(value = "邮箱账号")
     private String email;
 
+    @ApiModelProperty(value = "微信号id")
+    private String wechatId;
+
     @ApiModelProperty(value = "备注")
     private String remarks;
 
     @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
     private Date createTime;
 
     @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     private Date updateTime;
 
     @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
     private Long createUser;
 
     @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     private Long updateUser;
 
     @ApiModelProperty(value = "逻辑删除标记")
@@ -70,5 +75,5 @@ public class SystemUser implements Serializable {
     private Long deleted;
 
     @ApiModelProperty(value = "性别")
-    private char gender;
+    private Integer gender;
 }

+ 6 - 4
src/main/java/com/video/model/pojo/Video.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -47,15 +45,19 @@ public class Video implements Serializable {
     @ApiModelProperty(value = "视频时长")
     private Long videoDuration;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 6 - 4
src/main/java/com/video/model/pojo/VideoCategory.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -38,15 +36,19 @@ public class VideoCategory implements Serializable {
     @ApiModelProperty(value = "备注")
     private String remarks;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 6 - 4
src/main/java/com/video/model/pojo/VideoElse.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -41,15 +39,19 @@ public class VideoElse implements Serializable {
     @ApiModelProperty(value = "文件下载名称")
     private String videoElesName;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 6 - 4
src/main/java/com/video/model/pojo/VideoPlay.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -41,15 +39,19 @@ public class VideoPlay implements Serializable {
     @ApiModelProperty(value = "播放设备码")
     private String deviceCode;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 6 - 4
src/main/java/com/video/model/pojo/VideoShare.java

@@ -1,10 +1,8 @@
 package com.video.model.pojo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.util.Date;
-import com.baomidou.mybatisplus.annotation.Version;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -41,15 +39,19 @@ public class VideoShare implements Serializable {
     @ApiModelProperty(value = "视频分享链接")
     private String videoShareUrl;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 
+    @TableField(fill = FieldFill.INSERT)
     @ApiModelProperty(value = "创建人员")
     private Long createUser;
 
+    @TableField(fill = FieldFill.INSERT_UPDATE)
     @ApiModelProperty(value = "更新人员")
     private Long updateUser;
 

+ 4 - 4
src/main/resources/application-dev.yml

@@ -9,10 +9,10 @@ spring:
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   datasource:
     username: root
-  #  password: root
-    password: chuanghai_2023.
-  #  url: jdbc:mysql://localhost:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    password: root
+    #password: chuanghai_2023.
+    url: jdbc:mysql://localhost:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+   # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     driver-class-name: com.mysql.cj.jdbc.Driver
     cache:
       type: redis

+ 4 - 4
target/classes/application-dev.yml

@@ -9,10 +9,10 @@ spring:
   #\u6570\u636E\u5E93\u914D\u7F6E\u94FE\u63A5
   datasource:
     username: root
-  #  password: root
-    password: chuanghai_2023.
-  #  url: jdbc:mysql://localhost:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-    url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+    password: root
+    #password: chuanghai_2023.
+    url: jdbc:mysql://localhost:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+   # url: jdbc:mysql://139.199.2.142:3306/share_videos?characterEncoding=UTF-8&share_videosuseSSL=false&useUnicode=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
     driver-class-name: com.mysql.cj.jdbc.Driver
     cache:
       type: redis

BIN
target/classes/com/video/api/ExcelControllerAPI.class


BIN
target/classes/com/video/api/LogInfoControllerAPI.class


BIN
target/classes/com/video/controller/ExcelController.class


BIN
target/classes/com/video/controller/LogInfoController.class


BIN
target/classes/com/video/model/pojo/SystemAuthority.class


BIN
target/classes/com/video/model/pojo/SystemRole.class


BIN
target/classes/com/video/model/pojo/SystemUser.class


BIN
target/classes/com/video/model/pojo/Video.class


BIN
target/classes/com/video/model/pojo/VideoCategory.class


BIN
target/classes/com/video/model/pojo/VideoElse.class


BIN
target/classes/com/video/model/pojo/VideoPlay.class


BIN
target/classes/com/video/model/pojo/VideoShare.class


+ 2 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -39,6 +39,7 @@ common\exception\EmsException.class
 common\utils\JWTUtil.class
 common\exception\EmsExceptionHandler.class
 com\video\mapper\VideoCategoryMapper.class
+com\video\api\ExcelControllerAPI.class
 com\video\services\impl\SystemMenuServiceImpl.class
 com\video\annotation\ControllerIsShow.class
 com\video\model\vo\VideoVo.class
@@ -98,6 +99,7 @@ com\video\core\JwtAuthenticationInterceptor.class
 com\video\api\SendControllerAPI.class
 common\utils\ValidateCode.class
 com\video\services\VideoPlayService.class
+com\video\controller\ExcelController.class
 com\video\annotation\PassToken.class
 com\video\services\VideoElseService.class
 common\utils\CommonUtil.class

BIN
target/mybatis_plus-0.0.1-SNAPSHOT.jar


BIN
target/mybatis_plus-0.0.1-SNAPSHOT.jar.original


File diff suppressed because it is too large
+ 6 - 6
target/surefire-reports/TEST-com.video.MybatisPlusApplicationTests.xml


File diff suppressed because it is too large
+ 5 - 5
target/surefire-reports/TEST-com.video.WrapperTest.xml


+ 1 - 1
target/surefire-reports/com.video.MybatisPlusApplicationTests.txt

@@ -1,4 +1,4 @@
 -------------------------------------------------------------------------------
 Test set: com.video.MybatisPlusApplicationTests
 -------------------------------------------------------------------------------
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.089 s - in com.video.MybatisPlusApplicationTests
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.125 s - in com.video.MybatisPlusApplicationTests

+ 1 - 1
target/surefire-reports/com.video.WrapperTest.txt

@@ -1,4 +1,4 @@
 -------------------------------------------------------------------------------
 Test set: com.video.WrapperTest
 -------------------------------------------------------------------------------
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.video.WrapperTest
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.video.WrapperTest