silent 4 лет назад
Родитель
Сommit
9b4b74b048

+ 68 - 68
src/main/java/org/springblade/gateway/active_gateway/service/impl/AppActiveProductServiceImpl.java

@@ -80,73 +80,73 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 			throw new AppActiveProductException("活动已结束哦~");
 		}
 
-		//判断票数是否小于当前票数
-		Long voteCount = loginUser.getVoteCount();
-		Assert.notNull(voteCount,"用户没有票数");
-		Assert.notNull(activeHelpRecord.getVoteCount(),"投票数为空");
-		if(activeHelpRecord.getVoteCount()<1 || loginUser.getVoteCount()<activeHelpRecord.getVoteCount()){
-			throw new AppActiveProductException("用户所拥有的票数少于所投的票数");
-		}
-		//获取平台参数配置
-		ActiveSettingDto activeSetting = platformSettingUtil.getActiveSetting();
-		Assert.notNull(activeSetting,"平台没有配置投票参数");
-
-
-		//TODO 减去投票数
-		loginUser.setVoteCount(loginUser.getVoteCount()-activeHelpRecord.getVoteCount());
-
-		//判断是否普法积分
-		if(ObjectUtils.isNotEmpty(activeSetting.getVoteAndPointRate()) && !activeSetting.getVoteAndPointRate().equals(BigDecimal.ZERO)){
-			//修改普法积分(票数*积分比例+原有积分)
-			BigDecimal puFaPoint = activeSetting.getVoteAndPointRate()
-				.multiply(BigDecimal.valueOf(activeHelpRecord.getVoteCount()));
-			//添加普法积分赠送记录=>赠送给投票的用户
-			PointRecord pointRecord = new PointRecord();
-			pointRecord.setPoint(BigDecimal.valueOf(puFaPoint.doubleValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
-			pointRecord.setPointType(PointTypeEnum.PUFA_POINT_SEND);
-			pointRecord.setActiveProductId(activeHelpRecord.getProductId());
-			pointRecord.setUserId(activeHelpRecord.getUserId());
-			Assert.notNull(pointRecordService.save(pointRecord),"投票失败");
-			loginUser.setPufaPoint(puFaPoint.add(loginUser.getPufaPoint()));
-		}
-		//修改投票用户信息
-		Assert.isTrue(loginUserService.updateById(loginUser),"投票失败");
-
-
-		//TODO 修改活动热力值和票数
-		activeProductRecord.setVoteCount(activeProductRecord.getVoteCount()+1);
-		//判断是否赠送热力值
-		if(ObjectUtils.isNotEmpty(activeSetting.getVoteAndHeatRate()) && !activeSetting.getVoteAndHeatRate().equals(BigDecimal.ZERO)){
-			//查询参赛用户
-			LoginUser productUser = loginUserService.getById(activeProductRecord.getUserId());
-			Assert.notNull(productUser,"没有找到该参赛选手");
-
-			//热力值=活动票数*热力值比例
-			BigDecimal heatValue = activeSetting.getVoteAndHeatRate()
-				.multiply(BigDecimal.valueOf(activeHelpRecord.getVoteCount()));
-
-			//原热力值+投票热力值
-			productUser.setHeatValue(BigDecimal.valueOf(heatValue.doubleValue()).add(productUser.getHeatValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
-
-			//添加热力值赠送记录=>赠送给参赛用户
-			HeatRecord heatRecord = new HeatRecord();
-			heatRecord.setActiveProductId(activeHelpRecord.getProductId());
-			heatRecord.setHeatValue(BigDecimal.valueOf(heatValue.doubleValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
-			heatRecord.setHeatType(HeatTypeEnum.HEAT_VALUE_SEND);
-			heatRecord.setUserId(activeProductRecord.getUserId());
-			Assert.isTrue(heatRecordService.save(heatRecord),"投票失败");
-			//修改活动热力值
-			activeProductRecord.setHeatValue(heatValue.add(activeProductRecord.getHeatValue()));
-			//放入ZSET缓存排名(缓存名:活动id,作品id,热力值)
-			Assert.isTrue(ActiveProductUtil.addProductRank(activeProductRecord),"投票失败");
-
-			//修改参赛用户选手信息
-			Assert.isTrue(loginUserService.updateById(productUser),"投票失败");
-		}
-		//修改活动作品信息
-		Assert.isTrue(activeProductRecordService.updateById(activeProductRecord));
-
-		//TODO 添加活动记录
-		Assert.isTrue(activeHelpRecordService.save(activeHelpRecord),"投票失败");
+//		//判断票数是否小于当前票数
+//		Long voteCount = loginUser.getVoteCount();
+//		Assert.notNull(voteCount,"用户没有票数");
+//		Assert.notNull(activeHelpRecord.getVoteCount(),"投票数为空");
+//		if(activeHelpRecord.getVoteCount()<1 || loginUser.getVoteCount()<activeHelpRecord.getVoteCount()){
+//			throw new AppActiveProductException("用户所拥有的票数少于所投的票数");
+//		}
+//		//获取平台参数配置
+//		ActiveSettingDto activeSetting = platformSettingUtil.getActiveSetting();
+//		Assert.notNull(activeSetting,"平台没有配置投票参数");
+//
+//
+//		//TODO 减去投票数
+//		loginUser.setVoteCount(loginUser.getVoteCount()-activeHelpRecord.getVoteCount());
+//
+//		//判断是否普法积分
+//		if(ObjectUtils.isNotEmpty(activeSetting.getVoteAndPointRate()) && !activeSetting.getVoteAndPointRate().equals(BigDecimal.ZERO)){
+//			//修改普法积分(票数*积分比例+原有积分)
+//			BigDecimal puFaPoint = activeSetting.getVoteAndPointRate()
+//				.multiply(BigDecimal.valueOf(activeHelpRecord.getVoteCount()));
+//			//添加普法积分赠送记录=>赠送给投票的用户
+//			PointRecord pointRecord = new PointRecord();
+//			pointRecord.setPoint(BigDecimal.valueOf(puFaPoint.doubleValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
+//			pointRecord.setPointType(PointTypeEnum.PUFA_POINT_SEND);
+//			pointRecord.setActiveProductId(activeHelpRecord.getProductId());
+//			pointRecord.setUserId(activeHelpRecord.getUserId());
+//			Assert.notNull(pointRecordService.save(pointRecord),"投票失败");
+//			loginUser.setPufaPoint(puFaPoint.add(loginUser.getPufaPoint()));
+//		}
+//		//修改投票用户信息
+//		Assert.isTrue(loginUserService.updateById(loginUser),"投票失败");
+//
+//
+//		//TODO 修改活动热力值和票数
+//		activeProductRecord.setVoteCount(activeProductRecord.getVoteCount()+1);
+//		//判断是否赠送热力值
+//		if(ObjectUtils.isNotEmpty(activeSetting.getVoteAndHeatRate()) && !activeSetting.getVoteAndHeatRate().equals(BigDecimal.ZERO)){
+//			//查询参赛用户
+//			LoginUser productUser = loginUserService.getById(activeProductRecord.getUserId());
+//			Assert.notNull(productUser,"没有找到该参赛选手");
+//
+//			//热力值=活动票数*热力值比例
+//			BigDecimal heatValue = activeSetting.getVoteAndHeatRate()
+//				.multiply(BigDecimal.valueOf(activeHelpRecord.getVoteCount()));
+//
+//			//原热力值+投票热力值
+//			productUser.setHeatValue(BigDecimal.valueOf(heatValue.doubleValue()).add(productUser.getHeatValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
+//
+//			//添加热力值赠送记录=>赠送给参赛用户
+//			HeatRecord heatRecord = new HeatRecord();
+//			heatRecord.setActiveProductId(activeHelpRecord.getProductId());
+//			heatRecord.setHeatValue(BigDecimal.valueOf(heatValue.doubleValue())); //必须克隆对象,防止事务状态下,使用同一个对象地址
+//			heatRecord.setHeatType(HeatTypeEnum.HEAT_VALUE_SEND);
+//			heatRecord.setUserId(activeProductRecord.getUserId());
+//			Assert.isTrue(heatRecordService.save(heatRecord),"投票失败");
+//			//修改活动热力值
+//			activeProductRecord.setHeatValue(heatValue.add(activeProductRecord.getHeatValue()));
+//			//放入ZSET缓存排名(缓存名:活动id,作品id,热力值)
+//			Assert.isTrue(ActiveProductUtil.addProductRank(activeProductRecord),"投票失败");
+//
+//			//修改参赛用户选手信息
+//			Assert.isTrue(loginUserService.updateById(productUser),"投票失败");
+//		}
+//		//修改活动作品信息
+//		Assert.isTrue(activeProductRecordService.updateById(activeProductRecord));
+//
+//		//TODO 添加活动记录
+//		Assert.isTrue(activeHelpRecordService.save(activeHelpRecord),"投票失败");
 	}
 }

+ 15 - 7
src/main/java/org/springblade/gateway/goods_gateway/service/impl/AppHelpGoodsServiceImpl.java

@@ -1,5 +1,6 @@
 package org.springblade.gateway.goods_gateway.service.impl;
 
+import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -33,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.Arrays;
+import java.util.Map;
 
 /**
  * @Author: Silent
@@ -75,16 +77,21 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 
 		//判断用户今天购买该商品次数是否超过限制(-1标识不限制次数)
 		if(!helpGoods.getTotal().equals(-1L)){
-			int count = goodsRecordService.count(Wrappers.<GoodsRecord>lambdaQuery()
-				.eq(GoodsRecord::getUserId,loginUser.getId())
-				.eq(GoodsRecord::getHelpGoodsId,helpGoods.getId())
-				.eq(GoodsRecord::getType,GoodsRecordType.HELP_GOODS_EXCHANGE.name())
+			Map<String, Object> map = goodsRecordService.getMap(Wrappers.<GoodsRecord>query()
+				.select(new StringBuilder("sum(ifnull(")
+					.append(BeanPropertyUtil.getFieldNameToUnder(GoodsRecord::getNum))
+					.append(",0)) as count")
+					.toString())
+				.lambda()
+				.eq(GoodsRecord::getUserId, loginUser.getId())
+				.eq(GoodsRecord::getHelpGoodsId, helpGoods.getId())
+				.eq(GoodsRecord::getType, GoodsRecordType.HELP_GOODS_EXCHANGE.name())
 				.last(new StringBuilder("and date_format(")
 					.append(BeanPropertyUtil.getFieldNameToUnder(PointRecord::getCreateTime))
 					.append(",\"%Y-%m-%d\")=\"")
-					.append(DateUtil.format(DateUtil.now(),"yyyy-MM-dd").trim()).append("\"").toString()));
+					.append(DateUtil.format(DateUtil.now(), "yyyy-MM-dd").trim()).append("\"").toString()));
 			//购买次数>=允许购买的次数
-			if((cmccPointRecord.getNum().longValue()+count)>helpGoods.getTotal()){
+			if((cmccPointRecord.getNum().longValue() + MapUtil.getInt(map,"count"))>helpGoods.getTotal()){
 				throw new HelpGoodsException("您购买次数超过上限");
 			}
 		}
@@ -106,7 +113,7 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 		//判断是否赠送票数
 		if(ObjectUtils.isNotEmpty(helpGoods.getVotePointRate()) && helpGoods.getVotePointRate().intValue()>0){
 			//设置票数(数量*票数+原有票数)
-			loginUser.setVoteCount(BigDecimal.valueOf(loginUser.getVoteCount()).add(helpGoods.getVotePointRate().multiply(cmccPointRecord.getNum())).longValue());
+
 		}
 
 		//修改用户信息
@@ -116,6 +123,7 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 		GoodsRecord goodsRecord = new GoodsRecord();
 		goodsRecord.setUserId(loginUser.getId());
 		goodsRecord.setHelpGoodsId(helpGoods.getId());
+		goodsRecord.setNum(cmccPointRecord.getNum().longValue());
 		goodsRecord.setType(GoodsRecordType.HELP_GOODS_EXCHANGE);
 		Assert.isTrue(goodsRecordService.save(goodsRecord),"兑换失败");
 

+ 1 - 1
src/main/java/org/springblade/gateway/login_gateway/scheduled/UserScheduled.java

@@ -28,7 +28,7 @@ public class UserScheduled {
 	public void updateUserVote(){
 		ActiveSettingDto activeSetting = platformSettingUtil.getActiveSetting();
 		if(ObjectUtils.isNotEmpty(activeSetting) && ObjectUtils.isNotEmpty(activeSetting.getUserFreeVoteCount())){
-			loginUserService.update(Wrappers.<LoginUser>lambdaUpdate().set(LoginUser::getVoteCount,activeSetting));
+			//loginUserService.update(Wrappers.<LoginUser>lambdaUpdate().set(LoginUser::getVoteCount,activeSetting));
 		}else{
 			log.warn("没有找到活动配置,无法更用户每天票数...");
 		}

+ 129 - 0
src/main/java/org/springblade/sing/active/controller/UserHelpVoteController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.sing.active.entity.UserHelpVote;
+import org.springblade.sing.active.vo.UserHelpVoteVO;
+import org.springblade.sing.active.wrapper.UserHelpVoteWrapper;
+import org.springblade.sing.active.service.IUserHelpVoteService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 用户助力票数表 控制器
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("sing_active/userhelpvote")
+@Api(value = "用户助力票数表", tags = "用户助力票数表接口")
+public class UserHelpVoteController extends BladeController {
+
+	private final IUserHelpVoteService userHelpVoteService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入userHelpVote")
+	public R<UserHelpVoteVO> detail(UserHelpVote userHelpVote) {
+		UserHelpVote detail = userHelpVoteService.getOne(Condition.getQueryWrapper(userHelpVote));
+		return R.data(UserHelpVoteWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 用户助力票数表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入userHelpVote")
+	public R<IPage<UserHelpVoteVO>> list(UserHelpVote userHelpVote, Query query) {
+		IPage<UserHelpVote> pages = userHelpVoteService.page(Condition.getPage(query), Condition.getQueryWrapper(userHelpVote));
+		return R.data(UserHelpVoteWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 用户助力票数表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入userHelpVote")
+	public R<IPage<UserHelpVoteVO>> page(UserHelpVoteVO userHelpVote, Query query) {
+		IPage<UserHelpVoteVO> pages = userHelpVoteService.selectUserHelpVotePage(Condition.getPage(query), userHelpVote);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 用户助力票数表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入userHelpVote")
+	public R save(@Valid @RequestBody UserHelpVote userHelpVote) {
+		return R.status(userHelpVoteService.save(userHelpVote));
+	}
+
+	/**
+	 * 修改 用户助力票数表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入userHelpVote")
+	public R update(@Valid @RequestBody UserHelpVote userHelpVote) {
+		return R.status(userHelpVoteService.updateById(userHelpVote));
+	}
+
+	/**
+	 * 新增或修改 用户助力票数表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入userHelpVote")
+	public R submit(@Valid @RequestBody UserHelpVote userHelpVote) {
+		return R.status(userHelpVoteService.saveOrUpdate(userHelpVote));
+	}
+
+	
+	/**
+	 * 删除 用户助力票数表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(userHelpVoteService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/sing/active/dto/UserHelpVoteDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.dto;
+
+import org.springblade.sing.active.entity.UserHelpVote;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户助力票数表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UserHelpVoteDTO extends UserHelpVote {
+	private static final long serialVersionUID = 1L;
+
+}

+ 57 - 0
src/main/java/org/springblade/sing/active/entity/UserHelpVote.java

@@ -0,0 +1,57 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 用户助力票数表实体类
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+@Data
+@TableName("sing_user_help_vote")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserHelpVote对象", description = "用户助力票数表")
+public class UserHelpVote extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 用户ID
+	*/
+		@ApiModelProperty(value = "用户ID")
+		private Long userId;
+	/**
+	* 助力道具ID
+	*/
+		@ApiModelProperty(value = "助力道具ID")
+		private Long helpGoodsId;
+	/**
+	* 剩余票数
+	*/
+		@ApiModelProperty(value = "剩余票数")
+		private Long voteCount;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/sing/active/mapper/UserHelpVoteMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.mapper;
+
+import org.springblade.sing.active.entity.UserHelpVote;
+import org.springblade.sing.active.vo.UserHelpVoteVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 用户助力票数表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+public interface UserHelpVoteMapper extends BaseMapper<UserHelpVote> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userHelpVote
+	 * @return
+	 */
+	List<UserHelpVoteVO> selectUserHelpVotePage(IPage page, UserHelpVoteVO userHelpVote);
+
+}

+ 25 - 0
src/main/java/org/springblade/sing/active/mapper/UserHelpVoteMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.sing.active.mapper.UserHelpVoteMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="userHelpVoteResultMap" type="org.springblade.sing.active.entity.UserHelpVote">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="user_id" property="userId"/>
+        <result column="help_goods_id" property="helpGoodsId"/>
+        <result column="vote_count" property="voteCount"/>
+    </resultMap>
+
+
+    <select id="selectUserHelpVotePage" resultMap="userHelpVoteResultMap">
+        select * from sing_user_help_vote where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/sing/active/service/IUserHelpVoteService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.service;
+
+import org.springblade.sing.active.entity.UserHelpVote;
+import org.springblade.sing.active.vo.UserHelpVoteVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户助力票数表 服务类
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+public interface IUserHelpVoteService extends BaseService<UserHelpVote> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userHelpVote
+	 * @return
+	 */
+	IPage<UserHelpVoteVO> selectUserHelpVotePage(IPage<UserHelpVoteVO> page, UserHelpVoteVO userHelpVote);
+
+}

+ 41 - 0
src/main/java/org/springblade/sing/active/service/impl/UserHelpVoteServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.service.impl;
+
+import org.springblade.sing.active.entity.UserHelpVote;
+import org.springblade.sing.active.vo.UserHelpVoteVO;
+import org.springblade.sing.active.mapper.UserHelpVoteMapper;
+import org.springblade.sing.active.service.IUserHelpVoteService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户助力票数表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+@Service
+public class UserHelpVoteServiceImpl extends BaseServiceImpl<UserHelpVoteMapper, UserHelpVote> implements IUserHelpVoteService {
+
+	@Override
+	public IPage<UserHelpVoteVO> selectUserHelpVotePage(IPage<UserHelpVoteVO> page, UserHelpVoteVO userHelpVote) {
+		return page.setRecords(baseMapper.selectUserHelpVotePage(page, userHelpVote));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/sing/active/vo/UserHelpVoteVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.vo;
+
+import org.springblade.sing.active.entity.UserHelpVote;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 用户助力票数表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserHelpVoteVO对象", description = "用户助力票数表")
+public class UserHelpVoteVO extends UserHelpVote {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/sing/active/wrapper/UserHelpVoteWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.active.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.sing.active.entity.UserHelpVote;
+import org.springblade.sing.active.vo.UserHelpVoteVO;
+import java.util.Objects;
+
+/**
+ * 用户助力票数表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-18
+ */
+public class UserHelpVoteWrapper extends BaseEntityWrapper<UserHelpVote, UserHelpVoteVO>  {
+
+	public static UserHelpVoteWrapper build() {
+		return new UserHelpVoteWrapper();
+ 	}
+
+	@Override
+	public UserHelpVoteVO entityVO(UserHelpVote userHelpVote) {
+		UserHelpVoteVO userHelpVoteVO = Objects.requireNonNull(BeanUtil.copy(userHelpVote, UserHelpVoteVO.class));
+
+		//User createUser = UserCache.getUser(userHelpVote.getCreateUser());
+		//User updateUser = UserCache.getUser(userHelpVote.getUpdateUser());
+		//userHelpVoteVO.setCreateUserName(createUser.getName());
+		//userHelpVoteVO.setUpdateUserName(updateUser.getName());
+
+		return userHelpVoteVO;
+	}
+
+}