dev-discount
袁野 3 years ago
parent 5b509e5105
commit 1b8d15a045
  1. 1
      hai-bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 29
      hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java
  3. 18
      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. 11
      hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java

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

@ -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<String, Object> 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<String, Object> 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);
}
}
}

@ -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 {
@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 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;
}
}

@ -26,4 +26,14 @@ public interface HighGoldRecService {
* @Date 2021/3/27 10:03
**/
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;
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<HighGoldRec> list = highGoldRecMapper.selectByExample(example);
for (HighGoldRec highGoldRec : list) {
@ -55,4 +61,9 @@ public class HighGoldRecServiceImpl implements HighGoldRecService {
}
return list;
}
@Override
public List<Map<Long, Long>> queryGold(Map<String, Object> map) {
return highGoldRecMapper.queryGold(map);
}
}

Loading…
Cancel
Save