From 77d58298d00c11ade8862ca8acb0fdef5a45322e Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期五, 21 三月 2025 17:39:38 +0800 Subject: [PATCH] 修改 --- src/main/java/com/example/client/service/Level3ManageService.java | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/example/client/service/Level3ManageService.java b/src/main/java/com/example/client/service/Level3ManageService.java index b4c719c..bdbb552 100644 --- a/src/main/java/com/example/client/service/Level3ManageService.java +++ b/src/main/java/com/example/client/service/Level3ManageService.java @@ -13,6 +13,7 @@ import com.example.server.progressTrack.model.DjJdgzShip; import com.example.server.progressTrack.service.*; import com.example.server.teamGroup.service.SysTeamGroupClassService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -58,7 +59,7 @@ public JPanel createTable(Integer width, Integer height, JFrame jFrame) { JPanel panel = new JPanel(); - panel.setPreferredSize(new Dimension(width,height)); + panel.setPreferredSize(new Dimension(width, height)); JPanel topJpanel = new JPanel(); GridBagLayout layout = new GridBagLayout(); @@ -67,7 +68,7 @@ topJpanel.setBackground(Color.WHITE); JPanel centerJpanel = new JPanel(); - centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); + centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(105, jFrame))); centerJpanel.setBackground(Color.WHITE); panel.add(topJpanel, BorderLayout.NORTH); panel.add(centerJpanel, BorderLayout.CENTER); @@ -77,7 +78,7 @@ JComboBoxItem[] cabinList = cabinService.getList(); JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); String[] typeList = new String[]{ - "鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�","" + "","鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�" }; JLabel JLabel0 = new JLabel("宸ョ▼"); @@ -124,7 +125,7 @@ topJpanel.add(btnInsert, new GBC(3, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); topJpanel.add(btnImport, new GBC(4, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); - list = level3Service.getList(shipList.get(0).getId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); + list = level3Service.getList(shipList.get(0).getId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0], null); List<TableButton> buttonList = new ArrayList<>(); buttonList.add(new TableButton("edit", "缂栬緫")); buttonList.add(new TableButton("del", "鍒犻櫎")); @@ -148,6 +149,11 @@ table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + for (int i = 0; i < shipList.size(); i++) { + shipMap.put(shipList.get(i).getShipNo(), shipList.get(i).getId()); + comboBox.addItem(shipList.get(i).getShipNo()); + } + comboBox.setSelectedItem(shipList.get(0).getShipNo()); comboBox.addItemListener(new ItemListener() { public void itemStateChanged(final ItemEvent event) { String content = comboBox.getSelectedItem().toString(); @@ -157,7 +163,7 @@ String type = comboBox4.getSelectedItem().toString(); Long shipId = shipMap.get(content); - list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); + list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -184,7 +190,7 @@ String type = comboBox4.getSelectedItem().toString(); Long shipId = shipMap.get(content); - list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); + list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -205,7 +211,7 @@ String type = comboBox4.getSelectedItem().toString(); Long shipId = shipMap.get(content); - list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); + list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -223,7 +229,7 @@ String type = comboBox4.getSelectedItem().toString(); Long shipId = shipMap.get(content); - list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); + list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -241,7 +247,7 @@ String type = comboBox4.getSelectedItem().toString(); Long shipId = shipMap.get(content); - list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); + list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -254,7 +260,7 @@ query.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - list = level3Service.getList(null, null, null, null, null,sb.getText()); + list = level3Service.getList(null, null, null, null, null, sb.getText()); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); @@ -264,17 +270,12 @@ } }); - for (int i = 0; i < shipList.size(); i++) { - shipMap.put(shipList.get(i).getShipNo(), shipList.get(i).getId()); - comboBox.addItem(shipList.get(i).getShipNo()); - } - comboBox.setSelectedItem(shipList.get(0).getShipNo()); - tableModelListener(list, table, jFrame); btnInsert.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + jFrame.setEnabled(false); insert(jFrame); } }); @@ -282,6 +283,7 @@ btnImport.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + jFrame.setEnabled(false); importService.FileUpload(columnDto, table, jFrame); } }); @@ -289,13 +291,13 @@ JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(table); scrollPane.getViewport().setBackground(Color.WHITE); - scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,jFrame))); + scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(105, jFrame))); centerJpanel.add(scrollPane); jFrame.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { - centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); - scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(100,jFrame))); + centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(105, jFrame))); + scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(105, jFrame))); centerJpanel.revalidate(); centerJpanel.repaint(); scrollPane.revalidate(); @@ -328,7 +330,7 @@ JComboBoxItem[] cabinList = cabinService.getList(); JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); String[] typeList = new String[]{ - "鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�","" + "","鏀硅", "鍔犺", "鎹㈣", "鏀硅繘鎬т慨鐞�" }; JLabel JLabel1 = new JLabel("宸ョ▼"); @@ -463,7 +465,7 @@ data.setCabinId(String.valueOf(selectedIds)); data.setType(comboBox6.getSelectedItem().toString()); level3Service.insert(data); - list = level3Service.getList(level1Data.getShipId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); + list = level3Service.getList(level1Data.getShipId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0], null); CommonTable.refreshTable(list, columnDto, table); table.setRowHeight(25); -- Gitblit v1.9.1