修改nms上报接口支持批量提交,修改为阀门中域添加额外属性时的阀门库编号
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
package com.nis.domain.restful;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.wordnik.swagger.annotations.ApiModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* <p>Title: TrafficNmsServerStatistic</p>
|
||||||
|
* <p>Description: 记录nms服务器信息,全网机器总量,正常在线机器总数,异常机器列表</p>
|
||||||
|
* <p>Company: IIE</p>
|
||||||
|
* @author rkg
|
||||||
|
* @date 2018年8月17日
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "TrafficNmsServerStatistic对象", description = "nms上报的服务器相关信息对象类")
|
||||||
|
public class TrafficNmsServerStatisticList implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private List<TrafficNmsServerStatistic> trafficNmsServerList;
|
||||||
|
|
||||||
|
public List<TrafficNmsServerStatistic> getTrafficNmsServerList() {
|
||||||
|
return trafficNmsServerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrafficNmsServerList(List<TrafficNmsServerStatistic> trafficNmsServerList) {
|
||||||
|
this.trafficNmsServerList = trafficNmsServerList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,21 +1,19 @@
|
|||||||
package com.nis.web.controller.restful;
|
package com.nis.web.controller.restful;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.nis.domain.restful.TrafficNmsServerStatistic;
|
import com.nis.domain.restful.TrafficNmsServerStatistic;
|
||||||
|
import com.nis.domain.restful.TrafficNmsServerStatisticList;
|
||||||
import com.nis.restful.RestBusinessCode;
|
import com.nis.restful.RestBusinessCode;
|
||||||
import com.nis.restful.RestConstants;
|
|
||||||
import com.nis.restful.RestServiceException;
|
import com.nis.restful.RestServiceException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.controller.BaseRestController;
|
import com.nis.web.controller.BaseRestController;
|
||||||
@@ -38,30 +36,28 @@ public class NmsInfoController extends BaseRestController {
|
|||||||
@RequestMapping(value = "/nms/v1/saveServerStatus", method = RequestMethod.POST)
|
@RequestMapping(value = "/nms/v1/saveServerStatus", method = RequestMethod.POST)
|
||||||
@ApiOperation(value = "存储NMS系统上报的服务器状态接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的服务器状态信息")
|
@ApiOperation(value = "存储NMS系统上报的服务器状态接口", httpMethod = "POST", response = Map.class, notes = "接收NMS系统上报的服务器状态信息")
|
||||||
@ApiParam(value = "存储NMS系统上报的服务器状态接口", name = "saveServerStatus", required = true)
|
@ApiParam(value = "存储NMS系统上报的服务器状态接口", name = "saveServerStatus", required = true)
|
||||||
public Map<String, Object> saveServerStatus(@RequestBody TrafficNmsServerStatistic trafficNmsServerStatistic,
|
public Map<String, Object> saveServerStatus(
|
||||||
HttpServletRequest request, HttpServletResponse response) {
|
@RequestBody TrafficNmsServerStatisticList trafficNmsServerStatisticList, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
AuditLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||||
trafficNmsServerStatistic);
|
trafficNmsServerStatisticList);
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
|
||||||
map.put(RestConstants.REST_SERVICE_HTTP_STATUS, HttpStatus.OK);
|
|
||||||
try {
|
try {
|
||||||
TrafficNmsServerStatistic saveNmsServer = trafficNmsServerStatisticService
|
|
||||||
.saveNmsServer(trafficNmsServerStatistic);
|
if (trafficNmsServerStatisticList != null && trafficNmsServerStatisticList.getTrafficNmsServerList() != null
|
||||||
try {
|
&& trafficNmsServerStatisticList.getTrafficNmsServerList().size() > 0) {
|
||||||
trafficNmsServerStatisticService.saveAbnormalMachine(saveNmsServer.getId(),
|
trafficNmsServerStatisticService.saveNmsInfo(trafficNmsServerStatisticList.getTrafficNmsServerList());
|
||||||
saveNmsServer.getAbnormalMachineList());
|
} else {
|
||||||
} catch (Exception e) {
|
throw new RestServiceException(thread, System.currentTimeMillis() - start, "参数trafficNmsServerList不能为空",
|
||||||
trafficNmsServerStatisticService.delNmsServer(saveNmsServer);
|
RestBusinessCode.missing_args.getValue());
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "上报服务器状态信息异常:" + e.getMessage(),
|
throw new RestServiceException(thread, System.currentTimeMillis() - start, "上报服务器状态信息异常:" + e.getMessage(),
|
||||||
RestBusinessCode.unknow_error.getValue());
|
RestBusinessCode.unknow_error.getValue());
|
||||||
}
|
}
|
||||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "上报服务器状态信息成功",
|
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "上报服务器状态信息成功",
|
||||||
Constants.IS_DEBUG ? trafficNmsServerStatistic : null);
|
Constants.IS_DEBUG ? trafficNmsServerStatisticList : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import redis.clients.jedis.exceptions.JedisConnectionException;
|
|||||||
@Service()
|
@Service()
|
||||||
public class ConfigJedisServiceimpl implements ConfigRedisService {
|
public class ConfigJedisServiceimpl implements ConfigRedisService {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ConfigJedisServiceimpl.class);
|
private static Logger logger = LoggerFactory.getLogger(ConfigJedisServiceimpl.class);
|
||||||
private static final int TAPREDISDB = Configurations.getIntProperty("tapRedisDb", 7);
|
private static final int TAPREDISDB = Configurations.getIntProperty("tapRedisDb", 5);
|
||||||
// 用于在实时统计配置后面添加时间,方便读取入库时间
|
// 用于在实时统计配置后面添加时间,方便读取入库时间
|
||||||
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.restful.AbnormalMachine;
|
|
||||||
import com.nis.domain.restful.TrafficNmsServerStatistic;
|
import com.nis.domain.restful.TrafficNmsServerStatistic;
|
||||||
import com.nis.web.dao.TrafficNmsServerStatisticDao;
|
import com.nis.web.dao.TrafficNmsServerStatisticDao;
|
||||||
|
|
||||||
@@ -14,16 +14,13 @@ public class TrafficNmsServerStatisticService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
TrafficNmsServerStatisticDao trafficNmsServerStatisticDao;
|
TrafficNmsServerStatisticDao trafficNmsServerStatisticDao;
|
||||||
|
|
||||||
public TrafficNmsServerStatistic saveNmsServer(TrafficNmsServerStatistic trafficNmsServerStatistic) {
|
@Transactional
|
||||||
trafficNmsServerStatisticDao.insert(trafficNmsServerStatistic);
|
public void saveNmsInfo(List<TrafficNmsServerStatistic> trafficNmsServerList) {
|
||||||
return trafficNmsServerStatistic;
|
for (TrafficNmsServerStatistic trafficNmsServerStatistic : trafficNmsServerList) {
|
||||||
}
|
trafficNmsServerStatisticDao.insert(trafficNmsServerStatistic);
|
||||||
|
trafficNmsServerStatisticDao.insertAbnormalMachine(trafficNmsServerStatistic.getId(),
|
||||||
public void saveAbnormalMachine(Integer id, List<AbnormalMachine> abnormalMachineList) {
|
trafficNmsServerStatistic.getAbnormalMachineList());
|
||||||
trafficNmsServerStatisticDao.insertAbnormalMachine(id, abnormalMachineList);
|
}
|
||||||
}
|
Integer.parseInt(null);
|
||||||
|
|
||||||
public void delNmsServer(TrafficNmsServerStatistic trafficNmsServerStatistic) {
|
|
||||||
trafficNmsServerStatisticDao.delete(trafficNmsServerStatistic);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ idRelaRedisDBIndex=15
|
|||||||
#存储分组复用域配置的redisdb
|
#存储分组复用域配置的redisdb
|
||||||
tmpStorageReuseRegionDB=15
|
tmpStorageReuseRegionDB=15
|
||||||
##阀门配置在redisdb的序号
|
##阀门配置在redisdb的序号
|
||||||
tapRedisDb=7
|
tapRedisDb=5
|
||||||
|
|
||||||
##实时统计(编译配置)数据表达式
|
##实时统计(编译配置)数据表达式
|
||||||
redisStatisticsReal=[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATTR_TYPE];\t;[CONT_LABEL];\t;[TASK_ID];\t;[AFFAIR_ID];\t;[DO_BLACKLIST];\t;[DO_LOG];\t;[EFFECTIVE_RANGE];\t;[START_TIME];\t;[END_TIME];\t;[USER_REGION];\t;[IS_VALID];\t;[GROUP_NUM];\t;[FATHER_CFG_ID];\t;[OP_TIME]
|
redisStatisticsReal=[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATTR_TYPE];\t;[CONT_LABEL];\t;[TASK_ID];\t;[AFFAIR_ID];\t;[DO_BLACKLIST];\t;[DO_LOG];\t;[EFFECTIVE_RANGE];\t;[START_TIME];\t;[END_TIME];\t;[USER_REGION];\t;[IS_VALID];\t;[GROUP_NUM];\t;[FATHER_CFG_ID];\t;[OP_TIME]
|
||||||
@@ -205,6 +205,7 @@ redisStatisticsReal=[COMPILE_ID];\t;[SERVICE];\t;[ACTION];\t;[CONT_TYPE];\t;[ATT
|
|||||||
redisStatisticsRealDBIndex=14
|
redisStatisticsRealDBIndex=14
|
||||||
#maat测试程序输出日志的文件目录
|
#maat测试程序输出日志的文件目录
|
||||||
maatTestLogPath=c:/maat/mmat.log
|
maatTestLogPath=c:/maat/mmat.log
|
||||||
|
#maatTestLogPath=/home/maat/mmat.log
|
||||||
#样例文件存放目录,{tableType}和{fileName}会替换成具体内容
|
#样例文件存放目录,{tableType}和{fileName}会替换成具体内容
|
||||||
mmSampleDstPath=/home/mesasoft/{tableType}/full/{fileName}
|
mmSampleDstPath=/home/mesasoft/{tableType}/full/{fileName}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user