Merge remote-tracking branch 'origin/main'
commit
9956a27d2a
|
@ -1,124 +0,0 @@
|
|||
package com.ff.agent.contoller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.agent.dto.AgentTenantSecretKeyDTO;
|
||||
import com.ff.agent.request.AgentCreateTenantRequest;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ISysDeptService;
|
||||
import com.ff.base.system.service.ISysRoleService;
|
||||
import com.ff.base.system.service.ISysUserService;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/tenant")
|
||||
@Slf4j
|
||||
public class AgentController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
@Resource
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Resource
|
||||
private ISysDeptService deptService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService userService;
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param tenantSecretKeyDTO 租户密钥
|
||||
* @return {@link TableDataInfo }
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:list')")
|
||||
public TableDataInfo list(TenantSecretKeyDTO tenantSecretKeyDTO) {
|
||||
startPage();
|
||||
tenantSecretKeyDTO.setAgentId(getUserId());
|
||||
List<TenantSecretKey> tenantSecretKeys = tenantSecretKeyService.selectTenantSecretKeyDTOList(tenantSecretKeyDTO);
|
||||
TableDataInfo dataTable = getDataTable(tenantSecretKeys);
|
||||
List<AgentTenantSecretKeyDTO> list=new ArrayList<>();
|
||||
for (TenantSecretKey row : (List<TenantSecretKey>) dataTable.getRows()) {
|
||||
AgentTenantSecretKeyDTO agentTenantSecretKeyDTO=new AgentTenantSecretKeyDTO();
|
||||
BeanUtils.copyProperties(row, agentTenantSecretKeyDTO);
|
||||
list.add(agentTenantSecretKeyDTO);
|
||||
}
|
||||
dataTable.setRows(list);
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:create')")
|
||||
public AjaxResult createTenant(@Validated @RequestBody AgentCreateTenantRequest agentCreateTenantRequest) {
|
||||
|
||||
Assert.isTrue(CollectionUtils.isEmpty(tenantSecretKeyService.selectTenantSecretKeyList(TenantSecretKey.builder()
|
||||
.tenantKey(agentCreateTenantRequest.getAccount())
|
||||
.build())), MessageUtils.message("operation.tenant.account.already.used"));
|
||||
|
||||
Assert.isTrue(agentCreateTenantRequest.getPassword().equals(agentCreateTenantRequest.getConfirmPassword()),MessageUtils.message("operation.password.mismatch"));
|
||||
//创建租户
|
||||
TenantSecretKey tenantSecretKey = new TenantSecretKey();
|
||||
tenantSecretKey.setAgentId(getUserId());
|
||||
tenantSecretKey.setTenantKey(agentCreateTenantRequest.getAccount());
|
||||
tenantSecretKey.setPassword(SecurityUtils.encryptPassword(agentCreateTenantRequest.getPassword()));
|
||||
tenantSecretKey.setTenantSn(tenantSecretKeyService.generateTenantSn());
|
||||
tenantSecretKey.setTenantSecret(IdUtils.simpleUUID());
|
||||
tenantSecretKey.setDepositRatio(agentCreateTenantRequest.getDepositRatio());
|
||||
tenantSecretKey.setTenantType(agentCreateTenantRequest.getTenantType());
|
||||
tenantSecretKey.setCreateBy(getUsername());
|
||||
tenantSecretKey.setTenantStatus(Boolean.TRUE);
|
||||
int insertedTenantSecretKey = tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey);
|
||||
|
||||
|
||||
return toAjax(insertedTenantSecretKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户租户密钥Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/key")
|
||||
public class TenantSecretKeyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
/**
|
||||
* 查询用户租户密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
startPage();
|
||||
List<TenantSecretKey> list = tenantSecretKeyService.selectTenantSecretKeyList(tenantSecretKey);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户租户密钥列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:export')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
List<TenantSecretKey> list = tenantSecretKeyService.selectTenantSecretKeyList(tenantSecretKey);
|
||||
ExcelUtil<TenantSecretKey> util = new ExcelUtil<TenantSecretKey>(TenantSecretKey.class);
|
||||
util.exportExcel(response, list, "用户租户密钥数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户租户密钥详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantSecretKeyService.selectTenantSecretKeyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:add')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:edit')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantSecretKey tenantSecretKey)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.updateTenantSecretKey(tenantSecretKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户租户密钥
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:key:remove')")
|
||||
@Log(title = "用户租户密钥", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(tenantSecretKeyService.deleteTenantSecretKeyByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.ff.common.domain;
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 代理对象 ff_tenant_agent
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 代理状态 1正常 0停用 */
|
||||
@Excel(name = "代理状态 1正常 0停用")
|
||||
private Boolean agentStatus;
|
||||
|
||||
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
package com.ff.member.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 会员Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/member/member")
|
||||
public class MemberController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMemberService memberService;
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Member member)
|
||||
{
|
||||
startPage();
|
||||
List<Member> list = memberService.selectMemberList(member);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出会员列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:export')")
|
||||
@Log(title = "会员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Member member)
|
||||
{
|
||||
List<Member> list = memberService.selectMemberList(member);
|
||||
ExcelUtil<Member> util = new ExcelUtil<Member>(Member.class);
|
||||
util.exportExcel(response, list, "会员数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(memberService.selectMemberById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:add')")
|
||||
@Log(title = "会员", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Member member)
|
||||
{
|
||||
return toAjax(memberService.insertMember(member));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:edit')")
|
||||
@Log(title = "会员", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Member member)
|
||||
{
|
||||
return toAjax(memberService.updateMember(member));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('member:member:remove')")
|
||||
@Log(title = "会员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(memberService.deleteMemberByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
<?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.ff.common.mapper.TenantAgentMapper">
|
||||
|
||||
<resultMap type="TenantAgent" id="TenantAgentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="account" column="account" />
|
||||
<result property="password" column="password" />
|
||||
<result property="agentStatus" column="agent_status" />
|
||||
<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="selectTenantAgentVo">
|
||||
select id, account, password, agent_status, create_by, create_time, update_by, update_time from ff_tenant_agent
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantAgentList" parameterType="TenantAgent" resultMap="TenantAgentResult">
|
||||
<include refid="selectTenantAgentVo"/>
|
||||
<where>
|
||||
<if test="account != null and account != ''"> and account = #{account}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="agentStatus != null "> and agent_status = #{agentStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantAgentById" parameterType="Long" resultMap="TenantAgentResult">
|
||||
<include refid="selectTenantAgentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTenantAgent" parameterType="TenantAgent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_agent
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||
<if test="account != null">account,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="agentStatus != null">agent_status,</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="id != null">#{id},</if>
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="agentStatus != null">#{agentStatus},</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="updateTenantAgent" parameterType="TenantAgent">
|
||||
update ff_tenant_agent
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="account != null">account = #{account},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="agentStatus != null">agent_status = #{agentStatus},</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="deleteTenantAgentById" parameterType="Long">
|
||||
delete from ff_tenant_agent where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantAgentByIds" parameterType="String">
|
||||
delete from ff_tenant_agent where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,156 +0,0 @@
|
|||
<?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.ff.common.mapper.TenantGameQuotaFlowMapper">
|
||||
|
||||
<resultMap type="TenantGameQuotaFlow" id="TenantGameQuotaFlowResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="quotaType" column="quota_type" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="platformCode" column="platform_code" />
|
||||
<result property="currencyCode" column="currency_code" />
|
||||
<result property="isOut" column="is_out" />
|
||||
<result property="operationType" column="operation_type" />
|
||||
<result property="balanceBefore" column="balance_before" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="exchangeRatio" column="exchange_ratio" />
|
||||
<result property="exchangeMoney" column="exchange_money" />
|
||||
<result property="balanceAfter" column="balance_after" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="selectTenantGameQuotaFlowVo">
|
||||
select id, tenant_key, quota_type, member_id, platform_code, currency_code, is_out, operation_type, balance_before, balance, exchange_ratio, exchange_money, balance_after, remark, create_by, create_time, update_by, update_time from ff_tenant_game_quota_flow
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantGameQuotaFlowList" parameterType="TenantGameQuotaFlow" resultMap="TenantGameQuotaFlowResult">
|
||||
<include refid="selectTenantGameQuotaFlowVo"/>
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="quotaType != null and quotaType != ''"> and quota_type = #{quotaType}</if>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if>
|
||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
||||
<if test="isOut != null "> and is_out = #{isOut}</if>
|
||||
<if test="operationType != null "> and operation_type = #{operationType}</if>
|
||||
<if test="balanceBefore != null "> and balance_before = #{balanceBefore}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="exchangeRatio != null "> and exchange_ratio = #{exchangeRatio}</if>
|
||||
<if test="exchangeMoney != null "> and exchange_money = #{exchangeMoney}</if>
|
||||
<if test="balanceAfter != null "> and balance_after = #{balanceAfter}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantGameQuotaFlowById" parameterType="Long" resultMap="TenantGameQuotaFlowResult">
|
||||
<include refid="selectTenantGameQuotaFlowVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTenantGameQuotaFlow" parameterType="TenantGameQuotaFlow" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_game_quota_flow
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="quotaType != null">quota_type,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="platformCode != null">platform_code,</if>
|
||||
<if test="currencyCode != null">currency_code,</if>
|
||||
<if test="isOut != null">is_out,</if>
|
||||
<if test="operationType != null">operation_type,</if>
|
||||
<if test="balanceBefore != null">balance_before,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="exchangeRatio != null">exchange_ratio,</if>
|
||||
<if test="exchangeMoney != null">exchange_money,</if>
|
||||
<if test="balanceAfter != null">balance_after,</if>
|
||||
<if test="remark != null">remark,</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="id != null">#{id},</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="quotaType != null">#{quotaType},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="platformCode != null">#{platformCode},</if>
|
||||
<if test="currencyCode != null">#{currencyCode},</if>
|
||||
<if test="isOut != null">#{isOut},</if>
|
||||
<if test="operationType != null">#{operationType},</if>
|
||||
<if test="balanceBefore != null">#{balanceBefore},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="exchangeRatio != null">#{exchangeRatio},</if>
|
||||
<if test="exchangeMoney != null">#{exchangeMoney},</if>
|
||||
<if test="balanceAfter != null">#{balanceAfter},</if>
|
||||
<if test="remark != null">#{remark},</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="updateTenantGameQuotaFlow" parameterType="TenantGameQuotaFlow">
|
||||
update ff_tenant_game_quota_flow
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="quotaType != null">quota_type = #{quotaType},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="platformCode != null">platform_code = #{platformCode},</if>
|
||||
<if test="currencyCode != null">currency_code = #{currencyCode},</if>
|
||||
<if test="isOut != null">is_out = #{isOut},</if>
|
||||
<if test="operationType != null">operation_type = #{operationType},</if>
|
||||
<if test="balanceBefore != null">balance_before = #{balanceBefore},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="exchangeRatio != null">exchange_ratio = #{exchangeRatio},</if>
|
||||
<if test="exchangeMoney != null">exchange_money = #{exchangeMoney},</if>
|
||||
<if test="balanceAfter != null">balance_after = #{balanceAfter},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="deleteTenantGameQuotaFlowById" parameterType="Long">
|
||||
delete from ff_tenant_game_quota_flow where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantGameQuotaFlowByIds" parameterType="String">
|
||||
delete from ff_tenant_game_quota_flow where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getExchangeMoneyByMemberId" parameterType="TenantGameQuotaFlow" resultType="java.math.BigDecimal">
|
||||
select ifnull(sum(exchange_money),0) from ff_tenant_game_quota_flow
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="quotaType != null and quotaType != ''"> and quota_type = #{quotaType}</if>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="isOut != null "> and is_out = #{isOut}</if>
|
||||
<if test="operationType != null "> and operation_type = #{operationType}</if>
|
||||
<if test="balanceBefore != null "> and balance_before = #{balanceBefore}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="balanceAfter != null "> and balance_after = #{balanceAfter}</if>
|
||||
</where>
|
||||
group by member_id
|
||||
</select>
|
||||
|
||||
<select id="getBalanceByTenantKey" resultMap="TenantGameQuotaFlowResult">
|
||||
select tenant_key, sum(if(is_out,exchange_money,0))-sum(if(!is_out,exchange_money,0)) as exchange_money,currency_code
|
||||
from ff_tenant_game_quota_flow
|
||||
where create_time between #{params.beginTime} and #{params.endTime}
|
||||
and quota_type =#{quotaType} and operation_type = #{operationType}
|
||||
group by tenant_key,currency_code
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -1,97 +0,0 @@
|
|||
<?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.ff.common.mapper.TenantGameQuotaMapper">
|
||||
|
||||
<resultMap type="TenantGameQuota" id="TenantGameQuotaResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="quotaType" column="quota_type" />
|
||||
<result property="version" column="version" />
|
||||
<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="selectTenantGameQuotaVo">
|
||||
select id, tenant_key, balance, quota_type, version, create_by, create_time, update_by, update_time from ff_tenant_game_quota
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantGameQuotaByTenantKey" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
where tenant_key = #{tenantKey} and quota_type = #{quotaType}
|
||||
</select>
|
||||
|
||||
<select id="selectTenantGameQuotaList" parameterType="TenantGameQuota" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="quotaType != null and quotaType != ''"> and quota_type = #{quotaType}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantGameQuotaById" parameterType="Long" resultMap="TenantGameQuotaResult">
|
||||
<include refid="selectTenantGameQuotaVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="changeBalance" parameterType="TenantGameQuota">
|
||||
update ff_tenant_game_quota set balance = #{balance},version =version+1
|
||||
where tenant_key = #{tenantKey} and quota_type = #{quotaType} and version = #{version}
|
||||
</update>
|
||||
|
||||
<insert id="insertTenantGameQuota" parameterType="TenantGameQuota" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_game_quota
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="quotaType != null">quota_type,</if>
|
||||
<if test="version != null">version,</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="id != null">#{id},</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="quotaType != null">#{quotaType},</if>
|
||||
<if test="version != null">#{version},</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="updateTenantGameQuota" parameterType="TenantGameQuota">
|
||||
update ff_tenant_game_quota
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="quotaType != null">quota_type = #{quotaType},</if>
|
||||
<if test="version != null">version = #{version},</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="deleteTenantGameQuotaById" parameterType="Long">
|
||||
delete from ff_tenant_game_quota where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantGameQuotaByIds" parameterType="String">
|
||||
delete from ff_tenant_game_quota where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,137 +0,0 @@
|
|||
<?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.ff.game.mapper.GameExchangeMoneyMapper">
|
||||
|
||||
<resultMap type="GameExchangeMoney" id="GameExchangeMoneyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="currencyCode" column="currency_code" />
|
||||
<result property="transactionId" column="transaction_id" />
|
||||
<result property="memberId" column="member_id" />
|
||||
<result property="platformCode" column="platform_code" />
|
||||
<result property="balance" column="balance" />
|
||||
<result property="quota" column="quota" />
|
||||
<result property="coinBefore" column="coin_before" />
|
||||
<result property="coinAfter" column="coin_after" />
|
||||
<result property="currencyBefore" column="currency_before" />
|
||||
<result property="currencyAfter" column="currency_after" />
|
||||
<result property="exchangeType" column="exchange_type" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectGameExchangeMoneyVo">
|
||||
select id, tenant_key,order_id, currency_code, transaction_id, member_id, platform_code, balance, quota, coin_before, coin_after, currency_before, currency_after, exchange_type, status, create_by, create_time, update_by, update_time from ff_game_exchange_money
|
||||
</sql>
|
||||
|
||||
<select id="selectGameExchangeMoneyList" parameterType="GameExchangeMoney" resultMap="GameExchangeMoneyResult">
|
||||
<include refid="selectGameExchangeMoneyVo"/>
|
||||
<where>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
||||
<if test="transactionId != null and transactionId != ''"> and transaction_id = #{transactionId}</if>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if>
|
||||
<if test="balance != null "> and balance = #{balance}</if>
|
||||
<if test="quota != null "> and quota = #{quota}</if>
|
||||
<if test="coinBefore != null "> and coin_before = #{coinBefore}</if>
|
||||
<if test="coinAfter != null "> and coin_after = #{coinAfter}</if>
|
||||
<if test="currencyBefore != null "> and currency_before = #{currencyBefore}</if>
|
||||
<if test="currencyAfter != null "> and currency_after = #{currencyAfter}</if>
|
||||
<if test="exchangeType != null "> and exchange_type = #{exchangeType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGameExchangeMoneyById" parameterType="Long" resultMap="GameExchangeMoneyResult">
|
||||
<include refid="selectGameExchangeMoneyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertGameExchangeMoney" parameterType="GameExchangeMoney" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_game_exchange_money
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||
<if test="tenantKey != null">tenant_key,</if>
|
||||
<if test="currencyCode != null">currency_code,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="transactionId != null">transaction_id,</if>
|
||||
<if test="memberId != null">member_id,</if>
|
||||
<if test="platformCode != null">platform_code,</if>
|
||||
<if test="balance != null">balance,</if>
|
||||
<if test="quota != null">quota,</if>
|
||||
<if test="coinBefore != null">coin_before,</if>
|
||||
<if test="coinAfter != null">coin_after,</if>
|
||||
<if test="currencyBefore != null">currency_before,</if>
|
||||
<if test="currencyAfter != null">currency_after,</if>
|
||||
<if test="exchangeType != null">exchange_type,</if>
|
||||
<if test="status != null">status,</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="id != null">#{id},</if>
|
||||
<if test="tenantKey != null">#{tenantKey},</if>
|
||||
<if test="currencyCode != null">#{currencyCode},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="transactionId != null">#{transactionId},</if>
|
||||
<if test="memberId != null">#{memberId},</if>
|
||||
<if test="platformCode != null">#{platformCode},</if>
|
||||
<if test="balance != null">#{balance},</if>
|
||||
<if test="quota != null">#{quota},</if>
|
||||
<if test="coinBefore != null">#{coinBefore},</if>
|
||||
<if test="coinAfter != null">#{coinAfter},</if>
|
||||
<if test="currencyBefore != null">#{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">#{currencyAfter},</if>
|
||||
<if test="exchangeType != null">#{exchangeType},</if>
|
||||
<if test="status != null">#{status},</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="updateGameExchangeMoney" parameterType="GameExchangeMoney">
|
||||
update ff_game_exchange_money
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null">tenant_key = #{tenantKey},</if>
|
||||
<if test="currencyCode != null">currency_code = #{currencyCode},</if>
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="transactionId != null">transaction_id = #{transactionId},</if>
|
||||
<if test="memberId != null">member_id = #{memberId},</if>
|
||||
<if test="platformCode != null">platform_code = #{platformCode},</if>
|
||||
<if test="balance != null">balance = #{balance},</if>
|
||||
<if test="quota != null">quota = #{quota},</if>
|
||||
<if test="coinBefore != null">coin_before = #{coinBefore},</if>
|
||||
<if test="coinAfter != null">coin_after = #{coinAfter},</if>
|
||||
<if test="currencyBefore != null">currency_before = #{currencyBefore},</if>
|
||||
<if test="currencyAfter != null">currency_after = #{currencyAfter},</if>
|
||||
<if test="exchangeType != null">exchange_type = #{exchangeType},</if>
|
||||
<if test="status != null">status = #{status},</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="deleteGameExchangeMoneyById" parameterType="Long">
|
||||
delete from ff_game_exchange_money where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGameExchangeMoneyByIds" parameterType="String">
|
||||
delete from ff_game_exchange_money where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -1,8 +1,5 @@
|
|||
package com.ff.base.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.interceptor.DataSourceSwitchInterceptor;
|
||||
import com.ff.base.interceptor.RepeatSubmitInterceptor;
|
||||
|
@ -10,8 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
@ -19,7 +14,6 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
@ -36,6 +30,9 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
@Autowired
|
||||
private DataSourceSwitchInterceptor dataSourceSwitchInterceptor;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.ff.base.security.filter.JwtAuthenticationTokenFilter;
|
|||
import com.ff.base.security.handle.AuthenticationEntryPointImpl;
|
||||
import com.ff.base.security.handle.LogoutSuccessHandlerImpl;
|
||||
import com.ff.base.security.provider.MyDaoAuthenticationProvider;
|
||||
import com.ff.base.web.service.AgentDetailsServiceImpl;
|
||||
import com.ff.base.web.service.TenantDetailsServiceImpl;
|
||||
import com.ff.base.web.service.UserDetailsServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -44,6 +45,11 @@ public class SecurityConfig {
|
|||
@Autowired
|
||||
private TenantDetailsServiceImpl tenantDetailsService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private AgentDetailsServiceImpl agentDetailsService;
|
||||
|
||||
/**
|
||||
* 认证失败处理类
|
||||
*/
|
||||
|
@ -84,6 +90,8 @@ public class SecurityConfig {
|
|||
List<UserDetailsService> userDetailsServices = new ArrayList<>();
|
||||
userDetailsServices.add(userDetailsService);
|
||||
userDetailsServices.add(tenantDetailsService);
|
||||
userDetailsServices.add(agentDetailsService);
|
||||
|
||||
|
||||
List<AuthenticationProvider> providers = new ArrayList<>();
|
||||
MyDaoAuthenticationProvider adminDaoAuthenticationProvider = new MyDaoAuthenticationProvider();
|
||||
|
@ -97,6 +105,11 @@ public class SecurityConfig {
|
|||
adminDaoAuthenticationProvider1.setPasswordEncoder(bCryptPasswordEncoder());
|
||||
adminDaoAuthenticationProvider1.setUserDetailsServices(userDetailsServices);
|
||||
|
||||
MyDaoAuthenticationProvider adminDaoAuthenticationProvider2 = new MyDaoAuthenticationProvider();
|
||||
adminDaoAuthenticationProvider2.setUserDetailsService(agentDetailsService);
|
||||
adminDaoAuthenticationProvider2.setPasswordEncoder(bCryptPasswordEncoder());
|
||||
adminDaoAuthenticationProvider2.setUserDetailsServices(userDetailsServices);
|
||||
|
||||
|
||||
return new ProviderManager(providers);
|
||||
|
||||
|
|
|
@ -8,68 +8,6 @@ package com.ff.base.constant;
|
|||
public class ConfigConstants
|
||||
{
|
||||
|
||||
/**
|
||||
* 游戏充值
|
||||
*/
|
||||
public static final String GAME_RECHARGE = "game.recharge";
|
||||
|
||||
|
||||
/**
|
||||
* 游戏下载应用
|
||||
*/
|
||||
public static final String GAME_DOWNLOAD_APP = "game.download.app";
|
||||
|
||||
/**
|
||||
* 游戏充值下载应用
|
||||
*/
|
||||
public static final String GAME_RECHARGE_DOWNLOAD_APP = "game.download.app";
|
||||
/**
|
||||
* 游戏安卓下载应用
|
||||
*/
|
||||
public static final String GAME_ANDROID_DOWNLOAD_APP = "game.android.download.app";
|
||||
/**
|
||||
* 热门一
|
||||
*/
|
||||
public static final String HOT_ONE = "hot.one";
|
||||
/**
|
||||
* 热门二
|
||||
*/
|
||||
public static final String HOT_TWO = "hot.two";
|
||||
/**
|
||||
* 通知全部删除状态
|
||||
*/
|
||||
public static final String NOTICE_ALL_DELETE_STATUS = "notice.all.delete.status";
|
||||
/**
|
||||
* 通知全部已读状态
|
||||
*/
|
||||
public static final String NOTICE_ALL_READ_STATUS = "notice.all.read.status";
|
||||
/**
|
||||
* 通知显示发布时间
|
||||
*/
|
||||
public static final String NOTICE_SHOW_CREATE_TIME = "notice.show.create.time";
|
||||
|
||||
|
||||
/**
|
||||
* 第三方游戏账号唯一key
|
||||
*/
|
||||
public static final String GAME_ACCOUNT = "game.account";
|
||||
|
||||
/**
|
||||
* 关于我们开关
|
||||
*/
|
||||
public static final String ABOUT_SWITCH = "about.switch";
|
||||
|
||||
|
||||
/**
|
||||
* 跳过消息中心
|
||||
*/
|
||||
public static final String SKIP_MESSAGE_CENTER = "skip.message.center";
|
||||
|
||||
|
||||
/**
|
||||
* 是否开启在线客服开关
|
||||
*/
|
||||
public static final String OPEN_SERVICE = "open.service";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -77,10 +15,6 @@ public class ConfigConstants
|
|||
*/
|
||||
public static final String VIEW_FILE_URL = "view.file.url";
|
||||
|
||||
/**
|
||||
* H5防拦截开关 1 开启 2关闭
|
||||
*/
|
||||
public static final String H5_INTERCEPT_OPEN = "h5.intercept.open";
|
||||
|
||||
/**
|
||||
* 域名nginx配置文件
|
||||
|
@ -91,4 +25,9 @@ public class ConfigConstants
|
|||
* 域nginx配置参数
|
||||
*/
|
||||
public static final String DOMAIN_NGINX_CONFIG_PARAM = "domain.nginx.config.param";
|
||||
|
||||
/**
|
||||
* 邀请url
|
||||
*/
|
||||
public static final String INVITE_URL = "invite.url";
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ff.base.constant;
|
|||
|
||||
import io.jsonwebtoken.Claims;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
|
@ -261,4 +262,8 @@ public class Constants {
|
|||
* 租户角色
|
||||
*/
|
||||
public static final String TENANT_ROLE = "tenant";
|
||||
/**
|
||||
* 一百
|
||||
*/
|
||||
public static final BigDecimal HUNDRED =new BigDecimal("100") ;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 委员会批准状态
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Getter
|
||||
public enum CommissionApprovalStatus {
|
||||
UNWITHDRAWN(0, "未提现"),
|
||||
WITHDRAWING(1, "提现中"),
|
||||
WITHDRAWN(2, "已提现");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
CommissionApprovalStatus(Integer value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 佣金来源类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Getter
|
||||
public enum CommissionSourceType {
|
||||
AGENT_TENANT_REGISTER(1, "代理链接商户注册");
|
||||
|
||||
private final int value;
|
||||
private final String description;
|
||||
|
||||
CommissionSourceType(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 佣金类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Getter
|
||||
public enum CommissionType {
|
||||
INVITE(1, "邀请"),
|
||||
TAKE(2,"抽成");
|
||||
|
||||
private final int value;
|
||||
private final String description;
|
||||
|
||||
CommissionType(int value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum GamePlatforms {
|
||||
JILI("JILI", "JILI"),
|
||||
XK("XK", "XK"),
|
||||
|
@ -14,6 +17,17 @@ public enum GamePlatforms {
|
|||
this.info = info;
|
||||
}
|
||||
|
||||
|
||||
public static List<String> getCodes()
|
||||
{
|
||||
List<String> result=new ArrayList<>();
|
||||
GamePlatforms[] values = GamePlatforms.values();
|
||||
for (GamePlatforms value : values) {
|
||||
result.add(value.getCode());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 邀请类型
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/27
|
||||
*/
|
||||
@Getter
|
||||
public enum InviteType {
|
||||
|
||||
TENANT(1, "租户"),
|
||||
AGENT(2, "代理");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
InviteType(Integer value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 邀请者注册状态
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Getter
|
||||
public enum InviterRegisterStatus {
|
||||
PENDING(1, "待激活"),
|
||||
ACTIVATED(2, "已激活");
|
||||
|
||||
private final Integer value; // 状态值
|
||||
private final String description; // 状态描述
|
||||
|
||||
InviterRegisterStatus(Integer value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
|
@ -11,7 +11,8 @@ import lombok.Getter;
|
|||
@Getter
|
||||
public enum OperationType {
|
||||
API_BALANCE(1, "租户游玩操作余额"),
|
||||
REAL_BALANCE_SETTLEMENT(2, "日用额度结算")
|
||||
REAL_BALANCE_SETTLEMENT(2, "日用额度结算"),
|
||||
TENANT_RECHARGE(3, "信誉额度充值")
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.ff.base.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum Status {
|
||||
PENDING(1, "待处理"),
|
||||
PROCESSED(2, "已处理");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
Status(Integer value, String description) {
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
|
@ -20,6 +22,7 @@ public class SysConfig extends BaseEntity
|
|||
|
||||
/** 参数主键 */
|
||||
@Excel(name = "参数主键", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long configId;
|
||||
|
||||
/** 参数名称 */
|
||||
|
@ -37,7 +40,7 @@ public class SysConfig extends BaseEntity
|
|||
/** 系统内置(Y是 N否) */
|
||||
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
|
||||
private String configType;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getConfigId()
|
||||
{
|
||||
return configId;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
@ -15,6 +17,7 @@ public class SysDatasource extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 租户id */
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
@ -21,9 +23,11 @@ public class SysDept extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
|
@ -55,7 +59,7 @@ public class SysDept extends BaseEntity
|
|||
|
||||
/** 子部门 */
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
|
@ -65,7 +69,7 @@ public class SysDept extends BaseEntity
|
|||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.constant.UserConstants;
|
||||
|
@ -24,11 +26,13 @@ public class SysDictData extends BaseEntity
|
|||
/** 字典编码 */
|
||||
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
||||
@JsonView(DictDataSimpleView.class)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
|
||||
@JsonView(DictDataSimpleView.class)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dictSort;
|
||||
|
||||
/** 字典标签 */
|
||||
|
@ -74,7 +78,7 @@ public class SysDictData extends BaseEntity
|
|||
}
|
||||
@JsonView(DictDataSimpleView.class)
|
||||
private String remark;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getDictCode()
|
||||
{
|
||||
return dictCode;
|
||||
|
@ -84,7 +88,7 @@ public class SysDictData extends BaseEntity
|
|||
{
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getDictSort()
|
||||
{
|
||||
return dictSort;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
|
@ -21,6 +23,7 @@ public class SysDictType extends BaseEntity
|
|||
|
||||
/** 字典主键 */
|
||||
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
|
@ -34,7 +37,7 @@ public class SysDictType extends BaseEntity
|
|||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getDictId()
|
||||
{
|
||||
return dictId;
|
||||
|
|
|
@ -17,6 +17,7 @@ public class SysLogininfor extends BaseEntity
|
|||
|
||||
/** ID */
|
||||
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long infoId;
|
||||
|
||||
/** 用户账号 */
|
||||
|
@ -48,6 +49,7 @@ public class SysLogininfor extends BaseEntity
|
|||
private String msg;
|
||||
|
||||
/** 访问时间 */
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Long loginTime;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
@ -20,6 +22,7 @@ public class SysMenu extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 菜单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long menuId;
|
||||
|
||||
/** 菜单名称 */
|
||||
|
@ -29,6 +32,7 @@ public class SysMenu extends BaseEntity
|
|||
private String parentName;
|
||||
|
||||
/** 父菜单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
|
||||
/** 显示顺序 */
|
||||
|
@ -69,7 +73,7 @@ public class SysMenu extends BaseEntity
|
|||
|
||||
/** 子菜单 */
|
||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
|
|
|
@ -17,6 +17,7 @@ public class SysOperLog extends BaseEntity
|
|||
|
||||
/** 日志主键 */
|
||||
@Excel(name = "操作序号", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long operId;
|
||||
|
||||
/** 操作模块 */
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
|
@ -21,6 +23,7 @@ public class SysPost extends BaseEntity
|
|||
|
||||
/** 岗位序号 */
|
||||
@Excel(name = "岗位序号", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
|
@ -41,7 +44,7 @@ public class SysPost extends BaseEntity
|
|||
|
||||
/** 用户是否存在此岗位标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getPostId()
|
||||
{
|
||||
return postId;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
|
@ -22,6 +24,7 @@ public class SysRole extends BaseEntity
|
|||
|
||||
/** 角色ID */
|
||||
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
/** 角色名称 */
|
||||
|
@ -74,7 +77,7 @@ public class SysRole extends BaseEntity
|
|||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
@ -11,11 +13,13 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysRoleDept
|
||||
{
|
||||
/** 角色ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
/** 部门ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deptId;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
|
@ -25,7 +29,7 @@ public class SysRoleDept
|
|||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
@ -11,11 +13,13 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
public class SysRoleMenu
|
||||
{
|
||||
/** 角色ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long roleId;
|
||||
|
||||
/** 菜单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long menuId;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
|
@ -25,7 +29,7 @@ public class SysRoleMenu
|
|||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
public Long getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.annotation.Excel.ColumnType;
|
||||
import com.ff.base.annotation.Excel.Type;
|
||||
|
@ -27,6 +29,7 @@ public class SysUser extends BaseEntity {
|
|||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
|
@ -34,6 +37,7 @@ public class SysUser extends BaseEntity {
|
|||
* 部门ID
|
||||
*/
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
|
@ -105,6 +109,7 @@ public class SysUser extends BaseEntity {
|
|||
* 最后登录时间
|
||||
*/
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long loginDate;
|
||||
|
||||
/**
|
||||
|
@ -138,7 +143,7 @@ public class SysUser extends BaseEntity {
|
|||
|
||||
|
||||
/**
|
||||
* 登录类型 0 后台 1 代理 2 租户
|
||||
* 登录类型 0 后台 1 租户 2 代理
|
||||
*/
|
||||
private Integer loginType;
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 代理对象 ff_tenant_agent
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 注册时间 */
|
||||
@Excel(name = "注册时间")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long registerTime;
|
||||
|
||||
/** 注册IP */
|
||||
@Excel(name = "注册IP")
|
||||
private String registerIp;
|
||||
|
||||
/** 注册ip的城市 */
|
||||
@Excel(name = "注册ip的城市")
|
||||
private String registerIpCity;
|
||||
|
||||
/** 最后登录ip */
|
||||
@Excel(name = "最后登录ip")
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long loginData;
|
||||
|
||||
/** 租户状态 1正常 0停用 */
|
||||
@Excel(name = "租户状态 1正常 0停用")
|
||||
private Boolean tenantStatus;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货币协议
|
||||
*/
|
||||
private String currencyAgreement;
|
||||
|
||||
/**
|
||||
* 钱包地址
|
||||
*/
|
||||
private String walletAddress;
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 租户成本管理对象 ff_tenant_platform
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantPlatform extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 租户id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "租户id", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Long tenantId;
|
||||
|
||||
/** 平台编码 */
|
||||
@Excel(name = "平台编码")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 成本 */
|
||||
@Excel(name = "成本")
|
||||
private BigDecimal cost;
|
||||
|
||||
/** 使用成本 */
|
||||
@Excel(name = "使用成本")
|
||||
private BigDecimal useCost;
|
||||
|
||||
|
||||
}
|
|
@ -2,8 +2,9 @@ package com.ff.base.system.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -15,7 +16,7 @@ import lombok.NoArgsConstructor;
|
|||
* 用户租户密钥对象 ff_tenant_secret_key
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-20
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -26,44 +27,51 @@ public class TenantSecretKey extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
|
||||
/** 租户key */
|
||||
@Excel(name = "租户key")
|
||||
private String tenantKey;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
/** 注册时间 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "注册时间")
|
||||
private Long registerTime;
|
||||
|
||||
/** 注册ip */
|
||||
@Excel(name = "注册ip")
|
||||
private String registerIp;
|
||||
|
||||
/** 注册ip的城市 */
|
||||
@Excel(name = "注册ip的城市")
|
||||
private String registerIpCity;
|
||||
|
||||
/** 最后登录ip */
|
||||
@Excel(name = "最后登录ip")
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "最后登录时间")
|
||||
private Long loginData;
|
||||
|
||||
|
||||
|
||||
/** 租户key */
|
||||
@Excel(name = "租户key")
|
||||
private String tenantKey;
|
||||
|
||||
/** 代理id */
|
||||
@Excel(name = "代理id")
|
||||
/** 上级代理id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "上级代理id")
|
||||
private Long agentId;
|
||||
|
||||
|
||||
|
||||
/** 商户后缀 */
|
||||
@Excel(name = "商户后缀")
|
||||
@JsonIgnore
|
||||
private String tenantSn;
|
||||
|
||||
/** 租户密钥 */
|
||||
@Excel(name = "租户密钥")
|
||||
@JsonIgnore
|
||||
private String tenantSecret;
|
||||
|
||||
/** 租户状态 1正常 0停用 */
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.ff.base.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 租户白名单对象 ff_tenant_white
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantWhite extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 租户id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "租户id", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Long tenantId;
|
||||
|
||||
/** 白名单ip地址 */
|
||||
@Excel(name = "白名单ip地址")
|
||||
private String whiteIp;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.ff.base.system.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建租户dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class CreateTenantDTO implements Serializable {
|
||||
private final static long serialVersionUID = 1L;
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long registerTime;
|
||||
|
||||
/** 注册ip */
|
||||
private String registerIp;
|
||||
|
||||
/** 注册ip的城市 */
|
||||
private String registerIpCity;
|
||||
|
||||
/**
|
||||
* 代理id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
/** 买分比例 */
|
||||
private BigDecimal scoreRatio;
|
||||
|
||||
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
private Integer tenantType;
|
||||
|
||||
|
||||
/** 透支比例 */
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
private List<TenantPlatform> tenantPlatforms;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.ff.base.system.mapper;
|
||||
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface TenantAgentMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 代理
|
||||
*/
|
||||
TenantAgent selectTenantAgentById(Long id);
|
||||
|
||||
/**
|
||||
* 按帐户选择租户代理
|
||||
*
|
||||
* @param account 账户
|
||||
* @return {@link TenantAgent }
|
||||
*/
|
||||
TenantAgent selectTenantAgentByAccount(String account);
|
||||
|
||||
/**
|
||||
* 查询代理列表
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 代理集合
|
||||
*/
|
||||
List<TenantAgent> selectTenantAgentList(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 新增代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgent(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 修改代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgent(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 删除代理
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.ff.base.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
|
||||
/**
|
||||
* 租户成本管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface TenantPlatformMapper
|
||||
{
|
||||
/**
|
||||
* 查询租户成本管理
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 租户成本管理
|
||||
*/
|
||||
TenantPlatform selectTenantPlatformById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 查找租户平台
|
||||
*
|
||||
* @param tenantPlatform 租户平台
|
||||
* @return {@link TenantPlatform }
|
||||
*/
|
||||
TenantPlatform findTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
|
||||
/**
|
||||
* 按租户id选择货币代码
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return {@link List }<{@link String }>
|
||||
*/
|
||||
List<String> selectCurrencyCodeByTenantId(Long tenantId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户成本管理列表
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 租户成本管理集合
|
||||
*/
|
||||
List<TenantPlatform> selectTenantPlatformList(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 新增租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 修改租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 删除租户成本管理
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantPlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户成本管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantPlatformByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.base.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.system.domain.TenantWhite;
|
||||
|
||||
/**
|
||||
* 租户白名单Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface TenantWhiteMapper
|
||||
{
|
||||
/**
|
||||
* 查询租户白名单
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 租户白名单
|
||||
*/
|
||||
TenantWhite selectTenantWhiteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户白名单列表
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 租户白名单集合
|
||||
*/
|
||||
List<TenantWhite> selectTenantWhiteList(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 新增租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantWhite(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 修改租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantWhite(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 删除租户白名单
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantWhiteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除租户白名单
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantWhiteByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package com.ff.base.system.service;
|
||||
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface ITenantAgentService
|
||||
{
|
||||
/**
|
||||
* 查询代理
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 代理
|
||||
*/
|
||||
TenantAgent selectTenantAgentById(Long id);
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param password 密码
|
||||
* @return {@link String }
|
||||
*/
|
||||
String login(String username, String password);
|
||||
|
||||
/**
|
||||
* 按帐户选择租户代理
|
||||
*
|
||||
* @param account 账户
|
||||
* @return {@link TenantAgent }
|
||||
*/
|
||||
TenantAgent selectTenantAgentByAccount(String account);
|
||||
|
||||
|
||||
/**
|
||||
* 查询代理列表
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 代理集合
|
||||
*/
|
||||
List<TenantAgent> selectTenantAgentList(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 新增代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgent(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 创建租户代理
|
||||
*
|
||||
* @param tenantAgent 租户代理人
|
||||
* @return int
|
||||
*/
|
||||
int createTenantAgent(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 修改代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgent(TenantAgent tenantAgent);
|
||||
|
||||
/**
|
||||
* 批量删除代理
|
||||
*
|
||||
* @param ids 需要删除的代理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理信息
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentById(Long id);
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.ff.base.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
|
||||
/**
|
||||
* 租户成本管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface ITenantPlatformService
|
||||
{
|
||||
/**
|
||||
* 查询租户成本管理
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 租户成本管理
|
||||
*/
|
||||
TenantPlatform selectTenantPlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查找租户平台
|
||||
*
|
||||
* @param tenantPlatform 租户平台
|
||||
* @return {@link TenantPlatform }
|
||||
*/
|
||||
TenantPlatform findTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户成本管理列表
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 租户成本管理集合
|
||||
*/
|
||||
List<TenantPlatform> selectTenantPlatformList(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 按租户id选择货币代码
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return {@link List }<{@link String }>
|
||||
*/
|
||||
List<String> selectCurrencyCodeByTenantId(Long tenantId);
|
||||
|
||||
/**
|
||||
* 新增租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 修改租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantPlatform(TenantPlatform tenantPlatform);
|
||||
|
||||
/**
|
||||
* 批量删除租户成本管理
|
||||
*
|
||||
* @param ids 需要删除的租户成本管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantPlatformByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除租户成本管理信息
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantPlatformById(Long id);
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.ff.base.system.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
|
||||
/**
|
||||
|
@ -70,6 +71,15 @@ public interface ITenantSecretKeyService
|
|||
*/
|
||||
int insertTenantSecretKey(TenantSecretKey tenantSecretKey);
|
||||
|
||||
|
||||
/**
|
||||
* 创建租户
|
||||
*
|
||||
* @param createTenantDTO 创建租户dto
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
Integer createTenant(CreateTenantDTO createTenantDTO);
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.base.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.system.domain.TenantWhite;
|
||||
|
||||
/**
|
||||
* 租户白名单Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface ITenantWhiteService
|
||||
{
|
||||
/**
|
||||
* 查询租户白名单
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 租户白名单
|
||||
*/
|
||||
TenantWhite selectTenantWhiteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询租户白名单列表
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 租户白名单集合
|
||||
*/
|
||||
List<TenantWhite> selectTenantWhiteList(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 新增租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantWhite(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 修改租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantWhite(TenantWhite tenantWhite);
|
||||
|
||||
/**
|
||||
* 批量删除租户白名单
|
||||
*
|
||||
* @param ids 需要删除的租户白名单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantWhiteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除租户白名单信息
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantWhiteById(Long id);
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
package com.ff.base.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.domain.model.LoginForm;
|
||||
import com.ff.base.core.domain.model.LoginUser;
|
||||
import com.ff.base.enums.LoginType;
|
||||
import com.ff.base.exception.ServiceException;
|
||||
import com.ff.base.exception.user.UserPasswordNotMatchException;
|
||||
import com.ff.base.manager.AsyncManager;
|
||||
import com.ff.base.manager.factory.AsyncFactory;
|
||||
import com.ff.base.security.context.AuthenticationContextHolder;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.mapper.TenantAgentMapper;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.web.service.TokenService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 代理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentServiceImpl implements ITenantAgentService {
|
||||
@Autowired
|
||||
private TenantAgentMapper tenantAgentMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private AuthenticationManager authenticationManager;
|
||||
|
||||
@Resource
|
||||
private TokenService tokenService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询代理
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 代理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgent selectTenantAgentById(Long id) {
|
||||
return tenantAgentMapper.selectTenantAgentById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String login(String username, String password) {
|
||||
// 用户验证
|
||||
Authentication authentication = null;
|
||||
try {
|
||||
|
||||
|
||||
LoginForm loginForm = new LoginForm();
|
||||
loginForm.setAccountName(username);
|
||||
loginForm.setPassword(password);
|
||||
loginForm.setLoginType(LoginType.AGENT.getValue());
|
||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, loginForm);
|
||||
AuthenticationContextHolder.setContext(authenticationToken);
|
||||
authentication = authenticationManager.authenticate(authenticationToken);
|
||||
} catch (Exception e) {
|
||||
if (e instanceof BadCredentialsException) {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||
throw new UserPasswordNotMatchException();
|
||||
} else {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
} finally {
|
||||
AuthenticationContextHolder.clearContext();
|
||||
}
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
|
||||
//更新租户信息
|
||||
TenantAgent tenantAgent = new TenantAgent();
|
||||
tenantAgent.setId(loginUser.getUserId());
|
||||
tenantAgent.setLoginIp(IpUtils.getIpAddr());
|
||||
tenantAgent.setLoginData(DateUtils.getNowDate());
|
||||
tenantAgentMapper.updateTenantAgent(tenantAgent);
|
||||
// 生成token
|
||||
return tokenService.createToken(loginUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按帐户选择租户代理
|
||||
*
|
||||
* @param account 账户
|
||||
* @return {@link TenantAgent }
|
||||
*/
|
||||
@Override
|
||||
public TenantAgent selectTenantAgentByAccount(String account) {
|
||||
return tenantAgentMapper.selectTenantAgentByAccount(account);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理列表
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 代理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgent> selectTenantAgentList(TenantAgent tenantAgent) {
|
||||
return tenantAgentMapper.selectTenantAgentList(tenantAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgent(TenantAgent tenantAgent) {
|
||||
tenantAgent.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentMapper.insertTenantAgent(tenantAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建租户代理
|
||||
*
|
||||
* @param tenantAgent 租户代理人
|
||||
* @return int
|
||||
*/
|
||||
@Override
|
||||
public synchronized int createTenantAgent(TenantAgent tenantAgent) {
|
||||
TenantAgent tenantAgentByAccount = this.selectTenantAgentByAccount(tenantAgent.getAccount());
|
||||
if (!ObjectUtils.isEmpty(tenantAgentByAccount)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.insertTenantAgent(tenantAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理
|
||||
*
|
||||
* @param tenantAgent 代理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgent(TenantAgent tenantAgent) {
|
||||
tenantAgent.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentMapper.updateTenantAgent(tenantAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理
|
||||
*
|
||||
* @param ids 需要删除的代理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentByIds(Long[] ids) {
|
||||
return tenantAgentMapper.deleteTenantAgentByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理信息
|
||||
*
|
||||
* @param id 代理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentById(Long id) {
|
||||
return tenantAgentMapper.deleteTenantAgentById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.ff.base.system.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.base.system.mapper.TenantPlatformMapper;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 租户成本管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Service
|
||||
public class TenantPlatformServiceImpl implements ITenantPlatformService
|
||||
{
|
||||
@Autowired
|
||||
private TenantPlatformMapper tenantPlatformMapper;
|
||||
|
||||
/**
|
||||
* 查询租户成本管理
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 租户成本管理
|
||||
*/
|
||||
@Override
|
||||
public TenantPlatform selectTenantPlatformById(Long id)
|
||||
{
|
||||
return tenantPlatformMapper.selectTenantPlatformById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找租户平台
|
||||
*
|
||||
* @param tenantPlatform 租户平台
|
||||
* @return {@link TenantPlatform }
|
||||
*/
|
||||
@Override
|
||||
public TenantPlatform findTenantPlatform(TenantPlatform tenantPlatform) {
|
||||
return tenantPlatformMapper.findTenantPlatform(tenantPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户成本管理列表
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 租户成本管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantPlatform> selectTenantPlatformList(TenantPlatform tenantPlatform)
|
||||
{
|
||||
return tenantPlatformMapper.selectTenantPlatformList(tenantPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按租户id选择货币代码
|
||||
*
|
||||
* @param tenantId 租户id
|
||||
* @return {@link List }<{@link String }>
|
||||
*/
|
||||
@Override
|
||||
public List<String> selectCurrencyCodeByTenantId(Long tenantId) {
|
||||
return tenantPlatformMapper.selectCurrencyCodeByTenantId(tenantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantPlatform(TenantPlatform tenantPlatform)
|
||||
{
|
||||
tenantPlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantPlatform.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantPlatformMapper.insertTenantPlatform(tenantPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户成本管理
|
||||
*
|
||||
* @param tenantPlatform 租户成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantPlatform(TenantPlatform tenantPlatform)
|
||||
{
|
||||
tenantPlatform.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantPlatformMapper.updateTenantPlatform(tenantPlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户成本管理
|
||||
*
|
||||
* @param ids 需要删除的租户成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantPlatformByIds(Long[] ids)
|
||||
{
|
||||
return tenantPlatformMapper.deleteTenantPlatformByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户成本管理信息
|
||||
*
|
||||
* @param id 租户成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantPlatformById(Long id)
|
||||
{
|
||||
return tenantPlatformMapper.deleteTenantPlatformById(id);
|
||||
}
|
||||
}
|
|
@ -8,18 +8,26 @@ import com.ff.base.constant.Constants;
|
|||
import com.ff.base.core.domain.model.LoginForm;
|
||||
import com.ff.base.core.domain.model.LoginUser;
|
||||
import com.ff.base.enums.LoginType;
|
||||
import com.ff.base.enums.OperationType;
|
||||
import com.ff.base.enums.QuotaType;
|
||||
import com.ff.base.exception.ServiceException;
|
||||
import com.ff.base.exception.user.UserPasswordNotMatchException;
|
||||
import com.ff.base.manager.AsyncManager;
|
||||
import com.ff.base.manager.factory.AsyncFactory;
|
||||
import com.ff.base.security.context.AuthenticationContextHolder;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.NumberUtils;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.base.web.service.TokenService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
|
@ -29,6 +37,7 @@ import com.ff.base.system.mapper.TenantSecretKeyMapper;
|
|||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
@ -48,8 +57,13 @@ public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
|||
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private AuthenticationManager authenticationManager;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantPlatformService tenantPlatformService;
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
|
@ -126,11 +140,11 @@ public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
|||
*/
|
||||
@Override
|
||||
public synchronized String generateTenantSn() {
|
||||
String sn = NumberUtils.generateRandomCode();
|
||||
String sn = NumberUtils.generateRandomCode(3);
|
||||
while (!CollectionUtils.isEmpty(tenantSecretKeyMapper.selectTenantSecretKeyList(TenantSecretKey.builder()
|
||||
.tenantSn(sn)
|
||||
.build()))) {
|
||||
sn = NumberUtils.generateRandomCode();
|
||||
sn = NumberUtils.generateRandomCode(3);
|
||||
}
|
||||
return sn;
|
||||
}
|
||||
|
@ -170,6 +184,50 @@ public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
|||
return tenantSecretKeyMapper.insertTenantSecretKey(tenantSecretKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建租户
|
||||
*
|
||||
* @param createTenantDTO 创建租户dto
|
||||
* @return {@link Integer }
|
||||
*/
|
||||
@Override
|
||||
public synchronized Integer createTenant(CreateTenantDTO createTenantDTO) {
|
||||
|
||||
List<TenantSecretKey> tenantSecretKeys = this.selectTenantSecretKeyList(TenantSecretKey.builder()
|
||||
.tenantKey(createTenantDTO.getAccount())
|
||||
.build());
|
||||
if (!CollectionUtils.isEmpty(tenantSecretKeys)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//创建租户
|
||||
TenantSecretKey tenantSecretKey = new TenantSecretKey();
|
||||
tenantSecretKey.setAgentId(createTenantDTO.getAgentId());
|
||||
tenantSecretKey.setRegisterIp(createTenantDTO.getRegisterIp());
|
||||
tenantSecretKey.setRegisterTime(createTenantDTO.getRegisterTime());
|
||||
tenantSecretKey.setRegisterIpCity(createTenantDTO.getRegisterIpCity());
|
||||
|
||||
tenantSecretKey.setTenantKey(createTenantDTO.getAccount());
|
||||
tenantSecretKey.setPassword(SecurityUtils.encryptPassword(createTenantDTO.getPassword()));
|
||||
tenantSecretKey.setTenantSn(this.generateTenantSn());
|
||||
tenantSecretKey.setTenantSecret(IdUtils.simpleUUID());
|
||||
tenantSecretKey.setDepositRatio(createTenantDTO.getDepositRatio());
|
||||
tenantSecretKey.setTenantType(createTenantDTO.getTenantType());
|
||||
tenantSecretKey.setCreateBy(createTenantDTO.getAccount());
|
||||
tenantSecretKey.setTenantStatus(Boolean.TRUE);
|
||||
int insertedTenantSecretKey = this.insertTenantSecretKey(tenantSecretKey);
|
||||
if (insertedTenantSecretKey > 0) {
|
||||
for (TenantPlatform tenantPlatform : createTenantDTO.getTenantPlatforms()) {
|
||||
tenantPlatform.setTenantId(tenantSecretKey.getId());
|
||||
tenantPlatform.setCreateBy(createTenantDTO.getAccount());
|
||||
tenantPlatformService.insertTenantPlatform(tenantPlatform);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return insertedTenantSecretKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户租户密钥
|
||||
*
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
package com.ff.base.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.base.system.mapper.TenantWhiteMapper;
|
||||
import com.ff.base.system.domain.TenantWhite;
|
||||
import com.ff.base.system.service.ITenantWhiteService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 租户白名单Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Service
|
||||
public class TenantWhiteServiceImpl implements ITenantWhiteService
|
||||
{
|
||||
@Autowired
|
||||
private TenantWhiteMapper tenantWhiteMapper;
|
||||
|
||||
/**
|
||||
* 查询租户白名单
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 租户白名单
|
||||
*/
|
||||
@Override
|
||||
public TenantWhite selectTenantWhiteById(Long id)
|
||||
{
|
||||
return tenantWhiteMapper.selectTenantWhiteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户白名单列表
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 租户白名单
|
||||
*/
|
||||
@Override
|
||||
public List<TenantWhite> selectTenantWhiteList(TenantWhite tenantWhite)
|
||||
{
|
||||
return tenantWhiteMapper.selectTenantWhiteList(tenantWhite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantWhite(TenantWhite tenantWhite)
|
||||
{
|
||||
tenantWhite.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantWhite.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantWhiteMapper.insertTenantWhite(tenantWhite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户白名单
|
||||
*
|
||||
* @param tenantWhite 租户白名单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantWhite(TenantWhite tenantWhite)
|
||||
{
|
||||
tenantWhite.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantWhiteMapper.updateTenantWhite(tenantWhite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户白名单
|
||||
*
|
||||
* @param ids 需要删除的租户白名单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantWhiteByIds(Long[] ids)
|
||||
{
|
||||
return tenantWhiteMapper.deleteTenantWhiteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户白名单信息
|
||||
*
|
||||
* @param id 租户白名单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantWhiteById(Long id)
|
||||
{
|
||||
return tenantWhiteMapper.deleteTenantWhiteById(id);
|
||||
}
|
||||
}
|
|
@ -64,12 +64,12 @@ public class NumberUtils {
|
|||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
public static String generateRandomCode() {
|
||||
public static String generateRandomCode(Integer size) {
|
||||
Random random = new Random();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
// 每位字符可以是字母(A-Z, a-z)或数字(0-9)
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i <size ; i++) {
|
||||
int choice = random.nextInt(3);
|
||||
if (choice == 0) {
|
||||
// 随机字母(大写或小写)
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package com.ff.base.web.service;
|
||||
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.domain.model.LoginUser;
|
||||
import com.ff.base.enums.LoginType;
|
||||
import com.ff.base.exception.ServiceException;
|
||||
import com.ff.base.system.domain.SysRole;
|
||||
import com.ff.base.system.domain.SysUser;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.service.ISysMenuService;
|
||||
import com.ff.base.system.service.ISysRoleService;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 用户验证处理
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@Service
|
||||
public class AgentDetailsServiceImpl implements UserDetailsService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(AgentDetailsServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private ITenantAgentService tenantAgentService;
|
||||
|
||||
@Resource
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ISysMenuService menuService;
|
||||
|
||||
|
||||
@Resource
|
||||
private SysPermissionService permissionService;
|
||||
|
||||
@Resource
|
||||
private ISysRoleService roleService;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
|
||||
{
|
||||
|
||||
TenantAgent tenantAgent = tenantAgentService.selectTenantAgentByAccount(username);
|
||||
if (StringUtils.isNull(tenantAgent))
|
||||
{
|
||||
log.info("登录用户:{} 不存在.", username);
|
||||
throw new ServiceException(MessageUtils.message("user.not.exists"));
|
||||
}
|
||||
else if (!tenantAgent.getTenantStatus())
|
||||
{
|
||||
log.info("登录用户:{} 已被停用.", username);
|
||||
throw new ServiceException(MessageUtils.message("user.blocked"));
|
||||
}
|
||||
|
||||
passwordService.validate(tenantAgent.getPassword());
|
||||
|
||||
return createLoginUser(tenantAgent);
|
||||
}
|
||||
|
||||
public UserDetails createLoginUser(TenantAgent tenantAgent)
|
||||
{
|
||||
SysRole sysRole = roleService.selectRoleByRoleKey(Constants.AGENT_ROLE);
|
||||
SysUser sysUser=new SysUser();
|
||||
sysUser.setUserId(tenantAgent.getId());
|
||||
sysUser.setUserName(tenantAgent.getAccount());
|
||||
sysUser.setNickName(tenantAgent.getAccount());
|
||||
sysUser.setPassword(tenantAgent.getPassword());
|
||||
sysUser.setLoginType(LoginType.AGENT.getValue());
|
||||
sysUser.setLoginIp(tenantAgent.getLoginIp());
|
||||
sysUser.setLoginDate(tenantAgent.getLoginData());
|
||||
ArrayList<SysRole> sysRoles = new ArrayList<>();
|
||||
sysRoles.add(sysRole);
|
||||
sysUser.setRoles(sysRoles);
|
||||
sysUser.setRoleId(sysRole.getRoleId());
|
||||
sysUser.setRoleIds(new Long[]{sysRole.getRoleId()});
|
||||
|
||||
|
||||
return new LoginUser(tenantAgent.getId(),null, sysUser, menuService.selectMenuPermsByRoleId(sysRole.getRoleId()));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
<?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.ff.base.system.mapper.TenantAgentMapper">
|
||||
|
||||
<resultMap type="TenantAgent" id="TenantAgentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="account" column="account" />
|
||||
<result property="password" column="password" />
|
||||
<result property="registerTime" column="register_time" />
|
||||
<result property="registerIp" column="register_ip" />
|
||||
<result property="registerIpCity" column="register_ip_city" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginData" column="login_data" />
|
||||
<result property="tenantStatus" column="tenant_status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="currencyAgreement" column="currency_agreement" />
|
||||
<result property="walletAddress" column="wallet_address" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTenantAgentVo">
|
||||
select id,currency_agreement,wallet_address, account, password, register_time, register_ip, register_ip_city, login_ip, login_data, tenant_status, create_by, create_time, update_by, update_time from ff_tenant_agent
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantAgentList" parameterType="TenantAgent" resultMap="TenantAgentResult">
|
||||
<include refid="selectTenantAgentVo"/>
|
||||
<where>
|
||||
<if test="account != null and account != ''"> and account = #{account}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="registerTime != null "> and register_time = #{registerTime}</if>
|
||||
<if test="registerIp != null and registerIp != ''"> and register_ip = #{registerIp}</if>
|
||||
<if test="registerIpCity != null and registerIpCity != ''"> and register_ip_city = #{registerIpCity}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||
<if test="tenantStatus != null "> and tenant_status = #{tenantStatus}</if>
|
||||
<if test="currencyAgreement != null and currencyAgreement != ''"> and currency_agreement = #{currencyAgreement}</if>
|
||||
<if test="walletAddress != null and walletAddress != ''"> and wallet_address = #{walletAddress}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantAgentById" parameterType="Long" resultMap="TenantAgentResult">
|
||||
<include refid="selectTenantAgentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectTenantAgentByAccount" parameterType="String" resultMap="TenantAgentResult">
|
||||
<include refid="selectTenantAgentVo"/>
|
||||
where account = #{account}
|
||||
</select>
|
||||
|
||||
<insert id="insertTenantAgent" parameterType="TenantAgent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_agent
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="account != null">account,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="registerTime != null">register_time,</if>
|
||||
<if test="registerIp != null">register_ip,</if>
|
||||
<if test="registerIpCity != null">register_ip_city,</if>
|
||||
<if test="loginIp != null">login_ip,</if>
|
||||
<if test="loginData != null">login_data,</if>
|
||||
<if test="tenantStatus != null">tenant_status,</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>
|
||||
<if test="currencyAgreement != null">currency_agreement,</if>
|
||||
<if test="walletAddress != null">wallet_address,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="registerTime != null">#{registerTime},</if>
|
||||
<if test="registerIp != null">#{registerIp},</if>
|
||||
<if test="registerIpCity != null">#{registerIpCity},</if>
|
||||
<if test="loginIp != null">#{loginIp},</if>
|
||||
<if test="loginData != null">#{loginData},</if>
|
||||
<if test="tenantStatus != null">#{tenantStatus},</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>
|
||||
<if test="currencyAgreement != null">#{currencyAgreement},</if>
|
||||
<if test="walletAddress != null">#{walletAddress},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTenantAgent" parameterType="TenantAgent">
|
||||
update ff_tenant_agent
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="account != null">account = #{account},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="registerTime != null">register_time = #{registerTime},</if>
|
||||
<if test="registerIp != null">register_ip = #{registerIp},</if>
|
||||
<if test="registerIpCity != null">register_ip_city = #{registerIpCity},</if>
|
||||
<if test="loginIp != null">login_ip = #{loginIp},</if>
|
||||
<if test="loginData != null">login_data = #{loginData},</if>
|
||||
<if test="tenantStatus != null">tenant_status = #{tenantStatus},</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>
|
||||
<if test="currencyAgreement != null">currency_agreement = #{currencyAgreement},</if>
|
||||
<if test="walletAddress != null">wallet_address = #{walletAddress},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTenantAgentById" parameterType="Long">
|
||||
delete from ff_tenant_agent where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantAgentByIds" parameterType="String">
|
||||
delete from ff_tenant_agent where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,113 @@
|
|||
<?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.ff.base.system.mapper.TenantPlatformMapper">
|
||||
|
||||
<resultMap type="TenantPlatform" id="TenantPlatformResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="platformCode" column="platform_code" />
|
||||
<result property="currencyCode" column="currency_code" />
|
||||
<result property="cost" column="cost" />
|
||||
<result property="useCost" column="use_cost" />
|
||||
<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="selectTenantPlatformVo">
|
||||
select id, tenant_id, platform_code, currency_code, cost, use_cost, create_by, create_time, update_by, update_time from ff_tenant_platform
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantPlatformList" parameterType="TenantPlatform" resultMap="TenantPlatformResult">
|
||||
<include refid="selectTenantPlatformVo"/>
|
||||
<where>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if>
|
||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
||||
<if test="cost != null "> and cost = #{cost}</if>
|
||||
<if test="useCost != null "> and use_cost = #{useCost}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantPlatformById" parameterType="Long" resultMap="TenantPlatformResult">
|
||||
<include refid="selectTenantPlatformVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findTenantPlatform" parameterType="TenantPlatform" resultMap="TenantPlatformResult">
|
||||
<include refid="selectTenantPlatformVo"/>
|
||||
<where>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if>
|
||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
||||
<if test="cost != null "> and cost = #{cost}</if>
|
||||
<if test="useCost != null "> and use_cost = #{useCost}</if>
|
||||
</where>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectCurrencyCodeByTenantId" >
|
||||
select currency_code from ff_tenant_platform
|
||||
|
||||
where tenant_id = #{tenantId} group by currency_code
|
||||
</select>
|
||||
|
||||
<insert id="insertTenantPlatform" parameterType="TenantPlatform">
|
||||
insert into ff_tenant_platform
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="platformCode != null and platformCode != ''">platform_code,</if>
|
||||
<if test="currencyCode != null and currencyCode != ''">currency_code,</if>
|
||||
<if test="cost != null">cost,</if>
|
||||
<if test="useCost != null">use_cost,</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="id != null">#{id},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="platformCode != null and platformCode != ''">#{platformCode},</if>
|
||||
<if test="currencyCode != null and currencyCode != ''">#{currencyCode},</if>
|
||||
<if test="cost != null">#{cost},</if>
|
||||
<if test="useCost != null">#{useCost},</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="updateTenantPlatform" parameterType="TenantPlatform">
|
||||
update ff_tenant_platform
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="platformCode != null and platformCode != ''">platform_code = #{platformCode},</if>
|
||||
<if test="currencyCode != null and currencyCode != ''">currency_code = #{currencyCode},</if>
|
||||
<if test="cost != null">cost = #{cost},</if>
|
||||
<if test="useCost != null">use_cost = #{useCost},</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="deleteTenantPlatformById" parameterType="Long">
|
||||
delete from ff_tenant_platform where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantPlatformByIds" parameterType="String">
|
||||
delete from ff_tenant_platform where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -6,10 +6,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="TenantSecretKey" id="TenantSecretKeyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="password" column="password" />
|
||||
<result property="registerTime" column="register_time" />
|
||||
<result property="registerIp" column="register_ip" />
|
||||
<result property="registerIpCity" column="register_ip_city" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginData" column="login_data" />
|
||||
<result property="tenantKey" column="tenant_key" />
|
||||
<result property="agentId" column="agent_id" />
|
||||
<result property="tenantSn" column="tenant_sn" />
|
||||
<result property="tenantSecret" column="tenant_secret" />
|
||||
|
@ -25,34 +28,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectTenantSecretKeyVo">
|
||||
select id, password, login_ip, login_data, tenant_key, agent_id, tenant_sn, tenant_secret, tenant_status, quota_type, score_ratio, tenant_type, deposit_ratio, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
||||
select id, tenant_key, password, register_time, register_ip, register_ip_city, login_ip, login_data, agent_id, tenant_sn, tenant_secret, tenant_status, quota_type, score_ratio, tenant_type, deposit_ratio, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantSecretKeyList" parameterType="TenantSecretKey" resultMap="TenantSecretKeyResult">
|
||||
<include refid="selectTenantSecretKeyVo"/>
|
||||
<where>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''"> and tenant_secret = #{tenantSecret}</if>
|
||||
<if test="tenantStatus != null "> and tenant_status = #{tenantStatus}</if>
|
||||
<if test="quotaType != null "> and quota_type = #{quotaType}</if>
|
||||
<if test="scoreRatio != null "> and score_ratio = #{scoreRatio}</if>
|
||||
<if test="tenantType != null "> and tenant_type = #{tenantType}</if>
|
||||
<if test="depositRatio != null "> and deposit_ratio = #{depositRatio}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantSecretKeyDTOList" parameterType="com.ff.base.system.dto.TenantSecretKeyDTO" resultMap="TenantSecretKeyResult">
|
||||
<include refid="selectTenantSecretKeyVo"/>
|
||||
<where>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="registerTime != null "> and register_time = #{registerTime}</if>
|
||||
<if test="registerIp != null and registerIp != ''"> and register_ip = #{registerIp}</if>
|
||||
<if test="registerIpCity != null and registerIpCity != ''"> and register_ip_city = #{registerIpCity}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key like concat('%',#{tenantKey},'%') </if>
|
||||
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''"> and tenant_secret = #{tenantSecret}</if>
|
||||
|
@ -71,12 +59,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<insert id="insertTenantSecretKey" parameterType="TenantSecretKey" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ff_tenant_secret_key
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="registerTime != null">register_time,</if>
|
||||
<if test="registerIp != null">register_ip,</if>
|
||||
<if test="registerIpCity != null">register_ip_city,</if>
|
||||
<if test="loginIp != null">login_ip,</if>
|
||||
<if test="loginData != null">login_data,</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||
<if test="agentId != null">agent_id,</if>
|
||||
<if test="tenantSn != null">tenant_sn,</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">tenant_secret,</if>
|
||||
|
@ -90,12 +81,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="registerTime != null">#{registerTime},</if>
|
||||
<if test="registerIp != null">#{registerIp},</if>
|
||||
<if test="registerIpCity != null">#{registerIpCity},</if>
|
||||
<if test="loginIp != null">#{loginIp},</if>
|
||||
<if test="loginData != null">#{loginData},</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||
<if test="agentId != null">#{agentId},</if>
|
||||
<if test="tenantSn != null">#{tenantSn},</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">#{tenantSecret},</if>
|
||||
|
@ -114,10 +108,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateTenantSecretKey" parameterType="TenantSecretKey">
|
||||
update ff_tenant_secret_key
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="registerTime != null">register_time = #{registerTime},</if>
|
||||
<if test="registerIp != null">register_ip = #{registerIp},</if>
|
||||
<if test="registerIpCity != null">register_ip_city = #{registerIpCity},</if>
|
||||
<if test="loginIp != null">login_ip = #{loginIp},</if>
|
||||
<if test="loginData != null">login_data = #{loginData},</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||
<if test="tenantSn != null">tenant_sn = #{tenantSn},</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''">tenant_secret = #{tenantSecret},</if>
|
||||
|
@ -145,6 +142,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from ff_tenant_secret_key where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectTenantSecretKeyDTOList" parameterType="com.ff.base.system.dto.TenantSecretKeyDTO" resultMap="TenantSecretKeyResult">
|
||||
<include refid="selectTenantSecretKeyVo"/>
|
||||
<where>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key like concat('%',#{tenantKey},'%') </if>
|
||||
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||
<if test="tenantSecret != null and tenantSecret != ''"> and tenant_secret = #{tenantSecret}</if>
|
||||
<if test="tenantStatus != null "> and tenant_status = #{tenantStatus}</if>
|
||||
<if test="quotaType != null "> and quota_type = #{quotaType}</if>
|
||||
<if test="scoreRatio != null "> and score_ratio = #{scoreRatio}</if>
|
||||
<if test="tenantType != null "> and tenant_type = #{tenantType}</if>
|
||||
<if test="depositRatio != null "> and deposit_ratio = #{depositRatio}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteTenantSecretKeyByIds" parameterType="String">
|
||||
delete from ff_tenant_secret_key where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
@ -0,0 +1,79 @@
|
|||
<?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.ff.base.system.mapper.TenantWhiteMapper">
|
||||
|
||||
<resultMap type="TenantWhite" id="TenantWhiteResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="whiteIp" column="white_ip" />
|
||||
<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="selectTenantWhiteVo">
|
||||
select id, tenant_id, white_ip, create_by, create_time, update_by, update_time from ff_tenant_white
|
||||
</sql>
|
||||
|
||||
<select id="selectTenantWhiteList" parameterType="TenantWhite" resultMap="TenantWhiteResult">
|
||||
<include refid="selectTenantWhiteVo"/>
|
||||
<where>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="whiteIp != null and whiteIp != ''"> and white_ip = #{whiteIp}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectTenantWhiteById" parameterType="Long" resultMap="TenantWhiteResult">
|
||||
<include refid="selectTenantWhiteVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTenantWhite" parameterType="TenantWhite">
|
||||
insert into ff_tenant_white
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="whiteIp != null">white_ip,</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="id != null">#{id},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="whiteIp != null">#{whiteIp},</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="updateTenantWhite" parameterType="TenantWhite">
|
||||
update ff_tenant_white
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="whiteIp != null">white_ip = #{whiteIp},</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="deleteTenantWhiteById" parameterType="Long">
|
||||
delete from ff_tenant_white where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTenantWhiteByIds" parameterType="String">
|
||||
delete from ff_tenant_white where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -9,7 +9,7 @@
|
|||
</parent>
|
||||
|
||||
<groupId>com.ff</groupId>
|
||||
<artifactId>ff-admin</artifactId>
|
||||
<artifactId>ff-game</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<name>ff-admin</name>
|
||||
<description>ff-admin</description>
|
|
@ -0,0 +1,137 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
|
||||
import
|
||||
com.ff.agent.dto.AgentTenantSecretKeyDTO;
|
||||
import com.ff.agent.dto.AgentCreateTenantDTO;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
import com.ff.base.enums.OperationType;
|
||||
import com.ff.base.enums.QuotaType;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ISysDeptService;
|
||||
import com.ff.base.system.service.ISysRoleService;
|
||||
import com.ff.base.system.service.ISysUserService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* api控制器
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/tenant")
|
||||
@Slf4j
|
||||
public class AgentController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param tenantSecretKeyDTO 租户密钥
|
||||
* @return {@link TableDataInfo }
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:list')")
|
||||
public TableDataInfo list(TenantSecretKeyDTO tenantSecretKeyDTO) {
|
||||
startPage();
|
||||
tenantSecretKeyDTO.setAgentId(getUserId());
|
||||
List<TenantSecretKey> tenantSecretKeys = tenantSecretKeyService.selectTenantSecretKeyDTOList(tenantSecretKeyDTO);
|
||||
TableDataInfo dataTable = getDataTable(tenantSecretKeys);
|
||||
List<AgentTenantSecretKeyDTO> list = new ArrayList<>();
|
||||
for (TenantSecretKey row : (List<TenantSecretKey>) dataTable.getRows()) {
|
||||
AgentTenantSecretKeyDTO agentTenantSecretKeyDTO = new AgentTenantSecretKeyDTO();
|
||||
BeanUtils.copyProperties(row, agentTenantSecretKeyDTO);
|
||||
list.add(agentTenantSecretKeyDTO);
|
||||
}
|
||||
dataTable.setRows(list);
|
||||
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建租户
|
||||
*
|
||||
* @return {@link AjaxResult }
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@Transactional
|
||||
@PreAuthorize("@ss.hasPermi('agent:tenant:create')")
|
||||
public AjaxResult createTenant(@Validated @RequestBody AgentCreateTenantDTO agentCreateTenantDTO) {
|
||||
|
||||
//构造租户的充值信息
|
||||
List<TenantPlatform> tenantPlatforms = new ArrayList<>();
|
||||
for (TenantAgentPlatform tenantAgentPlatform : agentCreateTenantDTO.getTenantAgentPlatforms()) {
|
||||
TenantPlatform tenantPlatform = new TenantPlatform();
|
||||
BeanUtils.copyProperties(tenantAgentPlatform, tenantPlatform);
|
||||
tenantPlatforms.add(tenantPlatform);
|
||||
}
|
||||
|
||||
|
||||
//创建租户
|
||||
Integer tenant = tenantSecretKeyService.createTenant(CreateTenantDTO.builder()
|
||||
.registerTime(DateUtils.getNowDate())
|
||||
.registerIp(IpUtils.getIpAddr())
|
||||
.agentId(getUserId())
|
||||
.account(agentCreateTenantDTO.getAccount())
|
||||
.password(agentCreateTenantDTO.getPassword())
|
||||
.scoreRatio(agentCreateTenantDTO.getScoreRatio())
|
||||
.tenantType(agentCreateTenantDTO.getTenantType())
|
||||
.depositRatio(agentCreateTenantDTO.getDepositRatio())
|
||||
.tenantPlatforms(tenantPlatforms)
|
||||
.build());
|
||||
|
||||
if (tenant > 0) {
|
||||
//信誉额度
|
||||
if (!ObjectUtils.isEmpty(agentCreateTenantDTO.getRealBalance())) {
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.currencyCode(Constants.USDT)
|
||||
.tenantKey(agentCreateTenantDTO.getAccount())
|
||||
.balance(agentCreateTenantDTO.getRealBalance())
|
||||
.operationType(OperationType.TENANT_RECHARGE.getCode())
|
||||
.quotaType(QuotaType.REPUTATION.getCode())
|
||||
.remark(OperationType.TENANT_RECHARGE.getDescription())
|
||||
.build());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(tenant);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.CommissionApprovalStatus;
|
||||
import com.ff.base.enums.CommissionSourceType;
|
||||
import com.ff.base.enums.CommissionType;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/commission")
|
||||
public class TenantAgentCommissionController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentCommissionService tenantAgentCommissionService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentWithdrawalService tenantAgentWithdrawalService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentService tenantAgentService;
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(TenantAgentCommission tenantAgentCommission) {
|
||||
startPage();
|
||||
tenantAgentCommission.setAgentId(getUserId());
|
||||
List<TenantAgentCommission> list = tenantAgentCommissionService.selectTenantAgentCommissionList(tenantAgentCommission);
|
||||
|
||||
//未提现佣金
|
||||
tenantAgentCommission.setApprovalStatus(CommissionApprovalStatus.UNWITHDRAWN.getValue());
|
||||
BigDecimal unwithdrawn = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//已提现佣金
|
||||
tenantAgentCommission.setApprovalStatus(CommissionApprovalStatus.WITHDRAWN.getValue());
|
||||
BigDecimal withdrawn = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//总佣金
|
||||
tenantAgentCommission.setApprovalStatus(null);
|
||||
BigDecimal total = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
|
||||
// 邀请佣金
|
||||
tenantAgentCommission.setCommissionType(CommissionType.INVITE.getValue());
|
||||
BigDecimal invite = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
//抽成佣金
|
||||
tenantAgentCommission.setCommissionType(CommissionType.TAKE.getValue());
|
||||
BigDecimal take = tenantAgentCommissionService.getAgentCommissionSum(tenantAgentCommission);
|
||||
TableDataInfo dataTable = getDataTable(list);
|
||||
|
||||
AjaxResult ajaxResult = success(dataTable);
|
||||
ajaxResult.put("unwithdrawn", unwithdrawn);
|
||||
ajaxResult.put("withdrawn", withdrawn);
|
||||
ajaxResult.put("total", total);
|
||||
ajaxResult.put("invite", invite);
|
||||
ajaxResult.put("take", take);
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理佣金管理 详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentCommissionService.selectTenantAgentCommissionById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:commission:edit')")
|
||||
@Log(title = "代理佣金管理 ", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@Transactional
|
||||
public synchronized AjaxResult edit() {
|
||||
|
||||
//查询钱包
|
||||
TenantAgent tenantAgent = tenantAgentService.selectTenantAgentById(getUserId());
|
||||
Assert.isTrue(tenantAgent.getTenantStatus(), "当前租户已被停用");
|
||||
Assert.isTrue(!StringUtil.isEmpty(tenantAgent.getWalletAddress()) &&
|
||||
!StringUtil.isEmpty(tenantAgent.getCurrencyAgreement()), "钱包地址为空");
|
||||
|
||||
|
||||
//查询代理佣金信息
|
||||
TenantAgentCommission agentCommission = new TenantAgentCommission();
|
||||
agentCommission.setAgentId(getUserId());
|
||||
agentCommission.setApprovalStatus(CommissionApprovalStatus.UNWITHDRAWN.getValue());
|
||||
List<TenantAgentCommission> list = tenantAgentCommissionService.selectTenantAgentCommissionList(agentCommission);
|
||||
|
||||
BigDecimal usdtBalance = list.stream().map(TenantAgentCommission::getUsdtBalance).reduce(NumberUtil::add).get();
|
||||
Assert.isTrue(usdtBalance.compareTo(BigDecimal.ZERO) > 0, "佣金待提现余额为0");
|
||||
|
||||
TenantAgentWithdrawal tenantAgentWithdrawal = TenantAgentWithdrawal.builder()
|
||||
.agentId(getUserId())
|
||||
.commissionBalance(usdtBalance)
|
||||
.currencyAgreement(tenantAgent.getWalletAddress())
|
||||
.walletAddress(tenantAgent.getWalletAddress())
|
||||
.build();
|
||||
tenantAgentWithdrawalService.insertTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
for (TenantAgentCommission commission : list) {
|
||||
commission.setAgentWithdrawalId(tenantAgentWithdrawal.getId());
|
||||
commission.setUpdateBy(getUsername());
|
||||
commission.setApprovalStatus(CommissionApprovalStatus.WITHDRAWING.getValue());
|
||||
tenantAgentCommissionService.updateTenantAgentCommission(commission);
|
||||
}
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.dto.TenantAgentInviteDTO;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.base.annotation.Anonymous;
|
||||
import com.ff.base.constant.ConfigConstants;
|
||||
import com.ff.base.enums.InviteType;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite")
|
||||
public class TenantAgentInviteController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentInviteService tenantAgentInviteService;
|
||||
|
||||
@Resource
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 获取代理邀请链接详细信息
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping(value = "/code/{inviteCode}")
|
||||
public AjaxResult getInfo(@PathVariable("inviteCode") String inviteCode) {
|
||||
return success(tenantAgentInviteService.selectTenantAgentInviteByInviteCode(inviteCode));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentInvite tenantAgentInvite) {
|
||||
startPage();
|
||||
tenantAgentInvite.setAgentId(getUserId());
|
||||
List<TenantAgentInvite> list = tenantAgentInviteService.selectTenantAgentInviteList(tenantAgentInvite);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理邀请链接详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentInviteService.selectTenantAgentInviteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:invite:add')")
|
||||
@Log(title = "代理邀请链接", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@Transactional
|
||||
public AjaxResult add(@Validated @RequestBody TenantAgentInviteDTO tenantAgentInvite) {
|
||||
tenantAgentInvite.setAgentId(getUserId());
|
||||
String inviteUrl = sysConfigService.selectConfigByKey(ConfigConstants.INVITE_URL);
|
||||
tenantAgentInvite.setInviteCode(tenantAgentInviteService.getInviteCode());
|
||||
tenantAgentInvite.setInviteUrl(inviteUrl + "?code=" + tenantAgentInvite.getInviteCode());
|
||||
tenantAgentInvite.setCreateBy(getUsername());
|
||||
int result = tenantAgentInviteService.insertTenantAgentInvite(tenantAgentInvite);
|
||||
if (result > 0 && InviteType.TENANT.getValue().equals(tenantAgentInvite.getInviteType())) {
|
||||
// 保存平台注册利润信息
|
||||
List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms = tenantAgentInvite.getTenantAgentInvitePlatforms();
|
||||
for (TenantAgentInvitePlatform tenantAgentInvitePlatform : tenantAgentInvitePlatforms) {
|
||||
tenantAgentInvitePlatform.setInviteId(tenantAgentInvite.getId());
|
||||
tenantAgentInvitePlatform.setCreateBy(getUsername());
|
||||
tenantAgentInvitePlatformService.insertTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite/platform")
|
||||
public class TenantAgentInvitePlatformController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
|
||||
List<TenantAgentInvitePlatform> list = tenantAgentInvitePlatformService.selectTenantAgentInvitePlatformList(tenantAgentInvitePlatform);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,236 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterAddDTO;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import com.ff.base.annotation.Anonymous;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.enums.*;
|
||||
import com.ff.base.system.domain.TenantAgent;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
import com.ff.base.system.service.ITenantAgentService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.MessageUtils;
|
||||
import com.ff.base.utils.SecurityUtils;
|
||||
import com.ff.base.utils.bean.BeanUtils;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/invite/register")
|
||||
public class TenantAgentInviteRegisterController extends BaseController {
|
||||
@Autowired
|
||||
private ITenantAgentInviteRegisterService tenantAgentInviteRegisterService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInviteService tenantAgentInviteService;
|
||||
|
||||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantGameQuotaService tenantGameQuotaService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentCommissionService tenantAgentCommissionService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentService tenantAgentService;
|
||||
|
||||
@Resource
|
||||
private ITenantAgentInvitePlatformService tenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operation:register:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO) {
|
||||
startPage();
|
||||
tenantAgentInviteRegisterDTO.setAgentId(getUserId());
|
||||
List<TenantAgentInviteRegisterDTO> list = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterListDTO(tenantAgentInviteRegisterDTO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理邀请注册详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operation:register:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TenantAgentInviteRegisterAddDTO tenantAgentInviteRegisterAddDTO) {
|
||||
Assert.isTrue(tenantAgentInviteRegisterAddDTO.getPassword().equals(tenantAgentInviteRegisterAddDTO.getConfirmPassword()), "两次密码不一致");
|
||||
|
||||
List<TenantAgentInvite> tenantAgentInvites = tenantAgentInviteService.selectTenantAgentInviteList(TenantAgentInvite.builder()
|
||||
.inviteCode(tenantAgentInviteRegisterAddDTO.getInviteCode())
|
||||
.build());
|
||||
Assert.isTrue(!CollectionUtils.isEmpty(tenantAgentInvites), "邀请码错误");
|
||||
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(tenantAgentInviteRegisterAddDTO.getAccount());
|
||||
Assert.isTrue(ObjectUtils.isEmpty(tenantSecretKey), MessageUtils.message("operation.tenant.account.already.used"));
|
||||
|
||||
List<TenantAgentInviteRegister> tenantAgentInviteRegisters = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterList(TenantAgentInviteRegister.builder()
|
||||
.account(tenantAgentInviteRegisterAddDTO.getAccount())
|
||||
.build());
|
||||
Assert.isTrue(CollectionUtils.isEmpty(tenantAgentInviteRegisters), MessageUtils.message("operation.tenant.account.already.used"));
|
||||
|
||||
|
||||
TenantAgentInviteRegister tenantAgentInviteRegister = new TenantAgentInviteRegister();
|
||||
tenantAgentInviteRegister.setAgentId(tenantAgentInvites.get(0).getAgentId());
|
||||
tenantAgentInviteRegister.setRegisterTime(DateUtils.getNowDate());
|
||||
tenantAgentInviteRegister.setRegisterIp(IpUtils.getIpAddr());
|
||||
tenantAgentInviteRegister.setAccount(tenantAgentInviteRegisterAddDTO.getAccount());
|
||||
tenantAgentInviteRegister.setPassword(tenantAgentInviteRegisterAddDTO.getPassword());
|
||||
tenantAgentInviteRegister.setBalance(tenantAgentInvites.get(0).getBalance());
|
||||
tenantAgentInviteRegister.setInviteCode(tenantAgentInviteRegisterAddDTO.getInviteCode());
|
||||
tenantAgentInviteRegister.setOrderId(IdUtil.getSnowflakeNextIdStr());
|
||||
return toAjax(tenantAgentInviteRegisterService.insertTenantAgentInviteRegister(tenantAgentInviteRegister));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto 向
|
||||
*/
|
||||
@Anonymous
|
||||
@PutMapping
|
||||
@Transactional
|
||||
public void edit(@RequestBody TenantAgentInviteRegisterAddDTO dto) {
|
||||
TenantAgentInviteRegister tenantAgentInviteRegister = tenantAgentInviteRegisterService.selectTenantAgentInviteRegisterById(dto.getId());
|
||||
|
||||
Assert.isTrue(tenantAgentInviteRegister.getStatus().equals(InviterRegisterStatus.PENDING.getValue()), "该账号已激活");
|
||||
|
||||
//查询注册配置信息
|
||||
TenantAgentInvite tenantAgentInvite = tenantAgentInviteService.selectTenantAgentInviteByInviteCode(tenantAgentInviteRegister.getInviteCode());
|
||||
|
||||
List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms = tenantAgentInvitePlatformService.selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform.builder()
|
||||
.inviteId(tenantAgentInvite.getId())
|
||||
.build());
|
||||
Integer result = 0;
|
||||
if (tenantAgentInvite.getInviteType().equals(InviteType.TENANT.getValue())) {
|
||||
|
||||
List<TenantPlatform> tenantPlatforms = new ArrayList<>();
|
||||
for (TenantAgentInvitePlatform tenantAgentInvitePlatform : tenantAgentInvitePlatforms) {
|
||||
TenantPlatform tenantPlatform = new TenantPlatform();
|
||||
BeanUtils.copyProperties(tenantAgentInvitePlatform, tenantPlatform);
|
||||
tenantPlatforms.add(tenantPlatform);
|
||||
}
|
||||
|
||||
//创建租户
|
||||
result = tenantSecretKeyService.createTenant(CreateTenantDTO.builder()
|
||||
.registerTime(tenantAgentInviteRegister.getRegisterTime())
|
||||
.registerIp(tenantAgentInviteRegister.getRegisterIp())
|
||||
.agentId(tenantAgentInvite.getAgentId())
|
||||
.account(tenantAgentInviteRegister.getAccount())
|
||||
.password(tenantAgentInviteRegister.getPassword())
|
||||
.scoreRatio(tenantAgentInvite.getScoreRatio())
|
||||
.tenantType(tenantAgentInvite.getTenantType())
|
||||
.depositRatio(tenantAgentInvite.getDepositRatio())
|
||||
.tenantPlatforms(tenantPlatforms)
|
||||
.build());
|
||||
//信誉额度
|
||||
if (result > 0 & !ObjectUtils.isEmpty(tenantAgentInvite.getRealBalance())) {
|
||||
tenantGameQuotaService.balanceChanges(BalanceChangesDTO.builder()
|
||||
.isOut(Boolean.TRUE)
|
||||
.currencyCode(Constants.USDT)
|
||||
.tenantKey(tenantAgentInviteRegister.getAccount())
|
||||
.balance(tenantAgentInvite.getRealBalance())
|
||||
.operationType(OperationType.TENANT_RECHARGE.getCode())
|
||||
.quotaType(QuotaType.REPUTATION.getCode())
|
||||
.remark(OperationType.TENANT_RECHARGE.getDescription())
|
||||
.build());
|
||||
|
||||
}
|
||||
} else {
|
||||
result = tenantAgentService.createTenantAgent(TenantAgent.builder()
|
||||
.account(tenantAgentInviteRegister.getAccount())
|
||||
.password(tenantAgentInviteRegister.getPassword())
|
||||
.registerTime(tenantAgentInviteRegister.getRegisterTime())
|
||||
.registerIp(tenantAgentInviteRegister.getRegisterIp())
|
||||
.registerIpCity(tenantAgentInviteRegister.getRegisterIpCity())
|
||||
.tenantStatus(Boolean.TRUE)
|
||||
.build());
|
||||
}
|
||||
if (result > 0) {
|
||||
//添加佣金信息
|
||||
TenantAgentCommission tenantAgentCommission = TenantAgentCommission.builder()
|
||||
.agentId(tenantAgentInvite.getAgentId())
|
||||
.sourceId(tenantAgentInviteRegister.getId())
|
||||
.sourceType(CommissionSourceType.AGENT_TENANT_REGISTER.getValue())
|
||||
.commissionType(CommissionType.INVITE.getValue())
|
||||
.currencyCode(Constants.USDT)
|
||||
.balance(tenantAgentInviteRegister.getBalance())
|
||||
.costBalance(BigDecimal.ZERO)
|
||||
.merchantBalance(BigDecimal.ZERO)
|
||||
.commissionBalance(tenantAgentInviteRegister.getBalance())
|
||||
.usdtBalance(tenantAgentInviteRegister.getBalance())
|
||||
.build();
|
||||
tenantAgentCommission.setCreateBy(tenantAgentInviteRegister.getAccount());
|
||||
tenantAgentCommissionService.insertTenantAgentCommission(tenantAgentCommission);
|
||||
|
||||
//更新激活状态
|
||||
tenantAgentInviteRegister.setStatus(InviterRegisterStatus.ACTIVATED.getValue());
|
||||
tenantAgentInviteRegisterService.updateTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ff.base.core.page.PageDomain;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.service.ITenantAgentPlatformService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/platform")
|
||||
public class TenantAgentPlatformController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentPlatformService tenantAgentPlatformService;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*/
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select( )
|
||||
{
|
||||
PageHelper.orderBy("platform_code desc,currency_code desc");
|
||||
List<TenantAgentPlatform> list = tenantAgentPlatformService.selectTenantAgentPlatformList(TenantAgentPlatform.builder().build());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.ff.agent.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ff.base.annotation.Log;
|
||||
import com.ff.base.core.controller.BaseController;
|
||||
import com.ff.base.core.domain.AjaxResult;
|
||||
import com.ff.base.enums.BusinessType;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import com.ff.base.utils.poi.ExcelUtil;
|
||||
import com.ff.base.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Controller
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/agent/withdrawal")
|
||||
public class TenantAgentWithdrawalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ITenantAgentWithdrawalService tenantAgentWithdrawalService;
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
startPage();
|
||||
tenantAgentWithdrawal.setAgentId(getUserId());
|
||||
List<TenantAgentWithdrawal> list = tenantAgentWithdrawalService.selectTenantAgentWithdrawalList(tenantAgentWithdrawal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取代理申请提现审批管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(tenantAgentWithdrawalService.selectTenantAgentWithdrawalById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('agent:withdrawal:edit')")
|
||||
@Log(title = "代理申请提现审批管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
return toAjax(tenantAgentWithdrawalService.updateTenantAgentWithdrawal(tenantAgentWithdrawal));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.ff.agent.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 对象 ff_tenant_agent_commission
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgentCommission extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 代理id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
/** 来源id */
|
||||
@Excel(name = "来源id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long sourceId;
|
||||
|
||||
/** 来源类型 CommissionSourceType */
|
||||
@Excel(name = "来源类型 CommissionSourceType")
|
||||
private Integer sourceType;
|
||||
|
||||
/** 佣金类型 ff_tenant_agent_commission_type commissionType */
|
||||
@Excel(name = "佣金类型 commissionType")
|
||||
private Integer commissionType;
|
||||
|
||||
/** 币种 */
|
||||
@Excel(name = "币种")
|
||||
private String currencyCode;
|
||||
|
||||
/** 平台代码 */
|
||||
@Excel(name = "平台代码")
|
||||
private String platformCode;
|
||||
|
||||
/** 成本比例 */
|
||||
@Excel(name = "成本比例")
|
||||
private BigDecimal costBalance;
|
||||
|
||||
/** 商户比例 */
|
||||
@Excel(name = "商户比例")
|
||||
private BigDecimal merchantBalance;
|
||||
|
||||
/** 充值金额 */
|
||||
@Excel(name = "充值金额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 佣金金额 */
|
||||
@Excel(name = "佣金金额")
|
||||
private BigDecimal commissionBalance;
|
||||
|
||||
/** USDT金额 */
|
||||
@Excel(name = "USDT金额")
|
||||
private BigDecimal usdtBalance;
|
||||
|
||||
/** 佣金审批状态 ff_tenant_agent_approval_status 0 未提现 1 提现中 1 已提现 */
|
||||
@Excel(name = "佣金审批状态 0 未提现 1 提现中 1 已提现")
|
||||
private Integer approvalStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 代理提款id
|
||||
*/
|
||||
private Long agentWithdrawalId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.ff.agent.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 代理邀请链接对象 ff_tenant_agent_invite
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgentInvite extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 代理id */
|
||||
@Excel(name = "代理id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
/** 缴费金额 */
|
||||
@Excel(name = "缴费金额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 邀请类型 1 租户 2代理 ff_agent_invite_type */
|
||||
@Excel(name = "邀请类型 1 租户 2代理 ")
|
||||
private Integer inviteType;
|
||||
|
||||
/** 额度类型 TenantQuotaType 枚举 */
|
||||
@Excel(name = "额度类型 TenantQuotaType 枚举")
|
||||
private Integer quotaType;
|
||||
|
||||
/** 买分比例 */
|
||||
@Excel(name = "买分比例")
|
||||
private BigDecimal scoreRatio;
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
@Excel(name = "租户类型 TenantType 枚举")
|
||||
private Integer tenantType;
|
||||
|
||||
/** 透支比例 */
|
||||
@Excel(name = "透支比例")
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/** 信誉额度 */
|
||||
@Excel(name = "信誉额度")
|
||||
private BigDecimal realBalance;
|
||||
|
||||
/** 邀请码 */
|
||||
@Excel(name = "邀请码")
|
||||
private String inviteCode;
|
||||
|
||||
/** 邀请链接 */
|
||||
@Excel(name = "邀请链接")
|
||||
private String inviteUrl;
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.ff.agent.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理对象 ff_tenant_agent_invite_platform
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgentInvitePlatform extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 邀请码id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@Excel(name = "邀请码id", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Long inviteId;
|
||||
|
||||
/** 平台编码 */
|
||||
@Excel(name = "平台编码")
|
||||
private String platformCode;
|
||||
|
||||
/** 币种编码 */
|
||||
@Excel(name = "币种编码")
|
||||
private String currencyCode;
|
||||
|
||||
/** 成本 */
|
||||
@Excel(name = "成本")
|
||||
private BigDecimal cost;
|
||||
|
||||
/** 使用成本 */
|
||||
@Excel(name = "使用成本")
|
||||
private BigDecimal useCost;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.ff.agent.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 代理邀请注册对象 ff_tenant_agent_invite_register
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgentInviteRegister extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 代理id */
|
||||
@Excel(name = "代理id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
/** 邀请码 */
|
||||
@Excel(name = "邀请码")
|
||||
private String inviteCode;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
private String password;
|
||||
|
||||
/** 缴费金额 */
|
||||
@Excel(name = "缴费金额")
|
||||
private BigDecimal balance;
|
||||
|
||||
/** 注册时间 */
|
||||
@Excel(name = "注册时间")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long registerTime;
|
||||
|
||||
/** 注册IP */
|
||||
@Excel(name = "注册IP")
|
||||
private String registerIp;
|
||||
|
||||
/** 注册ip的城市 */
|
||||
@Excel(name = "注册ip的城市")
|
||||
private String registerIpCity;
|
||||
|
||||
/** 状态 1 待激活 2已激活 InviterRegisterStatus 枚举*/
|
||||
@Excel(name = "状态 1 待激活 2已激活")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 支付订单id
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.ff.agent.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理对象 ff_tenant_agent_withdrawal
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TenantAgentWithdrawal extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 代理id
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
/** 佣金余额 */
|
||||
@Excel(name = "佣金余额")
|
||||
private BigDecimal commissionBalance;
|
||||
|
||||
/** 币种协议 */
|
||||
@Excel(name = "币种协议")
|
||||
private String currencyAgreement;
|
||||
|
||||
/** 钱包地址 */
|
||||
@Excel(name = "钱包地址")
|
||||
private String walletAddress;
|
||||
|
||||
/** 0 未提现 1 提现中 1 已提现 3 已拒绝 */
|
||||
@Excel(name = " 0 未提现 1 提现中 1 已提现 3 已拒绝")
|
||||
private Integer approvalStatus;
|
||||
|
||||
|
||||
}
|
|
@ -1,7 +1,8 @@
|
|||
package com.ff.agent.request;
|
||||
package com.ff.agent.dto;
|
||||
|
||||
|
||||
import com.ff.base.xss.Xss;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
@ -9,6 +10,7 @@ import javax.validation.constraints.NotNull;
|
|||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理创建租户
|
||||
|
@ -17,7 +19,7 @@ import java.math.BigDecimal;
|
|||
* @date 2025/02/20
|
||||
*/
|
||||
@Data
|
||||
public class AgentCreateTenantRequest implements Serializable {
|
||||
public class AgentCreateTenantDTO implements Serializable {
|
||||
private static final long serialVersionUID = -5561068216486978354L;
|
||||
|
||||
|
||||
|
@ -34,12 +36,12 @@ public class AgentCreateTenantRequest implements Serializable {
|
|||
@NotBlank(message = "密码不能为空")
|
||||
@Size(min = 5, max = 20, message = "密码长度不能超过25个字符")
|
||||
private String password;
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
@NotBlank(message = "确认密码不能为空")
|
||||
@Size(min = 5, max = 20, message = "密码长度不能超过25个字符")
|
||||
private String confirmPassword;
|
||||
|
||||
|
||||
/** 买分比例 */
|
||||
@NotNull(message = "买分比例不能为空")
|
||||
private BigDecimal scoreRatio;
|
||||
|
||||
|
||||
|
||||
/** 租户类型 TenantType 枚举 */
|
||||
|
@ -52,6 +54,13 @@ public class AgentCreateTenantRequest implements Serializable {
|
|||
/** 透支比例 */
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
@NotNull(message = "租户代理平台列表不能为空")
|
||||
@Size(min = 1, message = "租户代理平台列表必须包含至少一个元素")
|
||||
private List<TenantAgentPlatform> tenantAgentPlatforms;
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -25,6 +27,7 @@ public class AgentTenantSecretKeyDTO extends BaseEntity
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
|
@ -41,6 +44,7 @@ public class AgentTenantSecretKeyDTO extends BaseEntity
|
|||
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long loginData;
|
||||
|
||||
|
||||
|
@ -51,6 +55,7 @@ public class AgentTenantSecretKeyDTO extends BaseEntity
|
|||
|
||||
/** 代理id */
|
||||
@Excel(name = "代理id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long agentId;
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 租户代理邀请dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/27
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteDTO extends TenantAgentInvite {
|
||||
|
||||
/**
|
||||
* 租户代理平台利润
|
||||
*/
|
||||
@NotNull(message = "租户代理平台列表不能为空")
|
||||
@Size(min = 1, message = "租户代理平台列表必须包含至少一个元素")
|
||||
private List<TenantAgentInvitePlatform> tenantAgentInvitePlatforms;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
|
||||
import com.ff.base.annotation.Excel;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 租户代理邀请注册添加数据
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/25
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteRegisterAddDTO extends BaseEntity {
|
||||
|
||||
|
||||
/** 邀请码 */
|
||||
private String inviteCode;
|
||||
|
||||
/** 账号 */
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
private String confirmPassword;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.ff.agent.dto;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.base.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 租户代理邀请注册dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/26
|
||||
*/
|
||||
@Data
|
||||
public class TenantAgentInviteRegisterDTO extends TenantAgentInviteRegister {
|
||||
/**
|
||||
* 邀请类型
|
||||
*/
|
||||
private Integer inviteType;
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface TenantAgentCommissionMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
TenantAgentCommission selectTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理 集合
|
||||
*/
|
||||
List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionByIds(Long[] ids);
|
||||
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface TenantAgentInviteMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode);
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接集合
|
||||
*/
|
||||
List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface TenantAgentInvitePlatformMapper
|
||||
{
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理集合
|
||||
*/
|
||||
List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface TenantAgentInviteRegisterMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO);
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册集合
|
||||
*/
|
||||
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.agent.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Mapper接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface TenantAgentWithdrawalMapper
|
||||
{
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理集合
|
||||
*/
|
||||
List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface ITenantAgentCommissionService
|
||||
{
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
TenantAgentCommission selectTenantAgentCommissionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理 集合
|
||||
*/
|
||||
List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission);
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的代理佣金管理 主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理 信息
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentCommissionById(Long id);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
public interface ITenantAgentInvitePlatformService
|
||||
{
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id);
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理集合
|
||||
*/
|
||||
List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform);
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台邀请注册成本管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理信息
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInvitePlatformById(Long id);
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface ITenantAgentInviteRegisterService
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册集合
|
||||
*/
|
||||
List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的代理邀请注册主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册信息
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteRegisterById(Long id);
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
public interface ITenantAgentInviteService
|
||||
{
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode);
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接集合
|
||||
*/
|
||||
List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 获取邀请码
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
String getInviteCode();
|
||||
|
||||
/**
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite);
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的代理邀请链接主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接信息
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentInviteById(Long id);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ff.agent.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Service接口
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
public interface ITenantAgentWithdrawalService
|
||||
{
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理集合
|
||||
*/
|
||||
List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal);
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的代理申请提现审批管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理信息
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTenantAgentWithdrawalById(Long id);
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentCommissionMapper;
|
||||
import com.ff.agent.domain.TenantAgentCommission;
|
||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||
|
||||
/**
|
||||
* 代理佣金管理 Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentCommissionServiceImpl implements ITenantAgentCommissionService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentCommissionMapper tenantAgentCommissionMapper;
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentCommission selectTenantAgentCommissionById(Long id)
|
||||
{
|
||||
return tenantAgentCommissionMapper.selectTenantAgentCommissionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理佣金管理 列表
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 代理佣金管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentCommission> selectTenantAgentCommissionList(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
return tenantAgentCommissionMapper.selectTenantAgentCommissionList(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得代理佣金
|
||||
*
|
||||
* @param tenantAgentCommission 租户代理佣金
|
||||
* @return {@link BigDecimal }
|
||||
*/
|
||||
@Override
|
||||
public BigDecimal getAgentCommissionSum(TenantAgentCommission tenantAgentCommission) {
|
||||
return tenantAgentCommissionMapper.getAgentCommissionSum(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
tenantAgentCommission.setCreateTime(DateUtils.getNowDate());
|
||||
tenantAgentCommission.setId(IdUtil.getSnowflakeNextId());
|
||||
return tenantAgentCommissionMapper.insertTenantAgentCommission(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理佣金管理
|
||||
*
|
||||
* @param tenantAgentCommission 代理佣金管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentCommission(TenantAgentCommission tenantAgentCommission)
|
||||
{
|
||||
tenantAgentCommission.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentCommissionMapper.updateTenantAgentCommission(tenantAgentCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理佣金管理
|
||||
*
|
||||
* @param ids 需要删除的代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentCommissionByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentCommissionMapper.deleteTenantAgentCommissionByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理佣金管理 信息
|
||||
*
|
||||
* @param id 代理佣金管理 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentCommissionById(Long id)
|
||||
{
|
||||
return tenantAgentCommissionMapper.deleteTenantAgentCommissionById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
|
||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 平台邀请注册成本管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-27
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInvitePlatformServiceImpl implements ITenantAgentInvitePlatformService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInvitePlatformMapper tenantAgentInvitePlatformMapper;
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvitePlatform selectTenantAgentInvitePlatformById(Long id)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询平台邀请注册成本管理列表
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 平台邀请注册成本管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInvitePlatform> selectTenantAgentInvitePlatformList(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.selectTenantAgentInvitePlatformList(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
tenantAgentInvitePlatform.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInvitePlatform.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInvitePlatformMapper.insertTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台邀请注册成本管理
|
||||
*
|
||||
* @param tenantAgentInvitePlatform 平台邀请注册成本管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInvitePlatform(TenantAgentInvitePlatform tenantAgentInvitePlatform)
|
||||
{
|
||||
tenantAgentInvitePlatform.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInvitePlatformMapper.updateTenantAgentInvitePlatform(tenantAgentInvitePlatform);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除平台邀请注册成本管理
|
||||
*
|
||||
* @param ids 需要删除的平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInvitePlatformByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除平台邀请注册成本管理信息
|
||||
*
|
||||
* @param id 平台邀请注册成本管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInvitePlatformById(Long id)
|
||||
{
|
||||
return tenantAgentInvitePlatformMapper.deleteTenantAgentInvitePlatformById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
|
||||
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 代理邀请注册Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInviteRegisterServiceImpl implements ITenantAgentInviteRegisterService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInviteRegisterMapper tenantAgentInviteRegisterMapper;
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理邀请注册列表
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 代理邀请注册
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInviteRegister> selectTenantAgentInviteRegisterList(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterList(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择租户代理邀请注册列表dto
|
||||
*
|
||||
* @param tenantAgentInviteRegisterDTO 租户代理邀请注册dto
|
||||
* @return {@link List }<{@link TenantAgentInviteRegisterDTO }>
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInviteRegisterDTO> selectTenantAgentInviteRegisterListDTO(TenantAgentInviteRegisterDTO tenantAgentInviteRegisterDTO) {
|
||||
return tenantAgentInviteRegisterMapper.selectTenantAgentInviteRegisterListDTO(tenantAgentInviteRegisterDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
tenantAgentInviteRegister.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInviteRegister.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteRegisterMapper.insertTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理邀请注册
|
||||
*
|
||||
* @param tenantAgentInviteRegister 代理邀请注册
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInviteRegister(TenantAgentInviteRegister tenantAgentInviteRegister)
|
||||
{
|
||||
tenantAgentInviteRegister.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteRegisterMapper.updateTenantAgentInviteRegister(tenantAgentInviteRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请注册
|
||||
*
|
||||
* @param ids 需要删除的代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteRegisterByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理邀请注册信息
|
||||
*
|
||||
* @param id 代理邀请注册主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteRegisterById(Long id)
|
||||
{
|
||||
return tenantAgentInviteRegisterMapper.deleteTenantAgentInviteRegisterById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.NumberUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentInviteMapper;
|
||||
import com.ff.agent.domain.TenantAgentInvite;
|
||||
import com.ff.agent.service.ITenantAgentInviteService;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
* 代理邀请链接Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentInviteServiceImpl implements ITenantAgentInviteService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentInviteMapper tenantAgentInviteMapper;
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvite selectTenantAgentInviteById(Long id)
|
||||
{
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按邀请代码选择租户代理邀请
|
||||
*
|
||||
* @param inviteCode 邀请码
|
||||
* @return {@link TenantAgentInvite }
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentInvite selectTenantAgentInviteByInviteCode(String inviteCode) {
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteByInviteCode( inviteCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理邀请链接列表
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 代理邀请链接
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentInvite> selectTenantAgentInviteList(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
return tenantAgentInviteMapper.selectTenantAgentInviteList(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentInvite(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
tenantAgentInvite.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentInvite.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteMapper.insertTenantAgentInvite(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邀请码
|
||||
*
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public synchronized String getInviteCode() {
|
||||
String inviteCode = NumberUtils.generateRandomCode(12);
|
||||
while (!CollectionUtils.isEmpty(tenantAgentInviteMapper.selectTenantAgentInviteList(TenantAgentInvite.builder()
|
||||
.inviteCode(inviteCode)
|
||||
.build()))) {
|
||||
inviteCode = NumberUtils.generateRandomCode(12);
|
||||
}
|
||||
return inviteCode;
|
||||
}
|
||||
|
||||
/**3
|
||||
* 修改代理邀请链接
|
||||
*
|
||||
* @param tenantAgentInvite 代理邀请链接
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentInvite(TenantAgentInvite tenantAgentInvite)
|
||||
{
|
||||
tenantAgentInvite.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentInviteMapper.updateTenantAgentInvite(tenantAgentInvite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理邀请链接
|
||||
*
|
||||
* @param ids 需要删除的代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentInviteMapper.deleteTenantAgentInviteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理邀请链接信息
|
||||
*
|
||||
* @param id 代理邀请链接主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentInviteById(Long id)
|
||||
{
|
||||
return tenantAgentInviteMapper.deleteTenantAgentInviteById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
package com.ff.agent.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
|
||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 代理申请提现审批管理Service业务层处理
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class TenantAgentWithdrawalServiceImpl implements ITenantAgentWithdrawalService
|
||||
{
|
||||
@Autowired
|
||||
private TenantAgentWithdrawalMapper tenantAgentWithdrawalMapper;
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
@Override
|
||||
public TenantAgentWithdrawal selectTenantAgentWithdrawalById(Long id)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理申请提现审批管理列表
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 代理申请提现审批管理
|
||||
*/
|
||||
@Override
|
||||
public List<TenantAgentWithdrawal> selectTenantAgentWithdrawalList(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.selectTenantAgentWithdrawalList(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
tenantAgentWithdrawal.setId(IdUtil.getSnowflakeNextId());
|
||||
tenantAgentWithdrawal.setCreateTime(DateUtils.getNowDate());
|
||||
return tenantAgentWithdrawalMapper.insertTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理申请提现审批管理
|
||||
*
|
||||
* @param tenantAgentWithdrawal 代理申请提现审批管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateTenantAgentWithdrawal(TenantAgentWithdrawal tenantAgentWithdrawal)
|
||||
{
|
||||
tenantAgentWithdrawal.setUpdateTime(DateUtils.getNowDate());
|
||||
return tenantAgentWithdrawalMapper.updateTenantAgentWithdrawal(tenantAgentWithdrawal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理申请提现审批管理
|
||||
*
|
||||
* @param ids 需要删除的代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentWithdrawalByIds(Long[] ids)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理申请提现审批管理信息
|
||||
*
|
||||
* @param id 代理申请提现审批管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteTenantAgentWithdrawalById(Long id)
|
||||
{
|
||||
return tenantAgentWithdrawalMapper.deleteTenantAgentWithdrawalById(id);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,11 @@
|
|||
package com.ff.annotation;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.system.domain.TenantWhite;
|
||||
import com.ff.base.system.service.ITenantWhiteService;
|
||||
import com.ff.base.utils.ip.IpUtils;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.base.utils.sign.Md5Utils;
|
||||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
|
@ -15,6 +20,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标题检查方面
|
||||
|
@ -29,6 +35,9 @@ public class HeaderCheckAspect {
|
|||
@Resource
|
||||
private ITenantSecretKeyService tenantSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private ITenantWhiteService tenantWhiteService;
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyUtils;
|
||||
|
||||
|
@ -59,10 +68,16 @@ public class HeaderCheckAspect {
|
|||
|
||||
|
||||
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(key);
|
||||
Assert.notNull(tenantSecretKey, "key不存在");
|
||||
Assert.notNull(tenantSecretKey, key+"key不存在");
|
||||
|
||||
Assert.isTrue(tenantSecretKey.getTenantStatus(), "当前租户已停用");
|
||||
|
||||
List<TenantWhite> tenantWhites = tenantWhiteService.selectTenantWhiteList(TenantWhite.builder()
|
||||
.tenantId(tenantSecretKey.getId())
|
||||
.whiteIp(IpUtils.getIpAddr())
|
||||
.build());
|
||||
Assert.isTrue(!tenantWhites.isEmpty(), "当前"+IpUtils.getIpAddr()+"不在白名单内");
|
||||
|
||||
String keyG = Md5Utils.md5New(random + key + tenantSecretKey.getTenantSecret());
|
||||
Assert.isTrue(keyG.equals(sign), "签名错误");
|
||||
//保存
|
|
@ -185,6 +185,7 @@ public class ApiGameController extends BaseController {
|
|||
|
||||
BigDecimal quota = tenantGameQuotaService.gameBalanceExchange(GameBalanceExchange.builder()
|
||||
.platformCode(gameExchangeBalanceRequest.getPlatformCode())
|
||||
.sourceId(gameExchangeBalanceRequest.getOrderId())
|
||||
.currencyCode(gameExchangeBalanceRequest.getCurrencyCode())
|
||||
.transferType(gameExchangeBalanceRequest.getTransferType())
|
||||
.amount(gameExchangeBalanceRequest.getAmount())
|
||||
|
@ -494,6 +495,7 @@ public class ApiGameController extends BaseController {
|
|||
tenantGameQuotaService.gameBalanceExchange(GameBalanceExchange.builder()
|
||||
.platformCode(gameExchangeMoney.getPlatformCode())
|
||||
.currencyCode(gameExchangeMoney.getCurrencyCode())
|
||||
.sourceId(gameExchangeBalanceAllRequest.getOrderId())
|
||||
.transferType(TransferType.ALL.getCode())
|
||||
.amount(gameExchangeMoney.getBalance())
|
||||
.account(member.getMemberAccount())
|
|
@ -46,7 +46,7 @@ public class GameExchangeBalanceRequest implements Serializable {
|
|||
* 金额
|
||||
*/
|
||||
@NotNull(message = "amount不能为空")
|
||||
@Min(value = 0, message = "amount最小值为0")
|
||||
@Min(value = 1, message = "amount最小值为1")
|
||||
@Max(value = 999999999, message = "amount最大值为999999999")
|
||||
private BigDecimal amount;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue