From f0aae4b39afbcbb18fb5a0b32e3ca689662c5ca7 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 10 三月 2025 08:21:31 +0800
Subject: [PATCH] jar

---
 src/main/java/com/example/client/service/TrackRecordManageService.java |   59 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/example/client/service/TrackRecordManageService.java b/src/main/java/com/example/client/service/TrackRecordManageService.java
index 52c1c2c..d30992b 100644
--- a/src/main/java/com/example/client/service/TrackRecordManageService.java
+++ b/src/main/java/com/example/client/service/TrackRecordManageService.java
@@ -4,11 +4,13 @@
 import com.example.client.dto.JComboBoxItem;
 import com.example.client.model.TableButton;
 import com.example.client.utils.CommonTable;
+import com.example.server.cabin.service.CabinService;
 import com.example.server.progressTrack.model.*;
 import com.example.server.progressTrack.service.DjJdgzNetworkLevel1Service;
 import com.example.server.progressTrack.service.DjJdgzNetworkLevel3Service;
 import com.example.server.progressTrack.service.DjJdgzShipService;
 import com.example.server.progressTrack.service.DjJdgzTrackRecordService;
+import com.example.server.teamGroup.service.SysTeamGroupClassService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -37,7 +39,13 @@
     @Autowired
     private ExportTrackRecordService exportTrackRecordService;
     @Autowired
+    private ImportTrackRecordService importTrackRecordService;
+    @Autowired
     private TrackRecordAddOrUpdate addOrUpdate; // 娉ㄥ叆 AddOrupdate 瀹炰緥
+    @Autowired
+    private SysTeamGroupClassService sysTeamGroupClassService;
+    @Autowired
+    private CabinService cabinService;
 
     private JTable table;
     private List<DjJdgzTrackRecord> list;
@@ -57,14 +65,18 @@
         panel.add(centerJpanel, BorderLayout.CENTER);
 
         JComboBoxItem[] projectList = level1Service.getProjectList();
+
+        JComboBoxItem[] cabinList = cabinService.getList();
+        JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList();
         JComboBoxItem[] statusList = {
-                new JComboBoxItem(0, "杩涜涓�"),
-                new JComboBoxItem(1, "宸插畬鎴�")
+                new JComboBoxItem(0L, "杩涜涓�"),
+                new JComboBoxItem(1L, "宸插畬鎴�")
         };
 
         JButton btnTj = new JButton("缁熻鎶ヨ〃");
         JButton btnJc = new JButton("鍛ㄨ繘搴︽鏌ヨ〃");
         JButton btnExport = new JButton("瀵煎嚭璺熻釜鎶ヨ〃");
+        JButton btnImport = new JButton("瀵煎叆璺熻釜鎶ヨ〃");
         JComboBox<JComboBoxItem> comboBox = new JComboBox<>(projectList);
         JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(statusList);
         JComboBoxItem selectedItem = (JComboBoxItem) comboBox.getSelectedItem();
@@ -80,10 +92,9 @@
                 list = djJdgzTrackRecordService.getList(level1Id, Math.toIntExact(Status));
                 CommonTable.refreshTable(list, columnDto, table);
                 table.setRowHeight(25);
-                table.setAutoCreateRowSorter(true);
                 table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 
-                tableModelListener(table, jFrame);
+                tableModelListener(table, jFrame,list);
             }
         });
 
@@ -97,16 +108,24 @@
                 list = djJdgzTrackRecordService.getList(level1Id, Math.toIntExact(Status));
                 CommonTable.refreshTable(list, columnDto, table);
                 table.setRowHeight(25);
-                table.setAutoCreateRowSorter(true);
                 table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 
-                tableModelListener(table, jFrame);
+                tableModelListener(table, jFrame,list);
+            }
+        });
+
+        btnImport.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBoxItem selectedItemNow = (JComboBoxItem) comboBox.getSelectedItem();
+                importTrackRecordService.FileUpload(columnDto,table,jFrame);
             }
         });
 
         topJpanel.add(btnTj);
         topJpanel.add(btnJc);
         topJpanel.add(btnExport);
+        topJpanel.add(btnImport);
         topJpanel.add(comboBox);
         topJpanel.add(comboBox2);
 
@@ -120,10 +139,13 @@
         columnDto = new ArrayList<>();
         //columnDto.add(new ColumnDto("ID", "id", -1, null,false));
         columnDto.add(new ColumnDto("搴忓彿", "", 50, "autoCreate", false, null, null));
