新增protocol返回

hunan
liuguijing 1 year ago
parent 192cb6fad4
commit abcabde513

@ -27,19 +27,15 @@ public class Constants {
public static String CMD = ""; public static String CMD = "";
public static String newCMD = ""; public static String newCMD = "";
public static String shpath = "/usr/local/bin/xympadmn";
public static String serverpath = "";
public static String portpath = "";
@PostConstruct @PostConstruct
private void init() { private void init() {
server = cmServer; server = cmServer;
port = cmaPort; port = cmaPort;
CMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port + " --udp=1"+ " --act="; // CMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port + " --udp=1"+ " --act=";
CMD = "C:\\Users\\shxy\\Desktop\\xymp\\xympadmn --server=" + server + " --port=" + port + " --udp=1"+ " --act=";
newCMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port; newCMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port;
serverpath = "--server=" + server;
portpath = "--port=" + port;
} }

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class Protocols implements Serializable {
private Integer id;
private String name;
private String version;
private static final long serialVersionUID = 1L;
}

@ -1,38 +0,0 @@
package com.shxy.xymanager_common.entity;
import java.io.Serializable;
import java.util.Date;
public class TerminalFavs implements Serializable {
private Integer userId;
private Integer termId;
private Date createTime;
private static final long serialVersionUID = 1L;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getTermId() {
return termId;
}
public void setTermId(Integer termId) {
this.termId = termId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -79,6 +79,9 @@ public class DyLineTreeListModel implements Serializable {
@ApiModelProperty(value = "杆塔地址", example = "名称名称") @ApiModelProperty(value = "杆塔地址", example = "名称名称")
private String address; private String address;
@ApiModelProperty(value = "规约", example = "规约")
private Integer protocol;
@ApiModelProperty(value = "装置显示名", example = "名称名称") @ApiModelProperty(value = "装置显示名", example = "名称名称")
private String displayname; private String displayname;
@ -91,5 +94,6 @@ public class DyLineTreeListModel implements Serializable {
@ApiModelProperty(value = "是否收藏", example = "0--未收藏 1--已收藏") @ApiModelProperty(value = "是否收藏", example = "0--未收藏 1--已收藏")
private Integer isfavor; private Integer isfavor;
} }
} }

@ -116,6 +116,12 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "是否删除", example = "0--删除1--未删除") @ApiModelProperty(value = "是否删除", example = "0--删除1--未删除")
private Integer status; private Integer status;
@ApiModelProperty(value = "规约编号", example = "21223")
private Integer protocol;
@ApiModelProperty(value = "规约名称", example = "21223")
private String protocolName;
@ApiModelProperty(value = "通道编号和名称", example = "213") @ApiModelProperty(value = "通道编号和名称", example = "213")
private List<ChannelBeans> list; private List<ChannelBeans> list;

@ -0,0 +1,9 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.Protocols;
import java.util.List;
public interface ProtocolsDao {
List<Protocols> selectAll();
}

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shxy.xymanager_dao.dao.ProtocolsDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Protocols">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="version" jdbcType="VARCHAR" property="version"/>
</resultMap>
<sql id="Base_Column_List">
id, name, version
</sql>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from protocols
</select>
</mapper>

@ -32,6 +32,7 @@ public class XyCache {
cacheService.updateGolobalMap(); cacheService.updateGolobalMap();
cacheService.updateProtocolMap();
} }

@ -46,6 +46,8 @@ public class CacheServiceImpl implements CacheService {
@Autowired @Autowired
TerminalImgAlarmParamsDao terminalImgAlarmParamsDao; TerminalImgAlarmParamsDao terminalImgAlarmParamsDao;
@Autowired
ProtocolsDao protocolsDao;
// @Override // @Override
// @Cacheable(value = "globalParams", key = "#param") // @Cacheable(value = "globalParams", key = "#param")
@ -287,6 +289,28 @@ public class CacheServiceImpl implements CacheService {
return lineMap; return lineMap;
} }
@Override
@Cacheable(value = "protocolMap")
public Map<Integer, Protocols> getProtocolMap() {
Map<Integer, Protocols> Map = new HashMap<Integer, Protocols>();
List<Protocols> protocols = protocolsDao.selectAll();
for (Protocols lineitem : protocols) {
Map.put(lineitem.getId(), lineitem);
}
return Map;
}
@Override
@Cacheable(value = "protocolMap")
public Map<Integer, Protocols> updateProtocolMap() {
Map<Integer, Protocols> Map = new HashMap<Integer, Protocols>();
List<Protocols> protocols = protocolsDao.selectAll();
for (Protocols lineitem : protocols) {
Map.put(lineitem.getId(), lineitem);
}
return Map;
}
@Override @Override
@CachePut(value = "globalMap") @CachePut(value = "globalMap")

