From f44cf3eb71584b89d37dd885bcbb410332451566 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 28 Sep 2021 22:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighActivityInfoController.java | 3 ++- .../com/bweb/controller/HighGoldRecController.java | 13 +++++++------ hai-cweb/src/main/resources/pre/application.yml | 2 +- .../hai/service/impl/HighGoldRecServiceImpl.java | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighActivityInfoController.java b/hai-bweb/src/main/java/com/bweb/controller/HighActivityInfoController.java index 56182747..7cbd8ba7 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighActivityInfoController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighActivityInfoController.java @@ -41,6 +41,7 @@ import java.util.*; @Controller @RequestMapping(value = "/activity") @Api(value = "活动业务接口") + public class HighActivityInfoController { private static Logger log = LoggerFactory.getLogger(HighActivityInfoController.class); @@ -196,7 +197,7 @@ public class HighActivityInfoController { @RequestMapping(value = "/getList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询活动列表") - public ResponseData getList(@RequestParam(value = "title", required = false) Integer title, + public ResponseData getList(@RequestParam(value = "title", required = false) String title, @RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "pageNum", required = true) Integer pageNum, diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java index c3b07bad..ffd49a79 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java @@ -9,6 +9,7 @@ import com.hai.model.ResponseData; import com.hai.service.HighGoldRecService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -50,11 +52,9 @@ public class HighGoldRecController { Map 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))); @@ -77,8 +77,9 @@ public class HighGoldRecController { map.put("goldType", goldType); map.put("resType", resType); if (createTimeS != null) { - map.put("createTimeS", DateUtil.long2Date(createTimeS)); - map.put("createTimeE", DateUtil.long2Date(createTimeE)); + map.put("createTimeS", DateUtil.date2String(new Date(createTimeS), "yyyy-MM-dd")); + map.put("createTimeE", DateUtil.date2String(new Date(createTimeE), "yyyy-MM-dd")); + } return ResponseMsgUtil.success(highGoldRecService.queryGold(map)); diff --git a/hai-cweb/src/main/resources/pre/application.yml b/hai-cweb/src/main/resources/pre/application.yml index d21a5106..a6ff5a1c 100644 --- a/hai-cweb/src/main/resources/pre/application.yml +++ b/hai-cweb/src/main/resources/pre/application.yml @@ -9,7 +9,7 @@ debug: false #datasource数据源设置 spring: datasource: - url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + z username: root password: HF123456. type: com.alibaba.druid.pool.DruidDataSource diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java index 558c7c21..a425cc94 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java @@ -10,6 +10,7 @@ import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.Map; @@ -50,6 +51,10 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { criteria.andResTypeEqualTo(MapUtils.getInteger(map, "resType")); } + if (MapUtils.getLong(map , "createTimeS") != null) { + criteria.andCreateTimeBetween(new Date(MapUtils.getLong(map , "createTimeS")) , new Date(MapUtils.getLong(map , "createTimeE"))); + } + example.setOrderByClause("create_time desc"); List list = highGoldRecMapper.selectByExample(example); for (HighGoldRec highGoldRec : list) {