refactor(exception): 新增自定义异常类并重构异常处理
- 新增 ApiException 类用于处理 API相关的异常 - 新增 BaseException 类作为基础异常类- 重构 CurrencyMapper 接口,调整包结构 - 新增 CurrencyServiceImpl 类实现币种相关服务 - 更新原有的 CurrencyServiceImpl 类,调整导入顺序main-pp
parent
e566053cb7
commit
4894bd7784
|
|
@ -16,6 +16,10 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ff</groupId>
|
||||||
|
<artifactId>ff-util</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
|
@ -51,7 +55,11 @@
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.mapper;
|
package com.ff.agent.mapper;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentCommission;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.agent.domain.TenantAgentCommission;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理佣金管理 Mapper接口
|
* 代理佣金管理 Mapper接口
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.mapper;
|
package com.ff.agent.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentInvite;
|
import com.ff.agent.domain.TenantAgentInvite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理邀请链接Mapper接口
|
* 代理邀请链接Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.mapper;
|
package com.ff.agent.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台邀请注册成本管理Mapper接口
|
* 平台邀请注册成本管理Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ff.agent.mapper;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理邀请注册Mapper接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-25
|
||||||
|
*/
|
||||||
|
public interface TenantAgentInviteRegisterMapper {
|
||||||
|
/**
|
||||||
|
* 查询代理邀请注册
|
||||||
|
*
|
||||||
|
* @param id 代理邀请注册主键
|
||||||
|
* @return 代理邀请注册
|
||||||
|
*/
|
||||||
|
TenantAgentInviteRegister selectTenantAgentInviteRegisterById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询代理邀请注册列表
|
||||||
|
*
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.mapper;
|
package com.ff.agent.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理申请提现审批管理Mapper接口
|
* 代理申请提现审批管理Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.ff.agent.service;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentCommission;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理佣金管理 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 com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台邀请注册成本管理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,62 @@
|
||||||
|
package com.ff.agent.service;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理邀请注册
|
||||||
|
*
|
||||||
|
* @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,70 @@
|
||||||
|
package com.ff.agent.service;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentInvite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理邀请链接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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理邀请链接
|
||||||
|
*
|
||||||
|
* @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 com.ff.agent.domain.TenantAgentWithdrawal;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理申请提现审批管理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 cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentCommission;
|
||||||
|
import com.ff.agent.mapper.TenantAgentCommissionMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理佣金管理 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,100 @@
|
||||||
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||||
|
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台邀请注册成本管理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,93 @@
|
||||||
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||||
|
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理邀请注册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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增代理邀请注册
|
||||||
|
*
|
||||||
|
* @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,103 @@
|
||||||
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentInvite;
|
||||||
|
import com.ff.agent.mapper.TenantAgentInviteMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentInviteService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理邀请链接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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改代理邀请链接
|
||||||
|
*
|
||||||
|
* @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,93 @@
|
||||||
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||||
|
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理申请提现审批管理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,8 +1,9 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.common.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.Currency;
|
import com.ff.common.domain.Currency;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种Mapper接口
|
* 币种Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.common.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.Lang;
|
import com.ff.common.domain.Lang;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统语种管理 Mapper接口
|
* 系统语种管理 Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ff.common.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.Currency;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 币种Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface ICurrencyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询币种
|
||||||
|
*
|
||||||
|
* @param id 币种主键
|
||||||
|
* @return 币种
|
||||||
|
*/
|
||||||
|
Currency selectCurrencyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种列表
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 币种集合
|
||||||
|
*/
|
||||||
|
List<Currency> selectCurrencyList(Currency currency);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增币种
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertCurrency(Currency currency);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改币种
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateCurrency(Currency currency);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除币种
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的币种主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteCurrencyByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除币种信息
|
||||||
|
*
|
||||||
|
* @param id 币种主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteCurrencyById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ff.common.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.Lang;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统语种管理 Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface ILangService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询系统语种管理
|
||||||
|
*
|
||||||
|
* @param id 系统语种管理 主键
|
||||||
|
* @return 系统语种管理
|
||||||
|
*/
|
||||||
|
Lang selectLangById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询系统语种管理 列表
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 系统语种管理 集合
|
||||||
|
*/
|
||||||
|
List<Lang> selectLangList(Lang lang);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增系统语种管理
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertLang(Lang lang);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改系统语种管理
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateLang(Lang lang);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除系统语种管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的系统语种管理 主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteLangByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除系统语种管理 信息
|
||||||
|
*
|
||||||
|
* @param id 系统语种管理 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteLangById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.Currency;
|
||||||
|
import com.ff.common.mapper.CurrencyMapper;
|
||||||
|
import com.ff.common.service.ICurrencyService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 币种Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CurrencyServiceImpl implements ICurrencyService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private CurrencyMapper currencyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种
|
||||||
|
*
|
||||||
|
* @param id 币种主键
|
||||||
|
* @return 币种
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Currency selectCurrencyById(Long id)
|
||||||
|
{
|
||||||
|
return currencyMapper.selectCurrencyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种列表
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 币种
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Currency> selectCurrencyList(Currency currency)
|
||||||
|
{
|
||||||
|
return currencyMapper.selectCurrencyList(currency);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增币种
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertCurrency(Currency currency)
|
||||||
|
{
|
||||||
|
currency.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
currency.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return currencyMapper.insertCurrency(currency);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改币种
|
||||||
|
*
|
||||||
|
* @param currency 币种
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateCurrency(Currency currency)
|
||||||
|
{
|
||||||
|
currency.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return currencyMapper.updateCurrency(currency);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除币种
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的币种主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCurrencyByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return currencyMapper.deleteCurrencyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除币种信息
|
||||||
|
*
|
||||||
|
* @param id 币种主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCurrencyById(Long id)
|
||||||
|
{
|
||||||
|
return currencyMapper.deleteCurrencyById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.Lang;
|
||||||
|
import com.ff.common.mapper.LangMapper;
|
||||||
|
import com.ff.common.service.ILangService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统语种管理 Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LangServiceImpl implements ILangService {
|
||||||
|
@Autowired
|
||||||
|
private LangMapper langMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询系统语种管理
|
||||||
|
*
|
||||||
|
* @param id 系统语种管理 主键
|
||||||
|
* @return 系统语种管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Lang selectLangById(Long id) {
|
||||||
|
return langMapper.selectLangById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询系统语种管理 列表
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 系统语种管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Lang> selectLangList(Lang lang) {
|
||||||
|
return langMapper.selectLangList(lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增系统语种管理
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertLang(Lang lang) {
|
||||||
|
lang.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
lang.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return langMapper.insertLang(lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改系统语种管理
|
||||||
|
*
|
||||||
|
* @param lang 系统语种管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateLang(Lang lang) {
|
||||||
|
lang.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return langMapper.updateLang(lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除系统语种管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的系统语种管理 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteLangByIds(Long[] ids) {
|
||||||
|
return langMapper.deleteLangByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除系统语种管理 信息
|
||||||
|
*
|
||||||
|
* @param id 系统语种管理 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteLangById(Long id) {
|
||||||
|
return langMapper.deleteLangById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package com.ff.game.mapper;
|
package com.ff.game.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.game.domain.GameBettingDetails;
|
import com.ff.game.domain.GameBettingDetails;
|
||||||
import com.ff.game.dto.GameBettingDetailsDTO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.security.core.parameters.P;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员投注细目Mapper接口
|
* 会员投注细目Mapper接口
|
||||||
|
|
@ -12,8 +11,7 @@ import org.springframework.security.core.parameters.P;
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-10
|
* @date 2025-02-10
|
||||||
*/
|
*/
|
||||||
public interface GameBettingDetailsMapper
|
public interface GameBettingDetailsMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询会员投注细目
|
* 查询会员投注细目
|
||||||
*
|
*
|
||||||
|
|
@ -33,14 +31,6 @@ public interface GameBettingDetailsMapper
|
||||||
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds, @Param("platformCode") String platformCode);
|
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds, @Param("platformCode") String platformCode);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询会员投注细目列表
|
|
||||||
*
|
|
||||||
* @param gameBettingDetailsDTO 会员投注细目
|
|
||||||
* @return 会员投注细目集合
|
|
||||||
*/
|
|
||||||
List<GameBettingDetails> selectGameBettingDetailsList(GameBettingDetailsDTO gameBettingDetailsDTO);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增会员投注细目
|
* 新增会员投注细目
|
||||||
*
|
*
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.ff.game.mapper;
|
package com.ff.game.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.game.domain.GameExchangeMoney;
|
import com.ff.game.domain.GameExchangeMoney;
|
||||||
import com.ff.game.dto.GameExchangeMoneyDTO;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员金额转移记录Mapper接口
|
* 会员金额转移记录Mapper接口
|
||||||
|
|
@ -10,8 +10,7 @@ import com.ff.game.dto.GameExchangeMoneyDTO;
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-10
|
* @date 2025-02-10
|
||||||
*/
|
*/
|
||||||
public interface GameExchangeMoneyMapper
|
public interface GameExchangeMoneyMapper {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询会员金额转移记录
|
* 查询会员金额转移记录
|
||||||
*
|
*
|
||||||
|
|
@ -28,13 +27,6 @@ public interface GameExchangeMoneyMapper
|
||||||
*/
|
*/
|
||||||
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
|
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择游戏兑换货币列表
|
|
||||||
*
|
|
||||||
* @param gameExchangeMoneyDTO 游戏兑换货币dto
|
|
||||||
* @return {@link List }<{@link GameExchangeMoneyDTO }>
|
|
||||||
*/
|
|
||||||
List<GameExchangeMoneyDTO> selectGameExchangeMoneyDTOList(GameExchangeMoneyDTO gameExchangeMoneyDTO);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增会员金额转移记录
|
* 新增会员金额转移记录
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.game.mapper;
|
package com.ff.game.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.game.domain.GameFreeRecord;
|
import com.ff.game.domain.GameFreeRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 免费赠送游戏记录Mapper接口
|
* 免费赠送游戏记录Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.ff.game.mapper;
|
package com.ff.game.mapper;
|
||||||
|
|
||||||
import com.ff.api.response.GameResponse;
|
|
||||||
import com.ff.game.api.request.GameUniqueDTO;
|
|
||||||
import com.ff.game.domain.Game;
|
import com.ff.game.domain.Game;
|
||||||
import com.ff.game.dto.GameDTO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -82,28 +79,5 @@ public interface GameMapper {
|
||||||
*/
|
*/
|
||||||
Integer selectMaxSortNoBy(@Param("platformType") Integer platformType, @Param("platformCode") String platformCode);
|
Integer selectMaxSortNoBy(@Param("platformType") Integer platformType, @Param("platformCode") String platformCode);
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择游戏唯一列表
|
|
||||||
*
|
|
||||||
* @param gameUniqueDTO 游戏独有dto
|
|
||||||
* @return {@link List }<{@link Game }>
|
|
||||||
*/
|
|
||||||
List<Game> selectGameUniqueList(GameUniqueDTO gameUniqueDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择游戏响应列表
|
|
||||||
*
|
|
||||||
* @return {@link List }<{@link GameResponse }>
|
|
||||||
*/
|
|
||||||
List<GameResponse> selectGameResponseList();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选择游戏数据列表
|
|
||||||
*
|
|
||||||
* @param gameDTO 游戏dto
|
|
||||||
* @return {@link List }<{@link Game }>
|
|
||||||
*/
|
|
||||||
List<Game> selectGameDTOList(GameDTO gameDTO);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,6 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface PlatformMapper {
|
public interface PlatformMapper {
|
||||||
|
|
||||||
|
|
||||||
List<Platform> selectList(Platform platform);
|
List<Platform> selectList(Platform platform);
|
||||||
|
|
||||||
Platform selectByPlatformCode(String platformCode);
|
Platform selectByPlatformCode(String platformCode);
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.ff.game.service;
|
||||||
|
|
||||||
|
import com.ff.game.domain.GameBettingDetails;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员投注细目Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface IGameBettingDetailsService {
|
||||||
|
/**
|
||||||
|
* 查询会员投注细目
|
||||||
|
*
|
||||||
|
* @param id 会员投注细目主键
|
||||||
|
* @return 会员投注细目
|
||||||
|
*/
|
||||||
|
GameBettingDetails selectGameBettingDetailsById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按投注id选择游戏投注详细信息
|
||||||
|
*
|
||||||
|
* @param wagersIds 投注ID
|
||||||
|
* @return {@link List }<{@link Long }>
|
||||||
|
*/
|
||||||
|
List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds, String platformCode);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员投注细目
|
||||||
|
*
|
||||||
|
* @param gameBettingDetails 会员投注细目
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param bettingDetails 投注详情
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int batchInsert(List<GameBettingDetails> bettingDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员投注细目
|
||||||
|
*
|
||||||
|
* @param gameBettingDetails 会员投注细目
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateGameBettingDetails(GameBettingDetails gameBettingDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员投注细目
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员投注细目主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameBettingDetailsByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员投注细目信息
|
||||||
|
*
|
||||||
|
* @param id 会员投注细目主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameBettingDetailsById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按投注id删除游戏投注详细信息
|
||||||
|
*
|
||||||
|
* @param wagersId 投注id
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int deleteGameBettingDetailsByWagersId(List<String> wagersId);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ff.game.service;
|
||||||
|
|
||||||
|
import com.ff.game.domain.GameExchangeMoney;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员金额转移记录Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface IGameExchangeMoneyService {
|
||||||
|
/**
|
||||||
|
* 查询会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param id 会员金额转移记录主键
|
||||||
|
* @return 会员金额转移记录
|
||||||
|
*/
|
||||||
|
GameExchangeMoney selectGameExchangeMoneyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员金额转移记录列表
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 会员金额转移记录集合
|
||||||
|
*/
|
||||||
|
List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员金额转移记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameExchangeMoneyByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员金额转移记录信息
|
||||||
|
*
|
||||||
|
* @param id 会员金额转移记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameExchangeMoneyById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.ff.game.service;
|
||||||
|
|
||||||
|
import com.ff.game.domain.GameFreeRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 免费赠送游戏记录Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface IGameFreeRecordService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param id 免费赠送游戏记录主键
|
||||||
|
* @return 免费赠送游戏记录
|
||||||
|
*/
|
||||||
|
GameFreeRecord selectGameFreeRecordById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询免费赠送游戏记录列表
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 免费赠送游戏记录集合
|
||||||
|
*/
|
||||||
|
List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateGameFreeRecord(GameFreeRecord gameFreeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的免费赠送游戏记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameFreeRecordByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除免费赠送游戏记录信息
|
||||||
|
*
|
||||||
|
* @param id 免费赠送游戏记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameFreeRecordById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.ff.game.service;
|
||||||
|
|
||||||
|
import com.ff.game.domain.Game;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台子游戏管理Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface IGameService {
|
||||||
|
/**
|
||||||
|
* 查询平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param id 平台子游戏管理主键
|
||||||
|
* @return 平台子游戏管理
|
||||||
|
*/
|
||||||
|
Game selectGameById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按游戏id选择游戏
|
||||||
|
*
|
||||||
|
* @param gameId 游戏id
|
||||||
|
* @return {@link Game }
|
||||||
|
*/
|
||||||
|
Game selectGameByGameId(String gameId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台子游戏管理列表
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 平台子游戏管理集合
|
||||||
|
*/
|
||||||
|
List<Game> selectGameList(Game game);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertGame(Game game);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateGame(Game game);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的平台子游戏管理主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除平台子游戏管理信息
|
||||||
|
*
|
||||||
|
* @param id 平台子游戏管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteGameById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按平台id选择最大排序号
|
||||||
|
*
|
||||||
|
* @return {@link Integer }
|
||||||
|
*/
|
||||||
|
Integer selectMaxSortNo(Integer platformType, String platformCode);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.ff.game.service;
|
||||||
|
|
||||||
|
import com.ff.game.domain.Platform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cengy
|
||||||
|
*/
|
||||||
|
public interface IPlatformService {
|
||||||
|
|
||||||
|
List<Platform> selectList(Platform platform);
|
||||||
|
|
||||||
|
Platform selectByPlatformCode(String platformCode);
|
||||||
|
|
||||||
|
int updatePlatform(Platform platform);
|
||||||
|
|
||||||
|
int insertPlatform(Platform platform);
|
||||||
|
|
||||||
|
int deleteById(Long id);
|
||||||
|
|
||||||
|
int deleteByIds(String ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.game.domain.GameBettingDetails;
|
||||||
|
import com.ff.game.mapper.GameBettingDetailsMapper;
|
||||||
|
import com.ff.game.service.IGameBettingDetailsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员投注细目Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService {
|
||||||
|
@Autowired
|
||||||
|
private GameBettingDetailsMapper gameBettingDetailsMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员投注细目
|
||||||
|
*
|
||||||
|
* @param id 会员投注细目主键
|
||||||
|
* @return 会员投注细目
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GameBettingDetails selectGameBettingDetailsById(Long id) {
|
||||||
|
return gameBettingDetailsMapper.selectGameBettingDetailsById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按投注id选择游戏投注详细信息
|
||||||
|
*
|
||||||
|
* @param wagersIds 投注ID
|
||||||
|
* @return {@link List }<{@link Long }>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds, String platformCode) {
|
||||||
|
return gameBettingDetailsMapper.selectGameBettingDetailsByWagersId(wagersIds, platformCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员投注细目
|
||||||
|
*
|
||||||
|
* @param gameBettingDetails 会员投注细目
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertGameBettingDetails(GameBettingDetails gameBettingDetails) {
|
||||||
|
gameBettingDetails.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
gameBettingDetails.setCreateTime(System.currentTimeMillis());
|
||||||
|
return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param bettingDetails 投注详情
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int batchInsert(List<GameBettingDetails> bettingDetails) {
|
||||||
|
return gameBettingDetailsMapper.batchInsert(bettingDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员投注细目
|
||||||
|
*
|
||||||
|
* @param gameBettingDetails 会员投注细目
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateGameBettingDetails(GameBettingDetails gameBettingDetails) {
|
||||||
|
gameBettingDetails.setUpdateTime(System.currentTimeMillis());
|
||||||
|
return gameBettingDetailsMapper.updateGameBettingDetails(gameBettingDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员投注细目
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员投注细目主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameBettingDetailsByIds(Long[] ids) {
|
||||||
|
return gameBettingDetailsMapper.deleteGameBettingDetailsByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员投注细目信息
|
||||||
|
*
|
||||||
|
* @param id 会员投注细目主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameBettingDetailsById(Long id) {
|
||||||
|
return gameBettingDetailsMapper.deleteGameBettingDetailsById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按投注id删除游戏投注详细信息
|
||||||
|
*
|
||||||
|
* @param wagersId 投注id
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameBettingDetailsByWagersId(List<String> wagersId) {
|
||||||
|
return gameBettingDetailsMapper.deleteGameBettingDetailsByWagersId(wagersId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.game.domain.GameExchangeMoney;
|
||||||
|
import com.ff.game.mapper.GameExchangeMoneyMapper;
|
||||||
|
import com.ff.game.service.IGameExchangeMoneyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员金额转移记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GameExchangeMoneyServiceImpl implements IGameExchangeMoneyService {
|
||||||
|
@Autowired
|
||||||
|
private GameExchangeMoneyMapper gameExchangeMoneyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param id 会员金额转移记录主键
|
||||||
|
* @return 会员金额转移记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GameExchangeMoney selectGameExchangeMoneyById(Long id) {
|
||||||
|
return gameExchangeMoneyMapper.selectGameExchangeMoneyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员金额转移记录列表
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 会员金额转移记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<GameExchangeMoney> selectGameExchangeMoneyList(GameExchangeMoney gameExchangeMoney) {
|
||||||
|
return gameExchangeMoneyMapper.selectGameExchangeMoneyList(gameExchangeMoney);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney) {
|
||||||
|
gameExchangeMoney.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
gameExchangeMoney.setCreateTime(System.currentTimeMillis());
|
||||||
|
return gameExchangeMoneyMapper.insertGameExchangeMoney(gameExchangeMoney);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param gameExchangeMoney 会员金额转移记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateGameExchangeMoney(GameExchangeMoney gameExchangeMoney) {
|
||||||
|
gameExchangeMoney.setUpdateTime(System.currentTimeMillis());
|
||||||
|
return gameExchangeMoneyMapper.updateGameExchangeMoney(gameExchangeMoney);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员金额转移记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员金额转移记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameExchangeMoneyByIds(Long[] ids) {
|
||||||
|
return gameExchangeMoneyMapper.deleteGameExchangeMoneyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员金额转移记录信息
|
||||||
|
*
|
||||||
|
* @param id 会员金额转移记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameExchangeMoneyById(Long id) {
|
||||||
|
return gameExchangeMoneyMapper.deleteGameExchangeMoneyById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.game.domain.GameFreeRecord;
|
||||||
|
import com.ff.game.mapper.GameFreeRecordMapper;
|
||||||
|
import com.ff.game.service.IGameFreeRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 免费赠送游戏记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GameFreeRecordServiceImpl implements IGameFreeRecordService {
|
||||||
|
@Autowired
|
||||||
|
private GameFreeRecordMapper gameFreeRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param id 免费赠送游戏记录主键
|
||||||
|
* @return 免费赠送游戏记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public GameFreeRecord selectGameFreeRecordById(Long id) {
|
||||||
|
return gameFreeRecordMapper.selectGameFreeRecordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询免费赠送游戏记录列表
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 免费赠送游戏记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<GameFreeRecord> selectGameFreeRecordList(GameFreeRecord gameFreeRecord) {
|
||||||
|
return gameFreeRecordMapper.selectGameFreeRecordList(gameFreeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertGameFreeRecord(GameFreeRecord gameFreeRecord) {
|
||||||
|
gameFreeRecord.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
gameFreeRecord.setCreateTime(System.currentTimeMillis());
|
||||||
|
return gameFreeRecordMapper.insertGameFreeRecord(gameFreeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param gameFreeRecord 免费赠送游戏记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateGameFreeRecord(GameFreeRecord gameFreeRecord) {
|
||||||
|
gameFreeRecord.setUpdateTime(System.currentTimeMillis());
|
||||||
|
return gameFreeRecordMapper.updateGameFreeRecord(gameFreeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除免费赠送游戏记录
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的免费赠送游戏记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameFreeRecordByIds(Long[] ids) {
|
||||||
|
return gameFreeRecordMapper.deleteGameFreeRecordByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除免费赠送游戏记录信息
|
||||||
|
*
|
||||||
|
* @param id 免费赠送游戏记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameFreeRecordById(Long id) {
|
||||||
|
return gameFreeRecordMapper.deleteGameFreeRecordById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.game.domain.Game;
|
||||||
|
import com.ff.game.mapper.GameMapper;
|
||||||
|
import com.ff.game.service.IGameService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台子游戏管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class GameServiceImpl implements IGameService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GameMapper gameMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param id 平台子游戏管理主键
|
||||||
|
* @return 平台子游戏管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Game selectGameById(Long id) {
|
||||||
|
return gameMapper.selectGameById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按游戏id选择游戏
|
||||||
|
*
|
||||||
|
* @param gameId 游戏id
|
||||||
|
* @return {@link Game }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Game selectGameByGameId(String gameId) {
|
||||||
|
return gameMapper.selectGameByGameId(gameId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台子游戏管理列表
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 平台子游戏管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Game> selectGameList(Game game) {
|
||||||
|
return gameMapper.selectGameList(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertGame(Game game) {
|
||||||
|
if (game.getId() == null) {
|
||||||
|
game.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
}
|
||||||
|
game.setCreateTime(System.currentTimeMillis());
|
||||||
|
return gameMapper.insertGame(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param game 平台子游戏管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateGame(Game game) {
|
||||||
|
game.setUpdateTime(System.currentTimeMillis());
|
||||||
|
return gameMapper.updateGame(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除平台子游戏管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的平台子游戏管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameByIds(Long[] ids) {
|
||||||
|
return gameMapper.deleteGameByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除平台子游戏管理信息
|
||||||
|
*
|
||||||
|
* @param id 平台子游戏管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteGameById(Long id) {
|
||||||
|
return gameMapper.deleteGameById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMaxSortNo(Integer platformType, String platformCode) {
|
||||||
|
return gameMapper.selectMaxSortNoBy(platformType, platformCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
|
import com.ff.game.domain.Platform;
|
||||||
|
import com.ff.game.mapper.PlatformMapper;
|
||||||
|
import com.ff.game.service.IPlatformService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cengy
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PlatformServiceImpl implements IPlatformService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PlatformMapper platformMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Platform> selectList(Platform platform) {
|
||||||
|
return platformMapper.selectList(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Platform selectByPlatformCode(String platformCode) {
|
||||||
|
return platformMapper.selectByPlatformCode(platformCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updatePlatform(Platform platform) {
|
||||||
|
return platformMapper.updatePlatform(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertPlatform(Platform platform) {
|
||||||
|
return platformMapper.insertPlatform(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteById(Long id) {
|
||||||
|
return platformMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteByIds(String ids) {
|
||||||
|
return platformMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package com.ff.member.mapper;
|
package com.ff.member.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.member.domain.Member;
|
import com.ff.member.domain.Member;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员Mapper接口
|
* 会员Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.ff.member.service;
|
||||||
|
|
||||||
|
import com.ff.member.domain.Member;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
public interface IMemberService {
|
||||||
|
/**
|
||||||
|
* 查询会员
|
||||||
|
*
|
||||||
|
* @param id 会员主键
|
||||||
|
* @return 会员
|
||||||
|
*/
|
||||||
|
Member selectMemberById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员列表
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 会员集合
|
||||||
|
*/
|
||||||
|
List<Member> selectMemberList(Member member);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertMember(Member member);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateMember(Member member);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteMemberByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员信息
|
||||||
|
*
|
||||||
|
* @param id 会员主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteMemberById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按游戏帐户选择成员
|
||||||
|
*
|
||||||
|
* @param gameAccount 游戏账号
|
||||||
|
* @return {@link Member }
|
||||||
|
*/
|
||||||
|
Member selectMemberByGameAccount(String gameAccount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按帐户选择成员
|
||||||
|
*
|
||||||
|
* @param account 账户
|
||||||
|
* @param currencyCode 货币代码
|
||||||
|
* @param platformCode 平台代码
|
||||||
|
* @return {@link Member }
|
||||||
|
*/
|
||||||
|
Member selectMemberByAccount(String account, String currencyCode, String platformCode);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
package com.ff.member.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.member.domain.Member;
|
||||||
|
import com.ff.member.mapper.MemberMapper;
|
||||||
|
import com.ff.member.service.IMemberService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MemberServiceImpl implements IMemberService {
|
||||||
|
@Autowired
|
||||||
|
private MemberMapper memberMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员
|
||||||
|
*
|
||||||
|
* @param id 会员主键
|
||||||
|
* @return 会员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Member selectMemberById(Long id) {
|
||||||
|
return memberMapper.selectMemberById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员列表
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 会员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Member> selectMemberList(Member member) {
|
||||||
|
return memberMapper.selectMemberList(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMember(Member member) {
|
||||||
|
member.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
member.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return memberMapper.insertMember(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMember(Member member) {
|
||||||
|
member.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return memberMapper.updateMember(member);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除会员
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的会员主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberByIds(Long[] ids) {
|
||||||
|
return memberMapper.deleteMemberByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除会员信息
|
||||||
|
*
|
||||||
|
* @param id 会员主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMemberById(Long id) {
|
||||||
|
return memberMapper.deleteMemberById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按游戏帐户选择成员
|
||||||
|
*
|
||||||
|
* @param gameAccount 游戏账号
|
||||||
|
* @return {@link Member }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Member selectMemberByGameAccount(String gameAccount) {
|
||||||
|
return memberMapper.selectMemberByGameAccount(gameAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按帐户选择成员
|
||||||
|
*
|
||||||
|
* @param account 账户
|
||||||
|
* @param currencyCode 货币代码
|
||||||
|
* @param platformCode 平台代码
|
||||||
|
* @return {@link Member }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Member selectMemberByAccount(String account, String currencyCode, String platformCode) {
|
||||||
|
return memberMapper.selectMemberByAccount(account, currencyCode, platformCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.sys.mapper;
|
package com.ff.sys.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.sys.domain.SysFeedback;
|
import com.ff.sys.domain.SysFeedback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统反馈Mapper接口
|
* 系统反馈Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.sys.mapper;
|
package com.ff.sys.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.sys.domain.SysNotice;
|
import com.ff.sys.domain.SysNotice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统公告Mapper接口
|
* 系统公告Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
package com.ff.sys.service;
|
package com.ff.sys.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.sys.domain.SysFeedback;
|
import com.ff.sys.domain.SysFeedback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统反馈Service接口
|
* 系统反馈Service接口
|
||||||
*
|
*
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-27
|
* @date 2025-02-27
|
||||||
*/
|
*/
|
||||||
public interface ISysFeedbackService
|
public interface ISysFeedbackService {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询系统反馈
|
* 查询系统反馈
|
||||||
*
|
*
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
package com.ff.sys.service;
|
package com.ff.sys.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.sys.domain.SysNotice;
|
import com.ff.sys.domain.SysNotice;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统公告Service接口
|
* 系统公告Service接口
|
||||||
*
|
*
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-28
|
* @date 2025-02-28
|
||||||
*/
|
*/
|
||||||
public interface ISysNoticeService
|
public interface ISysNoticeService {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询系统公告
|
* 查询系统公告
|
||||||
*
|
*
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package com.ff.sys.service.impl;
|
package com.ff.sys.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.sys.domain.SysFeedback;
|
||||||
|
import com.ff.sys.mapper.SysFeedbackMapper;
|
||||||
|
import com.ff.sys.service.ISysFeedbackService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.sys.mapper.SysFeedbackMapper;
|
|
||||||
import com.ff.sys.domain.SysFeedback;
|
import java.util.List;
|
||||||
import com.ff.sys.service.ISysFeedbackService;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -17,8 +18,7 @@ import cn.hutool.core.util.IdUtil;
|
||||||
* @date 2025-02-27
|
* @date 2025-02-27
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysFeedbackServiceImpl implements ISysFeedbackService
|
public class SysFeedbackServiceImpl implements ISysFeedbackService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysFeedbackMapper sysFeedbackMapper;
|
private SysFeedbackMapper sysFeedbackMapper;
|
||||||
|
|
||||||
|
|
@ -29,8 +29,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 系统反馈
|
* @return 系统反馈
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysFeedback selectSysFeedbackById(Long id)
|
public SysFeedback selectSysFeedbackById(Long id) {
|
||||||
{
|
|
||||||
return sysFeedbackMapper.selectSysFeedbackById(id);
|
return sysFeedbackMapper.selectSysFeedbackById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,8 +40,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 系统反馈
|
* @return 系统反馈
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback)
|
public List<SysFeedback> selectSysFeedbackList(SysFeedback sysFeedback) {
|
||||||
{
|
|
||||||
return sysFeedbackMapper.selectSysFeedbackList(sysFeedback);
|
return sysFeedbackMapper.selectSysFeedbackList(sysFeedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,8 +51,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSysFeedback(SysFeedback sysFeedback)
|
public int insertSysFeedback(SysFeedback sysFeedback) {
|
||||||
{
|
|
||||||
sysFeedback.setId(IdUtil.getSnowflakeNextId());
|
sysFeedback.setId(IdUtil.getSnowflakeNextId());
|
||||||
sysFeedback.setCreateTime(DateUtils.getNowDate());
|
sysFeedback.setCreateTime(DateUtils.getNowDate());
|
||||||
return sysFeedbackMapper.insertSysFeedback(sysFeedback);
|
return sysFeedbackMapper.insertSysFeedback(sysFeedback);
|
||||||
|
|
@ -67,8 +64,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateSysFeedback(SysFeedback sysFeedback)
|
public int updateSysFeedback(SysFeedback sysFeedback) {
|
||||||
{
|
|
||||||
sysFeedback.setUpdateTime(DateUtils.getNowDate());
|
sysFeedback.setUpdateTime(DateUtils.getNowDate());
|
||||||
return sysFeedbackMapper.updateSysFeedback(sysFeedback);
|
return sysFeedbackMapper.updateSysFeedback(sysFeedback);
|
||||||
}
|
}
|
||||||
|
|
@ -80,8 +76,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysFeedbackByIds(Long[] ids)
|
public int deleteSysFeedbackByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return sysFeedbackMapper.deleteSysFeedbackByIds(ids);
|
return sysFeedbackMapper.deleteSysFeedbackByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,8 +87,7 @@ public class SysFeedbackServiceImpl implements ISysFeedbackService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysFeedbackById(Long id)
|
public int deleteSysFeedbackById(Long id) {
|
||||||
{
|
|
||||||
return sysFeedbackMapper.deleteSysFeedbackById(id);
|
return sysFeedbackMapper.deleteSysFeedbackById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package com.ff.sys.service.impl;
|
package com.ff.sys.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.sys.domain.SysNotice;
|
||||||
|
import com.ff.sys.mapper.SysNoticeMapper;
|
||||||
|
import com.ff.sys.service.ISysNoticeService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.sys.mapper.SysNoticeMapper;
|
|
||||||
import com.ff.sys.domain.SysNotice;
|
import java.util.List;
|
||||||
import com.ff.sys.service.ISysNoticeService;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -17,8 +18,7 @@ import cn.hutool.core.util.IdUtil;
|
||||||
* @date 2025-02-28
|
* @date 2025-02-28
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysNoticeServiceImpl implements ISysNoticeService
|
public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysNoticeMapper sysNoticeMapper;
|
private SysNoticeMapper sysNoticeMapper;
|
||||||
|
|
||||||
|
|
@ -29,8 +29,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 系统公告
|
* @return 系统公告
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SysNotice selectSysNoticeById(Long id)
|
public SysNotice selectSysNoticeById(Long id) {
|
||||||
{
|
|
||||||
return sysNoticeMapper.selectSysNoticeById(id);
|
return sysNoticeMapper.selectSysNoticeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,8 +40,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 系统公告
|
* @return 系统公告
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysNotice> selectSysNoticeList(SysNotice sysNotice)
|
public List<SysNotice> selectSysNoticeList(SysNotice sysNotice) {
|
||||||
{
|
|
||||||
return sysNoticeMapper.selectSysNoticeList(sysNotice);
|
return sysNoticeMapper.selectSysNoticeList(sysNotice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,8 +51,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertSysNotice(SysNotice sysNotice)
|
public int insertSysNotice(SysNotice sysNotice) {
|
||||||
{
|
|
||||||
sysNotice.setId(IdUtil.getSnowflakeNextId());
|
sysNotice.setId(IdUtil.getSnowflakeNextId());
|
||||||
sysNotice.setCreateTime(DateUtils.getNowDate());
|
sysNotice.setCreateTime(DateUtils.getNowDate());
|
||||||
return sysNoticeMapper.insertSysNotice(sysNotice);
|
return sysNoticeMapper.insertSysNotice(sysNotice);
|
||||||
|
|
@ -67,8 +64,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateSysNotice(SysNotice sysNotice)
|
public int updateSysNotice(SysNotice sysNotice) {
|
||||||
{
|
|
||||||
sysNotice.setUpdateTime(DateUtils.getNowDate());
|
sysNotice.setUpdateTime(DateUtils.getNowDate());
|
||||||
return sysNoticeMapper.updateSysNotice(sysNotice);
|
return sysNoticeMapper.updateSysNotice(sysNotice);
|
||||||
}
|
}
|
||||||
|
|
@ -80,8 +76,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysNoticeByIds(Long[] ids)
|
public int deleteSysNoticeByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return sysNoticeMapper.deleteSysNoticeByIds(ids);
|
return sysNoticeMapper.deleteSysNoticeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,8 +87,7 @@ public class SysNoticeServiceImpl implements ISysNoticeService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteSysNoticeById(Long id)
|
public int deleteSysNoticeById(Long id) {
|
||||||
{
|
|
||||||
return sysNoticeMapper.deleteSysNoticeById(id);
|
return sysNoticeMapper.deleteSysNoticeById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ff.tenant.mapper;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantAgentPlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台利润成本管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
public interface TenantAgentPlatformMapper {
|
||||||
|
/**
|
||||||
|
* 查询平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param id 平台利润成本管理主键
|
||||||
|
* @return 平台利润成本管理
|
||||||
|
*/
|
||||||
|
TenantAgentPlatform selectTenantAgentPlatformById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台利润成本管理列表
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 平台利润成本管理集合
|
||||||
|
*/
|
||||||
|
List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param id 平台利润成本管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantAgentPlatformById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantAgentPlatformByIds(Long[] ids);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.ff.tenant.mapper;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户游戏额度流水Mapper接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-12
|
||||||
|
*/
|
||||||
|
public interface TenantGameQuotaFlowMapper {
|
||||||
|
/**
|
||||||
|
* 查询租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param id 租户游戏额度流水主键
|
||||||
|
* @return 租户游戏额度流水
|
||||||
|
*/
|
||||||
|
TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏额度流水列表
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 租户游戏额度流水集合
|
||||||
|
*/
|
||||||
|
List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param id 租户游戏额度流水主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantGameQuotaFlowById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantGameQuotaFlowByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过会员id获取余额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||||
|
* @return {@link BigDecimal }
|
||||||
|
*/
|
||||||
|
BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过租户密钥获取余额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||||
|
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||||
|
*/
|
||||||
|
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.tenant.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户游戏配额Mapper接口
|
* 租户游戏配额Mapper接口
|
||||||
*
|
*
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.ff.tenant.mapper;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 币种汇率Mapper接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
public interface TenantQuotaExchangeMapper {
|
||||||
|
/**
|
||||||
|
* 查询币种汇率
|
||||||
|
*
|
||||||
|
* @param id 币种汇率主键
|
||||||
|
* @return 币种汇率
|
||||||
|
*/
|
||||||
|
TenantQuotaExchange selectTenantQuotaExchangeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种汇率列表
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 币种汇率集合
|
||||||
|
*/
|
||||||
|
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增币种汇率
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改币种汇率
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除币种汇率
|
||||||
|
*
|
||||||
|
* @param id 币种汇率主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantQuotaExchangeById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除币种汇率
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantQuotaExchangeByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租户配额交换
|
||||||
|
*
|
||||||
|
* @param currencyCode 货币代码
|
||||||
|
* @param exchangeCurrencyCode 兑换货币代码
|
||||||
|
* @return {@link TenantQuotaExchange }
|
||||||
|
*/
|
||||||
|
TenantQuotaExchange getTenantQuotaExchange(@Param("currencyCode") String currencyCode, @Param("exchangeCurrencyCode") String exchangeCurrencyCode);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.tenant.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.TenantAgentPlatform;
|
import com.ff.common.domain.TenantAgentPlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台利润成本管理Mapper接口
|
* 平台利润成本管理Service接口
|
||||||
*
|
*
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-27
|
* @date 2025-02-27
|
||||||
*/
|
*/
|
||||||
public interface TenantAgentPlatformMapper
|
public interface ITenantAgentPlatformService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询平台利润成本管理
|
* 查询平台利润成本管理
|
||||||
|
|
@ -44,18 +45,18 @@ public interface TenantAgentPlatformMapper
|
||||||
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除平台利润成本管理
|
* 批量删除平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的平台利润成本管理主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantAgentPlatformByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除平台利润成本管理信息
|
||||||
*
|
*
|
||||||
* @param id 平台利润成本管理主键
|
* @param id 平台利润成本管理主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteTenantAgentPlatformById(Long id);
|
int deleteTenantAgentPlatformById(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除平台利润成本管理
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteTenantAgentPlatformByIds(Long[] ids);
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.tenant.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户游戏额度流水Mapper接口
|
* 租户游戏额度流水Service接口
|
||||||
*
|
*
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-12
|
* @date 2025-02-12
|
||||||
*/
|
*/
|
||||||
public interface TenantGameQuotaFlowMapper
|
public interface ITenantGameQuotaFlowService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询租户游戏额度流水
|
* 查询租户游戏额度流水
|
||||||
|
|
@ -46,22 +46,21 @@ public interface TenantGameQuotaFlowMapper
|
||||||
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除租户游戏额度流水
|
* 批量删除租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户游戏额度流水主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantGameQuotaFlowByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户游戏额度流水信息
|
||||||
*
|
*
|
||||||
* @param id 租户游戏额度流水主键
|
* @param id 租户游戏额度流水主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteTenantGameQuotaFlowById(Long id);
|
int deleteTenantGameQuotaFlowById(Long id);
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除租户游戏额度流水
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteTenantGameQuotaFlowByIds(Long[] ids);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过会员id获取余额
|
* 通过会员id获取余额
|
||||||
*
|
*
|
||||||
|
|
@ -78,6 +77,4 @@ public interface TenantGameQuotaFlowMapper
|
||||||
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||||
*/
|
*/
|
||||||
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
|
List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.ff.tenant.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户游戏配额Service接口
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-12
|
||||||
|
*/
|
||||||
|
public interface ITenantGameQuotaService {
|
||||||
|
/**
|
||||||
|
* 查询租户游戏配额
|
||||||
|
*
|
||||||
|
* @param id 租户游戏配额主键
|
||||||
|
* @return 租户游戏配额
|
||||||
|
*/
|
||||||
|
TenantGameQuota selectTenantGameQuotaById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏配额列表
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 租户游戏配额集合
|
||||||
|
*/
|
||||||
|
List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateTenantGameQuota(TenantGameQuota tenantGameQuota);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户游戏配额
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户游戏配额主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantGameQuotaByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户游戏配额信息
|
||||||
|
*
|
||||||
|
* @param id 租户游戏配额主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteTenantGameQuotaById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantKey 租户游戏配额主键
|
||||||
|
* @return 租户游戏配额
|
||||||
|
*/
|
||||||
|
TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType);
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.tenant.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.common.domain.TenantQuotaExchange;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种汇率Mapper接口
|
* 币种汇率Service接口
|
||||||
*
|
*
|
||||||
* @author shi
|
* @author shi
|
||||||
* @date 2025-02-21
|
* @date 2025-02-21
|
||||||
*/
|
*/
|
||||||
public interface TenantQuotaExchangeMapper
|
public interface ITenantQuotaExchangeService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询币种汇率
|
* 查询币种汇率
|
||||||
|
|
@ -28,6 +28,16 @@ public interface TenantQuotaExchangeMapper
|
||||||
*/
|
*/
|
||||||
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
|
List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租户配额交换
|
||||||
|
*
|
||||||
|
* @param currencyCode 货币代码
|
||||||
|
* @param exchangeCurrencyCode 兑换货币代码
|
||||||
|
* @return {@link TenantQuotaExchange }
|
||||||
|
*/
|
||||||
|
TenantQuotaExchange getTenantQuotaExchange(String currencyCode,String exchangeCurrencyCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增币种汇率
|
* 新增币种汇率
|
||||||
*
|
*
|
||||||
|
|
@ -44,29 +54,19 @@ public interface TenantQuotaExchangeMapper
|
||||||
*/
|
*/
|
||||||
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange);
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除币种汇率
|
|
||||||
*
|
|
||||||
* @param id 币种汇率主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
int deleteTenantQuotaExchangeById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除币种汇率
|
* 批量删除币种汇率
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的币种汇率主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteTenantQuotaExchangeByIds(Long[] ids);
|
int deleteTenantQuotaExchangeByIds(Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取租户配额交换
|
* 删除币种汇率信息
|
||||||
*
|
*
|
||||||
* @param currencyCode 货币代码
|
* @param id 币种汇率主键
|
||||||
* @param exchangeCurrencyCode 兑换货币代码
|
* @return 结果
|
||||||
* @return {@link TenantQuotaExchange }
|
|
||||||
*/
|
*/
|
||||||
TenantQuotaExchange getTenantQuotaExchange(@Param("currencyCode") String currencyCode, @Param("exchangeCurrencyCode") String exchangeCurrencyCode);
|
int deleteTenantQuotaExchangeById(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.ff.tenant.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.TenantAgentPlatform;
|
||||||
|
import com.ff.tenant.mapper.TenantAgentPlatformMapper;
|
||||||
|
import com.ff.tenant.service.ITenantAgentPlatformService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台利润成本管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantAgentPlatformServiceImpl implements ITenantAgentPlatformService {
|
||||||
|
@Autowired
|
||||||
|
private TenantAgentPlatformMapper tenantAgentPlatformMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param id 平台利润成本管理主键
|
||||||
|
* @return 平台利润成本管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantAgentPlatform selectTenantAgentPlatformById(Long id) {
|
||||||
|
return tenantAgentPlatformMapper.selectTenantAgentPlatformById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询平台利润成本管理列表
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 平台利润成本管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantAgentPlatform> selectTenantAgentPlatformList(TenantAgentPlatform tenantAgentPlatform) {
|
||||||
|
return tenantAgentPlatformMapper.selectTenantAgentPlatformList(tenantAgentPlatform);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform) {
|
||||||
|
tenantAgentPlatform.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
tenantAgentPlatform.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tenantAgentPlatformMapper.insertTenantAgentPlatform(tenantAgentPlatform);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param tenantAgentPlatform 平台利润成本管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTenantAgentPlatform(TenantAgentPlatform tenantAgentPlatform) {
|
||||||
|
tenantAgentPlatform.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tenantAgentPlatformMapper.updateTenantAgentPlatform(tenantAgentPlatform);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除平台利润成本管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的平台利润成本管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantAgentPlatformByIds(Long[] ids) {
|
||||||
|
return tenantAgentPlatformMapper.deleteTenantAgentPlatformByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除平台利润成本管理信息
|
||||||
|
*
|
||||||
|
* @param id 平台利润成本管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantAgentPlatformById(Long id) {
|
||||||
|
return tenantAgentPlatformMapper.deleteTenantAgentPlatformById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.ff.tenant.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
|
import com.ff.tenant.mapper.TenantGameQuotaFlowMapper;
|
||||||
|
import com.ff.tenant.service.ITenantGameQuotaFlowService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户游戏额度流水Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantGameQuotaFlowServiceImpl implements ITenantGameQuotaFlowService {
|
||||||
|
@Autowired
|
||||||
|
private TenantGameQuotaFlowMapper tenantGameQuotaFlowMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param id 租户游戏额度流水主键
|
||||||
|
* @return 租户游戏额度流水
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantGameQuotaFlow selectTenantGameQuotaFlowById(Long id) {
|
||||||
|
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏额度流水列表
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 租户游戏额度流水
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantGameQuotaFlow> selectTenantGameQuotaFlowList(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
return tenantGameQuotaFlowMapper.selectTenantGameQuotaFlowList(tenantGameQuotaFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
tenantGameQuotaFlow.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tenantGameQuotaFlowMapper.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏额度流水
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
tenantGameQuotaFlow.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tenantGameQuotaFlowMapper.updateTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户游戏额度流水
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户游戏额度流水主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantGameQuotaFlowByIds(Long[] ids) {
|
||||||
|
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户游戏额度流水信息
|
||||||
|
*
|
||||||
|
* @param id 租户游戏额度流水主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantGameQuotaFlowById(Long id) {
|
||||||
|
return tenantGameQuotaFlowMapper.deleteTenantGameQuotaFlowById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过会员id获取余额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||||
|
* @return {@link BigDecimal }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BigDecimal getExchangeMoneyByMemberId(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
return tenantGameQuotaFlowMapper.getExchangeMoneyByMemberId(tenantGameQuotaFlow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过租户密钥获取余额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuotaFlow 租户游戏配额流
|
||||||
|
* @return {@link List }<{@link TenantGameQuotaFlow }>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantGameQuotaFlow> getBalanceByTenantKey(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
return tenantGameQuotaFlowMapper.getBalanceByTenantKey(tenantGameQuotaFlow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.ff.tenant.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
|
import com.ff.tenant.mapper.TenantGameQuotaMapper;
|
||||||
|
import com.ff.tenant.service.ITenantGameQuotaService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户游戏配额Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-12
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService {
|
||||||
|
@Autowired
|
||||||
|
private TenantGameQuotaMapper tenantGameQuotaMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏配额
|
||||||
|
*
|
||||||
|
* @param id 租户游戏配额主键
|
||||||
|
* @return 租户游戏配额
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantGameQuota selectTenantGameQuotaById(Long id) {
|
||||||
|
return tenantGameQuotaMapper.selectTenantGameQuotaById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询租户游戏配额列表
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 租户游戏配额
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantGameQuota> selectTenantGameQuotaList(TenantGameQuota tenantGameQuota) {
|
||||||
|
return tenantGameQuotaMapper.selectTenantGameQuotaList(tenantGameQuota);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||||
|
tenantGameQuota.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantGameQuota 租户游戏配额
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||||
|
tenantGameQuota.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tenantGameQuotaMapper.updateTenantGameQuota(tenantGameQuota);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除租户游戏配额
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的租户游戏配额主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantGameQuotaByIds(Long[] ids) {
|
||||||
|
return tenantGameQuotaMapper.deleteTenantGameQuotaByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除租户游戏配额信息
|
||||||
|
*
|
||||||
|
* @param id 租户游戏配额主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantGameQuotaById(Long id) {
|
||||||
|
return tenantGameQuotaMapper.deleteTenantGameQuotaById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按租户密钥选择租户游戏配额
|
||||||
|
*
|
||||||
|
* @param tenantKey 租户密钥
|
||||||
|
* @param quotaType 配额类型
|
||||||
|
* @return {@link TenantGameQuota }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantGameQuota selectTenantGameQuotaByTenantKey(String tenantKey, String quotaType) {
|
||||||
|
TenantGameQuota tenantGameQuota = tenantGameQuotaMapper.selectTenantGameQuotaByTenantKey(tenantKey, quotaType);
|
||||||
|
|
||||||
|
//如果当前钱包不存在
|
||||||
|
if (ObjectUtils.isEmpty(tenantGameQuota)) {
|
||||||
|
tenantGameQuota = TenantGameQuota.builder()
|
||||||
|
.tenantKey(tenantKey)
|
||||||
|
.id(IdUtil.getSnowflakeNextId())
|
||||||
|
.balance(BigDecimal.ZERO)
|
||||||
|
.quotaType(quotaType)
|
||||||
|
.version(0)
|
||||||
|
.build();
|
||||||
|
tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||||
|
}
|
||||||
|
return tenantGameQuota;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.ff.tenant.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
|
import com.ff.tenant.mapper.TenantQuotaExchangeMapper;
|
||||||
|
import com.ff.tenant.service.ITenantQuotaExchangeService;
|
||||||
|
import com.ff.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 币种汇率Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantQuotaExchangeServiceImpl implements ITenantQuotaExchangeService {
|
||||||
|
@Autowired
|
||||||
|
private TenantQuotaExchangeMapper tenantQuotaExchangeMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种汇率
|
||||||
|
*
|
||||||
|
* @param id 币种汇率主键
|
||||||
|
* @return 币种汇率
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantQuotaExchange selectTenantQuotaExchangeById(Long id) {
|
||||||
|
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询币种汇率列表
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 币种汇率
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantQuotaExchange> selectTenantQuotaExchangeList(TenantQuotaExchange tenantQuotaExchange) {
|
||||||
|
return tenantQuotaExchangeMapper.selectTenantQuotaExchangeList(tenantQuotaExchange);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租户配额交换
|
||||||
|
*
|
||||||
|
* @param currencyCode 货币代码
|
||||||
|
* @param exchangeCurrencyCode 兑换货币代码
|
||||||
|
* @return {@link TenantQuotaExchange }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantQuotaExchange getTenantQuotaExchange(String currencyCode, String exchangeCurrencyCode) {
|
||||||
|
return tenantQuotaExchangeMapper.getTenantQuotaExchange(currencyCode, exchangeCurrencyCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增币种汇率
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange) {
|
||||||
|
tenantQuotaExchange.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
tenantQuotaExchange.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tenantQuotaExchangeMapper.insertTenantQuotaExchange(tenantQuotaExchange);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改币种汇率
|
||||||
|
*
|
||||||
|
* @param tenantQuotaExchange 币种汇率
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange) {
|
||||||
|
tenantQuotaExchange.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tenantQuotaExchangeMapper.updateTenantQuotaExchange(tenantQuotaExchange);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除币种汇率
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的币种汇率主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantQuotaExchangeByIds(Long[] ids) {
|
||||||
|
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除币种汇率信息
|
||||||
|
*
|
||||||
|
* @param id 币种汇率主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantQuotaExchangeById(Long id) {
|
||||||
|
return tenantQuotaExchangeMapper.deleteTenantQuotaExchangeById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.ff.exception;
|
||||||
|
|
||||||
|
import com.ff.base.enums.ErrorCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础异常
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class ApiException extends RuntimeException {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误码
|
||||||
|
*/
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public ApiException(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
public ApiException(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = ErrorCode.findByCode(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非空
|
||||||
|
*
|
||||||
|
* @param object 对象
|
||||||
|
* @param code 代码
|
||||||
|
*/
|
||||||
|
public static void notNull(@Nullable Object object, Integer code) {
|
||||||
|
if (object == null) {
|
||||||
|
throw new ApiException(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是真
|
||||||
|
*
|
||||||
|
* @param bool 布尔
|
||||||
|
* @param code 代码
|
||||||
|
*/
|
||||||
|
public static void isTrue(@Nullable Boolean bool, Integer code) {
|
||||||
|
if (Boolean.FALSE.equals(bool)) {
|
||||||
|
throw new ApiException(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.ff.exception;
|
||||||
|
|
||||||
|
import com.ff.base.utils.MessageUtils;
|
||||||
|
import com.ff.base.utils.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础异常
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
public class BaseException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属模块
|
||||||
|
*/
|
||||||
|
private String module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误码对应的参数
|
||||||
|
*/
|
||||||
|
private Object[] args;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误消息
|
||||||
|
*/
|
||||||
|
private String defaultMessage;
|
||||||
|
|
||||||
|
public BaseException(String module, String code, Object[] args, String defaultMessage)
|
||||||
|
{
|
||||||
|
this.module = module;
|
||||||
|
this.code = code;
|
||||||
|
this.args = args;
|
||||||
|
this.defaultMessage = defaultMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseException(String module, String code, Object[] args)
|
||||||
|
{
|
||||||
|
this(module, code, args, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseException(String module, String defaultMessage)
|
||||||
|
{
|
||||||
|
this(module, null, null, defaultMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseException(String code, Object[] args)
|
||||||
|
{
|
||||||
|
this(null, code, args, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseException(String defaultMessage)
|
||||||
|
{
|
||||||
|
this(null, null, null, defaultMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage()
|
||||||
|
{
|
||||||
|
String message = null;
|
||||||
|
if (!StringUtils.isEmpty(code))
|
||||||
|
{
|
||||||
|
message = MessageUtils.message(code, args);
|
||||||
|
}
|
||||||
|
if (message == null)
|
||||||
|
{
|
||||||
|
message = defaultMessage;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModule()
|
||||||
|
{
|
||||||
|
return module;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object[] getArgs()
|
||||||
|
{
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultMessage()
|
||||||
|
{
|
||||||
|
return defaultMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,11 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,946 @@
|
||||||
|
package com.ff.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
|
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.*;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间工具类
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||||
|
public static String YYYY = "yyyy";
|
||||||
|
|
||||||
|
public static String YYYY_MM = "yyyy-MM";
|
||||||
|
|
||||||
|
public static String YYYY_MM_DD = "yyyy-MM-dd";
|
||||||
|
|
||||||
|
public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||||
|
|
||||||
|
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
|
public static String[] parsePatterns = {
|
||||||
|
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||||
|
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||||
|
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||||
|
|
||||||
|
public static String HHMMSS = "HH:mm:ss";
|
||||||
|
|
||||||
|
public static String DAY_START_TIME = "00:00:00";
|
||||||
|
|
||||||
|
public static String DAY_END_TIME = "23:59:59";
|
||||||
|
|
||||||
|
public static final String ISO_8601_FORMAT= "yyyy-MM-dd'T'HH:mm:ss";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ISO_8601_FORMAT_Z= "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前Date型日期
|
||||||
|
*
|
||||||
|
* @return Date() 当前日期
|
||||||
|
*/
|
||||||
|
public static Long getNowDate() {
|
||||||
|
return Instant.now().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期
|
||||||
|
*
|
||||||
|
* @return {@link Long }
|
||||||
|
*/
|
||||||
|
public static Date getCurrentDate() {
|
||||||
|
return new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String getDate() {
|
||||||
|
return dateTimeNow(YYYY_MM_DD);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String getTime() {
|
||||||
|
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String dateTimeNow() {
|
||||||
|
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String dateTimeNow(final String format) {
|
||||||
|
return parseDateToStr(format, new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String dateTime(final Date date) {
|
||||||
|
return parseDateToStr(YYYY_MM_DD, date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String parseDateToStr(final String format, final Date date) {
|
||||||
|
return new SimpleDateFormat(format).format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Date dateTime(final String format, final String ts) {
|
||||||
|
try {
|
||||||
|
return new SimpleDateFormat(format).parse(ts);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期路径 即年/月/日 如2018/08/08
|
||||||
|
*/
|
||||||
|
public static final String datePath() {
|
||||||
|
Date now = new Date();
|
||||||
|
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期路径 即年/月/日 如20180808
|
||||||
|
*/
|
||||||
|
public static final String dateTime() {
|
||||||
|
Date now = new Date();
|
||||||
|
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期型字符串转化为日期 格式
|
||||||
|
*/
|
||||||
|
public static Date parseDate(Object str) {
|
||||||
|
if (str == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return parseDate(str.toString(), parsePatterns);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取服务器启动时间
|
||||||
|
*/
|
||||||
|
public static Date getServerStartDate() {
|
||||||
|
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||||
|
return new Date(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算相差天数
|
||||||
|
*/
|
||||||
|
public static int differentDaysByMillisecond(Date date1, Date date2) {
|
||||||
|
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算时间差
|
||||||
|
*
|
||||||
|
* @param endDate 最后时间
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @return 时间差(天/小时/分钟)
|
||||||
|
*/
|
||||||
|
public static String timeDistance(Date endDate, Date startTime) {
|
||||||
|
long nd = 1000 * 24 * 60 * 60;
|
||||||
|
long nh = 1000 * 60 * 60;
|
||||||
|
long nm = 1000 * 60;
|
||||||
|
// long ns = 1000;
|
||||||
|
// 获得两个时间的毫秒时间差异
|
||||||
|
long diff = endDate.getTime() - startTime.getTime();
|
||||||
|
// 计算差多少天
|
||||||
|
long day = diff / nd;
|
||||||
|
// 计算差多少小时
|
||||||
|
long hour = diff % nd / nh;
|
||||||
|
// 计算差多少分钟
|
||||||
|
long min = diff % nd % nh / nm;
|
||||||
|
// 计算差多少秒//输出结果
|
||||||
|
// long sec = diff % nd % nh % nm / ns;
|
||||||
|
return day + "天" + hour + "小时" + min + "分钟";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加 LocalDateTime ==> Date
|
||||||
|
*/
|
||||||
|
public static Date toDate(LocalDateTime temporalAccessor) {
|
||||||
|
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
|
||||||
|
return Date.from(zdt.toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取格式化日期yymmd
|
||||||
|
*
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
public static String getFormattedDate() {
|
||||||
|
ZonedDateTime nowUtcMinus4 = ZonedDateTime.now(ZoneId.of("UTC-4"));
|
||||||
|
|
||||||
|
String year = String.format("%02d", nowUtcMinus4.getYear() % 100);
|
||||||
|
String month = String.format("%02d", nowUtcMinus4.getMonthValue());
|
||||||
|
String day = String.valueOf(nowUtcMinus4.getDayOfMonth());
|
||||||
|
|
||||||
|
return year + month + day;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将日期格式化为gmt4
|
||||||
|
*
|
||||||
|
* @param date 日期
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
public static String formatDateToGMT4(Date date) {
|
||||||
|
// 将 Date 转换为 ZonedDateTime
|
||||||
|
ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of("GMT-4"));
|
||||||
|
// 定义日期时间格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
|
||||||
|
// 格式化并返回字符串
|
||||||
|
return zdt.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将时间戳转换为指定格式的时间字符串
|
||||||
|
*
|
||||||
|
* @param timestamp 时间戳(毫秒)
|
||||||
|
* @param format 目标时间格式,例如:yyyy-MM-dd'T'HH:mm:ssXXX
|
||||||
|
* @param timeZone 时区,例如:GMT+8,UTC等
|
||||||
|
* @return 格式化后的时间字符串
|
||||||
|
*/
|
||||||
|
public static String convertTimestampToFormattedDate(long timestamp, String format, String timeZone) {
|
||||||
|
// 创建日期格式化对象
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||||
|
|
||||||
|
// 设置时区为GMT+8
|
||||||
|
sdf.setTimeZone(TimeZone.getTimeZone(timeZone));
|
||||||
|
|
||||||
|
// 转换为 Date 对象
|
||||||
|
Date date = new Date(timestamp);
|
||||||
|
|
||||||
|
// 返回格式化后的时间字符串
|
||||||
|
return sdf.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将毫秒时间戳转换为指定时区的时间,并按指定格式输出
|
||||||
|
*
|
||||||
|
* @param timestampInMillis 毫秒级时间戳
|
||||||
|
* @param timeZone 时区(例如:America/New_York)
|
||||||
|
* @param format 时间格式(例如:yyyy-MM-dd HH:mm:ss)
|
||||||
|
* @return 格式化后的时间字符串
|
||||||
|
*/
|
||||||
|
public static String convertTimeZone(long timestampInMillis, String timeZone, String format) {
|
||||||
|
// 将毫秒时间戳转换为 Instant
|
||||||
|
Instant instant = Instant.ofEpochMilli(timestampInMillis);
|
||||||
|
|
||||||
|
// 将 UTC 时间转换为指定时区的时间
|
||||||
|
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(timeZone));
|
||||||
|
|
||||||
|
// 格式化输出为指定格式的时间字符串
|
||||||
|
return zonedDateTime.format(DateTimeFormatter.ofPattern(format));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加 LocalDate ==> Date
|
||||||
|
*/
|
||||||
|
public static Date toDate(LocalDate temporalAccessor) {
|
||||||
|
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
|
||||||
|
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||||
|
return Date.from(zdt.toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给定毫秒级时间戳,增加或扣除指定分钟
|
||||||
|
*
|
||||||
|
* @param timestampMillis 初始时间戳(毫秒级)
|
||||||
|
* @param minutes 要增加或扣除的分钟数(正值为增加,负值为扣除)
|
||||||
|
* @return long 结果时间戳(毫秒级)
|
||||||
|
*/
|
||||||
|
public static long addOrSubtractMinutes(long timestampMillis, int minutes) {
|
||||||
|
// 将分钟转换为毫秒,并加到时间戳上
|
||||||
|
return timestampMillis + minutes * 60 * 1000L;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加或减一天
|
||||||
|
*
|
||||||
|
* @param timestampDay 时间戳日期
|
||||||
|
* @param day 白天
|
||||||
|
* @return long
|
||||||
|
*/
|
||||||
|
public static long addOrSubtractDay(long timestampDay, int day) {
|
||||||
|
// 将分钟转换为毫秒,并加到时间戳上
|
||||||
|
return timestampDay + day * 60 * 1000L * 60 * 24;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取给定日期
|
||||||
|
*
|
||||||
|
* @return 不带时区的给定日期的起始时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static Long getDayStart(Calendar calendar) {
|
||||||
|
// 设置时间为当天的 00:00:00
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定时间戳指定时区的一天的开始时间
|
||||||
|
*
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @param timeZoneId 时区
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getDayStart(long timestamp, String timeZoneId) {
|
||||||
|
ZoneId zoneId = ZoneId.of(timeZoneId);
|
||||||
|
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), zoneId);
|
||||||
|
LocalDate localDate = zonedDateTime.toLocalDate();
|
||||||
|
LocalDateTime startOfDay = localDate.atStartOfDay();
|
||||||
|
ZonedDateTime startOfDayZoned = startOfDay.atZone(zoneId);
|
||||||
|
return startOfDayZoned.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取给定日期
|
||||||
|
*
|
||||||
|
* @return 不带时区的给定日期的结束时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static Long getDayEnd(Calendar calendar) {
|
||||||
|
// 设置时间为当天的 23:59:59
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定时间戳指定时区的一天的结束时间
|
||||||
|
*
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @param timeZoneId 时区
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getDayEnd(long timestamp, String timeZoneId) {
|
||||||
|
ZoneId zoneId = ZoneId.of(timeZoneId);
|
||||||
|
ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestamp), zoneId);
|
||||||
|
LocalDate localDate = zonedDateTime.toLocalDate();
|
||||||
|
LocalDateTime endOfDay = localDate.atTime(23, 59, 59, 999999999);
|
||||||
|
ZonedDateTime endOfDayZoned = endOfDay.atZone(zoneId);
|
||||||
|
return endOfDayZoned.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取昨天的开始时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getYesterdayStart() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
// 回溯一天
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
// 设置时间为当天的 00:00:00
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取昨天的结束时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getYesterdayEnd() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
// 回溯一天
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
// 设置时间为当天的 23:59:59
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上周的开始时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getLastWeekBegin() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
// 计算上周的起始日期(周一)
|
||||||
|
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
||||||
|
calendar.add(Calendar.WEEK_OF_YEAR, -1);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上周的结束时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getLastWeekEnd() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
// 计算上周的结束日期(周日)
|
||||||
|
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一周的开始时间
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getWeekBegin(Calendar calendar) {
|
||||||
|
// 设置一周的第一天为星期一
|
||||||
|
calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||||
|
// 获取当前日期在本周的位置
|
||||||
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
||||||
|
// 计算需要回溯的天数
|
||||||
|
int daysToSubtract = (dayOfWeek == Calendar.SUNDAY ? 6 : dayOfWeek - 2);
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -daysToSubtract);
|
||||||
|
// 设置时间为当天的 00:00:00
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一周的结束时间
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getWeekEnd(Calendar calendar) {
|
||||||
|
// 设置一周的第一天为星期一
|
||||||
|
calendar.setFirstDayOfWeek(Calendar.MONDAY);
|
||||||
|
// 获取当前日期在本周的位置
|
||||||
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
||||||
|
// 计算需要前进的天数
|
||||||
|
int daysToAdd = (dayOfWeek == Calendar.SUNDAY ? 0 : 7 - (dayOfWeek - 1));
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, daysToAdd);
|
||||||
|
// 设置时间为当天的 23:59:59
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前月份的开始时间
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getMonthStart(Calendar calendar) {
|
||||||
|
// 设置时间为当月的第一天
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
// 设置时间为当天的 00:00:00
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前月份的结束时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getMonthEnd(Calendar calendar) {
|
||||||
|
// 设置时间为当月的最后一天
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||||
|
// 设置时间为当天的 23:59:59
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23);
|
||||||
|
calendar.set(Calendar.MINUTE, 59);
|
||||||
|
calendar.set(Calendar.SECOND, 59);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上个月的开始时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getLastMonthStart() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
// 计算上个月的起始日期(1号)
|
||||||
|
calendar.add(Calendar.MONTH, -1);
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上个月的结束时间(不带时区)
|
||||||
|
*
|
||||||
|
* @return 时间戳
|
||||||
|
*/
|
||||||
|
public static Long getLastMonthEnd() {
|
||||||
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
|
||||||
|
calendar.add(Calendar.MONTH, -1); // 回退一个月
|
||||||
|
|
||||||
|
// 计算上个月的结束日期(最后一天)
|
||||||
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); // 设置日期为当月最后一天
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY, 23); // 设置小时为23
|
||||||
|
calendar.set(Calendar.MINUTE, 59); // 设置分钟为59
|
||||||
|
calendar.set(Calendar.SECOND, 59); // 设置秒为59
|
||||||
|
calendar.set(Calendar.MILLISECOND, 999); // 设置毫秒为999
|
||||||
|
return calendar.getTimeInMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断时间戳 A 距离时间戳 B 近还是距离时间戳 C 近
|
||||||
|
*
|
||||||
|
* @param timestampA 时间戳 A
|
||||||
|
* @param timestampB 时间戳 B
|
||||||
|
* @param timestampC 时间戳 C
|
||||||
|
* @return 返回 true 表示时间戳 A 更接近时间戳 B,返回 false 表示时间戳 A 更接近时间戳 C
|
||||||
|
*/
|
||||||
|
public static boolean isCloserToB(long timestampA, long timestampB, long timestampC) {
|
||||||
|
long diffAB = Math.abs(timestampA - timestampB);
|
||||||
|
long diffAC = Math.abs(timestampA - timestampC);
|
||||||
|
return diffAB < diffAC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定时间戳次日指定时区指定时间的时间戳
|
||||||
|
*
|
||||||
|
* @param utcTimestamp utc时间戳
|
||||||
|
* @param date 具体时间
|
||||||
|
* @param timeZonId 指定时区
|
||||||
|
* @return 只改变时区 不改变具体日期的时间戳
|
||||||
|
*/
|
||||||
|
public static long getTomorrowTimeByZonId(long utcTimestamp, Date date, String timeZonId) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
// 将时间戳转换为 Instant
|
||||||
|
Instant instant = Instant.ofEpochMilli(addOrSubtractDay(utcTimestamp, 1));
|
||||||
|
ZoneId zoneId = ZoneId.of(timeZonId);
|
||||||
|
LocalDate localDate = instant.atZone(zoneId).toLocalDate();
|
||||||
|
LocalDateTime tomorrowDrawStartTime = localDate.atTime(localTime);
|
||||||
|
return tomorrowDrawStartTime.atZone(zoneId).toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定时区并具体时间的的实时时间戳
|
||||||
|
*
|
||||||
|
* @param date 具体时间
|
||||||
|
* @param timeZonId 时区
|
||||||
|
* @return 只改变时区 不改变具体日期的时间戳
|
||||||
|
*/
|
||||||
|
public static long getTodayTimeByZonId(Date date, String timeZonId) {
|
||||||
|
// 获取今日指定时间后的时间戳
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
LocalDateTime todayDrawStartTime = currentDate.atTime(localTime);
|
||||||
|
ZoneId zoneId = ZoneId.of(timeZonId);
|
||||||
|
return todayDrawStartTime.atZone(zoneId).toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取下周指定周几的几点的指定时区时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfWeek 周几,1-7表示周一到周日
|
||||||
|
* @param date 具体时间,Date对象
|
||||||
|
* @return UTC时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static long getNextWeekTimestamp(int dayOfWeek, Date date, ZoneId zoneId) {
|
||||||
|
// 将Date对象转换为LocalDateTime对象
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
// 获取当前日期时间
|
||||||
|
ZonedDateTime now = ZonedDateTime.now(zoneId);
|
||||||
|
// 找到本周的周几
|
||||||
|
ZonedDateTime startOfWeek = now.with(dayOfWeek < now.getDayOfWeek().getValue() ? TemporalAdjusters.previousOrSame(DayOfWeek.of(dayOfWeek)) : TemporalAdjusters.nextOrSame(DayOfWeek.of(dayOfWeek)));
|
||||||
|
|
||||||
|
// 加上一个完整的星期,得到下周的周几
|
||||||
|
ZonedDateTime nextWeekStart = startOfWeek.plusWeeks(1);
|
||||||
|
|
||||||
|
// 设置指定的时间
|
||||||
|
ZonedDateTime targetDateTime = nextWeekStart.withHour(localTime.getHour()).withMinute(localTime.getMinute()).withSecond(localTime.getSecond()).withNano(0);
|
||||||
|
|
||||||
|
// 转换为时间戳(毫秒)
|
||||||
|
return targetDateTime.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定时区当前周指定周几的几点的时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfWeek 周几,1-7表示周一到周日
|
||||||
|
* @param date 具体时间,Date对象
|
||||||
|
* @return 时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static long getCurrentWeekTimestamp(int dayOfWeek, Date date, ZoneId zoneId) {
|
||||||
|
// 将Date对象转换为LocalDateTime对象
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
|
||||||
|
// 获取当前日期时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
// 获取当前周的指定周几的日期时间
|
||||||
|
LocalDateTime currentWeekDateTime = now.with(dayOfWeek < now.getDayOfWeek().getValue() ? TemporalAdjusters.previousOrSame(DayOfWeek.of(dayOfWeek)) : TemporalAdjusters.nextOrSame(DayOfWeek.of(dayOfWeek)))
|
||||||
|
.withHour(localTime.getHour())
|
||||||
|
.withMinute(localTime.getMinute())
|
||||||
|
.withSecond(localTime.getSecond())
|
||||||
|
.withNano(0);
|
||||||
|
|
||||||
|
// 将LocalDateTime转换为ZonedDateTime,使用UTC时区
|
||||||
|
ZonedDateTime zonedDateTime = currentWeekDateTime.atZone(zoneId);
|
||||||
|
|
||||||
|
// 将ZonedDateTime转换为时间戳(毫秒)
|
||||||
|
return zonedDateTime.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取下月指定日的几点的时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfMonth 指定日,1-31表示
|
||||||
|
* @param date 具体时间,Date对象
|
||||||
|
* @param month 下几月
|
||||||
|
* @return 时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static long getNextMonthTimestamp(int dayOfMonth, Date date, ZoneId zoneId, int month) {
|
||||||
|
// 将Date对象转换为LocalDateTime对象
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
|
||||||
|
// 获取当前日期时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
// 获取下个月的年份和月份
|
||||||
|
YearMonth nextMonth = YearMonth.from(now).plusMonths(month);
|
||||||
|
int maxDayNum = nextMonth.lengthOfMonth();
|
||||||
|
if (dayOfMonth > maxDayNum) {
|
||||||
|
dayOfMonth = maxDayNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建下个月指定日的LocalDateTime对象
|
||||||
|
LocalDateTime nextMonthDateTime = LocalDateTime.of(nextMonth.getYear(), nextMonth.getMonth(), dayOfMonth,
|
||||||
|
localTime.getHour(), localTime.getMinute(), localTime.getSecond(), 0);
|
||||||
|
|
||||||
|
// 将LocalDateTime转换为ZonedDateTime,使用UTC时区
|
||||||
|
ZonedDateTime zonedDateTime = nextMonthDateTime.atZone(zoneId);
|
||||||
|
|
||||||
|
// 将ZonedDateTime转换为时间戳(毫秒)
|
||||||
|
return zonedDateTime.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本月指定日的几点的时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfMonth 指定日,1-31表示
|
||||||
|
* @param date 具体时间,Date对象
|
||||||
|
* @return 时间戳(毫秒)
|
||||||
|
*/
|
||||||
|
public static long getCurrentMonthTimestamp(int dayOfMonth, Date date, ZoneId zoneId) {
|
||||||
|
// 将Date对象转换为LocalDateTime对象
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat(HHMMSS);
|
||||||
|
String format = sdf.format(date);
|
||||||
|
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern(HHMMSS);
|
||||||
|
LocalTime localTime = LocalTime.parse(format, timeFormatter);
|
||||||
|
|
||||||
|
// 获取当前日期时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 获取本月的年份和月份
|
||||||
|
YearMonth currentMonth = YearMonth.from(now);
|
||||||
|
int maxDayNum = currentMonth.lengthOfMonth();
|
||||||
|
if (dayOfMonth > maxDayNum) {
|
||||||
|
dayOfMonth = maxDayNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建本月指定日的LocalDateTime对象
|
||||||
|
LocalDateTime currentMonthDateTime = LocalDateTime.of(currentMonth.getYear(), currentMonth.getMonth(), dayOfMonth,
|
||||||
|
localTime.getHour(), localTime.getMinute(), localTime.getSecond(), 0);
|
||||||
|
|
||||||
|
// 将LocalDateTime转换为ZonedDateTime,使用UTC时区
|
||||||
|
ZonedDateTime zonedDateTime = currentMonthDateTime.atZone(zoneId);
|
||||||
|
|
||||||
|
// 将ZonedDateTime转换为时间戳(毫秒)
|
||||||
|
return zonedDateTime.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将时间戳转换为UTC0时区的时间戳
|
||||||
|
*
|
||||||
|
* @param timeZoneId 时区id
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @return UTC0时区的时间戳
|
||||||
|
*/
|
||||||
|
public static long covertToUTCtimestamp(String timeZoneId, long timestamp) {
|
||||||
|
// 将时间戳转换为 Instant 对象
|
||||||
|
Instant instant = Instant.ofEpochMilli(timestamp);
|
||||||
|
|
||||||
|
// 使用指定的时区将 Instant 对象转换为 ZonedDateTime 对象
|
||||||
|
ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of(timeZoneId));
|
||||||
|
ZonedDateTime zonedDateTime1 = zonedDateTime.withZoneSameLocal(ZoneOffset.UTC);
|
||||||
|
// 将 ZonedDateTime 对象转换为 UTC0 时区的 Instant 对象
|
||||||
|
|
||||||
|
// 获取 UTC0 时区的时间戳(以毫秒为单位)
|
||||||
|
return zonedDateTime1.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将UTC时间戳转换为指定时区的时间戳
|
||||||
|
*
|
||||||
|
* @param timeZoneId 时区id
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @return 指定时区的时间戳
|
||||||
|
*/
|
||||||
|
public static long covertUTCTotimeZonetimestamp(String timeZoneId, long timestamp) {
|
||||||
|
// 将时间戳转换为 Instant 对象
|
||||||
|
Instant instant = Instant.ofEpochMilli(timestamp);
|
||||||
|
|
||||||
|
// 使用指定的时区将 Instant 对象转换为 ZonedDateTime 对象
|
||||||
|
ZonedDateTime zonedDateTime = instant.atZone(ZoneOffset.UTC);
|
||||||
|
ZonedDateTime zonedDateTime1 = zonedDateTime.withZoneSameLocal(ZoneId.of(timeZoneId));
|
||||||
|
// 获取 指定 时区的时间戳(以毫秒为单位)
|
||||||
|
return zonedDateTime1.toInstant().toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否是指定时区的当天的0点
|
||||||
|
*
|
||||||
|
* @param timestamp
|
||||||
|
* @param timeZone
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isMidnight(long timestamp, TimeZone timeZone) {
|
||||||
|
Calendar calendar = Calendar.getInstance(timeZone);
|
||||||
|
calendar.setTimeInMillis(timestamp);
|
||||||
|
|
||||||
|
return calendar.get(Calendar.HOUR_OF_DAY) == 0 &&
|
||||||
|
calendar.get(Calendar.MINUTE) == 0 &&
|
||||||
|
calendar.get(Calendar.SECOND) == 0 &&
|
||||||
|
calendar.get(Calendar.MILLISECOND) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否是指定时区的周一的0点
|
||||||
|
*
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @param timeZone 指定时区
|
||||||
|
* @return 是否是周一的0点
|
||||||
|
*/
|
||||||
|
public static boolean isMondayMidnight(long timestamp, TimeZone timeZone) {
|
||||||
|
Calendar calendar = Calendar.getInstance(timeZone);
|
||||||
|
calendar.setTimeInMillis(timestamp);
|
||||||
|
|
||||||
|
return isMidnight(timestamp, timeZone) && calendar.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 ISO 8601 格式的时间字符串转换为毫秒时间戳
|
||||||
|
*
|
||||||
|
* @param isoDate ISO 8601 格式的时间字符串,例如 "2025-05-10T08:23:34Z"
|
||||||
|
* @return 从 Unix epoch 开始的毫秒时间戳
|
||||||
|
*/
|
||||||
|
public static long convertToMilliseconds(String isoDate) {
|
||||||
|
Instant instant = Instant.parse(isoDate);
|
||||||
|
return instant.toEpochMilli();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 ZoneId 转换为 TimeZone
|
||||||
|
*
|
||||||
|
* @param zoneId 要转换的 ZoneId
|
||||||
|
* @return 对应的 TimeZone
|
||||||
|
*/
|
||||||
|
public static TimeZone zoneIdToTimeZone(ZoneId zoneId) {
|
||||||
|
return TimeZone.getTimeZone(zoneId.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定星期几的开始和结束UTC时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfWeek 星期几,1-7,1表示星期一,7表示星期日
|
||||||
|
* @return 包含开始和结束UTC时间戳的数组,第一个元素是开始时间戳,第二个元素是结束时间戳
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getStartAndEndUTCTimestampOfDayOfWeek(int dayOfWeek) {
|
||||||
|
if (dayOfWeek < 1 || dayOfWeek > 7) {
|
||||||
|
throw new IllegalArgumentException("dayOfWeek must be between 1 and 7");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前日期
|
||||||
|
LocalDate today = LocalDate.now(ZoneOffset.UTC);
|
||||||
|
// 计算本周的开始日期(星期一)
|
||||||
|
LocalDate monday = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
||||||
|
// 计算指定星期几的日期
|
||||||
|
LocalDate targetDay = monday.plusDays(dayOfWeek - 1);
|
||||||
|
|
||||||
|
// 计算指定星期几的开始时间(00:00:00 UTC)
|
||||||
|
ZonedDateTime startOfDay = targetDay.atStartOfDay(ZoneOffset.UTC);
|
||||||
|
// 计算指定星期几的结束时间(23:59:59 UTC)
|
||||||
|
ZonedDateTime endOfDay = targetDay.atTime(LocalTime.MAX).atZone(ZoneOffset.UTC);
|
||||||
|
|
||||||
|
// 获取开始和结束时间戳
|
||||||
|
long startTimestamp = startOfDay.toInstant().toEpochMilli();
|
||||||
|
long endTimestamp = endOfDay.toInstant().toEpochMilli();
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("beginTime", startTimestamp);
|
||||||
|
map.put("endTime", endTimestamp);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取本月指定月几号的开始和结束UTC时间戳
|
||||||
|
*
|
||||||
|
* @param dayOfMonth 本月几号,1-31
|
||||||
|
* @return 包含开始和结束UTC时间戳的Map,键分别为"beginTime"和"endTime"
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> getStartAndEndUTCTimestampOfDayOfMonth(int dayOfMonth) {
|
||||||
|
// 获取当前日期
|
||||||
|
LocalDate today = LocalDate.now(ZoneOffset.UTC);
|
||||||
|
// 获取本月的年份和月份
|
||||||
|
YearMonth currentMonth = YearMonth.from(today);
|
||||||
|
int maxDayNum = currentMonth.lengthOfMonth();
|
||||||
|
if (dayOfMonth > maxDayNum) {
|
||||||
|
dayOfMonth = maxDayNum;
|
||||||
|
}
|
||||||
|
// 获取当前年份和月份
|
||||||
|
int year = today.getYear();
|
||||||
|
int month = today.getMonthValue();
|
||||||
|
|
||||||
|
// 构建指定月几号的日期
|
||||||
|
LocalDate targetDay;
|
||||||
|
try {
|
||||||
|
targetDay = LocalDate.of(year, month, dayOfMonth);
|
||||||
|
} catch (DateTimeException e) {
|
||||||
|
throw new IllegalArgumentException("Invalid dayOfMonth for the current month", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算指定月几号的开始时间(00:00:00 UTC)
|
||||||
|
ZonedDateTime startOfDay = targetDay.atStartOfDay(ZoneOffset.UTC);
|
||||||
|
// 计算指定月几号的结束时间(23:59:59 UTC)
|
||||||
|
ZonedDateTime endOfDay = targetDay.atTime(LocalTime.MAX).atZone(ZoneOffset.UTC);
|
||||||
|
|
||||||
|
// 获取开始和结束时间戳
|
||||||
|
long startTimestamp = startOfDay.toInstant().toEpochMilli();
|
||||||
|
long endTimestamp = endOfDay.toInstant().toEpochMilli();
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("beginTime", startTimestamp);
|
||||||
|
map.put("endTime", endTimestamp);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断两个毫秒级时间戳是否为同一天
|
||||||
|
*
|
||||||
|
* @param timestamp1 第一个时间戳
|
||||||
|
* @param timestamp2 第二个时间戳
|
||||||
|
* @return 如果两个时间戳属于同一天,返回true;否则返回false
|
||||||
|
*/
|
||||||
|
public static boolean isSameDay(long timestamp1, long timestamp2) {
|
||||||
|
// 将时间戳转换为 LocalDate
|
||||||
|
LocalDate date1 = Instant.ofEpochMilli(timestamp1)
|
||||||
|
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
|
||||||
|
.toLocalDate();
|
||||||
|
|
||||||
|
LocalDate date2 = Instant.ofEpochMilli(timestamp2)
|
||||||
|
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
|
||||||
|
.toLocalDate();
|
||||||
|
|
||||||
|
// 比较日期部分是否相同
|
||||||
|
return date1.isEqual(date2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 UTC 时区的当前日期,并返回 java.util.Date 类型
|
||||||
|
*
|
||||||
|
* @return java.util.Date 对象,表示 UTC 时区的当前日期
|
||||||
|
*/
|
||||||
|
public static Date getUTCDate() {
|
||||||
|
// 获取 UTC 时区的当前时间
|
||||||
|
ZonedDateTime utcTime = ZonedDateTime.now(ZoneId.of("UTC"));
|
||||||
|
|
||||||
|
// 提取 UTC 时区的日期部分
|
||||||
|
ZonedDateTime utcDateTime = utcTime.toLocalDate().atStartOfDay(ZoneId.of("UTC"));
|
||||||
|
|
||||||
|
// 将 ZonedDateTime 转换为 java.util.Date
|
||||||
|
return Date.from(utcDateTime.toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 LocalTime 转换为 Date
|
||||||
|
*
|
||||||
|
* @param localTime LocalTime对象
|
||||||
|
* @return Date对象
|
||||||
|
*/
|
||||||
|
public static Date convertToDate(LocalTime localTime) {
|
||||||
|
// 使用当前日期作为参考日期
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
|
// 将 LocalTime 和 LocalDate 结合成 LocalDateTime
|
||||||
|
LocalDateTime localDateTime = LocalDateTime.of(today, localTime);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String format = localDateTime.format(formatter);
|
||||||
|
// 将 LocalDateTime 转换为 Date
|
||||||
|
return DateUtils.parseDate(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否在指定时间段内
|
||||||
|
*
|
||||||
|
* @param value 要判断的时间戳
|
||||||
|
* @param minValue 开始时间戳
|
||||||
|
* @param maxValue 结束时间戳
|
||||||
|
* @return 是否在指定时间段内
|
||||||
|
*/
|
||||||
|
public static boolean isBetween(Long value, Long minValue, Long maxValue) {
|
||||||
|
return value >= minValue && value <= maxValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.ff.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID生成器工具类
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
public class IdUtils {
|
||||||
|
/**
|
||||||
|
* 获取随机UUID
|
||||||
|
*
|
||||||
|
* @return 随机UUID
|
||||||
|
*/
|
||||||
|
public static String randomUUID() {
|
||||||
|
return UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简化的UUID,去掉了横线
|
||||||
|
*
|
||||||
|
* @return 简化的UUID,去掉了横线
|
||||||
|
*/
|
||||||
|
public static String simpleUUID() {
|
||||||
|
return UUID.randomUUID().toString(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
|
||||||
|
*
|
||||||
|
* @return 随机UUID
|
||||||
|
*/
|
||||||
|
public static String fastUUID() {
|
||||||
|
return UUID.fastUUID().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简化的UUID,去掉了横线,使用性能更好的ThreadLocalRandom生成UUID
|
||||||
|
*
|
||||||
|
* @return 简化的UUID,去掉了横线
|
||||||
|
*/
|
||||||
|
public static String fastSimpleUUID() {
|
||||||
|
return UUID.fastUUID().toString(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,657 @@
|
||||||
|
package com.ff.utils;
|
||||||
|
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串工具类
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||||
|
/**
|
||||||
|
* 空字符串
|
||||||
|
*/
|
||||||
|
private static final String NULLSTR = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下划线
|
||||||
|
*/
|
||||||
|
private static final char SEPARATOR = '_';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 星号
|
||||||
|
*/
|
||||||
|
private static final char ASTERISK = '*';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取参数不为空值
|
||||||
|
*
|
||||||
|
* @param value defaultValue 要判断的value
|
||||||
|
* @return value 返回值
|
||||||
|
*/
|
||||||
|
public static <T> T nvl(T value, T defaultValue) {
|
||||||
|
return value != null ? value : defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个Collection是否为空, 包含List,Set,Queue
|
||||||
|
*
|
||||||
|
* @param coll 要判断的Collection
|
||||||
|
* @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(Collection<?> coll) {
|
||||||
|
return isNull(coll) || coll.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个Collection是否非空,包含List,Set,Queue
|
||||||
|
*
|
||||||
|
* @param coll 要判断的Collection
|
||||||
|
* @return true:非空 false:空
|
||||||
|
*/
|
||||||
|
public static boolean isNotEmpty(Collection<?> coll) {
|
||||||
|
return !isEmpty(coll);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个对象数组是否为空
|
||||||
|
*
|
||||||
|
* @param objects 要判断的对象数组
|
||||||
|
* * @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(Object[] objects) {
|
||||||
|
return isNull(objects) || (objects.length == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个对象数组是否非空
|
||||||
|
*
|
||||||
|
* @param objects 要判断的对象数组
|
||||||
|
* @return true:非空 false:空
|
||||||
|
*/
|
||||||
|
public static boolean isNotEmpty(Object[] objects) {
|
||||||
|
return !isEmpty(objects);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个Map是否为空
|
||||||
|
*
|
||||||
|
* @param map 要判断的Map
|
||||||
|
* @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(Map<?, ?> map) {
|
||||||
|
return isNull(map) || map.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个Map是否为空
|
||||||
|
*
|
||||||
|
* @param map 要判断的Map
|
||||||
|
* @return true:非空 false:空
|
||||||
|
*/
|
||||||
|
public static boolean isNotEmpty(Map<?, ?> map) {
|
||||||
|
return !isEmpty(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个字符串是否为空串
|
||||||
|
*
|
||||||
|
* @param str String
|
||||||
|
* @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(String str) {
|
||||||
|
return isNull(str) || NULLSTR.equals(str.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个字符串是否为非空串
|
||||||
|
*
|
||||||
|
* @param str String
|
||||||
|
* @return true:非空串 false:空串
|
||||||
|
*/
|
||||||
|
public static boolean isNotEmpty(String str) {
|
||||||
|
return !isEmpty(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个对象是否为空
|
||||||
|
*
|
||||||
|
* @param object Object
|
||||||
|
* @return true:为空 false:非空
|
||||||
|
*/
|
||||||
|
public static boolean isNull(Object object) {
|
||||||
|
return object == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个对象是否非空
|
||||||
|
*
|
||||||
|
* @param object Object
|
||||||
|
* @return true:非空 false:空
|
||||||
|
*/
|
||||||
|
public static boolean isNotNull(Object object) {
|
||||||
|
return !isNull(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 判断一个对象是否是数组类型(Java基本型别的数组)
|
||||||
|
*
|
||||||
|
* @param object 对象
|
||||||
|
* @return true:是数组 false:不是数组
|
||||||
|
*/
|
||||||
|
public static boolean isArray(Object object) {
|
||||||
|
return isNotNull(object) && object.getClass().isArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去空格
|
||||||
|
*/
|
||||||
|
public static String trim(String str) {
|
||||||
|
return (str == null ? "" : str.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换指定字符串的指定区间内字符为"*"
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @param startInclude 开始位置(包含)
|
||||||
|
* @param endExclude 结束位置(不包含)
|
||||||
|
* @return 替换后的字符串
|
||||||
|
*/
|
||||||
|
public static String hide(CharSequence str, int startInclude, int endExclude) {
|
||||||
|
if (isEmpty(str)) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
final int strLength = str.length();
|
||||||
|
if (startInclude > strLength) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
if (endExclude > strLength) {
|
||||||
|
endExclude = strLength;
|
||||||
|
}
|
||||||
|
if (startInclude > endExclude) {
|
||||||
|
// 如果起始位置大于结束位置,不替换
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
final char[] chars = new char[strLength];
|
||||||
|
for (int i = 0; i < strLength; i++) {
|
||||||
|
if (i >= startInclude && i < endExclude) {
|
||||||
|
chars[i] = ASTERISK;
|
||||||
|
} else {
|
||||||
|
chars[i] = str.charAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new String(chars);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截取字符串
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @param start 开始
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public static String substring(final String str, int start) {
|
||||||
|
if (str == null) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start < 0) {
|
||||||
|
start = str.length() + start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start < 0) {
|
||||||
|
start = 0;
|
||||||
|
}
|
||||||
|
if (start > str.length()) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.substring(start);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 截取字符串
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @param start 开始
|
||||||
|
* @param end 结束
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public static String substring(final String str, int start, int end) {
|
||||||
|
if (str == null) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end < 0) {
|
||||||
|
end = str.length() + end;
|
||||||
|
}
|
||||||
|
if (start < 0) {
|
||||||
|
start = str.length() + start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end > str.length()) {
|
||||||
|
end = str.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start > end) {
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (start < 0) {
|
||||||
|
start = 0;
|
||||||
|
}
|
||||||
|
if (end < 0) {
|
||||||
|
end = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.substring(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否为空,并且不是空白字符
|
||||||
|
*
|
||||||
|
* @param str 要判断的value
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public static boolean hasText(String str) {
|
||||||
|
return (str != null && !str.isEmpty() && containsText(str));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean containsText(CharSequence str) {
|
||||||
|
int strLen = str.length();
|
||||||
|
for (int i = 0; i < strLen; i++) {
|
||||||
|
if (!Character.isWhitespace(str.charAt(i))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 格式化文本, {} 表示占位符<br>
|
||||||
|
// * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
|
||||||
|
// * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
|
||||||
|
// * 例:<br>
|
||||||
|
// * 通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
|
||||||
|
// * 转义{}: format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
|
||||||
|
// * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
|
||||||
|
// *
|
||||||
|
// * @param template 文本模板,被替换的部分用 {} 表示
|
||||||
|
// * @param params 参数值
|
||||||
|
// * @return 格式化后的文本
|
||||||
|
// */
|
||||||
|
// public static String format(String template, Object... params) {
|
||||||
|
// if (isEmpty(params) || isEmpty(template)) {
|
||||||
|
// return template;
|
||||||
|
// }
|
||||||
|
// return StrFormatter.format(template, params);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 是否为http(s)://开头
|
||||||
|
// *
|
||||||
|
// * @param link 链接
|
||||||
|
// * @return 结果
|
||||||
|
// */
|
||||||
|
// public static boolean ishttp(String link) {
|
||||||
|
// return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转set
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @param sep 分隔符
|
||||||
|
* @return set集合
|
||||||
|
*/
|
||||||
|
public static final Set<String> str2Set(String str, String sep) {
|
||||||
|
return new HashSet<String>(str2List(str, sep, true, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转list
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @param sep 分隔符
|
||||||
|
* @param filterBlank 过滤纯空白
|
||||||
|
* @param trim 去掉首尾空白
|
||||||
|
* @return list集合
|
||||||
|
*/
|
||||||
|
public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
if (StringUtils.isEmpty(str)) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤空白字符串
|
||||||
|
if (filterBlank && StringUtils.isBlank(str)) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
String[] split = str.split(sep);
|
||||||
|
for (String string : split) {
|
||||||
|
if (filterBlank && StringUtils.isBlank(string)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (trim) {
|
||||||
|
string = string.trim();
|
||||||
|
}
|
||||||
|
list.add(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
|
||||||
|
*
|
||||||
|
* @param collection 给定的集合
|
||||||
|
* @param array 给定的数组
|
||||||
|
* @return boolean 结果
|
||||||
|
*/
|
||||||
|
public static boolean containsAny(Collection<String> collection, String... array) {
|
||||||
|
if (isEmpty(collection) || isEmpty(array)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
for (String str : array) {
|
||||||
|
if (collection.contains(str)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
|
||||||
|
*
|
||||||
|
* @param cs 指定字符串
|
||||||
|
* @param searchCharSequences 需要检查的字符串数组
|
||||||
|
* @return 是否包含任意一个字符串
|
||||||
|
*/
|
||||||
|
public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
|
||||||
|
if (isEmpty(cs) || isEmpty(searchCharSequences)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (CharSequence testStr : searchCharSequences) {
|
||||||
|
if (containsIgnoreCase(cs, testStr)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驼峰转下划线命名
|
||||||
|
*/
|
||||||
|
public static String toUnderScoreCase(String str) {
|
||||||
|
if (str == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
// 前置字符是否大写
|
||||||
|
boolean preCharIsUpperCase = true;
|
||||||
|
// 当前字符是否大写
|
||||||
|
boolean curreCharIsUpperCase = true;
|
||||||
|
// 下一字符是否大写
|
||||||
|
boolean nexteCharIsUpperCase = true;
|
||||||
|
for (int i = 0; i < str.length(); i++) {
|
||||||
|
char c = str.charAt(i);
|
||||||
|
if (i > 0) {
|
||||||
|
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
|
||||||
|
} else {
|
||||||
|
preCharIsUpperCase = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
curreCharIsUpperCase = Character.isUpperCase(c);
|
||||||
|
|
||||||
|
if (i < (str.length() - 1)) {
|
||||||
|
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
|
||||||
|
sb.append(SEPARATOR);
|
||||||
|
} else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
|
||||||
|
sb.append(SEPARATOR);
|
||||||
|
}
|
||||||
|
sb.append(Character.toLowerCase(c));
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否包含字符串
|
||||||
|
*
|
||||||
|
* @param str 验证字符串
|
||||||
|
* @param strs 字符串组
|
||||||
|
* @return 包含返回true
|
||||||
|
*/
|
||||||
|
public static boolean inStringIgnoreCase(String str, String... strs) {
|
||||||
|
if (str != null && strs != null) {
|
||||||
|
for (String s : strs) {
|
||||||
|
if (str.equalsIgnoreCase(trim(s))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
|
||||||
|
*
|
||||||
|
* @param name 转换前的下划线大写方式命名的字符串
|
||||||
|
* @return 转换后的驼峰式命名的字符串
|
||||||
|
*/
|
||||||
|
public static String convertToCamelCase(String name) {
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
// 快速检查
|
||||||
|
if (name == null || name.isEmpty()) {
|
||||||
|
// 没必要转换
|
||||||
|
return "";
|
||||||
|
} else if (!name.contains("_")) {
|
||||||
|
// 不含下划线,仅将首字母大写
|
||||||
|
return name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||||
|
}
|
||||||
|
// 用下划线将原始字符串分割
|
||||||
|
String[] camels = name.split("_");
|
||||||
|
for (String camel : camels) {
|
||||||
|
// 跳过原始字符串中开头、结尾的下换线或双重下划线
|
||||||
|
if (camel.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 首字母大写
|
||||||
|
result.append(camel.substring(0, 1).toUpperCase());
|
||||||
|
result.append(camel.substring(1).toLowerCase());
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驼峰式命名法
|
||||||
|
* 例如:user_name->userName
|
||||||
|
*/
|
||||||
|
public static String toCamelCase(String s) {
|
||||||
|
if (s == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (s.indexOf(SEPARATOR) == -1) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
s = s.toLowerCase();
|
||||||
|
StringBuilder sb = new StringBuilder(s.length());
|
||||||
|
boolean upperCase = false;
|
||||||
|
for (int i = 0; i < s.length(); i++) {
|
||||||
|
char c = s.charAt(i);
|
||||||
|
|
||||||
|
if (c == SEPARATOR) {
|
||||||
|
upperCase = true;
|
||||||
|
} else if (upperCase) {
|
||||||
|
sb.append(Character.toUpperCase(c));
|
||||||
|
upperCase = false;
|
||||||
|
} else {
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
|
||||||
|
// *
|
||||||
|
// * @param str 指定字符串
|
||||||
|
// * @param strs 需要检查的字符串数组
|
||||||
|
// * @return 是否匹配
|
||||||
|
// */
|
||||||
|
// public static boolean matches(String str, List<String> strs) {
|
||||||
|
// if (isEmpty(str) || isEmpty(strs)) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// for (String pattern : strs) {
|
||||||
|
// if (isMatch(pattern, str)) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 判断url是否与规则配置:
|
||||||
|
// * ? 表示单个字符;
|
||||||
|
// * * 表示一层路径内的任意字符串,不可跨层级;
|
||||||
|
// * ** 表示任意层路径;
|
||||||
|
// *
|
||||||
|
// * @param pattern 匹配规则
|
||||||
|
// * @param url 需要匹配的url
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public static boolean isMatch(String pattern, String url) {
|
||||||
|
// AntPathMatcher matcher = new AntPathMatcher();
|
||||||
|
// return matcher.match(pattern, url);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static <T> T cast(Object obj) {
|
||||||
|
return (T) obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字左边补齐0,使之达到指定长度。注意,如果数字转换为字符串后,长度大于size,则只保留 最后size个字符。
|
||||||
|
*
|
||||||
|
* @param num 数字对象
|
||||||
|
* @param size 字符串指定长度
|
||||||
|
* @return 返回数字的字符串格式,该字符串为指定长度。
|
||||||
|
*/
|
||||||
|
public static final String padl(final Number num, final int size) {
|
||||||
|
return padl(num.toString(), size, '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串左补齐。如果原始字符串s长度大于size,则只保留最后size个字符。
|
||||||
|
*
|
||||||
|
* @param s 原始字符串
|
||||||
|
* @param size 字符串指定长度
|
||||||
|
* @param c 用于补齐的字符
|
||||||
|
* @return 返回指定长度的字符串,由原字符串左补齐或截取得到。
|
||||||
|
*/
|
||||||
|
public static final String padl(final String s, final int size, final char c) {
|
||||||
|
final StringBuilder sb = new StringBuilder(size);
|
||||||
|
if (s != null) {
|
||||||
|
final int len = s.length();
|
||||||
|
if (s.length() <= size) {
|
||||||
|
for (int i = size - len; i > 0; i--) {
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
sb.append(s);
|
||||||
|
} else {
|
||||||
|
return s.substring(len - size, len);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = size; i > 0; i--) {
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加后缀
|
||||||
|
*
|
||||||
|
* @param code 代码
|
||||||
|
* @param suffix 后缀
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
public static String addSuffix(String code, Object suffix) {
|
||||||
|
return code +"_"+ suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除字符串中最后一个指定的子字符串
|
||||||
|
*
|
||||||
|
* @param original 原始字符串
|
||||||
|
* @return 移除后的字符串
|
||||||
|
*/
|
||||||
|
public static String removeLastOccurrence(String original, String suffix) {
|
||||||
|
// 查找位置
|
||||||
|
if (original.endsWith(suffix)) {
|
||||||
|
return original.substring(0, original.length() - suffix.length());
|
||||||
|
}
|
||||||
|
return original;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 生成唯一的订单号
|
||||||
|
*
|
||||||
|
* @param prefix 前缀(例如:"PG")
|
||||||
|
* @param length 订单号中随机部分的总长度(不包括前缀)
|
||||||
|
* @return 生成的唯一订单号
|
||||||
|
*/
|
||||||
|
public static String generateOrderId(String prefix, int length) {
|
||||||
|
if (length <= prefix.length()) {
|
||||||
|
throw new IllegalArgumentException("订单号长度必须大于前缀长度");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前时间戳
|
||||||
|
long timestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// 使用UUID生成一个随机的字符串并去掉 "-"
|
||||||
|
String randomString = UUID.randomUUID().toString().replace("-", "");
|
||||||
|
|
||||||
|
// 拼接时间戳和随机字符串
|
||||||
|
String source = prefix + timestamp + randomString;
|
||||||
|
|
||||||
|
// 截取指定长度的部分(确保符合需求的长度)
|
||||||
|
String orderId = getMD5Hash(source).substring(0, length - prefix.length());
|
||||||
|
|
||||||
|
return prefix + orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用MD5算法生成哈希值
|
||||||
|
*
|
||||||
|
* @param source 输入字符串
|
||||||
|
* @return 哈希值
|
||||||
|
*/
|
||||||
|
private static String getMD5Hash(String source) {
|
||||||
|
try {
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] digest = md.digest(source.getBytes());
|
||||||
|
StringBuilder hexString = new StringBuilder();
|
||||||
|
|
||||||
|
// 转换为16进制
|
||||||
|
for (byte b : digest) {
|
||||||
|
String hex = Integer.toHexString(0xFF & b);
|
||||||
|
if (hex.length() == 1) {
|
||||||
|
hexString.append('0');
|
||||||
|
}
|
||||||
|
hexString.append(hex);
|
||||||
|
}
|
||||||
|
return hexString.toString(); // 返回32位MD5哈希
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.ff.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误代码
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/02/19
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum ErrorCode {
|
||||||
|
ERROR(500, "业务异常"),
|
||||||
|
GAME_ACCOUNT_CREATION_FAILED(1001, "当前游戏账号已存在"),
|
||||||
|
ACCOUNT_NOT_EXIST(1002, "当前游戏账号不存在"),
|
||||||
|
PLATFORM_NOT_EXIST(1003, "游戏平台不存在"),
|
||||||
|
CURRENCY_NOT_EXIST(1004, "游戏平台不支持的货币"),
|
||||||
|
GAME_NOT_EXIST(1005, "游戏不存在"),
|
||||||
|
CURRENCY_EXCHANGE(1006, "不支持币种的汇率"),
|
||||||
|
FREQUENT_INTERFACE_REQUESTS(1007, "接口请求频繁"),
|
||||||
|
BALANCE_TRANSFER_FAILED(1008, "余额转移失败"),
|
||||||
|
LANG_NOT_EXIST(1009, "游戏平台不支持的语言"),
|
||||||
|
ORDER_NOT_EXIST(1010, "订单不存在"),
|
||||||
|
PLAYERS_ARE_PLAYING(1011, "玩家游玩中"),
|
||||||
|
INSUFFICIENT_PLAYER_BALANCE(1012, "玩家余额不足"),
|
||||||
|
KICK_OUT_AILED(1013, "玩家踢出失败"),
|
||||||
|
ACCOUNT_NOT_ONLINE(1014, "账号不在线"),
|
||||||
|
FREQUENT_BALANCE_TRANSFER(1015, "当前游戏账号余额转移频繁"),
|
||||||
|
PLATFORM_NOT_METHODS(1016, "游戏平台不支持的方法"),
|
||||||
|
Create_Member_Failure(1017, "创建会员失败"),
|
||||||
|
Transfer_In_Failure(1018, "转入失败"),
|
||||||
|
Transfer_Out_Failure(1019, "转出失败"),
|
||||||
|
Get_Member_Info_Failure(1020, "获取会员信息失败"),
|
||||||
|
Transfer_Not_Exist(1021, "转帐操作不存在"),
|
||||||
|
Get_Url_Failure(1022, "获取URL失败"),
|
||||||
|
Miss_Config(1023, "缺少配置"),
|
||||||
|
;
|
||||||
|
|
||||||
|
// 获取错误码
|
||||||
|
private final int code;
|
||||||
|
// 获取错误信息
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
// 构造函数
|
||||||
|
ErrorCode(int code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按代码查找系统
|
||||||
|
*
|
||||||
|
* @param code 代码
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
public static String findByCode(Integer code) {
|
||||||
|
Optional<String> system = Stream.of(ErrorCode.values())
|
||||||
|
.filter(errorCode -> errorCode.getCode() == code)
|
||||||
|
.map(ErrorCode::getMessage)
|
||||||
|
.findFirst();
|
||||||
|
return system.orElse(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.ff.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台类型
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/03/25
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PlatformType {
|
||||||
|
ELECTRONIC(1, "电子"),
|
||||||
|
CARD_GAME(2, "棋牌"),
|
||||||
|
GAME_HALL(3, "游戏大厅"),
|
||||||
|
FISHING(4, "捕鱼"),
|
||||||
|
BETTING_MACHINE(5, "押分机 (含宾果)"),
|
||||||
|
VIDEO(6, "视讯"),
|
||||||
|
LOTTERY(7, "彩票"),
|
||||||
|
SPORTS(8, "体育"),
|
||||||
|
HUNTING(9, "捕猎"),
|
||||||
|
BaiRen(10, "百人场");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.ff.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态类型
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/03/12
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum StatusType {
|
||||||
|
IN_PROGRESS(0, "进行中"),
|
||||||
|
SUCCESS(1, "成功"),
|
||||||
|
FAILURE(2, "失败");
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
StatusType(Integer value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.service;
|
package com.ff.agent.service;
|
||||||
|
|
||||||
|
import com.ff.agent.domain.TenantAgentCommission;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.agent.domain.TenantAgentCommission;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理佣金管理 Service接口
|
* 代理佣金管理 Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.service;
|
package com.ff.agent.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台邀请注册成本管理Service接口
|
* 平台邀请注册成本管理Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.service;
|
package com.ff.agent.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentInvite;
|
import com.ff.agent.domain.TenantAgentInvite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理邀请链接Service接口
|
* 代理邀请链接Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.agent.service;
|
package com.ff.agent.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理申请提现审批管理Service接口
|
* 代理申请提现审批管理Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
package com.ff.agent.service.impl;
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentCommission;
|
||||||
|
import com.ff.agent.mapper.TenantAgentCommissionMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentCommissionService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.agent.mapper.TenantAgentCommissionMapper;
|
|
||||||
import com.ff.agent.domain.TenantAgentCommission;
|
import java.math.BigDecimal;
|
||||||
import com.ff.agent.service.ITenantAgentCommissionService;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理佣金管理 Service业务层处理
|
* 代理佣金管理 Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package com.ff.agent.service.impl;
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
||||||
|
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.agent.mapper.TenantAgentInvitePlatformMapper;
|
|
||||||
import com.ff.agent.domain.TenantAgentInvitePlatform;
|
import java.util.List;
|
||||||
import com.ff.agent.service.ITenantAgentInvitePlatformService;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
package com.ff.agent.service.impl;
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.agent.domain.TenantAgentInviteRegister;
|
import com.ff.agent.domain.TenantAgentInviteRegister;
|
||||||
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
import com.ff.agent.dto.TenantAgentInviteRegisterDTO;
|
||||||
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
|
import com.ff.agent.mapper.TenantAgentInviteRegisterMapper;
|
||||||
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
import com.ff.agent.service.ITenantAgentInviteRegisterService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.uuid.IdUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理邀请注册Service业务层处理
|
* 代理邀请注册Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
package com.ff.agent.service.impl;
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentInvite;
|
||||||
|
import com.ff.agent.mapper.TenantAgentInviteMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentInviteService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.NumberUtils;
|
import com.ff.base.utils.NumberUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
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;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代理邀请链接Service业务层处理
|
* 代理邀请链接Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package com.ff.agent.service.impl;
|
package com.ff.agent.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.domain.TenantAgentWithdrawal;
|
||||||
|
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
|
||||||
|
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.agent.mapper.TenantAgentWithdrawalMapper;
|
|
||||||
import com.ff.agent.domain.TenantAgentWithdrawal;
|
import java.util.List;
|
||||||
import com.ff.agent.service.ITenantAgentWithdrawalService;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.Currency;
|
import com.ff.common.domain.Currency;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种Service接口
|
* 币种Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.Lang;
|
import com.ff.common.domain.Lang;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统语种管理 Service接口
|
* 系统语种管理 Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.TenantAgentPlatform;
|
import com.ff.common.domain.TenantAgentPlatform;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台利润成本管理Service接口
|
* 平台利润成本管理Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户游戏额度流水Service接口
|
* 租户游戏额度流水Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.ff.agent.dto.AgentCreateTenantDTO;
|
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
import com.ff.common.dto.BalanceChangesDTO;
|
||||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||||
import com.ff.common.dto.GameBalanceExchange;
|
import com.ff.common.dto.GameBalanceExchange;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户游戏配额Service接口
|
* 租户游戏配额Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.ff.common.service;
|
package com.ff.common.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.common.domain.TenantQuotaExchange;
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种汇率Service接口
|
* 币种汇率Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.common.domain.Currency;
|
||||||
|
import com.ff.common.mapper.CurrencyMapper;
|
||||||
|
import com.ff.common.service.ICurrencyService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.common.mapper.CurrencyMapper;
|
|
||||||
import com.ff.common.domain.Currency;
|
import java.util.List;
|
||||||
import com.ff.common.service.ICurrencyService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种Service业务层处理
|
* 币种Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.common.domain.Lang;
|
||||||
|
import com.ff.common.mapper.LangMapper;
|
||||||
|
import com.ff.common.service.ILangService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.common.mapper.LangMapper;
|
|
||||||
import com.ff.common.domain.Lang;
|
import java.util.List;
|
||||||
import com.ff.common.service.ILangService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统语种管理 Service业务层处理
|
* 系统语种管理 Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.common.domain.TenantAgentPlatform;
|
||||||
|
import com.ff.tenant.mapper.TenantAgentPlatformMapper;
|
||||||
|
import com.ff.common.service.ITenantAgentPlatformService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.common.mapper.TenantAgentPlatformMapper;
|
|
||||||
import com.ff.common.domain.TenantAgentPlatform;
|
import java.util.List;
|
||||||
import com.ff.common.service.ITenantAgentPlatformService;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
|
import com.ff.tenant.mapper.TenantGameQuotaFlowMapper;
|
||||||
|
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.common.mapper.TenantGameQuotaFlowMapper;
|
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
import java.math.BigDecimal;
|
||||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户游戏额度流水Service业务层处理
|
* 租户游戏额度流水Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import com.ff.common.domain.TenantQuotaExchange;
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
import com.ff.common.dto.BalanceChangesDTO;
|
||||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||||
import com.ff.common.dto.GameBalanceExchange;
|
import com.ff.common.dto.GameBalanceExchange;
|
||||||
import com.ff.common.mapper.TenantGameQuotaMapper;
|
import com.ff.tenant.mapper.TenantGameQuotaMapper;
|
||||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
|
import com.ff.tenant.mapper.TenantQuotaExchangeMapper;
|
||||||
|
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.common.mapper.TenantQuotaExchangeMapper;
|
|
||||||
import com.ff.common.domain.TenantQuotaExchange;
|
import java.util.List;
|
||||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种汇率Service业务层处理
|
* 币种汇率Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
package com.ff.game.service;
|
package com.ff.game.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.ff.game.domain.Game;
|
|
||||||
import com.ff.game.domain.GameBettingDetails;
|
import com.ff.game.domain.GameBettingDetails;
|
||||||
import com.ff.game.dto.GameBettingDetailsDTO;
|
import com.ff.game.dto.GameBettingDetailsDTO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员投注细目Service接口
|
* 会员投注细目Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
package com.ff.game.service;
|
package com.ff.game.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.ff.game.domain.GameBettingDetails;
|
|
||||||
import com.ff.game.domain.GameExchangeMoney;
|
import com.ff.game.domain.GameExchangeMoney;
|
||||||
import com.ff.game.dto.GameExchangeMoneyDTO;
|
import com.ff.game.dto.GameExchangeMoneyDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员金额转移记录Service接口
|
* 会员金额转移记录Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.game.service;
|
package com.ff.game.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.game.domain.GameFreeRecord;
|
import com.ff.game.domain.GameFreeRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 免费赠送游戏记录Service接口
|
* 免费赠送游戏记录Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.game.domain.GameBettingDetails;
|
||||||
import com.ff.game.dto.GameBettingDetailsDTO;
|
import com.ff.game.dto.GameBettingDetailsDTO;
|
||||||
|
import com.ff.game.mapper.GameBettingDetailsMapper;
|
||||||
|
import com.ff.game.service.IGameBettingDetailsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.game.mapper.GameBettingDetailsMapper;
|
|
||||||
import com.ff.game.domain.GameBettingDetails;
|
import java.util.List;
|
||||||
import com.ff.game.service.IGameBettingDetailsService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员投注细目Service业务层处理
|
* 会员投注细目Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,18 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.enums.GamePlatforms;
|
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
|
import com.ff.game.domain.GameExchangeMoney;
|
||||||
import com.ff.game.dto.GameExchangeMoneyDTO;
|
import com.ff.game.dto.GameExchangeMoneyDTO;
|
||||||
|
import com.ff.game.mapper.GameExchangeMoneyMapper;
|
||||||
|
import com.ff.game.service.IGameExchangeMoneyService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.game.mapper.GameExchangeMoneyMapper;
|
|
||||||
import com.ff.game.domain.GameExchangeMoney;
|
|
||||||
import com.ff.game.service.IGameExchangeMoneyService;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员金额转移记录Service业务层处理
|
* 会员金额转移记录Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.game.domain.GameFreeRecord;
|
||||||
|
import com.ff.game.mapper.GameFreeRecordMapper;
|
||||||
|
import com.ff.game.service.IGameFreeRecordService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.game.mapper.GameFreeRecordMapper;
|
|
||||||
import com.ff.game.domain.GameFreeRecord;
|
import java.util.List;
|
||||||
import com.ff.game.service.IGameFreeRecordService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 免费赠送游戏记录Service业务层处理
|
* 免费赠送游戏记录Service业务层处理
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import com.ff.base.constant.CacheConstants;
|
import com.ff.base.constant.CacheConstants;
|
||||||
|
import com.ff.base.core.redis.RedisCache;
|
||||||
import com.ff.base.datasource.DynamicDataSourceContextHolder;
|
import com.ff.base.datasource.DynamicDataSourceContextHolder;
|
||||||
import com.ff.game.domain.Platform;
|
import com.ff.game.domain.Platform;
|
||||||
import com.ff.game.mapper.PlatformMapper;
|
import com.ff.game.mapper.PlatformMapper;
|
||||||
import com.ff.game.service.IPlatformService;
|
import com.ff.game.service.IPlatformService;
|
||||||
import com.ff.redis.GRedisCache;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -21,10 +21,8 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PlatformMapper platformMapper;
|
PlatformMapper platformMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
GRedisCache gRedisCache;
|
RedisCache redisCache;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Platform> selectList(Platform platform) {
|
public List<Platform> selectList(Platform platform) {
|
||||||
|
|
@ -65,14 +63,14 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
DynamicDataSourceContextHolder.setDataSourceType(key.toString());
|
DynamicDataSourceContextHolder.setDataSourceType(key.toString());
|
||||||
List<Platform> list = selectList(new Platform());
|
List<Platform> list = selectList(new Platform());
|
||||||
for (Platform pp : list) {
|
for (Platform pp : list) {
|
||||||
gRedisCache.setCacheObject(getCacheKey(pp.getPlatformCode()), pp);
|
redisCache.setCacheObject(getCacheKey(pp.getPlatformCode()), pp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Platform get(String platformCode) {
|
public Platform get(String platformCode) {
|
||||||
return gRedisCache.getCacheObject(getCacheKey(platformCode));
|
return redisCache.getCacheObject(getCacheKey(platformCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCacheKey(String configKey) {
|
private String getCacheKey(String configKey) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.member.service;
|
package com.ff.member.service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.member.domain.Member;
|
import com.ff.member.domain.Member;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员Service接口
|
* 会员Service接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
package com.ff.member.service.impl;
|
package com.ff.member.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.enums.GamePlatforms;
|
import com.ff.base.enums.GamePlatforms;
|
||||||
import com.ff.base.enums.PlatformType;
|
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.RandomGeneratorUtils;
|
import com.ff.base.utils.RandomGeneratorUtils;
|
||||||
|
import com.ff.member.domain.Member;
|
||||||
|
import com.ff.member.mapper.MemberMapper;
|
||||||
|
import com.ff.member.service.IMemberService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.member.mapper.MemberMapper;
|
|
||||||
import com.ff.member.domain.Member;
|
|
||||||
import com.ff.member.service.IMemberService;
|
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员Service业务层处理
|
* 会员Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ff.common.mapper.TenantAgentPlatformMapper">
|
<mapper namespace="com.ff.tenant.mapper.TenantAgentPlatformMapper">
|
||||||
|
|
||||||
<resultMap type="TenantAgentPlatform" id="TenantAgentPlatformResult">
|
<resultMap type="TenantAgentPlatform" id="TenantAgentPlatformResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ff.common.mapper.TenantGameQuotaFlowMapper">
|
<mapper namespace="com.ff.tenant.mapper.TenantGameQuotaFlowMapper">
|
||||||
<resultMap type="TenantGameQuotaFlow" id="TenantGameQuotaFlowResult">
|
<resultMap type="TenantGameQuotaFlow" id="TenantGameQuotaFlowResult">
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="tenantKey" column="tenant_key"/>
|
<result property="tenantKey" column="tenant_key"/>
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue