1:完善maat类配置下发程序
2:删除对ip域配置对象集合的大小判断
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.nis.domain.restful.*;
|
||||
@@ -95,8 +96,6 @@ public class MaatTestController {
|
||||
return "false";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/delUnMaat", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "test redis", httpMethod = "GET", response = Map.class, notes = "测试redis事务的crontroller")
|
||||
@ApiParam(value = "test redis", name = "测试redis事务的crontroller", required = true)
|
||||
@@ -108,7 +107,7 @@ public class MaatTestController {
|
||||
map.put(service, arrayList);
|
||||
Map<Integer, Map<Integer, List<Long>>> idMap = new HashMap<Integer, Map<Integer, List<Long>>>();
|
||||
idMap.put(redisDB, map);
|
||||
configRedisService.delUnMaatConfig(idMap,true);
|
||||
configRedisService.delUnMaatConfig(idMap, true);
|
||||
// configRedisService.saveMaatConfig(listMap, service);
|
||||
// new ConfigRedisServiceimpl().GETMaatConfig(listMap);
|
||||
return "ok";
|
||||
@@ -148,8 +147,8 @@ public class MaatTestController {
|
||||
long seq_groupid = configRedisService.getIncrId("SEQ_GROUPID");
|
||||
List<MaatConfig> listMap = new ArrayList<MaatConfig>();
|
||||
long seq_regionid2 = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
listMap.add(getMaatConfig1(service, seq_groupid,seq_regionid2));
|
||||
//listMap.add(getMaatConfig2(service, seq_groupid,seq_regionid2));
|
||||
listMap.add(getMaatConfig1(service, seq_groupid, seq_regionid2));
|
||||
// listMap.add(getMaatConfig2(service, seq_groupid,seq_regionid2));
|
||||
|
||||
for (Integer db : redisDBByService) {
|
||||
configMap.put(db, listMap);
|
||||
@@ -164,7 +163,7 @@ public class MaatTestController {
|
||||
return "false";
|
||||
}
|
||||
|
||||
public MaatConfig getMaatConfig1(Integer service, long seq_groupid,long seq_regionid2) {
|
||||
public MaatConfig getMaatConfig1(Integer service, long seq_groupid, long seq_regionid2) {
|
||||
String time = new Date().getTime() + "";
|
||||
Map<String, String> configMap1 = new HashMap<String, String>();
|
||||
long seq_compileid = configRedisService.getIncrId("SEQ_COMPILEID");
|
||||
@@ -246,7 +245,7 @@ public class MaatTestController {
|
||||
return maatConfig;
|
||||
}
|
||||
|
||||
public MaatConfig getMaatConfig2(Integer service, long seq_groupid,long seq_regionid2) {
|
||||
public MaatConfig getMaatConfig2(Integer service, long seq_groupid, long seq_regionid2) {
|
||||
String time = new Date().getTime() + "";
|
||||
Map<String, String> configMap = new HashMap<String, String>();
|
||||
long seq_compileid = configRedisService.getIncrId("SEQ_COMPILEID");
|
||||
@@ -302,8 +301,6 @@ public class MaatTestController {
|
||||
return maatConfig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/testDelMaat", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "测试批量删除maat配置", httpMethod = "GET", response = String.class, notes = "测试批量删除maat配置,configId为配置id,多个配置id用逗号分隔")
|
||||
@ApiParam(value = "测试批量删除maat配置", name = "testDelMaat", required = true)
|
||||
@@ -345,7 +342,7 @@ public class MaatTestController {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
FileUtils.addStrToFile(sdf.format(new Date()) + "\t" + "获取业务类型" + service + "对应的redisDb失败\n",
|
||||
FileUtils.addStrToFile(sdf.format(new Date()) + "\t" + "error:获取业务类型" + service + "对应的redisDb失败\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
return "error";
|
||||
}
|
||||
@@ -353,7 +350,7 @@ public class MaatTestController {
|
||||
try {
|
||||
if (!configRedisService.delMaatConfig(restMap)) {
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "删除业务类型" + serviceType + "下的配置" + configId + "失败\n",
|
||||
sdf.format(new Date()) + "\t" + "error:删除业务类型" + serviceType + "下的配置" + configId + "失败\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
return "error";
|
||||
} else {
|
||||
@@ -365,7 +362,7 @@ public class MaatTestController {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "删除业务类型" + serviceType + "下的配置" + configId + "失败,失败原因:"
|
||||
sdf.format(new Date()) + "\t" + "error:删除业务类型" + serviceType + "下的配置" + configId + "失败,失败原因:"
|
||||
+ ExceptionUtil.getExceptionMsg(e) + "\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
|
||||
@@ -381,7 +378,7 @@ public class MaatTestController {
|
||||
@RequestParam(required = true) Integer saveCount, Integer forCount) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try {
|
||||
|
||||
|
||||
for (int a = 0; a < forCount; a++) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread thread = new AuditLogThread();
|
||||
@@ -397,14 +394,14 @@ public class MaatTestController {
|
||||
compileIdList.add(configCompile.getCompileId());
|
||||
}
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
||||
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是"
|
||||
+ compileIdList + "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
// 验证数据是否在正确
|
||||
maatTestServiceimpl.getKeys(configCompileList);
|
||||
list.add(testDelMaat(compileIdList.toString().replace("[", "").replace("]", ""), service));
|
||||
}
|
||||
|
||||
|
||||
// return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType="
|
||||
// + service + "&configId="
|
||||
// + compileIdList.toString().replace("[", "").replace("]", "");
|
||||
@@ -418,37 +415,90 @@ public class MaatTestController {
|
||||
@RequestMapping(value = "/cfg/v1/testSaveMaat", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "测试批量保存maat配置", httpMethod = "GET", response = String.class, notes = "测试批量保存maat配置,service:需要保存的业务类型,saveCount:保存几条配置")
|
||||
@ApiParam(value = "测试批量保存maat配置", name = "testSaveMaat", required = true)
|
||||
public String testSaveMaat(@RequestParam(required = true) Integer service,
|
||||
public Map testSaveMaat(@RequestParam(required = true) Integer service,
|
||||
@RequestParam(required = true) Integer saveCount) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread thread = new AuditLogThread();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
List<Long> compileIdList = new ArrayList<Long>();
|
||||
List<Long> compileIdList = null;
|
||||
|
||||
Map<Integer, String> map = new HashMap<Integer, String>();
|
||||
|
||||
try {
|
||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||
for (int i = 0; i < saveCount; i++) {
|
||||
configCompileList.add(getConfigCompile(service));
|
||||
// 获取所有maat类的业务类型
|
||||
Map<Integer, Map<Integer, List<String>>> sercieNameMap = ServiceAndRDBIndexReal.getSercieNameMap();
|
||||
if (sercieNameMap != null) {
|
||||
if (service == -1) {
|
||||
Set<Integer> keySet = sercieNameMap.keySet();
|
||||
for (Integer ser : keySet) {
|
||||
compileIdList = new ArrayList<Long>();
|
||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||
for (int i = 0; i < saveCount; i++) {
|
||||
configCompileList.add(getConfigCompile(ser));
|
||||
}
|
||||
// 保存测试配置
|
||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
compileIdList.add(configCompile.getCompileId());
|
||||
}
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "业务类型" + ser + "添加" + saveCount + "条数据成功,配置id是"
|
||||
+ compileIdList + "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
// 验证数据是否在正确
|
||||
maatTestServiceimpl.getKeys(configCompileList);
|
||||
map.put(ser, "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType=" + ser
|
||||
+ "&configId=" + compileIdList.toString().replace("[", "").replace("]", ""));
|
||||
|
||||
|
||||
testDelMaat(compileIdList.toString().replace("[", "").replace("]", ""), ser);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (sercieNameMap.containsKey(service)) {
|
||||
compileIdList = new ArrayList<Long>();
|
||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||
for (int i = 0; i < saveCount; i++) {
|
||||
configCompileList.add(getConfigCompile(service));
|
||||
}
|
||||
// 保存测试配置
|
||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
compileIdList.add(configCompile.getCompileId());
|
||||
}
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是"
|
||||
+ compileIdList + "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
// 验证数据是否在正确
|
||||
maatTestServiceimpl.getKeys(configCompileList);
|
||||
map.put(service, "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType="
|
||||
+ service + "&configId=" + compileIdList.toString().replace("[", "").replace("]", ""));
|
||||
testDelMaat(compileIdList.toString().replace("[", "").replace("]", ""), service);
|
||||
} else {
|
||||
|
||||
map.put(-2, "is not maat service");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
map.put(-3, "service map is null");
|
||||
}
|
||||
// 保存测试配置
|
||||
|
||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||
|
||||
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
compileIdList.add(configCompile.getCompileId());
|
||||
}
|
||||
FileUtils.addStrToFile(
|
||||
sdf.format(new Date()) + "\t" + "业务类型" + service + "添加" + saveCount + "条数据成功,配置id是" + compileIdList
|
||||
+ "\n" + sdf.format(new Date()) + "\t开始验证添加的数据各字段是否正确\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
// 验证数据是否在正确
|
||||
maatTestServiceimpl.getKeys(configCompileList);
|
||||
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
map.put(-4, "error");
|
||||
}
|
||||
return "http://127.0.0.1:8080/galaxy/service/cfg/v1/testDelMaat?serviceType=" + service + "&configId="
|
||||
+ compileIdList.toString().replace("[", "").replace("]", "");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private ConfigCompile getConfigCompile(Integer service) {
|
||||
@@ -487,72 +537,62 @@ public class MaatTestController {
|
||||
String[] typeArr = typeStr.split(":");
|
||||
int tableType = Integer.parseInt(typeArr[0]);
|
||||
String tableNameArr[] = typeArr[1].split(",");
|
||||
if (tableType == 12) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
|
||||
List<IpRegion> ipList = new ArrayList<IpRegion>();
|
||||
List<NumRegion> numList = new ArrayList<NumRegion>();
|
||||
List<StrRegion> strList = new ArrayList<StrRegion>();
|
||||
List<DigestRegion> digestList = new ArrayList<DigestRegion>();
|
||||
configCompile.setIpRegionList(ipList);
|
||||
configCompile.setNumRegionList(numList);
|
||||
configCompile.setStrRegionList(strList);
|
||||
configCompile.setDigestRegionList(digestList);
|
||||
configCompile.setIpClientRangeList(ipList);
|
||||
if (tableType == 12 || tableType == 18) {
|
||||
ipList = new ArrayList<IpRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getIpRegion(service, tableType, groupId, null));
|
||||
ipList.add(getIpRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getIpRegion(service, tableType, groupId, tableName));
|
||||
ipList.add(getIpRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
if (tableType == 12) {
|
||||
configCompile.setIpRegionList(ipList);
|
||||
} else if (tableType == 18) {
|
||||
configCompile.setIpClientRangeList(ipList);
|
||||
}
|
||||
|
||||
configCompile.setIpRegionList(list);
|
||||
} else if (tableType == 13) {
|
||||
List<NumRegion> list = new ArrayList<NumRegion>();
|
||||
numList = new ArrayList<NumRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getNumRegion(service, tableType, groupId, null));
|
||||
numList.add(getNumRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getNumRegion(service, tableType, groupId, tableName));
|
||||
numList.add(getNumRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setNumRegionList(list);
|
||||
configCompile.setNumRegionList(numList);
|
||||
} else if (tableType == 14 || tableType == 15) {
|
||||
strList = new ArrayList<StrRegion>();
|
||||
|
||||
} else if (tableType == 14) {
|
||||
List<StrRegion> list = new ArrayList<StrRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getStrRegion(service, tableType, groupId, null));
|
||||
strList.add(getStrRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getStrRegion(service, tableType, groupId, tableName));
|
||||
strList.add(getStrRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setStrRegionList(list);
|
||||
} else if (tableType == 15) {
|
||||
|
||||
List<StrRegion> list = new ArrayList<StrRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getStrRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getStrRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setStrRegionList(list);
|
||||
|
||||
configCompile.setStrRegionList(strList);
|
||||
} else if (tableType == 16) {
|
||||
List<DigestRegion> list = new ArrayList<DigestRegion>();
|
||||
|
||||
digestList = new ArrayList<DigestRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getDigestRegion(service, tableType, groupId, null));
|
||||
digestList.add(getDigestRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getDigestRegion(service, tableType, groupId, tableName));
|
||||
digestList.add(getDigestRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
|
||||
configCompile.setDigestRegionList(list);
|
||||
} else if (tableType == 18) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getIpRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getIpRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setIpClientRangeList(list);
|
||||
configCompile.setDigestRegionList(digestList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -21,9 +20,9 @@ import com.nis.domain.restful.StrRegion;
|
||||
import com.nis.util.CamelUnderlineUtil;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.FileUtils;
|
||||
import com.nis.util.JedisUtils;
|
||||
import com.nis.util.ReadMaatXmlUtil;
|
||||
import com.nis.util.ServiceAndRDBIndexReal;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service()
|
||||
public class MaatTestServiceimpl {
|
||||
@@ -47,58 +46,56 @@ public class MaatTestServiceimpl {
|
||||
|
||||
public void getConfigByKey(Integer redisDB, Integer service, ConfigCompile configCompile,
|
||||
MaatXmlConfig maatXmlConfig) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder.getBean("redisTemplate" + redisDB);
|
||||
if (maatXmlConfig != null && configCompile != null) {
|
||||
Long compileId = configCompile.getCompileId();
|
||||
validData(service, 10, compileId, configCompile.getCompileId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
configCompile,configCompile);
|
||||
validData(service, 10, compileId, configCompile.getCompileId(), redisDB, null, maatXmlConfig, configCompile,
|
||||
configCompile);
|
||||
|
||||
List<ConfigGroupRelation> groupRelationList = configCompile.getGroupRelationList();
|
||||
for (ConfigGroupRelation configGroupRelation : groupRelationList) {
|
||||
validData(service, 11, compileId, configGroupRelation.getGroupId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, configGroupRelation,configCompile);
|
||||
configGroupRelation, configCompile);
|
||||
}
|
||||
|
||||
List<IpRegion> ipRegionList = configCompile.getIpRegionList();
|
||||
for (IpRegion ipRegion : ipRegionList) {
|
||||
validData(service, 12, compileId, ipRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
ipRegion,configCompile);
|
||||
validData(service, 12, compileId, ipRegion.getRegionId(), redisDB, ipRegion.getTableName(),
|
||||
maatXmlConfig, ipRegion, configCompile);
|
||||
}
|
||||
List<NumRegion> numRegionList = configCompile.getNumRegionList();
|
||||
for (NumRegion numRegion : numRegionList) {
|
||||
validData(service, 13, compileId, numRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
numRegion,configCompile);
|
||||
validData(service, 13, compileId, numRegion.getRegionId(), redisDB, numRegion.getTableName(),
|
||||
maatXmlConfig, numRegion, configCompile);
|
||||
}
|
||||
|
||||
List<StrRegion> strRegionList = configCompile.getStrRegionList();
|
||||
for (StrRegion strRegion : strRegionList) {
|
||||
if (strRegion.getDistrict() == null || strRegion.getDistrict().trim().equals("")) {
|
||||
validData(service, 14, compileId, strRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, strRegion,configCompile);
|
||||
validData(service, 14, compileId, strRegion.getRegionId(), redisDB, strRegion.getTableName(),
|
||||
maatXmlConfig, strRegion, configCompile);
|
||||
} else {
|
||||
validData(service, 15, compileId, strRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, strRegion,configCompile);
|
||||
validData(service, 15, compileId, strRegion.getRegionId(), redisDB, strRegion.getTableName(),
|
||||
maatXmlConfig, strRegion, configCompile);
|
||||
}
|
||||
}
|
||||
|
||||
List<DigestRegion> digestRegionList = configCompile.getDigestRegionList();
|
||||
for (DigestRegion digestRegion : digestRegionList) {
|
||||
validData(service, 16, compileId, digestRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, digestRegion,configCompile);
|
||||
validData(service, 16, compileId, digestRegion.getRegionId(), redisDB, digestRegion.getTableName(),
|
||||
maatXmlConfig, digestRegion, configCompile);
|
||||
}
|
||||
|
||||
List<IpRegion> ipClientRangeList = configCompile.getIpClientRangeList();
|
||||
for (IpRegion ipRegion : ipClientRangeList) {
|
||||
validData(service, 18, compileId, ipRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
ipRegion,configCompile);
|
||||
validData(service, 18, compileId, ipRegion.getRegionId(), redisDB, ipRegion.getTableName(),
|
||||
maatXmlConfig, ipRegion, configCompile);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void validData(Integer service, Integer type, Long compileId, Long id, Integer redisDb, String tableName,
|
||||
MaatXmlConfig maatXmlConfig, RedisTemplate<String, String> redisTemplate, Object obj,
|
||||
ConfigCompile configCompile) {
|
||||
MaatXmlConfig maatXmlConfig, Object obj, ConfigCompile configCompile) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
String[] valArr = null;
|
||||
String key = null;
|
||||
@@ -141,12 +138,12 @@ public class MaatTestServiceimpl {
|
||||
valList.add(valStr);
|
||||
}
|
||||
}
|
||||
String val = redisTemplate.opsForValue().get(key);
|
||||
String val = JedisUtils.get(key, redisDb);
|
||||
valArr = val.split("\\t");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sysoLog(valArr, valList, obj, redisDb, key, configCompile)) {
|
||||
if (sysoLog(valArr, valList, obj, redisDb, key, configCompile,service)) {
|
||||
FileUtils
|
||||
.addStrToFile(
|
||||
"\t" + sdf.format(new Date()) + " 编译配置id为" + compileId + "的配置中,在" + redisDb + "号redis库中key="
|
||||
@@ -156,7 +153,26 @@ public class MaatTestServiceimpl {
|
||||
}
|
||||
|
||||
private boolean sysoLog(String[] valArr, List<String> valList, Object obj, Integer redisDb, String key,
|
||||
ConfigCompile configCompile) {
|
||||
ConfigCompile configCompile,Integer service) {
|
||||
|
||||
if (valList == null || valList.size() == 0) {
|
||||
FileUtils.addStrToFile(
|
||||
"\t" + sdf.format(new Date()) + " error:service="+service +"时拼接value属性名,value表达式为空请检查\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
return false;
|
||||
}
|
||||
if (valArr == null || valArr.length == 0) {
|
||||
FileUtils.addStrToFile(
|
||||
"\t" + sdf.format(new Date()) + " error:service="+service +"时拼接value值错误,value数组为空\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
return false;
|
||||
}
|
||||
if (valList == null || key.trim().equals("")) {
|
||||
FileUtils.addStrToFile(
|
||||
"\t" + sdf.format(new Date()) + " error:service="+service +"时拼接key=null请检查\n",
|
||||
Configurations.getStringProperty("maatTestLogPath", ""), true);
|
||||
return false;
|
||||
}
|
||||
boolean bool = true;
|
||||
for (int i = 0; i < valList.size(); i++) {
|
||||
String attrName = valList.get(i);
|
||||
@@ -165,9 +181,9 @@ public class MaatTestServiceimpl {
|
||||
String beanVal = null;
|
||||
if (filedName.toLowerCase().equals("service") || filedName.toLowerCase().equals("action")
|
||||
|| filedName.toLowerCase().equals("userregion")) {
|
||||
beanVal=getFieldValueByFieldName(filedName, configCompile);
|
||||
}else {
|
||||
beanVal=getFieldValueByFieldName(filedName, obj);
|
||||
beanVal = getFieldValueByFieldName(filedName, configCompile);
|
||||
} else {
|
||||
beanVal = getFieldValueByFieldName(filedName, obj);
|
||||
}
|
||||
String redisVal = valArr[i];
|
||||
if (!beanVal.trim().equals(redisVal.trim())) {
|
||||
|
||||
Reference in New Issue
Block a user