update 后台管理系统出入账接口问题修复

This commit is contained in:
yyb
2025-08-27 15:03:11 +08:00
parent f8264b2df1
commit 981838726c
10 changed files with 164 additions and 50 deletions

View File

@@ -3371,7 +3371,9 @@ public class DataTask {
List<UserPowerDto> userMhsList = poolMapper.getUserTodayTotalPower("enx", nowStr);
HashMap<String,BigDecimal> map = new HashMap<>();
userMhsList.stream().forEach(e ->{
map.put(e.getUser(),e.getMhs().divide(poolMhs,8,BigDecimal.ROUND_HALF_UP));
if(poolMhs != BigDecimal.ZERO){
map.put(e.getUser(),e.getMhs().divide(poolMhs,8, RoundingMode.HALF_UP));
}
});
if(map.size() >0){
@@ -3943,7 +3945,9 @@ public class DataTask {
List<UserPowerDto> userMhsList = poolMapper.getUserTodayTotalPower("alph", nowStr);
HashMap<String,BigDecimal> map = new HashMap<>();
userMhsList.stream().forEach(e ->{
map.put(e.getUser(),e.getMhs().divide(poolMhs,8,BigDecimal.ROUND_HALF_UP));
if(poolMhs != BigDecimal.ZERO){
map.put(e.getUser(),e.getMhs().divide(poolMhs,8, RoundingMode.HALF_UP));
}
});
if(map.size() >0){

View File

@@ -72,7 +72,7 @@ public class OffLineNoticeTask {
if(StringUtils.isNotEmpty(list)){
//list不为空才处理
//先获取通知列表
//先获取通知列表 TODO 这里查询notice_info为空,notice_info 里面存的从哪里来?
List<NoticeMinerCoinListDto> nmcList = noticeMapper.getNoticeEmailListByMinerAndCoin(list, Pools.NEXA.getCoin());
System.out.println("查询到离线通知列表"+nmcList);
Map<String, List<String>> userEmails = nmcList.stream().
@@ -83,7 +83,7 @@ public class OffLineNoticeTask {
if(StringUtils.isNotEmpty(userEmails)){
//获取上一次离线矿机数 可能为null 要做处理 如果没有redis记录 则上次离线数设置为0 若有redis但是key没有此挖矿账户也设置上次离线数为0
//获取上一次离线矿机数 可能为null 要做处理 如果没有redis记录 则上次离线数设置为0 若有redis但是key没有此挖矿账户也设置上次离线数为0 TODO 这里也没看到redis里面存储的位置
Map<String, Long> map = redisService.getCacheMap("NEXA_USERS_OFFLINE");
list.stream().forEach(e -> {
long lastOff = 0;

View File

@@ -10,6 +10,7 @@ import org.springframework.http.HttpHeaders;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -42,10 +43,13 @@ public class SocketDemo {
//Date endDate = DateUtils.getPreviousHalfHourOrFullHour(new Date());
//Date startDate = DateUtils.getOneMonthAgo(endDate);
//System.out.println(startDate+" "+endDate);
String textToTranslate = "<p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"84072040\" _msthash=\"1610\">API 中 coin 字段可目前仅取值支持nexa</span></p><p _msthidden=\"3\"><span id=\"step\"></span></p><h3 style=\"text-align: start;\" _msttexthash=\"11282648\" _msthash=\"1609\">矿池信息</h3><h3 style=\"text-align: start;\" _msthidden=\"3\"><span style=\"font-size: 16px;\" _msttexthash=\"11308739\" _msthash=\"1608\">公共结构</span></h3><p style=\"text-align: start;\" _msthidden=\"3\"><strong _msttexthash=\"7939243\" _msthash=\"1607\">哈希率</strong></p><p style=\"text-align: start;\" _msttexthash=\"11425713\" _msthash=\"1606\">算力数据</p><p style=\"text-align: start;\" _msthidden=\"3\"><br/></p><table style=\"width: auto;\" _msthidden=\"3\"><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"120\" _msttexthash=\"5204511\" _msthash=\"1596\">名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99.03\" _msttexthash=\"5230641\" _msthash=\"1597\">类型</th><th colspan=\"1\" rowspan=\"1\" width=\"117\" style=\"text-align: center;\" _msttexthash=\"4973501\" _msthash=\"1598\">备注</th><th colspan=\"1\" rowspan=\"1\" width=\"186\" style=\"text-align: center;\" _msttexthash=\"7093697\" _msthash=\"1599\">解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5119231\" _msthash=\"1600\">日期</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"5119231\" _msthash=\"1601\">日期</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"23246444\" _msthash=\"1602\">算力统计时间</td></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5078437\" _msthash=\"1603\">算力</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"1952132\" _msthash=\"1604\">双</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5078437\" _msthash=\"1605\">算力</font><br/></td></tr></tbody></table><p _msthidden=\"3\"><span id=\"MinersList\"></span></p><p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"10586056\" _msthash=\"1595\">矿工名单</span></p><p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"20870291\" _msthash=\"1594\">矿工数量数据</span></p><table style=\"width: auto;\" _msthidden=\"3\"><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"148.7\" style=\"text-align: center;\" _msttexthash=\"5204511\" _msthash=\"1581\">名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99\" style=\"text-align: center;\" _msttexthash=\"5230641\" _msthash=\"1582\">类型</th><th colspan=\"1\" rowspan=\"1\" width=\"111\" style=\"text-align: center;\" _msttexthash=\"4973501\" _msthash=\"1583\">备注</th><th colspan=\"1\" rowspan=\"1\" width=\"153\" style=\"text-align: center;\" _msttexthash=\"7093697\" _msthash=\"1584\">解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"2241785\" _msthash=\"1585\">总</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"5064124\" _msthash=\"1586\">整数</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\">"; // 替换为实际要翻译的文本
String apiKey = ""; // 替换为实际的 API 密钥
String response = translate(textToTranslate, apiKey);
System.out.println(response);
//String textToTranslate = "<p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"84072040\" _msthash=\"1610\">API 中 coin 字段可目前仅取值支持nexa</span></p><p _msthidden=\"3\"><span id=\"step\"></span></p><h3 style=\"text-align: start;\" _msttexthash=\"11282648\" _msthash=\"1609\">矿池信息</h3><h3 style=\"text-align: start;\" _msthidden=\"3\"><span style=\"font-size: 16px;\" _msttexthash=\"11308739\" _msthash=\"1608\">公共结构</span></h3><p style=\"text-align: start;\" _msthidden=\"3\"><strong _msttexthash=\"7939243\" _msthash=\"1607\">哈希率</strong></p><p style=\"text-align: start;\" _msttexthash=\"11425713\" _msthash=\"1606\">算力数据</p><p style=\"text-align: start;\" _msthidden=\"3\"><br/></p><table style=\"width: auto;\" _msthidden=\"3\"><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"120\" _msttexthash=\"5204511\" _msthash=\"1596\">名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99.03\" _msttexthash=\"5230641\" _msthash=\"1597\">类型</th><th colspan=\"1\" rowspan=\"1\" width=\"117\" style=\"text-align: center;\" _msttexthash=\"4973501\" _msthash=\"1598\">备注</th><th colspan=\"1\" rowspan=\"1\" width=\"186\" style=\"text-align: center;\" _msttexthash=\"7093697\" _msthash=\"1599\">解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5119231\" _msthash=\"1600\">日期</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"5119231\" _msthash=\"1601\">日期</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"23246444\" _msthash=\"1602\">算力统计时间</td></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5078437\" _msthash=\"1603\">算力</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"1952132\" _msthash=\"1604\">双</font><br/></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\"></td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\"><font _mstmutation=\"1\" _msttexthash=\"5078437\" _msthash=\"1605\">算力</font><br/></td></tr></tbody></table><p _msthidden=\"3\"><span id=\"MinersList\"></span></p><p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"10586056\" _msthash=\"1595\">矿工名单</span></p><p _msthidden=\"3\"><span style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);\" _msttexthash=\"20870291\" _msthash=\"1594\">矿工数量数据</span></p><table style=\"width: auto;\" _msthidden=\"3\"><tbody><tr><th colspan=\"1\" rowspan=\"1\" width=\"148.7\" style=\"text-align: center;\" _msttexthash=\"5204511\" _msthash=\"1581\">名称</th><th colspan=\"1\" rowspan=\"1\" width=\"99\" style=\"text-align: center;\" _msttexthash=\"5230641\" _msthash=\"1582\">类型</th><th colspan=\"1\" rowspan=\"1\" width=\"111\" style=\"text-align: center;\" _msttexthash=\"4973501\" _msthash=\"1583\">备注</th><th colspan=\"1\" rowspan=\"1\" width=\"153\" style=\"text-align: center;\" _msttexthash=\"7093697\" _msthash=\"1584\">解释</th></tr><tr><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"2241785\" _msthash=\"1585\">总</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\" style=\"text-align: center;\" _msttexthash=\"5064124\" _msthash=\"1586\">整数</td><td colspan=\"1\" rowspan=\"1\" width=\"auto\">"; // 替换为实际要翻译的文本
//String apiKey = ""; // 替换为实际的 API 密钥
//String response = translate(textToTranslate, apiKey);
//System.out.println(response);
System.out.println(LocalDateTime.now().toLocalDate().atStartOfDay());
}

View File

@@ -157,7 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
user_miner_account a
left join user_account_balance b on a.id = b.ma_id
where
`user` = #{user}
`user` = #{user} and coin != 'enx'
and a.status = 0
and b.status = 0
</select>