ソースを参照

合同相关时间

lamphua 10ヶ月前
コミット
72aea784a8

+ 0
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcContractCommentController.java ファイルの表示

@@ -86,8 +86,6 @@ public class CmcContractCommentController extends BaseController
86 86
     @PutMapping
87 87
     public AjaxResult edit(@RequestBody CmcContractComment cmcContractComment)
88 88
     {
89
-        if (Objects.equals(cmcContractComment.getUserId(), getLoginUser().getUserId()))
90
-            cmcContractComment.setCommentTime(new Date());
91 89
         return toAjax(cmcContractCommentService.updateCmcContractComment(cmcContractComment));
92 90
     }
93 91
 

+ 0
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcContractController.java ファイルの表示

@@ -91,11 +91,9 @@ public class CmcContractController extends BaseController
91 91
     {
92 92
         if (cmcContract.getManagerComment() != null && cmcContract.getGmComment() == null) {
93 93
             cmcContract.setManagerUserId(getLoginUser().getUserId());
94
-            cmcContract.setManagerTime(new Date());
95 94
         }
96 95
         if (cmcContract.getGmComment() != null && cmcContract.getSignDate() == null) {
97 96
             cmcContract.setGmUserId(getLoginUser().getUserId());
98
-            cmcContract.setGmTime(new Date());
99 97
         }
100 98
         return toAjax(cmcContractService.updateCmcContract(cmcContract));
101 99
     }

+ 0
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSubContractController.java ファイルの表示

@@ -92,11 +92,9 @@ public class CmcSubContractController extends BaseController
92 92
     {
93 93
         if (cmcSubContract.getManagerComment() != null && cmcSubContract.getGmComment() == null) {
94 94
             cmcSubContract.setManagerUserId(getLoginUser().getUserId());
95
-            cmcSubContract.setManagerTime(new Date());
96 95
         }
97 96
         if (cmcSubContract.getGmComment() != null && cmcSubContract.getSignDate() == null) {
98 97
             cmcSubContract.setGmUserId(getLoginUser().getUserId());
99
-            cmcSubContract.setGmTime(new Date());
100 98
         }
101 99
         return toAjax(cmcSubContractService.updateCmcSubContract(cmcSubContract));
102 100
     }

+ 23
- 0
oa-back/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java ファイルの表示

@@ -3,6 +3,10 @@ package com.ruoyi.quartz.task;
3 3
 import org.springframework.stereotype.Component;
4 4
 import com.ruoyi.common.utils.StringUtils;
5 5
 
6
+import java.io.File;
7
+import java.text.SimpleDateFormat;
8
+import java.util.Date;
9
+
6 10
 /**
7 11
  * 定时任务调度测试
8 12
  * 
@@ -25,4 +29,23 @@ public class RyTask
25 29
     {
26 30
         System.out.println("执行无参方法");
27 31
     }
32
+
33
+    public void linuxDump(String dir, String username, String password, String databaseName) throws Exception {
34
+        File file = new File(dir);
35
+        if (!file.exists()) {
36
+            file.mkdir();
37
+        }
38
+        String sqlName = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
39
+        File datafile = new File(file + File.separator + sqlName + ".sql");
40
+        if (datafile.exists()) {
41
+            System.out.println(sqlName + "文件名已存在,请更换");
42
+            return;
43
+        }
44
+        //拼接cmd命令  windows下 cmd   Linux下 /bin/sh
45
+        Process exec = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "/usr/bin/mysqldump -u " + username + " -p" + password + " " + databaseName + " > " + datafile});
46
+        if (exec.waitFor() == 0) {
47
+            System.out.println("数据库备份成功,备份路径为:" + datafile);
48
+        }
49
+    }
50
+
28 51
 }

読み込み中…
キャンセル
保存