123
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.cai.controller.admin;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.cai.domain.AccountChangeLog;
|
||||
import com.ruoyi.cai.service.AccountChangeLogService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 账户明细
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cai/accountChangeLog")
|
||||
public class AccountChangeLogController extends BaseController {
|
||||
|
||||
private final AccountChangeLogService accountChangeLogService;
|
||||
|
||||
/**
|
||||
* 查询账户明细列表
|
||||
*/
|
||||
@SaCheckPermission("cai:accountChangeLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AccountChangeLog> list(AccountChangeLog bo, PageQuery pageQuery) {
|
||||
Page<AccountChangeLog> page = accountChangeLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账户明细详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cai:accountChangeLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AccountChangeLog> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(accountChangeLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账户明细
|
||||
*/
|
||||
@SaCheckPermission("cai:accountChangeLog:add")
|
||||
@Log(title = "账户明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AccountChangeLog bo) {
|
||||
return toAjax(accountChangeLogService.save(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账户明细
|
||||
*/
|
||||
@SaCheckPermission("cai:accountChangeLog:edit")
|
||||
@Log(title = "账户明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AccountChangeLog bo) {
|
||||
return toAjax(accountChangeLogService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账户明细
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cai:accountChangeLog:remove")
|
||||
@Log(title = "账户明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(accountChangeLogService.removeBatchByIds(Arrays.asList(ids)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.cai.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 账户明细对象 cai_account_change_log
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("cai_account_change_log")
|
||||
public class AccountChangeLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 积分记录ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 蜜瓜号
|
||||
*/
|
||||
private String usercode;
|
||||
/**
|
||||
* 账户类型 1-余额 2-收益
|
||||
*/
|
||||
private Integer accountType;
|
||||
/**
|
||||
* 类别
|
||||
*/
|
||||
private Integer cateId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private Integer cateName;
|
||||
/**
|
||||
* 业务码
|
||||
*/
|
||||
private Long businessCode;
|
||||
/**
|
||||
* 变化值,为正 或者为负
|
||||
*/
|
||||
private BigDecimal changeValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 操作IP
|
||||
*/
|
||||
private String operateIp;
|
||||
/**
|
||||
* 是否为后台用户手动调整
|
||||
*/
|
||||
private Integer isAdmin;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cai.domain.AccountChangeLog;
|
||||
|
||||
/**
|
||||
* 账户明细Mapper接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-05
|
||||
*/
|
||||
public interface AccountChangeLogMapper extends BaseMapper<AccountChangeLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cai.domain.AccountChangeLog;
|
||||
|
||||
/**
|
||||
* 账户明细Service接口
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-05
|
||||
*/
|
||||
public interface AccountChangeLogService extends IService<AccountChangeLog> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.cai.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cai.domain.AccountChangeLog;
|
||||
import com.ruoyi.cai.mapper.AccountChangeLogMapper;
|
||||
import com.ruoyi.cai.service.AccountChangeLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 账户明细Service业务层处理
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-01-05
|
||||
*/
|
||||
@Service
|
||||
public class AccountChangeLogServiceImpl extends ServiceImpl<AccountChangeLogMapper,AccountChangeLog> implements AccountChangeLogService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.ruoyi.cai.mapper.AccountChangeLogMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.cai.domain.AccountChangeLog" id="AccountChangeLogResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="usercode" column="usercode"/>
|
||||
<result property="accountType" column="account_type"/>
|
||||
<result property="cateId" column="cate_id"/>
|
||||
<result property="cateName" column="cate_name"/>
|
||||
<result property="businessCode" column="business_code"/>
|
||||
<result property="changeValue" column="change_value"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="operateIp" column="operate_ip"/>
|
||||
<result property="isAdmin" column="is_admin"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user