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);
|
}
|
|
}
|