记得上下班打卡 | git大法好,push需谨慎

Commit 8cc523c0 authored by jiangxiulong's avatar jiangxiulong

演出本地列表 日历*2 城市名称搜索改成adcode

parent bde846fe
package com.liquidnet.service.kylin.constant; package com.liquidnet.service.kylin.constant;
import rx.Completable;
public class KylinRedisConst { public class KylinRedisConst {
public static final String FIELDS = "kylin:fields:id"; public static final String FIELDS = "kylin:fields:id";
public static final String PERFORMANCES = "kylin:performances:id:"; public static final String PERFORMANCES = "kylin:performances:id:";
public static final String PERFORMANCES_TRUE_NAME = "kylin:performances_true_name:id:"; public static final String PERFORMANCES_TRUE_NAME = "kylin:performances_true_name:id:";
public static final String PERFORMANCES_LIST_CITYNAME = "kylin:performances:cityName:"; public static final String PERFORMANCES_LIST_CITYNAME = "kylin:performances:cityName:";
public static final String PERFORMANCES_LIST_CITY = "kylin:performances:city:";
public static final String PERFORMANCES_LIST_SYSTEM_RECOMMEND = "kylin:performances:systemRecommend"; public static final String PERFORMANCES_LIST_SYSTEM_RECOMMEND = "kylin:performances:systemRecommend";
public static final String PERFORMANCES_LIST_NOTICE = "kylin:performances:notice"; public static final String PERFORMANCES_LIST_NOTICE = "kylin:performances:notice";
public static final String PERFORMANCES_LIST_RECOMMEND = "kylin:performances:recommend"; public static final String PERFORMANCES_LIST_RECOMMEND = "kylin:performances:recommend";
......
...@@ -207,6 +207,7 @@ public class DataUtils { ...@@ -207,6 +207,7 @@ public class DataUtils {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表 // 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY + vo.getCityId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_RECOMMEND);
......
...@@ -47,7 +47,8 @@ public class KylinPerformancesController { ...@@ -47,7 +47,8 @@ public class KylinPerformancesController {
@GetMapping("localList") @GetMapping("localList")
@ApiOperation("本地演出列表") @ApiOperation("本地演出列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code"),
@ApiImplicitParam(type = "query", dataType = "int", name = "days", value = "时间范围 几天 今天1 三天3。。。"), @ApiImplicitParam(type = "query", dataType = "int", name = "days", value = "时间范围 几天 今天1 三天3。。。"),
@ApiImplicitParam(type = "query", dataType = "int", name = "type", value = "演出类型 101音乐节 102小型演出(livehouse演出) 103巡演 演出类型只有这几个了"), @ApiImplicitParam(type = "query", dataType = "int", name = "type", value = "演出类型 101音乐节 102小型演出(livehouse演出) 103巡演 演出类型只有这几个了"),
...@@ -60,6 +61,7 @@ public class KylinPerformancesController { ...@@ -60,6 +61,7 @@ public class KylinPerformancesController {
}) })
public ResponseDto<HashMap<String, Object>> localList( public ResponseDto<HashMap<String, Object>> localList(
@RequestParam(defaultValue = "") String cityName, @RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode,
@RequestParam(defaultValue = "0") int days, @RequestParam(defaultValue = "0") int days,
@RequestParam(defaultValue = "0") int type, @RequestParam(defaultValue = "0") int type,
...@@ -72,7 +74,7 @@ public class KylinPerformancesController { ...@@ -72,7 +74,7 @@ public class KylinPerformancesController {
@RequestParam(defaultValue = "") String sort @RequestParam(defaultValue = "") String sort
) { ) {
HashMap<String, Object> result = kylinPerformancesService.localList( HashMap<String, Object> result = kylinPerformancesService.localList(
days, cityName, type, days, cityName, adCode, type,
isDiscount, isAdvance, isExclusive, isDiscount, isAdvance, isExclusive,
orderBy, sort orderBy, sort
); );
...@@ -124,12 +126,17 @@ public class KylinPerformancesController { ...@@ -124,12 +126,17 @@ public class KylinPerformancesController {
@ApiOperation("演出日历") @ApiOperation("演出日历")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "yearMonth", value = "年月 2021-01", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "yearMonth", value = "年月 2021-01", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true) @ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code")
}) })
public ResponseDto<List> performanceCalendar(@RequestParam String yearMonth, @RequestParam String cityName) { public ResponseDto<List> performanceCalendar(
@RequestParam String yearMonth,
@RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode
) {
List result = CollectionUtil.arrayListString(); List result = CollectionUtil.arrayListString();
try { try {
result = kylinPerformancesService.performanceCalendar(yearMonth, cityName); result = kylinPerformancesService.performanceCalendar(yearMonth, cityName, adCode);
} catch (Exception e) { } catch (Exception e) {
log.error("kylinCalendarError", e); log.error("kylinCalendarError", e);
} }
...@@ -140,11 +147,16 @@ public class KylinPerformancesController { ...@@ -140,11 +147,16 @@ public class KylinPerformancesController {
@ApiOperation("演出日历-演出列表") @ApiOperation("演出日历-演出列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "yearMonthDay", value = "年月日 2021-01-01", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "yearMonthDay", value = "年月日 2021-01-01", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称", required = true) @ApiImplicitParam(type = "query", dataType = "String", name = "cityName", value = "城市名称"),
@ApiImplicitParam(type = "query", dataType = "String", name = "adCode", value = "城市code")
}) })
public ResponseDto<List> calendarPerformances(@RequestParam String yearMonthDay, @RequestParam String cityName) { public ResponseDto<List> calendarPerformances(
@RequestParam String yearMonthDay,
@RequestParam(defaultValue = "") String cityName,
@RequestParam(defaultValue = "") String adCode
) {
List result = null; List result = null;
result = kylinPerformancesService.calendarPerformances(yearMonthDay, cityName); result = kylinPerformancesService.calendarPerformances(yearMonthDay, cityName, adCode);
return ResponseDto.success(result); return ResponseDto.success(result);
} }
......
...@@ -60,11 +60,11 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService { ...@@ -60,11 +60,11 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
private QueueUtils queueUtils; private QueueUtils queueUtils;
public HashMap<String, Object> localList( public HashMap<String, Object> localList(
int days, String cityName, int type, int days, String cityName, String adCode, int type,
Integer isDiscount, Integer isAdvance, Integer isExclusive, Integer isDiscount, Integer isAdvance, Integer isExclusive,
String orderBy, String sort String orderBy, String sort
) { ) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName); List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
// 是否启用推荐 // 是否启用推荐
Integer isRecommend = 1; Integer isRecommend = 1;
...@@ -284,8 +284,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService { ...@@ -284,8 +284,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return performanceList; return performanceList;
} }
public List performanceCalendar(String yearMonth, String cityName) { public List performanceCalendar(String yearMonth, String cityName, String adCode) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName); List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
// 获取此月开始结束时间 // 获取此月开始结束时间
String[] split = yearMonth.split("-"); String[] split = yearMonth.split("-");
...@@ -312,8 +312,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService { ...@@ -312,8 +312,8 @@ public class KylinPerformancesServiceImpl implements IKylinPerformancesService {
return newList; return newList;
} }
public List calendarPerformances(String yearMonthDay, String cityName) { public List calendarPerformances(String yearMonthDay, String cityName, String adCode) {
List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityName(cityName); List<KylinPerformanceVo> performancesList = dataUtils.getPerformancesListOfcityNameOradCode(cityName, adCode);
String yearMonthDayStart = yearMonthDay.concat(" 00:00:00"); String yearMonthDayStart = yearMonthDay.concat(" 00:00:00");
String yearMonthDayEnd = yearMonthDay.concat(" 23:59:59"); String yearMonthDayEnd = yearMonthDay.concat(" 23:59:59");
......
...@@ -293,16 +293,25 @@ public class DataUtils { ...@@ -293,16 +293,25 @@ public class DataUtils {
* *
* @param cityName * @param cityName
*/ */
public List<KylinPerformanceVo> getPerformancesListOfcityName(String cityName) { public List<KylinPerformanceVo> getPerformancesListOfcityNameOradCode(String cityName, String adCode) {
String redisKey = KylinRedisConst.PERFORMANCES_LIST_CITYNAME.concat(cityName); String redisKey = "";
if (cityName.isEmpty()) {
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITY.concat(adCode);
} else {
redisKey = KylinRedisConst.PERFORMANCES_LIST_CITYNAME.concat(cityName);
}
Object object = redisUtil.get(redisKey); Object object = redisUtil.get(redisKey);
if (object == null) { if (object == null) {
// 固定查询条件 // 固定查询条件
Query query = getCommonWhere(); Query query = getCommonWhere();
// 其他条件 // 其他条件
if (cityName.isEmpty()) {
query.addCriteria(Criteria.where("cityId").is(adCode));
} else {
Pattern cityNameCompile = Pattern.compile("^.*" + cityName + ".*$", Pattern.CASE_INSENSITIVE); Pattern cityNameCompile = Pattern.compile("^.*" + cityName + ".*$", Pattern.CASE_INSENSITIVE);
query.addCriteria(Criteria.where("cityName").regex(cityNameCompile)); query.addCriteria(Criteria.where("cityName").regex(cityNameCompile));
}
// 排序 // 排序
Sort sortName = Sort.by(Sort.Direction.ASC, "timeStart"); Sort sortName = Sort.by(Sort.Direction.ASC, "timeStart");
query.with(sortName); query.with(sortName);
......
...@@ -239,6 +239,7 @@ public class DataUtils { ...@@ -239,6 +239,7 @@ public class DataUtils {
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES + performanceIds);
// 大龙相关 演出列表 // 大龙相关 演出列表
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITYNAME + vo.getCityName());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_CITY + vo.getCityId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId()); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_ROADLIST + vo.getRoadShowId());
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_SYSTEM_RECOMMEND);
redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_RECOMMEND); redisDataSourceUtil.getRedisKylinUtil().del(KylinRedisConst.PERFORMANCES_LIST_RECOMMEND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment