45个文件已修改
10个文件已添加
3个文件已删除
| | |
| | | hSplitPane.setDividerSize(10); |
| | | hSplitPane.setOneTouchExpandable(true); |
| | | hSplitPane.setContinuousLayout(true); |
| | | |
| | | frame.getContentPane().add(hSplitPane, BorderLayout.CENTER); |
| | | |
| | | JSplitPane vSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
| | |
| | | tabbedPane.addTab(title, panel); |
| | | Component tabComponent = createTabComponent(title, tree); |
| | | tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, tabComponent);// 设置èªå®ä¹æ ç¾ç»ä»¶//忢å°å½åé¡µé¢ |
| | | if (tabbedPane.getTabCount() > 5) { |
| | | // å é¤ç¬¬ä¸ä¸ªæ ç¾ |
| | | tabbedPane.removeTabAt(0); |
| | | } |
| | | tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1); |
| | | } |
| | | |
| | |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.WaitUtil; |
| | | import com.example.server.DataSync.dto.DataExportDto; |
| | | import com.example.server.DataSync.service.DataSyncService; |
| | | import com.example.server.utils.CacheUtils; |
| | | import com.example.server.progressTrack.dao.ExportRecordDao; |
| | | import com.example.server.progressTrack.model.ExportRecord; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | |
| | | @Autowired |
| | | DataSyncService dataSyncService; |
| | | @Autowired |
| | | ExportRecordDao exportRecordDao; |
| | | @Autowired |
| | | ImportDataService importDataService; |
| | | |
| | | private List<ColumnDto> columnDto; |
| | | private JTable table; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); // ä½¿ç¨ BorderLayout |
| | |
| | | JLabel label1 = new JLabel("æç¤ºä¿¡æ¯"); |
| | | JTextArea tips = new JTextArea(7, 30); |
| | | tips.setEnabled(false); |
| | | tips.setForeground(Color.BLACK); // 设置为é»è² |
| | | tips.setDisabledTextColor(Color.BLACK); |
| | | tips.setLineWrap(true); |
| | | |
| | | JPanel center = new JPanel(new BorderLayout()); // 为 left 设置å¸å± |
| | |
| | | left.add(center, BorderLayout.CENTER); |
| | | |
| | | JLabel label2 = new JLabel("导åºè®°å½"); |
| | | List<DataExportDto> list = new ArrayList<>(); |
| | | List<ColumnDto> columnDto = new ArrayList<>(); |
| | | List<ExportRecord> list = exportRecordDao.getList(); |
| | | columnDto = new ArrayList<>(); |
| | | columnDto.add(new ColumnDto("åºå·", "", 265, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("å¯¼åºæ¶é´", "exportDate", 265, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("导åºäºº", "importStaff", 265, null, false, null, null)); |
| | | JTable table = CommonTable.createCommonTable(list, columnDto); |
| | | columnDto.add(new ColumnDto("å¯¼åºæ¶é´", "createDate", 265, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("æä½äºº", "userName", 265, null, false, null, null)); |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | |
| | | btnExport.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | dataSyncService.export(); |
| | | dataSyncService.export(tips); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | | public void refresh(List<ExportRecord> list){ |
| | | CommonTable.refreshTable(list, columnDto,table); |
| | | } |
| | | } |
| | |
| | | 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.progressTrack.dao.ImportRecordDao; |
| | | import com.example.server.progressTrack.model.ExportRecord; |
| | | import com.example.server.progressTrack.model.ImportRecord; |
| | | import com.example.server.utils.CacheUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @Autowired |
| | | DataSyncService dataSyncService; |
| | | @Autowired |
| | | ImportRecordDao importRecordDao; |
| | | @Autowired |
| | | ImportDataService importDataService; |
| | | private List<ColumnDto> columnDto; |
| | | private JTable table; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | |
| | | JPanel center = new JPanel(); // 为 left 设置å¸å± |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | center.setLayout(layout); |
| | | center.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/2)); |
| | | center.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/3)); |
| | | |
| | | JPanel south = new JPanel(new BorderLayout()); // 为 left 设置å¸å± |
| | | south.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/2)); |
| | | south.setPreferredSize(new Dimension((width - 10) / 2, (height-50)/3*2)); |
| | | |
| | | |
| | | String site = (String) CacheUtils.get("site", "site"); |
| | |
| | | JLabel label1 = new JLabel("æç¤ºä¿¡æ¯"); |
| | | JTextArea tips = new JTextArea(7, 30); |
| | | tips.setEnabled(false); |
| | | tips.setForeground(Color.BLACK); // 设置为é»è² |
| | | tips.setDisabledTextColor(Color.BLACK); |
| | | tips.setLineWrap(true); |
| | | south.add(label1,BorderLayout.NORTH); |
| | | south.add(tips,BorderLayout.CENTER); |
| | |
| | | SwingWorker<String, Void> sw = new SwingWorker<String, Void>() { |
| | | @Override |
| | | protected String doInBackground() throws Exception { |
| | | String flag = importDataService.UnzipFile(); |
| | | String flag = importDataService.UnzipFile(tips); |
| | | return flag; |
| | | } |
| | | |
| | |
| | | // å·æ°è¡¨æ ¼æ°æ®ï¼å¦æä¸ä¼ æåï¼ |
| | | if (uploadSucceeded.equals("true")) { |
| | | waitUtil.dispose(); |
| | | System.out.println("导å
¥æåæ¶é´" + new Date()); |
| | | tips.setText("导å
¥æå"+new Date()); |
| | | } else { |
| | | waitUtil.dispose(); |
| | | tips.setText("导å
¥å¤±è´¥"+new Date()); |
| | | JOptionPane.showMessageDialog(null, uploadSucceeded, "æç¤º", JOptionPane.ERROR_MESSAGE); |
| | | } |
| | | |
| | |
| | | left.add(south,BorderLayout.SOUTH); |
| | | |
| | | JLabel label2 = new JLabel("导å
¥è®°å½"); |
| | | List<DataImportDto> list = new ArrayList<>(); |
| | | List<ImportRecord> list = importRecordDao.getList(); |
| | | |
| | | List<ColumnDto> columnDto = new ArrayList<>(); |
| | | 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); |
| | | columnDto.add(new ColumnDto("æ°æ®æº", "importSite", 200, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("导å
¥æ¶é´", "createDate", 200, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("æä½äºº", "userName", 200, null, false, null,null)); |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | |
| | | |
| | | return panel; |
| | | } |
| | | |
| | | public void refresh(List<ImportRecord> list){ |
| | | CommonTable.refreshTable(list, columnDto,table); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.ComplexTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.Dto.StatistReportsDto; |
| | | import com.example.server.progressTrack.model.DjJdgzDismantTrack; |
| | |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 37)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 40)); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,frame))); |
| | | |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | |
| | | |
| | | trackTable = CommonTable.createCommonTable(list, columnDto); |
| | | trackTable.setRowHeight(25); |
| | | |
| | | trackTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | |
| | |
| | | btnSave.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | trackTable.getCellEditor().stopCellEditing(); |
| | | SysUser user = (SysUser) CacheUtils.get("user", "user"); |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(nowLevel3.getTeamgroupId().toString())){ |
| | | CommonTable.saveTableList(list, trackTable, columnDto); |
| | |
| | | |
| | | JScrollPane scrollPane = new JScrollPane(trackTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | scrollPane.setViewportView(trackTable); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, height - 130)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.add(scrollPane); |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,frame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | |
| | | JPanel jLeft = new JPanel(new BorderLayout()); |
| | | |
| | | JPanel top = new JPanel(); |
| | | JPanel center = new JPanel(); |
| | | |
| | | jLeft.setPreferredSize(new Dimension(600, height)); |
| | | top.setPreferredSize(new Dimension(600, 100)); |
| | | center.setPreferredSize(new Dimension(600, Compute.ComputeHeight(100,frame))); |
| | | jLeft.setPreferredSize(new Dimension(600, Compute.ComputeHeight(0,frame))); |
| | | jLeft.add(center, BorderLayout.CENTER); |
| | | jLeft.add(top, BorderLayout.NORTH); |
| | | |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | top.setLayout(layout); |
| | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç", "" |
| | | }; |
| | | List<DjJdgzShip> shipList = djJdgzShipService.getList(); |
| | | Map<String, Long> shipMap = new HashMap<>(); |
| | |
| | | top.add(sb, new GBC(4, 1, 2, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | top.add(query, new GBC(6, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | jLeft.add(top, BorderLayout.NORTH); |
| | | |
| | | List<ColumnDto> columnDto = new ArrayList<>(); |
| | | list = level3Service.getList(null, deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0],null); |
| | | 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", 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("设å¤åç§°", "name", 200, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("é¨é¨", "deptId", 150, "dict", false, null, deptList)); |
| | | columnDto.add(new ColumnDto("ä¸ä¸", "teamgroupId", 150, "dict", false, null, teamList)); |
| | | columnDto.add(new ColumnDto("è±å®¤", "cabinId", 100, "dict", false, null, cabinList)); |
| | | columnDto.add(new ColumnDto("ç±»å«", "type", 100, null, false, null, null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | query.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | list = level3Service.getList(null, null, null, null, null,sb.getText()); |
| | | list = level3Service.getList(null, null, null, null, null, sb.getText()); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | subTable.setRowHeight(25); |
| | |
| | | } |
| | | }); |
| | | |
| | | JScrollPane scrollTable = new JScrollPane(subTable); |
| | | jLeft.add(scrollTable, BorderLayout.CENTER); |
| | | JScrollPane scrollTable = new JScrollPane(subTable,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | scrollTable.setViewportView(subTable); |
| | | scrollTable.setPreferredSize(new Dimension(600,Compute.ComputeHeightWithScroll(100,frame))); |
| | | center.add(scrollTable); |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | center.setPreferredSize(new Dimension(600, Compute.ComputeHeight(100,frame))); |
| | | jLeft.setPreferredSize(new Dimension(600, Compute.ComputeHeight(0,frame))); |
| | | scrollTable.setPreferredSize(new Dimension(600,Compute.ComputeHeightWithScroll(100,frame))); |
| | | jLeft.revalidate(); |
| | | jLeft.repaint(); |
| | | center.revalidate(); |
| | | center.repaint(); |
| | | scrollTable.revalidate(); |
| | | scrollTable.repaint(); |
| | | } |
| | | }); |
| | | |
| | | JPanel track = addOrUpdate.createTrack(width - 620, height, list.get(0),frame); |
| | | |
| | | JPanel track = addOrUpdate.createTrack(width - 620, height, list.get(0), frame); |
| | | |
| | | // å建水平åå²é¢æ¿ |
| | | JSplitPane hSplitPane = new JSplitPane( |
| | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.MultiSelectComboBox2; |
| | | import com.example.client.utils.RequiredLabel; |
| | | import com.example.server.ExportExcel.dto.ExcelColumnDto; |
| | | import com.example.server.progressTrack.model.DjJdgzTrackRecord; |
| | | import com.example.server.progressTrack.service.DjJdgzNetworkLevel1Service; |
| | | import com.example.server.progressTrack.service.DjJdgzNetworkLevel3ListService; |
| | |
| | | import com.example.server.progressTrack.service.DjJdgzTrackRecordService; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.jdesktop.swingx.JXDatePicker; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.io.File; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.*; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class ExportTrackRecordService { |
| | |
| | | |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | frame1.setLayout(layout); |
| | | |
| | | List<ExcelColumnDto> columnDto = new ArrayList<>(); |
| | | |
| | | columnDto.add(new ExcelColumnDto("ä¸çº§èç¹", "Level1NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("äºçº§èç¹", "Level2NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("项ç®åç§°", "Level3NetworkName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("å½åèç¹", "Level3NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("ä¸ä¸", "teamgroupName", 20, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("æ»æ¿ä¿®åä½åè´è´£äºº", "GeneralRepair", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åæ¿ä¿®åä½åè´è´£äºº", "Repair", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("è·è¸ªæ¹å¼", "trackMethodStr", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("å©ä¿®äºº", "TrackPerson", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åæ¹", "TrackedPerson", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("è·è¸ªå°ç¹", "TrackLocation", 10, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("èç¹è¿å±", "status", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("è±æé£é©", "hasDelayRiskStr", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("é¢è®¡å®ææ¶é´", "EstimatedCompletionTime", 15, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("åå¨é®é¢", "Problem", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åç»è®¡å", "FollowupPlan", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("夿³¨", "Remark", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("å¡«åæ¶é´", "UpdateDate", 15, HorizontalAlignment.CENTER)); |
| | | |
| | | |
| | | JComboBoxItem[] statusList = { |
| | | new JComboBoxItem(0L, "è¿è¡ä¸"), |
| | |
| | | JLabel JLabel7 = new JLabel("ç»ææ¥æ"); |
| | | JXDatePicker endDate = new JXDatePicker(); |
| | | endDate.setPreferredSize(new Dimension(300, 28)); |
| | | |
| | | List<String> itemList = new ArrayList<>(); |
| | | for (ExcelColumnDto dto : columnDto) { |
| | | itemList.add(dto.getColumnDesc()); // å° dto.getColumnDesc() æ·»å å° List ä¸ |
| | | } |
| | | |
| | | String[] items = itemList.toArray(new String[0]); |
| | | MultiSelectComboBox2 mulcomboBox = new MultiSelectComboBox2(items, null, null); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | @Override |
| | |
| | | |
| | | frame1.add(JLabel7, new GBC(0, 7, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(endDate, new GBC(1, 7, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(mulcomboBox, new GBC(1, 8, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(exportButton, new GBC(0, 8, 2, 1).setWeight(0, 0)); |
| | | frame1.add(exportButton, new GBC(0, 11, 2, 1).setWeight(0, 0)); |
| | | |
| | | exportButton.addActionListener(new ActionListener() { |
| | | @Override |
| | |
| | | |
| | | if (projectItem != null) { |
| | | level1NetworkId = projectItem.getId(); |
| | | }else { |
| | | } else { |
| | | JOptionPane.showMessageDialog(null, "没æéæ©å·¥ç¨", "æç¤º", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | |
| | | istq = Math.toIntExact(tq.getId()); |
| | | } |
| | | |
| | | String filePath = "è·è¸ªè®°å½æ¥è¡¨.xlsx"; |
| | | djJdgzTrackRecordService.exportExcel(filePath, teamGroupId, level1NetworkId, level3NetworkId, level3NodeId, status, beginDate2, endDate2, istq); |
| | | List<ExcelColumnDto> columnDto2 = new ArrayList<>(); |
| | | Set<Integer> selectedIndices = mulcomboBox.getSelectedIndices(); |
| | | |
| | | for (Integer index : selectedIndices) { |
| | | columnDto2.add(columnDto.get(index)); |
| | | } |
| | | |
| | | String fileName = "è·è¸ªè®°å½æ¥è¡¨.xlsx"; |
| | | JFileChooser fileChooser = new JFileChooser(); |
| | | fileChooser.setSelectedFile(new File(filePath)); |
| | | fileChooser.setSelectedFile(new File(fileName)); |
| | | int result = fileChooser.showSaveDialog(frame1); |
| | | |
| | | if (result == JFileChooser.APPROVE_OPTION) { |
| | | File selectedFile = fileChooser.getSelectedFile(); |
| | | // å°æä»¶ç§»å¨å°ç¨æ·éæ©çä½ç½® |
| | | File originalFile = new File(filePath); |
| | | originalFile.renameTo(selectedFile); |
| | | djJdgzTrackRecordService.exportExcel(selectedFile.getPath(), teamGroupId, level1NetworkId, level3NetworkId, level3NodeId, status, beginDate2, endDate2, istq, columnDto2); |
| | | JOptionPane.showMessageDialog(frame1, "æä»¶å¯¼åºæå"); |
| | | } else { |
| | | JOptionPane.showMessageDialog(frame1, "æä»¶å¯¼åºåæ¶"); |
| | |
| | | handoverTimeDate.setDate(parse); |
| | | |
| | | JLabel JLabel4 = new JLabel("äº¤æ¥æ
åµè¯´æ"); |
| | | JTextArea handoverSitua = new JTextArea(5, 40); |
| | | /*JTextArea handoverSitua = new JTextArea(5, 40); |
| | | handoverSitua.setLineWrap(true); |
| | | handoverSitua.setPreferredSize(new Dimension(600,200)); |
| | | if (StringUtils.isNotBlank(data.getHandoverSituation())) { |
| | | handoverSitua.setText(data.getHandoverSituation()); |
| | | handoverSitua.setPreferredSize(new Dimension(600,200));*/ |
| | | JTabbedPane tabbedPane = new JTabbedPane(); |
| | | |
| | | // å建ä¸ä¸è¯´æ JTextArea |
| | | JTextArea professExplan = new JTextArea(5, 40); |
| | | professExplan.setLineWrap(true); |
| | | professExplan.setWrapStyleWord(true); |
| | | professExplan.setPreferredSize(new Dimension(600, 200)); |
| | | JScrollPane professionalScrollPane = new JScrollPane(professExplan); |
| | | professionalScrollPane.setPreferredSize(new Dimension(600, 200)); |
| | | |
| | | // å建é¨é¨è¯´æ JTextArea |
| | | JTextArea deptExplan = new JTextArea(5, 40); |
| | | deptExplan.setLineWrap(true); |
| | | deptExplan.setWrapStyleWord(true); |
| | | deptExplan.setPreferredSize(new Dimension(600, 200)); |
| | | JScrollPane departmentScrollPane = new JScrollPane(deptExplan); |
| | | departmentScrollPane.setPreferredSize(new Dimension(600, 200)); |
| | | |
| | | // å建TD说æ JTextArea |
| | | JTextArea tdExplan = new JTextArea(5, 40); |
| | | tdExplan.setLineWrap(true); |
| | | tdExplan.setWrapStyleWord(true); |
| | | tdExplan.setPreferredSize(new Dimension(600, 200)); |
| | | JScrollPane tdScrollPane = new JScrollPane(tdExplan); |
| | | tdScrollPane.setPreferredSize(new Dimension(600, 200)); |
| | | |
| | | // å° JTextArea æ·»å å° JTabbedPane |
| | | tabbedPane.addTab("ä¸ä¸äº¤æ¥è¯´æ", professionalScrollPane); |
| | | tabbedPane.addTab("é¨é¨äº¤æ¥è¯´æ", departmentScrollPane); |
| | | tabbedPane.addTab("èé交æ¥è¯´æ", tdScrollPane); |
| | | |
| | | if (StringUtils.isNotBlank(data.getProfessExplan())) { |
| | | professExplan.setText(data.getProfessExplan()); |
| | | } |
| | | if (StringUtils.isNotBlank(data.getDeptExplan())) { |
| | | deptExplan.setText(data.getDeptExplan()); |
| | | } |
| | | if (StringUtils.isNotBlank(data.getTdExplan())) { |
| | | tdExplan.setText(data.getTdExplan()); |
| | | } |
| | | |
| | | JLabel JLabel5 = new JLabel("éä»¶"); |
| | |
| | | frame1.add(handoverTimeDate, new GBC(1, 3, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel4, new GBC(0, 4, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(handoverSitua, new GBC(1, 4, 1, 5).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(tabbedPane, new GBC(1, 4, 1, 5).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel5, new GBC(0, 9, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(jPanel, new GBC(1, 9, 6, 5).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | |
| | | data.setCurrentTeam(currentTeamDesc.getText()); |
| | | data.setHandoverTeam(handoverTeamDesc.getText()); |
| | | data.setHandoverTime(sdFormat.format(handoverTimeDate.getDate())); |
| | | data.setHandoverSituation(handoverSitua.getText()); |
| | | data.setDeptExplan(deptExplan.getText()); |
| | | data.setProfessExplan(professExplan.getText()); |
| | | data.setTdExplan(tdExplan.getText()); |
| | | Long id = handoverService.save(data); |
| | | uploadFile.save(id); |
| | | List<DjJdgzHandover> list = handoverService.getList(project.getId()); |
| | |
| | | |
| | | columnDto = new ArrayList<>(); |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | columnDto.add(new ColumnDto("åºå·", "", (width - 10) / 8, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("交æ¹èé", "currentTeam", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("æ¥æ¹èé", "handoverTeam", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("äº¤æ¥æ¶é´", "handoverTime", (width - 10) / 8, "selectDate", false, null,null)); |
| | | columnDto.add(new ColumnDto("äº¤æ¥æ
åµè¯´æ", "handoverSituation", (width - 10) / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("éä»¶", "fileName", (width - 10) / 8, "", false, null,null)); |
| | | columnDto.add(new ColumnDto("æä½", "", (width - 10) / 8, "", true, buttonList,null)); |
| | | columnDto.add(new ColumnDto("åºå·", "", (width - 10) / 7, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", (width - 10) / 7, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("交æ¹èé", "currentTeam", (width - 10) / 7, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("æ¥æ¹èé", "handoverTeam", (width - 10) / 7, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("äº¤æ¥æ¶é´", "handoverTime", (width - 10) / 7, "selectDate", false, null,null)); |
| | | /* columnDto.add(new ColumnDto("äº¤æ¥æ
åµè¯´æ", "handoverSituation", (width - 10) / 8, null, false, null,null)); |
| | | */ columnDto.add(new ColumnDto("éä»¶", "fileName", (width - 10) / 7, "", false, null,null)); |
| | | columnDto.add(new ColumnDto("æä½", "", (width - 10) / 7, "", true, buttonList,null)); |
| | | |
| | | table = CommonTable.createCommonTable(list[0], columnDto); |
| | | table.setRowHeight(25); |
| | |
| | | }); |
| | | return jPanel; |
| | | } |
| | | public String UnzipFile(){ |
| | | public String UnzipFile(JTextArea tips){ |
| | | String massage = ""; |
| | | String filePath = model.getValueAt(0, 0).toString(); |
| | | String outputDirectory = UnzipPath; |
| | | try { |
| | | |
| | | File zipFile = new File(filePath); |
| | | if (!zipFile.exists()) { |
| | | massage = "ZIPæä»¶ä¸åå¨ï¼" + filePath; |
| | | tips.setText(tips.getText() + massage); |
| | | throw new FileNotFoundException("ZIPæä»¶ä¸åå¨ï¼" + filePath); |
| | | } |
| | | if (!zipFile.canRead()) { |
| | | massage = "æ æ³è¯»åZIPæä»¶ï¼è¯·æ£æ¥æä»¶æéï¼" + filePath; |
| | | tips.setText(tips.getText() + massage); |
| | | System.err.println("æ æ³è¯»åZIPæä»¶ï¼è¯·æ£æ¥æä»¶æéï¼" + filePath); |
| | | return "false"; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | System.out.println("æä»¶è§£å宿ï¼ç®æ ç®å½ï¼" + outputDirectory); |
| | | dataSyncService.importData(); |
| | | massage = "æä»¶è§£å宿ï¼ç®æ ç®å½ï¼" + outputDirectory; |
| | | tips.setText(tips.getText() + massage); |
| | | dataSyncService.importData(tips); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return "false"; |
| | |
| | | JLabel label0 = new JLabel("å·¥ç¨"); |
| | | JComboBox<JComboBoxItem> comboBox0 = new JComboBox<>(projectList); |
| | | |
| | | JLabel label1 = new JLabel("äºçº§ç½ç»å¾"); |
| | | JLabel label1 = new JLabel("ä¸çº§ç½ç»å¾èç¹"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(); |
| | | comboBox1.setModel(new DefaultComboBoxModel<>(level2List)); |
| | | |
| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private Level3ManageService level3ManageService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3Service level3Service; |
| | | private TrackRecordManageService trackRecordManageService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel2ListService level2ListService; |
| | | @Autowired |
| | |
| | | JLabel label0 = new JLabel("å·¥ç¨"); |
| | | JComboBox<JComboBoxItem> comboBox0 = new JComboBox<>(projectList); |
| | | |
| | | JLabel label1 = new JLabel("äºçº§ç½ç»å¾"); |
| | | JLabel label1 = new JLabel("ä¸çº§ç½ç»å¾èç¹"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(); |
| | | comboBox1.setModel(new DefaultComboBoxModel<>(level2List)); |
| | | |
| | |
| | | |
| | | |
| | | String filePath = result.toString(); |
| | | String flag = level3Service.importDiagramFromExcel(filePath, level1Id[0], level2Id[0], level2NodeId[0]); |
| | | String flag = djJdgzTrackRecordService.importDiagramFromExcel(filePath); |
| | | return flag; |
| | | } |
| | | |
| | |
| | | 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); |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç", "" |
| | | }; |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(level1Id[0], deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0], 0, null); |
| | | CommonTable.refreshTable(list, columnDto, subTable); |
| | | level3ManageService.tableModelListener(list, subTable, jFrame); |
| | | trackRecordManageService.tableModelListener(subTable, jFrame, list); |
| | | System.out.println("导å
¥æåæ¶é´" + new Date()); |
| | | } else { |
| | | waitUtil.dispose(); |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | import com.example.server.progressTrack.model.DjJdgzShip; |
| | |
| | | private List<ColumnDto> columnDto; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(); |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width, 37)); |
| | | topJpanel.setPreferredSize(new Dimension(width, 40)); |
| | | topJpanel.setBackground(Color.WHITE); |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame))); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | |
| | | 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 - 100)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame))); |
| | | centerJpanel.add(scrollPane); |
| | | jFrame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(40,jFrame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.server.progressTrack.Dto.NetworkNodeStatusDto; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1List; |
| | |
| | | import com.example.server.progressTrack.service.DjJdgzShipService; |
| | | import com.example.server.progressTrack.service.NetWorkDiagramService; |
| | | import com.mxgraph.swing.mxGraphComponent; |
| | | import com.mxgraph.util.mxPoint; |
| | | import com.mxgraph.util.mxRectangle; |
| | | import com.mxgraph.view.mxGraph; |
| | | import com.teamdev.jxbrowser.chromium.StopFindAction; |
| | | import org.jdesktop.swingx.JXDatePicker; |
| | |
| | | @Autowired |
| | | private NetWorkDiagramService netWorkDiagramService; |
| | | |
| | | public JPanel createTable(Integer width, Integer height) { |
| | | public JPanel createTable(Integer width, Integer height, JFrame frame) { |
| | | height = height - 100; |
| | | JPanel panel = new JPanel(); |
| | | |
| | | JPanel jLeft = new JPanel(new BorderLayout()); |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, height)); |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeight(0, frame))); |
| | | |
| | | JPanel diagram = new JPanel(new BorderLayout()); |
| | | diagram.setPreferredSize(new Dimension(width - width / 4, height)); |
| | |
| | | //columnDto.add(new ColumnDto("ID", "id", -1, null,false)); |
| | | |
| | | |
| | | columnDto.add(new ColumnDto("åºå·", "", width / 8 - 10, "autoCreate", false, null,null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", width / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("åºå·", "", width / 8 - 10, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", width / 8, null, false, null, null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | JScrollPane scrollTable = new JScrollPane(subTable); |
| | | scrollTable.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeightWithScroll(0, frame))); |
| | | jLeft.add(scrollTable, BorderLayout.CENTER); |
| | | |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeight(40, frame))); |
| | | scrollTable.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeightWithScroll(40, frame))); |
| | | jLeft.revalidate(); |
| | | jLeft.repaint(); |
| | | scrollTable.revalidate(); |
| | | scrollTable.repaint(); |
| | | } |
| | | }); |
| | | // å建水平åå²é¢æ¿ |
| | | JSplitPane hSplitPane = new JSplitPane( |
| | | JSplitPane.HORIZONTAL_SPLIT, |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | int r = subTable.getSelectedRow(); |
| | | DjJdgzNetworkLevel1 data = list.get(r); |
| | | List<NetworkNodeStatusDto> nodeStatusList = level1Service.getNodeStatusData(data.getId()); |
| | | graph2[0] = netWorkDiagramService.getCsDiagram(graph2[0], data.getContent(), nodeStatusList, diagram.getPreferredSize().width, diagram.getPreferredSize().height); |
| | | mxGraph csDiagram = netWorkDiagramService.getCsDiagram(graph2[0], data.getContent(), nodeStatusList, diagram.getPreferredSize().width, diagram.getPreferredSize().height); |
| | | if (nodeStatusList != null && nodeStatusList.size() > 0) { |
| | | graph2[0] = csDiagram; |
| | | } else { |
| | | graph2[0].removeCells(graph2[0].getChildVertices(graph2[0].getDefaultParent())); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel2; |
| | |
| | | |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(); |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width, 37)); |
| | | topJpanel.setPreferredSize(new Dimension(width, 40)); |
| | | topJpanel.setBackground(Color.WHITE); |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame))); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | |
| | | 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 - 100)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,jFrame))); |
| | | centerJpanel.add(scrollPane); |
| | | jFrame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,jFrame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(40,jFrame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.server.progressTrack.Dto.NetworkNodeStatusDto; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel2; |
| | |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | import java.awt.event.MouseAdapter; |
| | | import java.awt.event.MouseEvent; |
| | | import java.awt.event.MouseWheelEvent; |
| | | import java.awt.event.MouseWheelListener; |
| | | import java.awt.event.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private NetWorkDiagramService netWorkDiagramService; |
| | | |
| | | public JPanel createTable(Integer width, Integer height) { |
| | | height = height - 100; |
| | | JPanel panel = new JPanel(); |
| | | public JPanel createTable(Integer width, Integer height, JFrame frame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | |
| | | JPanel jLeft = new JPanel(new BorderLayout()); |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, height)); |
| | | JPanel jLeft = new JPanel(); |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeight(0, frame))); |
| | | |
| | | JPanel diagram = new JPanel(new BorderLayout()); |
| | | diagram.setPreferredSize(new Dimension(width - width / 4, height)); |
| | |
| | | //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 / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§èç¹", "processName", width / 8, null, false, null,null)); |
| | | columnDto.add(new ColumnDto("åºå·", "", 120, "autoCreate", false, null, null)); |
| | | columnDto.add(new ColumnDto("å·¥ç¨", "ProjectName", 145, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("ä¸çº§èç¹", "processName", 125, null, false, null, null)); |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | JScrollPane scrollTable = new JScrollPane(subTable); |
| | | jLeft.add(scrollTable, BorderLayout.CENTER); |
| | | scrollTable.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeightWithScroll(0, frame))); |
| | | jLeft.add(scrollTable); |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | |
| | | jLeft.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeight(0, frame))); |
| | | scrollTable.setPreferredSize(new Dimension(width / 4 - 20, Compute.ComputeHeightWithScroll(0, frame))); |
| | | jLeft.revalidate(); |
| | | jLeft.repaint(); |
| | | scrollTable.revalidate(); |
| | | scrollTable.repaint(); |
| | | } |
| | | }); |
| | | |
| | | // å建水平åå²é¢æ¿ |
| | | JSplitPane hSplitPane = new JSplitPane( |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | int r = subTable.getSelectedRow(); |
| | | DjJdgzNetworkLevel2 data = list.get(r); |
| | | List<NetworkNodeStatusDto> nodeStatusList = level2Service.getNodeStatusData(data.getId()); |
| | | graph2[0] = netWorkDiagramService.getCsDiagram(graph2[0], data.getContent(), nodeStatusList, diagram.getPreferredSize().width, diagram.getPreferredSize().height); |
| | | mxGraph csDiagram = netWorkDiagramService.getCsDiagram(graph2[0], data.getContent(), nodeStatusList, diagram.getPreferredSize().width, diagram.getPreferredSize().height); |
| | | if (nodeStatusList != null && nodeStatusList.size() > 0) { |
| | | graph2[0] = csDiagram; |
| | | } else { |
| | | graph2[0].removeCells(graph2[0].getChildVertices(graph2[0].getDefaultParent())); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.client.utils.MultiSelectComboBox; |
| | | import com.example.server.cabin.service.CabinService; |
| | |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(); |
| | | panel.setPreferredSize(new Dimension(width,height)); |
| | | |
| | | JPanel topJpanel = new JPanel(); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | |
| | | topJpanel.setBackground(Color.WHITE); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | if (selectedItem != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | 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(); |
| | |
| | | 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)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,jFrame))); |
| | | centerJpanel.add(scrollPane); |
| | | jFrame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(100,jFrame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | |
| | | 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.client.utils.*; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.Dto.TableNodeDto; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.event.TableModelEvent; |
| | | import javax.swing.table.DefaultTableCellRenderer; |
| | | import javax.swing.table.DefaultTableModel; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | |
| | | private List<ColumnDto> columnDto; |
| | | |
| | | |
| | | public JPanel createTable(Integer width, Integer height) { |
| | | JPanel panel = new JPanel(); |
| | | public JPanel createTable(Integer width, Integer height,JFrame frame) { |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | |
| | | JPanel topJpanel = new JPanel(); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | |
| | | topJpanel.setBackground(Color.WHITE); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,frame))); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | |
| | | JComboBoxItem[] cabinList = cabinService.getList(); |
| | | JComboBoxItem[] deptList = sysTeamGroupClassService.getDeptList(); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç","" |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç", "" |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("å·¥ç¨"); |
| | |
| | | JTextField sb = new JTextField(16); |
| | | JButton query = new JButton("æ¥è¯¢"); |
| | | |
| | | List<ColorDescription> colorDescriptions = new ArrayList<>(); |
| | | colorDescriptions.add(new ColorDescription("#3498DB", "è¿è¡ä¸")); |
| | | colorDescriptions.add(new ColorDescription("#F1C40F", "临æ")); |
| | | colorDescriptions.add(new ColorDescription("#E74C3C", "龿")); |
| | | colorDescriptions.add(new ColorDescription("#2ECC71", "æ£å¸¸å®æ")); |
| | | colorDescriptions.add(new ColorDescription("#006400", "è¶
æå®æ")); |
| | | |
| | | // åå»ºä¸ææ¡ |
| | | ColorDescriptionComboBox comboBox5 = new ColorDescriptionComboBox(colorDescriptions); |
| | | |
| | | |
| | | 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(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)); |
| | | topJpanel.add(comboBox5, new GBC(3, 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); |
| | | 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)); |
| | |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | MouseMotionListener mouseMotionListener = new MouseMotionListener() { |
| | | @Override |
| | | public void mouseDragged(MouseEvent e) { |
| | | // ä¸éè¦å¤çé¼ æ æå¨äºä»¶ |
| | | } |
| | | |
| | | @Override |
| | | public void mouseMoved(MouseEvent e) { |
| | | Point point = e.getPoint(); |
| | | int row = table.rowAtPoint(point); |
| | | int column = table.columnAtPoint(point); |
| | | |
| | | if (row <= list.size() && column > 1) { |
| | | String hexColor = (String) table.getValueAt(row, column); |
| | | String tooltip = getTooltipText(hexColor); |
| | | table.setToolTipText(tooltip); |
| | | } else { |
| | | table.setToolTipText(null); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | table.addMouseMotionListener(mouseMotionListener); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | String content = comboBox.getSelectedItem().toString(); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | |
| | | public void itemStateChanged(ItemEvent e) { |
| | | if (e.getStateChange() == ItemEvent.SELECTED) { |
| | | JComboBoxItem selectedItem = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | if (selectedItem.getId() != null) { |
| | | long selectedId = selectedItem.getId(); |
| | | if (selectedItem != 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(); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | |
| | | Long shipId = shipMap.get(content); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type,null); |
| | | list = level3Service.getNodeList(shipId, dept.getId(), team.getId(), cabin.getId(), type, null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | |
| | | query.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | list = level3Service.getNodeList(null, null, null, null, null,sb.getText()); |
| | | list = level3Service.getNodeList(null, null, null, null, null, sb.getText()); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | |
| | | 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)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,frame))); |
| | | centerJpanel.add(scrollPane); |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,frame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20,Compute.ComputeHeightWithScroll(100,frame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | | |
| | | private static String getTooltipText(String hexColor) { |
| | | switch (hexColor) { |
| | | case "#3498DB": |
| | | return "è¿è¡ä¸"; |
| | | case "#F1C40F": |
| | | return "临æ"; |
| | | case "#E74C3C": |
| | | return "龿"; |
| | | case "#2ECC71": |
| | | return "æ£å¸¸å®æ"; |
| | | case "#006400": |
| | | return "è¶
æå®æ"; |
| | | default: |
| | | return "æªå¼å§"; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | mxGraphComponent graphComponent = new mxGraphComponent(graph); |
| | | graphComponent.setConnectable(false); |
| | | graphComponent.setDragEnabled(false); |
| | | graphComponent.zoomTo(2, true); |
| | | graphComponent.zoomTo(1, true); |
| | | diagram.add(graphComponent); |
| | | |
| | | mxGraph finalGraph = graph; |
| | |
| | | JPanel level1Manage = level1ManageService.createTable(width, height, frame); |
| | | main.showTab("ä¸çº§ç½ç»å¾ç®¡ç", level1Manage, tree); |
| | | } else if (nodeName.equals("ä¸çº§ç½ç»å¾æ¥ç")) { |
| | | JPanel level1View = level1ViewService.createTable(width, height); |
| | | JPanel level1View = level1ViewService.createTable(width, height,frame); |
| | | main.showTab("ä¸çº§ç½ç»å¾æ¥ç", level1View, tree); |
| | | } else if (nodeName.equals("äºçº§ç½ç»å¾ç®¡ç")) { |
| | | JPanel level2Manage = level2ManageService.createTable(width, height, frame); |
| | | main.showTab("äºçº§ç½ç»å¾ç®¡ç", level2Manage, tree); |
| | | } else if (nodeName.equals("äºçº§ç½ç»å¾æ¥ç")) { |
| | | JPanel level2View = level2ViewService.createTable(width, height); |
| | | JPanel level2View = level2ViewService.createTable(width, height,frame); |
| | | main.showTab("äºçº§ç½ç»å¾æ¥ç", level2View, tree); |
| | | } else if (nodeName.equals("ä¸çº§ç½ç»å¾ç®¡ç")) { |
| | | JPanel level3Manage = level3ManageService.createTable(width, height, frame); |
| | | main.showTab("ä¸çº§ç½ç»å¾ç®¡ç", level3Manage, tree); |
| | | } else if (nodeName.equals("ä¸çº§ç½ç»å¾æ¥ç")) { |
| | | JPanel level3View = level3View2Service.createTable(width, height); |
| | | JPanel level3View = level3View2Service.createTable(width, height,frame); |
| | | main.showTab("ä¸çº§ç½ç»å¾æ¥ç", level3View, tree); |
| | | } else if (nodeName.equals("项ç®è¿åº¦è¡¨")) { |
| | | JPanel trackRecord = trackRecordManageService.createTable(width, height, frame); |
| | |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.BoxIteUtils; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzDismantTrack; |
| | |
| | | |
| | | public JPanel createTrack(Integer width, Integer height, DjJdgzNetworkLevel3 djJdgzNetworkLevel3,JFrame frame) { |
| | | nowLevel3 = djJdgzNetworkLevel3; |
| | | JPanel panel = new JPanel(); |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 37)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 40)); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,frame))); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | | |
| | |
| | | |
| | | JScrollPane scrollPane = new JScrollPane(trackTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | scrollPane.setViewportView(trackTable); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, height - 130)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.add(scrollPane); |
| | | |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | return panel; |
| | | } |
| | | |
| | |
| | | import com.example.client.dto.ColumnDto; |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel3; |
| | |
| | | JPanel jLeft = new JPanel(new BorderLayout()); |
| | | |
| | | JPanel top = new JPanel(); |
| | | JPanel center = new JPanel(); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | top.setLayout(layout); |
| | | |
| | | jLeft.setPreferredSize(new Dimension(width / 2 - 20, height)); |
| | | top.setPreferredSize(new Dimension(width / 2 - 20, 100)); |
| | | jLeft.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(0,frame))); |
| | | center.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(100,frame))); |
| | | |
| | | jLeft.add(center,BorderLayout.CENTER); |
| | | |
| | | |
| | | // åå»ºå·¦ä¾§è¡¨æ ¼ |
| | | |
| | |
| | | |
| | | JTable subTable = CommonTable.createCommonTable(list, columnDto); |
| | | subTable.setRowHeight(25); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); |
| | | subTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | |
| | | |
| | | |
| | | JScrollPane scrollTable = new JScrollPane(subTable); |
| | | jLeft.add(scrollTable, BorderLayout.CENTER); |
| | | scrollTable.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeightWithScroll(100,frame))); |
| | | center.add(scrollTable); |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | jLeft.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(0,frame))); |
| | | center.setPreferredSize(new Dimension(width / 2 - 20, Compute.ComputeHeight(100,frame))); |
| | | scrollTable.setPreferredSize(new Dimension(width / 2 - 20,Compute.ComputeHeightWithScroll(100,frame))); |
| | | jLeft.revalidate(); |
| | | jLeft.repaint(); |
| | | center.revalidate(); |
| | | center.repaint(); |
| | | scrollTable.revalidate(); |
| | | scrollTable.repaint(); |
| | | } |
| | | }); |
| | | |
| | | JPanel track = addOrUpdate.createTrack(width / 2, height, list.get(0), frame); |
| | | |
| | |
| | | |
| | | 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.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.*; |
| | | import com.example.server.sysOss.model.SysOss; |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.utils.CacheUtils; |
| | | import com.mxgraph.swing.mxGraphComponent; |
| | | import com.mxgraph.view.mxGraph; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jdesktop.swingx.JXDatePicker; |
| | | 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 javax.swing.table.TableModel; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | import java.text.ParseException; |
| | |
| | | trackPersonDesc.setText(data.getTrackPerson()); |
| | | } |
| | | |
| | | JLabel JLabel34 = new JLabel("åä½"); |
| | | JTextField trackPersonUnitDesc = new JTextField(16); |
| | | if (StringUtils.isNotBlank(data.getTrackPersonUnit())) { |
| | | trackPersonUnitDesc.setText(data.getTrackPersonUnit()); |
| | | } |
| | | |
| | | JLabel JLabel4 = new JLabel("èç³»æ¹å¼"); |
| | | JTextField trackPersonContactDesc = new JTextField(16); |
| | | if (StringUtils.isNotBlank(data.getTrackPersonContact())) { |
| | |
| | | JTextField trackedPersonDesc = new JTextField(16); |
| | | if (StringUtils.isNotBlank(data.getTrackedPerson())) { |
| | | trackedPersonDesc.setText(data.getTrackedPerson()); |
| | | } |
| | | |
| | | JLabel JLabel56 = new JLabel("åä½"); |
| | | JTextField trackedPersonUnitDesc = new JTextField(16); |
| | | if (StringUtils.isNotBlank(data.getTrackedPersonUnit())) { |
| | | trackedPersonUnitDesc.setText(data.getTrackedPersonUnit()); |
| | | } |
| | | |
| | | JLabel JLabel6 = new JLabel("èç³»æ¹å¼"); |
| | |
| | | |
| | | frame1.add(JLabel3, new GBC(0, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackPersonDesc, new GBC(1, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel4, new GBC(2, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackPersonContactDesc, new GBC(3, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel34, new GBC(2, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackPersonUnitDesc, new GBC(3, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel4, new GBC(4, 1, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackPersonContactDesc, new GBC(5, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel5, new GBC(0, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackedPersonDesc, new GBC(1, 2, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel6, new GBC(2, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackedPersonContactDesc, new GBC(3, 2, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel56, new GBC(2, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackedPersonUnitDesc, new GBC(3, 2, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | frame1.add(JLabel6, new GBC(4, 2, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(trackedPersonContactDesc, new GBC(5, 2, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | frame1.add(JLabel7, new GBC(0, 3, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | frame1.add(generalRepairUnitDesc, new GBC(1, 3, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | |
| | | data.setTrackLocation(trackLocatDesc.getText()); |
| | | data.setTrackPerson(trackPersonDesc.getText()); |
| | | data.setTrackPersonContact(trackPersonContactDesc.getText()); |
| | | data.setTrackPersonUnit(trackPersonUnitDesc.getText()); |
| | | data.setTrackedPersonUnit(trackedPersonUnitDesc.getText()); |
| | | data.setTrackedPerson(trackedPersonDesc.getText()); |
| | | data.setTrackedPersonContact(trackedPersonContactDesc.getText()); |
| | | data.setGeneralRepairUnit(generalRepairUnitDesc.getText()); |
| | |
| | | data.setRemark(remark.getText()); |
| | | Long id = djJdgzTrackRecordService.save(data); |
| | | uploadFile.save(id); |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(level1Id, 0); |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(level1Id, level3.getDeptId(), null, null, level3.getType(), 0, null); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | trackRecordManageService.tableModelListener(table, jFrame, list); |
| | | frame1.dispose(); |
| | |
| | | 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.*; |
| | | 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 javax.swing.*; |
| | | import javax.swing.event.TableModelEvent; |
| | | import javax.swing.table.TableColumnModel; |
| | | import java.awt.*; |
| | | import java.awt.event.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | |
| | | @Service |
| | |
| | | private JTable table; |
| | | private List<DjJdgzTrackRecord> list; |
| | | private List<ColumnDto> columnDto; |
| | | private TableColumnModel columnModel; |
| | | |
| | | public JPanel createTable(Integer width, Integer height, JFrame jFrame) { |
| | | JPanel panel = new JPanel(); |
| | | |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width, 37)); |
| | | JPanel topJpanel = new JPanel(); |
| | | GridBagLayout layout = new GridBagLayout(); |
| | | topJpanel.setLayout(layout); |
| | | topJpanel.setPreferredSize(new Dimension(width - 20, 100)); |
| | | topJpanel.setBackground(Color.WHITE); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); |
| | | centerJpanel.setBackground(Color.WHITE); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | |
| | | new JComboBoxItem(1L, "已宿") |
| | | }; |
| | | |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(null); |
| | | String[] typeList = new String[]{ |
| | | "æ¹è£
", "å è£
", "æ¢è£
", "æ¹è¿æ§ä¿®ç", "" |
| | | }; |
| | | |
| | | JLabel JLabel0 = new JLabel("å·¥ç¨"); |
| | | JComboBox<JComboBoxItem> comboBox = new JComboBox<>(projectList); |
| | | comboBox.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JLabel JLabel1 = new JLabel("é¨é¨"); |
| | | JComboBox<JComboBoxItem> comboBox1 = new JComboBox<>(deptList); |
| | | comboBox1.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JComboBoxItem[] teamList1 = sysTeamGroupClassService.getTeamList(deptList[0].getId()); |
| | | |
| | | JLabel JLabel2 = new JLabel("ä¸ä¸"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(teamList1); |
| | | comboBox2.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JLabel JLabel3 = new JLabel("è±å®¤"); |
| | | JComboBox<JComboBoxItem> comboBox3 = new JComboBox<>(cabinList); |
| | | comboBox3.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JLabel JLabel4 = new JLabel("ç±»å«"); |
| | | JComboBox<String> comboBox4 = new JComboBox<>(typeList); |
| | | comboBox4.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JLabel JLabel5 = new JLabel("ç¶æ"); |
| | | JComboBox<JComboBoxItem> comboBox5 = new JComboBox<>(statusList); |
| | | comboBox5.setPreferredSize(new Dimension(150, 28)); |
| | | |
| | | JTextField sb = new JTextField(16); |
| | | sb.setPreferredSize(new Dimension(150, 28)); |
| | | JButton query = new JButton("æ¥è¯¢"); |
| | | |
| | | 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(); |
| | | JComboBoxItem selectedItem2 = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | |
| | | comboBox.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem selectedItemNow = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem selectedItem2Now = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Long level1Id = selectedItemNow.getId(); |
| | | Long Status = selectedItem2Now.getId(); |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(level1Id, Math.toIntExact(Status)); |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table, jFrame,list); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | |
| | | comboBox1.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | Long deptId = dept.getId(); |
| | | JComboBoxItem[] teamList = sysTeamGroupClassService.getTeamList(deptId); |
| | | comboBox2.setModel(new DefaultComboBoxModel<>(teamList)); |
| | | |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | |
| | | comboBox2.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem selectedItemNow = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem selectedItem2Now = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Long level1Id = selectedItemNow.getId(); |
| | | Long Status = selectedItem2Now.getId(); |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(level1Id, Math.toIntExact(Status)); |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | tableModelListener(table, jFrame,list); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | |
| | | comboBox3.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | comboBox4.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | |
| | | comboBox5.addItemListener(new ItemListener() { |
| | | public void itemStateChanged(final ItemEvent event) { |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox1.getSelectedItem(); |
| | | JComboBoxItem team = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | JComboBoxItem cabin = (JComboBoxItem) comboBox3.getSelectedItem(); |
| | | String type = comboBox4.getSelectedItem().toString(); |
| | | JComboBoxItem status = (JComboBoxItem) comboBox5.getSelectedItem(); |
| | | |
| | | list = djJdgzTrackRecordService.getList(project.getId(), dept.getId(), team.getId(), cabin.getId(), type, Math.toIntExact(status.getId()), null); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | query.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | JComboBoxItem project = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | list = djJdgzTrackRecordService.getList(project.getId(), null, null, null, null, null, sb.getText()); |
| | | |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | table.setRowHeight(25); |
| | | |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | tableModelListener(table, jFrame, list); |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | JComboBoxItem selectedItemNow = (JComboBoxItem) comboBox.getSelectedItem(); |
| | | importTrackRecordService.FileUpload(columnDto,table,jFrame); |
| | | importTrackRecordService.FileUpload(columnDto, table, jFrame); |
| | | } |
| | | }); |
| | | |
| | | topJpanel.add(btnTj); |
| | | topJpanel.add(btnJc); |
| | | topJpanel.add(btnExport); |
| | | topJpanel.add(btnImport); |
| | | topJpanel.add(comboBox); |
| | | topJpanel.add(comboBox2); |
| | | |
| | | comboBox.setPreferredSize(new Dimension(300, 28)); |
| | | comboBox2.setPreferredSize(new Dimension(300, 28)); |
| | | |
| | | list = djJdgzTrackRecordService.getList(selectedItem.getId(), Math.toIntExact(selectedItem2.getId())); |
| | | list = djJdgzTrackRecordService.getList(projectList[0].getId(), deptList[0].getId(), teamList[0].getId(), cabinList[0].getId(), typeList[0], Math.toIntExact(statusList[0].getId()), null); |
| | | List<TableButton> buttonList = new ArrayList<>(); |
| | | buttonList.add(new TableButton("edit", "ç¼è¾")); |
| | | |
| | |
| | | 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("å½åèç¹", "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)); |
| | | columnDto.add(new ColumnDto("åæ¿ä¿®åä½", "repair", 180, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("å½åèç¹", "level3NodeName", 150, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("计å宿æ¶é´", "requiredCompletionTime", 180, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("è·è¸ªè®°å½", "", 100, "", true, buttonList, null)); |
| | | columnDto.add(new ColumnDto("æ»æ¿ä¿®åä½", "generalRepair", 200, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("åæ¿ä¿®åä½", "repair", 200, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("åå²è®°å½", "trackNum", 100, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("宿æ¶é´", "actualCompletion", 200, null, false, null, null)); |
| | | columnDto.add(new ColumnDto("éä»¶", "fileName", 200, null, false, null, null)); |
| | |
| | | table = CommonTable.createCommonTable(list, columnDto); |
| | | table.setRowHeight(25); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
| | | |
| | | List<String> itemList = new ArrayList<>(); |
| | | for (ColumnDto dto : columnDto) { |
| | | itemList.add(dto.getColumnDesc()); // å° dto.getColumnDesc() æ·»å å° List ä¸ |
| | | } |
| | | |
| | | String[] items = itemList.toArray(new String[0]); |
| | | columnModel = table.getColumnModel(); |
| | | MultiSelectComboBox2 mulcomboBox = new MultiSelectComboBox2(items,columnDto,columnModel); |
| | | |
| | | /* final Integer[] lastIndex = {-1}; |
| | | mulcomboBox.addItemListener(new ItemListener() { |
| | | @Override |
| | | public void itemStateChanged(ItemEvent event) { |
| | | int selectedIndex = mulcomboBox.getSelectedIndex(); |
| | | if (lastIndex[0] == selectedIndex){ |
| | | lastIndex[0] = -1; |
| | | return; |
| | | }else{ |
| | | lastIndex[0] = selectedIndex; |
| | | } |
| | | if (selectedIndex != -1) { |
| | | // æ´æ° selectedIndices |
| | | if (event.getStateChange() == ItemEvent.SELECTED){ |
| | | Integer width = columnDto.get(selectedIndex).getColumnWidth(); |
| | | columnModel.getColumn(selectedIndex).setPreferredWidth(width); |
| | | }else{ |
| | | columnModel.getColumn(selectedIndex).setPreferredWidth(0); |
| | | } |
| | | } |
| | | } |
| | | });*/ |
| | | |
| | | 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(JLabel5, new GBC(10, 0, 1, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(comboBox5, new GBC(11, 0, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | topJpanel.add(btnTj, new GBC(1, 1, 1, 1).setInsets(5)); |
| | | topJpanel.add(btnJc, new GBC(2, 1, 2, 1).setInsets(5)); |
| | | topJpanel.add(btnImport, new GBC(4, 1, 2, 1).setInsets(5)); |
| | | topJpanel.add(btnExport, new GBC(6, 1, 2, 1).setInsets(5)); |
| | | topJpanel.add(mulcomboBox, new GBC(8, 1, 2, 1).setInsets(5)); |
| | | topJpanel.add(sb, new GBC(10, 1, 2, 1).setAnchor(GBC.SOUTHEAST).setInsets(5)); |
| | | topJpanel.add(query, new GBC(12, 1, 1, 1).setAnchor(GBC.SOUTHWEST).setInsets(5)); |
| | | |
| | | |
| | | table.addMouseListener(new MouseAdapter() { |
| | | @Override |
| | |
| | | exportTrackRecordService.openDialog(jFrame); |
| | | } |
| | | }); |
| | | tableModelListener(table, jFrame,list); |
| | | tableModelListener(table, jFrame, list); |
| | | |
| | | 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 - 130)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,jFrame))); |
| | | centerJpanel.add(scrollPane); |
| | | jFrame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(100,jFrame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(100,jFrame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | |
| | | return panel; |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | public void tableModelListener(JTable table, JFrame jFrame,List<DjJdgzTrackRecord> recordList) { |
| | | public void tableModelListener(JTable table, JFrame jFrame, List<DjJdgzTrackRecord> recordList) { |
| | | table.getModel().addTableModelListener(e -> { |
| | | // æ£æ¥äºä»¶ç±»å |
| | | if (e.getType() == TableModelEvent.UPDATE) { |
| | |
| | | data = djJdgzTrackRecordService.get(data.getId()); |
| | | data.setLevel1NetworkId(level1Id); |
| | | data.setIsUpdate(isUpdate); |
| | | }else{ |
| | | } else { |
| | | DjJdgzNetworkLevel3 level3 = level3Service.get(data.getLevel3NetworkId()); |
| | | data.setGeneralRepairUnit(level3.getGeneralRepairUnit()); |
| | | data.setGeneralRepairUnitDirector(level3.getGeneralRepairUnitDirector()); |
| | |
| | | System.out.println("åå
æ ¼åå: è¡=" + row + ", å=" + column + ", æ°å¼=" + newValue); |
| | | } |
| | | }); |
| | | |
| | | table.addMouseListener(new MouseAdapter() { |
| | | @Override |
| | | public void mousePressed(MouseEvent e) { |
| | | if (e.isPopupTrigger()) { |
| | | showPopupMenu(e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void mouseReleased(MouseEvent e) { |
| | | if (e.isPopupTrigger()) { |
| | | showPopupMenu(e); |
| | | } |
| | | } |
| | | |
| | | private void showPopupMenu(MouseEvent e) { |
| | | JPopupMenu popupMenu = new JPopupMenu(); |
| | | JMenuItem menuItem1 = new JMenuItem("æ¤å"); |
| | | popupMenu.add(menuItem1); |
| | | int row = table.rowAtPoint(e.getPoint()); |
| | | int col = table.columnAtPoint(e.getPoint()); |
| | | DjJdgzTrackRecord djJdgzTrackRecord = list.get(row); |
| | | if (djJdgzTrackRecord.getCurrentStatus() == 1) { |
| | | table.setRowSelectionInterval(row, row); |
| | | popupMenu.show(e.getComponent(), e.getX(), e.getY()); |
| | | menuItem1.addActionListener(ex -> { |
| | | djJdgzTrackRecordService.retract(djJdgzTrackRecord.getId()); |
| | | List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getList(djJdgzTrackRecord.getLevel1NetworkId(), null, null, null, null, 0, null); |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | tableModelListener(table, jFrame, list); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.example.client.utils; |
| | | |
| | | public class ColorDescription { |
| | | private String hexColor; |
| | | private String description; |
| | | |
| | | public ColorDescription(String hexColor, String description) { |
| | | this.hexColor = hexColor; |
| | | this.description = description; |
| | | } |
| | | |
| | | public String getHexColor() { |
| | | return hexColor; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.client.utils; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.plaf.basic.BasicComboBoxEditor; |
| | | import javax.swing.table.DefaultTableCellRenderer; |
| | | import javax.swing.table.TableColumnModel; |
| | | import java.awt.*; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class ColorDescriptionComboBox extends JComboBox<ColorDescription> { |
| | | private String defaultText; // é»è®¤æ¾ç¤ºææ¬ |
| | | |
| | | public ColorDescriptionComboBox(List<ColorDescription> colorDescriptions) { |
| | | super(colorDescriptions.toArray(new ColorDescription[0])); |
| | | this.defaultText = "ç¶æ"; // 设置é»è®¤ææ¬ |
| | | setEditable(true); |
| | | |
| | | // èªå®ä¹æ¸²æå¨ |
| | | 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 instanceof ColorDescription) { |
| | | ColorDescription cd = (ColorDescription) value; |
| | | setText(cd.getDescription()); // æ¾ç¤ºæè¿° |
| | | setIcon(new ColorIcon(cd.getHexColor())); // 设置å形徿 |
| | | } |
| | | return this; |
| | | } |
| | | }); |
| | | |
| | | // èªå®ä¹ç¼è¾å¨ |
| | | setEditor(new BasicComboBoxEditor() { |
| | | private JTextField textField; |
| | | |
| | | @Override |
| | | public Component getEditorComponent() { |
| | | if (textField == null) { |
| | | textField = new JTextField(defaultText); // 设置é»è®¤ææ¬ |
| | | textField.setEditable(false); // 设置为ä¸å¯ç¼è¾ |
| | | } |
| | | return textField; |
| | | } |
| | | |
| | | @Override |
| | | public void setItem(Object anObject) { |
| | | // ç¦ç¨èªå¨æ´æ°ç¼è¾å¨ææ¬çè¡ä¸º |
| | | if (textField != null) { |
| | | textField.setText(defaultText); // å§ç»æ¾ç¤ºé»è®¤ææ¬ |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | // èªå®ä¹å形徿 ç±» |
| | | class ColorIcon implements Icon { |
| | | private Color color; |
| | | |
| | | public ColorIcon(String hexColor) { |
| | | this.color = ColorUtils.hexToColor(hexColor); |
| | | } |
| | | |
| | | @Override |
| | | public void paintIcon(Component c, Graphics g, int x, int y) { |
| | | int width = getIconWidth(); |
| | | int height = getIconHeight(); |
| | | int diameter = Math.min(width, height); |
| | | int xCenter = (width - diameter) / 2; |
| | | int yCenter = (height - diameter) / 2; |
| | | |
| | | g.setColor(color); |
| | | g.fillOval(x + xCenter, y + yCenter, diameter, diameter); |
| | | } |
| | | |
| | | @Override |
| | | public int getIconWidth() { |
| | | return 20; // åå½¢ç宽度 |
| | | } |
| | | |
| | | @Override |
| | | public int getIconHeight() { |
| | | return 20; // åå½¢çé«åº¦ |
| | | } |
| | | } |
| | | // åå
è¿å¶é¢è²è½¬æ¢ä¸º Color 对象 |
| | | class ColorUtils { |
| | | public static Color hexToColor(String hex) { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | public static void setColumnType(List<ColumnDto> dtoList, JTable table) { |
| | | for (int j = 0; j < dtoList.size(); j++) { |
| | | table.getColumnModel().getColumn(j).setPreferredWidth(dtoList.get(j).getColumnWidth()); |
| | | table.getColumnModel().getColumn(j).setMinWidth(2); |
| | | if (dtoList.get(j).getButtonList() != null) { |
| | | CreateTableButton.AcceptRejectRenderer renderer = new CreateTableButton.AcceptRejectRenderer(dtoList.get(j).getButtonList()); |
| | | table.getColumnModel().getColumn(j).setCellRenderer(renderer); |
New file |
| | |
| | | package com.example.client.utils; |
| | | |
| | | import javax.swing.*; |
| | | import java.awt.*; |
| | | |
| | | public class Compute { |
| | | /*public static Integer ComputeHeight(Integer topHeight){ |
| | | GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
| | | Rectangle rect = ge.getMaximumWindowBounds(); |
| | | Integer screenWidth = rect.width; |
| | | Integer screenHeight = rect.height; |
| | | |
| | | Integer panelHeight = screenHeight - 50 - topHeight; |
| | | |
| | | return panelHeight; |
| | | } |
| | | public static Integer ComputeHeightWithScroll(Integer topHeight){ |
| | | GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
| | | Rectangle rect = ge.getMaximumWindowBounds(); |
| | | Integer screenWidth = rect.width; |
| | | Integer screenHeight = rect.height; |
| | | |
| | | Integer panelHeight = screenHeight - 50 - 30 - topHeight; |
| | | |
| | | return panelHeight; |
| | | }*/ |
| | | public static Integer ComputeHeight(Integer topHeight, JFrame frame){ |
| | | int height = frame.getSize().height; |
| | | Integer panelHeight = height - 70 - topHeight; |
| | | |
| | | return panelHeight; |
| | | } |
| | | public static Integer ComputeHeightWithScroll(Integer topHeight, JFrame frame){ |
| | | int height = frame.getSize().height; |
| | | Integer panelHeight = height - 100 - topHeight; |
| | | |
| | | return panelHeight; |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.client.utils; |
| | | |
| | | import com.example.client.dto.ColumnDto; |
| | | |
| | | import javax.swing.*; |
| | | import javax.swing.plaf.basic.BasicComboBoxEditor; |
| | | import javax.swing.table.TableColumnModel; |
| | | import java.awt.*; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class MultiSelectComboBox2 extends JComboBox<String> { |
| | | public Set<Integer> selectedIndices = new HashSet<>(); |
| | | private String defaultText; // é»è®¤æ¾ç¤ºææ¬ |
| | | |
| | | public MultiSelectComboBox2(String[] items, List<ColumnDto> columnDto, TableColumnModel columnModel) { |
| | | super(items); |
| | | this.defaultText = "èªå®ä¹è¡¨å¤´"; // 设置é»è®¤ææ¬ |
| | | setEditable(true); |
| | | |
| | | // èªå®ä¹æ¸²æå¨ |
| | | setRenderer(new DefaultListCellRenderer() { |
| | | @Override |
| | | public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
| | | JCheckBox checkBox = new JCheckBox(); |
| | | checkBox.setText(value.toString()); // 使ç¨å符串ä½ä¸ºææ¬ |
| | | checkBox.setSelected(selectedIndices.contains(index)); // 设置éä¸ç¶æ |
| | | checkBox.setEnabled(list.isEnabled()); |
| | | checkBox.setFont(list.getFont()); |
| | | checkBox.setFocusPainted(false); |
| | | checkBox.setBackground(isSelected ? list.getSelectionBackground() : list.getBackground()); |
| | | checkBox.setForeground(isSelected ? list.getSelectionForeground() : list.getForeground()); |
| | | return checkBox; |
| | | } |
| | | }); |
| | | |
| | | // èªå®ä¹ç¼è¾å¨ |
| | | setEditor(new BasicComboBoxEditor() { |
| | | private JTextField textField; |
| | | |
| | | @Override |
| | | public Component getEditorComponent() { |
| | | if (textField == null) { |
| | | textField = new JTextField(defaultText); // 设置é»è®¤ææ¬ |
| | | textField.setEditable(false); // 设置为ä¸å¯ç¼è¾ |
| | | } |
| | | return textField; |
| | | } |
| | | |
| | | @Override |
| | | public void setItem(Object anObject) { |
| | | // ç¦ç¨èªå¨æ´æ°ç¼è¾å¨ææ¬çè¡ä¸º |
| | | if (textField != null) { |
| | | textField.setText(defaultText); // å§ç»æ¾ç¤ºé»è®¤ææ¬ |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // æ·»å å¨ä½çå¬å¨ |
| | | addActionListener(e -> { |
| | | int selectedIndex = getSelectedIndex(); |
| | | if (selectedIndex != -1) { |
| | | if (selectedIndices.contains(selectedIndex)) { |
| | | selectedIndices.remove(selectedIndex); |
| | | if (columnModel != null) { |
| | | columnModel.getColumn(selectedIndex).setPreferredWidth(2); |
| | | } |
| | | } else { |
| | | selectedIndices.add(selectedIndex); |
| | | if (columnModel != null) { |
| | | Integer width = columnDto.get(selectedIndex).getColumnWidth(); |
| | | columnModel.getColumn(selectedIndex).setPreferredWidth(width); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // é»è®¤é䏿æé¡¹ |
| | | for (int i = 0; i < getItemCount(); i++) { |
| | | selectedIndices.add(i); // å°ææç´¢å¼æ·»å å°éä¸éå |
| | | } |
| | | } |
| | | |
| | | public Set<String> getSelectedItems() { |
| | | Set<String> selectedItems = new HashSet<>(); |
| | | for (Integer index : selectedIndices) { |
| | | selectedItems.add((String) getItemAt(index)); |
| | | } |
| | | return selectedItems; |
| | | } |
| | | |
| | | public void setSelectedItems(Set<String> items) { |
| | | selectedIndices.clear(); // æ¸
空å½åéä¸é¡¹ |
| | | for (int i = 0; i < getItemCount(); i++) { |
| | | String item = getItemAt(i); |
| | | if (items.contains(item)) { |
| | | selectedIndices.add(i); // å°å¯¹åºçç´¢å¼æ·»å å°éä¸éå |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Set<Integer> getUnselectedIndices() { |
| | | Set<Integer> unselectedIndices = new HashSet<>(); |
| | | for (int i = 0; i < getItemCount(); i++) { |
| | | if (!selectedIndices.contains(i)) { |
| | | unselectedIndices.add(i); |
| | | } |
| | | } |
| | | return unselectedIndices; |
| | | } |
| | | |
| | | public Set<Integer> getSelectedIndices() { |
| | | return new HashSet<>(selectedIndices); |
| | | } |
| | | } |
| | |
| | | package com.example.server.DataSync.service; |
| | | |
| | | import com.example.Application; |
| | | import com.example.client.service.DataExportManageService; |
| | | import com.example.client.service.DataImportManageService; |
| | | import com.example.client.utils.WaitUtil; |
| | | import com.example.server.DataSync.dto.IDUpdateDateDto; |
| | | import com.example.server.DataSync.dto.FieldTypeDto; |
| | | import com.example.server.mysql.dao.SysMysqlDao; |
| | | import com.example.server.progressTrack.dao.ExportRecordDao; |
| | | import com.example.server.progressTrack.dao.ImportRecordDao; |
| | | import com.example.server.progressTrack.model.ExportRecord; |
| | | import com.example.server.progressTrack.model.ImportRecord; |
| | | import com.example.server.utils.CacheUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | public class DataSyncService { |
| | | @Autowired |
| | | protected SysMysqlDao sysMysqlDao; |
| | | @Autowired |
| | | protected ExportRecordDao exportRecordDao; |
| | | @Autowired |
| | | protected ImportRecordDao importRecordDao; |
| | | @Autowired |
| | | DataExportManageService dataExportManageService; |
| | | @Autowired |
| | | DataImportManageService dataImportManageService; |
| | | |
| | | @Value("${data.config-path}") |
| | | private String configPath2; |
| | |
| | | @Value("${spring.datasource.url}") |
| | | private String datasource; |
| | | |
| | | public void export() { |
| | | |
| | | public void export(JTextArea tips) { |
| | | final String[] massage = {""}; |
| | | String[] parts = datasource.split(":", 3); |
| | | // å®ä¹æä»¶è·¯å¾ |
| | | String dbPath = parts[2]; |
| | |
| | | String outputZipPath = showSaveFileDialog(mySite + "åæ¥æ°æ®å
.zip"); |
| | | |
| | | if (outputZipPath == null) { |
| | | System.out.println("ç¨æ·åæ¶ä¿åï¼ç¨åºéåºã"); |
| | | }else{ |
| | | massage[0] = "ç¨æ·åæ¶ä¿åï¼ç¨åºéåºã"+ new Date(); |
| | | tips.setText(tips.getText() + massage[0]); |
| | | } else { |
| | | final WaitUtil waitUtil = new WaitUtil(imgPath, "æ°æ®æ£å¨å¯¼å
¥ï¼è¯·ç¨å"); |
| | | |
| | | // å¼å§ä¸ä¼ æä»¶ç弿¥ä»»å¡ |
| | | SwingWorker<String, Void> sw = new SwingWorker<String, Void>() { |
| | | @Override |
| | | protected String doInBackground() throws Exception { |
| | | String flag = zipData(dbPath,configPath,directoryPath,outputZipPath); |
| | | String flag = zipData(dbPath, configPath, directoryPath, outputZipPath); |
| | | return flag; |
| | | } |
| | | |
| | |
| | | // å·æ°è¡¨æ ¼æ°æ®ï¼å¦æä¸ä¼ æåï¼ |
| | | if (uploadSucceeded.equals("true")) { |
| | | waitUtil.dispose(); |
| | | System.out.println("å¯¼åºæåæ¶é´" + new Date()); |
| | | massage[0] = "å¯¼åºæå" + new Date(); |
| | | exportRecordDao.insert(new ExportRecord()); |
| | | List<ExportRecord> list = exportRecordDao.getList(); |
| | | dataExportManageService.refresh(list); |
| | | tips.setText(tips.getText() + massage[0]); |
| | | } else { |
| | | waitUtil.dispose(); |
| | | massage[0] = "导åºå¤±è´¥" + new Date(); |
| | | tips.setText(tips.getText() + massage[0]); |
| | | JOptionPane.showMessageDialog(null, uploadSucceeded, "æç¤º", JOptionPane.ERROR_MESSAGE); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public String zipData(String dbPath,String configPath,String directoryPath,String outputZipPath){ |
| | | public String zipData(String dbPath, String configPath, String directoryPath, String outputZipPath) { |
| | | // å建ZIPæä»¶è¾åºæµ |
| | | FileOutputStream fos = null; |
| | | ZipOutputStream zos = null; |
| | |
| | | return "true"; |
| | | } |
| | | |
| | | public void importData() { |
| | | public void importData(JTextArea tips) { |
| | | String massage = ""; |
| | | InputStream inStream = null; |
| | | Properties properties = new Properties(); |
| | | try { |
| | |
| | | |
| | | // éå½å¤å¶æä»¶å¤¹ |
| | | copyDirectory(sourceDir, targetDir); |
| | | System.out.println("æä»¶å¤¹å¤å¶å®æï¼ç®æ è·¯å¾ï¼" + targetDir); |
| | | |
| | | massage = "æä»¶å¤¹å¤å¶å®æï¼ç®æ è·¯å¾ï¼" + targetDir; |
| | | tips.setText(tips.getText() + massage); |
| | | //读åé
ç½® |
| | | inStream = new FileInputStream(UnzipPath + "config.properties"); |
| | | properties.load(inStream); |
| | |
| | | syncTable("dj_jdgz_track_record"); |
| | | syncTable("dj_sys_oss"); |
| | | syncTable("dj_jdgz_dismant_track"); |
| | | syncTable("dj_sys_teamgroup_class"); |
| | | syncTable("sys_user"); |
| | | } |
| | | } else if ("åå®¶".equals(mySite)) { |
| | | syncTable("dj_jdgz_handover"); |
| | |
| | | syncTable("dj_sys_oss"); |
| | | syncTable("dj_jdgz_dismant_track"); |
| | | } |
| | | ImportRecord data =new ImportRecord(); |
| | | data.setImportSite(otherSite); |
| | | importRecordDao.insert(data); |
| | | List<ImportRecord> list = importRecordDao.getList(); |
| | | dataImportManageService.refresh(list); |
| | | } |
| | | |
| | | public void syncTable(String tableName) { |
| | |
| | | java.util.Date otherUpdateDate = dateFormat.parse(otherupdateDate); |
| | | if (otherUpdateDate.after(mysqlUpdateDate)) { |
| | | isUpdate = true; |
| | | }else { |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | |
| | |
| | | public void insertFill(MetaObject metaObject) { |
| | | Object object = metaObject.getOriginalObject(); |
| | | SysUser user = (SysUser) CacheUtils.get("user","user"); |
| | | LocalDate currentDate = LocalDate.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å½åæ¥ææ ¼å¼å为å符串 |
| | | String date = currentDate.format(formatter); |
| | | String date = currentDateTime.format(formatter); |
| | | |
| | | if (object instanceof TeamEntity) { |
| | | TeamEntity entity = (TeamEntity) object; |
| | |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | LocalDate currentDate = LocalDate.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDateTime currentDateTime = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å½åæ¥ææ ¼å¼å为å符串 |
| | | String date = currentDate.format(formatter); |
| | | String date = currentDateTime.format(formatter); |
| | | SysUser user =(SysUser) CacheUtils.get("user","user"); |
| | | Object object = metaObject.getOriginalObject(); |
| | | if (object instanceof PlatformEntity) { |
| | |
| | | @Mapper |
| | | public interface DjJdgzTrackRecordDao extends BaseDao<DjJdgzTrackRecord> { |
| | | |
| | | List<DjJdgzTrackRecord> getList(Long level1NetworkId,Integer status,Long userId); |
| | | List<DjJdgzTrackRecord> getList(Long level1NetworkId, Long deptId, Long teamId, Long cabinId, String type, Integer status, String name); |
| | | |
| | | List<DjJdgzTrackRecord> getHistory(Long level3NodeId); |
| | | |
| | |
| | | Integer getTrackNum(Long level3NodeId); |
| | | |
| | | List<DjJdgzTrackRecord> getListByImport(Long level1Id, Long level2Id, Long level2NodeId, String selectedIds); |
| | | |
| | | void retract(Long id); |
| | | } |
New file |
| | |
| | | package com.example.server.progressTrack.dao; |
| | | |
| | | import com.example.server.dao.BaseDao; |
| | | import com.example.server.progressTrack.model.ExportRecord; |
| | | import com.example.server.progressTrack.model.ImportRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * dj_jdgz_ship |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-12-18 |
| | | */ |
| | | @Mapper |
| | | public interface ExportRecordDao extends BaseDao<ExportRecord> { |
| | | List<ExportRecord> getList(); |
| | | } |
New file |
| | |
| | | package com.example.server.progressTrack.dao; |
| | | |
| | | import com.example.client.dto.JComboBoxItem; |
| | | import com.example.server.dao.BaseDao; |
| | | import com.example.server.progressTrack.model.DjJdgzShip; |
| | | import com.example.server.progressTrack.model.ImportRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * dj_jdgz_ship |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-12-18 |
| | | */ |
| | | @Mapper |
| | | public interface ImportRecordDao extends BaseDao<ImportRecord> { |
| | | List<ImportRecord> getList(); |
| | | |
| | | } |
| | |
| | | /** |
| | | * dj_jdgz_handover |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-12-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("dj_jdgz_handover") |
| | | public class DjJdgzHandover extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "ä¸çº§ç½ç»å¾ID") |
| | | private Long level1NetworkId; |
| | | @ApiModelProperty(value = "ä¸çº§ç½ç»å¾ID") |
| | | private Long level1NetworkId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·¥ç¨åç§°ï¼ç±Xå·-年份-ä¿®çç级èªå¨æ¼æ¥ï¼") |
| | | private String projectName; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·¥ç¨åç§°ï¼ç±Xå·-年份-ä¿®çç级èªå¨æ¼æ¥ï¼") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "å½åé") |
| | | private String currentTeam; |
| | | @ApiModelProperty(value = "å½åé") |
| | | private String currentTeam; |
| | | |
| | | @ApiModelProperty(value = "交æ¥é") |
| | | private String handoverTeam; |
| | | @ApiModelProperty(value = "交æ¥é") |
| | | private String handoverTeam; |
| | | |
| | | @ApiModelProperty(value = "äº¤æ¥æ¶é´") |
| | | private String handoverTime; |
| | | @ApiModelProperty(value = "äº¤æ¥æ¶é´") |
| | | private String handoverTime; |
| | | |
| | | @ApiModelProperty(value = "äº¤æ¥æ
åµè¯´æ") |
| | | private String handoverSituation; |
| | | @ApiModelProperty(value = "äº¤æ¥æ
åµè¯´æ") |
| | | private String tdExplan; |
| | | @ApiModelProperty(value = "äº¤æ¥æ
åµè¯´æ") |
| | | private String professExplan; |
| | | @ApiModelProperty(value = "äº¤æ¥æ
åµè¯´æ") |
| | | private String deptExplan; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private Integer remark; |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private Integer remark; |
| | | |
| | | @TableField(exist = false) |
| | | private String fileName; |
| | | @TableField(exist = false) |
| | | private String fileName; |
| | | |
| | | } |
New file |
| | |
| | | package com.example.server.progressTrack.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.example.client.entity.PlatformLogEntity; |
| | | import com.example.server.entity.BaseEntity; |
| | | import com.example.server.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * dj_jdgz_handover |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-12-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("export_record") |
| | | public class ExportRecord extends PlatformLogEntity { |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | } |
New file |
| | |
| | | package com.example.server.progressTrack.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.example.client.entity.PlatformLogEntity; |
| | | import com.example.server.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * dj_jdgz_handover |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-12-17 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("import_record") |
| | | public class ImportRecord extends PlatformLogEntity { |
| | | private String importSite; |
| | | |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | } |
| | |
| | | time1 = time1.replace("/", "-"); |
| | | node.setRequiredCompletionTime(time1); |
| | | node.setProcessName(mapProcessName.get(1)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(1); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time1.matches("[0-9.]+")) { |
| | | time1 = time1.replace(".", "-"); |
| | | node.setRequiredCompletionTime(time1); |
| | | node.setProcessName(mapProcessName.get(1)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(1); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time1.matches("[0-9-]+")) { |
| | | node.setRequiredCompletionTime(time1); |
| | | node.setProcessName(mapProcessName.get(1)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(1); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 1 + "个" + "èç¹æ¶é´æ¥ææ ¼å¼ä¸è§è"; |
| | |
| | | if (time2.matches("[0-9/]+")) { |
| | | node.setRequiredCompletionTime(time2); |
| | | node.setProcessName(mapProcessName.get(2)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(2); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time2.matches("[0-9.]+")) { |
| | | time2 = time2.replace(".", "-"); |
| | | node.setRequiredCompletionTime(time2); |
| | | node.setProcessName(mapProcessName.get(2)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(2); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time2.matches("[0-9-]+")) { |
| | | node.setRequiredCompletionTime(time2); |
| | | node.setProcessName(mapProcessName.get(2)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(2); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 2 + "个" + "èç¹æ¶é´çæ¥ææ ¼å¼ä¸è§è"; |
| | |
| | | time3 = time3.replace("/", "-"); |
| | | node.setRequiredCompletionTime(time3); |
| | | node.setProcessName(mapProcessName.get(3)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(3); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time3.matches("[0-9.]+")) { |
| | | time3 = time3.replace(".", "-"); |
| | | node.setRequiredCompletionTime(time3); |
| | | node.setProcessName(mapProcessName.get(3)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(3); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time3.matches("[0-9-]+")) { |
| | | node.setRequiredCompletionTime(time3); |
| | | node.setProcessName(mapProcessName.get(3)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(3); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 3 + "个" + "èç¹æ¶é´çæ¥ææ ¼å¼ä¸è§è"; |
| | |
| | | time4 = time4.replace("/", "-"); |
| | | node.setRequiredCompletionTime(time4); |
| | | node.setProcessName(mapProcessName.get(4)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(4); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time4.matches("[0-9.]+")) { |
| | | time4 = time4.replace(".", "-"); |
| | | node.setRequiredCompletionTime(time4); |
| | | node.setProcessName(mapProcessName.get(4)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(4); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time4.matches("[0-9-]+")) { |
| | | node.setRequiredCompletionTime(time4); |
| | | node.setProcessName(mapProcessName.get(4)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(4); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 4 + "个" + "èç¹æ¶é´çæ¥ææ ¼å¼ä¸è§è"; |
| | |
| | | time5 = time5.replace("/", "-"); |
| | | node.setRequiredCompletionTime(time5); |
| | | node.setProcessName(mapProcessName.get(5)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(5); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time5.matches("[0-9.]+")) { |
| | | time5 = time5.replace(".", "-"); |
| | | node.setRequiredCompletionTime(time5); |
| | | node.setProcessName(mapProcessName.get(5)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(5); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else if (time5.matches("[0-9-]+")) { |
| | | node.setRequiredCompletionTime(time5); |
| | | node.setProcessName(mapProcessName.get(5)); |
| | | node.setSort(sort + 1); |
| | | node.setSort(5); |
| | | DjJdgzNetworkLevel3ListService.insert(node); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 5 + "个" + "è¦æ±å®ææ¶é´çæ¥ææ ¼å¼ä¸è§è"; |
| | |
| | | if (StringUtils.isNotBlank(generalRepairUnitDirector)) { |
| | | data.setGeneralRepairUnitDirector(generalRepairUnitDirector); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | if (StringUtils.isNotBlank(repairUnit)) { |
| | | data.setRepairUnit(repairUnit); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | if (StringUtils.isNotBlank(repairUnitContact)) { |
| | | data.setRepairUnitContact(repairUnitContact); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | if (StringUtils.isNotBlank(repairUnitDirector)) { |
| | | data.setRepairUnitDirector(repairUnitDirector); |
| | | } |
| | | |
| | |
| | | import com.example.server.progressTrack.Dto.StatistReportsDto; |
| | | import com.example.server.progressTrack.dao.DjJdgzTrackRecordDao; |
| | | import com.example.server.progressTrack.model.DjJdgzNetworkLevel1; |
| | | 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.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.service.UserService; |
| | | import com.example.server.utils.FileUtils; |
| | | import com.example.server.utils.ImportUtil; |
| | | import com.example.server.utils.TreeFieldUtils; |
| | | import com.example.server.utils.UUIDUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | 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.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3ListService djJdgzNetworkLevel3ListService; |
| | | @Autowired |
| | | private DjJdgzNetworkLevel3Service djJdgzNetworkLevel3Service; |
| | | @Autowired |
| | | private UserService sysUserService; |
| | | @Autowired |
| | | private SysTeamGroupClassService sysTeamGroupClassService; |
| | | |
| | | |
| | | public List<DjJdgzTrackRecord> getList(Long level1NetworkId, Integer status) { |
| | | public List<DjJdgzTrackRecord> getList(Long level1NetworkId, Long deptId, Long teamId, Long cabinId, String type, Integer status, String name) { |
| | | Long userId = null; |
| | | /* Map adminRole = sysUserService.adminRole(); |
| | | Object isTyRole = adminRole.get("isTyRole"); |
| | |
| | | if (isTyRole.equals(true) || isYwzRole.equals(true)) { |
| | | userId = UserContext.getUser().getId(); |
| | | }*/ |
| | | List<DjJdgzTrackRecord> list = baseDao.getList(level1NetworkId, status, userId); |
| | | List<DjJdgzTrackRecord> list = baseDao.getList(level1NetworkId,deptId,teamId,cabinId,type, status, name); |
| | | /*if (list != null && list.size() > 0) { |
| | | sysOssService.setListOsses(list, "ProjectProgressFileUpload"); |
| | | }*/ |
| | |
| | | |
| | | public void exportExcel(String filePath, String teamgroupId, Long level1NetworkId, |
| | | Long level3NetworkId, Long level3NodeId, Integer status, Date beginDate, |
| | | Date endDate, Integer istq) { |
| | | Date endDate, Integer istq, List<ExcelColumnDto> columnDto) { |
| | | List<ExprotExcelDto> dtos = new ArrayList<>(); |
| | | /* Map<String, String> keywordMap = dailyPlanService.getReplacement(); |
| | | String keywordT = keywordMap.get("ting");*/ |
| | |
| | | |
| | | ExprotExcelDto dto = new ExprotExcelDto(); |
| | | dto.setSheetName("è·è¸ªè®°å½æç»"); |
| | | List<ExcelColumnDto> columnDto = new ArrayList<>(); |
| | | |
| | | columnDto.add(new ExcelColumnDto("ä¸çº§èç¹", "Level1NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("äºçº§èç¹", "Level2NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("项ç®åç§°", "Level3NetworkName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("å½åèç¹", "Level3NodeName", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("ä¸ä¸", "TeamGroupName", 20, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("æ»æ¿ä¿®åä½åè´è´£äºº", "GeneralRepair", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åæ¿ä¿®åä½åè´è´£äºº", "Repair", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("è·è¸ªæ¹å¼", "trackMethodStr", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("å©ä¿®äºº", "TrackPerson", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åæ¹", "TrackedPerson", 25, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("è·è¸ªå°ç¹", "TrackLocation", 10, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("èç¹è¿å±", "status", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("è±æé£é©", "hasDelayRiskStr", 10, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("é¢è®¡å®ææ¶é´", "EstimatedCompletionTime", 15, HorizontalAlignment.CENTER)); |
| | | columnDto.add(new ExcelColumnDto("åå¨é®é¢", "Problem", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("åç»è®¡å", "FollowupPlan", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("夿³¨", "Remark", 20, HorizontalAlignment.LEFT)); |
| | | columnDto.add(new ExcelColumnDto("å¡«åæ¶é´", "UpdateDate", 15, HorizontalAlignment.CENTER)); |
| | | |
| | | List<DjJdgzTrackRecord> list = baseDao.getdata(teamgroupId, level1NetworkId, level3NetworkId, level3NodeId, status, beginDate, endDate, istq); |
| | | |
| | |
| | | } |
| | | |
| | | public List<DjJdgzTrackRecord> getListByImport(Long level1Id, Long level2Id, Long level2NodeId, String selectedIds) { |
| | | return baseDao.getListByImport(level1Id,level2Id,level2NodeId,selectedIds); |
| | | return baseDao.getListByImport(level1Id, level2Id, level2NodeId, selectedIds); |
| | | } |
| | | |
| | | public String importDiagramFromExcel(String path) { |
| | | String result = "true"; |
| | | Integer sum = 0; // æ»å
±çæ¡æ° |
| | | Integer suc = 0; // æåçæ¡æ° |
| | | Integer err = 0; // å¤±è´¥çæ¡æ° |
| | | Map<String, Object> errMap = new HashMap<>(); |
| | | MultipartFile mutFile = null; |
| | | try { |
| | | mutFile = FileUtils.convertFileToMultipartFile(path); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String sheetName = null; |
| | | int row1 = 0; |
| | | try { |
| | | // è·å导å
¥æä»¶çåç¼å |
| | | String fileName = mutFile.getOriginalFilename(); |
| | | Workbook workbook = null; |
| | | //è§£å³excelçæ¬é®é¢ |
| | | if (fileName != null && fileName.endsWith(".xls")) { |
| | | workbook = new HSSFWorkbook(mutFile.getInputStream()); |
| | | } else if (fileName != null && fileName.endsWith(".xlsx")) { |
| | | workbook = new XSSFWorkbook(mutFile.getInputStream()); |
| | | } |
| | | assert workbook != null; //æè¨å¦æ[boolean表达å¼]为trueï¼åç¨åºç»§ç»æ§è¡ã å¦æä¸ºfalseï¼åç¨åºæåºAssertionErrorï¼å¹¶ç»æ¢æ§è¡ã |
| | | |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | int num = sheet.getLastRowNum(); // ä¸å
±æå¤å°è¡ |
| | | sheetName = sheet.getSheetName(); //è·åå½åsheetåç§° |
| | | sum = sum + num; |
| | | |
| | | Map<String, Integer> trackMethodMap = new HashMap<>(); |
| | | trackMethodMap.put("线ä¸", 0); |
| | | trackMethodMap.put("çµè¯", 1); |
| | | |
| | | Map<String, Integer> statusMap = new HashMap<>(); |
| | | statusMap.put("è¿è¡ä¸", 0); |
| | | statusMap.put("已宿", 1); |
| | | |
| | | Map<String, Integer> hasDelayRiskMap = new HashMap<>(); |
| | | hasDelayRiskMap.put("æ", 1); |
| | | hasDelayRiskMap.put("æ ", 0); |
| | | |
| | | |
| | | for (int j = 2; j <= num; j++) { |
| | | int sort = 0; |
| | | DjJdgzTrackRecord data = new DjJdgzTrackRecord(); |
| | | |
| | | boolean isErr = false; |
| | | row1 = j + 1; |
| | | String pattern = "yyyy-MM-dd"; |
| | | Row row = sheet.getRow(j); |
| | | |
| | | String idStr = ImportUtil.getCellValue(row, 0, pattern); |
| | | String dataDate = ImportUtil.getCellValue(row, 1, pattern); |
| | | String name = ImportUtil.getCellValue(row, 2, pattern); |
| | | String progressName = ImportUtil.getCellValue(row, 3, pattern); |
| | | String trackMethodStr = ImportUtil.getCellValue(row, 4, pattern); |
| | | String trackLocationStr = ImportUtil.getCellValue(row, 5, pattern); |
| | | String currentStatusStr = ImportUtil.getCellValue(row, 6, pattern); |
| | | String hasDelayRiskStr = ImportUtil.getCellValue(row, 7, pattern); |
| | | String estimatedCompletionTimeStr = ImportUtil.getCellValue(row, 8, pattern); |
| | | String problemStr = ImportUtil.getCellValue(row, 9, pattern); |
| | | String followupPlanStr = ImportUtil.getCellValue(row, 10, pattern); |
| | | String remarkStr = ImportUtil.getCellValue(row, 11, pattern); |
| | | String trackPersonStr = ImportUtil.getCellValue(row, 12, pattern); |
| | | String trackPersonContact = ImportUtil.getCellValue(row, 13, pattern); |
| | | String trackPersonUnit = ImportUtil.getCellValue(row, 14, pattern); |
| | | String trackedPerson = ImportUtil.getCellValue(row, 15, pattern); |
| | | String trackedPersonContact = ImportUtil.getCellValue(row, 16, pattern); |
| | | String trackedPersonUnit = ImportUtil.getCellValue(row, 17, pattern); |
| | | String generalRepairUnit = ImportUtil.getCellValue(row, 18, pattern); |
| | | String generalRepairUnitDirector = ImportUtil.getCellValue(row, 19, pattern); |
| | | String generalRepairUnitContact = ImportUtil.getCellValue(row, 20, pattern); |
| | | String repairUnit = ImportUtil.getCellValue(row, 21, pattern); |
| | | String repairUnitDirector = ImportUtil.getCellValue(row, 22, pattern); |
| | | String repairUnitContact = ImportUtil.getCellValue(row, 23, pattern); |
| | | |
| | | DjJdgzNetworkLevel3 level3 = djJdgzNetworkLevel3Service.get(Long.parseLong(idStr)); |
| | | Long level1NetworkId = level3.getLevel1NetworkId(); |
| | | |
| | | Long id = UUIDUtil.generateId(); |
| | | |
| | | if (StringUtils.isEmpty(dataDate)) { |
| | | result = "第" + j + "è¡" + "å½å
¥æ¶é´ä¸è½ä¸ºç©º"; |
| | | isErr = true; |
| | | continue; |
| | | } else { |
| | | int weekNo = this.getWeekNo(level1NetworkId); |
| | | data.setWeekNo(weekNo); |
| | | data.setLevel1NetworkId(level1NetworkId); |
| | | data.setLevel3NetworkId(level3.getId()); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(name)) { |
| | | result = "第" + j + "è¡" + "设å¤åç§°ä¸è½ä¸ºç©º"; |
| | | isErr = true; |
| | | continue; |
| | | } else { |
| | | data.setId(id); |
| | | data.setLevel3NetworkName(name); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(progressName)) { |
| | | result = "第" + j + "è¡" + "èç¹åç§°ä¸è½ä¸ºç©º"; |
| | | isErr = true; |
| | | continue; |
| | | } else { |
| | | List<DjJdgzNetworkLevel3List> list = djJdgzNetworkLevel3ListService.getList(level3.getId()); |
| | | for (DjJdgzNetworkLevel3List item : list) { |
| | | if(item.getProcessName().equals(progressName)){ |
| | | data.setLevel3NodeId(item.getId()); |
| | | data.setEstimatedCompletionTime(item.getRequiredCompletionTime()); |
| | | break; |
| | | } |
| | | } |
| | | data.setProcessName(progressName); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(trackMethodStr)) { |
| | | data.setTrackMethod(0); |
| | | } else { |
| | | data.setTrackMethod(trackMethodMap.get(trackMethodStr)); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackLocationStr)) { |
| | | data.setTrackLocation(trackLocationStr); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(currentStatusStr)) { |
| | | data.setCurrentStatus(0); |
| | | } else { |
| | | data.setCurrentStatus(statusMap.get(currentStatusStr)); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(hasDelayRiskStr)) { |
| | | data.setHasDelayRisk(0); |
| | | } else { |
| | | data.setHasDelayRisk(hasDelayRiskMap.get(hasDelayRiskStr)); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(estimatedCompletionTimeStr)) { |
| | | if (estimatedCompletionTimeStr.matches("[0-9/]+")) { |
| | | estimatedCompletionTimeStr = estimatedCompletionTimeStr.replace("/", "-"); |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else if (estimatedCompletionTimeStr.matches("[0-9.]+")) { |
| | | estimatedCompletionTimeStr = estimatedCompletionTimeStr.replace(".", "-"); |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else if (estimatedCompletionTimeStr.matches("[0-9-]+")) { |
| | | data.setEstimatedCompletionTime(estimatedCompletionTimeStr); |
| | | } else { |
| | | result = "第" + j + "è¡" + "第" + 1 + "个" + "é¢è®¡å®ææ¶é´æ¥ææ ¼å¼ä¸è§è"; |
| | | isErr = true; |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(problemStr)) { |
| | | data.setProblem(problemStr); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(followupPlanStr)) { |
| | | data.setFollowupPlan(followupPlanStr); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(remarkStr)) { |
| | | data.setRemark(remarkStr); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackPersonStr)) { |
| | | data.setTrackPerson(trackPersonStr); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackPersonContact)) { |
| | | data.setTrackPersonContact(trackPersonContact); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackPersonUnit)) { |
| | | data.setTrackPersonUnit(trackPersonUnit); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackedPerson)) { |
| | | data.setTrackPerson(trackPersonStr); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackedPersonContact)) { |
| | | data.setTrackPersonContact(trackPersonContact); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(trackedPersonUnit)) { |
| | | data.setTrackPersonUnit(trackPersonUnit); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | data.setGeneralRepairUnit(generalRepairUnit); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(generalRepairUnitContact)) { |
| | | data.setGeneralRepairUnitContact(generalRepairUnitContact); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnitDirector)) { |
| | | data.setGeneralRepairUnitDirector(generalRepairUnitDirector); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | data.setRepairUnit(repairUnit); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | data.setRepairUnitContact(repairUnitContact); |
| | | } |
| | | if (StringUtils.isNotBlank(generalRepairUnit)) { |
| | | data.setRepairUnitDirector(repairUnitDirector); |
| | | } |
| | | |
| | | if (!isErr) { |
| | | data.setIsUpdate(false); |
| | | this.save(data); |
| | | } |
| | | if (isErr) { |
| | | err++; |
| | | continue; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | result = "导å
¥" + row1 + "è¡æ°æ®æ¶æ£æµå°å¼å¸¸ï¼ä¸æå¯¼å
¥æä½ã"; |
| | | } |
| | | |
| | | suc = sum - err; |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public void retract(Long id) { |
| | | baseDao.retract(id); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "åç±»ï¼A/Bï¼") |
| | | private String classType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ç±»åï¼") |
| | | private String type; |
| | | |
| | |
| | | Row row = sheet.createRow(num); |
| | | |
| | | Cell cell = row.createCell(0); |
| | | cell.setCellValue(list.get(i).getId()); |
| | | cell.setCellValue(list.get(i).getId().toString()); |
| | | |
| | | cell = row.createCell(1); |
| | | cell.setCellValue(date); |
| | |
| | | } |
| | | cell = row.createCell(20); |
| | | if (StringUtils.isNotBlank(list.get(i).getGeneralRepairUnitContact())) { |
| | | cell.setCellValue(list.get(i).getGeneralRepairUnitDirector()); |
| | | cell.setCellValue(list.get(i).getGeneralRepairUnitContact()); |
| | | } |
| | | cell = row.createCell(21); |
| | | if (StringUtils.isNotBlank(list.get(i).getRepairUnit())) { |
| | |
| | | server: |
| | | port: 8080 |
| | | |
| | | logging: |
| | | level: |
| | | com.example: debug |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- æ¥å¿æ ¹ç®å½--> |
| | | <property name="LOG_PATH" value="../logs"/> |
| | | <property name="LOG_PATH" value="./log"/> |
| | | <!-- 项ç®å --> |
| | | <property name="PROJECT_NAME" value="progress_track"/> |
| | | <!-- å®ä¹æ§å¶å°è¾åºæ ¼å¼é¢è² æ¥å¿æä»¶æ ¼å¼ --> |
| | |
| | | SELECT |
| | | null AS id, |
| | | '' AS name |
| | | ORDER BY |
| | | id |
| | | </select> |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <select id="getList" resultType="com.example.server.menu.model.Menu"> |
| | | select a.id,a.pid,a.menu_name |
| | | from menu a |
| | | where |
| | | a.is_delete = 0 |
| | | <if test="site!='å·¥ä½ç»'"> |
| | | and menu_name not like '%管ç%' |
| | | </if> |
| | | order by sort |
| | | SELECT a.id, a.pid, a.menu_name |
| | | FROM menu a |
| | | WHERE |
| | | a.is_delete = 0 |
| | | <if test="site != 'å·¥ä½ç»'"> |
| | | AND ( |
| | | menu_name NOT LIKE '%管ç%' |
| | | OR menu_name = 'ä¸çº§ç½ç»å¾ç®¡ç' |
| | | ) |
| | | </if> |
| | | ORDER BY sort; |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | SELECT |
| | | a.*, |
| | | b.project_name, |
| | | GROUP_CONCAT(c.name) AS fileName-- ä½¿ç¨ GROUP_CONCAT æ¼æ¥ c.name |
| | | GROUP_CONCAT(c.name) AS fileName |
| | | FROM |
| | | dj_jdgz_handover a |
| | | LEFT JOIN dj_jdgz_network_level1 b |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.server.progressTrack.dao.DjJdgzTrackRecordDao"> |
| | | <update id="retract"> |
| | | UPDATE dj_jdgz_track_record |
| | | SET CURRENT_STATUS = 0 |
| | | WHERE LEVEL3_NETWORK_ID = ( |
| | | SELECT LEVEL3_NETWORK_ID FROM dj_jdgz_track_record WHERE id = ${id} |
| | | ) |
| | | AND create_date >= ( |
| | | SELECT create_date FROM dj_jdgz_track_record WHERE id = ${id} |
| | | ); |
| | | </update> |
| | | |
| | | <select id="getList" resultType="com.example.server.progressTrack.model.DjJdgzTrackRecord"> |
| | | SELECT |
| | |
| | | WHERE |
| | | a.IS_DELETE = 0 |
| | | and a.network_id != 10000 |
| | | <if test="userId!=null"> |
| | | AND a.TEAMGROUP_ID in (select teamgroup from sys_user where is_delete=0 and user_id=#{userId}) |
| | | </if> |
| | | <if test="status==1"> |
| | | AND b.CURRENT_STATUS = 1 |
| | | </if> |
| | |
| | | AND f.IS_DELETE = 0 |
| | | AND g.IS_DELETE = 0 |
| | | AND g.id = ${level1NetworkId} |
| | | <if test="deptId!=null"> |
| | | and c.dept_id = ${deptId} |
| | | </if> |
| | | <if test="teamId!=null"> |
| | | and c.TEAMGROUP_ID = ${teamId} |
| | | </if> |
| | | <if test="cabinId!=null"> |
| | | and c.cabin_id LIKE '%${cabinId}%' |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and c.type = #{type} |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and c.name LIKE '%${name}%' |
| | | </if> |
| | | <if test="status==0"> |
| | | GROUP BY |
| | | c.id |
| | |
| | | select GENERAL_REPAIR_UNIT || ',' || GENERAL_REPAIR_UNIT_DIRECTOR || ',' || |
| | | GENERAL_REPAIR_UNIT_CONTACT AS generalRepair, |
| | | REPAIR_UNIT || ',' || REPAIR_UNIT_DIRECTOR || ',' || REPAIR_UNIT_CONTACT AS `repair`, |
| | | track_person || ',' || track_person_contact AS trackPerson, |
| | | tracked_person || ',' || tracked_person_contact AS trackedPerson, |
| | | track_person || ',' || track_person_unit || ',' || track_person_contact AS trackPerson, |
| | | tracked_person || ',' || tracked_person_unit || ',' || tracked_person_contact AS trackedPerson, |
| | | track_method, |
| | | track_location, |
| | | CURRENT_STATUS, |
| | |
| | | b.GENERAL_REPAIR_UNIT|| ',' || b.GENERAL_REPAIR_UNIT_DIRECTOR|| ',' || |
| | | b.GENERAL_REPAIR_UNIT_CONTACT AS generalRepair, |
| | | b.REPAIR_UNIT|| ',' || b.REPAIR_UNIT_DIRECTOR|| ',' || b.REPAIR_UNIT_CONTACT AS `repair`, |
| | | b.track_person|| ',' || b.track_person_contact AS trackPerson, |
| | | b.tracked_person|| ',' || b.tracked_person_contact AS trackedPerson, |
| | | b.track_person|| ',' || b.track_person_unit || ',' || b.track_person_contact AS trackPerson, |
| | | b.tracked_person|| ',' || b.tracked_person_unit || ',' || b.tracked_person_contact AS trackedPerson, |
| | | b.track_method, |
| | | b.track_location, |
| | | b.track_location, |
| | |
| | | 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 |
| | | LEFT JOIN dj_sys_teamgroup_class h ON h.id = a.TEAMGROUP_ID |
| | | LEFT JOIN dj_sys_teamgroup_class h ON h.id = c.TEAMGROUP_ID |
| | | WHERE |
| | | a.IS_DELETE = 0 |
| | | and a.network_id != 10000 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.server.progressTrack.dao.ExportRecordDao"> |
| | | <select id="getList" resultType="com.example.server.progressTrack.model.ExportRecord"> |
| | | select a.*, b.user_name |
| | | from export_record a |
| | | left join sys_user b on b.user_id = a.creator |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.server.progressTrack.dao.ImportRecordDao"> |
| | | <select id="getList" resultType="com.example.server.progressTrack.model.ImportRecord"> |
| | | select a.*, b.user_name |
| | | from import_record a |
| | | left join sys_user b on b.user_id = a.creator |
| | | </select> |
| | | </mapper> |