装置通道线路和删除装置修改

jni
liuguijing 2 years ago
parent c606c354ba
commit 5c0a5b48da

@ -1,9 +1,7 @@
package com.shxy.xymanager_admin;
import com.shxy.xymanager_service.service.DyLevelService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@ -18,10 +18,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

@ -41,6 +41,9 @@ public class Terminals implements Serializable {
private Date updateTime;
/*展示名字 等价与displayname 用于方便*/
private String name;
private static final long serialVersionUID = 1L;
}

@ -62,7 +62,7 @@ public class DyLineAndTermModel implements Serializable {
private String cmdid;
@ApiModelProperty(value = "显示名", example = "名称名称")
private String displayName;
private String name;
}
}

@ -44,7 +44,7 @@
<result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="display_name" jdbcType="VARCHAR" property="name"/>
</collection>
</collection>
</resultMap>

@ -104,10 +104,11 @@
e.id as channel_id,
e.channel_name as channel_name
from
((((terminals a left join `lines` b on a.line_id = b.id and a.status = #{status})
((((terminals a left join `lines` b on a.line_id = b.id )
left join tower c on a.tower_id = c.id)
left join terminal_channel_mapper d on a.id = d.term_id)
left join terminal_channels e on d.channel_id = e.id)
WHERE a.status = 1
order by a.create_time desc
</select>
@ -354,8 +355,8 @@
<if test="data.lineid != null">
line_id = #{data.lineid},
</if>
<if test="data.towerid != null">
tower_id = #{data.towerid},
<if test="data.towerid != null">
tower_id = #{data.towerid},
</if>
<if test="data.cmdid != null">
cmdid = #{data.cmdid},

@ -191,7 +191,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<String> resetTerminal(String cmId) {
// Cma cma = new Cma("47.96.238.157", 6891);
String cmd = Constants.CMD+"reset --flag=1 --cmdid=" + cmId + "\t" + "--mode=0";
String cmd = Constants.CMD + "reset --flag=1 --cmdid=" + cmId + "\t" + "--mode=0";
Integer retCode = ProcessExecUtils.exec(cmd);
// boolean reset = cma.reset(vo.getTermid().toString(), (short) 0x01);
if (retCode == 0) {
@ -206,16 +206,16 @@ public class TerminalServiceImpl implements TerminalService {
public ServiceBody<TerminalStatusModel> getTerminalStatus(Integer termId) {
TerminalStatusModel model = new TerminalStatusModel();
String cmdId = terminalsDao.getCmdIdByTermId(termId);
String cmd = Constants.CMD+"runningstatus --flag=0 --cmdid=" + cmdId;
String cmd = Constants.CMD + "runningstatus --flag=0 --cmdid=" + cmdId;
ProcessExecUtils.exec(cmd);
/* TerminalModel model = new TerminalModel();*/
/* TerminalInfoDto dto = terminalsDao.getTerminalInfo(termId);*/
/* TerminalInfoDto dto = terminalsDao.getTerminalInfo(termId);*/
/*if (null != dto) {*/
/* BigInteger updatetime = MyDateUtils.TimeSecond2MillSecond(dto.getWsUpdateTime().longValue());
BeanUtils.copyProperties(dto, model);*/
DateTime now = DateTime.now();
model.setQueryTime(now);
DateTime now = DateTime.now();
model.setQueryTime(now);
/* model.setWsUpdateTime(MyDateUtils.date(updatetime.longValue()).toString());
}*/
@ -233,11 +233,11 @@ public class TerminalServiceImpl implements TerminalService {
TerminalModel model = new TerminalModel();
TerminalInfoDto dto = terminalsDao.getTerminalInfo(vo.getTermId());
Boolean hasNew = false;
if(null!=dto) {
if (null != dto) {
BeanUtils.copyProperties(dto, model);
BigInteger wsUpdateTime = dto.getWsUpdateTime();
BigInteger queryTime = MyDateUtils.TimeMillSecond2Second(vo.getQueryTime());
hasNew = wsUpdateTime.compareTo(queryTime) < 0 ? false : true;
hasNew = wsUpdateTime.compareTo(queryTime) < 0 ? false : true;
}
model.setIsNew(hasNew);
@ -252,7 +252,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<TerminalUpdateModel> updateTerminalId(TerminalIdUpdateVo vo) {
TerminalUpdateModel model = new TerminalUpdateModel();
String cmd = Constants.CMD+"termid --flag=1 --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId() ;
String cmd = Constants.CMD + "termid --flag=1 --cmdid=" + vo.getCmdId() + "\t" + "--newcmdid=" + vo.getNewCmdId();
Integer retCode = ProcessExecUtils.exec(cmd);
model.setTermId(vo.getTermId());
if (retCode == 0) {
@ -275,12 +275,13 @@ public class TerminalServiceImpl implements TerminalService {
public ServiceBody<DyLineAndTermModel> getTermListByChannel(TerminalChannelIdVo vo) {
Integer id = vo.getId();
DyLineAndTermModel model = new DyLineAndTermModel();
List<DyLineAndTerminalNoHeartDto> list = dyLevelDao.selectTreeListByChannelId(id,CommonStatus.EFFECTIVE.value());
List<DyLineAndTerminalNoHeartDto> list = dyLevelDao.selectTreeListByChannelId(id, CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<DyLineAndTermModel.DyListBean> beans = BeanUtil.copyToList(list, DyLineAndTermModel.DyListBean.class,CopyOptions.create().ignoreCase());
List<DyLineAndTermModel.DyListBean> beans = BeanUtil.copyToList(list, DyLineAndTermModel.DyListBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
}
return Asserts.success(model);
@ -288,7 +289,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<GetModel> terminalIdGet(TerminalIdUpdateVo vo) {
String cmd = Constants.CMD+"termid --clientid=10 --flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID;
String cmd = Constants.CMD + "termid --clientid=10 --flag=0 --cmdid=" + vo.getCmdId() + "\t" + "--reqid=" + Constants.REQUEST_ID;
ProcessExecUtils.exec(cmd);
GetModel model = new GetModel();
model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString()));

Loading…
Cancel
Save