-        columnDto.add(new ColumnDto("宸ョ▼鍚嶇О", "ProjectName", 180, null, false, null, null));
+        columnDto.add(new ColumnDto("閮ㄩ棬", "deptId", 120, "dict", false, null, deptList));
+        columnDto.add(new ColumnDto("涓撲笟", "teamgroupName", 120, null, false, null, null));
+        columnDto.add(new ColumnDto("鑸卞", "cabinId", 100, "dict", false, null, cabinList));
+        columnDto.add(new ColumnDto("绫诲埆", "type", 100, null, false, null, null));
         columnDto.add(new ColumnDto("涓�绾ц妭鐐�", "level1NodeName", 120, null, false, null, null));
         columnDto.add(new ColumnDto("浜岀骇鑺傜偣", "level2NodeName", 120, null, false, null, null));
-        columnDto.add(new ColumnDto("椤圭洰鍚嶇О", "level3NetworkName", 120, null, false, null, null));
+        columnDto.add(new ColumnDto("璁惧鍚嶇О", "level3NetworkName", 120, null, false, null, null));
         columnDto.add(new ColumnDto("褰撳墠鑺傜偣", "level3NodeName", 120, null, false, null, null));
         columnDto.add(new ColumnDto("璁″垝瀹屾垚鏃堕棿", "requiredCompletionTime", 200, null, false, null, null));
         columnDto.add(new ColumnDto("鎬绘壙淇崟浣�", "generalRepair", 180, null, false, null, null));
@@ -136,7 +158,6 @@
 
         table = CommonTable.createCommonTable(list, columnDto);
         table.setRowHeight(25);
-        table.setAutoCreateRowSorter(true);
         table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
 
         table.addMouseListener(new MouseAdapter() {
@@ -149,7 +170,7 @@
 
                 // 妫�鏌ユ槸鍚︾偣鍑讳簡鏈夋晥鍗曞厓鏍�
                 if (row >= 0 && column >= 0) {
-                    if (column == 10) { // 鍒楃储寮曚粠0寮�濮�
+                    if (column == 13) { // 鍒楃储寮曚粠0寮�濮�
                         // 鑾峰彇璇ュ崟鍏冩牸鐨勫��
                         Object cellValue = table.getValueAt(row, column);
                         Integer value = Integer.parseInt(cellValue.toString());
@@ -182,7 +203,7 @@
                 exportTrackRecordService.openDialog(jFrame);
             }
         });
-        tableModelListener(table, jFrame);
+        tableModelListener(table, jFrame,list);
 
         JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
         scrollPane.setViewportView(table);
@@ -211,17 +232,17 @@
         List<ColumnDto> columnDto = new ArrayList<>();
         List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getHistory(level3NodeId);
         JComboBoxItem[] trackList = {
-                new JComboBoxItem(0, "绾夸笅"),
-                new JComboBoxItem(1, "鐢佃瘽"),
+                new JComboBoxItem(0L, "绾夸笅"),
+                new JComboBoxItem(1L, "鐢佃瘽"),
         };
 
         JComboBoxItem[] statusList = {
-                new JComboBoxItem(0, "杩涜涓�"),
-                new JComboBoxItem(1, "宸插畬鎴�"),
+                new JComboBoxItem(0L, "杩涜涓�"),
+                new JComboBoxItem(1L, "宸插畬鎴�"),
         };
         JComboBoxItem[] hasDelayRiskList = {
-                new JComboBoxItem(0, "鏃�"),
-                new JComboBoxItem(1, "鏈�"),
+                new JComboBoxItem(0L, "鏃�"),
+                new JComboBoxItem(1L, "鏈�"),
         };
 
         columnDto.add(new ColumnDto("搴忓彿", "", 50, "autoCreate", false, null, null));
@@ -251,7 +272,7 @@
 
     }
 
-    public void tableModelListener(JTable table, JFrame jFrame) {
+    public void tableModelListener(JTable table, JFrame jFrame,List<DjJdgzTrackRecord> recordList) {
         table.getModel().addTableModelListener(e -> {
             // 妫�鏌ヤ簨浠剁被鍨�
             if (e.getType() == TableModelEvent.UPDATE) {
@@ -263,7 +284,7 @@
                 Object newValue = table.getModel().getValueAt(row, column);
                 // 杈撳嚭鍙樺寲淇℃伅
                 if (newValue.equals("edit")) {
-                    DjJdgzTrackRecord data = list.get(row);
+                    DjJdgzTrackRecord data = recordList.get(row);
                     Long level1Id = data.getLevel1NetworkId();
                     data.setProcessName(data.getLevel3NodeName());
                     Boolean isUpdate = data.getIsUpdate();

--
Gitblit v1.9.1