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

Commit 06f2f0ce authored by jiangxiulong's avatar jiangxiulong

time

parent 4a026b20
...@@ -2,7 +2,6 @@ package com.liquidnet.service.kylin.controller; ...@@ -2,7 +2,6 @@ package com.liquidnet.service.kylin.controller;
import com.liquidnet.service.ResponseDto; import com.liquidnet.service.ResponseDto;
import com.liquidnet.service.kylin.dto.param.PerformanceCreateParam;
import com.liquidnet.service.kylin.service.impl.KylinPerformancesServiceImpl; import com.liquidnet.service.kylin.service.impl.KylinPerformancesServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
/** /**
* <p> * <p>
...@@ -35,6 +33,7 @@ public class KylinPerformancesController { ...@@ -35,6 +33,7 @@ public class KylinPerformancesController {
@GetMapping("localList") @GetMapping("localList")
@ApiOperation("本地演出列表") @ApiOperation("本地演出列表")
public ResponseDto<HashMap<String, Object>> localList( public ResponseDto<HashMap<String, Object>> localList(
@RequestParam(value = "sellTime", defaultValue = "") String sellTime, //开票时间
@RequestParam(value = "title", defaultValue = "") String title, //演出名称 @RequestParam(value = "title", defaultValue = "") String title, //演出名称
@RequestParam(value = "cityId", defaultValue = "") String cityId, //省份id @RequestParam(value = "cityId", defaultValue = "") String cityId, //省份id
@RequestParam(value = "type", defaultValue = "") Integer type, //演出类型 @RequestParam(value = "type", defaultValue = "") Integer type, //演出类型
...@@ -44,7 +43,7 @@ public class KylinPerformancesController { ...@@ -44,7 +43,7 @@ public class KylinPerformancesController {
// 排序 // 排序
@RequestParam(value = "SortType", defaultValue = "1") Integer SortType // 1时间正序 2时间倒序 @RequestParam(value = "SortType", defaultValue = "1") Integer SortType // 1时间正序 2时间倒序
) { ) {
HashMap<String, Object> result = kylinPerformancesService.localList(title, cityId, type, page, size, SortType); HashMap<String, Object> result = kylinPerformancesService.localList(sellTime, title, cityId, type, page, size, SortType);
if (result.size() > 0) { if (result.size() > 0) {
return ResponseDto.success(result); return ResponseDto.success(result);
} else { } else {
......
...@@ -36,7 +36,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -36,7 +36,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
@Autowired @Autowired
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
public HashMap<String, Object> localList(String title, String cityId, Integer type, Integer page, Integer size, Integer SortType) { public HashMap<String, Object> localList(String sellTime, String title, String cityId, Integer type, Integer page, Integer size, Integer SortType) {
HashMap<String,Object> info = new HashMap<>(); HashMap<String,Object> info = new HashMap<>();
// 排序 分页 // 排序 分页
...@@ -69,8 +69,13 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -69,8 +69,13 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
queryObject.put("type", type); queryObject.put("type", type);
} }
// 固定查询条件
Query query = new BasicQuery(queryObject); Query query = new BasicQuery(queryObject);
if (!sellTime.isEmpty()) {
String sellTimeEnd = sellTime + " 23:59:59";
query.addCriteria(Criteria.where("stopSellTime").gte(sellTime).lte(sellTimeEnd));
}
// 固定查询条件
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
String nowTimeStr = nowTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); String nowTimeStr = nowTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
query.addCriteria(Criteria.where("stopSellTime").gte(nowTimeStr)); query.addCriteria(Criteria.where("stopSellTime").gte(nowTimeStr));
......
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