1、对比release1.1和develop分支的配置文件,将未合并部分手动添加到develop;
2、修改分组复用传给redis接口数据的结构
This commit is contained in:
@@ -376,7 +376,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/groupReuseSources", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "分组复用域配置新增接口", httpMethod = "POST", response = Map.class, notes = "接收分组复用域配置,增加到对应的分组中")
|
||||
@ApiParam(value = "分组复用域配置对象", name = "configSource", required = true)
|
||||
@ApiParam(value = "分组复用域配置对象", name = "groupReuseSource", required = true)
|
||||
public Map addGroupReuseSources(@RequestBody GroupReuseSource groupReuseSource, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
|
||||
@@ -419,7 +419,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/groupReuseSources", method = RequestMethod.PUT)
|
||||
@ApiOperation(value = "分组复用域配置删除接口", httpMethod = "PUT", response = Map.class, notes = "接收分组复用域配置,并从对应分组中删除")
|
||||
@ApiParam(value = "分组复用域配置对象", name = "configSource", required = true)
|
||||
@ApiParam(value = "分组复用域配置对象", name = "groupReuseSource", required = true)
|
||||
public Map delGroupReuseSources(@RequestBody GroupReuseSource groupReuseSource, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
@@ -477,7 +477,11 @@
|
||||
<result column="d_subscribe_id" jdbcType="VARCHAR" property="dSubscribeId" />
|
||||
<result column="scene_file" jdbcType="VARCHAR" property="sceneFile" />
|
||||
|
||||
<result column="app_label" jdbcType="VARCHAR" property="appLabel" />
|
||||
<result column="label_proto_id" jdbcType="INTEGER" property="labelProtoId" />
|
||||
<result column="label_os_id" jdbcType="INTEGER" property="labelOsId" />
|
||||
<result column="label_bs_id" jdbcType="INTEGER" property="labelBsId" />
|
||||
<result column="label_behav_id" jdbcType="INTEGER" property="labelBehavId" />
|
||||
<result column="label_app_id" jdbcType="INTEGER" property="labelAppId" />
|
||||
<result column="c2s_pkt_num" jdbcType="VARCHAR" property="c2sPktNum" />
|
||||
<result column="s2c_pkt_num" jdbcType="VARCHAR" property="s2cPktNum" />
|
||||
<result column="c2s_byte_num" jdbcType="VARCHAR" property="c2sByteNum" />
|
||||
|
||||
@@ -904,72 +904,69 @@ public class ConfigSourcesService extends BaseService {
|
||||
*/
|
||||
public void deleteGroupReuseSources(AuditLogThread thread, long start, List<GroupReuse> groupReuseList, Date opTime,
|
||||
StringBuffer sb) throws Exception {
|
||||
// 按service分类
|
||||
Map<Integer, List<MaatConfig>> maatMap = new HashMap<Integer, List<MaatConfig>>();
|
||||
|
||||
GroupReuseVal.valGroupReuse(groupReuseList, false);
|
||||
// 按service分类 Map<service,Map<groupId,List<"tableName,regionId">>
|
||||
Map<Integer, Map<Long, List<String>>> reuseMap = new HashMap<Integer, Map<Long,List<String>>>();
|
||||
|
||||
for (GroupReuse groupReuse : groupReuseList) {
|
||||
// 验证格式
|
||||
checkGroupReuseForUpdate(groupReuse);
|
||||
|
||||
Integer service = groupReuse.getService();
|
||||
MaatConfig maatConfig = new MaatConfig();
|
||||
maatConfig.setService(service);
|
||||
List<Map<String, String>> dstMaplList = null;
|
||||
|
||||
if (!reuseMap.containsKey(service)) {
|
||||
Map<Long, List<String>> map = new HashMap<Long, List<String>>();
|
||||
reuseMap.put(service, map);
|
||||
}
|
||||
|
||||
// 字符串域
|
||||
List<Map<String, String>> strongMapList = null;
|
||||
if (!StringUtil.isEmpty(groupReuse.getStrRegionList())) {
|
||||
dstMaplList = new ArrayList<Map<String, String>>();
|
||||
for (StrRegion region : groupReuse.getStrRegionList()) {
|
||||
if (StringUtil.isEmpty(region.getDistrict())) {
|
||||
dstMaplList.add(convertObjectToMap(region, StrRegion.class));
|
||||
} else {
|
||||
if (StringUtil.isEmpty(strongMapList)) {
|
||||
strongMapList = new ArrayList<Map<String, String>>();
|
||||
}
|
||||
strongMapList.add(convertObjectToMap(region, StrRegion.class));
|
||||
if (reuseMap.get(service).containsKey(region.getGroupId())) {
|
||||
reuseMap.get(service).get(region.getGroupId()).add(region.getTableName()+","+region.getRegionId());
|
||||
}else{
|
||||
Map<Long, List<String>> groupMap = new HashMap<Long, List<String>>();
|
||||
List<String> regionList = new ArrayList<String>();
|
||||
regionList.add(region.getTableName()+","+region.getRegionId());
|
||||
groupMap.put(region.getGroupId(), regionList);
|
||||
}
|
||||
}
|
||||
}
|
||||
maatConfig.setStrRegionMapList(dstMaplList);
|
||||
// 增强字符串域
|
||||
if (!StringUtil.isEmpty(strongMapList) && strongMapList.size() > 0) {
|
||||
maatConfig.setStrStrRegionMapList((strongMapList));
|
||||
}
|
||||
|
||||
// 数值域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(groupReuse.getNumRegionList())) {
|
||||
dstMaplList = new ArrayList<Map<String, String>>();
|
||||
for (NumRegion region : groupReuse.getNumRegionList()) {
|
||||
dstMaplList.add(convertObjectToMap(region, NumRegion.class));
|
||||
if (reuseMap.get(service).containsKey(region.getGroupId())) {
|
||||
reuseMap.get(service).get(region.getGroupId()).add(region.getTableName()+","+region.getRegionId());
|
||||
}else{
|
||||
Map<Long, List<String>> groupMap = new HashMap<Long, List<String>>();
|
||||
List<String> regionList = new ArrayList<String>();
|
||||
regionList.add(region.getTableName()+","+region.getRegionId());
|
||||
groupMap.put(region.getGroupId(), regionList);
|
||||
}
|
||||
}
|
||||
}
|
||||
maatConfig.setNumRegionMapList(dstMaplList);
|
||||
|
||||
// Ip域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(groupReuse.getIpRegionList())) {
|
||||
dstMaplList = new ArrayList<Map<String, String>>();
|
||||
for (IpRegion region : groupReuse.getIpRegionList()) {
|
||||
dstMaplList.add(convertObjectToMap(region, IpRegion.class));
|
||||
if (reuseMap.get(service).containsKey(region.getGroupId())) {
|
||||
reuseMap.get(service).get(region.getGroupId()).add(region.getTableName()+","+region.getRegionId());
|
||||
}else{
|
||||
Map<Long, List<String>> groupMap = new HashMap<Long, List<String>>();
|
||||
List<String> regionList = new ArrayList<String>();
|
||||
regionList.add(region.getTableName()+","+region.getRegionId());
|
||||
groupMap.put(region.getGroupId(), regionList);
|
||||
reuseMap.put(service, groupMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
maatConfig.setIpRegionMapList(dstMaplList);
|
||||
|
||||
if (maatMap.containsKey(service)) {
|
||||
maatMap.get(service).add(maatConfig);
|
||||
} else {
|
||||
List<MaatConfig> maatCfgList = new ArrayList<MaatConfig>();
|
||||
maatCfgList.add(maatConfig);
|
||||
maatMap.put(service, maatCfgList);
|
||||
}
|
||||
}
|
||||
logger.info("调用接口删除Redis中分组复用的域配置接口");
|
||||
// 所有的都删除成功返回true
|
||||
if (!configRedisService.delGroupReuseConfig(maatMap)) {
|
||||
throw new ServiceRuntimeException("删除分组利用域配置时出现异常,具体原因不详,请联系管理员",
|
||||
RestBusinessCode.service_runtime_error.getValue());
|
||||
}
|
||||
// if (!configRedisService.delGroupReuseConfig(reuseMap)) {
|
||||
// throw new ServiceRuntimeException("删除分组利用域配置时出现异常,具体原因不详,请联系管理员",
|
||||
// RestBusinessCode.service_runtime_error.getValue());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1048,7 +1045,7 @@ public class ConfigSourcesService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasRegionFlag) {
|
||||
if (!hasRegionFlag) {
|
||||
// 所有的域类型都不包括,可能是配置文件配错了
|
||||
throw new ServiceRuntimeException(
|
||||
"service为" + config.getService() + "的" + RestBusinessCode.ReuseRegionIsNull.getErrorReason(),
|
||||
|
||||
Reference in New Issue
Block a user