Authored by 胡古飞

屏蔽逻辑优化

... ... @@ -28,7 +28,8 @@ public class ForbiddenBrandsController {
testResult.put("code", 200);
testResult.put("message", "success");
} catch (Exception e) {
testResult.put("code", 400);
e.printStackTrace();
testResult.put("code", 400);
testResult.put("message", e.getMessage());
}
return testResult;
... ...
... ... @@ -52,7 +52,9 @@ public class ForbidenSortBrandLogicService {
if (forbiddenSortBrandsMap != null) {
return;
}
forbiddenSortBrandsMap = new HashMap<String, List<Integer>>();
List<ForbiddenSortBrand> forbiddenSortBrands = this.getForbiddenSortBrandList();
System.out.println("total forbiddenSortBrands size is " + forbiddenSortBrands.size());
for (ForbiddenSortBrand forbiddenSortBrand : forbiddenSortBrands) {
String key = this.getKey(forbiddenSortBrand.getMaxSortId(), forbiddenSortBrand.getMiddleSortId(), forbiddenSortBrand.getSmallSortId());
List<Integer> brandIds = forbiddenSortBrandsMap.get(key);
... ... @@ -62,8 +64,7 @@ public class ForbidenSortBrandLogicService {
}
brandIds.add(forbiddenSortBrand.getBrandId());
}
// remove from db
//remove from db
forbiddenSortBrandMapper.deleteAll();
long begin = System.currentTimeMillis();
logger.info("deleteAll forbiddenSortBrand success [cost={}]", (System.currentTimeMillis() - begin));
... ... @@ -194,7 +195,8 @@ public class ForbidenSortBrandLogicService {
long time = System.currentTimeMillis() / 1000L;
forbiddenSortBrand.setCreateTime((int) time);
results.add(forbiddenSortBrand);
transferResult.append(maxSortId).append("-").append(middleSortId).append("-").append(smallSortId).append("-").append(brandId).append(LINE_SEPARATOR);
String result = new StringBuilder(maxSortId+":"+contents[0] + "-").append(middleSortId+":"+contents[1] + "-").append(smallSortId+":"+contents[2]+ "-").append(brandId+":"+contents[3]).toString();
transferResult.append(result).append(LINE_SEPARATOR);
}
}
// 7、拼接数据
... ...
This diff could not be displayed because it is too large.