修复装置通道的bug

dev
liuguijing 2 years ago
parent eb3fd00451
commit fe76b6e6f7

@ -148,28 +148,29 @@
</select> </select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap"> <select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
SELECT SELECT
z.id AS id, a.id AS id,
z.name AS name, a.name AS name,
z.dy_value AS dyvalue, a.dy_value AS dyvalue,
x.id AS line_id, b.id AS line_id,
x.name AS line_name, b.name AS line_name,
x.bs_manufacturer AS bs_manufacturer, b.bs_manufacturer AS bs_manufacturer,
y.id AS term_id, d.id AS term_id,
y.tower_id AS tower_id, d.tower_id AS tower_id,
y.cmdid AS cmdid, d.cmdid AS cmdid,
y.display_name AS display_name, d.display_name AS display_name,
k.id AS channel_id, f.id AS channel_id,
k.channel_name AS channel_name, f.channel_name AS channel_name,
l.schedule_id AS schedule_id g.schedule_id AS schedule_id
FROM FROM
(((((dy_level z (((((dy_level a
left JOIN `lines` x ON z.id = x.dy_level_id and z.status = #{status} and x.status = #{status}) left JOIN `lines` b ON a.id = b.dy_level_id and a.status = #{status} and b.status = #{status})
left JOIN terminals y ON x.id = y.line_id and y.status = #{status}) left join towers c on b.id = c.line_id
left JOIN terminal_channel_mapper j ON j.term_id = y.id) left JOIN terminals d ON c.id = d.tower_id and d.status = #{status})
left JOIN terminal_channels k ON j.channel_id = k.id and k.status = #{status}) left JOIN terminal_channel_mapper e ON e.term_id = d.id)
left JOIN terminal_schedule l ON k.id = l.channel_id and l.term_id = y.id) left JOIN terminal_channels f ON e.channel_id = f.id and f.status = #{status})
left JOIN terminal_schedule g ON f.id = g.channel_id and g.term_id = d.id)
<if test="termid != null"> <if test="termid != null">
where y.id = #{termid} where d.id = #{termid}
</if> </if>
</select> </select>

@ -6,10 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto; import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.dto.LineAndDyNameDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalStatus; import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
@ -21,6 +18,7 @@ import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.DyLevelDao;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao; import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao; import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao; import com.shxy.xymanager_dao.dao.TerminalStatusDao;
@ -51,6 +49,9 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
@Autowired @Autowired
TerminalPhotoDao terminalPhotoDao; TerminalPhotoDao terminalPhotoDao;
@Autowired
DyLevelDao dyLevelDao;
@Autowired @Autowired
CacheService cacheService; CacheService cacheService;
@ -232,6 +233,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
*/ */
@Override @Override
public ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo) { public ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo) {
Integer termId = vo.getTermid();
DyLineTreeAndChannelListModel model = new DyLineTreeAndChannelListModel(); DyLineTreeAndChannelListModel model = new DyLineTreeAndChannelListModel();
List<TerminalChannels> channellist = terminalChannelsDao.selectChannelList(CommonStatus.EFFECTIVE.value()); List<TerminalChannels> channellist = terminalChannelsDao.selectChannelList(CommonStatus.EFFECTIVE.value());
ArrayList<DyLineTreeAndChannelListModel.ChannelChooseBean> channels = new ArrayList<>(); ArrayList<DyLineTreeAndChannelListModel.ChannelChooseBean> channels = new ArrayList<>();
@ -244,6 +246,60 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
channels.add(channelChooseBean); channels.add(channelChooseBean);
} }
model.setChannellist(channels); model.setChannellist(channels);
// Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
// Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
// Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
// List<DyAndLineAndTowerAndTermDto> dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(null, null, null, termId, null, CommonStatus.EFFECTIVE.value());
// ArrayList<DyLineTreeAndChannelListModel.DyListBean> dymodellist = new ArrayList<>();
// for (int i = 0; i < dtos.size(); i++) {
// DyAndLineAndTowerAndTermDto dyDto = dtos.get(i);
// List<LineAndTowerAndTermDto> linelist = dyDto.getList();
// DyLineTreeAndChannelListModel.DyListBean dyListBean = new DyLineTreeAndChannelListModel.DyListBean();
// dyListBean.setId(dyDto.getId());
// dyListBean.setName(dyDto.getName());
// dyListBean.setDyValue(dyDto.getDyValue());
//
// ArrayList<DyLineTreeAndChannelListModel.LineBean> linemodellist = new ArrayList<>();
// if (CollectionUtil.isEmpty(linelist)) {
// continue;
// }
// for (int j = 0; j < linelist.size(); j++) {
// LineAndTowerAndTermDto lineDto = linelist.get(j);
// List<TowerAndTermDto> termlist = lineDto.getList();
// DyLineTreeAndChannelListModel.LineBean linebean = new DyLineTreeAndChannelListModel.LineBean();
// linebean.setId(lineDto.getId());
// linebean.setName(lineDto.getName());
// linebean.setBsManufacturer(lineDto.getBsManufacturer());
// if (CollectionUtil.isEmpty(termlist)) {
// continue;
// }
// for (int k = 0; k < termlist.size(); k++) {
// TowerAndTermDto towerAndTermDto = termlist.get(k);
// List<Terminals> list = towerAndTermDto.getList();
// for (int l = 0; l < list.size(); l++) {
// Terminals terminals = list.get(l);
// DyLineTreeAndChannelListModel.TerminalBean termBean = new DyLineTreeAndChannelListModel.TerminalBean();
// termBean.setId(terminals.getId());
// termBean.setCmdid(terminals.getCmdid());
// termBean.setName(terminals.getName());
// termBean.setTowerid(terminals.getTowerid());
// }
//
// }
// linebean.setList();
// linemodellist.add(linebean);
// }
//
// dyListBean.setList(linemodellist);
//
// dymodellist.add(dyListBean);
// }
// model.setList(dymodellist);
List<DyLineAndTerminalAndChannelDto> list = terminalChannelsDao.selectAllAndChannelByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value()); List<DyLineAndTerminalAndChannelDto> list = terminalChannelsDao.selectAllAndChannelByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {

Loading…
Cancel
Save