jinlin
4 天以前 a3fe79e605b07a5a908599aaa830a0860e9423d2
src/main/java/com/example/client/service/Level3View2Service.java
@@ -7,6 +7,7 @@
import com.example.server.cabin.service.CabinService;
import com.example.server.progressTrack.Dto.TableNodeDto;
import com.example.server.progressTrack.model.DjJdgzShip;
import com.example.server.progressTrack.model.DjJdgzTrackRecord;
import com.example.server.progressTrack.service.*;
import com.example.server.teamGroup.service.SysTeamGroupClassService;
import org.apache.commons.lang3.StringUtils;
@@ -28,6 +29,8 @@
    private DjJdgzNetworkLevel3Service level3Service;
    @Autowired
    private DjJdgzShipService djJdgzShipService;
    @Autowired
    private DjJdgzTrackRecordService djJdgzTrackRecordService;
    @Autowired
    private SysTeamGroupClassService sysTeamGroupClassService;
    @Autowired
@@ -165,8 +168,8 @@
        MouseMotionListener mouseMotionListener = new MouseMotionListener() {
            @Override
            public void mouseDragged(MouseEvent e) {
                // 不需要处理鼠标拖动事件
            }
            @Override
            public void mouseMoved(MouseEvent e) {
@@ -201,8 +204,26 @@
                }
            }
        };
        MouseAdapter mouseAdapter = new MouseAdapter(){
            @Override
            public void mouseClicked(MouseEvent e) {
                // if (historyCalled[0]) return;
                // 获取点击的行和列
                int row = table.rowAtPoint(e.getPoint());
                // 检查是否点击了有效单元格
                if (row >= 0) {
                    Long id = list.get(row).getNetworkId();
                    if (id != null) {
                      getRecordById(frame,id);
                    }
                }
            }
        };
        table.addMouseMotionListener(mouseMotionListener);
        table.addMouseListener(mouseAdapter);
        comboBox.addItemListener(new ItemListener() {
            public void itemStateChanged(final ItemEvent event) {
@@ -460,6 +481,65 @@
        return panel;
    }
    private void getRecordById(JFrame jFrame, Long id) {
        jFrame.setEnabled(false);
        JFrame frame1 = new JFrame("跟踪记录");
        frame1.setSize(2000, 800);
        frame1.setResizable(true);
        frame1.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        frame1.setLocationRelativeTo(null);
        frame1.addWindowListener(new WindowAdapter() {
            //添加第二个界面的关闭事件:
            public void windowClosing(WindowEvent e) {
                //添加事件:
                jFrame.setEnabled(true);//将主界面再设置为可操作的
            }
        });
        List<ColumnDto> columnDto = new ArrayList<>();
        List<DjJdgzTrackRecord> list = djJdgzTrackRecordService.getRecordById(id);
        JComboBoxItem[] trackList = {
                new JComboBoxItem(0L, "线下"),
                new JComboBoxItem(1L, "电话"),
        };
        JComboBoxItem[] statusList = {
                new JComboBoxItem(0L, "进行中"),
                new JComboBoxItem(1L, "已完成"),
        };
        JComboBoxItem[] hasDelayRiskList = {
                new JComboBoxItem(0L, "无"),
                new JComboBoxItem(1L, "有"),
        };
        columnDto.add(new ColumnDto("序号", "", 80, "autoCreate", false, null, null));
        columnDto.add(new ColumnDto("节点名称", "processName", 120, null, false, null, null));
        columnDto.add(new ColumnDto("跟踪方式", "trackMethod", 120, "dict", false, null, trackList));
        columnDto.add(new ColumnDto("跟踪地点", "trackLocation", 120, null, false, null, null));
        columnDto.add(new ColumnDto("助修人", "trackPerson", 180, null, false, null, null));
        columnDto.add(new ColumnDto("厂方", "trackedPerson", 180, 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("节点进展", "currentStatus", 120, "dict", false, null, statusList));
        columnDto.add(new ColumnDto("脱期风险", "hasDelayRisk", 120, "dict", false, null, hasDelayRiskList));
        columnDto.add(new ColumnDto("预计完成时间", "estimatedCompletionTime", 200, "selectDate", false, null, null));
        columnDto.add(new ColumnDto("存在问题", "problem", 160, null, false, null, null));
        columnDto.add(new ColumnDto("后续计划", "followupPlan", 160, null, false, null, null));
        columnDto.add(new ColumnDto("备注", "remark", 160, null, false, null, null));
        JTable subTable = CommonTable.createCommonTable(list, columnDto);
        subTable.setRowHeight(25);
        subTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        JScrollPane scrollPane = new JScrollPane(subTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        scrollPane.setViewportView(subTable);
        scrollPane.getViewport().setBackground(Color.WHITE);
        //scrollPane.setPreferredSize(new Dimension(width - 20, height - 100));
        frame1.add(scrollPane);
        frame1.setVisible(true);
    }
    private void export(JFrame jFrame) {
        JFrame frame1 = new JFrame("导出三级网络图状态");
        frame1.setSize(300, 400);