feat:积分管理
This commit is contained in:
1 parent
24ca3f57cb
commit
c439bf4c4c
17 files changed
+709
-1
No files matched your search
@@ -708,4 +708,53 @@ CREATE TABLE mch_pick_up_join
|
||||
mch_id bigint NOT NULL COMMENT '商户id',
|
||||
mch_pick_up_id bigint NOT NULL COMMENT '自提点id',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='商户自提点关联表';
|
||||
) ENGINE = InnoDB COMMENT ='商户自提点关联表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for integral_manage
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS integral_manage;
|
||||
CREATE TABLE integral_manage
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '创建者',
|
||||
|
||||
user_id bigint default NULL COMMENT '用户id',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
|
||||
integral_num int NOT NULL DEFAULT 0 COMMENT '积分总数',
|
||||
total_expense int NOT NULL DEFAULT 0 COMMENT '累计积分支出',
|
||||
total_recharge int NOT NULL DEFAULT 0 COMMENT '累计积分获得',
|
||||
integral_freeze int NOT NULL DEFAULT 0 COMMENT '冻结积分数',
|
||||
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='积分管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for integral_transaction
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS integral_transaction;
|
||||
CREATE TABLE integral_transaction
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '创建者',
|
||||
integral_id bigint NOT NULL COMMENT '积分总数',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
biz_type varchar(256) NOT NULL COMMENT '关联类型',
|
||||
biz_id varchar(64) NOT NULL COMMENT '关联业务编号',
|
||||
title varchar(128) NOT NULL COMMENT '流水标题',
|
||||
integral_num int NOT NULL COMMENT '流水积分',
|
||||
integral_balance int NOT NULL COMMENT '积分余额',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='积分记录';
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralManageDto extends IntegralManageEntity {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralTransactionDto extends IntegralTransactionEntity {
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("integral_manage")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户积分")
|
||||
public class IntegralManageEntity extends Model<IntegralManageEntity> {
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "创建者")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 积分总数
|
||||
*/
|
||||
@Schema(description = "积分总数")
|
||||
private Integer integralNum;
|
||||
|
||||
/**
|
||||
* 累计积分支出
|
||||
*/
|
||||
@Schema(description = "累计积分支出")
|
||||
private Integer totalExpense;
|
||||
|
||||
/**
|
||||
* 累计积分获得
|
||||
*/
|
||||
@Schema(description = "累计积分获得")
|
||||
private Integer totalRecharge;
|
||||
|
||||
/**
|
||||
* 冻结积分数
|
||||
*/
|
||||
@Schema(description = "冻结积分数")
|
||||
private Integer integralFreeze;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 积分记录
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("integral_transaction")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "积分记录")
|
||||
public class IntegralTransactionEntity extends Model<IntegralTransactionEntity> {
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "创建者")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 积分总数
|
||||
*/
|
||||
@Schema(description = "积分总数")
|
||||
private Long integralId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 关联类型
|
||||
*/
|
||||
@Schema(description = "关联类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 关联业务编号
|
||||
*/
|
||||
@Schema(description = "关联业务编号")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 流水标题
|
||||
*/
|
||||
@Schema(description = "流水标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 流水积分
|
||||
*/
|
||||
@Schema(description = "流水积分")
|
||||
private Integer integralNum;
|
||||
|
||||
/**
|
||||
* 积分余额
|
||||
*/
|
||||
@Schema(description = "积分余额")
|
||||
private Integer integralBalance;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralManageVo extends IntegralManageEntity {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.integral;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralTransactionVo extends IntegralTransactionEntity {
|
||||
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.bsd.pjcloud.wallet.controller.Integral;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/integral-manage")
|
||||
@Tag(description = "integralManage", name = "用户积分管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class IntegralManageController {
|
||||
|
||||
private final IntegralManageService integralManageService;
|
||||
|
||||
/**
|
||||
* 查询分页页面
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_view')")
|
||||
public R<Page<IntegralManageVo>> getIntegralManagePage(@ParameterObject Page page, @ParameterObject IntegralManageDto dto) {
|
||||
return R.ok(integralManageService.scopePageList(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询用户积分
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(integralManageService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户积分
|
||||
*/
|
||||
@Operation(summary = "新增用户积分", description = "新增用户积分")
|
||||
@SysLog("新增用户积分")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_add')")
|
||||
public R save(@RequestBody IntegralManageEntity integralManage) {
|
||||
return R.ok(integralManageService.save(integralManage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户积分
|
||||
*/
|
||||
@Operation(summary = "修改用户积分", description = "修改用户积分")
|
||||
@SysLog("修改用户积分")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_edit')")
|
||||
public R updateById(@RequestBody IntegralManageEntity integralManage) {
|
||||
return R.ok(integralManageService.updateById(integralManage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除用户积分
|
||||
*/
|
||||
@Operation(summary = "通过id删除用户积分", description = "通过id删除用户积分")
|
||||
@SysLog("通过id删除用户积分")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(integralManageService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralManage_export')")
|
||||
public List<IntegralManageEntity> export(IntegralManageEntity integralManage, Long[] ids) {
|
||||
return integralManageService.list(Wrappers.lambdaQuery(integralManage).in(ArrayUtil.isNotEmpty(ids), IntegralManageEntity::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.bsd.pjcloud.wallet.controller.Integral;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralTransactionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 积分记录
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/integralTransaction")
|
||||
@Tag(description = "integralTransaction", name = "积分记录管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class IntegralTransactionController {
|
||||
|
||||
private final IntegralTransactionService integralTransactionService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_view')")
|
||||
public R getIntegralTransactionPage(@ParameterObject Page page, @ParameterObject IntegralTransactionDto dto) {
|
||||
return R.ok(integralTransactionService.scopePageList(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询积分记录
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(integralTransactionService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增积分记录
|
||||
*/
|
||||
@Operation(summary = "新增积分记录", description = "新增积分记录")
|
||||
@SysLog("新增积分记录")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_add')")
|
||||
public R save(@RequestBody IntegralTransactionEntity integralTransaction) {
|
||||
return R.ok(integralTransactionService.save(integralTransaction));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分记录
|
||||
*/
|
||||
@Operation(summary = "修改积分记录", description = "修改积分记录")
|
||||
@SysLog("修改积分记录")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_edit')")
|
||||
public R updateById(@RequestBody IntegralTransactionEntity integralTransaction) {
|
||||
return R.ok(integralTransactionService.updateById(integralTransaction));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除积分记录
|
||||
*/
|
||||
@Operation(summary = "通过id删除积分记录", description = "通过id删除积分记录")
|
||||
@SysLog("通过id删除积分记录")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(integralTransactionService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_integralTransaction_export')")
|
||||
public List<IntegralTransactionEntity> export(IntegralTransactionEntity integralTransaction, Long[] ids) {
|
||||
return integralTransactionService.list(Wrappers.lambdaQuery(integralTransaction).in(ArrayUtil.isNotEmpty(ids), IntegralTransactionEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface IntegralManageMapper extends PjcloudBaseMapper<IntegralManageEntity> {
|
||||
|
||||
Page<IntegralManageVo> scopePageList(Page page, @Param("dto") IntegralManageDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface IntegralTransactionMapper extends PjcloudBaseMapper<IntegralTransactionEntity> {
|
||||
|
||||
Page<IntegralTransactionVo> scopePageList(Page page, @Param("dto") IntegralTransactionDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
|
||||
public interface IntegralManageService extends IService<IntegralManageEntity> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
Page<IntegralManageVo> scopePageList(Page page, IntegralManageDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
|
||||
public interface IntegralTransactionService extends IService<IntegralTransactionEntity> {
|
||||
|
||||
Page<IntegralTransactionVo> scopePageList(Page page, IntegralTransactionDto dto, DataScope dataScope);
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.integral.IntegralManageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralManageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 用户积分
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper, IntegralManageEntity> implements IntegralManageService {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Override
|
||||
public Page<IntegralManageVo> scopePageList(Page page, IntegralManageDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageList(page, dto, dataScope);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.integral;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.integral.IntegralTransactionMapper;
|
||||
import com.bsd.pjcloud.wallet.service.IntegralTransactionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 积分记录
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class IntegralTransactionServiceImpl extends ServiceImpl<IntegralTransactionMapper, IntegralTransactionEntity> implements IntegralTransactionService {
|
||||
|
||||
@Override
|
||||
public Page<IntegralTransactionVo> scopePageList(Page page, IntegralTransactionDto dto, DataScope dataScope) {
|
||||
return baseMapper.scopePageList(page, dto, dataScope);
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?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="com.bsd.pjcloud.wallet.mapper.integral.IntegralManageMapper">
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.dept_id,
|
||||
a.integral_num,
|
||||
a.total_expense,
|
||||
a.total_recharge,
|
||||
a.integral_freeze,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.userId != null">
|
||||
and a.user_id = #{dto.userId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.integral.IntegralManageVo">
|
||||
<include refid="selectA"/>
|
||||
from integral_manage a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?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="com.bsd.pjcloud.wallet.mapper.integral.IntegralTransactionMapper">
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.integral_id,
|
||||
a.dept_id,
|
||||
a.biz_type,
|
||||
a.biz_id,
|
||||
a.title,
|
||||
a.integral_num,
|
||||
a.integral_balance,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.integralId != null">
|
||||
and a.integral_id = #{dto.integralId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.integral.IntegralTransactionVo">
|
||||
<include refid="selectA"/>
|
||||
from integral_transaction a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc, a.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user