From 799622ea4d37aa6bb9fee457967532aa93d18594 Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Sun, 21 Mar 2021 20:17:05 +0800 Subject: [PATCH] 扣除用户积分 --- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java | 85 ------------------------------------------ 1 files changed, 0 insertions(+), 85 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java index 5fc88e7..a18df97 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java @@ -1,23 +1,8 @@ package com.matrix.system.shopXcx.api.action; -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.component.redis.RedisUserLoginUtils; -import com.matrix.system.shopXcx.bean.ShopScoreExchange; -import com.matrix.system.shopXcx.bean.ShopScoreRecord; -import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; -import com.matrix.system.shopXcx.dao.ShopScoreRecordDao; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.List; /** * @description 用户积分控制器 @@ -29,76 +14,6 @@ @CrossOrigin(origins = "*", maxAge = 3600) public class WxShopScoreAction { - @Autowired - private ShopScoreRecordDao shopScoreRecordDao; - @Autowired - private ShopScoreExchangeDao shopScoreExchangeDao; - @Autowired - private RedisUserLoginUtils redisUserLoginUtils; - @Autowired - private BizUserService bizUserService; - - /** - * 查询我的获得积分列表 - * @return - */ - @RequestMapping(value = "/getRecordList") - @ResponseBody - public AjaxResult getRecordList(@RequestBody PaginationVO pageVo) { - - pageVo.setSort("create_time"); - pageVo.setOrder("desc"); - BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopScoreRecord params = new ShopScoreRecord(); - params.setBeneficiaryId(loginBizUser.getOpenId()); - List<ShopScoreRecord> dataList = shopScoreRecordDao.selectInPage(params, pageVo); - int total = shopScoreRecordDao.selectTotalRecord(params); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); - //查询用户总积分 - BizUser user = bizUserService.findById(loginBizUser.getUserId()); - Integer totalScore = 0; - if (user != null && user.getTotalScore() != null) { - totalScore = user.getTotalScore(); - } - result.putInMap("totalScore", totalScore); - //查询下级总人数 - BizUser peopleSumParams = new BizUser(); - peopleSumParams.setParentOpenId(loginBizUser.getOpenId()); - int peopleSum = bizUserService.findTotal(peopleSumParams); - result.putInMap("peopleSum", peopleSum); - return result; - } - - - /** - * 查询我的积分兑换列表 - * @return - */ - @RequestMapping(value = "/getChangeRecordList") - @ResponseBody - public AjaxResult getChangeRecordList(@RequestBody PaginationVO pageVo) { - - //不分页 - pageVo.setOffset(null); - pageVo.setLimit(null); - //按生成时间倒序排列 - pageVo.setSort("create_time"); - pageVo.setOrder("desc"); - BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); - ShopScoreExchange params = new ShopScoreExchange(); - params.setUserId(loginBizUser.getOpenId()); - List<ShopScoreExchange> dataList = shopScoreExchangeDao.selectInPage(params, pageVo); - int total = shopScoreExchangeDao.selectTotalRecord(params); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); - //查询用户当前积分 - BizUser user = bizUserService.findById(loginBizUser.getUserId()); - Integer currentScore = 0; - if (user != null && user.getCurrentScore() != null) { - currentScore = user.getCurrentScore(); - } - result.putInMap("currentScore", currentScore); - return result; - } } \ No newline at end of file -- Gitblit v1.9.1