|
@@ -1,17 +1,27 @@
|
|
|
package com.management.platform.controller;
|
|
|
|
|
|
+import com.management.platform.entity.Company;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
+import fr.opensagres.poi.xwpf.converter.pdf.PdfConverter;
|
|
|
+import fr.opensagres.poi.xwpf.converter.pdf.PdfOptions;
|
|
|
+import fr.opensagres.xdocreport.document.IXDocReport;
|
|
|
+import fr.opensagres.xdocreport.document.registry.XDocReportRegistry;
|
|
|
+import fr.opensagres.xdocreport.template.IContext;
|
|
|
+import fr.opensagres.xdocreport.template.TemplateEngineKind;
|
|
|
import org.apache.log4j.LogManager;
|
|
|
import org.apache.log4j.Logger;
|
|
|
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileOutputStream;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.OutputStream;
|
|
|
+import java.io.*;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.nio.channels.FileChannel;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
@RestController
|
|
@@ -57,4 +67,28 @@ public class CommonUploadController {
|
|
|
|
|
|
return msg;
|
|
|
}
|
|
|
+ @RequestMapping("/downLoadLog")
|
|
|
+ public HttpRespMsg downLoadLog() throws IOException {
|
|
|
+ HttpRespMsg httpRespMsg=new HttpRespMsg();
|
|
|
+ FileChannel sourceChannel = null;
|
|
|
+ FileChannel destChannel = null;
|
|
|
+ try {
|
|
|
+ File file=new File("/www/worktime/server/");
|
|
|
+ if(!file.exists()){
|
|
|
+ file.mkdirs();
|
|
|
+ }
|
|
|
+ sourceChannel = new FileInputStream("/www/worktime/server/wt_print.log").getChannel();
|
|
|
+ destChannel = new FileOutputStream(path+"wt_print.log").getChannel();
|
|
|
+ destChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally{
|
|
|
+ sourceChannel.close();
|
|
|
+ destChannel.close();
|
|
|
+ }
|
|
|
+ httpRespMsg.data="/upload/"+"wt_print.log";
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
}
|