@ -103,6 +103,7 @@ public class DyLevelServiceImpl implements DyLevelService {
bean.setEquipname(terminalsWithHeart.getEquipname()); bean.setEquipname(terminalsWithHeart.getEquipname());
bean.setModel(terminalsWithHeart.getModel()); bean.setModel(terminalsWithHeart.getModel());
bean.setName(terminalsWithHeart.getName()); bean.setName(terminalsWithHeart.getName());
bean.setProtocol(terminalsWithHeart.getProtocol());
bean.setTowerid(terminalsWithHeart.getTowerid()); bean.setTowerid(terminalsWithHeart.getTowerid());
Integer isfavor = terminalsWithHeart.getIsfavor(); Integer isfavor = terminalsWithHeart.getIsfavor();
bean.setIsfavor(isfavor); bean.setIsfavor(isfavor);

@ -85,7 +85,7 @@ public class TerminalServiceImpl implements TerminalService {
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap(); Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap(); Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TermAndChannelDto> termAndChannelMap = cacheService.getTermAndChannelMap(); Map<Integer, TermAndChannelDto> termAndChannelMap = cacheService.getTermAndChannelMap();
// Map<Integer, Protocols> protocolMap = cacheService.getProtocolMap(); Map<Integer, Protocols> protocolMap = cacheService.getProtocolMap();
Integer dyid = vo.getDyId(); Integer dyid = vo.getDyId();
Integer lineid = vo.getLineId(); Integer lineid = vo.getLineId();
Integer tower = vo.getTowerId(); Integer tower = vo.getTowerId();
@ -132,19 +132,21 @@ public class TerminalServiceImpl implements TerminalService {
} }
} }
// if (protocolMap != null) { if (protocolMap != null) {
// Integer protocol = item.getProtocol(); Integer protocol = item.getProtocol();
// if (protocol != null) { if (protocol != null) {
// terminalsBean.setProtocol(protocol); terminalsBean.setProtocol(protocol);
// Protocols protocols = protocolMap.get(protocol); Protocols protocols = protocolMap.get(protocol);
// if (protocols != null) { if (protocols != null) {
// terminalsBean.setProtocolName(protocols.getName()); terminalsBean.setProtocolName(protocols.getName());
// } }
// } }
// } }
// terminalsBean.setSim(item.getSim()); // terminalsBean.setSim(item.getSim());
// terminalsBean.setWorkingDate(item.getWorkingDate()); // terminalsBean.setWorkingDate(item.getWorkingDate());
// terminalsBean.setNetType(item.getNetType()); // terminalsBean.setNetType(item.getNetType());
// terminalsBean.setPhase(item.getPhase());
// terminalsBean.setEquipmentType(item.getEquipmentType());
terminalsBean.setCmdId(item.getCmdid()); terminalsBean.setCmdId(item.getCmdid());
terminalsBean.setOrgId(item.getOrgId()); terminalsBean.setOrgId(item.getOrgId());

@ -83,6 +83,10 @@ public interface CacheService {
Map<String, String> getGolobalMap(); Map<String, String> getGolobalMap();
Map<Integer, Protocols> getProtocolMap();
Map<Integer, Protocols> updateProtocolMap();
Map<String, String> updateGolobalMap(); Map<String, String> updateGolobalMap();
Map<Integer, TerminalImgAlarmParams> getAlarmParamMap(); Map<Integer, TerminalImgAlarmParams> getAlarmParamMap();

Loading…
Cancel
Save