dev-discount
袁野 3 years ago
parent f3987bc6f9
commit 5ebec0977e
  1. 23
      hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java
  2. 5
      hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java

@ -3,6 +3,7 @@ package com.bweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.ResponseData;
import com.hai.service.HighGoldRecService;
@ -41,16 +42,19 @@ public class HighGoldRecController {
@ApiOperation(value = "获取金币情况")
public ResponseData getGoldRecList(@RequestParam(name = "goldType", required = false) Integer goldType,
@RequestParam(name = "resType", required = false) Integer resType,
@RequestParam(name = "createTimeS", required = false) String createTimeS,
@RequestParam(name = "createTimeE", required = false) String createTimeE,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String, Object> map = new HashMap<>();
map.put("goldType", goldType);
map.put("resType", resType);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
if (createTimeS != null) {
map.put("createTimeS", DateUtil.long2Date(createTimeS));
map.put("createTimeE", DateUtil.long2Date(createTimeE));
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highGoldRecService.getGoldRec(map)));
@ -66,15 +70,16 @@ public class HighGoldRecController {
@ApiOperation(value = "获取金币统计")
public ResponseData queryGold(@RequestParam(name = "goldType", required = false) Integer goldType,
@RequestParam(name = "resType", required = false) Integer resType,
@RequestParam(name = "createTimeS", required = false) String createTimeS,
@RequestParam(name = "createTimeE", required = false) String createTimeE) {
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE) {
try {
Map<String, Object> map = new HashMap<>();
map.put("goldType", goldType);
map.put("resType", resType);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
if (createTimeS != null) {
map.put("createTimeS", DateUtil.long2Date(createTimeS));
map.put("createTimeE", DateUtil.long2Date(createTimeE));
}
return ResponseMsgUtil.success(highGoldRecService.queryGold(map));
} catch (Exception e) {

@ -50,10 +50,6 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
criteria.andResTypeEqualTo(MapUtils.getInteger(map, "resType"));
}
if (MapUtils.getString(map, "createTimeS") != null) {
criteria.andCreateTimeBetween(DateUtil.format("yyyy-MM-dd" , MapUtils.getString(map, "createTimeS")) , DateUtil.format("yyyy-MM-dd" , MapUtils.getString(map, "createTimE")));
}
example.setOrderByClause("create_time desc");
List<HighGoldRec> list = highGoldRecMapper.selectByExample(example);
for (HighGoldRec highGoldRec : list) {
@ -64,6 +60,7 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
@Override
public List<Map<Long, Long>> queryGold(Map<String, Object> map) {
return highGoldRecMapper.queryGold(map);
}
}

Loading…
Cancel
Save