update 管理系统用户算力曲线,在离线柱状图
This commit is contained in:
parent
0b2decafc9
commit
5a8e59336a
|
@ -5,9 +5,7 @@ import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
import com.m2pool.common.security.annotation.Logical;
|
import com.m2pool.common.security.annotation.Logical;
|
||||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||||
import com.m2pool.common.security.annotation.RequiresRoles;
|
import com.m2pool.common.security.annotation.RequiresRoles;
|
||||||
import com.m2pool.manage.dto.ManageBroadcastDto;
|
import com.m2pool.manage.dto.*;
|
||||||
import com.m2pool.manage.dto.ManageUserDto;
|
|
||||||
import com.m2pool.manage.dto.ManageUserInfoDto;
|
|
||||||
import com.m2pool.manage.service.ManageUserService;
|
import com.m2pool.manage.service.ManageUserService;
|
||||||
import com.m2pool.manage.vo.*;
|
import com.m2pool.manage.vo.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
@ -18,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 管理系统用户信息控制器类
|
* @Description 管理系统用户信息控制器类
|
||||||
|
@ -45,8 +44,8 @@ public class ManageUserController {
|
||||||
@ApiOperation(value = "管理系统:发送邮件给某些用户")
|
@ApiOperation(value = "管理系统:发送邮件给某些用户")
|
||||||
@RequiresLogin
|
@RequiresLogin
|
||||||
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
public void sendTextMailMessage(@RequestBody EmailVo emailVo){
|
public R<String> sendTextMailMessage(@RequestBody EmailVo emailVo){
|
||||||
manageUserService.sendTextMailMessage(emailVo.getTo(),emailVo.getSubject(),emailVo.getText());
|
return manageUserService.sendTextMailMessage(emailVo.getTo(),emailVo.getSubject(),emailVo.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/get/user/info")
|
@PostMapping("/get/user/info")
|
||||||
|
@ -57,6 +56,31 @@ public class ManageUserController {
|
||||||
return manageUserService.getUserInfo(manageUserInfoVo);
|
return manageUserService.getUserInfo(manageUserInfoVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getMiningUserInfo")
|
||||||
|
@ApiOperation(value = "管理系统:根据用户邮箱查询用户对应的挖矿账户及币种信息")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<List<ManageMiningUserDto>> getMiningUserInfo(@RequestBody ManageMiningUserVo manageMiningUserVo){
|
||||||
|
return manageUserService.getMiningUserInfo(manageMiningUserVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getMiningPowerInfo")
|
||||||
|
@ApiOperation(value = "管理系统:根据币种,挖矿账户,时间,查询用户算力曲线")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<List<ManageMiningUserPowerDto>> getMiningPowerInfo(@RequestBody ManageMiningUserPowerVo manageMiningUserPowerVo){
|
||||||
|
return manageUserService.getMiningPowerInfo(manageMiningUserPowerVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getMinerUserOnlineStatus")
|
||||||
|
@ApiOperation(value = "管理系统:获取挖矿账户对应的矿工在离线情况")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<List<ManageMiningUserOnlineDto>> getMinerUserOnlineStatus(@RequestBody ManageMiningUserPowerVo manageMiningUserPowerVo){
|
||||||
|
return manageUserService.getMinerUserOnlineStatus(manageMiningUserPowerVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 历史支付地址详情
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "HistoryBalanceDto", description = "历史支付地址详情")
|
||||||
|
public class HistoryBalanceDto {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "历史支付地址",example = "testAddBalanceForgrs")
|
||||||
|
private String balance;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 用户请求对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "用户挖矿账户详情请求对象")
|
||||||
|
public class ManageMiningUserDto {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名(邮箱)",example = "1328642438@qq.com",required = true)
|
||||||
|
private String user;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户对应的挖矿账号(一个用户可以对应多个)",example = "miner",required = true)
|
||||||
|
private String minerUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "币种",example = "nexa",required = true)
|
||||||
|
private String coin;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 矿工在离线返回对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "矿工在离线返回对象")
|
||||||
|
public class ManageMiningUserOnlineDto {
|
||||||
|
|
||||||
|
//@ApiModelProperty(value = "挖矿账户",example = "a1xsminer",required = true)
|
||||||
|
//private String minerUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间",example = "2025-06-27 16:30:00",required = true)
|
||||||
|
private LocalDateTime date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在线数量",example = "15")
|
||||||
|
private Integer onlineNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "离线数量",example = "10")
|
||||||
|
private Integer offlineNum;
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 用户请求对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "用户挖矿账户详情请求对象")
|
||||||
|
public class ManageMiningUserPowerDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "挖矿账户",example = "miner")
|
||||||
|
private String minerUser;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时间",example = "2024-11-28T11:00:00")
|
||||||
|
private Date date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "算力",example = "0.000000000")
|
||||||
|
private BigDecimal pv;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "算力单位",example = "GH/s")
|
||||||
|
private String unit;
|
||||||
|
}
|
|
@ -3,11 +3,15 @@ package com.m2pool.manage.dto;
|
||||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.apache.catalina.LifecycleState;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 查询用户详情信息放回对象
|
* @Description 查询用户详情信息放回对象
|
||||||
|
@ -16,6 +20,8 @@ import java.time.LocalDateTime;
|
||||||
*/
|
*/
|
||||||
@Builder
|
@Builder
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "ManageUserInfoDto", description = "查询用户详情信息放回对象")
|
@ApiModel(value = "ManageUserInfoDto", description = "查询用户详情信息放回对象")
|
||||||
public class ManageUserInfoDto {
|
public class ManageUserInfoDto {
|
||||||
|
|
||||||
|
@ -29,10 +35,10 @@ public class ManageUserInfoDto {
|
||||||
@ApiModelProperty(value = "转账地址",example = "D7tviVPKtTd2qnkzJEVfZWQqzV6NyQqHxw")
|
@ApiModelProperty(value = "转账地址",example = "D7tviVPKtTd2qnkzJEVfZWQqzV6NyQqHxw")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@ApiModelProperty(value = "交易创建时间",example = "2025-06-16 00:00:00")
|
@ApiModelProperty(value = "收益分配日期",example = "2025-06-16 00:00:00")
|
||||||
private LocalDateTime createDate;
|
private LocalDateTime createDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "",example = "2025-06-16 00:00:00")
|
@ApiModelProperty(value = "实际转账日期",example = "2025-06-16 00:00:00")
|
||||||
private LocalDateTime shouldOutDate;
|
private LocalDateTime shouldOutDate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "最大高度",example = "100000")
|
@ApiModelProperty(value = "最大高度",example = "100000")
|
||||||
|
@ -40,4 +46,9 @@ public class ManageUserInfoDto {
|
||||||
|
|
||||||
@ApiModelProperty(value = "交易金额",example = " 273920.9666238700")
|
@ApiModelProperty(value = "交易金额",example = " 273920.9666238700")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "历史支付地址",example = "")
|
||||||
|
private List<HistoryBalanceDto> historyBalance;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,15 @@ package com.m2pool.manage.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.m2pool.common.datasource.annotation.DistributionDB;
|
import com.m2pool.common.datasource.annotation.DistributionDB;
|
||||||
import com.m2pool.manage.dto.ManageUserDto;
|
import com.m2pool.common.datasource.annotation.HashRateDB;
|
||||||
import com.m2pool.manage.dto.ManageUserInfoDto;
|
import com.m2pool.manage.dto.*;
|
||||||
import com.m2pool.manage.entity.ManageBroadcast;
|
import com.m2pool.manage.entity.ManageBroadcast;
|
||||||
import com.m2pool.manage.vo.ManageBaseVo;
|
import com.m2pool.manage.vo.ManageBaseVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
@ -32,4 +34,50 @@ public interface ManageBroadcastMapper extends BaseMapper<ManageBroadcast> {
|
||||||
*/
|
*/
|
||||||
@DistributionDB
|
@DistributionDB
|
||||||
ManageUserInfoDto getUserInfo(@Param("user") String user,@Param("coin") String coin);
|
ManageUserInfoDto getUserInfo(@Param("user") String user,@Param("coin") String coin);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取挖矿账户对应的历史支付地址
|
||||||
|
* @param user
|
||||||
|
* @param coin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<HistoryBalanceDto> getHistoryBalance(@Param("user") String user, @Param("coin") String coin);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户对应的挖矿账户及币种信息
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageMiningUserDto> getMiningUserInfo(@Param("user") String user);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户算力曲线
|
||||||
|
* @param minerUser
|
||||||
|
* @param coin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageMiningUserPowerDto> getMiningPowerInfo(@Param("minerUser") String minerUser, @Param("coin") String coin, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户对应的所有挖矿账户
|
||||||
|
* @param user
|
||||||
|
* @param coin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getAllMinerUserByCoin(@Param("user") String user,@Param("coin") String coin);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取挖矿账户对应时间段的在离线情况
|
||||||
|
* @param minerUser
|
||||||
|
* @param coin
|
||||||
|
* @param startDate
|
||||||
|
* @param endDate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@HashRateDB
|
||||||
|
List<ManageMiningUserOnlineDto> getMinerUserOnlineStatus(@Param("minerUser") String minerUser, @Param("coin") String coin, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,11 @@ package com.m2pool.manage.service;
|
||||||
|
|
||||||
import com.m2pool.common.core.Result.R;
|
import com.m2pool.common.core.Result.R;
|
||||||
import com.m2pool.common.core.web.page.TableDataInfo;
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
import com.m2pool.manage.dto.ManageUserDto;
|
import com.m2pool.manage.dto.*;
|
||||||
import com.m2pool.manage.dto.ManageUserInfoDto;
|
import com.m2pool.manage.vo.*;
|
||||||
import com.m2pool.manage.vo.ManageUserInfoVo;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import com.m2pool.manage.vo.ManageUserVo;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,7 +27,7 @@ public interface ManageUserService{
|
||||||
* @param subject
|
* @param subject
|
||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
void sendTextMailMessage(String to,String subject,String text);
|
R<String> sendTextMailMessage(String to,String subject,String text);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,4 +36,27 @@ public interface ManageUserService{
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
R<ManageUserInfoDto> getUserInfo(ManageUserInfoVo manageUserInfoVo);
|
R<ManageUserInfoDto> getUserInfo(ManageUserInfoVo manageUserInfoVo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理系统:查询用户对应的挖矿账户及币种信息
|
||||||
|
* @param manageMiningUserVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<List<ManageMiningUserDto>> getMiningUserInfo(ManageMiningUserVo manageMiningUserVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理系统:用户算力曲线
|
||||||
|
* @param manageMiningUserPowerVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<List<ManageMiningUserPowerDto>> getMiningPowerInfo(ManageMiningUserPowerVo manageMiningUserPowerVo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理系统:获取挖矿账户对应的矿工在离线情况
|
||||||
|
* @param manageMiningUserPowerVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<List<ManageMiningUserOnlineDto>> getMinerUserOnlineStatus(ManageMiningUserPowerVo manageMiningUserPowerVo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,24 +4,25 @@ import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.m2pool.common.core.Result.R;
|
import com.m2pool.common.core.Result.R;
|
||||||
import com.m2pool.common.core.constant.HttpStatus;
|
import com.m2pool.common.core.constant.HttpStatus;
|
||||||
|
import com.m2pool.common.core.utils.StringUtils;
|
||||||
import com.m2pool.common.core.web.page.TableDataInfo;
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
import com.m2pool.manage.dto.ManageBroadcastDto;
|
import com.m2pool.manage.dto.*;
|
||||||
import com.m2pool.manage.dto.ManageUserDto;
|
|
||||||
import com.m2pool.manage.dto.ManageUserInfoDto;
|
|
||||||
import com.m2pool.manage.mapper.ManageBroadcastMapper;
|
import com.m2pool.manage.mapper.ManageBroadcastMapper;
|
||||||
import com.m2pool.manage.service.ManageUserService;
|
import com.m2pool.manage.service.ManageUserService;
|
||||||
import com.m2pool.manage.vo.ManageBaseVo;
|
import com.m2pool.manage.utils.PowerUnitUtils;
|
||||||
import com.m2pool.manage.vo.ManageUserInfoVo;
|
import com.m2pool.manage.vo.*;
|
||||||
import com.m2pool.manage.vo.ManageUserVo;
|
|
||||||
import com.m2pool.manage.vo.PageVo;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,17 +59,23 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[\\w-.]+@([\\w-]+\\.)+[\\w-]{2,4}$");
|
||||||
@Override
|
@Override
|
||||||
public void sendTextMailMessage(String to,String subject,String text){
|
public R<String> sendTextMailMessage(String to,String subject,String text){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//true 代表支持复杂的类型
|
//true 代表支持复杂的类型
|
||||||
MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(javaMailSender.createMimeMessage(),true);
|
MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(javaMailSender.createMimeMessage(),true);
|
||||||
//邮件发信人
|
//邮件发信人
|
||||||
mimeMessageHelper.setFrom(sendMailer);
|
mimeMessageHelper.setFrom(sendMailer);
|
||||||
|
String[] split = to.split("[,;;,\\s]+");
|
||||||
|
for (String s : split) {
|
||||||
|
if (!EMAIL_PATTERN.matcher(s).matches()) {
|
||||||
|
return R.fail("邮箱格式错误"+s);
|
||||||
|
}
|
||||||
|
}
|
||||||
//邮件收信人 1或多个
|
//邮件收信人 1或多个
|
||||||
mimeMessageHelper.setTo(to.split(","));
|
mimeMessageHelper.setTo(split);
|
||||||
|
|
||||||
//邮件主题
|
//邮件主题
|
||||||
mimeMessageHelper.setSubject(subject);
|
mimeMessageHelper.setSubject(subject);
|
||||||
//邮件内容
|
//邮件内容
|
||||||
|
@ -79,9 +86,10 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||||
//发送邮件
|
//发送邮件
|
||||||
javaMailSender.send(mimeMessageHelper.getMimeMessage());
|
javaMailSender.send(mimeMessageHelper.getMimeMessage());
|
||||||
//System.out.println("发送邮件成功:"+sendMailer+"->"+to);
|
//System.out.println("发送邮件成功:"+sendMailer+"->"+to);
|
||||||
|
return R.success("发送成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
return R.fail("发送失败"+e.getMessage());
|
||||||
//System.out.println("发送邮件失败:"+e.getMessage());
|
//System.out.println("发送邮件失败:"+e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +97,110 @@ public class ManageUserServiceImpl implements ManageUserService {
|
||||||
@Override
|
@Override
|
||||||
public R<ManageUserInfoDto> getUserInfo(ManageUserInfoVo manageUserInfoVo) {
|
public R<ManageUserInfoDto> getUserInfo(ManageUserInfoVo manageUserInfoVo) {
|
||||||
ManageUserInfoDto manageUserInfoDto = manageBroadcastMapper.getUserInfo(manageUserInfoVo.getMinerUser(), manageUserInfoVo.getCoin());
|
ManageUserInfoDto manageUserInfoDto = manageBroadcastMapper.getUserInfo(manageUserInfoVo.getMinerUser(), manageUserInfoVo.getCoin());
|
||||||
|
List<HistoryBalanceDto> historyBalance = manageBroadcastMapper.getHistoryBalance(manageUserInfoVo.getMinerUser(), manageUserInfoVo.getCoin());
|
||||||
|
if (manageUserInfoDto == null && !historyBalance.isEmpty()){
|
||||||
|
manageUserInfoDto = new ManageUserInfoDto();
|
||||||
|
manageUserInfoDto.setUser(manageUserInfoVo.getMinerUser());
|
||||||
|
manageUserInfoDto.setCoin(manageUserInfoVo.getCoin());
|
||||||
|
manageUserInfoDto.setHistoryBalance(historyBalance);
|
||||||
|
}else if(manageUserInfoDto !=null && !historyBalance.isEmpty()){
|
||||||
|
manageUserInfoDto.setHistoryBalance(historyBalance);
|
||||||
|
}
|
||||||
|
|
||||||
return R.success(manageUserInfoDto);
|
return R.success(manageUserInfoDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<ManageMiningUserDto>> getMiningUserInfo(ManageMiningUserVo manageMiningUserVo) {
|
||||||
|
List<ManageMiningUserDto> miningUserInfo = manageBroadcastMapper.getMiningUserInfo(manageMiningUserVo.getUser());
|
||||||
|
return R.success(miningUserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<ManageMiningUserPowerDto>> getMiningPowerInfo(ManageMiningUserPowerVo manageMiningUserPowerVo) {
|
||||||
|
List<ManageMiningUserPowerDto> list = manageBroadcastMapper.getMiningPowerInfo(manageMiningUserPowerVo.getMinerUser()
|
||||||
|
, manageMiningUserPowerVo.getCoin(), manageMiningUserPowerVo.getStartDate(), manageMiningUserPowerVo.getEndDate());
|
||||||
|
ManageMiningUserPowerDto maxPv = list.stream().max(Comparator.comparing(ManageMiningUserPowerDto::getPv)).orElse(new ManageMiningUserPowerDto());
|
||||||
|
PowerUnitUtils.NetPowerUnit powerUnit;
|
||||||
|
if (!list.isEmpty()){
|
||||||
|
powerUnit = PowerUnitUtils.getPowerUnit(maxPv.getPv().multiply(BigDecimal.valueOf(1000 * 1000)));
|
||||||
|
}else{
|
||||||
|
powerUnit = new PowerUnitUtils.NetPowerUnit("GH/S", BigDecimal.valueOf(1000 * 1000 * 1000));
|
||||||
|
}
|
||||||
|
changeUnit(powerUnit, list,BigDecimal.valueOf(1000 * 1000));
|
||||||
|
list = fillMissingData(list,powerUnit.getUnit(),manageMiningUserPowerVo.getMinerUser());
|
||||||
|
return R.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位转换
|
||||||
|
* @param netPowerUnit
|
||||||
|
* @param list
|
||||||
|
* @param factor
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void changeUnit(PowerUnitUtils.NetPowerUnit netPowerUnit, List<ManageMiningUserPowerDto> list,BigDecimal factor) {
|
||||||
|
list.forEach(e -> {
|
||||||
|
if(StringUtils.isNotNull(e.getPv())){
|
||||||
|
e.setUnit(netPowerUnit.getUnit());
|
||||||
|
e.setPv(e.getPv().multiply(factor).divide(netPowerUnit.getUnitValue(),2, RoundingMode.HALF_UP).stripTrailingZeros());
|
||||||
|
}else {
|
||||||
|
e.setUnit(netPowerUnit.getUnit());
|
||||||
|
e.setPv(BigDecimal.valueOf(0));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据补零 30分钟时间端
|
||||||
|
* @param dataList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<ManageMiningUserPowerDto> fillMissingData(List<ManageMiningUserPowerDto> dataList,String unit,String minerUser) {
|
||||||
|
if (dataList == null || dataList.size() <= 1) {
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对数据按时间排序
|
||||||
|
dataList.sort(Comparator.comparing(ManageMiningUserPowerDto::getDate));
|
||||||
|
|
||||||
|
List<ManageMiningUserPowerDto> resultList = new ArrayList<>();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
|
// 获取起始和结束时间
|
||||||
|
Date startTime = dataList.get(0).getDate();
|
||||||
|
Date endTime = dataList.get(dataList.size() - 1).getDate();
|
||||||
|
|
||||||
|
calendar.setTime(startTime);
|
||||||
|
Map<Long, ManageMiningUserPowerDto> timeDataMap = new HashMap<>();
|
||||||
|
for (ManageMiningUserPowerDto data : dataList) {
|
||||||
|
timeDataMap.put(data.getDate().getTime(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (calendar.getTime().getTime() <= endTime.getTime()) {
|
||||||
|
long currentTime = calendar.getTime().getTime();
|
||||||
|
ManageMiningUserPowerDto data = timeDataMap.get(currentTime);
|
||||||
|
if (data != null) {
|
||||||
|
resultList.add(data);
|
||||||
|
} else {
|
||||||
|
resultList.add(new ManageMiningUserPowerDto(minerUser,calendar.getTime(), BigDecimal.valueOf(0), unit));
|
||||||
|
}
|
||||||
|
// 增加 30 分钟
|
||||||
|
calendar.add(Calendar.MINUTE, 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<ManageMiningUserOnlineDto>> getMinerUserOnlineStatus(ManageMiningUserPowerVo manageMiningUserPowerVo) {
|
||||||
|
//查询挖矿账户对应的所有矿工在离线情况
|
||||||
|
List<ManageMiningUserOnlineDto> minerUserOnlineStatus = manageBroadcastMapper.getMinerUserOnlineStatus(
|
||||||
|
manageMiningUserPowerVo.getMinerUser(),
|
||||||
|
manageMiningUserPowerVo.getCoin(),
|
||||||
|
manageMiningUserPowerVo.getStartDate(),
|
||||||
|
manageMiningUserPowerVo.getEndDate());
|
||||||
|
return R.success(minerUserOnlineStatus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.m2pool.manage.utils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 算力转换
|
||||||
|
* @Date 2024/6/13 10:54
|
||||||
|
* @Author dy
|
||||||
|
*/
|
||||||
|
public class PowerUnitUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取某个算力值 对应应该换算的单位 和单位符号值
|
||||||
|
* @param value
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static NetPowerUnit getPowerUnit(BigDecimal value){
|
||||||
|
NetPowerUnit unit = new NetPowerUnit();
|
||||||
|
//默认1K 以下
|
||||||
|
unit.setUnit("H/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1));
|
||||||
|
if (value != null){
|
||||||
|
//ps BigDecimal最大上限少于1000*1000*1000*1000*10 所以需要中间值 gValue
|
||||||
|
BigDecimal gValue = value.divide(BigDecimal.valueOf(1000000000), 2, RoundingMode.HALF_UP);
|
||||||
|
if (gValue.compareTo(BigDecimal.valueOf(1000L *1000*1000*10)) >= 0){
|
||||||
|
//10E
|
||||||
|
unit.setUnit("EH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000L*1000*1000*1000*1000*1000));
|
||||||
|
}
|
||||||
|
else if (gValue.compareTo(BigDecimal.valueOf(1000*1000*10)) >= 0){
|
||||||
|
//10P -10E
|
||||||
|
|
||||||
|
unit.setUnit("PH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000L*1000*1000*1000*1000));
|
||||||
|
}
|
||||||
|
else if (gValue.compareTo(BigDecimal.valueOf(1000 * 10)) >= 0){
|
||||||
|
//10 T - 10P
|
||||||
|
unit.setUnit("TH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000L*1000*1000*1000));
|
||||||
|
}
|
||||||
|
else if (value.compareTo(BigDecimal.valueOf(1000L *1000*1000 * 10)) >= 0){
|
||||||
|
//10G - 10T
|
||||||
|
unit.setUnit("GH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000L*1000*1000));
|
||||||
|
}
|
||||||
|
else if (value.compareTo(BigDecimal.valueOf(1000*1000*10)) >= 0){
|
||||||
|
//10M - 10G
|
||||||
|
unit.setUnit("MH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000L*1000));
|
||||||
|
}
|
||||||
|
else if (value.compareTo(BigDecimal.valueOf(1000 * 10)) >= 0){
|
||||||
|
//10K-10M
|
||||||
|
unit.setUnit("KH/s");
|
||||||
|
unit.setUnitValue(BigDecimal.valueOf(1000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class NetPowerUnit{
|
||||||
|
private String unit;
|
||||||
|
private BigDecimal unitValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.m2pool.manage.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 用户请求对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "ManageMiningUserPowerVo")
|
||||||
|
public class ManageMiningUserPowerVo {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "挖矿账户",example = "miner",required = true)
|
||||||
|
private String minerUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "币种",example = "nexa",required = true)
|
||||||
|
private String coin;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "开始时间",example = "2025-06-22")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "结束时间",example = "2025-06-22")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.m2pool.manage.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 用户请求对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "用户挖矿账户详情请求对象")
|
||||||
|
public class ManageMiningUserVo{
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名(邮箱)",example = "1328642438@qq.com",required = true)
|
||||||
|
private String user;
|
||||||
|
}
|
|
@ -2,8 +2,10 @@ package com.m2pool.manage.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 查询用户详情信请求对象
|
* @Description 查询用户详情信请求对象
|
||||||
|
@ -12,6 +14,8 @@ import lombok.Data;
|
||||||
*/
|
*/
|
||||||
@Builder
|
@Builder
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "ManageUserInfoVo", description = "查询用户详情信请求对象")
|
@ApiModel(value = "ManageUserInfoVo", description = "查询用户详情信请求对象")
|
||||||
public class ManageUserInfoVo {
|
public class ManageUserInfoVo {
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,42 @@ server:
|
||||||
mime-types: application/json
|
mime-types: application/json
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
#邮箱基本配置
|
||||||
|
mail:
|
||||||
|
# 配置在limit_time内,用户可以发送limit次验证码
|
||||||
|
limit: 2 这个是我额外的配置,结合邮箱服务用的
|
||||||
|
limitTime: 10 这个是我额外的配置
|
||||||
|
#配置smtp服务主机地址
|
||||||
|
# sina smtp.sina.cn
|
||||||
|
# aliyun smtp.aliyun.com
|
||||||
|
# 163 smtp.163.com 端口号465或994
|
||||||
|
host: mail.privateemail.com
|
||||||
|
#发送者邮箱
|
||||||
|
username: do.not.reply@m2pool.com
|
||||||
|
#配置密码,注意不是真正的密码,而是刚刚申请到的授权码
|
||||||
|
# password:
|
||||||
|
# password: M2202401!
|
||||||
|
# password: axvm-zfgx-cgcg-qhhu
|
||||||
|
password: M2202401!
|
||||||
|
|
||||||
|
#端口号
|
||||||
|
port: 587
|
||||||
|
# port: 465
|
||||||
|
#默认的邮件编码为UTF-8
|
||||||
|
default-encoding: UTF-8
|
||||||
|
#其他参数
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
#配置SSL 加密工厂
|
||||||
|
smtp:
|
||||||
|
ssl:
|
||||||
|
#本地测试,先放开ssl
|
||||||
|
enable: false
|
||||||
|
required: false
|
||||||
|
#开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误
|
||||||
|
debug: false
|
||||||
|
socketFactory:
|
||||||
|
class: javax.net.ssl.SSLSocketFactory
|
||||||
mvc:
|
mvc:
|
||||||
pathmatch:
|
pathmatch:
|
||||||
matching-strategy: ant-path-matcher
|
matching-strategy: ant-path-matcher
|
||||||
|
@ -20,7 +56,7 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8808
|
server-addr: 127.0.0.1:8808
|
||||||
namespace: m2_test
|
namespace: m2_prod
|
||||||
group: m2_prod_group
|
group: m2_prod_group
|
||||||
# server-addr: 127.0.0.1:8808
|
# server-addr: 127.0.0.1:8808
|
||||||
config:
|
config:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
user_account_balance uab
|
user_account_balance uab
|
||||||
LEFT JOIN user_miner_account uma ON uab.ma_id = uma.id
|
LEFT JOIN user_miner_account uma ON uab.ma_id = uma.id
|
||||||
<where>
|
<where>
|
||||||
uma.coin = #{coin} AND uma.status = 0
|
uma.coin = #{coin} AND uma.status = 0 AND uab.status = 0
|
||||||
<if test="user != null and user != ''">
|
<if test="user != null and user != ''">
|
||||||
AND uma.user like CONCAT('%',#{user},'%')
|
AND uma.user like CONCAT('%',#{user},'%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -46,4 +46,57 @@
|
||||||
AND `user` = #{user};
|
AND `user` = #{user};
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getHistoryBalance" resultType="com.m2pool.manage.dto.HistoryBalanceDto">
|
||||||
|
SELECT
|
||||||
|
uab.balance
|
||||||
|
FROM
|
||||||
|
user_account_balance uab
|
||||||
|
LEFT JOIN user_miner_account uma ON uab.ma_id = uma.id
|
||||||
|
WHERE
|
||||||
|
uma.coin = #{coin} AND uma.miner_user=#{user} AND uab.status = 99
|
||||||
|
</select>
|
||||||
|
<select id="getMiningUserInfo" resultType="com.m2pool.manage.dto.ManageMiningUserDto">
|
||||||
|
SELECT
|
||||||
|
coin,
|
||||||
|
`user`,
|
||||||
|
miner_user as minerUser
|
||||||
|
FROM
|
||||||
|
user_miner_account
|
||||||
|
WHERE
|
||||||
|
`user` = #{user} and status = 0
|
||||||
|
</select>
|
||||||
|
<select id="getMiningPowerInfo" resultType="com.m2pool.manage.dto.ManageMiningUserPowerDto">
|
||||||
|
SELECT
|
||||||
|
`user` as minerUser,
|
||||||
|
`date`,
|
||||||
|
mhs as pv
|
||||||
|
FROM
|
||||||
|
${coin}_users_30m
|
||||||
|
<where>
|
||||||
|
`user` = #{minerUser}
|
||||||
|
<if test="startDate != null and endDate != null">
|
||||||
|
and `date` >= #{startDate} AND `date`<![CDATA[ <= ]]> #{endDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="getMinerUserOnlineStatus" resultType="com.m2pool.manage.dto.ManageMiningUserOnlineDto">
|
||||||
|
select
|
||||||
|
`date`,
|
||||||
|
sum(case when `state` = "online" then 1 else 0 end) as onlineNum,
|
||||||
|
sum(case when `state` = "offline" then 1 else 0 end) as offlineNum
|
||||||
|
from
|
||||||
|
${coin}_mhsv2
|
||||||
|
<where>
|
||||||
|
`user` = #{minerUser}
|
||||||
|
<if test="startDate != null and endDate != null">
|
||||||
|
and `date` >= #{startDate} AND `date`<![CDATA[ <= ]]> #{endDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by `date`
|
||||||
|
</select>
|
||||||
|
<select id="getAllMinerUserByCoin" resultType="java.lang.String">
|
||||||
|
select miner_user from user_miner_account where coin = #{coin} and `user` = #{user} and status = 0;
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
server:
|
||||||
|
port: 9207
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/json
|
||||||
|
|
||||||
|
spring:
|
||||||
|
#邮箱基本配置
|
||||||
|
mail:
|
||||||
|
# 配置在limit_time内,用户可以发送limit次验证码
|
||||||
|
limit: 2 这个是我额外的配置,结合邮箱服务用的
|
||||||
|
limitTime: 10 这个是我额外的配置
|
||||||
|
#配置smtp服务主机地址
|
||||||
|
# sina smtp.sina.cn
|
||||||
|
# aliyun smtp.aliyun.com
|
||||||
|
# 163 smtp.163.com 端口号465或994
|
||||||
|
host: mail.privateemail.com
|
||||||
|
#发送者邮箱
|
||||||
|
username: support@m2pool.cc
|
||||||
|
#配置密码,注意不是真正的密码,而是刚刚申请到的授权码
|
||||||
|
# password:
|
||||||
|
# password: m2pool2024@!
|
||||||
|
# password: axvm-zfgx-cgcg-qhhu
|
||||||
|
password: m2pool2024@!
|
||||||
|
#端口号
|
||||||
|
port: 587
|
||||||
|
#默认的邮件编码为UTF-8
|
||||||
|
default-encoding: UTF-8
|
||||||
|
#其他参数
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
#配置SSL 加密工厂
|
||||||
|
smtp:
|
||||||
|
ssl:
|
||||||
|
#本地测试,先放开ssl
|
||||||
|
enable: false
|
||||||
|
required: false
|
||||||
|
#开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误
|
||||||
|
debug: false
|
||||||
|
socketFactory:
|
||||||
|
class: javax.net.ssl.SSLSocketFactory
|
||||||
|
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: m2pool-oapi
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 127.0.0.1:8808
|
||||||
|
namespace: m2_prod
|
||||||
|
group: m2_prod_group
|
||||||
|
# server-addr: 127.0.0.1:8808
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 127.0.0.1:8808
|
||||||
|
# server-addr: 127.0.0.1:8808
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
namespace: m2_prod
|
||||||
|
group: m2_prod_group
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 2MB
|
||||||
|
max-request-size: 8MB
|
||||||
|
|
||||||
|
myenv:
|
||||||
|
domain: https://www.m2pool.com
|
||||||
|
path: /var/www/html/web
|
||||||
|
img: /img
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
|
||||||
|
|
||||||
|
##测试环境
|
||||||
|
server:
|
||||||
|
port: 9507
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/json
|
||||||
|
|
||||||
|
spring:
|
||||||
|
#邮箱基本配置
|
||||||
|
mail:
|
||||||
|
# 配置在limit_time内,用户可以发送limit次验证码
|
||||||
|
limit: 2 这个是我额外的配置,结合邮箱服务用的
|
||||||
|
limitTime: 10 这个是我额外的配置
|
||||||
|
#配置smtp服务主机地址
|
||||||
|
# sina smtp.sina.cn
|
||||||
|
# aliyun smtp.aliyun.com
|
||||||
|
# 163 smtp.163.com 端口号465或994
|
||||||
|
host: mail.privateemail.com
|
||||||
|
#发送者邮箱
|
||||||
|
username: support@m2pool.cc
|
||||||
|
#配置密码,注意不是真正的密码,而是刚刚申请到的授权码
|
||||||
|
# password:
|
||||||
|
# password: m2pool2024@!
|
||||||
|
# password: axvm-zfgx-cgcg-qhhu
|
||||||
|
password: m2pool2024@!
|
||||||
|
#端口号
|
||||||
|
port: 587
|
||||||
|
#默认的邮件编码为UTF-8
|
||||||
|
default-encoding: UTF-8
|
||||||
|
#其他参数
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
#配置SSL 加密工厂
|
||||||
|
smtp:
|
||||||
|
ssl:
|
||||||
|
#本地测试,先放开ssl
|
||||||
|
enable: false
|
||||||
|
required: false
|
||||||
|
#开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误
|
||||||
|
debug: false
|
||||||
|
socketFactory:
|
||||||
|
class: javax.net.ssl.SSLSocketFactory
|
||||||
|
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: m2pool-oapi
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 127.0.0.1:8808
|
||||||
|
namespace: m2_test
|
||||||
|
group: m2_test_group
|
||||||
|
# server-addr: 127.0.0.1:8808
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 127.0.0.1:8808
|
||||||
|
# server-addr: 127.0.0.1:8808
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
namespace: m2_test
|
||||||
|
group: m2_test_group
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 2MB
|
||||||
|
max-request-size: 8MB
|
||||||
|
|
||||||
|
myenv:
|
||||||
|
domain: https://test.m2pool.com
|
||||||
|
path: /var/www/html/web_test
|
||||||
|
img: /img
|
||||||
|
|
|
@ -1,156 +1,4 @@
|
||||||
server:
|
|
||||||
port: 9207
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
mime-types: application/json
|
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
#邮箱基本配置
|
|
||||||
mail:
|
|
||||||
# 配置在limit_time内,用户可以发送limit次验证码
|
|
||||||
limit: 2 这个是我额外的配置,结合邮箱服务用的
|
|
||||||
limitTime: 10 这个是我额外的配置
|
|
||||||
#配置smtp服务主机地址
|
|
||||||
# sina smtp.sina.cn
|
|
||||||
# aliyun smtp.aliyun.com
|
|
||||||
# 163 smtp.163.com 端口号465或994
|
|
||||||
host: mail.privateemail.com
|
|
||||||
#发送者邮箱
|
|
||||||
username: support@m2pool.cc
|
|
||||||
#配置密码,注意不是真正的密码,而是刚刚申请到的授权码
|
|
||||||
# password:
|
|
||||||
# password: m2pool2024@!
|
|
||||||
# password: axvm-zfgx-cgcg-qhhu
|
|
||||||
password: m2pool2024@!
|
|
||||||
#端口号
|
|
||||||
port: 587
|
|
||||||
#默认的邮件编码为UTF-8
|
|
||||||
default-encoding: UTF-8
|
|
||||||
#其他参数
|
|
||||||
properties:
|
|
||||||
mail:
|
|
||||||
#配置SSL 加密工厂
|
|
||||||
smtp:
|
|
||||||
ssl:
|
|
||||||
#本地测试,先放开ssl
|
|
||||||
enable: false
|
|
||||||
required: false
|
|
||||||
#开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误
|
|
||||||
debug: false
|
|
||||||
socketFactory:
|
|
||||||
class: javax.net.ssl.SSLSocketFactory
|
|
||||||
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: m2pool-oapi
|
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: prod
|
active: test
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: 127.0.0.1:8808
|
|
||||||
namespace: m2_prod
|
|
||||||
group: m2_prod_group
|
|
||||||
# server-addr: 127.0.0.1:8808
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: 127.0.0.1:8808
|
|
||||||
# server-addr: 127.0.0.1:8808
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
namespace: m2_prod
|
|
||||||
group: m2_prod_group
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 2MB
|
|
||||||
max-request-size: 8MB
|
|
||||||
|
|
||||||
myenv:
|
|
||||||
domain: https://www.m2pool.com
|
|
||||||
path: /var/www/html/web
|
|
||||||
img: /img
|
|
||||||
|
|
||||||
|
|
||||||
##测试环境
|
|
||||||
#server:
|
|
||||||
# port: 9507
|
|
||||||
# compression:
|
|
||||||
# enabled: true
|
|
||||||
# mime-types: application/json
|
|
||||||
#
|
|
||||||
#spring:
|
|
||||||
# #邮箱基本配置
|
|
||||||
# mail:
|
|
||||||
# # 配置在limit_time内,用户可以发送limit次验证码
|
|
||||||
# limit: 2 这个是我额外的配置,结合邮箱服务用的
|
|
||||||
# limitTime: 10 这个是我额外的配置
|
|
||||||
# #配置smtp服务主机地址
|
|
||||||
# # sina smtp.sina.cn
|
|
||||||
# # aliyun smtp.aliyun.com
|
|
||||||
# # 163 smtp.163.com 端口号465或994
|
|
||||||
# host: mail.privateemail.com
|
|
||||||
# #发送者邮箱
|
|
||||||
# username: support@m2pool.cc
|
|
||||||
# #配置密码,注意不是真正的密码,而是刚刚申请到的授权码
|
|
||||||
# # password:
|
|
||||||
# # password: m2pool2024@!
|
|
||||||
# # password: axvm-zfgx-cgcg-qhhu
|
|
||||||
# password: m2pool2024@!
|
|
||||||
# #端口号
|
|
||||||
# port: 587
|
|
||||||
# #默认的邮件编码为UTF-8
|
|
||||||
# default-encoding: UTF-8
|
|
||||||
# #其他参数
|
|
||||||
# properties:
|
|
||||||
# mail:
|
|
||||||
# #配置SSL 加密工厂
|
|
||||||
# smtp:
|
|
||||||
# ssl:
|
|
||||||
# #本地测试,先放开ssl
|
|
||||||
# enable: false
|
|
||||||
# required: false
|
|
||||||
# #开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误
|
|
||||||
# debug: false
|
|
||||||
# socketFactory:
|
|
||||||
# class: javax.net.ssl.SSLSocketFactory
|
|
||||||
#
|
|
||||||
# application:
|
|
||||||
# # 应用名称
|
|
||||||
# name: m2pool-oapi
|
|
||||||
# profiles:
|
|
||||||
# # 环境配置
|
|
||||||
# active: test
|
|
||||||
# cloud:
|
|
||||||
# nacos:
|
|
||||||
# discovery:
|
|
||||||
# # 服务注册地址
|
|
||||||
# server-addr: 127.0.0.1:8808
|
|
||||||
# namespace: m2_test
|
|
||||||
# group: m2_test_group
|
|
||||||
# # server-addr: 127.0.0.1:8808
|
|
||||||
# config:
|
|
||||||
# # 配置中心地址
|
|
||||||
# server-addr: 127.0.0.1:8808
|
|
||||||
# # server-addr: 127.0.0.1:8808
|
|
||||||
# # 配置文件格式
|
|
||||||
# file-extension: yml
|
|
||||||
# # 共享配置
|
|
||||||
# shared-configs:
|
|
||||||
# - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
# namespace: m2_test
|
|
||||||
# group: m2_test_group
|
|
||||||
# servlet:
|
|
||||||
# multipart:
|
|
||||||
# max-file-size: 2MB
|
|
||||||
# max-request-size: 8MB
|
|
||||||
#
|
|
||||||
#myenv:
|
|
||||||
# domain: https://test.m2pool.com
|
|
||||||
# path: /var/www/html/web_test
|
|
||||||
# img: /img
|
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ public class PoolServiceImpl implements PoolService {
|
||||||
|
|
||||||
//全网算力 调用转换工具 动态转换为数值+单位
|
//全网算力 调用转换工具 动态转换为数值+单位
|
||||||
dto.setTotalPower(PowerUnitUtils.powerFormat(info.getPower(),pool.getCoin()));
|
dto.setTotalPower(PowerUnitUtils.powerFormat(info.getPower(),pool.getCoin()));
|
||||||
|
dto.setHeight(info.getHeight());
|
||||||
//System.out.println("dto"+dto);
|
//System.out.println("dto"+dto);
|
||||||
}else {
|
}else {
|
||||||
System.out.println("未能从节点获取到信息");
|
System.out.println("未能从节点获取到信息");
|
||||||
|
@ -109,7 +110,7 @@ public class PoolServiceImpl implements PoolService {
|
||||||
|
|
||||||
BigDecimal price = redisService.getCacheObject(pool.getCoin() + "_price");
|
BigDecimal price = redisService.getCacheObject(pool.getCoin() + "_price");
|
||||||
dto.setPrice(price.toEngineeringString()+ " USD");
|
dto.setPrice(price.toEngineeringString()+ " USD");
|
||||||
dto.setHeight(info.getHeight());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//从enums中拿币种名、页面显示名、币种对应算法
|
//从enums中拿币种名、页面显示名、币种对应算法
|
||||||
|
|
|
@ -67,9 +67,12 @@ public class SysProfileController extends BaseController
|
||||||
//隐藏不需要返回前端的信息
|
//隐藏不需要返回前端的信息
|
||||||
SysUserDto userDto = new SysUserDto();
|
SysUserDto userDto = new SysUserDto();
|
||||||
BeanUtils.copyProperties(user,userDto);
|
BeanUtils.copyProperties(user,userDto);
|
||||||
|
SysRole sysRole;
|
||||||
SysRole sysRole = user.getRoles().get(0);
|
try {
|
||||||
|
sysRole = user.getRoles().get(0);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("角色不存在");
|
||||||
|
}
|
||||||
SysRoleDto roleDto = new SysRoleDto();
|
SysRoleDto roleDto = new SysRoleDto();
|
||||||
BeanUtils.copyProperties(sysRole,roleDto);
|
BeanUtils.copyProperties(sysRole,roleDto);
|
||||||
|
|
||||||
|
|
|
@ -255,12 +255,13 @@ public class SysUserServiceImpl implements SysUserService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int updateUser(SysUser user)
|
public int updateUser(SysUser user)
|
||||||
{
|
{
|
||||||
Long userId = user.getUserId();
|
//Long userId = user.getUserId();
|
||||||
|
|
||||||
|
System.out.println("修改用户信息"+user);
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
//userRoleMapper.deleteUserRoleByUserId(userId);
|
||||||
// 新增用户与角色管理 此处要保证传过来的user中要携带roleIds
|
//// 新增用户与角色管理 此处要保证传过来的user中要携带roleIds
|
||||||
insertUserRole(user);
|
//insertUserRole(user);
|
||||||
//// 删除用户与岗位关联
|
//// 删除用户与岗位关联
|
||||||
//userPostMapper.deleteUserPostByUserId(userId);
|
//userPostMapper.deleteUserPostByUserId(userId);
|
||||||
//// 新增用户与岗位管理
|
//// 新增用户与岗位管理
|
||||||
|
|
Loading…
Reference in New Issue