From bf5b01b14dc7bfc214e646425a62f5593890d7e3 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期六, 08 十一月 2025 22:05:37 +0800
Subject: [PATCH] 清洗数据库日期错误,并且导入日期通用化处理
---
src/main/java/com/example/client/service/DataExportManageService.java | 36 +++++++++++++++++++++++++-----------
1 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/example/client/service/DataExportManageService.java b/src/main/java/com/example/client/service/DataExportManageService.java
index 28a6341..b08575d 100644
--- a/src/main/java/com/example/client/service/DataExportManageService.java
+++ b/src/main/java/com/example/client/service/DataExportManageService.java
@@ -3,13 +3,12 @@
import com.example.client.dto.ColumnDto;
import com.example.client.utils.CommonTable;
-import com.example.client.utils.GBC;
-import com.example.client.utils.WaitUtil;
-import com.example.server.DataSync.dto.DataExportDto;
import com.example.server.DataSync.service.DataSyncService;
-import com.example.server.utils.CacheUtils;
+import com.example.server.progressTrack.dao.ExportRecordDao;
+import com.example.server.progressTrack.model.ExportRecord;
+import com.example.server.user.model.SysUser;
+import com.example.server.utils.UserAndSiteUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.swing.*;
@@ -24,7 +23,12 @@
@Autowired
DataSyncService dataSyncService;
@Autowired
+ ExportRecordDao exportRecordDao;
+ @Autowired
ImportDataService importDataService;
+
+ private List<ColumnDto> columnDto;
+ private JTable table;
public JPanel createTable(Integer width, Integer height, JFrame jFrame) {
JPanel panel = new JPanel(new BorderLayout()); // 浣跨敤 BorderLayout
@@ -43,6 +47,8 @@
JLabel label1 = new JLabel("鎻愮ず淇℃伅");
JTextArea tips = new JTextArea(7, 30);
tips.setEnabled(false);
+ tips.setForeground(Color.BLACK); // 璁剧疆涓洪粦鑹�
+ tips.setDisabledTextColor(Color.BLACK);
tips.setLineWrap(true);
JPanel center = new JPanel(new BorderLayout()); // 涓� left 璁剧疆甯冨眬
@@ -54,12 +60,12 @@
left.add(center, BorderLayout.CENTER);
JLabel label2 = new JLabel("瀵煎嚭璁板綍");
- List<DataExportDto> list = new ArrayList<>();
- List<ColumnDto> columnDto = new ArrayList<>();
+ List<ExportRecord> list = exportRecordDao.getList();
+ columnDto = new ArrayList<>();
columnDto.add(new ColumnDto("搴忓彿", "", 265, "autoCreate", false, null, null));
- columnDto.add(new ColumnDto("瀵煎嚭鏃堕棿", "exportDate", 265, null, false, null, null));
- columnDto.add(new ColumnDto("瀵煎嚭浜�", "importStaff", 265, null, false, null, null));
- JTable table = CommonTable.createCommonTable(list, columnDto);
+ columnDto.add(new ColumnDto("瀵煎嚭鏃堕棿", "createDate", 265, null, false, null, null));
+ columnDto.add(new ColumnDto("鎿嶄綔浜�", "userName", 265, null, false, null, null));
+ table = CommonTable.createCommonTable(list, columnDto);
table.setRowHeight(25);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
@@ -72,10 +78,18 @@
btnExport.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- dataSyncService.export();
+ SysUser user = (SysUser) UserAndSiteUtils.get("user","user");
+ if (user==null){
+ JOptionPane.showMessageDialog(null, "鐢ㄦ埛澶辨晥璇烽��鍑哄苟閲嶆柊鐧诲綍", "鎻愮ず", JOptionPane.WARNING_MESSAGE);
+ return;
+ }
+ dataSyncService.export(tips);
}
});
return panel;
}
+ public void refresh(List<ExportRecord> list){
+ CommonTable.refreshTable(list, columnDto,table);
+ }
}
--
Gitblit v1.9.1