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

+ 1 - 1
src/main/java/org/springblade/gateway/active_gateway/controller/AppActiveProductController.java

@@ -70,7 +70,7 @@ public class AppActiveProductController extends BladeController {
 		try {
 			//获取用户IP地址
 			activeHelpRecord.setIp(IPUtils.getRealIp(request));
-			activeService.activeHelp(activeHelpRecord);
+			activeService.activeHelp(activeHelpRecord,null);
 			return R.success("助力成功!");
 		} catch (Exception e) {
 			log.error(e.getMessage());

+ 2 - 2
src/main/java/org/springblade/gateway/active_gateway/service/AppActiveProductService.java

@@ -14,11 +14,11 @@ import org.springblade.sing.user.entity.LoginUser;
  */
 public interface AppActiveProductService {
 
-	void activeHelp(ActiveHelpRecord activeHelpRecord);
+	void activeHelp(ActiveHelpRecord activeHelpRecord,String phone);
 
 	void updateProductVoteAndHeat(ActiveHelpRecord activeHelpRecord, ActiveProductRecord activeProductRecord, ActiveSettingDto activeSetting);
 
-	void userPuFaPointUpdate(ActiveHelpRecord activeHelpRecord, LoginUser loginUser, ActiveSettingDto activeSetting);
+	void userPuFaPointUpdate(ActiveHelpRecord activeHelpRecord, String phone, ActiveSettingDto activeSetting);
 
 	void userHelpCountCheck(ActiveHelpRecord activeHelpRecord, ActiveProductRecord activeProductRecord, LoginUser loginUser, HelpGoods helpGoods);
 }

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

@@ -27,7 +27,9 @@ import org.springblade.sing.heat.entity.UserHeat;
 import org.springblade.sing.heat.service.IHeatRecordService;
 import org.springblade.sing.heat.service.IUserHeatService;
 import org.springblade.sing.point.entity.PointRecord;
+import org.springblade.sing.point.entity.UserPufaPoint;
 import org.springblade.sing.point.service.IPointRecordService;
+import org.springblade.sing.point.service.IUserPufaPointService;
 import org.springblade.sing.user.entity.LoginUser;
 import org.springblade.sing.user.service.ILoginUserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -63,6 +65,8 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 	private PlatformSettingUtil platformSettingUtil;
 	@Autowired
 	private IUserHeatService userHeatService;
+	@Autowired
+	private IUserPufaPointService userPufaPointService;
 
 	/**
 	 * 活动助力
@@ -72,7 +76,7 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void activeHelp(ActiveHelpRecord activeHelpRecord) {
+	public void activeHelp(ActiveHelpRecord activeHelpRecord,String phone) {
 		//获取作品
 		ActiveProductRecord activeProductRecord = activeProductRecordService.getById(activeHelpRecord.getProductId());
 		Assert.notNull(activeProductRecord, "没有找到作品");
@@ -109,7 +113,7 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 		Assert.notNull(activeSetting, "平台没有配置投票参数");
 
 		//更新用户普法积分
-		userPuFaPointUpdate(activeHelpRecord, loginUser, activeSetting);
+		userPuFaPointUpdate(activeHelpRecord, phone, activeSetting);
 
 		//更新活动作品的票数和热力值
 		updateProductVoteAndHeat(activeHelpRecord, activeProductRecord, activeSetting);
@@ -207,14 +211,41 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 		}
 	}
 
+//	/**
+//	 * 更新用户普法积分
+//	 * @param activeHelpRecord
+//	 * @param loginUser
+//	 * @param activeSetting
+//	 */
+//	@Override
+//	public void userPuFaPointUpdate(ActiveHelpRecord activeHelpRecord, LoginUser loginUser, ActiveSettingDto activeSetting) {
+//		//判断是否普法积分
+//		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), "投票失败");
+//	}
+
 	/**
 	 * 更新用户普法积分
 	 * @param activeHelpRecord
-	 * @param loginUser
+	 * @param phone
 	 * @param activeSetting
 	 */
 	@Override
-	public void userPuFaPointUpdate(ActiveHelpRecord activeHelpRecord, LoginUser loginUser, ActiveSettingDto activeSetting) {
+	public void userPuFaPointUpdate(ActiveHelpRecord activeHelpRecord, String phone, ActiveSettingDto activeSetting) {
 		//判断是否普法积分
 		if (ObjectUtils.isNotEmpty(activeSetting.getVoteAndPointRate()) && !activeSetting.getVoteAndPointRate().equals(BigDecimal.ZERO)) {
 			//修改普法积分(票数*积分比例+原有积分)
@@ -227,11 +258,19 @@ public class AppActiveProductServiceImpl implements AppActiveProductService {
 			pointRecord.setActiveProductId(activeHelpRecord.getProductId());
 			pointRecord.setUserId(activeHelpRecord.getUserId());
 			Assert.notNull(pointRecordService.save(pointRecord), "投票失败");
-			loginUser.setPufaPoint(puFaPoint.add(loginUser.getPufaPoint()));
-		}
 
-		//修改投票用户信息
-		Assert.isTrue(loginUserService.updateById(loginUser), "投票失败");
+			//修改积分
+			UserPufaPoint userPufaPoint = userPufaPointService.getOne(Wrappers.<UserPufaPoint>lambdaQuery().eq(UserPufaPoint::getPhone, phone));
+			if(ObjectUtils.isEmpty(userPufaPoint)){
+				userPufaPoint = new UserPufaPoint();
+				userPufaPoint.setPhone(phone);
+				userPufaPoint.setHeatValue(BigDecimal.ZERO);
+			}
+			userPufaPoint.setHeatValue(userPufaPoint.getHeatValue().add(puFaPoint));
+
+			//保存
+			userPufaPointService.saveOrUpdate(userPufaPoint);
+		}
 	}
 
 	/**

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

@@ -92,7 +92,7 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 		activeHelpRecord.setHelpGoodsId(helpGoods.getId());
 		activeHelpRecord.setIp(IPUtils.getRealIp(request));
 		activeHelpRecord.setVoteCount(helpGoods.getVotePointRate().longValue());
-		appActiveProductService.activeHelp(activeHelpRecord);
+		appActiveProductService.activeHelp(activeHelpRecord,ObjectUtils.getIfNull(cmccPointRecord.getPhone(),loginUser::getPhone));
 
 		//助力之后判断是否需要移动积分兑换(防止先兑换之后,助力不成功问题)
 		cmccPointExchange(cmccPointRecord, cmccDectOrderRequest, helpGoods, loginUser);

+ 7 - 2
src/main/java/org/springblade/sing/goods/wrapper/HelpGoodsWrapper.java

@@ -32,6 +32,7 @@ import org.springblade.sing.goods.entity.HelpGoods;
 import org.springblade.sing.goods.vo.HelpGoodsVO;
 import org.springblade.sing.point.entity.PointRecord;
 
+import java.math.BigDecimal;
 import java.util.Map;
 import java.util.Objects;
 
@@ -61,7 +62,7 @@ public class HelpGoodsWrapper extends BaseEntityWrapper<HelpGoods, HelpGoodsVO>
 		HelpGoodsVO helpGoodsVO = Objects.requireNonNull(BeanUtil.copy(helpGoods, HelpGoodsVO.class));
 
 		//查询用户剩余道具次数
-		if(ObjectUtils.isNotEmpty(userId)){
+		if(ObjectUtils.isNotEmpty(userId) && ObjectUtils.isNotEmpty(productId)){
 			//判断总次数
 			long total = helpGoodsVO.getTotal() - appHelpGoodsService.userHelpGoodsExchangeCount(userId, helpGoodsVO.getId());
 			if(!Long.valueOf(0L).equals(total)){
@@ -77,7 +78,11 @@ public class HelpGoodsWrapper extends BaseEntityWrapper<HelpGoods, HelpGoodsVO>
 						.append(BeanPropertyUtil.getFieldNameToUnder(PointRecord::getCreateTime))
 						.append(",\"%Y-%m-%d\")=\"")
 						.append(DateUtil.format(DateUtil.now(), "yyyy-MM-dd").trim()).append("\"").toString()));
-				helpGoodsVO.setRemainCount(helpGoodsVO.getActiveVote() - MapUtil.getLong(map, "count"));
+				//活动允许投票数/兑换所得票数-所投的票数/兑换所得票数
+				helpGoodsVO.setRemainCount(BigDecimal.valueOf(helpGoodsVO.getActiveVote())
+					.divide(helpGoodsVO.getVotePointRate())
+					.subtract(BigDecimal.valueOf(MapUtil.getLong(map, "count"))
+						.divide(helpGoodsVO.getVotePointRate())).longValue());
 			}else{
 				helpGoodsVO.setRemainCount(0L);
 			}

+ 129 - 0
src/main/java/org/springblade/sing/point/controller/UserPufaPointController.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.point.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.point.entity.UserPufaPoint;
+import org.springblade.sing.point.vo.UserPufaPointVO;
+import org.springblade.sing.point.wrapper.UserPufaPointWrapper;
+import org.springblade.sing.point.service.IUserPufaPointService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 用户普法积分表 控制器
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("sing_point/userpufapoint")
+@Api(value = "用户普法积分表", tags = "用户普法积分表接口")
+public class UserPufaPointController extends BladeController {
+
+	private final IUserPufaPointService userPufaPointService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入userPufaPoint")
+	public R<UserPufaPointVO> detail(UserPufaPoint userPufaPoint) {
+		UserPufaPoint detail = userPufaPointService.getOne(Condition.getQueryWrapper(userPufaPoint));
+		return R.data(UserPufaPointWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 用户普法积分表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入userPufaPoint")
+	public R<IPage<UserPufaPointVO>> list(UserPufaPoint userPufaPoint, Query query) {
+		IPage<UserPufaPoint> pages = userPufaPointService.page(Condition.getPage(query), Condition.getQueryWrapper(userPufaPoint));
+		return R.data(UserPufaPointWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 用户普法积分表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入userPufaPoint")
+	public R<IPage<UserPufaPointVO>> page(UserPufaPointVO userPufaPoint, Query query) {
+		IPage<UserPufaPointVO> pages = userPufaPointService.selectUserPufaPointPage(Condition.getPage(query), userPufaPoint);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 用户普法积分表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入userPufaPoint")
+	public R save(@Valid @RequestBody UserPufaPoint userPufaPoint) {
+		return R.status(userPufaPointService.save(userPufaPoint));
+	}
+
+	/**
+	 * 修改 用户普法积分表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入userPufaPoint")
+	public R update(@Valid @RequestBody UserPufaPoint userPufaPoint) {
+		return R.status(userPufaPointService.updateById(userPufaPoint));
+	}
+
+	/**
+	 * 新增或修改 用户普法积分表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入userPufaPoint")
+	public R submit(@Valid @RequestBody UserPufaPoint userPufaPoint) {
+		return R.status(userPufaPointService.saveOrUpdate(userPufaPoint));
+	}
+
+	
+	/**
+	 * 删除 用户普法积分表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(userPufaPointService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/sing/point/dto/UserPufaPointDTO.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.point.dto;
+
+import org.springblade.sing.point.entity.UserPufaPoint;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户普法积分表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UserPufaPointDTO extends UserPufaPoint {
+	private static final long serialVersionUID = 1L;
+
+}

+ 53 - 0
src/main/java/org/springblade/sing/point/entity/UserPufaPoint.java

@@ -0,0 +1,53 @@
+/*
+ *      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.point.entity;
+
+import java.math.BigDecimal;
+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-20
+ */
+@Data
+@TableName("sing_user_pufa_point")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserPufaPoint对象", description = "用户普法积分表")
+public class UserPufaPoint extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 手机号码
+	*/
+		@ApiModelProperty(value = "手机号码")
+		private String phone;
+	/**
+	* 热力值
+	*/
+		@ApiModelProperty(value = "热力值")
+		private BigDecimal heatValue;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/sing/point/mapper/UserPufaPointMapper.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.point.mapper;
+
+import org.springblade.sing.point.entity.UserPufaPoint;
+import org.springblade.sing.point.vo.UserPufaPointVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 用户普法积分表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+public interface UserPufaPointMapper extends BaseMapper<UserPufaPoint> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userPufaPoint
+	 * @return
+	 */
+	List<UserPufaPointVO> selectUserPufaPointPage(IPage page, UserPufaPointVO userPufaPoint);
+
+}

+ 24 - 0
src/main/java/org/springblade/sing/point/mapper/UserPufaPointMapper.xml

@@ -0,0 +1,24 @@
+<?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.point.mapper.UserPufaPointMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="userPufaPointResultMap" type="org.springblade.sing.point.entity.UserPufaPoint">
+        <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="phone" property="phone"/>
+        <result column="heat_value" property="heatValue"/>
+    </resultMap>
+
+
+    <select id="selectUserPufaPointPage" resultMap="userPufaPointResultMap">
+        select * from sing_user_pufa_point where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/sing/point/service/IUserPufaPointService.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.point.service;
+
+import org.springblade.sing.point.entity.UserPufaPoint;
+import org.springblade.sing.point.vo.UserPufaPointVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户普法积分表 服务类
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+public interface IUserPufaPointService extends BaseService<UserPufaPoint> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userPufaPoint
+	 * @return
+	 */
+	IPage<UserPufaPointVO> selectUserPufaPointPage(IPage<UserPufaPointVO> page, UserPufaPointVO userPufaPoint);
+
+}

+ 41 - 0
src/main/java/org/springblade/sing/point/service/impl/UserPufaPointServiceImpl.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.point.service.impl;
+
+import org.springblade.sing.point.entity.UserPufaPoint;
+import org.springblade.sing.point.vo.UserPufaPointVO;
+import org.springblade.sing.point.mapper.UserPufaPointMapper;
+import org.springblade.sing.point.service.IUserPufaPointService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户普法积分表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+@Service
+public class UserPufaPointServiceImpl extends BaseServiceImpl<UserPufaPointMapper, UserPufaPoint> implements IUserPufaPointService {
+
+	@Override
+	public IPage<UserPufaPointVO> selectUserPufaPointPage(IPage<UserPufaPointVO> page, UserPufaPointVO userPufaPoint) {
+		return page.setRecords(baseMapper.selectUserPufaPointPage(page, userPufaPoint));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/sing/point/vo/UserPufaPointVO.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.point.vo;
+
+import org.springblade.sing.point.entity.UserPufaPoint;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 用户普法积分表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserPufaPointVO对象", description = "用户普法积分表")
+public class UserPufaPointVO extends UserPufaPoint {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/sing/point/wrapper/UserPufaPointWrapper.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.point.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.sing.point.entity.UserPufaPoint;
+import org.springblade.sing.point.vo.UserPufaPointVO;
+import java.util.Objects;
+
+/**
+ * 用户普法积分表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-20
+ */
+public class UserPufaPointWrapper extends BaseEntityWrapper<UserPufaPoint, UserPufaPointVO>  {
+
+	public static UserPufaPointWrapper build() {
+		return new UserPufaPointWrapper();
+ 	}
+
+	@Override
+	public UserPufaPointVO entityVO(UserPufaPoint userPufaPoint) {
+		UserPufaPointVO userPufaPointVO = Objects.requireNonNull(BeanUtil.copy(userPufaPoint, UserPufaPointVO.class));
+
+		//User createUser = UserCache.getUser(userPufaPoint.getCreateUser());
+		//User updateUser = UserCache.getUser(userPufaPoint.getUpdateUser());
+		//userPufaPointVO.setCreateUserName(createUser.getName());
+		//userPufaPointVO.setUpdateUserName(updateUser.getName());
+
+		return userPufaPointVO;
+	}
+
+}