dev-discount
胡锐 3 years ago
commit c935a94a4e
  1. 1
      hai-bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 34
      hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java
  3. 20
      hai-service/src/main/java/com/hai/dao/HighGoldRecMapperExt.java
  4. 23
      hai-service/src/main/java/com/hai/model/HighGoldRecModel.java
  5. 10
      hai-service/src/main/java/com/hai/service/HighGoldRecService.java
  6. 8
      hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java

@ -96,6 +96,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/telApi/*") .excludePathPatterns("/telApi/*")
.excludePathPatterns("/coupon/getGuizhouSinopec") .excludePathPatterns("/coupon/getGuizhouSinopec")
.excludePathPatterns("/cmsContent/get*") .excludePathPatterns("/cmsContent/get*")
.excludePathPatterns("/highGoldRec/*")
; ;
} }

@ -3,6 +3,7 @@ package com.bweb.controller;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.security.UserCenter; import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.HighGoldRecService; import com.hai.service.HighGoldRecService;
@ -33,9 +34,6 @@ public class HighGoldRecController {
private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class); private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class);
@Autowired
private UserCenter userCenter;
@Resource @Resource
private HighGoldRecService highGoldRecService; private HighGoldRecService highGoldRecService;
@ -44,6 +42,8 @@ public class HighGoldRecController {
@ApiOperation(value = "获取金币情况") @ApiOperation(value = "获取金币情况")
public ResponseData getGoldRecList(@RequestParam(name = "goldType", required = false) Integer goldType, public ResponseData getGoldRecList(@RequestParam(name = "goldType", required = false) Integer goldType,
@RequestParam(name = "resType", required = false) Integer resType, @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 = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
@ -51,6 +51,11 @@ public class HighGoldRecController {
map.put("goldType", goldType); map.put("goldType", goldType);
map.put("resType", resType); map.put("resType", resType);
if (createTimeS != null) {
map.put("createTimeS", DateUtil.long2Date(createTimeS));
map.put("createTimeE", DateUtil.long2Date(createTimeE));
}
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highGoldRecService.getGoldRec(map))); 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<String, Object> 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);
}
}
} }

@ -1,7 +1,25 @@
package com.hai.dao; 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扩展类 * mapper扩展类
*/ */
public interface HighGoldRecMapperExt { public interface HighGoldRecMapperExt {
} @Select({"<script>" +
"SELECT" +
" gold_type , SUM(gold) AS sum FROM high_gold_rec" +
" WHERE" +
" 1 = 1" +
" <if test='map.createTimeS != null'> AND create_time BETWEEN '${map.createTimeS}' AND '${map.createTimeE}'</if> " +
" <if test='map.resType != null'> AND res_type = #{map.resType}</if> " +
" <if test='map.goldType != null'> AND gold_type = #{map.goldType}</if>" +
" GROUP BY gold_type" +
" </script>"})
// 查询申请记录
List<Map<Long,Long>> queryGold(@Param("map") Map<String,Object> map);
}

@ -6,6 +6,12 @@ public class HighGoldRecModel {
private HighUser highUser; private HighUser highUser;
// 收入
private Long income;
// 支出
private Long expend;
public HighUser getHighUser() { public HighUser getHighUser() {
return highUser; return highUser;
} }
@ -13,4 +19,21 @@ public class HighGoldRecModel {
public void setHighUser(HighUser highUser) { public void setHighUser(HighUser highUser) {
this.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;
}
} }

@ -26,4 +26,14 @@ public interface HighGoldRecService {
* @Date 2021/3/27 10:03 * @Date 2021/3/27 10:03
**/ **/
List<HighGoldRec> getGoldRec(Map<String, Object> map); List<HighGoldRec> getGoldRec(Map<String, Object> map);
/**
* @Author Sum1Dream
* @name queryGold.java
* @Description // 查询金币使用统计
* @Date 15:28 2021/9/22
* @Param [map]
* @return java.util.Map<java.lang.Long,java.lang.Long>
**/
List<Map<Long , Long> > queryGold(Map<String, Object> map);
} }

@ -1,5 +1,6 @@
package com.hai.service.impl; package com.hai.service.impl;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighGoldRecMapper; import com.hai.dao.HighGoldRecMapper;
import com.hai.entity.HighGoldRec; import com.hai.entity.HighGoldRec;
import com.hai.entity.HighGoldRecExample; import com.hai.entity.HighGoldRecExample;
@ -36,6 +37,7 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
HighGoldRecExample example = new HighGoldRecExample(); HighGoldRecExample example = new HighGoldRecExample();
HighGoldRecExample.Criteria criteria = example.createCriteria(); HighGoldRecExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) { if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
} }
@ -55,4 +57,10 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
} }
return list; return list;
} }
@Override
public List<Map<Long, Long>> queryGold(Map<String, Object> map) {
return highGoldRecMapper.queryGold(map);
}
} }

Loading…
Cancel
Save