Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product
# Conflicts: # yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.javaplp
commit
b697ee3298
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java
@ -1,14 +1,12 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分记录创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointRecordCreateReqVO extends PointRecordBaseVO {
|
||||
public class MemberPointRecordCreateReqVO extends MemberPointRecordBaseVO {
|
||||
|
||||
}
|
||||
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java
5
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java
5
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java
@ -1,15 +1,15 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分记录更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PointRecordUpdateReqVO extends PointRecordBaseVO {
|
||||
public class MemberPointRecordUpdateReqVO extends MemberPointRecordBaseVO {
|
||||
|
||||
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457")
|
||||
@NotNull(message = "自增主键不能为空")
|
||||
@ -1 +0,0 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
|
||||
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
|
||||
import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 积分签到规则")
|
||||
@RestController
|
||||
@RequestMapping("/point/sign-in-config")
|
||||
@Validated
|
||||
public class MemberSignInConfigController {
|
||||
|
||||
@Resource
|
||||
private MemberSignInConfigService memberSignInConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建积分签到规则")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:create')")
|
||||
public CommonResult<Integer> createSignInConfig(@Valid @RequestBody MemberSignInConfigCreateReqVO createReqVO) {
|
||||
return success(memberSignInConfigService.createSignInConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新积分签到规则")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:update')")
|
||||
public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody MemberSignInConfigUpdateReqVO updateReqVO) {
|
||||
memberSignInConfigService.updateSignInConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除积分签到规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')")
|
||||
public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) {
|
||||
memberSignInConfigService.deleteSignInConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得积分签到规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<MemberSignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) {
|
||||
MemberSignInConfigDO signInConfig = memberSignInConfigService.getSignInConfig(id);
|
||||
return success(MemberSignInConfigConvert.INSTANCE.convert(signInConfig));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得积分签到规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<PageResult<MemberSignInConfigRespVO>> getSignInConfigPage(@Valid MemberSignInConfigPageReqVO pageVO) {
|
||||
PageResult<MemberSignInConfigDO> pageResult = memberSignInConfigService.getSignInConfigPage(pageVO);
|
||||
return success(MemberSignInConfigConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
}
|
||||
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java
@ -1,14 +1,12 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 积分签到规则创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInConfigCreateReqVO extends SignInConfigBaseVO {
|
||||
public class MemberSignInConfigCreateReqVO extends MemberSignInConfigBaseVO {
|
||||
|
||||
}
|
||||
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java
6
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java
@ -1,15 +1,15 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 积分签到规则更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInConfigUpdateReqVO extends SignInConfigBaseVO {
|
||||
public class MemberSignInConfigUpdateReqVO extends MemberSignInConfigBaseVO {
|
||||
|
||||
@Schema(description = "规则自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13653")
|
||||
@NotNull(message = "规则自增主键不能为空")
|
||||
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 用户签到积分创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MemberSignInRecordCreateReqVO extends MemberSignInRecordBaseVO {
|
||||
|
||||
}
|
||||
@ -1,14 +1,17 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户签到积分 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordRespVO extends SignInRecordBaseVO {
|
||||
public class MemberSignInRecordRespVO extends MemberSignInRecordBaseVO {
|
||||
|
||||
@Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903")
|
||||
private Long id;
|
||||
12
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java
12
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java → yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java
@ -1,15 +1,17 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.signin.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 用户签到积分更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordUpdateReqVO extends SignInRecordBaseVO {
|
||||
public class MemberSignInRecordUpdateReqVO extends MemberSignInRecordBaseVO {
|
||||
|
||||
@Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903")
|
||||
@NotNull(message = "签到自增id不能为空")
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.member.convert.point;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Convert
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberPointRecordConvert {
|
||||
|
||||
MemberPointRecordConvert INSTANCE = Mappers.getMapper(MemberPointRecordConvert.class);
|
||||
|
||||
MemberPointRecordDO convert(MemberPointRecordCreateReqVO bean);
|
||||
|
||||
MemberPointRecordDO convert(MemberPointRecordUpdateReqVO bean);
|
||||
|
||||
MemberPointRecordRespVO convert(MemberPointRecordDO bean);
|
||||
|
||||
PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> page);
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.convert.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Convert
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberSignInConfigConvert {
|
||||
|
||||
MemberSignInConfigConvert INSTANCE = Mappers.getMapper(MemberSignInConfigConvert.class);
|
||||
|
||||
MemberSignInConfigDO convert(MemberSignInConfigCreateReqVO bean);
|
||||
|
||||
MemberSignInConfigDO convert(MemberSignInConfigUpdateReqVO bean);
|
||||
|
||||
MemberSignInConfigRespVO convert(MemberSignInConfigDO bean);
|
||||
|
||||
List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list);
|
||||
|
||||
PageResult<MemberSignInConfigRespVO> convertPage(PageResult<MemberSignInConfigDO> page);
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.member.convert.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberSignInRecordConvert {
|
||||
|
||||
MemberSignInRecordConvert INSTANCE = Mappers.getMapper(MemberSignInRecordConvert.class);
|
||||
|
||||
MemberSignInRecordDO convert(MemberSignInRecordCreateReqVO bean);
|
||||
|
||||
MemberSignInRecordDO convert(MemberSignInRecordUpdateReqVO bean);
|
||||
|
||||
MemberSignInRecordRespVO convert(MemberSignInRecordDO bean);
|
||||
|
||||
PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> page);
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.point;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Mapper
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO> {
|
||||
|
||||
default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>()
|
||||
.eqIfPresent(MemberPointRecordDO::getBizId, reqVO.getBizId())
|
||||
.eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(MemberPointRecordDO::getType, reqVO.getType())
|
||||
.eqIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(MemberPointRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Mapper
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfigDO> {
|
||||
|
||||
default PageResult<MemberSignInConfigDO> selectPage(MemberSignInConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInConfigDO>()
|
||||
.eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay())
|
||||
.orderByAsc(MemberSignInConfigDO::getDay));
|
||||
}
|
||||
|
||||
//
|
||||
default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){
|
||||
return selectCount(new LambdaQueryWrapperX <MemberSignInConfigDO>()
|
||||
.ne(MemberSignInConfigDO::getId, reqVO.getId())
|
||||
.eq(MemberSignInConfigDO::getDay,reqVO.getDay())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecordDO> {
|
||||
|
||||
default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>()
|
||||
.eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay())
|
||||
.betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MemberSignInRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.member.service.point;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointRecordMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
|
||||
/**
|
||||
* 用户积分记录 Service 实现类
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MemberPointRecordServiceImpl implements MemberPointRecordService {
|
||||
|
||||
@Resource
|
||||
private MemberPointRecordMapper recordMapper;
|
||||
|
||||
@Override
|
||||
public void updateRecord(MemberPointRecordUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRecordExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MemberPointRecordDO updateObj = MemberPointRecordConvert.INSTANCE.convert(updateReqVO);
|
||||
recordMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
private void validateRecordExists(Long id) {
|
||||
if (recordMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.RECORD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberPointRecordDO getRecord(Long id) {
|
||||
return recordMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) {
|
||||
return recordMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.member.service.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Service 接口
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
public interface MemberSignInConfigService {
|
||||
|
||||
/**
|
||||
* 创建积分签到规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createSignInConfig(@Valid MemberSignInConfigCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新积分签到规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSignInConfig(@Valid MemberSignInConfigUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除积分签到规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSignInConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 积分签到规则
|
||||
*/
|
||||
MemberSignInConfigDO getSignInConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 积分签到规则分页
|
||||
*/
|
||||
PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.member.service.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface MemberSignInRecordService {
|
||||
|
||||
/**
|
||||
* 删除用户签到积分
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSignInRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户签到积分
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户签到积分
|
||||
*/
|
||||
MemberSignInRecordDO getSignInRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户签到积分分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户签到积分分页
|
||||
*/
|
||||
PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.member.service.signin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_RECORD_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MemberSignInRecordServiceImpl implements MemberSignInRecordService {
|
||||
|
||||
@Resource
|
||||
private MemberSignInRecordMapper memberSignInRecordMapper;
|
||||
|
||||
@Override
|
||||
public void deleteSignInRecord(Long id) {
|
||||
// 校验存在
|
||||
validateSignInRecordExists(id);
|
||||
// 删除
|
||||
memberSignInRecordMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSignInRecordExists(Long id) {
|
||||
if (memberSignInRecordMapper.selectById(id) == null) {
|
||||
throw exception(SIGN_IN_RECORD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberSignInRecordDO getSignInRecord(Long id) {
|
||||
return memberSignInRecordMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) {
|
||||
return memberSignInRecordMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-point</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>yudao-module-point-api</module>
|
||||
</modules>
|
||||
|
||||
|
||||
</project>
|
||||
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-point</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-point-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-point</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>yudao-module-point-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-point-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@ -1,102 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.pointrecord;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
|
||||
import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert;
|
||||
import cn.iocoder.yudao.module.point.service.pointrecord.PointRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户积分记录")
|
||||
@RestController
|
||||
@RequestMapping("/point/record")
|
||||
@Validated
|
||||
public class PointRecordController {
|
||||
|
||||
@Resource
|
||||
private PointRecordService recordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:create')")
|
||||
public CommonResult<Long> createRecord(@Valid @RequestBody PointRecordCreateReqVO createReqVO) {
|
||||
return success(recordService.createRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:update')")
|
||||
public CommonResult<Boolean> updateRecord(@Valid @RequestBody PointRecordUpdateReqVO updateReqVO) {
|
||||
recordService.updateRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户积分记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('point:record:delete')")
|
||||
public CommonResult<Boolean> deleteRecord(@RequestParam("id") Long id) {
|
||||
recordService.deleteRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户积分记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:query')")
|
||||
public CommonResult<PointRecordRespVO> getRecord(@RequestParam("id") Long id) {
|
||||
PointRecordDO record = recordService.getRecord(id);
|
||||
return success(PointRecordConvert.INSTANCE.convert(record));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得用户积分记录列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:query')")
|
||||
public CommonResult<List<PointRecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<PointRecordDO> list = recordService.getRecordList(ids);
|
||||
return success(PointRecordConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户积分记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:query')")
|
||||
public CommonResult<PageResult<PointRecordRespVO>> getRecordPage(@Valid PointRecordPageReqVO pageVO) {
|
||||
PageResult<PointRecordDO> pageResult = recordService.getRecordPage(pageVO);
|
||||
return success(PointRecordConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户积分记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('point:record:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRecordExcel(@Valid PointRecordExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<PointRecordDO> list = recordService.getRecordList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<PointRecordExcelVO> datas = PointRecordConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "用户积分记录.xls", "数据", PointRecordExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinconfig;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
|
||||
import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert;
|
||||
import cn.iocoder.yudao.module.point.service.signinconfig.SignInConfigService;
|
||||
|
||||
@Tag(name = "管理后台 - 积分签到规则")
|
||||
@RestController
|
||||
@RequestMapping("/point/sign-in-config")
|
||||
@Validated
|
||||
public class SignInConfigController {
|
||||
|
||||
@Resource
|
||||
private SignInConfigService signInConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建积分签到规则")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:create')")
|
||||
public CommonResult<Integer> createSignInConfig(@Valid @RequestBody SignInConfigCreateReqVO createReqVO) {
|
||||
return success(signInConfigService.createSignInConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新积分签到规则")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:update')")
|
||||
public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody SignInConfigUpdateReqVO updateReqVO) {
|
||||
signInConfigService.updateSignInConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除积分签到规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')")
|
||||
public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) {
|
||||
signInConfigService.deleteSignInConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得积分签到规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<SignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) {
|
||||
SignInConfigDO signInConfig = signInConfigService.getSignInConfig(id);
|
||||
return success(SignInConfigConvert.INSTANCE.convert(signInConfig));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得积分签到规则列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<List<SignInConfigRespVO>> getSignInConfigList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<SignInConfigDO> list = signInConfigService.getSignInConfigList(ids);
|
||||
return success(SignInConfigConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得积分签到规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<PageResult<SignInConfigRespVO>> getSignInConfigPage(@Valid SignInConfigPageReqVO pageVO) {
|
||||
PageResult<SignInConfigDO> pageResult = signInConfigService.getSignInConfigPage(pageVO);
|
||||
return success(SignInConfigConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出积分签到规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSignInConfigExcel(@Valid SignInConfigExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<SignInConfigDO> list = signInConfigService.getSignInConfigList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<SignInConfigExcelVO> datas = SignInConfigConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "积分签到规则.xls", "数据", SignInConfigExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Excel VO
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Data
|
||||
public class SignInConfigExcelVO {
|
||||
|
||||
@ExcelProperty("签到第x天")
|
||||
private Integer day;
|
||||
|
||||
@ExcelProperty("签到天数对应分数")
|
||||
private Integer point;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinrecord;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
|
||||
import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert;
|
||||
import cn.iocoder.yudao.module.point.service.signinrecord.SignInRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户签到积分")
|
||||
@RestController
|
||||
@RequestMapping("/point/sign-in-record")
|
||||
@Validated
|
||||
public class SignInRecordController {
|
||||
|
||||
@Resource
|
||||
private SignInRecordService signInRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户签到积分")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:create')")
|
||||
public CommonResult<Long> createSignInRecord(@Valid @RequestBody SignInRecordCreateReqVO createReqVO) {
|
||||
return success(signInRecordService.createSignInRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户签到积分")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:update')")
|
||||
public CommonResult<Boolean> updateSignInRecord(@Valid @RequestBody SignInRecordUpdateReqVO updateReqVO) {
|
||||
signInRecordService.updateSignInRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户签到积分")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')")
|
||||
public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) {
|
||||
signInRecordService.deleteSignInRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户签到积分")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
|
||||
public CommonResult<SignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) {
|
||||
SignInRecordDO signInRecord = signInRecordService.getSignInRecord(id);
|
||||
return success(SignInRecordConvert.INSTANCE.convert(signInRecord));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得用户签到积分列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
|
||||
public CommonResult<List<SignInRecordRespVO>> getSignInRecordList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(ids);
|
||||
return success(SignInRecordConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户签到积分分页")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:query')")
|
||||
public CommonResult<PageResult<SignInRecordRespVO>> getSignInRecordPage(@Valid SignInRecordPageReqVO pageVO) {
|
||||
PageResult<SignInRecordDO> pageResult = signInRecordService.getSignInRecordPage(pageVO);
|
||||
return success(SignInRecordConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户签到积分 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-record:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSignInRecordExcel(@Valid SignInRecordExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<SignInRecordDO> list = signInRecordService.getSignInRecordList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<SignInRecordExcelVO> datas = SignInRecordConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "用户签到积分.xls", "数据", SignInRecordExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户签到积分创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SignInRecordCreateReqVO extends SignInRecordBaseVO {
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Excel VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class SignInRecordExcelVO {
|
||||
|
||||
@ExcelProperty("签到自增id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty("签到用户")
|
||||
private Integer userId;
|
||||
|
||||
@ExcelProperty("第几天签到")
|
||||
private Integer day;
|
||||
|
||||
@ExcelProperty("签到的分数")
|
||||
private Integer point;
|
||||
|
||||
@ExcelProperty("签到时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.convert.pointrecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Convert
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointRecordConvert {
|
||||
|
||||
PointRecordConvert INSTANCE = Mappers.getMapper(PointRecordConvert.class);
|
||||
|
||||
PointRecordDO convert(PointRecordCreateReqVO bean);
|
||||
|
||||
PointRecordDO convert(PointRecordUpdateReqVO bean);
|
||||
|
||||
PointRecordRespVO convert(PointRecordDO bean);
|
||||
|
||||
List<PointRecordRespVO> convertList(List<PointRecordDO> list);
|
||||
|
||||
PageResult<PointRecordRespVO> convertPage(PageResult<PointRecordDO> page);
|
||||
|
||||
List<PointRecordExcelVO> convertList02(List<PointRecordDO> list);
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.convert.signinconfig;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Convert
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface SignInConfigConvert {
|
||||
|
||||
SignInConfigConvert INSTANCE = Mappers.getMapper(SignInConfigConvert.class);
|
||||
|
||||
SignInConfigDO convert(SignInConfigCreateReqVO bean);
|
||||
|
||||
SignInConfigDO convert(SignInConfigUpdateReqVO bean);
|
||||
|
||||
SignInConfigRespVO convert(SignInConfigDO bean);
|
||||
|
||||
List<SignInConfigRespVO> convertList(List<SignInConfigDO> list);
|
||||
|
||||
PageResult<SignInConfigRespVO> convertPage(PageResult<SignInConfigDO> page);
|
||||
|
||||
List<SignInConfigExcelVO> convertList02(List<SignInConfigDO> list);
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.convert.signinrecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Convert
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SignInRecordConvert {
|
||||
|
||||
SignInRecordConvert INSTANCE = Mappers.getMapper(SignInRecordConvert.class);
|
||||
|
||||
SignInRecordDO convert(SignInRecordCreateReqVO bean);
|
||||
|
||||
SignInRecordDO convert(SignInRecordUpdateReqVO bean);
|
||||
|
||||
SignInRecordRespVO convert(SignInRecordDO bean);
|
||||
|
||||
List<SignInRecordRespVO> convertList(List<SignInRecordDO> list);
|
||||
|
||||
PageResult<SignInRecordRespVO> convertPage(PageResult<SignInRecordDO> page);
|
||||
|
||||
List<SignInRecordExcelVO> convertList02(List<SignInRecordDO> list);
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.dal.mysql.pointrecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Mapper
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointRecordMapper extends BaseMapperX<PointRecordDO> {
|
||||
|
||||
default PageResult<PointRecordDO> selectPage(PointRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PointRecordDO>()
|
||||
.eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId())
|
||||
.eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(PointRecordDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(PointRecordDO::getId));
|
||||
}
|
||||
|
||||
default List<PointRecordDO> selectList(PointRecordExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<PointRecordDO>()
|
||||
.eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId())
|
||||
.eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType())
|
||||
.eqIfPresent(PointRecordDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(PointRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.dal.mysql.signinconfig;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Mapper
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Mapper
|
||||
public interface SignInConfigMapper extends BaseMapperX<SignInConfigDO> {
|
||||
|
||||
default PageResult<SignInConfigDO> selectPage(SignInConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SignInConfigDO>()
|
||||
.eqIfPresent(SignInConfigDO::getDay, reqVO.getDay())
|
||||
.orderByAsc(SignInConfigDO::getDay));
|
||||
}
|
||||
|
||||
default List<SignInConfigDO> selectList(SignInConfigExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<SignInConfigDO>()
|
||||
.eqIfPresent(SignInConfigDO::getDay, reqVO.getDay())
|
||||
.orderByDesc(SignInConfigDO::getId));
|
||||
}
|
||||
|
||||
//
|
||||
default long selectSameDayNotSelf(SignInConfigUpdateReqVO reqVO){
|
||||
return selectCount(new LambdaQueryWrapperX <SignInConfigDO>()
|
||||
.ne(SignInConfigDO::getId, reqVO.getId())
|
||||
.eq(SignInConfigDO::getDay,reqVO.getDay())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.dal.mysql.signinrecord;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*;
|
||||
|
||||
/**
|
||||
* 用户签到积分 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SignInRecordMapper extends BaseMapperX<SignInRecordDO> {
|
||||
|
||||
default PageResult<SignInRecordDO> selectPage(SignInRecordPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SignInRecordDO>()
|
||||
.eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(SignInRecordDO::getDay, reqVO.getDay())
|
||||
.betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SignInRecordDO::getId));
|
||||
}
|
||||
|
||||
default List<SignInRecordDO> selectList(SignInRecordExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<SignInRecordDO>()
|
||||
.eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(SignInRecordDO::getDay, reqVO.getDay())
|
||||
.betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SignInRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.service.pointrecord;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Service 接口
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
public interface PointRecordService {
|
||||
|
||||
/**
|
||||
* 创建用户积分记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRecord(@Valid PointRecordCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户积分记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRecord(@Valid PointRecordUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户积分记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户积分记录
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户积分记录
|
||||
*/
|
||||
PointRecordDO getRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户积分记录列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 用户积分记录列表
|
||||
*/
|
||||
List<PointRecordDO> getRecordList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得用户积分记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户积分记录分页
|
||||
*/
|
||||
PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得用户积分记录列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 用户积分记录列表
|
||||
*/
|
||||
List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO);
|
||||
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.service.pointrecord;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert;
|
||||
import cn.iocoder.yudao.module.point.dal.mysql.pointrecord.PointRecordMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Service 实现类
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PointRecordServiceImpl implements PointRecordService {
|
||||
|
||||
@Resource
|
||||
private PointRecordMapper recordMapper;
|
||||
|
||||
@Override
|
||||
public Long createRecord(PointRecordCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
PointRecordDO record = PointRecordConvert.INSTANCE.convert(createReqVO);
|
||||
recordMapper.insert(record);
|
||||
// 返回
|
||||
return record.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRecord(PointRecordUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRecordExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PointRecordDO updateObj = PointRecordConvert.INSTANCE.convert(updateReqVO);
|
||||
recordMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecord(Long id) {
|
||||
// 校验存在
|
||||
validateRecordExists(id);
|
||||
// 删除
|
||||
recordMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRecordExists(Long id) {
|
||||
if (recordMapper.selectById(id) == null) {
|
||||
throw exception(RECORD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointRecordDO getRecord(Long id) {
|
||||
return recordMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointRecordDO> getRecordList(Collection<Long> ids) {
|
||||
return recordMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO) {
|
||||
return recordMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO) {
|
||||
return recordMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.service.signinconfig;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Service 接口
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
public interface SignInConfigService {
|
||||
|
||||
/**
|
||||
* 创建积分签到规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createSignInConfig(@Valid SignInConfigCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新积分签到规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSignInConfig(@Valid SignInConfigUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除积分签到规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSignInConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 积分签到规则
|
||||
*/
|
||||
SignInConfigDO getSignInConfig(Integer id);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 积分签到规则列表
|
||||
*/
|
||||
List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 积分签到规则分页
|
||||
*/
|
||||
PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得积分签到规则列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 积分签到规则列表
|
||||
*/
|
||||
List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO);
|
||||
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
package cn.iocoder.yudao.module.point.service.signinconfig;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert;
|
||||
import cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 积分签到规则 Service 实现类
|
||||
*
|
||||
* @author QingX
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SignInConfigServiceImpl implements SignInConfigService {
|
||||
|
||||
@Resource
|
||||
private SignInConfigMapper signInConfigMapper;
|
||||
|
||||
@Override
|
||||
public Integer createSignInConfig(SignInConfigCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
SignInConfigDO signInConfig = SignInConfigConvert.INSTANCE.convert(createReqVO);
|
||||
//判断是否重复插入签到天数
|
||||
validateSignInConfigExistsDay(signInConfig.getDay());
|
||||
signInConfigMapper.insert(signInConfig);
|
||||
// 返回
|
||||
return signInConfig.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSignInConfig(SignInConfigUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSignInConfigExists(updateReqVO.getId());
|
||||
//判断是否重复插入签到天数
|
||||
validateSignInConfigSameDayNotSelf(updateReqVO);
|
||||
// 判断更新的
|
||||
SignInConfigDO updateObj = SignInConfigConvert.INSTANCE.convert(updateReqVO);
|
||||
|
||||
|
||||
signInConfigMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSignInConfig(Integer id) {
|
||||
// 校验存在
|
||||
validateSignInConfigExists(id);
|
||||
// 删除
|
||||
signInConfigMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSignInConfigExists(Integer id) {
|
||||
if (signInConfigMapper.selectById(id) == null) {
|
||||
throw exception(SIGN_IN_CONFIG_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
//根据签到天数判断是否存在一个相同的天数
|
||||
private void validateSignInConfigExistsDay(Integer day) {
|
||||
if (signInConfigMapper.selectCount(SignInConfigDO::getDay,day)>0) {
|
||||
throw exception(SIGN_IN_CONFIG_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
//更新天数时判断是否有重复的天数,需要去除自己
|
||||
private void validateSignInConfigSameDayNotSelf(SignInConfigUpdateReqVO reqVO) {
|
||||
if (signInConfigMapper.selectSameDayNotSelf(reqVO)>0) {
|
||||
throw exception(SIGN_IN_CONFIG_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SignInConfigDO getSignInConfig(Integer id) {
|
||||
return signInConfigMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids) {
|
||||
return signInConfigMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO) {
|
||||
return signInConfigMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO) {
|
||||
return signInConfigMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue