49个文件已修改
12个文件已添加
1个文件已删除
| | |
| | | public static void main(String[] args) { |
| | | System.setProperty("java.awt.headless", "false"); |
| | | SpringApplication.run(Application.class, args); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.user.service.UserService; |
| | | import com.example.server.utils.CacheUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | String finalSite = site; |
| | | String finalTeamGroup = teamGroup; |
| | | String finalTeam = team; |
| | | String finalTeamGroup1 = teamGroup; |
| | | loginButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | |
| | | |
| | | user = userService.login(name, str); |
| | | exist = user.getExist(); |
| | | |
| | | Boolean exit2 = true; |
| | | if (StringUtils.isNotBlank(user.getTeamgroup())) { |
| | | if (StringUtils.isNotBlank(finalTeamGroup1) && !finalTeamGroup1.equals("null")) { |
| | | if (!finalTeamGroup1.contains(user.getTeamgroup())) { |
| | | exit2 = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (exist) { |
| | | System.out.println("ç»å½æå"); |
| | | if (!exit2) { |
| | | JOptionPane.showMessageDialog(null, "å½åæºå¨ä¸æ¯æè¯¥ä¸ä¸ç¨æ·ç»å½", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | try { |
| | | String path = Login.class.getClassLoader().getResource("config.properties").getPath(); |
| | | OutputStream outputStream = null; |
| | |
| | | outputStream = new FileOutputStream(path); |
| | | } else { |
| | | try { |
| | | outputStream = new FileOutputStream("config.properties"); |
| | | outputStream = new FileOutputStream(configPath); |
| | | } catch (FileNotFoundException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | properties.setProperty("userName", name); |
| | | properties.setProperty("password", str); |
| | | properties.store(outputStream, "rxkj"); |
| | |
| | | import java.util.Objects; |
| | | |
| | | public class JComboBoxItem { |
| | | private final long id; |
| | | private final Long id; |
| | | private final String name; |
| | | |
| | | public JComboBoxItem(long id, String name) { |
| | | public JComboBoxItem(Long id, String name) { |
| | | this.id = id; |
| | | this.name = name; |
| | | } |
| | | |
| | | public long getId() { |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | |
| | | import com.example.client.Login; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.MultiSelectComboBox; |
| | | import com.example.client.utils.WaitUtil; |
| | | import com.example.server.DataSync.service.DataSyncService; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.utils.CacheUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.io.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Date; |
| | | import java.util.HashSet; |
| | | import java.util.Properties; |
| | | import java.util.Set; |
| | | |
| | | |
| | | @Service |
| | | public class ConfigManageService { |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | @Value("${data.config-path}") |
| | | private String configPath; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | Properties properties = new Properties(); |
| | | |
| | | String site = ""; |
| | | String teamGroup = ""; |
| | | String team = ""; |
| | | |
| | | String path = Login.class.getClassLoader().getResource("config.properties").getPath(); |
| | | InputStream inStream = null; |
| | | File dir = new File(path); |
| | | if (dir.exists()) { |
| | | inStream = Login.class.getClassLoader().getResourceAsStream("config.properties"); |
| | | } else { |
| | | try { |
| | | inStream = new FileInputStream(configPath); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | Reader reader = null; |
| | | try { |
| | | reader = new InputStreamReader(inStream, StandardCharsets.UTF_8); |
| | | // 使ç¨Properties.load(Reader)å è½½å±æ§æä»¶ |
| | | properties.load(reader); |
| | | site = properties.get("site").toString(); |
| | | teamGroup = properties.get("teamGroup").toString(); |
| | | team = properties.get("team").toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (reader != null) { |
| | | try { |
| | | reader.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (inStream != null) { |
| | | try { |
| | | inStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | JPanel panel = new JPanel(); |
| | | |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | panel.setLayout(layout); |
| | | |
| | | panel.setPreferredSize(new Dimension(width - 20, height)); |
| | | String[] siteList = new String[]{ |
| | | "å·¥ä½ç»", "åå®¶", "TD" |
| | | }; |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | |
| | | JLabel JLabel1 = new JLabel("æå±æºå¨"); |
| | | JComboBox<String> comboBox = new JComboBox<>(siteList); |
| | | comboBox.setPreferredSize(new Dimension(185,28)); |
| | | if (StringUtils.isNotBlank(site)) { |
| | | comboBox.setSelectedItem(site); |
| | | } |
| | | |
| | | JLabel JLabel2 = new JLabel("æå±TD"); |
| | | JTextField teamName = new JTextField(16); |
| | | if (StringUtils.isNotBlank(team)) { |
| | | teamName.setText(team.replace("TD", "")); |
| | | } |
| | | |
| | | JLabel JLabel3 = new JLabel("坿ä½çä¸ä¸"); |
| | | MultiSelectComboBox comboBox2 = new MultiSelectComboBox(teamList); |
| | | comboBox2.setPreferredSize(new Dimension(500, 25)); |
| | | if (StringUtils.isNotBlank(teamGroup) && !teamGroup.equals("null")) { |
| | | Set<Long> selectedIds = new HashSet<>(); |
| | | String[] idParts = teamGroup.split(","); |
| | | for (String idPart : idParts) { |
| | | selectedIds.add(Long.parseLong(idPart.trim())); // å°å符串转æ¢ä¸º Long ç±»åå¹¶æ·»å å°éåä¸ |
| | | } |
| | | |
| | | // å° ID 转æ¢ä¸ºå¯¹åºç JComboBoxItem 对象 |
| | | Set<JComboBoxItem> selectedItems = new HashSet<>(); |
| | | for (JComboBoxItem item : teamList) { |
| | | if (selectedIds.contains(item.getId())) { // æ£æ¥ Long ç±»åç ID æ¯å¦å¹é
|
| | | selectedItems.add(item); // æ·»å å°éä¸é¡¹éå |
| | | } |
| | | } |
| | | comboBox2.setSelectedItems(selectedItems); |
| | | } |
| | | |
| | | |
| | | JButton save = new JButton("ä¿å"); |
| | | |
| | | save.addActionListener((e) -> { |
| | | try { |
| | | String path2 = Login.class.getClassLoader().getResource("config.properties").getPath(); |
| | | OutputStream outputStream = null; |
| | | File dir2 = new File(path2); |
| | | if (dir2.exists()) { |
| | | outputStream = new FileOutputStream(path2); |
| | | } else { |
| | | try { |
| | | outputStream = new FileOutputStream(configPath); |
| | | } catch (FileNotFoundException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | Set<JComboBoxItem> selectedItems = comboBox2.getSelectedItems(); |
| | | StringBuilder selectedIds = new StringBuilder(); |
| | | for (JComboBoxItem item : selectedItems) { |
| | | selectedIds.append(item.getId()).append(","); |
| | | } |
| | | properties.setProperty("site", comboBox.getSelectedItem().toString()); |
| | | properties.setProperty("team", teamName.getText() + "TD"); |
| | | properties.setProperty("teamGroup", String.valueOf(selectedIds)); |
| | | CacheUtils.remove("site", "site"); |
| | | CacheUtils.put("site", "site", comboBox.getSelectedItem().toString()); |
| | | properties.store(outputStream, "rxkj"); |
| | | outputStream.close(); |
| | | } catch (FileNotFoundException ex) { |
| | | ex.printStackTrace(); |
| | | } catch (IOException ep) { |
| | | ep.printStackTrace(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | panel.add(JLabel1, new GBC(0, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | panel.add(comboBox, new GBC(1, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | panel.add(JLabel2, new GBC(0, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | panel.add(teamName, new GBC(1, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | panel.add(JLabel3, new GBC(0, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | panel.add(comboBox2, new GBC(1, 2, 2, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | panel.add(save, new GBC(0, 3, 2, 1).setWeight(0, 0)); |
| | | |
| | | |
| | | return panel; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DataExportManageService { |
| | | @Autowired |
| | | DataSyncService dataSyncService; |
| | | @Autowired |
| | | ImportDataService importDataService; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); // ä½¿ç¨ BorderLayout |
| | | panel.setPreferredSize(new Dimension(width - 10, height)); |
| | | |
| | | JPanel left = new JPanel(new BorderLayout()); // 为 left 设置å¸å± |
| | | left.setPreferredSize(new Dimension((width - 10) / 2, height)); |
| | | |
| | | JPanel right = new JPanel(new BorderLayout()); // 为 right 设置å¸å± |
| | | right.setPreferredSize(new Dimension((width - 10) / 2, height)); |
| | | |
| | | JButton btnExport = new JButton("导åº"); |
| | | JPanel top = new JPanel(new FlowLayout(FlowLayout.LEFT)); // 为 left 设置å¸å± |
| | | top.add(btnExport); |
| | | |
| | | JLabel label1 = new JLabel("æç¤ºä¿¡æ¯"); |
| | | JTextArea tips = new JTextArea(7, 30); |
| | | tips.setEnabled(false); |
| | | tips.setLineWrap(true); |
| | | |
| | | JPanel center = new JPanel(new BorderLayout()); // 为 left 设置å¸å± |
| | | center.setPreferredSize(new Dimension((width - 10) / 2, height-50)); |
| | | center.add(label1,BorderLayout.NORTH); |
| | | center.add(tips,BorderLayout.CENTER); |
| | | |
| | | left.add(top, BorderLayout.NORTH); |
| | | left.add(center, BorderLayout.CENTER); |
| | | |
| | | JLabel label2 = new JLabel("导åºè®°å½"); |
| | | List<DataExportDto> list = new ArrayList<>(); |
| | | List<ColumnDto> 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); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | right.add(label2, BorderLayout.NORTH); |
| | | right.add(new JScrollPane(table), BorderLayout.CENTER); // å° table å
è£
å¨ JScrollPane ä¸ |
| | | |
| | | panel.add(left, BorderLayout.WEST); |
| | | panel.add(right, BorderLayout.CENTER); // å° right æ·»å å° CENTER åºå |
| | | |
| | | btnExport.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | dataSyncService.export(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | |
| | | 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.dto.DataImportDto; |
| | | import com.example.server.DataSync.service.DataSyncService; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel2List; |
| | | import com.example.server.utils.CacheUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | public class DataImportManageService { |
| | | @Value("${data.imgDir}") |
| | | private String imgPath; |
| | | @Autowired |
| | | DataSyncService dataSyncService; |
| | | @Autowired |
| | | ImportDataService importDataService; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | panel.setPreferredSize(new Dimension(width-10,height)); |
| | | |
| | | JPanel left = new JPanel(new BorderLayout()); |
| | | left.setPreferredSize(new Dimension((width-10)/2,height)); |
| | | |
| | | JPanel right = new JPanel(new BorderLayout()); |
| | | right.setPreferredSize(new Dimension((width-10)/2,height)); |
| | | |
| | | JPanel top = new JPanel(new FlowLayout(FlowLayout.LEFT)); // 为 left 设置å¸å± |
| | | top.setPreferredSize(new Dimension((width - 10) / 2, 50)); |
| | | |
| | | JPanel center = new JPanel(); // 为 left 设置å¸å± |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | center.setLayout(layout); |
| | | center.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/2)); |
| | | |
| | | JPanel south = new JPanel(new BorderLayout()); // 为 left 设置å¸å± |
| | | south.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/2)); |
| | | |
| | | |
| | | String site = (String) CacheUtils.get("site", "site"); |
| | | JLabel label = new JLabel(site + "æºå¨"); |
| | | top.add(label); |
| | | |
| | | JPanel jPanel = importDataService.FileUpload(jFrame,700,100); |
| | | JButton btnImport = new JButton("导å
¥"); |
| | | center.add(jPanel, new GBC(0, 0, 1, 1).setInsets(5)); |
| | | center.add(btnImport, new GBC(0, 1, 1, 1).setInsets(5)); |
| | | |
| | | |
| | | JLabel label1 = new JLabel("æç¤ºä¿¡æ¯"); |
| | | JTextArea tips = new JTextArea(7, 30); |
| | | tips.setEnabled(false); |
| | | tips.setLineWrap(true); |
| | | south.add(label1,BorderLayout.NORTH); |
| | | south.add(tips,BorderLayout.CENTER); |
| | | |
| | | |
| | | btnImport.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | // å建æè½¬çå¾
æ¡çå®ä¾ï¼å设WaitUtilæ¯ä¸ä¸ªèªå®ä¹çSwingç»ä»¶ï¼ |
| | | final WaitUtil waitUtil = new WaitUtil(imgPath, "æ°æ®æ£å¨å¯¼å
¥ï¼è¯·ç¨å"); |
| | | |
| | | // å¼å§ä¸ä¼ æä»¶ç弿¥ä»»å¡ |
| | | SwingWorker<String, Void> sw = new SwingWorker<String, Void>() { |
| | | @Override |
| | | protected String doInBackground() throws Exception { |
| | | String flag = importDataService.UnzipFile(); |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | protected void done() { |
| | | try { |
| | | // è·åä¸ä¼ ç»æï¼å¨è¿ä¸ªä¾åä¸ï¼æä»¬å设ä¸ä¼ æ¹æ³è¿åBooleanç±»åï¼ |
| | | String uploadSucceeded = get(); |
| | | |
| | | // å·æ°è¡¨æ ¼æ°æ®ï¼å¦æä¸ä¼ æåï¼ |
| | | if (uploadSucceeded.equals("true")) { |
| | | waitUtil.dispose(); |
| | | System.out.println("导å
¥æåæ¶é´" + new Date()); |
| | | } else { |
| | | waitUtil.dispose(); |
| | | JOptionPane.showMessageDialog(null, uploadSucceeded, "æç¤º", JOptionPane.ERROR_MESSAGE); |
| | | } |
| | | |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | waitUtil.dispose(); |
| | | } |
| | | } |
| | | }; |
| | | // æ§è¡å¼æ¥ä»»å¡ |
| | | sw.execute(); |
| | | waitUtil.setVisible(true); |
| | | } |
| | | }); |
| | | |
| | | left.add(top,BorderLayout.NORTH); |
| | | left.add(center,BorderLayout.CENTER); |
| | | left.add(south,BorderLayout.SOUTH); |
| | | |
| | | JLabel label2 = new JLabel("导å
¥è®°å½"); |
| | | List<DataImportDto> list = new ArrayList<>(); |
| | | |
| | | List<ColumnDto> columnDto = new ArrayList<>(); |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("åºå·", "", 200, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("æ°æ®æº", "importLocal", 200, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("导å
¥æ¶é´", "importDate", 200, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("æä½äºº", "importStaff", 200, null, false, null,null)); |
| | | JTable table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | right.add(label2, BorderLayout.NORTH); |
| | | right.add(new JScrollPane(table), BorderLayout.CENTER); |
| | | |
| | | panel.add(left,BorderLayout.WEST); |
| | | panel.add(right, BorderLayout.CENTER); |
| | | |
| | | return panel; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @Autowired |
| | | private DjJdgzDismantTrackService djJdgzDismantTrackService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3Service djJdgzNetworkLevel3Service; |
| | | @Autowired |
| | | private StatisDismantService statisDismantService; |
| | | @Autowired |
| | | private StatisDismant2Service statisDismant2Service; |
| | | @Autowired |
| | | private CabinService cabinService; |
| | | private JTable trackTable; |
| | | private List<ColumnDto> columnDto; |
| | | private DjJdgzNetworkLevel3 nowLevel3; |
| | | private List<DjJdgzDismantTrack> list; |
| | | |
| | | public JPanel createTrack(Integer width, Integer height, DjJdgzNetworkLevel3 djJdgzNetworkLevel3,JFrame frame) { |
| | | nowLevel3 = djJdgzNetworkLevel3; |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | |
| | |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | |
| | | JButton btnTj = new JButton("ç»è®¡æ¥è¡¨"); |
| | | JButton btnTjz = new JButton("æå¸è¿åº¦ç»è®¡æ»è¡¨"); |
| | | JButton btnTj = new JButton("æå¸è¿åº¦è¯¦æ
表"); |
| | | JButton btnExport = new JButton("å¯¼åºæå¸æ¥è¡¨"); |
| | | JButton btnSave = new JButton("ä¿å"); |
| | | JButton btnImport = new JButton("æ¹é导å
¥"); |
| | | |
| | | topJpanel.add(btnTjz); |
| | | topJpanel.add(btnTj); |
| | | topJpanel.add(btnExport); |
| | | topJpanel.add(btnSave); |
| | | topJpanel.add(btnImport); |
| | | |
| | | List<DjJdgzDismantTrack> list = djJdgzDismantTrackService.getList(djJdgzNetworkLevel3.getId(), null); |
| | | list = djJdgzDismantTrackService.getList(nowLevel3.getId(), null); |
| | | List<TableButton> buttonList = new ArrayList<>(); |
| | | buttonList.add(new TableButton("edit", "ç¼è¾")); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | JComboBoxItem[] statusList = { |
| | | new JComboBoxItem(0, "è¿è¡ä¸"), |
| | | new JComboBoxItem(1, "已宿"), |
| | | new JComboBoxItem(0L, "è¿è¡ä¸"), |
| | | new JComboBoxItem(1L, "已宿"), |
| | | }; |
| | | |
| | | // åå»ºå·¦ä¾§è¡¨æ ¼ |
| | |
| | | columnDto.add(new ColumnDto("å
¥åºæ¶é´", "warehouseTime", 130, "selectDate", true, null, null)); |
| | | columnDto.add(new ColumnDto("å
¥åºäººå", "warehouseStaff", 120, null, true, null, null)); |
| | | columnDto.add(new ColumnDto("å½ååæ¾ä½ç½®", "currentLocation", 160, null, true, null, null)); |
| | | columnDto.add(new ColumnDto("ç¶æ", "status", 120, "dict", true, null, statusList)); |
| | | columnDto.add(new ColumnDto("ç¶æ", "status", 120, "dicts", true, null, statusList)); |
| | | |
| | | trackTable = CommonTable.createCommonTable(list, columnDto); |
| | | trackTable.setRowHeight(25); |
| | | trackTable.setAutoCreateRowSorter(true); |
| | | |
| | | trackTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | |
| | |
| | | trackTable = new ComplexTable(headerRows,body); |
| | | CommonTable.setColumnType(columnDto, trackTable);*/ |
| | | |
| | | btnTjz.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | statisDismantService.createTable(frame,nowLevel3.getLevel1NetworkId()); |
| | | } |
| | | }); |
| | | btnTj.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | statisDismantService.createTable(frame,djJdgzNetworkLevel3.getLevel1NetworkId()); |
| | | statisDismant2Service.createTable(frame,nowLevel3.getLevel1NetworkId()); |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser user = (SysUser) CacheUtils.get("user", "user"); |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(djJdgzNetworkLevel3.getTeamgroupId())){ |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(nowLevel3.getTeamgroupId().toString())){ |
| | | CommonTable.saveTableList(list, trackTable, columnDto); |
| | | djJdgzDismantTrackService.save(list); |
| | | }else{ |
| | | JOptionPane.showMessageDialog(null, "ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | JOptionPane.showMessageDialog(null, "å½åç¨æ·ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | } |
| | | } |
| | | }); |
| | |
| | | btnImport.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | importDismantTrackService.FileUpload(djJdgzNetworkLevel3.getId(),frame); |
| | | importDismantTrackService.FileUpload(nowLevel3.getId(),frame); |
| | | } |
| | | }); |
| | | |
| | |
| | | return panel; |
| | | } |
| | | public void refreshTable(Long level3Id){ |
| | | List<DjJdgzDismantTrack> list = djJdgzDismantTrackService.getList(level3Id, null); |
| | | nowLevel3 = djJdgzNetworkLevel3Service.get(level3Id); |
| | | list = djJdgzDismantTrackService.getList(level3Id, null); |
| | | CommonTable.refreshTable(list, columnDto, trackTable); |
| | | trackTable.setRowHeight(25); |
| | | trackTable.setAutoCreateRowSorter(true); |
| | | |
| | | trackTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | } |
| | | |
| | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | List<DjJdgzShip> shipList = djJdgzShipService.getList(); |
| | | Map<String, Long> shipMap = new HashMap<>(); |
| | |
| | | list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | |
| | | columnDto.add(new ColumnDto("åºå·", "", 60, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤åç§°", "name", 112, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 100, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 100, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("设å¤åç§°", "name", 110, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 120, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 120, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", 100, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", 100, null, false, null, null)); |
| | | |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | frame1.setLayout(layout); |
| | | |
| | | JComboBoxItem[] statusList = { |
| | | new JComboBoxItem(0, "è¿è¡ä¸"), |
| | | new JComboBoxItem(1, "已宿"), |
| | | new JComboBoxItem(0L, "è¿è¡ä¸"), |
| | | new JComboBoxItem(1L, "已宿"), |
| | | }; |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | JComboBoxItem[] teamGroupList = sysTeamGroupClassService.getList(); |
| | |
| | | frame1.setLayout(layout); |
| | | |
| | | 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, "æ¯"), |
| | | }; |
| | | |
| | | JComboBoxItem[] projectList = level1Service.getProjectList(); |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list[0], columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | |
| | | list[0] = handoverService.getList(projectId); |
| | | CommonTable.refreshTable(list[0], columnDto,table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table,jFrame,list[0]); |
| | |
| | | |
| | | public JPanel FileUpload(JFrame frame, Integer width, Integer heigth) { |
| | | JPanel jPanel = new JPanel(); |
| | | /*GridBagLayout layout = new GridBagLayout(); |
| | | jPanel.setLayout(layout);*/ |
| | | jPanel.setPreferredSize(new Dimension(width, heigth)); |
| | | |
| | | JTable table = new JTable(); |
| | |
| | | |
| | | |
| | | JScrollPane scrolltable = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | |
| | | scrolltable.setPreferredSize(new Dimension(width-150,heigth)); |
| | | scrolltable.setViewportView(table); |
| | | scrolltable.getViewport().setBackground(Color.WHITE); |
| | | |
| | | JButton browseButton = new JButton("éæ©æä»¶"); |
| | | jPanel.add(browseButton); |
| | | |
| | | jPanel.add(scrolltable); |
| | | jPanel.add(browseButton); |
| | | |
| | | |
| | | browseButton.addActionListener(new ActionListener() { |
| | | @Override |
| | |
| | | private String tmpPath; |
| | | |
| | | public void FileUpload(List<ColumnDto> columnDto, JTable subTable, JFrame jFrame) { |
| | | frame = new JFrame("导å
¥"); |
| | | frame = new JFrame("导å
¥ä¸çº§ç½ç»å¾"); |
| | | frame.setSize(900, 600); |
| | | frame.setResizable(true); |
| | | frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | |
| | | @Override |
| | | public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
| | | super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
| | | setText(truncateText(value.toString(), 15)); // æªæææ¬ |
| | | if(value!=null){ |
| | | setText(truncateText(value.toString(), 15)); // æªæææ¬ |
| | | }else{ |
| | | setText(""); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç" |
| | | }; |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | List<DjJdgzNetworkLevel3> list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | level3ManageService.tableModelListener(list, subTable, jFrame); |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.*; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.progressTrack.service.*; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.utils.DownLoadTmpFile; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.table.DefaultTableModel; |
| | | import java.awt.*; |
| | | import java.awt.datatransfer.DataFlavor; |
| | | import java.awt.datatransfer.Transferable; |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.awt.event.ItemEvent; |
| | | import java.awt.event.ItemListener; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | |
| | | @Service |
| | | public class ImportTrackRecordService { |
| | | private JTable table; |
| | | private JFrame frame; |
| | | @Value("${data.imgDir}") |
| | | private String imgPath; |
| | | private File selectedFiles; |
| | | @Autowired |
| | | private Level3ManageService level3ManageService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3Service level3Service; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel2ListService level2ListService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel2Service level2Service; |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | @Autowired |
| | | private CabinService cabinService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel1Service level1Service; |
| | | @Autowired |
| | | private DjJdgzTrackRecordService djJdgzTrackRecordService; |
| | | @Value("${data.tmp-path}") |
| | | private String tmpPath; |
| | | |
| | | public void FileUpload(List<ColumnDto> columnDto, JTable subTable, JFrame jFrame) { |
| | | frame = new JFrame("导å
¥è·è¸ªè®°å½"); |
| | | frame.setSize(900, 600); |
| | | frame.setResizable(true); |
| | | frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | | frame.setLocationRelativeTo(null); |
| | | frame.setVisible(true); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | frame.setLayout(layout); |
| | | |
| | | table = new JTable(); |
| | | table.setRowHeight(40); |
| | | DefaultTableModel model = new DefaultTableModel(); |
| | | String[] columnIdentifiers = {"æä»¶å°å", "æä½"};//表头 |
| | | |
| | | final Long[] level1Id = {null}; |
| | | final Long[] level2Id = {null}; |
| | | final Long[] level2NodeId = {null}; |
| | | |
| | | JComboBoxItem[] projectList = level1Service.getProjectList(); |
| | | JComboBoxItem[] level2List = level2Service.getLevel2List(projectList[0].getId()); |
| | | JComboBoxItem[] level2NodeList = level2ListService.getNode(level2List[0].getId()); |
| | | level1Id[0] = projectList[0].getId(); |
| | | level2Id[0] = level2List[0].getId(); |
| | | level2NodeId[0] = level2NodeList[0].getId(); |
| | | |
| | | JLabel label0 = new JLabel("å·¥ç¨"); |
| | | JComboBox<JComboBoxItem> comboBox0 = new JComboBox<>(projectList); |
| | | |
| | | JLabel label1 = new JLabel("äºçº§ç½ç»å¾"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(); |
| | | comboBox1.setModel(new DefaultComboBoxModel<>(level2List)); |
| | | |
| | | JLabel label2 = new JLabel("äºçº§ç½ç»å¾èç¹"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(level2NodeList); |
| | | comboBox2.setRenderer(new DefaultListCellRenderer() { |
| | | @Override |
| | | public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
| | | super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
| | | if(value!=null){ |
| | | setText(truncateText(value.toString(), 15)); // æªæææ¬ |
| | | }else{ |
| | | setText(""); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | private String truncateText(String text, int maxLength) { |
| | | if (text.length() > maxLength) { |
| | | return text.substring(0, maxLength - 3) + "..."; |
| | | } |
| | | return text; |
| | | } |
| | | }); |
| | | |
| | | JComboBoxItem[] teamList1 = sysTeamGroupClassService.getTeamList(null); |
| | | |
| | | JLabel JLabel5 = new JLabel("ä¸ä¸"); |
| | | MultiSelectComboBox comboBox4 = new MultiSelectComboBox(teamList1); |
| | | comboBox4.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JButton downloadbtn = new JButton("è·è¸ªè®°å½å¯¼å
¥æ¨¡æ¿çæ"); |
| | | |
| | | comboBox0.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox0.getSelectedItem(); |
| | | if (selectedItem != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | level1Id[0] = selectedId; |
| | | |
| | | JComboBoxItem[] level2List = level2Service.getLevel2List(selectedId); |
| | | comboBox1.setModel(new DefaultComboBoxModel<>(level2List)); |
| | | comboBox2.setModel(new DefaultComboBoxModel<>()); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | comboBox1.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | if (selectedItem != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | level2Id[0] = selectedId; |
| | | |
| | | JComboBoxItem[] level2NodeList = level2ListService.getNode(selectedId); |
| | | comboBox2.setModel(new DefaultComboBoxModel<>(level2NodeList)); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | comboBox2.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | if (selectedItem != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | level2NodeId[0] = selectedId; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | downloadbtn.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | JComboBoxItem selectedItem0 = (JComboBoxItem) comboBox0.getSelectedItem(); |
| | | JComboBoxItem selectedItem1 = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem selectedItem2 = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Long level1Id = selectedItem0 == null? null:selectedItem0.getId(); |
| | | Long level2Id = selectedItem1 == null? null:selectedItem1.getId(); |
| | | Long level2NodeId = selectedItem2 == null? null:selectedItem2.getId(); |
| | | Set<JComboBoxItem> selectedItems = comboBox4.getSelectedItems(); |
| | | StringBuilder selectedIds = new StringBuilder(); |
| | | for (JComboBoxItem item : selectedItems) { |
| | | selectedIds.append(item.getId()).append(","); |
| | | } |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getListByImport(level1Id,level2Id,level2NodeId,selectedIds.toString()); |
| | | DownLoadTmpFile.buildTrack(list,tmpPath + "è·è¸ªè®°å½å¯¼å
¥æ¨¡æ¿.xlsx", frame); |
| | | } |
| | | }); |
| | | |
| | | JScrollPane scrolltable = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | |
| | | scrolltable.setViewportView(table); |
| | | scrolltable.getViewport().setBackground(Color.WHITE); |
| | | |
| | | JButton browseButton = new JButton("éæ©æä»¶"); |
| | | JButton uploadButton = new JButton("ä¸ä¼ æä»¶"); |
| | | |
| | | frame.add(label0, new GBC(0, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame.add(comboBox0, new GBC(1, 0, 2, 1).setAnchor(GBC.SOUTHWEST).setFill(GBC.BOTH).setInsets(5)); |
| | | |
| | | frame.add(label1, new GBC(0, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame.add(comboBox1, new GBC(1, 1, 2, 1).setAnchor(GBC.SOUTHWEST).setFill(GBC.BOTH).setInsets(5)); |
| | | |
| | | frame.add(label2, new GBC(0, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame.add(comboBox2, new GBC(1, 2, 2, 1).setAnchor(GBC.SOUTHWEST).setFill(GBC.BOTH).setInsets(5)); |
| | | |
| | | frame.add(JLabel5, new GBC(0, 3, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame.add(comboBox4, new GBC(1, 3, 3, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame.add(downloadbtn, new GBC(0, 4, 2, 1).setFill(GBC.BOTH).setInsets(5)); |
| | | |
| | | frame.add(browseButton, new GBC(0, 5, 1, 1).setWeight(0, 1).setInsets(5)); |
| | | frame.add(scrolltable, new GBC(1, 5, 3, 1).setFill(GBC.BOTH).setWeight(0, 1).setInsets(5)); |
| | | |
| | | frame.add(uploadButton, new GBC(0, 6, 4, 1).setWeight(1, 0)); |
| | | |
| | | browseButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | Boolean flag = true; |
| | | // ä¿åå½åçå¤è§è®¾ç½® |
| | | LookAndFeel savedLookAndFeel = UIManager.getLookAndFeel(); |
| | | |
| | | // 设置æä»¶éæ©å¨å¤è§ |
| | | try { |
| | | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | |
| | | JFileChooser fileChooser = new JFileChooser(); |
| | | |
| | | fileChooser.setDialogTitle("éæ©æä»¶"); |
| | | fileChooser.setPreferredSize(new Dimension(800, 500)); |
| | | |
| | | |
| | | fileChooser.setMultiSelectionEnabled(true); |
| | | |
| | | //æ¢å¤å¤è§ï¼é¿å
æ¹åææç»ä»¶å¤è§ |
| | | try { |
| | | UIManager.setLookAndFeel(savedLookAndFeel); |
| | | } catch (UnsupportedLookAndFeelException ed) { |
| | | ed.printStackTrace(); |
| | | } |
| | | |
| | | int result = fileChooser.showOpenDialog(frame); |
| | | if (result == JFileChooser.FILES_ONLY) { |
| | | selectedFiles = fileChooser.getSelectedFile(); |
| | | |
| | | Integer oldNum = model.getRowCount(); |
| | | String[][] data = new String[oldNum + 1][2]; |
| | | for (int i = 0; i < oldNum; i++) { |
| | | data[i][0] = model.getValueAt(i, 0).toString(); |
| | | } |
| | | |
| | | String suffix = selectedFiles.getName().substring(selectedFiles.getName().lastIndexOf(".")); |
| | | if (suffix.equals(".xlsx") || suffix.equals(".xls")) { |
| | | data[oldNum][0] = selectedFiles.getPath(); |
| | | } else { |
| | | flag = false; |
| | | |
| | | } |
| | | |
| | | if (!flag) { |
| | | JOptionPane.showMessageDialog(null, "åªè½ä¸ä¼ .xlsxæ.xlsçæä»¶ï¼ä¸ä¸è¶
è¿2G", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | |
| | | model.setDataVector(data, columnIdentifiers); |
| | | table.setModel(model); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(600); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(100); |
| | | |
| | | |
| | | table.getColumnModel().getColumn(0).setCellRenderer(new TableViewRenderer()); |
| | | table.getColumnModel().getColumn(1).setCellRenderer(new TableCellRendererButton()); |
| | | table.getColumnModel().getColumn(1).setCellEditor(new TableCellEditorButton(null, null)); |
| | | |
| | | } else { |
| | | Object[] options = {"OK ", "CANCEL "}; |
| | | JOptionPane.showOptionDialog(null, "éæ©çæä»¶ä¸æ£ç¡® ", "æç¤º", JOptionPane.DEFAULT_OPTION, |
| | | JOptionPane.WARNING_MESSAGE, null, options, options[0]); |
| | | } |
| | | } |
| | | }); |
| | | uploadButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | // å建æè½¬çå¾
æ¡çå®ä¾ï¼å设WaitUtilæ¯ä¸ä¸ªèªå®ä¹çSwingç»ä»¶ï¼ |
| | | final WaitUtil waitUtil = new WaitUtil(imgPath, "æä»¶æ£å¨å¯¼å
¥ï¼è¯·ç¨å"); |
| | | |
| | | // å¼å§ä¸ä¼ æä»¶ç弿¥ä»»å¡ |
| | | SwingWorker<String, Void> sw = new SwingWorker<String, Void>() { |
| | | @Override |
| | | protected String doInBackground() throws Exception { |
| | | // ä¸ä¼ æä»¶çé»è¾ |
| | | StringBuilder result = new StringBuilder(); |
| | | |
| | | // ä»ç¬¬ä¸åï¼ç´¢å¼ä¸º0ï¼è·åæ°æ® |
| | | String data = model.getValueAt(0, 0).toString(); |
| | | // å°æ°æ®åæ¢è¡ç¬¦æ¼æ¥å°StringBuilderä¸ |
| | | result.append(data); |
| | | |
| | | |
| | | String filePath = result.toString(); |
| | | String flag = level3Service.importDiagramFromExcel(filePath, level1Id[0], level2Id[0], level2NodeId[0]); |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | protected void done() { |
| | | try { |
| | | // è·åä¸ä¼ ç»æï¼å¨è¿ä¸ªä¾åä¸ï¼æä»¬å设ä¸ä¼ æ¹æ³è¿åBooleanç±»åï¼ |
| | | String uploadSucceeded = get(); |
| | | |
| | | // å·æ°è¡¨æ ¼æ°æ®ï¼å¦æä¸ä¼ æåï¼ |
| | | if (uploadSucceeded.equals("true")) { |
| | | waitUtil.dispose(); |
| | | frame.dispose(); |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | List<DjJdgzNetworkLevel3> list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | level3ManageService.tableModelListener(list, subTable, jFrame); |
| | | System.out.println("导å
¥æåæ¶é´" + new Date()); |
| | | } else { |
| | | waitUtil.dispose(); |
| | | JOptionPane.showMessageDialog(null, uploadSucceeded, "æç¤º", JOptionPane.ERROR_MESSAGE); |
| | | } |
| | | |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | waitUtil.dispose(); |
| | | } |
| | | } |
| | | }; |
| | | // æ§è¡å¼æ¥ä»»å¡ |
| | | sw.execute(); |
| | | waitUtil.setVisible(true); |
| | | } |
| | | }); |
| | | |
| | | scrolltable.setTransferHandler(new TransferHandler() { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Override |
| | | public boolean importData(JComponent comp, Transferable t) { |
| | | try { |
| | | Boolean flag = true; |
| | | Object o = t.getTransferData(DataFlavor.javaFileListFlavor); |
| | | String filepath = o.toString(); |
| | | if (filepath.startsWith("[")) { |
| | | filepath = filepath.substring(1); |
| | | } |
| | | if (filepath.endsWith("]")) { |
| | | filepath = filepath.substring(0, filepath.length() - 1); |
| | | } |
| | | String[] filepathArr = filepath.split(", "); |
| | | Integer oldNum = model.getRowCount(); |
| | | String[][] data = new String[oldNum + filepathArr.length][2]; |
| | | for (int i = 0; i < oldNum; i++) { |
| | | data[i][0] = model.getValueAt(i, 0).toString(); |
| | | } |
| | | for (int i = 0; i < filepathArr.length; i++) { |
| | | if (filepathArr[i].contains(".xlsx") || filepathArr[i].contains(".xls")) { |
| | | data[i + oldNum][0] = filepathArr[i]; |
| | | } else { |
| | | flag = false; |
| | | break; |
| | | } |
| | | } |
| | | if (!flag) { |
| | | JOptionPane.showMessageDialog(null, "åªè½ä¸ä¼ .xlsxæ.xlsçæä»¶ï¼ä¸ä¸è¶
è¿2G\"", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return flag; |
| | | } |
| | | model.setDataVector(data, columnIdentifiers); |
| | | table.setModel(model); |
| | | table.getColumnModel().getColumn(0).setPreferredWidth(650); |
| | | table.getColumnModel().getColumn(1).setPreferredWidth(80); |
| | | |
| | | table.getColumnModel().getColumn(0).setCellRenderer(new TableViewRenderer()); |
| | | table.getColumnModel().getColumn(1).setCellRenderer(new TableCellRendererButton()); |
| | | table.getColumnModel().getColumn(1).setCellEditor(new TableCellEditorButton(null, null)); |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean canImport(JComponent comp, DataFlavor[] flavors) { |
| | | for (int i = 0; i < flavors.length; i++) { |
| | | if (DataFlavor.javaFileListFlavor.equals(flavors[i])) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | final Boolean[] isFirstLoadData = {true}; |
| | |
| | | if (!isFirstLoadData[0]) { |
| | | CommonTable.refreshTable(list, columnDto,table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table,jFrame); |
| | |
| | | frame1.setLayout(layout); |
| | | JComboBoxItem[] shipList = djJdgzShipService.getListByItem(); |
| | | JComboBoxItem[] levelList = { |
| | | new JComboBoxItem(1, "ä¸çº§"), |
| | | new JComboBoxItem(2, "äºçº§"), |
| | | new JComboBoxItem(3, "ä¸çº§"), |
| | | new JComboBoxItem(1L, "ä¸çº§"), |
| | | new JComboBoxItem(1L, "äºçº§"), |
| | | new JComboBoxItem(1L, "ä¸çº§"), |
| | | }; |
| | | |
| | | JLabel JLabel1 = new JLabel("çå·"); |
| | |
| | | data.setStartDate(sdFormat.format(beginDate.getDate())); |
| | | data.setYear((Integer) yearPicker.getValue()); |
| | | data.setAdventDay(7); |
| | | data.setProjectName(ship.getName()+"-"+yearPicker.getValue() + "-" + level.getName()); |
| | | data.setProjectName(level.getName()+"ä¿®ç"+ship.getName()+"项ç®"); |
| | | level1Service.insert(data); |
| | | list = level1Service.getList(ship.getId()); |
| | | CommonTable.refreshTable(list,columnDto,table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table,jFrame); |
| | | frame1.dispose(); |
| | |
| | | List<TableButton> buttonList = new ArrayList<>(); |
| | | buttonList.add(new TableButton("del", "å é¤")); |
| | | |
| | | columnDto.add(new ColumnDto("åºå·", "", 50, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("åºå·", "", 50, "autoCreate", true, null,null)); |
| | | //columnDto.add(new ColumnDto("å·¥ç¨ä¸ä¸", "majorName", 180, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("èç¹åç§°", "ProcessName", 160, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("è¦æ±å®ææ¶é´", "requiredCompletionTime", 120, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("èç¹åç§°", "ProcessName", 160, null, true, null,null)); |
| | | columnDto.add(new ColumnDto("è¦æ±å®ææ¶é´", "requiredCompletionTime", 120, "selectDate", true, null,null)); |
| | | columnDto.add(new ColumnDto("æä½", "", 85, "", true, buttonList,null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | final Boolean[] isFirstLoadData = {true}; |
| | |
| | | if (!isFirstLoadData[0]) { |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table, jFrame); |
| | |
| | | list = level2Service.getList(level1Data.getShipId()); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame); |
| | | frame1.dispose(); |
| | |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("å·¥ç¨"); |
| | |
| | | |
| | | columnDto = new ArrayList<>(); |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("åºå·", "", (width - 10) / 10, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", (width - 10) / 10, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", (width - 10) / 10, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", (width - 10) / 10, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", (width - 10) / 10, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", (width - 10) / 10, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§ç½ç»å¾èç¹åç§°", "level1NodeName", (width - 10) / 10, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("äºçº§ç½ç»å¾èç¹åç§°", "level2NodeName", (width - 10) / 10, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§ç½ç»å¾åç§°", "name", (width - 10) / 10, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("æä½", "", (width - 10) / 10, "", true, buttonList, null)); |
| | | columnDto.add(new ColumnDto("åºå·", "", 176, "autoCreate", false, null, null)); |
| | | //columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", 150, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 176, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 176, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", 176, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", 176, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§ç½ç»å¾èç¹åç§°", "level1NodeName", 176, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("äºçº§ç½ç»å¾èç¹åç§°", "level2NodeName", 185, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§ç½ç»å¾åç§°", "name", 176, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("æä½", "", 190, "", true, buttonList, null)); |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | } |
| | |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(list, table, jFrame); |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | } |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | } |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | } |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | } |
| | |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | |
| | | JLabel JLabel1 = new JLabel("å·¥ç¨"); |
| | |
| | | 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); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(list, table, jFrame); |
| | | frame1.dispose(); |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.MultiSelectComboBox; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.Dto.TableNodeDto; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.model.DjJdgzShip; |
| | | import com.example.server.progressTrack.service.*; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.event.TableModelEvent; |
| | | import javax.swing.table.DefaultTableModel; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Service |
| | | public class Level3View2Service { |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3Service level3Service; |
| | | @Autowired |
| | | private DjJdgzShipService djJdgzShipService; |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | @Autowired |
| | | private CabinService cabinService; |
| | | |
| | | private JTable table; |
| | | private List<TableNodeDto> list; |
| | | private Map<String, Long> shipMap = new HashMap<>(); |
| | | private List<ColumnDto> columnDto; |
| | | |
| | | |
| | | public JPanel createTable(Integer width, Integer height) { |
| | | JPanel panel = new JPanel(); |
| | | |
| | | JPanel topJpanel = new JPanel(); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | topJpanel.setLayout(layout); |
| | | topJpanel.setPreferredSize(new Dimension(width, 100)); |
| | | topJpanel.setBackground(Color.WHITE); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | | |
| | | List<DjJdgzShip> shipList = djJdgzShipService.getList(); |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("å·¥ç¨"); |
| | | JComboBox comboBox = new JComboBox(); |
| | | comboBox.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JLabel JLabel1 = new JLabel("é¨é¨"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(deptList); |
| | | comboBox1.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JComboBoxItem[] teamList1 = sysTeamGroupClassService.getTeamList(deptList[0].getId()); |
| | | |
| | | JLabel JLabel2 = new JLabel("ä¸ä¸"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(teamList1); |
| | | comboBox2.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JLabel JLabel3 = new JLabel("è±å®¤"); |
| | | JComboBox<JComboBoxItem> comboBox3 = new JComboBox<>(cabinList); |
| | | comboBox3.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JLabel JLabel4 = new JLabel("ç±»å«"); |
| | | JComboBox<String> comboBox4 = new JComboBox<>(typeList); |
| | | comboBox4.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | JTextField sb = new JTextField(16); |
| | | JButton query = new JButton("æ¥è¯¢"); |
| | | |
| | | topJpanel.add(JLabel0, new GBC(0, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox, new GBC(1, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | topJpanel.add(JLabel1, new GBC(2, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox1, new GBC(3, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | topJpanel.add(JLabel2, new GBC(4, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox2, new GBC(5, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | topJpanel.add(JLabel3, new GBC(6, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox3, new GBC(7, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | topJpanel.add(JLabel4, new GBC(8, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox4, new GBC(9, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | topJpanel.add(sb, new GBC(0, 1, 2, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(query, new GBC(2, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | list = level3Service.getNodeList(shipList.get(0).getId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | |
| | | columnDto = new ArrayList<>(); |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("åºå·", "", 227, "autoCreate", false, null, null)); |
| | | //columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", 150, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤åç§°", "name", 227, null, true, null, null)); |
| | | columnDto.add(new ColumnDto("è®¾å¤æå¸åºè±", "time1Color", 227, "Circle", true, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤å交", "time2Color", 227, "Circle", true, null, null)); |
| | | columnDto.add(new ColumnDto("ææ£é´å®", "time3Color", 227, "Circle", true, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤è¿å", "time4Color", 227, "Circle", true, null, null)); |
| | | columnDto.add(new ColumnDto("åè£
", "time5Color", 227, "Circle", true, null, null)); |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | String content = comboBox.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | } |
| | | }); |
| | | comboBox1.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | if (selectedItem.getId() != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(selectedId); |
| | | comboBox2.setModel(new DefaultComboBoxModel<>(teamList)); |
| | | comboBox2.setSelectedIndex(0); |
| | | |
| | | String content = comboBox.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | comboBox2.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | String content = comboBox.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | } |
| | | }); |
| | | comboBox3.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | String content = comboBox.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | } |
| | | }); |
| | | comboBox4.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | String content = comboBox.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | } |
| | | }); |
| | | |
| | | query.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | list = level3Service.getNodeList(null, null, null, null, null,sb.getText()); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | 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()); |
| | | |
| | | |
| | | 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, height - 120)); |
| | | centerJpanel.add(scrollPane); |
| | | |
| | | return panel; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @Autowired |
| | | private Level3ViewService level3ViewService; |
| | | @Autowired |
| | | private Level3View2Service level3View2Service; |
| | | @Autowired |
| | | private TrackRecordManageService trackRecordManageService; |
| | | @Autowired |
| | | private HandoverService handoverService; |
| | | @Autowired |
| | | private DataSyncManageService dataSyncManageService; |
| | | private DataImportManageService dataImportManageService; |
| | | @Autowired |
| | | private DataExportManageService dataExportManageService; |
| | | @Autowired |
| | | private UserManageService userManageService; |
| | | @Autowired |
| | |
| | | private SubunitService subunitService; |
| | | @Autowired |
| | | private TeamGroupManageService teamGroupManageService; |
| | | @Autowired |
| | | private ConfigManageService configManageService; |
| | | |
| | | @Autowired |
| | | private Main main; |
| | |
| | | JPanel level3Manage = level3ManageService.createTable(width, height, frame); |
| | | main.showTab("ä¸çº§ç½ç»å¾ç®¡ç", level3Manage, tree); |
| | | } else if (nodeName.equals("ä¸çº§ç½ç»å¾æ¥ç")) { |
| | | JPanel level3View = level3ViewService.createTable(width, height); |
| | | JPanel level3View = level3View2Service.createTable(width, height); |
| | | main.showTab("ä¸çº§ç½ç»å¾æ¥ç", level3View, tree); |
| | | } else if (nodeName.equals("项ç®è¿åº¦è¡¨")) { |
| | | JPanel trackRecord = trackRecordManageService.createTable(width, height, frame); |
| | |
| | | } else if (nodeName.equals("äº¤æ¥æ
åµ")) { |
| | | JPanel handover = handoverService.createTable(width, height, frame); |
| | | main.showTab("äº¤æ¥æ
åµ", handover, tree); |
| | | } else if (nodeName.equals("æ°æ®åæ¥")) { |
| | | JPanel dataSync = dataSyncManageService.createTable(width, height, frame); |
| | | main.showTab("æ°æ®åæ¥", dataSync, tree); |
| | | } else if (nodeName.equals("ç¨æ·ç®¡ç")) { |
| | | } else if (nodeName.equals("æ°æ®å¯¼å
¥")) { |
| | | JPanel dataImport = dataImportManageService.createTable(width, height, frame); |
| | | main.showTab("æ°æ®å¯¼å
¥", dataImport, tree); |
| | | } else if (nodeName.equals("æ°æ®å¯¼åº")) { |
| | | JPanel dataExport = dataExportManageService.createTable(width, height, frame); |
| | | main.showTab("æ°æ®å¯¼åº", dataExport, tree); |
| | | }else if (nodeName.equals("ç¨æ·ç®¡ç")) { |
| | | JPanel user = userManageService.createTable(width, height, frame); |
| | | main.showTab("ç¨æ·ç®¡ç", user, tree); |
| | | } else if (nodeName.equals("æå¸è¿åº¦è¡¨")) { |
| | |
| | | main.showTab("åé¨ä»¶é
ç½®", subunit, tree); |
| | | }else if (nodeName.equals("ä¸ä¸ç®¡ç")) { |
| | | JPanel teamGroup = teamGroupManageService.createTable(width, height, frame); |
| | | main.showTab("åé¨ä»¶é
ç½®", teamGroup, tree); |
| | | main.showTab("ä¸ä¸ç®¡ç", teamGroup, tree); |
| | | }else if (nodeName.equals("å¹³å°é
ç½®")) { |
| | | JPanel config = configManageService.createTable(width, height, frame); |
| | | main.showTab("å¹³å°é
ç½®", config, tree); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨åç§°", "ProjectName", 280, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("çç»ä¸ä¸", "teamGroupName", 150, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("çç»ä¸ä¸", "teamgroupName", 150, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§èç¹", "level1NodeName", 150, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("äºçº§èç¹", "level2NodeName", 150, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("项ç®åç§°", "level3NetworkName", 150, null, false, null,null)); |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | JScrollPane scrollTable = new JScrollPane(table); |
| | | frame1.add(scrollTable); |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.ComplexHeaderUI; |
| | | import com.example.client.utils.ComplexTable; |
| | | import com.example.client.utils.ComplexTableUI; |
| | | import com.example.server.progressTrack.Dto.StatistDismantDto; |
| | | import com.example.server.progressTrack.model.DjJdgzShip; |
| | | import com.example.server.progressTrack.service.DjJdgzDismantTrackService; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.table.DefaultTableModel; |
| | | import javax.swing.table.TableModel; |
| | | import java.awt.*; |
| | | import java.awt.event.ItemEvent; |
| | | import java.awt.event.ItemListener; |
| | | import java.awt.event.WindowAdapter; |
| | | import java.awt.event.WindowEvent; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Vector; |
| | | |
| | | |
| | | @Service |
| | | public class StatisDismant2Service { |
| | | @Autowired |
| | | private DjJdgzDismantTrackService djJdgzDismantTrackService; |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | |
| | | public void createTable(JFrame jFrame, Long level1Id) { |
| | | JFrame frame1 = new JFrame("æå¸è¿åº¦ç»è®¡è¯¦æ
表"); |
| | | frame1.setSize(1500, 800); |
| | | frame1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | | frame1.setLocationRelativeTo(null); |
| | | frame1.setVisible(true); |
| | | frame1.addWindowListener(new WindowAdapter() { |
| | | //æ·»å 第äºä¸ªçé¢çå
³éäºä»¶: |
| | | public void windowClosing(WindowEvent e) { |
| | | //æ·»å äºä»¶: |
| | | jFrame.setEnabled(true);//å°ä¸»çé¢åè®¾ç½®ä¸ºå¯æä½ç |
| | | } |
| | | }); |
| | | |
| | | |
| | | JPanel topJpanel = new JPanel(); |
| | | topJpanel.setPreferredSize(new Dimension(1500, 40)); |
| | | topJpanel.setBackground(Color.WHITE); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(1500 - 20, 800 - 40)); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | |
| | | |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | |
| | | |
| | | JLabel JLabel1 = new JLabel("é¨é¨"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(deptList); |
| | | comboBox1.setPreferredSize(new Dimension(185, 28)); |
| | | comboBox1.setSelectedIndex(1); |
| | | |
| | | JComboBoxItem[] teamList1 = sysTeamGroupClassService.getTeamList(deptList[1].getId()); |
| | | |
| | | JLabel JLabel2 = new JLabel("ä¸ä¸"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(teamList1); |
| | | comboBox2.setPreferredSize(new Dimension(185, 28)); |
| | | |
| | | topJpanel.add(JLabel1); |
| | | topJpanel.add(comboBox1); |
| | | topJpanel.add(JLabel2); |
| | | topJpanel.add(comboBox2); |
| | | |
| | | final List<StatistDismantDto>[] list = new List[]{djJdgzDismantTrackService.getStatist2(level1Id, deptList[1].getId())}; |
| | | |
| | | Object[][] headerRows = new Object[2][9]; |
| | | headerRows[0] = new Object[]{"è±å®¤", "æ»æ°", ComplexTable.mergeCellX, "æå¸è¿åº¦å®æ", ComplexTable.mergeCellX, "åé¨ä»¶", ComplexTable.mergeCellX, ComplexTable.mergeCellX, ComplexTable.mergeCellX,}; |
| | | //æ¤å¤2-5æ¯ä¸ä¼æ¾ç¤ºåºæ¥çï¼å 为1-4åä¸åå¹¶äºä¸è¡ + åå³åå¹¶äºä¸å ï¼ è2-5被è¿ä¸ªç©å½¢èå´å
æ¬äº |
| | | headerRows[1] = new Object[]{ComplexTable.mergeCellY, "设å¤", "åé¨ä»¶", "设å¤", "åé¨ä»¶", "å·²æå¸", "å·²åºè±", "å·²éé", "å·²å
¥åº"}; |
| | | |
| | | String[][] body = new String[list[0].size()][9]; |
| | | |
| | | for (int i = 0; i < list[0].size(); i++) { |
| | | StatistDismantDto data = list[0].get(i); |
| | | body[i][0] = data.getName(); |
| | | body[i][1] = String.valueOf(data.getSbsl()); |
| | | body[i][2] = String.valueOf(data.getZbjsl()); |
| | | body[i][3] = String.valueOf(data.getSbcxsl()); |
| | | body[i][4] = String.valueOf(data.getZbjcxsl()); |
| | | body[i][5] = String.valueOf(data.getDismantsl()); |
| | | body[i][6] = String.valueOf(data.getExitsl()); |
| | | body[i][7] = String.valueOf(data.getReturnsl()); |
| | | body[i][8] = String.valueOf(data.getWarehousesl()); |
| | | } |
| | | |
| | | JTable jTable = new ComplexTable(headerRows, body, 160); |
| | | JScrollPane scrollTable = new JScrollPane(jTable); |
| | | scrollTable.setPreferredSize(new Dimension(1500 - 20, 800 - 40)); |
| | | centerJpanel.add(scrollTable); |
| | | frame1.add(topJpanel, BorderLayout.NORTH); |
| | | frame1.add(centerJpanel, BorderLayout.CENTER); |
| | | comboBox1.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | if (selectedItem != null && selectedItem.getId() != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(selectedId); |
| | | comboBox2.setModel(new DefaultComboBoxModel<>(teamList)); |
| | | comboBox2.setSelectedIndex(0); |
| | | |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Long id = null; |
| | | if (team.getId() != null) { |
| | | id = team.getId(); |
| | | } else { |
| | | id = dept.getId(); |
| | | } |
| | | list[0] = djJdgzDismantTrackService.getStatist2(level1Id, id); |
| | | |
| | | Object[][] headerRows = new Object[2][9]; |
| | | headerRows[0] = new Object[]{"é¨é¨/ä¸ä¸", "æ»æ°", ComplexTable.mergeCellX, "æå¸è¿åº¦å®æ", ComplexTable.mergeCellX, "åé¨ä»¶", ComplexTable.mergeCellX, ComplexTable.mergeCellX, ComplexTable.mergeCellX,}; |
| | | //æ¤å¤2-5æ¯ä¸ä¼æ¾ç¤ºåºæ¥çï¼å 为1-4åä¸åå¹¶äºä¸è¡ + åå³åå¹¶äºä¸å ï¼ è2-5被è¿ä¸ªç©å½¢èå´å
æ¬äº |
| | | headerRows[1] = new Object[]{ComplexTable.mergeCellY, "设å¤", "åé¨ä»¶", "设å¤", "åé¨ä»¶", "å·²æå¸", "å·²åºè±", "å·²éé", "å·²å
¥åº"}; |
| | | |
| | | String[][] body = new String[list[0].size()][9]; |
| | | |
| | | for (int i = 0; i < list[0].size(); i++) { |
| | | StatistDismantDto data = list[0].get(i); |
| | | body[i][0] = data.getName(); |
| | | body[i][1] = String.valueOf(data.getSbsl()); |
| | | body[i][2] = String.valueOf(data.getZbjsl()); |
| | | body[i][3] = String.valueOf(data.getSbcxsl()); |
| | | body[i][4] = String.valueOf(data.getZbjcxsl()); |
| | | body[i][5] = String.valueOf(data.getDismantsl()); |
| | | body[i][6] = String.valueOf(data.getExitsl()); |
| | | body[i][7] = String.valueOf(data.getReturnsl()); |
| | | body[i][8] = String.valueOf(data.getWarehousesl()); |
| | | } |
| | | Vector<Vector<Object>> dataVector = new Vector<>(); |
| | | for (Object[] row : body) { |
| | | dataVector.add(new Vector<>(Arrays.asList(row))); |
| | | } |
| | | |
| | | Vector<Object> columnIdentifiers = new Vector<>(Arrays.asList(headerRows[1])); |
| | | |
| | | DefaultTableModel model = (DefaultTableModel) jTable.getModel(); |
| | | model.setDataVector(dataVector, columnIdentifiers); |
| | | |
| | | // 设置å宽 |
| | | for (int i = 0; i < headerRows[1].length; i++) { |
| | | jTable.getColumnModel().getColumn(i).setPreferredWidth(160); |
| | | } |
| | | |
| | | // 设置表头UI |
| | | jTable.getTableHeader().setUI(new ComplexHeaderUI(headerRows, jTable)); |
| | | |
| | | // è®¾ç½®è¡¨æ ¼UI |
| | | jTable.setUI(new ComplexTableUI(body, jTable)); |
| | | |
| | | // éæ°æ¸²æè¡¨æ ¼ |
| | | jTable.repaint(); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | comboBox2.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Long id = null; |
| | | if (team.getId() != null) { |
| | | id = team.getId(); |
| | | } else { |
| | | id = dept.getId(); |
| | | } |
| | | list[0] = djJdgzDismantTrackService.getStatist2(level1Id, id); |
| | | |
| | | Object[][] headerRows = new Object[2][9]; |
| | | headerRows[0] = new Object[]{"é¨é¨/ä¸ä¸", "æ»æ°", ComplexTable.mergeCellX, "æå¸è¿åº¦å®æ", ComplexTable.mergeCellX, "åé¨ä»¶", ComplexTable.mergeCellX, ComplexTable.mergeCellX, ComplexTable.mergeCellX,}; |
| | | //æ¤å¤2-5æ¯ä¸ä¼æ¾ç¤ºåºæ¥çï¼å 为1-4åä¸åå¹¶äºä¸è¡ + åå³åå¹¶äºä¸å ï¼ è2-5被è¿ä¸ªç©å½¢èå´å
æ¬äº |
| | | headerRows[1] = new Object[]{ComplexTable.mergeCellY, "设å¤", "åé¨ä»¶", "设å¤", "åé¨ä»¶", "å·²æå¸", "å·²åºè±", "å·²éé", "å·²å
¥åº"}; |
| | | |
| | | String[][] body = new String[list[0].size()][9]; |
| | | |
| | | for (int i = 0; i < list[0].size(); i++) { |
| | | StatistDismantDto data = list[0].get(i); |
| | | body[i][0] = data.getName(); |
| | | body[i][1] = String.valueOf(data.getSbsl()); |
| | | body[i][2] = String.valueOf(data.getZbjsl()); |
| | | body[i][3] = String.valueOf(data.getSbcxsl()); |
| | | body[i][4] = String.valueOf(data.getZbjcxsl()); |
| | | body[i][5] = String.valueOf(data.getDismantsl()); |
| | | body[i][6] = String.valueOf(data.getExitsl()); |
| | | body[i][7] = String.valueOf(data.getReturnsl()); |
| | | body[i][8] = String.valueOf(data.getWarehousesl()); |
| | | } |
| | | Vector<Vector<Object>> dataVector = new Vector<>(); |
| | | for (Object[] row : body) { |
| | | dataVector.add(new Vector<>(Arrays.asList(row))); |
| | | } |
| | | |
| | | Vector<Object> columnIdentifiers = new Vector<>(Arrays.asList(headerRows[1])); |
| | | |
| | | DefaultTableModel model = (DefaultTableModel) jTable.getModel(); |
| | | model.setDataVector(dataVector, columnIdentifiers); |
| | | |
| | | // 设置å宽 |
| | | for (int i = 0; i < headerRows[1].length; i++) { |
| | | jTable.getColumnModel().getColumn(i).setPreferredWidth(160); |
| | | } |
| | | |
| | | // 设置å宽 |
| | | for (int i = 0; i < headerRows[1].length; i++) { |
| | | jTable.getColumnModel().getColumn(i).setPreferredWidth(160); |
| | | } |
| | | |
| | | // 设置表头UI |
| | | jTable.getTableHeader().setUI(new ComplexHeaderUI(headerRows, jTable)); |
| | | |
| | | // è®¾ç½®è¡¨æ ¼UI |
| | | jTable.setUI(new ComplexTableUI(body, jTable)); |
| | | |
| | | // éæ°æ¸²æè¡¨æ ¼ |
| | | jTable.repaint(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | frame1.setVisible(true); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | private DjJdgzDismantTrackService djJdgzDismantTrackService; |
| | | |
| | | public void createTable(JFrame jFrame,Long level1Id) { |
| | | JFrame frame1 = new JFrame("ç»è®¡æ¥è¡¨"); |
| | | frame1.setSize(1200, 700); |
| | | frame1.setResizable(false); |
| | | JFrame frame1 = new JFrame("æå¸è¿åº¦ç»è®¡æ»è¡¨"); |
| | | frame1.setSize(1500, 800); |
| | | frame1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | | frame1.setLocationRelativeTo(null); |
| | | frame1.setVisible(true); |
| | |
| | | |
| | | |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | JScrollPane scrollTable = new JScrollPane(table);*/ |
| | | //frame1.add(scrollTable); |
| | |
| | | body[i][8] = String.valueOf(data.getWarehousesl()); |
| | | } |
| | | |
| | | JScrollPane scrollTable = new JScrollPane(new ComplexTable(headerRows , body,130)); |
| | | JScrollPane scrollTable = new JScrollPane(new ComplexTable(headerRows , body,160)); |
| | | frame1.add(scrollTable); |
| | | frame1.setVisible(true); |
| | | } |
| | |
| | | |
| | | |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | JScrollPane scrollTable = new JScrollPane(table);*/ |
| | | //frame1.add(scrollTable); |
| | |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzDismantTrack; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.progressTrack.service.DjJdgzDismantTrackService; |
| | | import com.example.server.progressTrack.service.DjJdgzNetworkLevel3Service; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | |
| | | private CabinService cabinService; |
| | | private List<ColumnDto> columnDto; |
| | | private JTable trackTable; |
| | | private DjJdgzNetworkLevel3 nowLevel3; |
| | | |
| | | public JPanel createTrack(Integer width, Integer height, DjJdgzNetworkLevel3 djJdgzNetworkLevel3,JFrame frame) { |
| | | nowLevel3 = djJdgzNetworkLevel3; |
| | | JPanel panel = new JPanel(); |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | |
| | | topJpanel.add(btnInsert); |
| | | |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | List<DjJdgzDismantTrack> list = djJdgzDismantTrackService.getList(djJdgzNetworkLevel3.getId(), null); |
| | | List<DjJdgzDismantTrack> list = djJdgzDismantTrackService.getList(nowLevel3.getId(), null); |
| | | List<TableButton> buttonList = new ArrayList<>(); |
| | | buttonList.add(new TableButton("edit", "ç¼è¾")); |
| | | buttonList.add(new TableButton("del", "å é¤")); |
| | |
| | | trackTable = CommonTable.createCommonTable(list, columnDto); |
| | | trackTable.setPreferredSize(new Dimension(width , height)); |
| | | trackTable.setRowHeight(25); |
| | | trackTable.setAutoCreateRowSorter(true); |
| | | |
| | | trackTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(trackTable, frame,list,columnDto); |
| | |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser user = (SysUser) CacheUtils.get("user", "user"); |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(djJdgzNetworkLevel3.getTeamgroupId())) { |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(nowLevel3.getTeamgroupId().toString())) { |
| | | DjJdgzDismantTrack djJdgzDismantTrack = new DjJdgzDismantTrack(); |
| | | djJdgzDismantTrack.setLevel3NetworkId(djJdgzNetworkLevel3.getId()); |
| | | djJdgzDismantTrack.setLevel3NetworkId(nowLevel3.getId()); |
| | | insert(frame,djJdgzDismantTrack); |
| | | }else{ |
| | | JOptionPane.showMessageDialog(null, "ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | JOptionPane.showMessageDialog(null, "å½åç¨æ·ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | list.add(data); |
| | | djJdgzDismantTrackService.save(list); |
| | | |
| | | this.refreshTable(data.getLevel3NetworkId(),null); |
| | | frame1.dispose(); |
| | | jFrame.setEnabled(true);//å°ä¸»çé¢åè®¾ç½®ä¸ºå¯æä½ç |
| | | }); |
| | | } |
| | | public void refreshTable(Long level3Id,JFrame jFrame){ |
| | | nowLevel3 = level3Service.get(level3Id); |
| | | List<DjJdgzDismantTrack> list = djJdgzDismantTrackService.getList(level3Id, null); |
| | | CommonTable.refreshTable(list, columnDto, trackTable); |
| | | trackTable.setRowHeight(25); |
| | | trackTable.setAutoCreateRowSorter(true); |
| | | |
| | | trackTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(trackTable, jFrame,list,columnDto); |
| | | } |
| | |
| | | if (n == 0) { |
| | | DefaultTableModel model = (DefaultTableModel) table.getModel(); |
| | | DjJdgzDismantTrack data = list.get(row); |
| | | djJdgzDismantTrackService.deleteLogic(data.getId()); |
| | | djJdgzDismantTrackService.delete(data.getId()); |
| | | list.remove(row); |
| | | model.removeRow(row); |
| | | } |
| | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | }; |
| | | List<DjJdgzShip> shipList = djJdgzShipService.getList(); |
| | | Map<String, Long> shipMap = new HashMap<>(); |
| | |
| | | list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | |
| | | columnDto.add(new ColumnDto("åºå·", "", 60, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤åç§°", "name", 180, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 180, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 180, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", 180, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", 180, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("设å¤åç§°", "name", 152, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 152, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 152, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", 150, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", 150, null, false, null, null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | | subTable.setRowHeight(25); |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
| | |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoCreateRowSorter(true); |
| | | |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | subTable.addMouseListener(new MouseAdapter() { |
| | | public void mouseClicked(MouseEvent e) { |
New file |
| | |
| | | package com.example.client.service; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.BoxIteUtils; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.boatFleet.service.BoatFleetService; |
| | | import com.example.server.teamGroup.model.SysTeamGroupClass; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.user.service.UserService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class TeamGroupAddOrUpdate { |
| | | |
| | | @Autowired |
| | | private TeamGroupManageService teamGroupManageService; |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | |
| | | |
| | | public void openDialog(SysTeamGroupClass data, JFrame jFrame, List<ColumnDto> columnDto, JTable table) { |
| | | JFrame frame1 = new JFrame("ä¸ä¸æä½"); |
| | | frame1.setSize(800, 600); |
| | | frame1.setResizable(false); |
| | | frame1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | | frame1.setLocationRelativeTo(null); |
| | | frame1.setVisible(true); |
| | | frame1.addWindowListener(new WindowAdapter() { |
| | | //æ·»å 第äºä¸ªçé¢çå
³éäºä»¶: |
| | | public void windowClosing(WindowEvent e) { |
| | | //æ·»å äºä»¶: |
| | | jFrame.setEnabled(true);//å°ä¸»çé¢åè®¾ç½®ä¸ºå¯æä½ç |
| | | } |
| | | }); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | frame1.setLayout(layout); |
| | | |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | String[] typeList = new String[]{ |
| | | "é¨é¨", "ä¸ä¸" |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("ç±»å"); |
| | | JComboBox<String> comboBox1 = new JComboBox<>(typeList); |
| | | comboBox1.setPreferredSize(new Dimension(185,28)); |
| | | if (StringUtils.isNotBlank(data.getType())) { |
| | | comboBox1.setSelectedItem(data.getType()); |
| | | } |
| | | |
| | | JLabel JLabel1 = new JLabel("é¨é¨/ä¸ä¸åç§°"); |
| | | JTextField name = new JTextField(16); |
| | | if (StringUtils.isNotBlank(data.getName())) { |
| | | name.setText(data.getName()); |
| | | } |
| | | |
| | | JLabel JLabel4 = new JLabel("æå±é¨é¨"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(deptList); |
| | | comboBox2.setPreferredSize(new Dimension(185,28)); |
| | | if (data.getPid() != null) { |
| | | if (data.getPid()!=0){ |
| | | comboBox2.setSelectedItem(BoxIteUtils.GetSelectItemById(deptList, data.getPid())); |
| | | }else { |
| | | comboBox2.setEditable(false); |
| | | } |
| | | } |
| | | |
| | | comboBox1.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | String type = comboBox1.getSelectedItem().toString(); |
| | | if (type.equals("é¨é¨")) { |
| | | comboBox2.setEditable(false); |
| | | comboBox2.setSelectedIndex(-1); |
| | | data.setPid(0L); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | JButton saveButton = new JButton("ç¡®å®"); |
| | | |
| | | frame1.add(JLabel0, new GBC(0, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(comboBox1, new GBC(1, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel1, new GBC(0, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(name, new GBC(1, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel4, new GBC(0, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(comboBox2, new GBC(1, 2, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(saveButton, new GBC(0, 3, 2, 1).setWeight(0, 0)); |
| | | |
| | | saveButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | String type = comboBox1.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Integer sortMax = 0; |
| | | if (type.equals("é¨é¨")) { |
| | | data.setPid(0L); |
| | | sortMax = sysTeamGroupClassService.getSortMax(0L); |
| | | data.setSort(sortMax + 100); |
| | | } else { |
| | | data.setPid(dept.getId()); |
| | | sortMax = sysTeamGroupClassService.getSortMax(dept.getId()); |
| | | data.setSort(sortMax + 1); |
| | | } |
| | | |
| | | data.setArea("hld"); |
| | | data.setName(name.getText()); |
| | | //data.setBoatfleet(String.valueOf(boat.getId())); |
| | | |
| | | sysTeamGroupClassService.save(data); |
| | | |
| | | List<SysTeamGroupClass> list = sysTeamGroupClassService.getListByTree();; |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | teamGroupManageService.tableModelListener(table, jFrame, list); |
| | | frame1.dispose(); |
| | | jFrame.setEnabled(true);//å°ä¸»çé¢åè®¾ç½®ä¸ºå¯æä½ç |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | public class TeamGroupManageService { |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | @Autowired |
| | | private TeamGroupAddOrUpdate addOrUpdate; |
| | | |
| | | private JTable table; |
| | | private List<ColumnDto> columnDto; |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | //tableModelListener(table,jFrame,list); |
| | | tableModelListener(table,jFrame,list); |
| | | |
| | | /* btnInsert.addActionListener(new ActionListener() { |
| | | btnInsert.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser data = new SysUser(); |
| | | SysTeamGroupClass data = new SysTeamGroupClass(); |
| | | addOrUpdate.openDialog(data,jFrame, columnDto,table); |
| | | jFrame.setEnabled(false); |
| | | } |
| | | });*/ |
| | | }); |
| | | |
| | | JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | scrollPane.setViewportView(table); |
| | |
| | | return panel; |
| | | } |
| | | |
| | | /* public void tableModelListener(JTable table,JFrame jFrame,List<SysUser> list){ |
| | | public void tableModelListener(JTable table,JFrame jFrame,List<SysTeamGroupClass> list){ |
| | | table.getModel().addTableModelListener(e -> { |
| | | // æ£æ¥äºä»¶ç±»å |
| | | if (e.getType() == TableModelEvent.UPDATE) { |
| | |
| | | Object newValue = table.getModel().getValueAt(row, column); |
| | | // è¾åºååä¿¡æ¯ |
| | | if (newValue.equals("edit")){ |
| | | SysUser data = list.get(row); |
| | | SysTeamGroupClass data = list.get(row); |
| | | addOrUpdate.openDialog(data,jFrame, columnDto,table); |
| | | jFrame.setEnabled(false); |
| | | }else if(newValue.equals("del")) { |
| | | int n = JOptionPane.showConfirmDialog(null, "æ¯å¦å é¤?", "æç¤º", JOptionPane.YES_NO_OPTION); |
| | | if (n == 0) { |
| | | DefaultTableModel model = (DefaultTableModel) table.getModel(); |
| | | SysUser data = list.get(row); |
| | | userService.deleteLogic(data.getId()); |
| | | SysTeamGroupClass data = list.get(row); |
| | | sysTeamGroupClassService.deleteLogic(data.getId()); |
| | | list.remove(row); |
| | | model.removeRow(row); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | */ |
| | | |
| | | } |
| | | |
| | |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.UploadFile; |
| | | import com.example.server.progressTrack.model.DjJdgzDismantTrack; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3List; |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.progressTrack.service.DjJdgzNetworkLevel3ListService; |
| | | import com.example.server.progressTrack.service.DjJdgzNetworkLevel3Service; |
| | | import com.example.server.progressTrack.service.DjJdgzTrackRecordService; |
| | | import com.example.server.progressTrack.service.NetWorkDiagramService; |
| | | import com.example.server.progressTrack.service.*; |
| | | import com.example.server.sysOss.model.SysOss; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | |
| | | private TrackRecordManageService trackRecordManageService; |
| | | @Autowired |
| | | private UploadFile uploadFile; |
| | | @Autowired |
| | | private DjJdgzDismantTrackService djJdgzDismantTrackService; |
| | | |
| | | public void openDialog(DjJdgzTrackRecord data, JFrame jFrame, Long level1Id, List<ColumnDto> columnDto, JTable table) { |
| | | JFrame frame1 = new JFrame("è·è¸ªè®°å½"); |
| | | JFrame frame1 = new JFrame(data.getLevel3NetworkName() + "è·è¸ªè®°å½"); |
| | | frame1.setSize(1200, 800); |
| | | frame1.setResizable(false); |
| | | frame1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
| | |
| | | hasDelayRiskMap.put(0, "æ "); |
| | | |
| | | 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, "æ"), |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("å½åèç¹"); |
| | |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(statusList); |
| | | comboBox1.setPreferredSize(new Dimension(185, 28)); |
| | | if (data.getCurrentStatus() != null) { |
| | | comboBox0.setSelectedItem(new JComboBoxItem(data.getCurrentStatus(), statusMap.get(data.getCurrentStatus()))); |
| | | comboBox0.setSelectedItem(new JComboBoxItem(data.getCurrentStatus().longValue(), statusMap.get(data.getCurrentStatus()))); |
| | | } |
| | | |
| | | |
| | |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(hasDelayRiskList); |
| | | comboBox2.setPreferredSize(new Dimension(185, 28)); |
| | | if (data.getHasDelayRisk() != null) { |
| | | comboBox0.setSelectedItem(new JComboBoxItem(data.getHasDelayRisk(), hasDelayRiskMap.get(data.getHasDelayRisk()))); |
| | | comboBox0.setSelectedItem(new JComboBoxItem(data.getHasDelayRisk().longValue(), hasDelayRiskMap.get(data.getHasDelayRisk()))); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | JLabel JLabel19 = new JLabel("éä»¶"); |
| | | SysOss oss = new SysOss(); |
| | | if (data.getId()!=null){ |
| | | if (data.getId() != null) { |
| | | oss.setBusiId(data.getId()); |
| | | } |
| | | oss.setBusiType("ProjectProgressFileUpload"); |
| | |
| | | oss.setBusiFieldName("项ç®è¿åº¦æä»¶"); |
| | | oss.setStatus(1); |
| | | oss.setChannel("local"); |
| | | JPanel jPanel = uploadFile.uploadFile(jFrame,500,220,oss); |
| | | JPanel jPanel = uploadFile.uploadFile(jFrame, 500, 220, oss); |
| | | JButton saveButton = new JButton("ä¿å"); |
| | | |
| | | frame1.add(JLabel0, new GBC(0, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser user = (SysUser) CacheUtils.get("user", "user"); |
| | | DjJdgzNetworkLevel3 level3 = djJdgzNetworkLevel3Service.get(data.getLevel3NetworkId()); |
| | | if (user.getTeamgroup()!=null && !user.getTeamgroup().equals(level3.getTeamgroupId())){ |
| | | JOptionPane.showMessageDialog(null, "ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | if (user.getTeamgroup() != null && !user.getTeamgroup().equals(level3.getTeamgroupId().toString())) { |
| | | JOptionPane.showMessageDialog(null, "å½åç¨æ·ä¸å¯æä½å
¶ä»ä¸ä¸æ°æ®", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | |
| | | JComboBoxItem trackMethod = (JComboBoxItem) comboBox0.getSelectedItem(); |
| | | JComboBoxItem currentStatus = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem hasDelayRisk = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | List<DjJdgzDismantTrack> list1 = djJdgzDismantTrackService.getList(data.getLevel3NetworkId(), null); |
| | | if (data.getProcessName().equals("è®¾å¤æå¸åºè±") && currentStatus.getId() == 1 && list1 != null && list1.size() > 0) { |
| | | Boolean status = djJdgzDismantTrackService.getStatus(data.getLevel3NetworkId()); |
| | | if (!status) { |
| | | JOptionPane.showMessageDialog(null, "ææªå®æçåé¨ä»¶", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | data.setTrackMethod(Math.toIntExact(trackMethod.getId())); |
| | | data.setProcessName(data.getLevel3NodeName()); |
| | | data.setTrackLocation(trackLocatDesc.getText()); |
| | |
| | | data.setRemark(remark.getText()); |
| | | Long id = djJdgzTrackRecordService.save(data); |
| | | uploadFile.save(id); |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(level1Id,0); |
| | | CommonTable.refreshTable(list,columnDto,table); |
| | | trackRecordManageService.tableModelListener(table,jFrame); |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(level1Id, 0); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | trackRecordManageService.tableModelListener(table, jFrame, list); |
| | | frame1.dispose(); |
| | | jFrame.setEnabled(true);//å°ä¸»çé¢åè®¾ç½®ä¸ºå¯æä½ç |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | @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; |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | | }); |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | 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)); |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | table.addMouseListener(new MouseAdapter() { |
| | |
| | | |
| | | // æ£æ¥æ¯å¦ç¹å»äºææåå
æ ¼ |
| | | 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()); |
| | |
| | | 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); |
| | |
| | | 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)); |
| | |
| | | |
| | | } |
| | | |
| | | 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) { |
| | |
| | | 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(); |
| | |
| | | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoCreateRowSorter(true); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table,jFrame,list); |
New file |
| | |
| | | package com.example.client.utils; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.table.DefaultTableCellRenderer; |
| | | import java.awt.*; |
| | | |
| | | public class CircleRenderer extends DefaultTableCellRenderer { |
| | | @Override |
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
| | | |
| | | // å°åå
è¿å¶å符串转æ¢ä¸º Color 对象 |
| | | if (value instanceof String) { |
| | | String hexColor = (String) value; |
| | | Color color = hexToColor(hexColor); |
| | | setForeground(color); // è®¾ç½®åæ¯è²ä¸ºåå½¢çé¢è² |
| | | } |
| | | |
| | | // è®¾ç½®èæ¯è²ï¼å¯éï¼ |
| | | setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); |
| | | |
| | | // è®¾ç½®ææ¬ä¸ºç©ºï¼å 为æä»¬åªæ¾ç¤ºå形徿¡ |
| | | setText(""); |
| | | |
| | | return this; |
| | | } |
| | | |
| | | @Override |
| | | protected void paintComponent(Graphics g) { |
| | | super.paintComponent(g); |
| | | |
| | | // ç»å¶å形徿¡ |
| | | int width = getWidth(); |
| | | int height = getHeight(); |
| | | int diameter = Math.min(width, height); // åçç´å¾ |
| | | int x = (width - diameter) / 2; |
| | | int y = (height - diameter) / 2; |
| | | |
| | | g.setColor(getForeground()); |
| | | g.fillOval(x, y, diameter, diameter); // ç»å¶å¡«å
çåå½¢ |
| | | } |
| | | |
| | | // å°åå
è¿å¶å符串转æ¢ä¸º Color 对象 |
| | | private Color hexToColor(String hex) { |
| | | if (hex == null || hex.isEmpty()) { |
| | | return Color.WHITE; // é»è®¤é¢è² |
| | | } |
| | | try { |
| | | // 廿å¯è½åå¨ç "#" åç¼ |
| | | hex = hex.trim().replace("#", ""); |
| | | int rgb = Integer.parseInt(hex, 16); |
| | | return new Color((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF); |
| | | } catch (NumberFormatException e) { |
| | | return Color.WHITE; // å¦æè½¬æ¢å¤±è´¥ï¼è¿åé»è®¤é¢è² |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | table.getColumnModel().getColumn(j).setCellEditor(new DatePickerEditor(datePicker)); |
| | | } |
| | | if ("dict".equals(dtoList.get(j).getColumnType())) { |
| | | if ("dict".equals(dtoList.get(j).getColumnType()) || "dicts".equals(dtoList.get(j).getColumnType())) { |
| | | Map<Long, JComboBoxItem> itemMap = new HashMap<>(); |
| | | JComboBoxItem[] dictList = dtoList.get(j).getDictList(); |
| | | for (JComboBoxItem item : dictList) { |
| | |
| | | }); |
| | | table.getColumnModel().getColumn(j).setCellRenderer(new CellComboBoxRenderer(itemMap)); |
| | | table.getColumnModel().getColumn(j).setCellEditor(new CellComboBoxEditor(comboBox, itemMap)); |
| | | } |
| | | if ("Circle".equals(dtoList.get(j).getColumnType())) { |
| | | table.getColumnModel().getColumn(j).setCellRenderer(new CircleRenderer()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (StringUtils.isBlank(dtoList.get(j).getColumnType()) || dtoList.get(j).getColumnType().equals("selectDate")) { |
| | | rowData[i][j] = valueStr; |
| | | } else if (dtoList.get(j).getColumnType().equals("dict")) { |
| | | rowData[i][j] = valueStr; |
| | | } else if (dtoList.get(j).getColumnType().equals("dicts")) { |
| | | rowData[i][j] = valueStr; |
| | | } else if (dtoList.get(j).getColumnType().equals("Circle")) { |
| | | rowData[i][j] = valueStr; |
| | | } else if (dtoList.get(j).getColumnType().equals("autoCreate")) { |
| | | rowData[i][j] = "" + (i + 1); |
| | |
| | | if (StringUtils.isNotBlank(fieldName)) { |
| | | if ("dict".equals(dtoList.get(j).getColumnType())) { |
| | | method = c1azz.getMethod("set" + StringUtils.capitalize(fieldName), Long.class); |
| | | } else if ("dicts".equals(dtoList.get(j).getColumnType())) { |
| | | method = c1azz.getMethod("set" + StringUtils.capitalize(fieldName), Integer.class); |
| | | } else { |
| | | method = c1azz.getMethod("set" + StringUtils.capitalize(fieldName), String.class); |
| | | } |
| | | Object value = table.getModel().getValueAt(i, j); |
| | | if (value != null) { |
| | | if (value != null && !value.equals("") ) { |
| | | if ("selectDate".equals(dtoList.get(j).getColumnType())) { |
| | | method.invoke(object, value.toString()); |
| | | System.out.println(value.toString().length()); |
| | | String valueStr = value.toString(); |
| | | Method method2 = c1azz.getMethod("set" + StringUtils.capitalize(fieldName) + "Digit", Long.class); |
| | | //Method method2 = c1azz.getMethod("set" + StringUtils.capitalize(fieldName) + "Digit", Long.class); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date date = null; |
| | | try { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | Long timestamp = date.getTime(); |
| | | method2.invoke(object, timestamp); |
| | | // method2.invoke(object, timestamp); |
| | | } else if ("dict".equals(dtoList.get(j).getColumnType())) { |
| | | method.invoke(object, Long.parseLong(value.toString())); |
| | | } else if ("dicts".equals(dtoList.get(j).getColumnType())) { |
| | | method.invoke(object, Integer.valueOf(value.toString())); |
| | | } else { |
| | | method.invoke(object, value.toString()); |
| | | } |
| | |
| | | import javax.swing.table.DefaultTableCellRenderer; |
| | | import javax.swing.table.DefaultTableModel; |
| | | import java.awt.*; |
| | | import java.util.Arrays; |
| | | import java.util.Vector; |
| | | |
| | | |
| | | public class ComplexTable extends JTable { |
| | |
| | | this.getTableHeader().setUI(new ComplexHeaderUI(headerRows, this)); |
| | | this.setUI(new ComplexTableUI(body, this)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | return selectedItems; |
| | | } |
| | | |
| | | public void setSelectedItems(Set<JComboBoxItem> items) { |
| | | selectedIndices.clear(); // æ¸
空å½åéä¸é¡¹ |
| | | for (int i = 0; i < getItemCount(); i++) { |
| | | JComboBoxItem item = getItemAt(i); |
| | | if (items.contains(item)) { |
| | | selectedIndices.add(i); // å°å¯¹åºçç´¢å¼æ·»å å°éä¸éå |
| | | } |
| | | } |
| | | updateTextField(); // æ´æ°ææ¬æ¡å
容 |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.server.DataSync.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DataExportDto { |
| | | private String exportDate; |
| | | private String exportStaff; |
| | | } |
New file |
| | |
| | | package com.example.server.DataSync.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DataImportDto { |
| | | private String importDate; |
| | | private String importLocal; |
| | | private String importStaff; |
| | | } |
| | |
| | | syncTable("dj_jdgz_track_record"); |
| | | syncTable("dj_sys_oss"); |
| | | syncTable("dj_jdgz_dismant_track"); |
| | | } else if ("TD".equals(mySite)) { |
| | | if ("TD".equals(otherSite)) { |
| | | } else if (mySite.equals("TD")) { |
| | | if (otherSite.equals("TD")) { |
| | | syncTable("dj_jdgz_network_level3"); |
| | | syncTable("dj_jdgz_network_level3_list"); |
| | | syncTable("dj_jdgz_track_record"); |
| | | syncTable("dj_sys_oss"); |
| | | syncTable("dj_jdgz_dismant_track"); |
| | | syncTable("dj_jdgz_handover"); |
| | | } else if ("å·¥ä½ç»".equals(otherSite)) { |
| | | syncTable("dj_jdgz_handover"); |
| | | syncTable("dj_jdgz_network_level1"); |
| | |
| | | } |
| | | } |
| | | if (isUpdate) { |
| | | updateSql = "update " + tableName + " set " + updateSql + "where id = " + id; |
| | | updateSql = "update " + tableName + " set " + updateSql + " where id = " + id; |
| | | // æ§è¡update |
| | | sysMysqlDao.execute(updateSql); |
| | | } else { |
New file |
| | |
| | | package com.example.server.progressTrack.Dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TableNodeDto { |
| | | private Long id; |
| | | |
| | | private Long networkId; |
| | | |
| | | @ApiModelProperty(value = "è¦æ±å®ææ¶é´") |
| | | private String requiredCompletionTime; |
| | | |
| | | @ApiModelProperty(value = "å®é
宿æ¶é´") |
| | | private String actualCompletion; |
| | | |
| | | @ApiModelProperty(value = "å½åç¶æ") |
| | | private Integer currentStatus; |
| | | |
| | | private String processName; |
| | | private String name; |
| | | |
| | | private String time1Color; |
| | | private String time2Color; |
| | | private String time3Color; |
| | | private String time4Color; |
| | | private String time5Color; |
| | | |
| | | } |
| | |
| | | List<DjJdgzDismantTrack> getdata(Long deptId, Long teamGroupId, Long level1NetworkId, Long level3NetworkId, Integer status); |
| | | |
| | | List<StatistDismantDto> getStatist(Long level1Id); |
| | | |
| | | Boolean getStatus(Long level3NetworkId); |
| | | |
| | | List<StatistDismantDto> getStatist2(Long level1Id, Long id); |
| | | } |
| | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.server.dao.BaseDao; |
| | | import com.example.server.progressTrack.Dto.NetworkNodeStatusDto; |
| | | import com.example.server.progressTrack.Dto.TableNodeDto; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | void deleteByTeamGroup(Long teamGroupId, String name); |
| | | |
| | | JComboBoxItem[] getListByExport(Long projectId, Long deptId, Long teamId); |
| | | |
| | | List<TableNodeDto> getNodeList(Long shipId, Long deptId, Long teamId, Long cabinId, String type, String name); |
| | | } |
| | |
| | | List<DjJdgzTrackRecord> getSummaryData(String teamgroupId, Long level1NetworkId, Long level3NetworkId, Long level3NodeId, Integer status, Date beginDate, Date endDate, Integer istq); |
| | | |
| | | Integer getTrackNum(Long level3NodeId); |
| | | |
| | | List<DjJdgzTrackRecord> getListByImport(Long level1Id, Long level2Id, Long level2NodeId, String selectedIds); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "è·è¸ªäºº") |
| | | private String trackPerson; |
| | | |
| | | @ApiModelProperty(value = "è·è¸ªäººåä½") |
| | | private String trackPersonUnit; |
| | | @ApiModelProperty(value = "è·è¸ªäººèç³»æ¹å¼") |
| | | private String trackPersonContact; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "被è·è¸ªäºº") |
| | | private String trackedPerson; |
| | | |
| | | @ApiModelProperty(value = "è·è¸ªäººåä½") |
| | | private String trackedPersonUnit; |
| | | @ApiModelProperty(value = "被è·è¸ªäººèç³»æ¹å¼") |
| | | private String trackedPersonContact; |
| | | |
| | |
| | | private String status; |
| | | |
| | | @TableField(exist = false) |
| | | private String teamGroupName; |
| | | private String teamgroupName; |
| | | |
| | | @TableField(exist = false) |
| | | private String istq; |
| | |
| | | @TableField(exist = false) |
| | | private String fileName; |
| | | |
| | | @TableField(exist = false) |
| | | private Long cabinId; |
| | | |
| | | @TableField(exist = false) |
| | | private String type; |
| | | |
| | | } |
| | |
| | | String curSbName = ""; |
| | | Long curSbId = null; |
| | | |
| | | for (int j = 1; j <= num; j++) { |
| | | for (int j = 2; j <= num; j++) { |
| | | DjJdgzDismantTrack data = new DjJdgzDismantTrack(); |
| | | |
| | | boolean isErr = false; |
| | |
| | | public List<StatistDismantDto> getStatist(Long level1Id) { |
| | | return baseDao.getStatist(level1Id); |
| | | } |
| | | |
| | | public Boolean getStatus(Long level3NetworkId) { |
| | | return baseDao.getStatus(level3NetworkId); |
| | | } |
| | | |
| | | public void delete(Long id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | public List<StatistDismantDto> getStatist2(Long level1Id, Long id) { |
| | | return baseDao.getStatist2(level1Id,id); |
| | | } |
| | | } |
| | |
| | | import com.example.client.service.BaseService; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.Dto.NetworkNodeStatusDto; |
| | | import com.example.server.progressTrack.Dto.TableNodeDto; |
| | | import com.example.server.progressTrack.dao.DjJdgzNetworkLevel3Dao; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3List; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | |
| | | @Value("${zt.oss.local-path}") |
| | | private String path; |
| | | |
| | | enum StatusEnum {zy, jxz, lq, yq, zcwc, cqwc} |
| | | |
| | | String[] fillColorArr = {"#e5e5e5", "#3498DB", "#F1C40F", "#E74C3C", "#2ECC71", "#006400"}; |
| | | String[] fontColorArr = {"#e5e5e5", "#3498DB", "#F1C40F", "#E74C3C", "#2ECC71", "#006400"}; |
| | | |
| | | public List<DjJdgzNetworkLevel3> getList(Long shipId, Long deptId, Long teamId, Long cabinId, String type, String name) { |
| | | List<DjJdgzNetworkLevel3> list = baseDao.getList(shipId, deptId, teamId, cabinId, type, name); |
| | |
| | | teamMap.put(item.getName(), item.getId()); |
| | | } |
| | | |
| | | for (int j = 1; j <= num; j++) { |
| | | for (int j = 2; j <= num; j++) { |
| | | int sort = 0; |
| | | DjJdgzNetworkLevel3 data = new DjJdgzNetworkLevel3(); |
| | | DjJdgzNetworkLevel3List node = new DjJdgzNetworkLevel3List(); |
| | |
| | | JComboBoxItem[] list = baseDao.getListByExport(projectId, deptId, teamId); |
| | | return list; |
| | | } |
| | | |
| | | public List<TableNodeDto> getNodeList(Long shipId, Long deptId, Long teamId, Long cabinId, String type, String name) { |
| | | List<TableNodeDto> list = baseDao.getNodeList(shipId, deptId, teamId, cabinId, type, name); |
| | | |
| | | Map<Long, StatusEnum> statusMap = new HashMap<>(); |
| | | Date today = new Date(); |
| | | for (TableNodeDto node : list) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date requiredCompletionDate = null; |
| | | Date actualCompletionDate = null; |
| | | try { |
| | | if (StringUtils.isNotBlank(node.getRequiredCompletionTime())) { |
| | | requiredCompletionDate = sdf.parse(node.getRequiredCompletionTime()); |
| | | } |
| | | if (StringUtils.isNotBlank(node.getActualCompletion())) { |
| | | actualCompletionDate = sdf.parse(node.getActualCompletion()); |
| | | } |
| | | |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (node.getCurrentStatus() == null || node.getCurrentStatus() == 0) { |
| | | if (today.after(requiredCompletionDate)) { |
| | | statusMap.put(node.getId(), StatusEnum.yq); |
| | | } else if ((requiredCompletionDate.getTime() - today.getTime()) / (1000 * 60 * 60 * 24) < 7) { |
| | | statusMap.put(node.getId(), StatusEnum.lq); |
| | | } else { |
| | | statusMap.put(node.getId(), StatusEnum.jxz); |
| | | } |
| | | } else if (node.getCurrentStatus() == 1) { |
| | | // 已宿 |
| | | if (node.getActualCompletion() != null && actualCompletionDate.after(requiredCompletionDate)) { |
| | | statusMap.put(node.getId(), StatusEnum.cqwc); |
| | | } else { |
| | | statusMap.put(node.getId(), StatusEnum.zcwc); |
| | | } |
| | | } |
| | | } |
| | | StatusEnum status = StatusEnum.jxz; |
| | | List<TableNodeDto> dataList = new ArrayList<>(); |
| | | Long oldId = 0L; |
| | | TableNodeDto data = null; |
| | | for (TableNodeDto node : list) { |
| | | if (oldId.equals(node.getNetworkId())){ |
| | | |
| | | }else{ |
| | | data = new TableNodeDto(); |
| | | data.setName(node.getName()); |
| | | data.setNetworkId(node.getNetworkId()); |
| | | dataList.add(data); |
| | | oldId = node.getNetworkId(); |
| | | } |
| | | |
| | | status = statusMap.get(node.getId()); |
| | | if (node.getProcessName().equals("è®¾å¤æå¸åºè±")) { |
| | | data.setTime1Color(fillColorArr[status.ordinal()]); |
| | | } else if (node.getProcessName().equals("设å¤å交")) { |
| | | data.setTime2Color(fillColorArr[status.ordinal()]); |
| | | } else if (node.getProcessName().equals("ææ£é´å®")) { |
| | | data.setTime3Color(fillColorArr[status.ordinal()]); |
| | | } else if (node.getProcessName().equals("设å¤è¿å")) { |
| | | data.setTime4Color(fillColorArr[status.ordinal()]); |
| | | } else if (node.getProcessName().equals("åè£
")) { |
| | | data.setTime5Color(fillColorArr[status.ordinal()]); |
| | | } |
| | | } |
| | | |
| | | |
| | | return dataList; |
| | | } |
| | | /* public void exportExcelTemplate(HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | String excelName="ä¸çº§ç½ç»å¾æ¹é模ç"; |
| | | String excelPath = path + "template/jx-model/" + excelName + ".xlsx"; //模æ¿è·¯å¾ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<DjJdgzTrackRecord> getListByImport(Long level1Id, Long level2Id, Long level2NodeId, String selectedIds) { |
| | | return baseDao.getListByImport(level1Id,level2Id,level2NodeId,selectedIds); |
| | | } |
| | | } |
| | |
| | | //ç¶æå为ï¼ä¸ä¸ãå·²å¯å¨/è¿è¡ä¸ï¼æµ
ç°ï¼ã临æï¼é»è²ï¼ã已龿ï¼çº¢è²ï¼ãå·²å®æï¼æµ
绿è²ï¼ãè¶
æå®æï¼æ·±ç»¿è²ï¼ |
| | | enum StatusEnum {zy, jxz, lq, yq, zcwc, cqwc} |
| | | |
| | | String[] fillColorArr = {"#e5e5e5", "#A9A9A9", "yellow", "#FF0000", "#90EE90", "#006400"}; |
| | | String[] fontColorArr = {"#e5e5e5", "#A9A9A9", "yellow", "#FF0000", "#90EE90", "#006400"}; |
| | | String[] fillColorArr = {"#e5e5e5", "#3498DB", "#F1C40F", "#E74C3C", "#2ECC71", "#006400"}; |
| | | String[] fontColorArr = {"#e5e5e5", "#3498DB", "#F1C40F", "#E74C3C", "#2ECC71", "#006400"}; |
| | | |
| | | InitParamDto initParamDto = new InitParamDto(); |
| | | ResultDataDto resultDataDto = new ResultDataDto(); |
| | |
| | | JComboBoxItem[] getDeptList(); |
| | | |
| | | List<SysTeamGroupClass> getListByTree(); |
| | | |
| | | Integer getSortMax(Long pid); |
| | | } |
| | |
| | | @ApiModelProperty(value = "åç±»ï¼A/Bï¼") |
| | | private String classType; |
| | | |
| | | @ApiModelProperty(value = "ç±»åï¼") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String comment; |
| | | |
| | |
| | | public List<SysTeamGroupClass> getListByTree() { |
| | | return baseDao.getListByTree(); |
| | | } |
| | | |
| | | public Integer getSortMax(Long pid) { |
| | | return baseDao.getSortMax(pid); |
| | | } |
| | | |
| | | public void save(SysTeamGroupClass data) { |
| | | if (data.getId()!=null){ |
| | | this.update(data); |
| | | }else{ |
| | | this.insert(data); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.example.server.utils; |
| | | |
| | | import com.example.Application; |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.progressTrack.service.DjJdgzDismantTrackService; |
| | | import com.example.server.progressTrack.service.DjJdgzTrackRecordService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | import javax.swing.*; |
| | | import java.io.*; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | public class DownLoadTmpFile { |
| | | public static void down(String name,JFrame frame1){ |
| | | public static void down(String name, JFrame frame1) { |
| | | InputStream inputStream = Application.class.getClassLoader().getResourceAsStream(name); |
| | | |
| | | if (inputStream == null) { |
| | |
| | | tempFile.delete(); // å é¤ä¸´æ¶æä»¶ |
| | | } |
| | | } |
| | | |
| | | public static void buildTrack(List<DjJdgzTrackRecord> list, String path, JFrame frame1) { |
| | | LocalDate currentDate = LocalDate.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | // å°å½åæ¥ææ ¼å¼å为å符串 |
| | | String date = currentDate.format(formatter); |
| | | |
| | | InputStream inputStream = Application.class.getClassLoader().getResourceAsStream(path); |
| | | |
| | | if (inputStream == null) { |
| | | try { |
| | | inputStream = new FileInputStream(path); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | Workbook workbook = new XSSFWorkbook(inputStream); |
| | | // è·å第ä¸ä¸ªå·¥ä½è¡¨ |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | int num = 1; |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | num = num + 1; |
| | | Row row = sheet.createRow(num); |
| | | |
| | | Cell cell = row.createCell(0); |
| | | cell.setCellValue(list.get(i).getId()); |
| | | |
| | | cell = row.createCell(1); |
| | | cell.setCellValue(date); |
| | | |
| | | cell = row.createCell(2); |
| | | cell.setCellValue(list.get(i).getLevel3NetworkName()); |
| | | |
| | | cell = row.createCell(12); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackPerson())) { |
| | | cell.setCellValue(list.get(i).getTrackPerson()); |
| | | } |
| | | cell = row.createCell(13); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackPersonContact())) { |
| | | cell.setCellValue(list.get(i).getTrackPersonContact()); |
| | | } |
| | | |
| | | cell = row.createCell(14); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackPersonUnit())) { |
| | | cell.setCellValue(list.get(i).getTrackPersonUnit()); |
| | | } |
| | | |
| | | cell = row.createCell(15); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackedPerson())) { |
| | | cell.setCellValue(list.get(i).getTrackPerson()); |
| | | } |
| | | cell = row.createCell(16); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackedPersonContact())) { |
| | | cell.setCellValue(list.get(i).getTrackPersonContact()); |
| | | } |
| | | |
| | | cell = row.createCell(17); |
| | | if (StringUtils.isNotBlank(list.get(i).getTrackedPersonUnit())) { |
| | | cell.setCellValue(list.get(i).getTrackPersonUnit()); |
| | | } |
| | | |
| | | cell = row.createCell(18); |
| | | if (StringUtils.isNotBlank(list.get(i).getGeneralRepairUnit())) { |
| | | cell.setCellValue(list.get(i).getGeneralRepairUnit()); |
| | | } |
| | | cell = row.createCell(19); |
| | | if (StringUtils.isNotBlank(list.get(i).getGeneralRepairUnitDirector())) { |
| | | cell.setCellValue(list.get(i).getGeneralRepairUnitDirector()); |
| | | } |
| | | cell = row.createCell(20); |
| | | if (StringUtils.isNotBlank(list.get(i).getGeneralRepairUnitContact())) { |
| | | cell.setCellValue(list.get(i).getGeneralRepairUnitDirector()); |
| | | } |
| | | cell = row.createCell(21); |
| | | if (StringUtils.isNotBlank(list.get(i).getRepairUnit())) { |
| | | cell.setCellValue(list.get(i).getRepairUnit()); |
| | | } |
| | | cell = row.createCell(22); |
| | | if (StringUtils.isNotBlank(list.get(i).getRepairUnitDirector())) { |
| | | cell.setCellValue(list.get(i).getRepairUnitDirector()); |
| | | } |
| | | cell = row.createCell(23); |
| | | if (StringUtils.isNotBlank(list.get(i).getRepairUnitContact())) { |
| | | cell.setCellValue(list.get(i).getRepairUnitContact()); |
| | | } |
| | | |
| | | if (i >= list.size() - 1) { |
| | | row = sheet.createRow(sheet.getLastRowNum() + 3); |
| | | cell = row.createCell(1); |
| | | cell.setCellValue("注ï¼"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("1. 设å¤åç§°ï¼å¯¼åºæ¨¡æ¿æ¶ï¼ç³»ç»èªå¨çæè¯¥ä¸ä¸çææè®¾å¤ï¼ç¨æ·ä¸è¦ä¿®æ¹"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("2. é»è²æ ç®ä¸ºä¸»è¦å¡«åä¿¡æ¯ï¼å
¶ä¸ï¼é¢è®¡å®ææ¶é´ä¸å¡«æ¶ï¼å¯¼å
¥æ¶ç³»ç»å°å½åèç¹çè¦æ±å®ææ¶é´ä½ä¸ºé¢è®¡å®ææ¶é´"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("3. ç»¿è²æ ç®ä¸ºå¯¼åºæ¨¡æ¿æ¶å¸¦ææ°æ®ï¼å¯æ ¹æ®éè¦ä¿®æ¹"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("4. æ°æ®å½å
¥æ¶é´ä¸ºè·è¸ªçæ¶é´ï¼å¯¼å
¥åç³»ç»èªå¨æ¢ç®æå¨"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("5. æ°æ®å½å
¥æ¶é´æè
å½åèç¹æ ç®æªå½æ°æ®æ¶ï¼å¯¼å
¥æ¶ç³»ç»å¤æè¯¥è¡ä¸ºç©º"); |
| | | row = sheet.createRow(sheet.getLastRowNum() + 1); |
| | | cell = row.createCell(2); |
| | | cell.setCellValue("6. 以䏿 ç®ä¸ºä¸æéï¼å½åèç¹ãè·è¸ªæ¹å¼ãèç¹è¿å±ãææ è±æé£é©"); |
| | | } |
| | | } |
| | | // å¼¹åºæä»¶éæ©å¯¹è¯æ¡ |
| | | JFileChooser fileChooser = new JFileChooser(); |
| | | fileChooser.setSelectedFile(new File(path)); // é»è®¤æä»¶å |
| | | int result = fileChooser.showSaveDialog(frame1); |
| | | if (result == JFileChooser.APPROVE_OPTION) { |
| | | File selectedFile = fileChooser.getSelectedFile(); |
| | | try (FileOutputStream outputStream = new FileOutputStream(selectedFile)) { |
| | | workbook.write(outputStream); |
| | | JOptionPane.showMessageDialog(frame1, "æä»¶ä¿åæå", "æå", JOptionPane.INFORMATION_MESSAGE); |
| | | } catch (IOException e) { |
| | | JOptionPane.showMessageDialog(frame1, "æä»¶ä¿å失败: " + e.getMessage(), "é误", JOptionPane.ERROR_MESSAGE); |
| | | } |
| | | } |
| | | } catch ( |
| | | IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | select id, name |
| | | from cabin |
| | | where is_delete = 0 |
| | | UNION ALL |
| | | SELECT |
| | | null AS id, |
| | | '' AS name |
| | | </select> |
| | | </mapper> |
| | |
| | | b.UPDATE_DATE |
| | | </select> |
| | | <select id="getStatist" resultType="com.example.server.progressTrack.Dto.StatistDismantDto"> |
| | | select a.*, |
| | | sum(case when c.status=1 then 1 else 0 end) as sbcxsl |
| | | from ( |
| | | select a.id, |
| | | case when a.pid=0 then a.NAME else ' '|| a.NAME end as name, |
| | | case when a.pid=0 then '' || a.id else ''|| a.pid || a.SORT end as sort, |
| | | count(DISTINCT b.LEVEL3_NETWORK_ID) as sbsl, |
| | | count(DISTINCT b.dismant_id) as zbjsl, |
| | | sum(case when b.status=1 then 1 else 0 end) as zbjcxsl, |
| | | sum( CASE WHEN dismant_time IS NULL THEN 0 ELSE 1 END ) AS dismantsl, |
| | | sum( CASE WHEN exit_time IS NULL THEN 0 ELSE 1 END ) AS exitsl, |
| | | sum( CASE WHEN return_weight_time IS NULL THEN 0 ELSE 1 END ) AS returnsl, |
| | | sum( CASE WHEN warehouse_time IS NULL THEN 0 ELSE 1 END ) AS warehousesl |
| | | from dj_sys_teamgroup_class a |
| | | left join ( |
| | | select a.id as id2 ,a.pid as pid2 ,c.LEVEL3_NETWORK_ID, |
| | | c.id as dismant_id,c.status, |
| | | c.dismant_time, |
| | | c.exit_time, |
| | | c.return_weight_time, |
| | | c.warehouse_time |
| | | from dj_sys_teamgroup_class a,dj_jdgz_network_level3 b,dj_jdgz_dismant_track c |
| | | where a.IS_DELETE= 0 and b.IS_DELETE = 0 and c.is_delete = 0 |
| | | and a.AREA = 'hld' |
| | | and b.TEAMGROUP_ID = a.id |
| | | and c.LEVEL3_NETWORK_ID = b.id |
| | | and b.LEVEL1_NETWORK_ID = ${level1Id} |
| | | ) b on a.id=b.id2 or a.id = b.pid2 |
| | | where a.AREA = 'hld' and a.IS_DELETE = 0 |
| | | group by a.id,a.NAME |
| | | ) a |
| | | select a.id, |
| | | case when a.pid=0 then a.NAME else ' '|| a.NAME end as name, |
| | | case when a.pid=0 then '' || a.id else ''|| a.pid || a.SORT end as sort, |
| | | sum(case when b.LEVEL3_NETWORK_ID is not null then 1 else 0 end) as sbsl, |
| | | sum(case when sbStatus = 1 then 1 else 0 end) as sbcxsl, |
| | | sum(case when zbjsl is null then 0 else zbjsl end) as zbjsl, |
| | | sum(case when zbjwcsl is null then 0 else zbjwcsl end) as zbjcxsl, |
| | | sum(case when dismantsl is null then 0 else dismantsl end) as dismantsl, |
| | | sum(case when exitsl is null then 0 else exitsl end) as exitsl, |
| | | sum(case when returnsl is null then 0 else returnsl end) as returnsl, |
| | | sum(case when warehousesl is null then 0 else warehousesl end) as warehousesl |
| | | from dj_sys_teamgroup_class a |
| | | left join ( |
| | | select a.id as id2 ,a.pid as pid2, |
| | | case when EXISTS(select 1 from dj_jdgz_dismant_track c where c.LEVEL3_NETWORK_ID=b.id |
| | | and (status=0 or status is null) and is_delete = 0) or not |
| | | EXISTS(select 1 from dj_jdgz_dismant_track c where c.LEVEL3_NETWORK_ID=b.id |
| | | and status=1 and is_delete = 0)then 0 else 1 end as status |
| | | from dj_sys_teamgroup_class a ,dj_jdgz_network_level3 b |
| | | where a.IS_DELETE= 0 and b.IS_DELETE = 0 |
| | | select a.id as id2, a.pid as pid2,c.LEVEL3_NETWORK_ID, |
| | | case when EXISTS(select 1 from dj_jdgz_dismant_track s where s.LEVEL3_NETWORK_ID=b.id and (s.status=0 or s.status is null) and s.is_delete = 0) or not EXISTS(select 1 from dj_jdgz_dismant_track s where s.LEVEL3_NETWORK_ID=b.id and s.status=1 and s.is_delete = 0) then 0 else 1 end as sbStatus, |
| | | sum(case when c.id is not null then 1 else 0 end) as zbjsl, |
| | | sum(case when c.status=1 then 1 else 0 end) as zbjwcsl, |
| | | sum(case when c.dismant_time is null then 0 else 1 end) as dismantsl, |
| | | sum(case when c.exit_time is null then 0 else 1 end) as exitsl, |
| | | sum(case when c.return_weight_time is null then 0 else 1 end) as returnsl, |
| | | sum(case when c.warehouse_time is null then 0 else 1 end) as warehousesl |
| | | from dj_sys_teamgroup_class a |
| | | left join dj_jdgz_network_level3 b on b.IS_DELETE = 0 and b.TEAMGROUP_ID = a.id |
| | | left join dj_jdgz_dismant_track c on c.is_delete = 0 and c.LEVEL3_NETWORK_ID = b.id |
| | | where a.IS_DELETE= 0 |
| | | and a.AREA = 'hld' |
| | | and b.TEAMGROUP_ID = a.id |
| | | and b.LEVEL1_NETWORK_ID = ${level1Id} |
| | | ) c on a.id=c.id2 or a.id = c.pid2 |
| | | group by a.id,a.NAME,b.id |
| | | ) b on a.id=b.id2 or a.id = b.pid2 |
| | | where a.AREA = 'hld' and a.IS_DELETE = 0 |
| | | group by a.id,a.NAME |
| | | order by sort |
| | | </select> |
| | | <select id="getStatus" resultType="java.lang.Boolean"> |
| | | SELECT CASE |
| | | WHEN NOT EXISTS ( |
| | | SELECT 1 |
| | | FROM dj_jdgz_dismant_track |
| | | WHERE LEVEL3_NETWORK_ID = ${level3NetworkId} AND (status=0 or status is null) |
| | | ) THEN TRUE |
| | | ELSE FALSE |
| | | END |
| | | </select> |
| | | <select id="getStatist2" resultType="com.example.server.progressTrack.Dto.StatistDismantDto"> |
| | | select a.id,a.name, |
| | | sum(case when b.id is not null then 1 else 0 end) as sbsl, |
| | | sum(case when sbStatus = 1 then 1 else 0 end) as sbcxsl, |
| | | sum(case when zbjsl is null then 0 else zbjsl end) as zbjsl, |
| | | sum(case when zbjwcsl is null then 0 else zbjwcsl end) as zbjcxsl, |
| | | sum(case when dismantsl is null then 0 else dismantsl end) as dismantsl, |
| | | sum(case when exitsl is null then 0 else exitsl end) as exitsl, |
| | | sum(case when returnsl is null then 0 else returnsl end) as returnsl, |
| | | sum(case when warehousesl is null then 0 else warehousesl end) as warehousesl |
| | | from cabin a |
| | | left join ( |
| | | select b.id,c.cabin_id, |
| | | case when EXISTS(select 1 from dj_jdgz_dismant_track s where s.LEVEL3_NETWORK_ID=b.id and (s.status=0 or s.status is null) and s.is_delete = 0) or not EXISTS(select 1 from dj_jdgz_dismant_track s where s.LEVEL3_NETWORK_ID=b.id and s.status=1 and s.is_delete = 0) then 0 else 1 end as sbStatus, |
| | | sum(case when c.id is not null then 1 else 0 end) as zbjsl, |
| | | sum(case when c.status=1 then 1 else 0 end) as zbjwcsl, |
| | | sum(case when c.dismant_time is null then 0 else 1 end) as dismantsl, |
| | | sum(case when c.exit_time is null then 0 else 1 end) as exitsl, |
| | | sum(case when c.return_weight_time is null then 0 else 1 end) as returnsl, |
| | | sum(case when c.warehouse_time is null then 0 else 1 end) as warehousesl |
| | | from dj_jdgz_network_level3 b |
| | | join dj_jdgz_dismant_track c on c.is_delete = 0 and c.LEVEL3_NETWORK_ID = b.id |
| | | where b.IS_DELETE = 0 |
| | | and b.LEVEL1_NETWORK_ID = ${level1Id} |
| | | and b.TEAMGROUP_ID in (select id from dj_sys_teamgroup_class where AREA = 'hld' and IS_DELETE = 0 and (id = ${id} or pid = ${id})) |
| | | group by b.id,c.cabin_id |
| | | ) b on a.id=b.cabin_id |
| | | where a.IS_DELETE = 0 |
| | | group by b.cabin_id |
| | | order by a.id |
| | | </select> |
| | | </mapper> |
| | |
| | | GROUP BY a.id |
| | | </select> |
| | | <select id="getProjectList" resultType="com.example.client.dto.JComboBoxItem"> |
| | | select id, project_name as `name` |
| | | select id, project_name as `name`,year |
| | | from dj_jdgz_network_level1 |
| | | where is_delete = 0 |
| | | UNION ALL |
| | | SELECT |
| | | null AS id, |
| | | '' AS name , |
| | | 0 AS year |
| | | ORDER BY year desc |
| | | </select> |
| | | |
| | |
| | | LEFT JOIN dj_jdgz_network_level1_list b on b.NETWORK_ID = c.ID |
| | | LEFT JOIN dj_jdgz_network_level2_list d on d.ID = a.LEVEL2_NODE_ID |
| | | where |
| | | a.is_delete = 0 |
| | | and b.is_delete = 0 |
| | | and c.is_delete = 0 |
| | | and d.is_delete = 0 |
| | | <if test="shipId!=null"> |
| | | and c.ship_id = ${shipId} |
| | | </if> |
| | | <if test="deptId!=null"> |
| | | and a.dept_id = ${deptId} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | and a.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="cabinId!=null"> |
| | | and a.cabin_id LIKE '%${cabinId}%' |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and a.type = #{type} |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and a.name LIKE '%${name}%' |
| | | </if> |
| | | a.is_delete = 0 |
| | | and b.is_delete = 0 |
| | | and c.is_delete = 0 |
| | | and d.is_delete = 0 |
| | | <if test="shipId!=null"> |
| | | and c.ship_id = ${shipId} |
| | | </if> |
| | | <if test="deptId!=null"> |
| | | and a.dept_id = ${deptId} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | and a.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="cabinId!=null"> |
| | | and a.cabin_id LIKE '%${cabinId}%' |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and a.type = #{type} |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and a.name LIKE '%${name}%' |
| | | </if> |
| | | group by a.id |
| | | </select> |
| | | |
| | |
| | | and a.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | </select> |
| | | <select id="getNodeList" resultType="com.example.server.progressTrack.Dto.TableNodeDto"> |
| | | SELECT |
| | | b.name, |
| | | a.NETWORK_ID, |
| | | a.process_name, |
| | | a.ID, a.REQUIRED_COMPLETION_TIME, a.ACTUAL_COMPLETION, a.CURRENT_STATUS |
| | | FROM `dj_jdgz_network_level3_list` a |
| | | LEFT JOIN dj_jdgz_network_level3 b on b.ID = a.NETWORK_ID |
| | | LEFT JOIN dj_jdgz_network_level1 c on c.ID = b.LEVEL1_NETWORK_ID |
| | | where |
| | | a.is_delete = 0 |
| | | and b.is_delete = 0 |
| | | and c.is_delete = 0 |
| | | <if test="shipId!=null"> |
| | | and c.ship_id = ${shipId} |
| | | </if> |
| | | <if test="deptId!=null"> |
| | | and b.dept_id = ${deptId} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | and b.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="cabinId!=null"> |
| | | and b.cabin_id LIKE '%${cabinId}%' |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and b.type = #{type} |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and b.name LIKE '%${name}%' |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | b.LEVEL3_NODE_ID ELSE a.id |
| | | END AS level3NodeId, |
| | | c.id as level3NetworkId, |
| | | c.teamgroup_name, |
| | | c.dept_id, |
| | | c.cabin_id, |
| | | c.type, |
| | | c.`NAME` as level3NetworkName, |
| | | a.PROCESS_NAME AS level3NodeName, |
| | | a.REQUIRED_COMPLETION_TIME, |
| | |
| | | <select id="getReport" resultType="com.example.server.progressTrack.Dto.StatistReportsDto"> |
| | | select d.*, e.name as teamGroupName |
| | | from ( |
| | | select TEAMGROUP_ID, |
| | | count(1) as allNum, |
| | | sum(case when status = 'zcjxz' or status = 'lq' then 1 else 0 end) as jxzNum, |
| | | sum(case when status = 'lq' then 1 else 0 end) as lqNum, |
| | | sum(case when status = 'yq' then 1 else 0 end) as yqNum, |
| | | sum(case when status = 'zcwc' then 1 else 0 end) as zcwcNum, |
| | | sum(case when status = 'cqwc' then 1 else 0 end) as cqwcNum |
| | | from ( |
| | | select b.TEAMGROUP_ID, |
| | | CASE |
| | | WHEN b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME > b.ACTUAL_COMPLETION THEN |
| | | 'cqwc' |
| | | WHEN b.CURRENT_STATUS = 1 THEN |
| | | 'zcwc' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < (SELECT datetime('now')) THEN 'yq' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < (SELECT date('now', '-' || c.advent_day || ' days')) THEN 'lq' |
| | | ELSE 'zcjxz' |
| | | END AS status |
| | | from dj_jdgz_network_level3 a, |
| | | dj_jdgz_network_level3_list b, |
| | | dj_jdgz_network_level1 c |
| | | where a.IS_DELETE = 0 |
| | | and a.LEVEL1_NETWORK_ID = ${level1NetworkId} |
| | | and a.LEVEL1_NETWORK_ID = c.id |
| | | and b.IS_DELETE = 0 |
| | | and b.NETWORK_ID = a.id |
| | | ) c |
| | | group by TEAMGROUP_ID |
| | | ) d, |
| | | dj_sys_teamgroup_class e |
| | | select TEAMGROUP_ID, |
| | | count(1) as allNum, |
| | | sum(case when status = 'zcjxz' or status = 'lq' then 1 else 0 end) as jxzNum, |
| | | sum(case when status = 'lq' then 1 else 0 end) as lqNum, |
| | | sum(case when status = 'yq' then 1 else 0 end) as yqNum, |
| | | sum(case when status = 'zcwc' then 1 else 0 end) as zcwcNum, |
| | | sum(case when status = 'cqwc' then 1 else 0 end) as cqwcNum |
| | | from ( |
| | | select a.TEAMGROUP_ID, |
| | | CASE |
| | | WHEN b.CURRENT_STATUS = 1 |
| | | AND b.REQUIRED_COMPLETION_TIME > b.ACTUAL_COMPLETION THEN |
| | | 'cqwc' |
| | | WHEN b.CURRENT_STATUS = 1 THEN |
| | | 'zcwc' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < (SELECT datetime('now')) THEN 'yq' |
| | | WHEN b.REQUIRED_COMPLETION_TIME < |
| | | (SELECT date('now', '-' || c.advent_day || ' days')) THEN 'lq' |
| | | ELSE 'zcjxz' |
| | | END AS status |
| | | from dj_jdgz_network_level3 a, |
| | | dj_jdgz_network_level3_list b, |
| | | dj_jdgz_network_level1 c |
| | | where a.IS_DELETE = 0 |
| | | and a.LEVEL1_NETWORK_ID = ${level1NetworkId} |
| | | and a.LEVEL1_NETWORK_ID = c.id |
| | | and b.IS_DELETE = 0 |
| | | and b.NETWORK_ID = a.id |
| | | ) c |
| | | group by TEAMGROUP_ID |
| | | ) d, |
| | | dj_sys_teamgroup_class e |
| | | where d.TEAMGROUP_ID = e.id |
| | | </select> |
| | | <select id="prompt" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | |
| | | e.PROCESS_NAME AS level1NodeName, |
| | | f.project_name, |
| | | g.week_no, |
| | | h.name as teamGroupName |
| | | b.TEAMGROUP_NAME |
| | | FROM |
| | | `dj_jdgz_network_level3_list` a |
| | | LEFT JOIN dj_jdgz_network_level3 b ON b.id = a.NETWORK_ID |
| | |
| | | from dj_jdgz_track_record |
| | | where LEVEL3_NODE_ID = ${level3NodeId} |
| | | </select> |
| | | <select id="getListByImport" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | | SELECT |
| | | c.id, |
| | | c.`NAME` as level3NetworkName, |
| | | CASE |
| | | WHEN |
| | | b.GENERAL_REPAIR_UNIT IS NOT NULL THEN b.GENERAL_REPAIR_UNIT else |
| | | c.GENERAL_REPAIR_UNIT |
| | | END as GENERAL_REPAIR_UNIT, |
| | | CASE |
| | | WHEN |
| | | b.GENERAL_REPAIR_UNIT_DIRECTOR IS NOT NULL THEN b.GENERAL_REPAIR_UNIT_DIRECTOR else |
| | | c.GENERAL_REPAIR_UNIT_DIRECTOR |
| | | END as GENERAL_REPAIR_UNIT_DIRECTOR, |
| | | CASE |
| | | WHEN |
| | | b.GENERAL_REPAIR_UNIT_CONTACT IS NOT NULL THEN |
| | | b.GENERAL_REPAIR_UNIT_CONTACT else |
| | | c.GENERAL_REPAIR_UNIT_CONTACT |
| | | END as GENERAL_REPAIR_UNIT_CONTACT, |
| | | CASE |
| | | WHEN |
| | | b.REPAIR_UNIT IS NOT NULL THEN b.REPAIR_UNIT else |
| | | c.REPAIR_UNIT |
| | | END as REPAIR_UNIT, |
| | | CASE |
| | | WHEN |
| | | b.REPAIR_UNIT_DIRECTOR IS NOT NULL THEN b.REPAIR_UNIT_DIRECTOR else |
| | | c.REPAIR_UNIT_DIRECTOR |
| | | END as REPAIR_UNIT_DIRECTOR, |
| | | CASE |
| | | WHEN |
| | | b.REPAIR_UNIT_CONTACT IS NOT NULL THEN |
| | | b.REPAIR_UNIT_CONTACT else |
| | | c.REPAIR_UNIT_CONTACT |
| | | END as REPAIR_UNIT_CONTACT, |
| | | b.track_person, |
| | | b.track_person_unit, |
| | | b.track_person_contact, |
| | | b.tracked_person, |
| | | b.tracked_person_unit, |
| | | b.tracked_person_contact |
| | | FROM |
| | | dj_jdgz_network_level3_list a |
| | | LEFT JOIN ( |
| | | SELECT * |
| | | FROM dj_jdgz_track_record |
| | | WHERE (LEVEL3_NODE_ID, update_date) IN ( |
| | | SELECT LEVEL3_NODE_ID, MAX(update_date) |
| | | FROM dj_jdgz_track_record |
| | | GROUP BY LEVEL3_NODE_ID |
| | | ) |
| | | ) b ON b.LEVEL3_NODE_ID = a.id |
| | | LEFT JOIN dj_jdgz_network_level3 c ON c.id = a.NETWORK_ID |
| | | LEFT JOIN dj_jdgz_network_level2_list d ON d.id = c.LEVEL2_NODE_ID |
| | | LEFT JOIN dj_jdgz_network_level2 e ON e.id = d.NETWORK_ID |
| | | LEFT JOIN dj_jdgz_network_level1_list f ON f.id = e.LEVEL1_NODE_ID |
| | | LEFT JOIN dj_jdgz_network_level1 g ON g.id = c.LEVEL1_NETWORK_ID |
| | | WHERE |
| | | a.IS_DELETE = 0 |
| | | and a.network_id != 10000 |
| | | <if test="selectedIds!=null and selectedIds!=''"> |
| | | AND c.TEAMGROUP_ID in (${selectedIds}) |
| | | </if> |
| | | and (b.CURRENT_STATUS IS null OR b.CURRENT_STATUS = 0) |
| | | AND c.IS_DELETE = 0 |
| | | AND d.IS_DELETE = 0 |
| | | AND e.IS_DELETE = 0 |
| | | AND f.IS_DELETE = 0 |
| | | AND g.IS_DELETE = 0 |
| | | AND g.id = ${level1Id} |
| | | <if test="level2Id!=null"> |
| | | AND e.id = ${level2Id} |
| | | </if> |
| | | <if test="level2NodeId!=null"> |
| | | AND d.id = ${level2NodeId} |
| | | </if> |
| | | GROUP BY |
| | | c.id |
| | | ORDER BY |
| | | a.REQUIRED_COMPLETION_TIME |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="getAll" resultType="com.example.server.teamGroup.model.SysTeamGroupClass"> |
| | | SELECT |
| | | a.* |
| | | a.* |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | <if test="localArea!=null and (localArea=='sy' or localArea=='qd' or localArea=='hld')"> |
| | | and a.area=#{localArea} |
| | | </if> |
| | | a.is_delete = 0 |
| | | <if test="localArea!=null and (localArea=='sy' or localArea=='qd' or localArea=='hld')"> |
| | | and a.area=#{localArea} |
| | | </if> |
| | | ORDER BY |
| | | a.area desc, a.sort |
| | | a.area desc, a.sort |
| | | </select> |
| | | |
| | | <select id="getMapAll" resultType="com.example.client.entity.MapData"> |
| | | SELECT |
| | | a.id,a.name |
| | | a.id,a.name |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | a.is_delete = 0 |
| | | <if test="localArea!=null and (localArea=='sy' or localArea=='qd')"> |
| | | and a.area=#{localArea} |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="getTeamGroupIdByNames" resultType="java.lang.Long"> |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name IN |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name IN |
| | | <foreach item="item" index="index" collection="list" |
| | | open="(" separator="," close=")"> |
| | | #{item} |
| | |
| | | </select> |
| | | |
| | | <select id="getTeamGroupIdByName" resultType="java.lang.Long"> |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name = #{name} |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name = #{name} |
| | | <if test="localArea!=null and (localArea=='sy' or localArea=='qd')"> |
| | | and a.area=#{localArea} |
| | | </if> |
| | | </select> |
| | | <select id="getBzTeamGroupIdByName" resultType="java.lang.Long"> |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name = #{name} |
| | | SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE a.is_delete=0 AND a.name = #{name} |
| | | <if test="localArea!=null and (localArea=='sy' or localArea=='qd')"> |
| | | and a.area=#{localArea} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getTeamGroupClassList" resultType="com.example.server.teamGroup.model.SysTeamGroupClass"> |
| | | SELECT |
| | | a.id,a.name |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | and area = 'sy' |
| | | and pid != 0 |
| | | order by sort |
| | | SELECT a.id, |
| | | a.name |
| | | FROM DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE a.is_delete = 0 |
| | | and area = 'sy' |
| | | and pid != 0 |
| | | order by sort |
| | | </select> |
| | | <select id="getList" resultType="com.example.client.dto.JComboBoxItem"> |
| | | SELECT |
| | | a.id, |
| | | CASE |
| | | WHEN a.pid != 0 THEN b.name || '/' || a.name |
| | | ELSE a.name |
| | | END AS name |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | LEFT JOIN |
| | | DJ_SYS_TEAMGROUP_CLASS b ON a.pid = b.id |
| | | WHERE |
| | | a.is_delete = 0 |
| | | SELECT a.id, |
| | | CASE |
| | | WHEN a.pid != 0 THEN b.name || '/' || a.name |
| | | ELSE a.name |
| | | END AS name |
| | | FROM DJ_SYS_TEAMGROUP_CLASS a |
| | | LEFT JOIN |
| | | DJ_SYS_TEAMGROUP_CLASS b ON a.pid = b.id |
| | | WHERE a.is_delete = 0 |
| | | AND a.pid != 0 |
| | | ORDER BY |
| | | a.sort; |
| | | ORDER BY a.sort; |
| | | </select> |
| | | <select id="getTeamList" resultType="com.example.client.dto.JComboBoxItem"> |
| | | SELECT |
| | | a.id, |
| | | a.name |
| | | a.id, |
| | | a.name, |
| | | a.sort |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | AND a.pid != 0 |
| | | a.is_delete = 0 |
| | | AND a.pid != 0 |
| | | <if test="pid!=null"> |
| | | AND a.pid = ${pid} |
| | | </if> |
| | | UNION ALL |
| | | SELECT |
| | | null AS id, |
| | | '' AS name , |
| | | 0 AS sort |
| | | ORDER BY |
| | | a.sort; |
| | | sort; |
| | | </select> |
| | | <select id="getDeptList" resultType="com.example.client.dto.JComboBoxItem"> |
| | | SELECT |
| | | a.id, |
| | | a.name |
| | | FROM |
| | | DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | SELECT a.id, |
| | | a.name, |
| | | a.sort |
| | | FROM DJ_SYS_TEAMGROUP_CLASS a |
| | | WHERE a.is_delete = 0 |
| | | AND a.pid = 0 |
| | | ORDER BY |
| | | a.sort; |
| | | UNION ALL |
| | | SELECT null AS id, |
| | | '' AS name, |
| | | 0 AS sort |
| | | ORDER BY sort |
| | | </select> |
| | | <select id="getListByTree" resultType="com.example.server.teamGroup.model.SysTeamGroupClass"> |
| | | SELECT |
| | | a.id, |
| | | CASE |
| | | WHEN a.pid = 0 THEN |
| | | a.NAME ELSE ' ' || a.NAME |
| | | END AS name, |
| | | CASE |
| | | SELECT a.id, |
| | | a.pid, |
| | | CASE |
| | | WHEN a.pid = 0 THEN |
| | | a.NAME |
| | | ELSE ' ' || a.NAME |
| | | END AS name, |
| | | CASE |
| | | WHEN a.pid = 0 THEN |
| | | 'é¨é¨' |
| | | ELSE 'ä¸ä¸' |
| | | END AS type, |
| | | CASE |
| | | |
| | | WHEN a.pid = 0 THEN |
| | | '' || a.id ELSE '' || a.pid || a.SORT |
| | | END AS sort2 |
| | | FROM |
| | | dj_sys_teamgroup_class a |
| | | WHERE |
| | | a.AREA = 'hld' |
| | | WHEN a.pid = 0 THEN |
| | | '' || a.id |
| | | ELSE '' || a.pid || a.SORT |
| | | END AS sort2 |
| | | FROM dj_sys_teamgroup_class a |
| | | WHERE a.AREA = 'hld' |
| | | AND a.IS_DELETE = 0 |
| | | ORDER BY sort2 |
| | | </select> |
| | | <select id="getSortMax" resultType="java.lang.Integer"> |
| | | select max(sort) |
| | | FROM dj_sys_teamgroup_class |
| | | WHERE AREA = 'hld' |
| | | AND IS_DELETE = 0 |
| | | and pid = ${pid} |
| | | </select> |
| | | </mapper> |