添加账户相关类
This commit is contained in:
parent
7bfa938679
commit
11fc93790e
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.business.controller;
|
package com.ruoyi.business.ajax;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelReader;
|
import com.alibaba.excel.ExcelReader;
|
||||||
|
|
@ -17,7 +17,7 @@ import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/data")
|
@RequestMapping("/ajax/data")
|
||||||
public class SyncDataController extends BaseController {
|
public class SyncDataController extends BaseController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.ruoyi.business.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员账户对象 biz_account
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-14
|
||||||
|
*/
|
||||||
|
public class BizAccount extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 会员账户ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 会员ID */
|
||||||
|
@Excel(name = "会员ID")
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
/** 账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田 */
|
||||||
|
@Excel(name = "账户类型:0-福豆余额,1-个人福豆,2-团队福豆,3-专项福豆,4-福豆田")
|
||||||
|
private Integer accountType;
|
||||||
|
|
||||||
|
/** 账户金额 */
|
||||||
|
@Excel(name = "账户金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setMemberId(Long memberId)
|
||||||
|
{
|
||||||
|
this.memberId = memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberId()
|
||||||
|
{
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
public void setAccountType(Integer accountType)
|
||||||
|
{
|
||||||
|
this.accountType = accountType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAccountType()
|
||||||
|
{
|
||||||
|
return accountType;
|
||||||
|
}
|
||||||
|
public void setAmount(BigDecimal amount)
|
||||||
|
{
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAmount()
|
||||||
|
{
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("memberId", getMemberId())
|
||||||
|
.append("accountType", getAccountType())
|
||||||
|
.append("amount", getAmount())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ruoyi.business.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.business.domain.BizAccount;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员账户Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-14
|
||||||
|
*/
|
||||||
|
public interface BizAccountMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询会员账户
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 会员账户
|
||||||
|
*/
|
||||||
|
public BizAccount selectBizAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员账户列表
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 会员账户集合
|
||||||
|
*/
|
||||||
|
public List<BizAccount> selectBizAccountList(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBizAccount(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBizAccount(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员账户
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员账户
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizAccountByIds(String[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ruoyi.business.service;
|
||||||
|
|
||||||
|
import com.ruoyi.business.domain.BizAccount;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员账户Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-14
|
||||||
|
*/
|
||||||
|
public interface IBizAccountService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询会员账户
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 会员账户
|
||||||
|
*/
|
||||||
|
public BizAccount selectBizAccountById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员账户列表
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 会员账户集合
|
||||||
|
*/
|
||||||
|
public List<BizAccount> selectBizAccountList(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBizAccount(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBizAccount(BizAccount bizAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员账户
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizAccountByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员账户信息
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizAccountById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.ruoyi.business.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.business.domain.BizAccount;
|
||||||
|
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||||
|
import com.ruoyi.business.service.IBizAccountService;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员账户Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BizAccountServiceImpl implements IBizAccountService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BizAccountMapper bizAccountMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员账户
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 会员账户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BizAccount selectBizAccountById(Long id)
|
||||||
|
{
|
||||||
|
return bizAccountMapper.selectBizAccountById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员账户列表
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 会员账户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BizAccount> selectBizAccountList(BizAccount bizAccount)
|
||||||
|
{
|
||||||
|
return bizAccountMapper.selectBizAccountList(bizAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBizAccount(BizAccount bizAccount)
|
||||||
|
{
|
||||||
|
bizAccount.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return bizAccountMapper.insertBizAccount(bizAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员账户
|
||||||
|
*
|
||||||
|
* @param bizAccount 会员账户
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBizAccount(BizAccount bizAccount)
|
||||||
|
{
|
||||||
|
bizAccount.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return bizAccountMapper.updateBizAccount(bizAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员账户对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBizAccountByIds(String ids)
|
||||||
|
{
|
||||||
|
return bizAccountMapper.deleteBizAccountByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员账户信息
|
||||||
|
*
|
||||||
|
* @param id 会员账户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBizAccountById(Long id)
|
||||||
|
{
|
||||||
|
return bizAccountMapper.deleteBizAccountById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?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.business.mapper.BizAccountMapper">
|
||||||
|
|
||||||
|
<resultMap type="BizAccount" id="BizAccountResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="memberId" column="member_id" />
|
||||||
|
<result property="accountType" column="account_type" />
|
||||||
|
<result property="amount" column="amount" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBizAccountVo">
|
||||||
|
select id, member_id, account_type, amount, create_by, create_time, update_by, update_time from biz_account
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBizAccountList" parameterType="BizAccount" resultMap="BizAccountResult">
|
||||||
|
<include refid="selectBizAccountVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||||
|
<if test="accountType != null "> and account_type = #{accountType}</if>
|
||||||
|
<if test="amount != null "> and amount = #{amount}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBizAccountById" parameterType="Long" resultMap="BizAccountResult">
|
||||||
|
<include refid="selectBizAccountVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBizAccount" parameterType="BizAccount" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into biz_account
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">member_id,</if>
|
||||||
|
<if test="accountType != null">account_type,</if>
|
||||||
|
<if test="amount != null">amount,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">#{memberId},</if>
|
||||||
|
<if test="accountType != null">#{accountType},</if>
|
||||||
|
<if test="amount != null">#{amount},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBizAccount" parameterType="BizAccount">
|
||||||
|
update biz_account
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
|
<if test="accountType != null">account_type = #{accountType},</if>
|
||||||
|
<if test="amount != null">amount = #{amount},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBizAccountById" parameterType="Long">
|
||||||
|
delete from biz_account where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBizAccountByIds" parameterType="String">
|
||||||
|
delete from biz_account where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -275,6 +275,7 @@ public class ShiroConfig
|
||||||
filterChainDefinitionMap.put("/docs/**", "anon");
|
filterChainDefinitionMap.put("/docs/**", "anon");
|
||||||
filterChainDefinitionMap.put("/fonts/**", "anon");
|
filterChainDefinitionMap.put("/fonts/**", "anon");
|
||||||
filterChainDefinitionMap.put("/img/**", "anon");
|
filterChainDefinitionMap.put("/img/**", "anon");
|
||||||
|
// 前端所有接口放行
|
||||||
filterChainDefinitionMap.put("/ajax/**", "anon");
|
filterChainDefinitionMap.put("/ajax/**", "anon");
|
||||||
filterChainDefinitionMap.put("/js/**", "anon");
|
filterChainDefinitionMap.put("/js/**", "anon");
|
||||||
filterChainDefinitionMap.put("/ruoyi/**", "anon");
|
filterChainDefinitionMap.put("/ruoyi/**", "anon");
|
||||||
|
|
@ -285,8 +286,6 @@ public class ShiroConfig
|
||||||
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
|
filterChainDefinitionMap.put("/login", "anon,captchaValidate");
|
||||||
// 注册相关
|
// 注册相关
|
||||||
filterChainDefinitionMap.put("/register", "anon,captchaValidate");
|
filterChainDefinitionMap.put("/register", "anon,captchaValidate");
|
||||||
// 前端所有接口放行
|
|
||||||
filterChainDefinitionMap.put("/api/**", "anon");
|
|
||||||
// 系统权限列表
|
// 系统权限列表
|
||||||
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
|
// filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue