Browse Source

修改操作界面

master
VIVIMAN 3 years ago
parent
commit
239b3c9b02
  1. BIN
      lib/Dm7-18-Jdbc.jar
  2. BIN
      lib/kingbase8-8.6.0.jar
  3. BIN
      lib/oscarJDBC16.jar
  4. 37
      pom.xml
  5. 17
      src/main/java/com/insigma/HyToolApplication.java
  6. 14
      src/main/java/com/insigma/config/AppCfg.java
  7. 1
      src/main/java/com/insigma/entry/IndexObj.java
  8. 16
      src/main/java/com/insigma/entry/TabColObj.java
  9. 3
      src/main/java/com/insigma/service/Database.java
  10. 92
      src/main/java/com/insigma/service/impl/WindowsTomcatMysql.java
  11. 277
      src/main/java/com/insigma/ui/SwingFrame.java
  12. 44
      src/main/java/com/insigma/utils/DbUtil.java
  13. 78
      src/main/java/com/insigma/utils/FileUtil.java
  14. 71
      src/main/java/com/insigma/utils/LinuxCommandUtil.java
  15. 12
      src/main/java/com/insigma/utils/RegisterUtil.java
  16. 8
      src/main/java/com/insigma/utils/WinCommandUtil.java
  17. 69
      src/main/java/com/insigma/utils/ZipUtil.java
  18. 3
      src/main/resources/application-dev.yml
  19. 9
      src/main/resources/application.properties

BIN
lib/Dm7-18-Jdbc.jar

Binary file not shown.

BIN
lib/kingbase8-8.6.0.jar

Binary file not shown.

BIN
lib/oscarJDBC16.jar

Binary file not shown.

37
pom.xml

@ -144,6 +144,43 @@
<version>1.6.5.132</version>
</dependency>
<!-- 数据源 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.44</version>
</dependency>
<dependency>
<groupId>kingbase</groupId>
<artifactId>jdbc4</artifactId>
<version>8.6.0</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/kingbase8-8.6.0.jar</systemPath>
</dependency>
<dependency>
<groupId>oscar</groupId>
<artifactId>oscarJDBC</artifactId>
<version>16</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/oscarJDBC16.jar</systemPath>
</dependency>
<dependency>
<groupId>Dm7</groupId>
<artifactId>Jdbc</artifactId>
<version>18</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/Dm7-18-Jdbc.jar</systemPath>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.1.0</version>
</dependency>
</dependencies>
<build>

17
src/main/java/com/insigma/HyToolApplication.java

@ -1,6 +1,9 @@
package com.insigma;
import cn.hutool.db.Session;
import com.insigma.config.AppCfg;
import com.insigma.demos.SwingSet2;
import com.insigma.utils.DbUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -25,12 +28,22 @@ public class HyToolApplication {
Properties loadProperties = PropertiesLoaderUtils
.loadProperties(new EncodedResource(new ClassPathResource("application.properties"), "UTF-8"));
String guiType = loadProperties.getProperty("swing.ui.type");
String url = loadProperties.getProperty("db.url");
String usr = loadProperties.getProperty("db.usr");
String pwd = loadProperties.getProperty("db.pwd");
AppCfg.DB = loadProperties.getProperty("hy.db");
AppCfg.MW = loadProperties.getProperty("hy.mw");
AppCfg.HZB = loadProperties.getProperty("hy.hzb");
AppCfg.BROWSER = loadProperties.getProperty("hy.browser");
SwingUtilities.invokeLater(() -> {
log.info("正在启动GUI =======================>>> " + guiType );
log.info("正在启动GUI =======================>>> 成功!");
SwingSet2.main(args);
});
Session session = DbUtil.getSession(url, usr, pwd);
log.info("获取{}连接,进行操作!", session);
session.close();
} catch (Exception e) {
log.error("\n\t 启动GUI异常 >>>>>>>>>>>{},{}",e.getMessage(),e);
e.printStackTrace();

14
src/main/java/com/insigma/config/AppCfg.java

@ -0,0 +1,14 @@
package com.insigma.config;
/**
* (AppConfig )
*
* @author zhangxianwei
* @since 17:21 2022/4/18
*/
public class AppCfg {
public static String BROWSER;
public static String DB;
public static String MW;
public static String HZB;
}

1
src/main/java/com/insigma/entry/IndexObj.java

@ -12,5 +12,6 @@ import lombok.Data;
public class IndexObj {
private String tab;
private String col;
private String idx;
}

16
src/main/java/com/insigma/entry/TabColObj.java

@ -0,0 +1,16 @@
package com.insigma.entry;
import lombok.Data;
/**
* (IndexObj )
*
* @author zhangxianwei
* @since 21:29 2022/4/17
*/
@Data
public class TabColObj {
private String tab;
private String col;
}

3
src/main/java/com/insigma/service/Database.java

@ -1,6 +1,7 @@
package com.insigma.service;
import com.insigma.entry.IndexObj;
import com.insigma.entry.TabColObj;
import org.springframework.util.Assert;
import java.util.List;
@ -36,7 +37,7 @@ public interface Database {
* 清除 应用 缓存
* @return
*/
default boolean cleanDbCache() {
default boolean cleanDbCache(List<String> sql, List<TabColObj> tabColObjs) {
System.out.println("进行缓存清除,但是未检测到实现应用调用此方法!");
return false;
}

92
src/main/java/com/insigma/service/impl/WindowsTomcatMysql.java

@ -1,10 +1,18 @@
package com.insigma.service.impl;
import cn.hutool.db.Session;
import com.insigma.config.AppCfg;
import com.insigma.entry.IndexObj;
import com.insigma.entry.TabColObj;
import com.insigma.service.Computer;
import com.insigma.service.*;
import com.insigma.utils.DbUtil;
import com.insigma.utils.FileUtil;
import com.insigma.utils.WinCommandUtil;
import com.insigma.utils.ZipUtil;
import lombok.extern.slf4j.Slf4j;
import java.sql.SQLException;
import java.util.List;
@ -14,6 +22,7 @@ import java.util.List;
* @author zhangxianwei
* @since 23:30 2022/4/17
*/
@Slf4j
public class WindowsTomcatMysql extends Computer implements Database, Middleware {
@Override
@ -28,26 +37,99 @@ public class WindowsTomcatMysql extends Computer implements Database, Middleware
@Override
public boolean rebuildIndex(List<IndexObj> index) {
return Database.super.rebuildIndex(index);
log.info("创建链接...");
final Session session = DbUtil.getSession(DbUtil.url, DbUtil.usr, DbUtil.pwd);
try {
for (IndexObj idx : index) {
session.execute("DROP INDEX ? ON ?", idx.getIdx(), idx.getTab());
session.execute("ALTER TABLE ? ADD INDEX ? (?) USING BTREE", idx.getTab(), idx.getIdx(), idx.getCol());
}
} catch (SQLException e) {
log.error("执行更新索引发生异常:{}", e.getMessage());
e.printStackTrace();
session.close();
return false;
}
session.close();
return true;
}
@Override
public boolean setDbSize(int size) {
log.info("停止 数据库 服务...");
runShell("sc stop " + AppCfg.DB);
log.info("设置 数据库 内存参数...");
FileUtil.replaceLine(AppCfg.HZB + "/mysql/my.ini",
"innodb_buffer_pool_size",
String.format("innodb_buffer_pool_size=%dM", size));
log.info("启动 数据库 服务...");
runShell("sc start " + AppCfg.DB);
return Database.super.setDbSize(size);
}
@Override
public boolean cleanDbCache() {
return Database.super.cleanDbCache();
public boolean cleanDbCache(List<String> sql, List<TabColObj> tabColObjs) {
log.info("创建链接...");
final Session session = DbUtil.getSession(DbUtil.url, DbUtil.usr, DbUtil.pwd);
try {
log.info("执行 预置 SQL 脚本...");
for (String s : sql) {
session.execute(s);
}
log.info("执行 清洗数据中特殊字符串 脚本...");
for (String lj : DbUtil.RUBBISH) {
for (TabColObj tab : tabColObjs) {
session.execute("update ? set ?=replace(?, '?', '') where ? is not null",
tab.getTab(), tab.getCol(), tab.getCol(), lj, tab.getCol());
}
}
} catch (SQLException e) {
log.error("执行 清洗数据中特殊字符串 发生异常:{}", e.getMessage());
e.printStackTrace();
session.close();
return false;
}
log.info("执行 清洗数据中特殊字符串 完成...");
session.close();
return true;
}
@Override
public boolean cleanMwCache() {
return Middleware.super.cleanMwCache();
log.info("停止 中间件 服务...");
runShell("sc stop " + AppCfg.MW);
log.info("退出 浏览器...");
runShell("taskkill /f /im " + AppCfg.BROWSER);
log.info("删除 浏览器 历史文件...");
FileUtil.delAllFile(AppCfg.HZB + "/360se6/User Data");
log.info("解压 新浏览器 文件...");
ZipUtil.unZip7Z(AppCfg.HZB + "/tools/User Data.zip", AppCfg.HZB + "/360se6");
log.info("删除 应用 缓存文件...");
FileUtil.delAllFile(AppCfg.HZB + "/tomcat8/temp");
FileUtil.delAllFile(AppCfg.HZB + "/tomcat8/work/Catalina/localhost/qggwy");
log.info("启动 中间件 服务...");
runShell("sc start " + AppCfg.MW);
return true;
}
@Override
public boolean setMwSize(int size) {
return Middleware.super.setMwSize(size);
log.info("停止 中间件 服务...");
runShell("sc stop " + AppCfg.MW);
log.info("启动 中间件 服务...");
runShell("sc start " + AppCfg.MW);
return true;
}
public void openServer(){
runShell("SERVICES.MSC");
log.info("打开本地服务完成!");
}
}

277
src/main/java/com/insigma/ui/SwingFrame.java

@ -1,4 +1,6 @@
package com.qggwy;
package com.insigma.ui;
import lombok.extern.slf4j.Slf4j;
import java.awt.EventQueue;
@ -34,6 +36,7 @@ import javax.swing.Timer;
import javax.swing.JTextPane;
import java.awt.Component;
@Slf4j
public class SwingFrame extends JFrame implements ActionListener {
/**
@ -57,6 +60,7 @@ public class SwingFrame extends JFrame implements ActionListener {
* Launch the application.
*/
public static void main(String[] args) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
@ -65,16 +69,17 @@ public class SwingFrame extends JFrame implements ActionListener {
}
}
}catch(Exception e) {
System.out.println(e);
log.error("启动发生异常:", e);
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
SwingFrame frame = new SwingFrame();
frame.setTitle("系统工具"); //设置显示窗口标题
// frame.setSize(1600,400);//设置显示窗口大小
// frame.getContentPane().setBackground(Color.blue);//设置显示窗体颜色
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //设置窗口是否可以关闭
frame.setTitle("系统工具"); //设置显示窗口标题
// frame.setSize(1600,400);//设置显示窗口大小
// frame.getContentPane().setBackground(Color.blue);//设置显示窗体颜色
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //设置窗口是否可以关闭
frame.setBounds(100, 100, 773, 459);
frame.setVisible(true);
java.net.URL imgURL =SwingFrame.class.getResource("favicon.jpg");
@ -106,26 +111,26 @@ public class SwingFrame extends JFrame implements ActionListener {
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
tabbedPane.setBounds(5, 5, 745, 402);
tabbedPane.setBackground(Color.WHITE);
tabbedPane.setFont(new Font("微软雅黑", Font.PLAIN, 15));
tabbedPane.setFont(new Font("微软雅黑", Font.PLAIN, 15));
contentPane.add(tabbedPane);
JPanel memoryPanel = new JPanel();//调整内存面板
JPanel memoryPanel = new JPanel();//调整内存面板
memoryPanel.setBorder(UIManager.getBorder("Button.border"));
memoryPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
memoryPanel.setForeground(Color.GRAY);
memoryPanel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("调整内存", null, memoryPanel, null);
tabbedPane.addTab("调整内存", null, memoryPanel, null);
memoryPanel.setLayout(null);
JLabel lblNewLabel = new JLabel("调整内存");
JLabel lblNewLabel = new JLabel("调整内存");
lblNewLabel.setBounds(60, 31, 125, 34);
lblNewLabel.setForeground(Color.RED);
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 30));
lblNewLabel.setFont(new Font("微软雅黑", Font.PLAIN, 30));
memoryPanel.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("根据具体系统运行可设置应用内容、数据库内容的大小。");
JLabel lblNewLabel_1 = new JLabel("根据具体系统运行可设置应用内容、数据库内容的大小。");
lblNewLabel_1.setBounds(60, 75, 375, 18);
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_1.setFont(new Font("微软雅黑", Font.PLAIN, 15));
memoryPanel.add(lblNewLabel_1);
JSeparator separator = new JSeparator();
@ -133,30 +138,30 @@ public class SwingFrame extends JFrame implements ActionListener {
separator.setBounds(60, 106, 531, 5);
memoryPanel.add(separator);
JLabel lblNewLabel_2 = new JLabel("应用内存");
JLabel lblNewLabel_2 = new JLabel("应用内存");
lblNewLabel_2.setBounds(60, 124, 80, 18);
lblNewLabel_2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
lblNewLabel_2.setFont(new Font("微软雅黑", Font.PLAIN, 20));
memoryPanel.add(lblNewLabel_2);
JLabel lblNewLabel_3 = new JLabel("非堆区初始内存分配大小");
JLabel lblNewLabel_3 = new JLabel("非堆区初始内存分配大小");
lblNewLabel_3.setBackground(new Color(221, 160, 221));
lblNewLabel_3.setBounds(82, 165, 175, 18);
lblNewLabel_3.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_3.setFont(new Font("微软雅黑", Font.PLAIN, 15));
memoryPanel.add(lblNewLabel_3);
JLabel label = new JLabel("堆区最大内存分配上限");
JLabel label = new JLabel("堆区最大内存分配上限");
label.setBounds(82, 196, 156, 18);
label.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label.setFont(new Font("微软雅黑", Font.PLAIN, 15));
memoryPanel.add(label);
JLabel label_1 = new JLabel("初始内存分配大小");
JLabel label_1 = new JLabel("初始内存分配大小");
label_1.setBounds(82, 227, 156, 18);
label_1.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_1.setFont(new Font("微软雅黑", Font.PLAIN, 15));
memoryPanel.add(label_1);
JLabel label_2 = new JLabel("最大内存分配上限");
JLabel label_2 = new JLabel("最大内存分配上限");
label_2.setBounds(82, 258, 156, 18);
label_2.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_2.setFont(new Font("微软雅黑", Font.PLAIN, 15));
memoryPanel.add(label_2);
textField = new JTextField();
@ -179,18 +184,18 @@ public class SwingFrame extends JFrame implements ActionListener {
textField_3.setColumns(10);
memoryPanel.add(textField_3);
JLabel lblNewLabel_4 = new JLabel("最大可设置到1024MB");
lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel lblNewLabel_4 = new JLabel("最大可设置到1024MB");
lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_4.setBounds(355, 166, 163, 18);
memoryPanel.add(lblNewLabel_4);
JLabel label_3 = new JLabel("数据库内存");
label_3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel label_3 = new JLabel("数据库内存");
label_3.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_3.setBounds(60, 307, 100, 24);
memoryPanel.add(label_3);
JLabel label_4 = new JLabel("数据库内存大小");
label_4.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_4 = new JLabel("数据库内存大小");
label_4.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_4.setBounds(82, 344, 156, 18);
memoryPanel.add(label_4);
@ -200,43 +205,44 @@ public class SwingFrame extends JFrame implements ActionListener {
memoryPanel.add(textField_4);
JButton btnNewButton_1 = new JButton("保存");
JButton btnNewButton_1 = new JButton("保存");
btnNewButton_1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
// btnNewButton_1.setContentAreaFilled(false);//按钮设置为透明
// btnNewButton_1.setBorder(BorderFactory.createRaisedBevelBorder());//设置凸起来的按钮
// btnNewButton_1.setBorder(BorderFactory.createLoweredBevelBorder()); //设置凹起来的按钮
// btnNewButton_1.setBorderPainted(false);//去掉按钮的边框的设置
// btnNewButton_1.setContentAreaFilled(false);//按钮设置为透明
// btnNewButton_1.setBorder(BorderFactory.createRaisedBevelBorder());//设置凸起来的按钮
// btnNewButton_1.setBorder(BorderFactory.createLoweredBevelBorder()); //设置凹起来的按钮
// btnNewButton_1.setBorderPainted(false);//去掉按钮的边框的设置
// String path = "C:\\Users\\86177\\Desktop\\www.png";
// File file = new File(path);
// Image image = ImageIO.read(file);
// btnNewButton_1.setIcon(new ImageIcon(image.getScaledInstance(50, 50, image.SCALE_DEFAULT)));
btnNewButton_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
btnNewButton_1.setFont(new Font("微软雅黑", Font.PLAIN, 20));
btnNewButton_1.setBounds(500, 344, 113, 40);
memoryPanel.add(btnNewButton_1);
JPanel repairPanel = new JPanel();//数据修复面板
JPanel repairPanel = new JPanel();//数据修复面板
repairPanel.setForeground(Color.GRAY);
repairPanel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("数据修复", null, repairPanel, null);
tabbedPane.addTab("数据修复", null, repairPanel, null);
repairPanel.setLayout(null);
JLabel label_5 = new JLabel("系统修复");
JLabel label_5 = new JLabel("系统修复");
label_5.setBounds(42, 35, 120, 40);
label_5.setForeground(Color.RED);
label_5.setFont(new Font("微软雅黑", Font.PLAIN, 30));
label_5.setFont(new Font("微软雅黑", Font.PLAIN, 30));
repairPanel.add(label_5);
JButton btnNewButton = new JButton("开始修复");
JButton btnNewButton = new JButton("开始修复");
btnNewButton.setBounds(504, 42, 113, 40);
repairPanel.add(btnNewButton);
JLabel label_6 = new JLabel("通过数据清洗等操作可以有效解决系统功能异常问题");
JLabel label_6 = new JLabel("通过数据清洗等操作可以有效解决系统功能异常问题");
label_6.setBounds(42, 76, 375, 18);
label_6.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_6.setFont(new Font("微软雅黑", Font.PLAIN, 15));
repairPanel.add(label_6);
JSeparator separator_1 = new JSeparator();
@ -244,130 +250,132 @@ public class SwingFrame extends JFrame implements ActionListener {
separator_1.setBounds(27, 100, 590, 5);
repairPanel.add(separator_1);
JCheckBox chckbxNewCheckBox = new JCheckBox("修复数据库数据");
JCheckBox chckbxNewCheckBox = new JCheckBox("修复数据库数据");
chckbxNewCheckBox.setBackground(new Color(220, 220, 220));
chckbxNewCheckBox.setBounds(53, 130, 162, 27);
chckbxNewCheckBox.setFont(new Font("微软雅黑", Font.PLAIN, 18));
chckbxNewCheckBox.setFont(new Font("微软雅黑", Font.PLAIN, 18));
repairPanel.add(chckbxNewCheckBox);
JLabel lblNewLabel_5 = new JLabel("机构信息管理、人员信息管理、数据校核、信息系统查询等。");
JLabel lblNewLabel_5 = new JLabel("机构信息管理、人员信息管理、数据校核、信息系统查询等。");
lblNewLabel_5.setBounds(77, 166, 405, 18);
lblNewLabel_5.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_5.setFont(new Font("微软雅黑", Font.PLAIN, 15));
repairPanel.add(lblNewLabel_5);
JCheckBox checkBox = new JCheckBox("修复系统管理数据");
JCheckBox checkBox = new JCheckBox("修复系统管理数据");
checkBox.setBackground(new Color(220, 220, 220));
checkBox.setBounds(53, 193, 173, 27);
checkBox.setFont(new Font("微软雅黑", Font.PLAIN, 18));
checkBox.setFont(new Font("微软雅黑", Font.PLAIN, 18));
repairPanel.add(checkBox);
JLabel label_7 = new JLabel("角色管理、用户管理、日志管理、系统参数配置等。");
JLabel label_7 = new JLabel("角色管理、用户管理、日志管理、系统参数配置等。");
label_7.setBounds(77, 229, 345, 18);
label_7.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_7.setFont(new Font("微软雅黑", Font.PLAIN, 15));
repairPanel.add(label_7);
JCheckBox checkBox_1 = new JCheckBox("修复统计专用信息管理数据");
JCheckBox checkBox_1 = new JCheckBox("修复统计专用信息管理数据");
checkBox_1.setBackground(new Color(220, 220, 220));
checkBox_1.setBounds(53, 256, 253, 27);
checkBox_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
checkBox_1.setFont(new Font("微软雅黑", Font.PLAIN, 18));
repairPanel.add(checkBox_1);
JLabel label_8 = new JLabel("信息表、校核、使用情况、人员对比等。");
JLabel label_8 = new JLabel("信息表、校核、使用情况、人员对比等。");
label_8.setBounds(72, 290, 270, 18);
label_8.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_8.setFont(new Font("微软雅黑", Font.PLAIN, 15));
repairPanel.add(label_8);
JCheckBox checkBox_2 = new JCheckBox("修复年报统计数据");
JCheckBox checkBox_2 = new JCheckBox("修复年报统计数据");
checkBox_2.setBackground(new Color(220, 220, 220));
checkBox_2.setBounds(53, 331, 253, 27);
checkBox_2.setFont(new Font("微软雅黑", Font.PLAIN, 18));
checkBox_2.setFont(new Font("微软雅黑", Font.PLAIN, 18));
repairPanel.add(checkBox_2);
JLabel label_9 = new JLabel("统计报表、校核、报表说明等。");
label_9.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_9 = new JLabel("统计报表、校核、报表说明等。");
label_9.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_9.setBounds(72, 366, 270, 18);
repairPanel.add(label_9);
Panel backupsPanel = new Panel();//数据库备份面板
Panel backupsPanel = new Panel();//数据库备份面板
backupsPanel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("数据库备份", null, backupsPanel, null);
tabbedPane.addTab("数据库备份", null, backupsPanel, null);
backupsPanel.setLayout(null);
JLabel lblNewLabel_12 = new JLabel("数据库备份");
JLabel lblNewLabel_12 = new JLabel("数据库备份");
lblNewLabel_12.setBounds(32, 13, 114, 28);
lblNewLabel_12.setFont(new Font("微软雅黑", Font.PLAIN, 20));
lblNewLabel_12.setFont(new Font("微软雅黑", Font.PLAIN, 20));
backupsPanel.add(lblNewLabel_12);
JLabel label_10 = new JLabel("数据库还原");
JLabel label_10 = new JLabel("数据库还原");
label_10.setBounds(459, 13, 105, 28);
label_10.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_10.setFont(new Font("微软雅黑", Font.PLAIN, 20));
backupsPanel.add(label_10);
String strMsg1 = "当系统因突发情况无法正常启动时,可以进行数据备份,确保因系统异常情况导致数据丢失。";
String strMsg1 = "当系统因突发情况无法正常启动时,可以进行数据备份,确保因系统异常情况导致数据丢失。";
String strMsg = "<html><body>" + strMsg1 + "<br><body></html>";
JLabel lblNewLabel_13 = new JLabel(strMsg);
lblNewLabel_13.setBounds(32, 39, 238, 107);
lblNewLabel_13.setFont(new Font("微软雅黑", Font.PLAIN, 16));
lblNewLabel_13.setFont(new Font("微软雅黑", Font.PLAIN, 16));
backupsPanel.add(lblNewLabel_13);
String strMsg3 = "备份数据库中所有的数据表,即安装路径下的data文件";
String strMsg3 = "备份数据库中所有的数据表,即安装路径下的data文件";
String strMsg4 = "(D:\\hzb2021\\mysql\\data)";
String strMsgData = "<html><body>" + strMsg3 + "<br>" + strMsg4 + "<body></html>";
JLabel lblNewLabel_14 = new JLabel(strMsgData);
lblNewLabel_14.setBounds(32, 131, 238, 96);
lblNewLabel_14.setFont(new Font("微软雅黑", Font.PLAIN, 16));
lblNewLabel_14.setFont(new Font("微软雅黑", Font.PLAIN, 16));
backupsPanel.add(lblNewLabel_14);
String strMsg5 = "数据备份默认至保存安装路径下,即(D:\\hzb2021),保存格式zip文件";
String strMsg5 = "数据备份默认至保存安装路径下,即(D:\\hzb2021),保存格式zip文件";
String strMsgData1 = "<html><body>" + strMsg5 + "<br><body></html>";
JLabel lblNewLabel_15 = new JLabel(strMsgData1);
lblNewLabel_15.setBounds(32, 223, 228, 96);
lblNewLabel_15.setFont(new Font("微软雅黑", Font.PLAIN, 16));
lblNewLabel_15.setFont(new Font("微软雅黑", Font.PLAIN, 16));
backupsPanel.add(lblNewLabel_15);
JButton btnNewButton_3 = new JButton("数据库备份");
JButton btnNewButton_3 = new JButton("数据库备份");
btnNewButton_3.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
btnNewButton_3.setBounds(32, 316, 113, 27);
backupsPanel.add(btnNewButton_3);
JLabel label_11 = new JLabel("<html><body>数据库还原将覆盖当前系统中所有人为产生的数据,不可恢复,需谨慎操作。<br><body></html>");
JLabel label_11 = new JLabel("<html><body>数据库还原将覆盖当前系统中所有人为产生的数据,不可恢复,需谨慎操作。<br><body></html>");
label_11.setBounds(382, 55, 238, 74);
label_11.setFont(new Font("微软雅黑", Font.PLAIN, 16));
label_11.setFont(new Font("微软雅黑", Font.PLAIN, 16));
backupsPanel.add(label_11);
JLabel label_12 = new JLabel("<html><body>为确保当前系统的安全,需要输入当前系统管理员密码才可以进行数据库还原。<br><body></html>");
JLabel label_12 = new JLabel("<html><body>为确保当前系统的安全,需要输入当前系统管理员密码才可以进行数据库还原。<br><body></html>");
label_12.setBounds(382, 149, 238, 74);
label_12.setFont(new Font("微软雅黑", Font.PLAIN, 16));
label_12.setFont(new Font("微软雅黑", Font.PLAIN, 16));
backupsPanel.add(label_12);
JButton button = new JButton("数据库还原");
JButton button = new JButton("数据库还原");
button.setBounds(451, 316, 113, 27);
backupsPanel.add(button);
JLabel lblNewLabel_16 = new JLabel("注:当系统遇到极端情况导致无法登陆时,系统卸载可进行数据库备份,重装或升级之后进行数据库还原。");
lblNewLabel_16.setFont(new Font("微软雅黑", Font.PLAIN, 13));
JLabel lblNewLabel_16 = new JLabel("注:当系统遇到极端情况导致无法登陆时,系统卸载可进行数据库备份,重装或升级之后进行数据库还原。");
lblNewLabel_16.setFont(new Font("微软雅黑", Font.PLAIN, 13));
lblNewLabel_16.setBounds(14, 366, 620, 18);
backupsPanel.add(lblNewLabel_16);
Panel upgradePanel = new Panel();//系统升级面板
Panel upgradePanel = new Panel();//系统升级面板
upgradePanel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("系统升级", null, upgradePanel, null);
tabbedPane.addTab("系统升级", null, upgradePanel, null);
upgradePanel.setLayout(null);
JLabel lblNewLabel_8 = new JLabel("安装包/升级包下载");
lblNewLabel_8.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel lblNewLabel_8 = new JLabel("安装包/升级包下载");
lblNewLabel_8.setFont(new Font("微软雅黑", Font.PLAIN, 20));
lblNewLabel_8.setBounds(47, 47, 181, 28);
upgradePanel.add(lblNewLabel_8);
final JLabel lblNewLabel_9 = new JLabel("下载地址:https://www.12371.cn/zgrjxz/gwywx/");
lblNewLabel_9.setFont(new Font("微软雅黑", Font.PLAIN, 18));
final JLabel lblNewLabel_9 = new JLabel("下载地址:https://www.12371.cn/zgrjxz/gwywx/");
lblNewLabel_9.setFont(new Font("微软雅黑", Font.PLAIN, 18));
lblNewLabel_9.setBounds(57, 88, 420, 18);
upgradePanel.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e){ //鼠标点击事件
@Override
public void mouseClicked(MouseEvent e){ //鼠标点击事件
@SuppressWarnings("unused")
URI uri = null;
try {
@ -389,61 +397,63 @@ public class SwingFrame extends JFrame implements ActionListener {
}
}
public void mouseEntered(MouseEvent e) { //鼠标移入事件
@Override
public void mouseEntered(MouseEvent e) { //鼠标移入事件
lblNewLabel_9.setForeground(Color.red);
}
public void mouseExited(MouseEvent e) { //鼠标移出事件
@Override
public void mouseExited(MouseEvent e) { //鼠标移出事件
lblNewLabel_9.setForeground(Color.blue);
}
});
upgradePanel.add(lblNewLabel_9);
JLabel lblNewLabel_10 = new JLabel("客服电话:400-8600-797-1、400-9608-590-5。");
lblNewLabel_10.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel lblNewLabel_10 = new JLabel("客服电话:400-8600-797-1、400-9608-590-5。");
lblNewLabel_10.setFont(new Font("微软雅黑", Font.PLAIN, 20));
lblNewLabel_10.setBounds(47, 161, 462, 28);
upgradePanel.add(lblNewLabel_10);
JLabel lblNewLabel_11 = new JLabel("业务咨询、商务洽谈。");
lblNewLabel_11.setFont(new Font("宋体", Font.PLAIN, 18));
JLabel lblNewLabel_11 = new JLabel("业务咨询、商务洽谈。");
lblNewLabel_11.setFont(new Font("宋体", Font.PLAIN, 18));
lblNewLabel_11.setBounds(57, 202, 278, 18);
upgradePanel.add(lblNewLabel_11);
JPanel startRepairPanel = new JPanel();
startRepairPanel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("开始修复界面", null, startRepairPanel, null);
tabbedPane.addTab("开始修复界面", null, startRepairPanel, null);
startRepairPanel.setLayout(null);
lblNewLabel_6 = new JLabel("系统正在数据修复中,建议不要随意随意停止!");
lblNewLabel_6 = new JLabel("系统正在数据修复中,建议不要随意随意停止!");
lblNewLabel_6.setBounds(57, 34, 378, 18);
lblNewLabel_6.setForeground(new Color(255, 0, 0));
lblNewLabel_6.setFont(new Font("微软雅黑", Font.PLAIN, 18));
lblNewLabel_6.setFont(new Font("微软雅黑", Font.PLAIN, 18));
startRepairPanel.add(lblNewLabel_6);
JButton btnNewButton_2 = new JButton("停止修复");
JButton btnNewButton_2 = new JButton("停止修复");
btnNewButton_2.setBounds(495, 65, 113, 27);
startRepairPanel.add(btnNewButton_2);
JProgressBar progressBar = new JProgressBar();
// MyJProgressBar progressBar = new MyJProgressBar();
progressBar.setBounds(57, 65, 412, 27);
// 设置进度的 最小值 和 最大值
// 设置进度的 最小值 和 最大值
progressBar.setMinimum(MIN_PROGRESS);
progressBar.setMaximum(MAX_PROGRESS);
// 设置当前进度值
// 设置当前进度值
progressBar.setValue(currentProgress);
// 绘制百分比文本(进度条中间显示的百分数)
// 绘制百分比文本(进度条中间显示的百分数)
progressBar.setStringPainted(true);
// 添加进度改变通知
// 添加进度改变通知
progressBar.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
System.out.println("当前进度值: " + progressBar.getValue() + "; " +
"进度百分比: " + progressBar.getPercentComplete());
log.info("当前进度值: " + progressBar.getValue() + "; " +
"进度百分比: " + progressBar.getPercentComplete());
}
});
// 添加到内容面板
// 添加到内容面板
startRepairPanel.add(progressBar);
JSeparator separator_2 = new JSeparator();
@ -451,8 +461,8 @@ public class SwingFrame extends JFrame implements ActionListener {
separator_2.setBackground(Color.LIGHT_GRAY);
startRepairPanel.add(separator_2);
JLabel lblNewLabel_7 = new JLabel("更新情况");
lblNewLabel_7.setFont(new Font("微软雅黑", Font.PLAIN, 18));
JLabel lblNewLabel_7 = new JLabel("更新情况");
lblNewLabel_7.setFont(new Font("微软雅黑", Font.PLAIN, 18));
lblNewLabel_7.setBounds(57, 121, 78, 18);
startRepairPanel.add(lblNewLabel_7);
@ -465,88 +475,89 @@ public class SwingFrame extends JFrame implements ActionListener {
JPanel panel = new JPanel();
panel.setBackground(new Color(220, 220, 220));
tabbedPane.addTab("数据库备份", null, panel, null);
tabbedPane.addTab("数据库备份", null, panel, null);
JButton btnNewButton_4 = new JButton("返回");
JButton btnNewButton_4 = new JButton("返回");
btnNewButton_4.setBounds(14, 13, 113, 27);
btnNewButton_4.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
}
});
panel.setLayout(null);
panel.add(btnNewButton_4);
JLabel lblNewLabel_17 = new JLabel("数据库备份");
JLabel lblNewLabel_17 = new JLabel("数据库备份");
lblNewLabel_17.setBounds(94, 60, 100, 27);
lblNewLabel_17.setFont(new Font("微软雅黑", Font.PLAIN, 20));
lblNewLabel_17.setFont(new Font("微软雅黑", Font.PLAIN, 20));
panel.add(lblNewLabel_17);
JLabel lblNewLabel_18 = new JLabel("存储目录:");
JLabel lblNewLabel_18 = new JLabel("存储目录:");
lblNewLabel_18.setBounds(71, 90, 85, 27);
lblNewLabel_18.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_18.setFont(new Font("微软雅黑", Font.PLAIN, 15));
panel.add(lblNewLabel_18);
JButton btnNewButton_5 = new JButton("更改");
JButton btnNewButton_5 = new JButton("更改");
btnNewButton_5.setBounds(414, 92, 113, 24);
panel.add(btnNewButton_5);
JLabel lblNewLabel_19 = new JLabel("数据库备份的格式为“zip”");
JLabel lblNewLabel_19 = new JLabel("数据库备份的格式为“zip”");
lblNewLabel_19.setBounds(170, 120, 186, 18);
lblNewLabel_19.setFont(new Font("微软雅黑", Font.PLAIN, 15));
lblNewLabel_19.setFont(new Font("微软雅黑", Font.PLAIN, 15));
panel.add(lblNewLabel_19);
JLabel label_13 = new JLabel("备份内容:");
label_13.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_13 = new JLabel("备份内容:");
label_13.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_13.setBounds(71, 140, 85, 27);
panel.add(label_13);
JLabel label_14 = new JLabel("基础库");
label_14.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel label_14 = new JLabel("基础库");
label_14.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_14.setBounds(170, 140, 100, 27);
panel.add(label_14);
JLabel label_15 = new JLabel("机构信息管理、人员信息管理、数据校核、信息系统查询等。");
label_15.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_15 = new JLabel("机构信息管理、人员信息管理、数据校核、信息系统查询等。");
label_15.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_15.setBounds(170, 160, 412, 27);
panel.add(label_15);
JLabel label_16 = new JLabel("系统管理");
label_16.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel label_16 = new JLabel("系统管理");
label_16.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_16.setBounds(170, 190, 100, 27);
panel.add(label_16);
JLabel label_17 = new JLabel("角色管理、用户管理、日志管理、系统参数配置等。");
label_17.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_17 = new JLabel("角色管理、用户管理、日志管理、系统参数配置等。");
label_17.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_17.setBounds(170, 210, 412, 27);
panel.add(label_17);
JLabel label_18 = new JLabel("统计专用信息管理");
label_18.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel label_18 = new JLabel("统计专用信息管理");
label_18.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_18.setBounds(170, 240, 167, 27);
panel.add(label_18);
JLabel label_19 = new JLabel("信息表、校核、使用情况、人员对比等。");
label_19.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_19 = new JLabel("信息表、校核、使用情况、人员对比等。");
label_19.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_19.setBounds(170, 266, 412, 27);
panel.add(label_19);
JLabel label_20 = new JLabel("统计年报");
label_20.setFont(new Font("微软雅黑", Font.PLAIN, 20));
JLabel label_20 = new JLabel("统计年报");
label_20.setFont(new Font("微软雅黑", Font.PLAIN, 20));
label_20.setBounds(170, 293, 100, 27);
panel.add(label_20);
JLabel label_21 = new JLabel("统计报表、校核、报表说明等。");
label_21.setFont(new Font("微软雅黑", Font.PLAIN, 15));
JLabel label_21 = new JLabel("统计报表、校核、报表说明等。");
label_21.setFont(new Font("微软雅黑", Font.PLAIN, 15));
label_21.setBounds(170, 318, 412, 27);
panel.add(label_21);
JButton btnNewButton_6 = new JButton("开始备份");
JButton btnNewButton_6 = new JButton("开始备份");
btnNewButton_6.setBounds(206, 357, 113, 27);
panel.add(btnNewButton_6);
textField_5 = new JTextField("D:\\hzb2022");
textField_5.setFont(new Font("微软雅黑", Font.PLAIN, 15));
textField_5.setFont(new Font("微软雅黑", Font.PLAIN, 15));
textField_5.setBounds(170, 92, 245, 24);
panel.add(textField_5);
textField_5.setColumns(10);

44
src/main/java/com/insigma/utils/DbUtil.java

@ -0,0 +1,44 @@
package com.insigma.utils;
import cn.hutool.db.Session;
import cn.hutool.db.ds.simple.SimpleDataSource;
import org.springframework.util.StringUtils;
import javax.sql.DataSource;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* (DbUtil )
*
* @author zhangxianwei
* @since 15:18 2022/4/18
*/
public class DbUtil {
private static DataSource ds;
public static String url;
public static String usr;
public static String pwd;
public static Session getSession(String url, String usr, String pwd) {
if(Objects.isNull(ds)){
DbUtil.url = url;
DbUtil.usr = url;
DbUtil.pwd = url;
ds = new SimpleDataSource(isDb(url), usr, pwd);
}
return Session.create(ds);
}
private static final String MYSQL = "jdbc:mysql";
private static String isDb(String url){
if(StringUtils.startsWithIgnoreCase(url, MYSQL)){
url += "?useUnicode=true&characterEncoding=utf8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
}
return url;
}
public static final List<String> RUBBISH = Arrays.asList("&#x00","&#x01","&#00","&#01","&#");
}

78
src/main/java/com/insigma/utils/FileUtil.java

@ -0,0 +1,78 @@
package com.insigma.utils;
import java.io.*;
/**
* (FileUtil )
*
* @author zhangxianwei
* @since 16:23 2022/4/18
*/
public class FileUtil {
public static void replaceLine(String path, String keyword, String replaceToStr) {
String temp;
try {
File file = new File(path);
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
StringBuffer buf = new StringBuffer();
// 保存该行前面的内容
while ((temp = br.readLine()) != null) {
if (temp.trim().startsWith(keyword)) {
buf = buf.append(replaceToStr);
} else {
buf = buf.append(temp);
}
buf = buf.append(System.getProperty("line.separator"));
}
br.close();
FileOutputStream fos = new FileOutputStream(file);
PrintWriter pw = new PrintWriter(fos);
pw.write(buf.toString().toCharArray());
pw.flush();
pw.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除整个文件夹里的内容
*
* @param path
* @throws Exception
*/
public static void delAllFile(String path) {
File file = new File(path);
if (!file.exists()) {
return;
}
if (!file.isDirectory()) {
return;
}
String[] tempList = file.list();
File temp = null;
for (int i = 0; i < tempList.length; i++) {
if (path.endsWith(File.separator)) {
temp = new File(path + tempList[i]);
} else {
temp = new File(path + File.separator + tempList[i]);
}
if (temp.isFile()) {
temp.delete();
}
if (temp.isDirectory()) {
delAllFile(path + File.separatorChar + tempList[i]);// 先删除文件夹里面的文件
File folderPath = new File(path + File.separatorChar + tempList[i]); // 再删除空文件夹
folderPath.delete();
}
}
file.delete(); //删除自身文件夹
}
}

71
src/main/java/com/insigma/utils/LinuxCommandUtil.java

@ -0,0 +1,71 @@
package com.insigma.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* CommandImpUtil
*
* @author admin
*/
@Slf4j
public class LinuxCommandUtil implements Runnable {
private String command;
public LinuxCommandUtil(String command) {
this.command = command;
}
@Override
public void run() {
Process process;
int exitVal = 0;
try {
log.debug("准备执行命令:{}",command);
process = Runtime.getRuntime().exec(command);
// Runtime.exec()创建的子进程公用父进程的流,不同平台上,父进程的stream buffer可能被打满导致子进程阻塞,从而永远无法返回。
//针对这种情况,我们只需要将子进程的stream重定向出来即可。
new RunCmdStreamThread(process.getInputStream(), "INFO").start();
new RunCmdStreamThread(process.getErrorStream(), "ERR").start();
exitVal = process.waitFor();
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
if (exitVal != 0) {
log.error("执行命令发生异常:{}", exitVal);
throw new RuntimeException("shell任务执行失败");
}
}
static class RunCmdStreamThread extends Thread {
InputStream is;
String printType;
RunCmdStreamThread(InputStream is, String printType) {
this.is = is;
this.printType = printType;
}
@Override
public void run() {
try {
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
while ((line = br.readLine()) != null) {
log.debug("输出:{}>{}", printType, line);
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
}

12
src/main/java/com/insigma/utils/RegisterUtil.java

@ -0,0 +1,12 @@
package com.insigma.utils;
/**
* (RegisterUtil )
*
* @author zhangxianwei
* @since 18:02 2022/4/18
*/
public class RegisterUtil {
}

8
src/main/java/com/insigma/utils/WinCommandUtil.java

@ -1,6 +1,8 @@
package com.insigma.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.io.*;
/**
@ -12,8 +14,14 @@ import java.io.*;
public class WinCommandUtil implements Runnable {
private String command;
private final String CMD = "cmd";
private final String EXE = "cmd.exe /c ";
public WinCommandUtil(String command) {
if(StringUtils.startsWithIgnoreCase(command, CMD)){
this.command = command;
}else{
this.command = EXE + command;
}
}
@Override

69
src/main/java/com/insigma/utils/ZipUtil.java

@ -0,0 +1,69 @@
package com.insigma.utils;
import com.insigma.config.AppCfg;
import java.io.File;
/**
* (ZipUtil )
*
* @author zhangxianwei
* @since 17:34 2022/4/18
*/
public class ZipUtil {
private static final String SX = "/";
private static final String XX = "\\";
public static void zip7Z(String dirName, String zipFileName) {
if (XX.equals(File.separator)) {
String cmd7z = getRootPath() + "7-Zip/7z.exe";
try {
String cmd = "cmd.exe /c " + cmd7z.trim().replace(" ", "\" \"") + " a -tzip \"" + zipFileName + "\" \"" + dirName + "\\*\"";
new WinCommandUtil(cmd).run();
} catch (Exception ie) {
ie.printStackTrace();
}
} else if (SX.equals(File.separator)) {
try {
String cmd777 = "chmod -R 777 "+dirName;
new LinuxCommandUtil(cmd777).run();
int index = cmd777.lastIndexOf(File.separator);
String cmd777Short = cmd777.substring(0,index);
new LinuxCommandUtil(cmd777Short).run();
String cmd = "7z a "+zipFileName+" "+dirName+" ";
new LinuxCommandUtil(cmd).run();
} catch (Exception ie) {
ie.printStackTrace();
}
}
}
public static void unZip7Z(String filepath, String destinationDir) {
if (XX.equals(File.separator)) {
String cmd7z = getRootPath() + "7-Zip/7z.exe";
try {
String cmd = "cmd.exe /c " + cmd7z.trim().replace(" ", "\" \"") + " x \"" + filepath + "\" -o\"" + destinationDir + "\" " + " -y ";
new WinCommandUtil(cmd).run();
} catch (Exception ie) {
ie.printStackTrace();
}
} else if (SX.equals(File.separator)) {
try {
String cmd777 ="chmod -R 777 "+filepath+File.separator;
new WinCommandUtil(cmd777).run();
String cmd = "unzip -o "+filepath+" -d "+destinationDir+"";
new WinCommandUtil(cmd).run();
new WinCommandUtil(cmd777).run();
} catch (Exception ie) {
ie.printStackTrace();
}
}
}
public static String getRootPath() {
return AppCfg.HZB + "/tomcat8/webapps/qggwy/WEB-INF/classes/static/softTools/";
}
}

3
src/main/resources/application-dev.yml

@ -9,7 +9,8 @@ spring:
basename: language/swingset
logging:
level: debug
level:
com.insigma: debug
file:
path: output/log
name: D:/ouput/logs/SwingDemoLog.log

9
src/main/resources/application.properties

@ -3,3 +3,12 @@
spring.profiles.active=dev
swing.ui.testCN=测试
db.url=jdbc:mysql://127.0.0.1:35017/hy_qggwy
db.usr=root
db.pwd=admin
hy.db=GWY20_Mysql
hy.mw=GWY20_Tomcat
hy.hzb=D:/hzb2021
hy.browser=360se.exe

Loading…
Cancel
Save