|
|
@@ -72,10 +72,7 @@ public class FrontNewsController extends BaseController {
|
|
|
@ApiOperation("00 通关指南")
|
|
|
public TableDataInfo getMainList(@ApiParam(value = "省份 ", example = "湖南") @RequestParam(required = false) String location) {
|
|
|
BWwwNewsRef cond = new BWwwNewsRef();
|
|
|
- if(StringUtils.isBlank(location) && StringUtils.isBlank((location = VistorContextHolder.getLocation()))) {
|
|
|
- cond.setLocation("湖南");
|
|
|
- }
|
|
|
- cond.setLocation(location);
|
|
|
+ cond.setLocation(getLocation(location));
|
|
|
return getDataTable(newsRefService.selectBWwwNewsRefList(cond));
|
|
|
}
|
|
|
|
|
|
@@ -83,7 +80,7 @@ public class FrontNewsController extends BaseController {
|
|
|
@ApiOperation("00 通关指南免登陆")
|
|
|
public TableDataInfo getMainListNoToken(@ApiParam(value = "省份 ", example = "湖南") @RequestParam(required = false) String location) {
|
|
|
BWwwNewsRef cond = new BWwwNewsRef();
|
|
|
- cond.setLocation(StringUtils.isNotBlank(location) ? location : "湖南");
|
|
|
+ cond.setLocation(getLocation(location));
|
|
|
return getDataTable(newsRefService.selectBWwwNewsRefList(cond));
|
|
|
}
|
|
|
|
|
|
@@ -110,26 +107,23 @@ public class FrontNewsController extends BaseController {
|
|
|
@ApiParam(value = "省份 ", example = "湖南") @RequestParam(required = false) String location,
|
|
|
@ApiParam(value = "页数", example = "1") @RequestParam Integer pageNum,
|
|
|
@ApiParam(value = "页大小", example = "15") @RequestParam Integer pageSize) {
|
|
|
- if(StringUtils.isBlank(location)) {
|
|
|
- location = VistorContextHolder.getLocation();
|
|
|
- }
|
|
|
- return llist(ids,top,type,tag,title,location, pageNum,pageSize);
|
|
|
+ return llist(ids,top,type,tag,title,getLocation(location), pageNum,pageSize);
|
|
|
}
|
|
|
|
|
|
private TableDataInfo llist(String ids,Boolean top,String type, String tag,String title,String location, Integer pageNum,Integer pageSize){
|
|
|
- startPage();
|
|
|
BWwwNews exam = new BWwwNews();
|
|
|
exam.setIsTop(null==top?null:(top?1:0));
|
|
|
exam.setType(type);
|
|
|
exam.setTitle(title);
|
|
|
exam.setTag(StringUtils.trimToNull(tag));
|
|
|
- exam.setLocation(StringUtils.isNotBlank(location) ? location : "湖南");
|
|
|
+ exam.setLocation(getLocation(location));
|
|
|
if(StringUtils.isNotBlank(ids)){
|
|
|
String[] strArray = ids.split(",");
|
|
|
List<String> strList = new ArrayList<>(strArray.length);
|
|
|
Collections.addAll(strList, strArray);
|
|
|
exam.setIds(strList);
|
|
|
}
|
|
|
+ startPage();
|
|
|
List<BWwwNews> arr = newsService.selectBWwwNewsList(exam);
|
|
|
return getDataTable(arr);
|
|
|
}
|
|
|
@@ -141,7 +135,7 @@ public class FrontNewsController extends BaseController {
|
|
|
@ApiParam(value = "省份 ", example = "湖南") @RequestParam(required = false) String location,
|
|
|
@ApiParam(value = "页数", example = "1") Integer pageNum,
|
|
|
@ApiParam(value = "页大小", example = "15") Integer pageSize) {
|
|
|
- return llist(ids,top,type,tag,title,location, pageNum,pageSize);
|
|
|
+ return llist(ids,top,type,tag,title,getLocation(location), pageNum,pageSize);
|
|
|
}
|
|
|
|
|
|
@GetMapping("info")
|
|
|
@@ -163,4 +157,14 @@ public class FrontNewsController extends BaseController {
|
|
|
return AjaxResult.success(clicked);
|
|
|
}
|
|
|
|
|
|
+ private String getLocation(String location){
|
|
|
+ if(StringUtils.isBlank(location)) {
|
|
|
+ location = VistorContextHolder.getLocation();
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(location)) {
|
|
|
+ location = "湖南";
|
|
|
+ }
|
|
|
+ return location;
|
|
|
+ }
|
|
|
+
|
|
|
}
|