瀏覽代碼

Merge remote-tracking branch 'origin/V0.1.0' into V0.1.0

jingyuanchao 1 年之前
父節點
當前提交
6877708828

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java

@@ -873,7 +873,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
     private Map<String, Object> getFtlEdu(CoreEduTrainingTaskDetailVo task) {
         Map<String, Object> data = new HashMap<>();
         String startTime = DateUtil.format(task.getTrainingStartDateTime(), "yyyy年MM月dd日HH时mm分");
-        String endTime = DateUtil.format(task.getTrainingEndDateTime(), "yyyy年MM月dd日HH时mm分");
+        String endTime = DateUtil.format(task.getTrainingEndDateTime(), "HH时mm分");
         String address = task.getOrgName();
         String site = task.getSite();
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();

+ 5 - 4
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -184,18 +184,19 @@ public class PdfUtil {
 
     public static void dealEduBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
         //第一行
-        createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
-        createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 2, 1);
+
         createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 2, 1);
+        createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("site").toString(), Element.ALIGN_MIDDLE, 2, 1);
         //第二行
         createPDFCell(tableFont, table, "主持人", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_MIDDLE, 2, 1);
         createPDFCell(tableFont, table, "记录人", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
 
-        createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
-        createPDFCell(tableFont, table, data.get("site").toString(), Element.ALIGN_LEFT, 5, 1);
+        createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 5, 1);
 
         //内容
         createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 1);

+ 2 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/ExportSqlController.java

@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
@@ -39,7 +40,7 @@ public class ExportSqlController {
     }
 
     @GetMapping("/tables")
-    public void exportDataBase(HttpServletResponse response, List<String> tableNames){
+    public void exportDataBase(HttpServletResponse response,@RequestParam List<String> tableNames){
         try {
             exportSqlService.exportTables(response,tableNames);
         } catch (Exception e) {

+ 8 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ExportDatabaseUtil.java

@@ -36,6 +36,8 @@ public class ExportDatabaseUtil {
 
             //写入table
             writeTable(tables,stmt,rs,bw);
+            bw.flush();
+            bw.close();
             // 关闭资源
             fw.close();
 
@@ -89,6 +91,8 @@ public class ExportDatabaseUtil {
 
             //写入table
             writeTable(tables,stmt,rs,bw,tableName);
+            bw.flush();
+            bw.close();
             // 关闭资源
             fw.close();
 
@@ -133,14 +137,16 @@ public class ExportDatabaseUtil {
             stmt = conn.createStatement();
 
             // 获取数据库表名
-            List<String> tables = getTables(stmt,rs);
+//            List<String> tables = getTables(stmt,rs);
 
 
             FileWriter fw = new FileWriter(file, false);
             BufferedWriter bw = new BufferedWriter(fw);
 
             //写入table
-            writeTable(tables,stmt,rs,bw,tableNames);
+            writeTable(tableNames,stmt,rs,bw,tableNames);
+            bw.flush();
+            bw.close();
             // 关闭资源
             fw.close();