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 4386b1b8..c3b07bad 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.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; @@ -33,9 +34,6 @@ public class HighGoldRecController { private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class); - @Autowired - private UserCenter userCenter; - @Resource private HighGoldRecService highGoldRecService; @@ -44,6 +42,8 @@ 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) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize) { try { @@ -51,6 +51,11 @@ 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)); + } + PageHelper.startPage(pageNum,pageSize); return ResponseMsgUtil.success(new PageInfo<>(highGoldRecService.getGoldRec(map))); @@ -60,4 +65,27 @@ 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) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE) { + try { + Map map = new HashMap<>(); + map.put("goldType", goldType); + map.put("resType", resType); + if (createTimeS != null) { + map.put("createTimeS", DateUtil.long2Date(createTimeS)); + map.put("createTimeE", DateUtil.long2Date(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..558c7c21 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")); } @@ -55,4 +57,10 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { } return list; } + + @Override + public List> queryGold(Map map) { + + return highGoldRecMapper.queryGold(map); + } }