diff --git a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java index 3e876b46..b359904b 100644 --- a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -96,6 +96,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/telApi/*") .excludePathPatterns("/coupon/getGuizhouSinopec") .excludePathPatterns("/cmsContent/get*") + .excludePathPatterns("/highGoldRec/*") ; } 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 7964a4d3..9b8fe55a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java @@ -36,9 +36,6 @@ public class HighGoldRecController { private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class); - @Autowired - private UserCenter userCenter; - @Resource private HighGoldRecService highGoldRecService; @@ -47,12 +44,16 @@ 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 = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { Map map = new HashMap<>(); map.put("goldType", goldType); map.put("resType", resType); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(highGoldRecService.getGoldRec(map))); @@ -63,4 +64,26 @@ public class HighGoldRecController { } } + @RequestMapping(value="/queryGold",method = RequestMethod.GET) + @ResponseBody + @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) { + try { + Map map = new HashMap<>(); + map.put("goldType", goldType); + map.put("resType", resType); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + + return ResponseMsgUtil.success(highGoldRecService.queryGold(map)); + + } catch (Exception e) { + log.error("HighCouponController -> getCouponList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java index 059fbea1..c537735f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java @@ -1,7 +1,25 @@ package com.hai.dao; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + /** * mapper扩展类 */ public interface HighGoldRecMapperExt { -} \ No newline at end of file + @Select({""}) + // 查询申请记录 + List> queryGold(@Param("map") Map map); +} diff --git a/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java b/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java index 8dc82c06..dd52523d 100644 --- a/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java +++ b/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java @@ -6,6 +6,12 @@ public class HighGoldRecModel { private HighUser highUser; + // 收入 + private Long income; + + // 支出 + private Long expend; + public HighUser getHighUser() { return highUser; } @@ -13,4 +19,21 @@ public class HighGoldRecModel { public void setHighUser(HighUser highUser) { this.highUser = highUser; } + + + public Long getIncome() { + return income; + } + + public void setIncome(Long income) { + this.income = income; + } + + public Long getExpend() { + return expend; + } + + public void setExpend(Long expend) { + this.expend = expend; + } } diff --git a/hai-service/src/main/java/com/hai/service/HighGoldRecService.java b/hai-service/src/main/java/com/hai/service/HighGoldRecService.java index ae4369b7..a00fb801 100644 --- a/hai-service/src/main/java/com/hai/service/HighGoldRecService.java +++ b/hai-service/src/main/java/com/hai/service/HighGoldRecService.java @@ -26,4 +26,14 @@ public interface HighGoldRecService { * @Date 2021/3/27 10:03 **/ List getGoldRec(Map map); + + /** + * @Author Sum1Dream + * @name queryGold.java + * @Description // 查询金币使用统计 + * @Date 15:28 2021/9/22 + * @Param [map] + * @return java.util.Map + **/ + List > queryGold(Map map); } 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 bfe843a6..f2644c76 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 @@ -1,5 +1,6 @@ package com.hai.service.impl; +import com.hai.common.utils.DateUtil; import com.hai.dao.HighGoldRecMapper; import com.hai.entity.HighGoldRec; import com.hai.entity.HighGoldRecExample; @@ -36,6 +37,7 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { HighGoldRecExample example = new HighGoldRecExample(); HighGoldRecExample.Criteria criteria = example.createCriteria(); + if (MapUtils.getLong(map, "userId") != null) { criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); } @@ -48,6 +50,10 @@ 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 list = highGoldRecMapper.selectByExample(example); for (HighGoldRec highGoldRec : list) { @@ -55,4 +61,9 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { } return list; } + + @Override + public List> queryGold(Map map) { + return highGoldRecMapper.queryGold(map); + } }