jinlin
2025-03-01 86f02fee03614fef275c6e0c355d73318ca3025e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.example.server.progressTrack.service;
 
import com.example.client.dto.JComboBoxItem;
import com.example.client.service.BaseService;
import com.example.server.progressTrack.Dto.NetworkNodeStatusDto;
import com.example.server.progressTrack.dao.DjJdgzNetworkLevel2Dao;
import com.example.server.progressTrack.model.DjJdgzNetworkLevel2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
 
/**
 * dj_jdgz_network_level2
 *
 * @author zt generator 
 * @since 1.0.0 2024-12-17
 */
@Service
public class DjJdgzNetworkLevel2Service  extends BaseService<DjJdgzNetworkLevel2Dao, DjJdgzNetworkLevel2> {
    @Autowired
    NetWorkDiagramService netWorkDiagramService;
 
    public List<DjJdgzNetworkLevel2> getList(Long shipId) {
        List<DjJdgzNetworkLevel2> list = baseDao.getList(shipId);
        return  list;
    }
 
    /**
     * 获取节点状态数据
     *
     */
    public List<NetworkNodeStatusDto> getNodeStatusData(Long id) {
        baseDao.setStatusNull(id);
        baseDao.setStatus(id);
        List<NetworkNodeStatusDto> list = baseDao.getNodeStatusData(id);
        return list;
    }
 
 
    public JComboBoxItem[] getLevel2List(Long networkId) {
        return baseDao.getLevel2List(networkId);
    }
 
    /**
     * 删除
     *
     * @param ids
     */
    public void delete(Long[] ids) {
        super.deleteLogic(ids);
    }
 
    public String getStatusDiagram(Long id) {
        DjJdgzNetworkLevel2 djJdgzNetworkLevel2 = this.get(id);
        String json = djJdgzNetworkLevel2.getContent();
        List<NetworkNodeStatusDto> nodeStatusData = this.getNodeStatusData(id);
        String statusDiagram = netWorkDiagramService.getStatusDiagram(json, null, nodeStatusData);
        return statusDiagram;
    }
 
    public String getDiagramByNodeId(Long id) {
        String json = baseDao.getByNodeId(id);
        return json;
    }
 
    public void deleteLevel2(Long id) {
        baseDao.deleteLevel3List(id);
        baseDao.deleteLevel3(id);
        baseDao.deleteLevel2List(id);
        baseDao.deleteLevel2(id);
    }
 
}