|
|
@ -6,17 +6,12 @@ import com.shxy.xymanager_common.bean.PermissionDetail;
|
|
|
|
import com.shxy.xymanager_common.entity.*;
|
|
|
|
import com.shxy.xymanager_common.entity.*;
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
import com.shxy.xymanager_common.enums.CommonStatus;
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_common.model.UploadModel;
|
|
|
|
import com.shxy.xymanager_common.page.PageUtils;
|
|
|
|
import com.shxy.xymanager_common.page.PageUtils;
|
|
|
|
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
|
|
|
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
|
|
|
|
import com.shxy.xymanager_common.vo.TerminalSelectVo;
|
|
|
|
import com.shxy.xymanager_common.vo.TerminalSelectVo;
|
|
|
|
import com.shxy.xymanager_dao.dao.MntnRawReportsMapper;
|
|
|
|
import com.shxy.xymanager_dao.dao.*;
|
|
|
|
import com.shxy.xymanager_dao.dao.MntnStatusMapper;
|
|
|
|
import com.shxy.xymanager_service.service.*;
|
|
|
|
import com.shxy.xymanager_dao.dao.TerminalsDao;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_dao.dao.View_Dy_Line_Tower_TerminalsDao;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_service.service.ActivitiesService;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_service.service.CacheService;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_service.service.TerminalExtService;
|
|
|
|
|
|
|
|
import com.shxy.xymanager_service.service.UserService;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@ -37,6 +32,8 @@ public class TerminalExtServiceImpl implements TerminalExtService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
TerminalsDao terminalsDao;
|
|
|
|
TerminalsDao terminalsDao;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
TowerDao towerDao;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
ActivitiesService activitiesService;
|
|
|
|
ActivitiesService activitiesService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
UserService userService;
|
|
|
|
UserService userService;
|
|
|
@ -48,6 +45,10 @@ public class TerminalExtServiceImpl implements TerminalExtService {
|
|
|
|
MntnRawReportsMapper rawReportsMapper;
|
|
|
|
MntnRawReportsMapper rawReportsMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
CacheService cacheService;
|
|
|
|
CacheService cacheService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
NewCacheService newCacheService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
TerminalChannelMapperDao channelMapperDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -219,4 +220,46 @@ public class TerminalExtServiceImpl implements TerminalExtService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new PageInfo<>(list);
|
|
|
|
return new PageInfo<>(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void importTerminal(UploadModel model) {
|
|
|
|
|
|
|
|
Lines line = newCacheService.getLine(model.getLineId());
|
|
|
|
|
|
|
|
if (line == null) {
|
|
|
|
|
|
|
|
throw new ApiException("未找到该线路");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Protocols protocol = cacheService.getProtocolMap().get(model.getProtocol());
|
|
|
|
|
|
|
|
if (protocol == null) {
|
|
|
|
|
|
|
|
throw new ApiException("未找到该规约");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
|
|
|
for (String cmdid : model.getCmdidList()) {
|
|
|
|
|
|
|
|
Towers tower = new Towers();
|
|
|
|
|
|
|
|
tower.setName(cmdid);
|
|
|
|
|
|
|
|
tower.setLineid(line.getId());
|
|
|
|
|
|
|
|
tower.setStatus(CommonStatus.EFFECTIVE.value());
|
|
|
|
|
|
|
|
tower.setCreateTime(now);
|
|
|
|
|
|
|
|
tower.setUpdateTime(now);
|
|
|
|
|
|
|
|
towerDao.insert(tower);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Terminals term = new Terminals();
|
|
|
|
|
|
|
|
term.makeDefaultValue();
|
|
|
|
|
|
|
|
term.setCmdid(cmdid);
|
|
|
|
|
|
|
|
term.setLineId(line.getId());
|
|
|
|
|
|
|
|
term.setTowerId(tower.getId());
|
|
|
|
|
|
|
|
term.setProtocol(model.getProtocol());
|
|
|
|
|
|
|
|
term.setDisplayName(cmdid);
|
|
|
|
|
|
|
|
term.setCreateTime(now);
|
|
|
|
|
|
|
|
term.setUpdateTime(now);
|
|
|
|
|
|
|
|
terminalsDao.insert(term);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= model.getChannelCount(); i++) {
|
|
|
|
|
|
|
|
TerminalChannelMapper channel = new TerminalChannelMapper();
|
|
|
|
|
|
|
|
channel.setTermId(term.getId());
|
|
|
|
|
|
|
|
channel.setChannelId(i);
|
|
|
|
|
|
|
|
channel.setCreateTime(now);
|
|
|
|
|
|
|
|
channel.setUpdateTime(now);
|
|
|
|
|
|
|
|
channelMapperDao.insertSelective(channel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|