|
@@ -1,12 +1,10 @@
|
|
|
package org.jeecg.modules.appInterface.controller;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.sql.Connection;
|
|
|
import java.sql.DriverManager;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.io.IOException;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
@@ -17,6 +15,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
+import org.jeecg.modules.appInterface.FileList;
|
|
|
import org.jeecg.modules.appInterface.ResHttpStatus;
|
|
|
import org.jeecg.modules.appInterface.entity.FbsWorkingStatistics;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -36,6 +35,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -61,7 +61,12 @@ public class FbsWorkingStatisticsController {
|
|
|
private IFbsWorkshopDispatchListService fbsWorkshopDispatchListService;
|
|
|
@Autowired
|
|
|
private IFbsPersonService fbsPersonService;
|
|
|
- public static void main(String[] srg) {
|
|
|
+ @Value("${jeecg.path.upload}")
|
|
|
+ private String upLoadPath;
|
|
|
+ @Value("${jeecg.path.upvedio}")
|
|
|
+ private String upVedio;
|
|
|
+
|
|
|
+ public static void main1(String[] srg) {
|
|
|
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
|
|
//加载JDBC驱动
|
|
|
String dbURL = "jdbc:sqlserver://103.40.192.17:43110;DatabaseName=UFDATA_006_2019";
|
|
@@ -500,4 +505,78 @@ public class FbsWorkingStatisticsController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+ @RequestMapping(value = "getEsopFileList")
|
|
|
+ public Result<List<Map<String,Object>>> getEsopFileList(){
|
|
|
+ Result<List<Map<String,Object>>> result=new Result<>();
|
|
|
+ ArrayList<String> list = new ArrayList<>();
|
|
|
+ FileList.getAllFileName(upLoadPath,list);
|
|
|
+ List<Map<String,Object>> resuleMap = new ArrayList<>();
|
|
|
+ try {
|
|
|
+
|
|
|
+ for (String o:list){
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("fileName",o);
|
|
|
+ map.put("fileType",getFileOf(o).toLowerCase());
|
|
|
+ resuleMap.add(map);
|
|
|
+ }
|
|
|
+ result.setResult(resuleMap);
|
|
|
+ result.success("操作成功");
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.error500("操作失败:"+e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "getVedioFileList")
|
|
|
+ public Result<List<Map<String,Object>>> getVedioFileList(){
|
|
|
+ Result<List<Map<String,Object>>> result=new Result<>();
|
|
|
+ ArrayList<String> list = new ArrayList<>();
|
|
|
+ FileList.getAllFileName(upVedio,list);
|
|
|
+ List<Map<String,Object>> resuleMap = new ArrayList<>();
|
|
|
+ try {
|
|
|
+
|
|
|
+ for (String o:list){
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("fileName",o);
|
|
|
+ map.put("fileType",getFileOf(o).toLowerCase());
|
|
|
+ resuleMap.add(map);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ result.setResult(resuleMap);
|
|
|
+ result.success("操作成功");
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.error500("操作失败:"+e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取文件后缀名
|
|
|
+ * @param fileName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getFileOf(String fileName) {
|
|
|
+
|
|
|
+ String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
|
+ return suffix;
|
|
|
+ }
|
|
|
+
|
|
|
+// public static void main(String[] args) {
|
|
|
+// File file = new File("HelloWorld.java");
|
|
|
+// String fileName = file.getName();
|
|
|
+// System.out.println(fileName.lastIndexOf(".") + 1);
|
|
|
+// System.out.println("======================");
|
|
|
+// System.out.println(fileName.lastIndexOf("."));
|
|
|
+// System.out.println("======================");
|
|
|
+// String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
|
+// System.out.println(suffix);
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|