update 新增后台管理系统文档管理模块,以及业务系统帮助中心文档接口。修改首页折线图补零逻辑bug,及管理系统挖矿账户详情页,收支详情修改
This commit is contained in:
parent
0857913e54
commit
b43e8f9965
|
@ -91,6 +91,7 @@ public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoom> i
|
||||||
//1.查询当前用户与对应用户是否已存在创建的聊天室
|
//1.查询当前用户与对应用户是否已存在创建的聊天室
|
||||||
String userEmail = roomVo.getEmail();
|
String userEmail = roomVo.getEmail();
|
||||||
ChatRoomDto roomByUserEmail = chatRoomMapper.findRoomByUserEmail(userEmail);
|
ChatRoomDto roomByUserEmail = chatRoomMapper.findRoomByUserEmail(userEmail);
|
||||||
|
System.out.println("bby-用户邮箱"+roomByUserEmail);
|
||||||
//获取nacos中配置的客服邮箱列表,这个列表中的邮箱实际可能不是客服角色,但能够行驶客服角色功能
|
//获取nacos中配置的客服邮箱列表,这个列表中的邮箱实际可能不是客服角色,但能够行驶客服角色功能
|
||||||
List<String> customerEmails = new ArrayList<>(Arrays.asList(webSocketConfig.getDefaultCustomerEmail().split(",")));
|
List<String> customerEmails = new ArrayList<>(Arrays.asList(webSocketConfig.getDefaultCustomerEmail().split(",")));
|
||||||
int i = random.nextInt(customerEmails.size());
|
int i = random.nextInt(customerEmails.size());
|
||||||
|
@ -149,6 +150,7 @@ public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoom> i
|
||||||
.userOneEmail(userEmail)
|
.userOneEmail(userEmail)
|
||||||
.userTwoEmail(email)
|
.userTwoEmail(email)
|
||||||
.build();
|
.build();
|
||||||
|
try{
|
||||||
int insert = chatRoomMapper.insert(build);
|
int insert = chatRoomMapper.insert(build);
|
||||||
if (insert > 0){
|
if (insert > 0){
|
||||||
return R.success(ChatRoomDto.builder()
|
return R.success(ChatRoomDto.builder()
|
||||||
|
@ -157,6 +159,10 @@ public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoom> i
|
||||||
.customerIsOnline(customerIsOnline)
|
.customerIsOnline(customerIsOnline)
|
||||||
.userEmail(build.getUserTwoEmail()).build());
|
.userEmail(build.getUserTwoEmail()).build());
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
return R.fail("聊天室已存在,创建聊天室失败");
|
||||||
|
}
|
||||||
|
|
||||||
return R.fail("聊天室不存在,并且创建聊天室失败");
|
return R.fail("聊天室不存在,并且创建聊天室失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.m2pool.manage.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 国家常量类
|
||||||
|
* @Date 2025/7/10 14:38
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
public class CountryConstant {
|
||||||
|
|
||||||
|
public static final String ZH = "zh";
|
||||||
|
public static final String EN = "en";
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.m2pool.manage.controller;
|
||||||
|
|
||||||
|
import com.m2pool.common.core.Result.R;
|
||||||
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
|
import com.m2pool.common.security.annotation.Logical;
|
||||||
|
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||||
|
import com.m2pool.common.security.annotation.RequiresRoles;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDocumentDto;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDto;
|
||||||
|
import com.m2pool.manage.dto.ManageDocumentDto;
|
||||||
|
import com.m2pool.manage.service.ManageDocumentsService;
|
||||||
|
import com.m2pool.manage.vo.ManageBaseVo;
|
||||||
|
import com.m2pool.manage.vo.ManageCatalogueVo;
|
||||||
|
import com.m2pool.manage.vo.ManageDocumentVo;
|
||||||
|
import com.m2pool.manage.vo.ManageSearchDocumentVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档信息控制器类
|
||||||
|
* @Date 2025/5/22 14:22
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/documents")
|
||||||
|
@Api(tags = "文档控制器类")
|
||||||
|
public class ManageDocumentsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageDocumentsService manageDocumentsService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getListDataByPage")
|
||||||
|
@ApiOperation(value = "管理系统:分页+条件查询所有的文档 + 业务系统:按关键字搜索文章内容")
|
||||||
|
//@RequiresLogin
|
||||||
|
//@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public TableDataInfo<ManageDocumentDto> getListDataByPage(@RequestBody ManageSearchDocumentVo manageSearchDocumentVo){
|
||||||
|
return manageDocumentsService.getListDataByPage(manageSearchDocumentVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addDocument")
|
||||||
|
@ApiOperation(value = "管理系统:新增文档")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<String> addDocument(@RequestBody ManageDocumentVo manageDocumentVo){
|
||||||
|
return manageDocumentsService.addDocument(manageDocumentVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deleteDocument")
|
||||||
|
@ApiOperation(value = "管理系统:删除文档")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<String> deleteDocument(@RequestBody ManageBaseVo manageBaseVo){
|
||||||
|
return manageDocumentsService.deleteDocument(manageBaseVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateDocument")
|
||||||
|
@ApiOperation(value = "管理系统:修改文档")
|
||||||
|
@RequiresLogin
|
||||||
|
@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<String> updateDocument(@RequestBody ManageDocumentVo manageDocumentVo){
|
||||||
|
return manageDocumentsService.updateDocument(manageDocumentVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/findDataInfo")
|
||||||
|
@ApiOperation(value = "管理系统:获取文档详情,用于编辑修改文档 + 业务系统:根据id获取对应的文档详情内容")
|
||||||
|
//@RequiresLogin
|
||||||
|
//@RequiresRoles(value = {"back_admin","admin"}, logical = Logical.OR)
|
||||||
|
public R<ManageDocumentDto> findDataInfo(@RequestBody ManageBaseVo manageBaseVo){
|
||||||
|
return manageDocumentsService.findDataInfo(manageBaseVo);
|
||||||
|
}
|
||||||
|
//@PostMapping("/findDataById")
|
||||||
|
//@ApiOperation(value = "业务系统:根据id获取对应的文档详情内容")
|
||||||
|
//public R<ManageDocumentDto> findDataById(@RequestBody(required = false) ManageBaseVo manageBaseVo){
|
||||||
|
// return manageDocumentsService.findDataById(manageBaseVo);
|
||||||
|
//}
|
||||||
|
|
||||||
|
@PostMapping("/findCatalogueDocumentList")
|
||||||
|
@ApiOperation(value = "业务系统:获取文档类型对应的文章列表")
|
||||||
|
public R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(@RequestBody ManageCatalogueVo manageCatalogueVo){
|
||||||
|
return manageDocumentsService.findCatalogueDocumentList(manageCatalogueVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/findCatalogueList")
|
||||||
|
@ApiOperation(value = "业务系统:获取文档目录列表 + 管理系统:目录下拉选择框")
|
||||||
|
public R<List<ManageCatalogueDto>> findCatalogueList(@RequestBody ManageCatalogueVo manageCatalogueVo){
|
||||||
|
return manageDocumentsService.findCatalogueList(manageCatalogueVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@PostMapping("/searchDocument")
|
||||||
|
//@ApiOperation(value = "业务系统:按关键字搜索文章内容")
|
||||||
|
//public TableDataInfo<ManageDocumentDto> searchDocument(@RequestBody ManageSearchDocumentVo manageSearchDocumentVo){
|
||||||
|
// return manageDocumentsService.searchDocument(manageSearchDocumentVo);
|
||||||
|
//}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档返回对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "ManageDocumentDto", description = "文档返回对象")
|
||||||
|
public class ManageCatalogueDocumentDto {
|
||||||
|
@ApiModelProperty(value = "id",example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题(中文或英文)",example = "文档标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "副标题(中文或英文)",example = "文档副标题")
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档创建者",example = "文档创建者")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最后一次修改,修改人",example = "146555@qq.com")
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间",example = "2025-05-22 14:22:13")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间",example = "2025-05-22 14:22:13")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||||
|
private Integer type;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档返回对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@ApiModel(value = "ManageCatalogueDto", description = "文档返回对象")
|
||||||
|
public class ManageCatalogueDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型描述",example = "api文档")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档类型",example = "1")
|
||||||
|
private Integer type;
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档返回对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "ManageDocumentDto", description = "文档返回对象")
|
||||||
|
public class ManageDocumentDto {
|
||||||
|
@ApiModelProperty(value = "id",example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题(中文或英文)",example = "文档标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "副标题(中文或英文)",example = "文档副标题")
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容(中文或英文)",example = "文档内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档创建者",example = "文档创建者")
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最后一次修改,修改人",example = "146555@qq.com")
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间",example = "2025-05-22 14:22:13")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间",example = "2025-05-22 14:22:13")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||||
|
private Integer type;
|
||||||
|
}
|
|
@ -1,17 +1,14 @@
|
||||||
package com.m2pool.manage.dto;
|
package com.m2pool.manage.dto;
|
||||||
|
|
||||||
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.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
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 查询用户详情信息放回对象
|
||||||
|
@ -35,8 +32,8 @@ 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 date;
|
||||||
|
|
||||||
@ApiModelProperty(value = "实际转账日期",example = "2025-06-16 00:00:00")
|
@ApiModelProperty(value = "实际转账日期",example = "2025-06-16 00:00:00")
|
||||||
private LocalDateTime shouldOutDate;
|
private LocalDateTime shouldOutDate;
|
||||||
|
@ -44,8 +41,12 @@ public class ManageUserInfoDto {
|
||||||
@ApiModelProperty(value = "最大高度",example = "100000")
|
@ApiModelProperty(value = "最大高度",example = "100000")
|
||||||
private String maxHeight;
|
private String maxHeight;
|
||||||
|
|
||||||
@ApiModelProperty(value = "交易金额",example = " 273920.9666238700")
|
@ApiModelProperty(value = "交易id",example = "0x01")
|
||||||
private BigDecimal amount;
|
private String txId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分配金额",example = " 273920.9666238700")
|
||||||
|
private BigDecimal allocationAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "转账金额",example = " 273920.9666238700")
|
||||||
|
private BigDecimal transferAmount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.m2pool.manage.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 广播信息实体类
|
||||||
|
* @Date 2025/5/22 14:13
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ManageDocuments {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private String contentEn;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String titleEn;
|
||||||
|
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
private String subTitleEn;
|
||||||
|
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
private Boolean del;
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.m2pool.manage.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统文档类型实体类
|
||||||
|
* @Date 2025/5/22 14:13
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ManageDocumentsType {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private String descriptionEn;
|
||||||
|
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
private Boolean del;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.m2pool.manage.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/7/15 15:34
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ManageWalletOutIn {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String coin;
|
||||||
|
|
||||||
|
private String user;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private LocalDateTime date;
|
||||||
|
|
||||||
|
private LocalDateTime shouldOutDate;
|
||||||
|
|
||||||
|
private Integer maxHeight;
|
||||||
|
|
||||||
|
private String txId;
|
||||||
|
|
||||||
|
private BigDecimal allocationAmount;
|
||||||
|
|
||||||
|
|
||||||
|
private BigDecimal transferAmount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -33,7 +33,6 @@ public interface ManageBroadcastMapper extends BaseMapper<ManageBroadcast> {
|
||||||
* @param coin
|
* @param coin
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@DistributionDB
|
|
||||||
List<ManageUserInfoDto> getUserInfo(@Param("user") String user,@Param("coin") String coin, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
List<ManageUserInfoDto> getUserInfo(@Param("user") String user,@Param("coin") String coin, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.m2pool.manage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDocumentDto;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDto;
|
||||||
|
import com.m2pool.manage.dto.ManageDocumentDto;
|
||||||
|
import com.m2pool.manage.entity.ManageDocuments;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ManageDocumentsMapper extends BaseMapper<ManageDocuments> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询所有文档(中文)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageDocumentDto> getListDataByPage(@Param("keyword") String keyword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有文档(英文)
|
||||||
|
* @param keyword
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageDocumentDto> getListDataEnByPage(@Param("keyword") String keyword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有文档类型对应的文章列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageCatalogueDocumentDto> findCatalogueDocumentList(@Param("type") Integer type,@Param("lang") String lang);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询目录列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ManageCatalogueDto> findCatalogueList(@Param("lang") String lang);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.m2pool.manage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.m2pool.common.datasource.annotation.DistributionDB;
|
||||||
|
import com.m2pool.common.datasource.annotation.HashRateDB;
|
||||||
|
import com.m2pool.manage.dto.*;
|
||||||
|
import com.m2pool.manage.entity.ManageBroadcast;
|
||||||
|
import com.m2pool.manage.entity.ManageWalletOutIn;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ManageWalletOutInMapper extends BaseMapper<ManageWalletOutIn> {
|
||||||
|
|
||||||
|
|
||||||
|
@DistributionDB
|
||||||
|
List<ManageWalletOutIn> getWalletInfo(
|
||||||
|
@Param("startDate") LocalDateTime startDate
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.m2pool.manage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.m2pool.common.core.Result.R;
|
||||||
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDocumentDto;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDto;
|
||||||
|
import com.m2pool.manage.dto.ManageDocumentDto;
|
||||||
|
import com.m2pool.manage.entity.ManageDocuments;
|
||||||
|
import com.m2pool.manage.vo.ManageBaseVo;
|
||||||
|
import com.m2pool.manage.vo.ManageCatalogueVo;
|
||||||
|
import com.m2pool.manage.vo.ManageDocumentVo;
|
||||||
|
import com.m2pool.manage.vo.ManageSearchDocumentVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 广播信息 服务接口
|
||||||
|
*/
|
||||||
|
public interface ManageDocumentsService extends IService<ManageDocuments> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统:分页+条件查询所有的文档
|
||||||
|
* @param manageSearchDocumentVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TableDataInfo<ManageDocumentDto> getListDataByPage( ManageSearchDocumentVo manageSearchDocumentVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 业务系统:根据id获取对应的文档详情内容 + 管理系统:根据id获取文档详情,用于编辑修改文档
|
||||||
|
* @param manageBaseVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<ManageDocumentDto> findDataById(ManageBaseVo manageBaseVo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统:新增文档
|
||||||
|
* @param manageDocumentVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<String> addDocument( ManageDocumentVo manageDocumentVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统:删除文档
|
||||||
|
* @param manageBaseVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<String> deleteDocument(ManageBaseVo manageBaseVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统:修改文档
|
||||||
|
* @param manageDocumentVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<String> updateDocument(ManageDocumentVo manageDocumentVo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 管理系统:获取文档详情,用于编辑修改文档
|
||||||
|
* @param manageBaseVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<ManageDocumentDto> findDataInfo( ManageBaseVo manageBaseVo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 业务系统:获取文档目录列表
|
||||||
|
* @param manageCatalogueVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 业务系统:搜索文档
|
||||||
|
* @param manageSearchDocumentVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TableDataInfo<ManageDocumentDto> searchDocument( ManageSearchDocumentVo manageSearchDocumentVo);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 业务系统:获取文档目录列表 + 管理系统:目录下拉选择框
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
R<List<ManageCatalogueDto>> findCatalogueList(ManageCatalogueVo manageCatalogueVo);
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.m2pool.manage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.m2pool.common.core.Result.R;
|
||||||
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
|
import com.m2pool.manage.dto.ManageBroadcastDto;
|
||||||
|
import com.m2pool.manage.entity.ManageBroadcast;
|
||||||
|
import com.m2pool.manage.entity.ManageWalletOutIn;
|
||||||
|
import com.m2pool.manage.vo.ManageBaseVo;
|
||||||
|
import com.m2pool.manage.vo.ManageBroadcastVo;
|
||||||
|
import com.m2pool.manage.vo.PageVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 广播信息 服务接口
|
||||||
|
*/
|
||||||
|
public interface ManageWalletOutInService extends IService<ManageWalletOutIn> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,221 @@
|
||||||
|
package com.m2pool.manage.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.m2pool.common.core.Result.R;
|
||||||
|
import com.m2pool.common.core.constant.HttpStatus;
|
||||||
|
import com.m2pool.common.core.web.page.TableDataInfo;
|
||||||
|
import com.m2pool.common.security.utils.SecurityUtils;
|
||||||
|
import com.m2pool.manage.constant.CountryConstant;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDocumentDto;
|
||||||
|
import com.m2pool.manage.dto.ManageCatalogueDto;
|
||||||
|
import com.m2pool.manage.dto.ManageDocumentDto;
|
||||||
|
import com.m2pool.manage.entity.ManageDocuments;
|
||||||
|
import com.m2pool.manage.mapper.ManageDocumentsMapper;
|
||||||
|
import com.m2pool.manage.service.ManageDocumentsService;
|
||||||
|
import com.m2pool.manage.utils.TranslateUtils;
|
||||||
|
import com.m2pool.manage.vo.ManageBaseVo;
|
||||||
|
import com.m2pool.manage.vo.ManageCatalogueVo;
|
||||||
|
import com.m2pool.manage.vo.ManageDocumentVo;
|
||||||
|
import com.m2pool.manage.vo.ManageSearchDocumentVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档信息 服务器类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ManageDocumentsServiceImpl extends ServiceImpl<ManageDocumentsMapper, ManageDocuments> implements ManageDocumentsService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageDocumentsMapper manageDocumentsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<ManageDocumentDto> getListDataByPage(ManageSearchDocumentVo manageSearchDocumentVo) {
|
||||||
|
PageHelper.startPage(manageSearchDocumentVo.getPageNum(), manageSearchDocumentVo.getPageSize());
|
||||||
|
List<ManageDocumentDto> listDataByPage;
|
||||||
|
if (CountryConstant.EN.equals(manageSearchDocumentVo.getLang())){
|
||||||
|
listDataByPage = manageDocumentsMapper.getListDataByPage(manageSearchDocumentVo.getKeyword());
|
||||||
|
}else{
|
||||||
|
listDataByPage = manageDocumentsMapper.getListDataByPage(manageSearchDocumentVo.getKeyword());
|
||||||
|
}
|
||||||
|
return getDataTable(listDataByPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TableDataInfo<ManageDocumentDto> getDataTable(List<ManageDocumentDto> list)
|
||||||
|
{
|
||||||
|
TableDataInfo<ManageDocumentDto> rspData = new TableDataInfo<ManageDocumentDto>();
|
||||||
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
|
rspData.setRows(list);
|
||||||
|
rspData.setMsg("查询成功");
|
||||||
|
PageInfo<ManageDocumentDto> pageInfo = new PageInfo<ManageDocumentDto>(list);
|
||||||
|
rspData.setTotal(pageInfo.getTotal());
|
||||||
|
rspData.setTotalPage(pageInfo.getPages());
|
||||||
|
PageHelper.clearPage();
|
||||||
|
return rspData;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public R<ManageDocumentDto> findDataById(ManageBaseVo manageBaseVo) {
|
||||||
|
ManageDocuments documents = this.getById(manageBaseVo.getId());
|
||||||
|
ManageDocumentDto build = ManageDocumentDto.builder()
|
||||||
|
.id(documents.getId())
|
||||||
|
.title(documents.getTitle())
|
||||||
|
.subTitle(documents.getSubTitle())
|
||||||
|
.content(documents.getContent())
|
||||||
|
.createUser(documents.getCreateUser())
|
||||||
|
.updateUser(documents.getUpdateUser())
|
||||||
|
.updateTime(documents.getUpdateTime())
|
||||||
|
.createTime(documents.getCreateTime())
|
||||||
|
.build();
|
||||||
|
if (CountryConstant.EN.equals(manageBaseVo.getLang())){
|
||||||
|
build.setTitle(documents.getTitleEn());
|
||||||
|
build.setSubTitle(documents.getSubTitleEn());
|
||||||
|
build.setContent(documents.getContentEn());
|
||||||
|
}
|
||||||
|
return R.success(build);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<String> addDocument(ManageDocumentVo manageDocumentVo) {
|
||||||
|
String fromCountry = CountryConstant.ZH;
|
||||||
|
String toCountry = CountryConstant.EN;
|
||||||
|
ManageDocuments build;
|
||||||
|
//英文转中文
|
||||||
|
if (CountryConstant.EN.equals(manageDocumentVo.getLang())){
|
||||||
|
build = ManageDocuments.builder()
|
||||||
|
.titleEn(manageDocumentVo.getTitle())
|
||||||
|
.subTitleEn(manageDocumentVo.getSubTitle())
|
||||||
|
.contentEn(manageDocumentVo.getContent())
|
||||||
|
.content(TranslateUtils.translate(manageDocumentVo.getContent(), toCountry, fromCountry))
|
||||||
|
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
|
||||||
|
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
|
||||||
|
.type(manageDocumentVo.getType())
|
||||||
|
.createUser(SecurityUtils.getUsername())
|
||||||
|
.updateUser(SecurityUtils.getUsername())
|
||||||
|
.build();
|
||||||
|
}else{
|
||||||
|
//中文转英文
|
||||||
|
build = ManageDocuments.builder()
|
||||||
|
.title(manageDocumentVo.getTitle())
|
||||||
|
.subTitle(manageDocumentVo.getSubTitle())
|
||||||
|
.content(manageDocumentVo.getContent())
|
||||||
|
.type(manageDocumentVo.getType())
|
||||||
|
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
|
||||||
|
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
|
||||||
|
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
|
||||||
|
.createUser(SecurityUtils.getUsername())
|
||||||
|
.updateUser(SecurityUtils.getUsername())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
int insert = manageDocumentsMapper.insert(build);
|
||||||
|
if (insert > 0){
|
||||||
|
return R.success("添加文章成功");
|
||||||
|
}
|
||||||
|
return R.fail("添加文章失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<String> deleteDocument(ManageBaseVo manageBaseVo) {
|
||||||
|
int delete = manageDocumentsMapper.deleteById(manageBaseVo.getId());
|
||||||
|
if (delete > 0){
|
||||||
|
return R.success("删除文章成功");
|
||||||
|
}
|
||||||
|
return R.fail("删除文章失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<String> updateDocument(ManageDocumentVo manageDocumentVo) {
|
||||||
|
String fromCountry = CountryConstant.ZH;
|
||||||
|
String toCountry = CountryConstant.EN;
|
||||||
|
ManageDocuments build;
|
||||||
|
//英文转中文
|
||||||
|
if (CountryConstant.EN.equals(manageDocumentVo.getLang())){
|
||||||
|
build = ManageDocuments.builder()
|
||||||
|
.id(manageDocumentVo.getId())
|
||||||
|
.titleEn(manageDocumentVo.getTitle())
|
||||||
|
.subTitleEn(manageDocumentVo.getSubTitle())
|
||||||
|
.contentEn(manageDocumentVo.getContent())
|
||||||
|
.content(TranslateUtils.translate(manageDocumentVo.getContent(), toCountry, fromCountry))
|
||||||
|
.title(TranslateUtils.translate(manageDocumentVo.getTitle(), toCountry, fromCountry))
|
||||||
|
.subTitle(TranslateUtils.translate(manageDocumentVo.getSubTitle(), toCountry, fromCountry))
|
||||||
|
.createUser(SecurityUtils.getUsername())
|
||||||
|
.updateUser(SecurityUtils.getUsername())
|
||||||
|
.build();
|
||||||
|
}else{
|
||||||
|
//中文转英文
|
||||||
|
build = ManageDocuments.builder()
|
||||||
|
.id(manageDocumentVo.getId())
|
||||||
|
.title(manageDocumentVo.getTitle())
|
||||||
|
.subTitle(manageDocumentVo.getSubTitle())
|
||||||
|
.content(manageDocumentVo.getContent())
|
||||||
|
.contentEn(TranslateUtils.translate(manageDocumentVo.getContent(), fromCountry, toCountry))
|
||||||
|
.titleEn(TranslateUtils.translate(manageDocumentVo.getTitle(), fromCountry, toCountry))
|
||||||
|
.subTitleEn(TranslateUtils.translate(manageDocumentVo.getSubTitle(), fromCountry, toCountry))
|
||||||
|
.createUser(SecurityUtils.getUsername())
|
||||||
|
.updateUser(SecurityUtils.getUsername())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
int insert = manageDocumentsMapper.updateById(build);
|
||||||
|
if (insert > 0){
|
||||||
|
return R.success("修改文章成功");
|
||||||
|
}
|
||||||
|
return R.fail("修改文章失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<ManageDocumentDto> findDataInfo(ManageBaseVo manageBaseVo) {
|
||||||
|
ManageDocuments documents = this.getById(manageBaseVo.getId());
|
||||||
|
ManageDocumentDto build = null;
|
||||||
|
if(documents != null){
|
||||||
|
build = ManageDocumentDto.builder()
|
||||||
|
.id(documents.getId())
|
||||||
|
.title(documents.getTitle())
|
||||||
|
.subTitle(documents.getSubTitle())
|
||||||
|
.content(documents.getContent())
|
||||||
|
.createUser(documents.getCreateUser())
|
||||||
|
.updateUser(documents.getUpdateUser())
|
||||||
|
.updateTime(documents.getUpdateTime())
|
||||||
|
.createTime(documents.getCreateTime())
|
||||||
|
.build();
|
||||||
|
if (CountryConstant.EN.equals(manageBaseVo.getLang())){
|
||||||
|
build.setTitle(documents.getTitleEn());
|
||||||
|
build.setSubTitle(documents.getSubTitleEn());
|
||||||
|
build.setContent(documents.getContentEn());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return R.success(build);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<ManageCatalogueDocumentDto>> findCatalogueDocumentList(ManageCatalogueVo manageCatalogueVo) {
|
||||||
|
|
||||||
|
List<ManageCatalogueDocumentDto> catalogueDocumentList = manageDocumentsMapper.findCatalogueDocumentList(manageCatalogueVo.getType(),manageCatalogueVo.getLang());
|
||||||
|
return R.success(catalogueDocumentList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<ManageDocumentDto> searchDocument(ManageSearchDocumentVo manageSearchDocumentVo) {
|
||||||
|
PageHelper.startPage(manageSearchDocumentVo.getPageNum(), manageSearchDocumentVo.getPageSize());
|
||||||
|
List<ManageDocumentDto> listDataByPage;
|
||||||
|
if (CountryConstant.EN.equals(manageSearchDocumentVo.getLang())){
|
||||||
|
listDataByPage = manageDocumentsMapper.getListDataEnByPage(manageSearchDocumentVo.getKeyword());
|
||||||
|
}else{
|
||||||
|
listDataByPage = manageDocumentsMapper.getListDataByPage(manageSearchDocumentVo.getKeyword());
|
||||||
|
}
|
||||||
|
|
||||||
|
return getDataTable(listDataByPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<List<ManageCatalogueDto>> findCatalogueList(ManageCatalogueVo manageCatalogueVo) {
|
||||||
|
List<ManageCatalogueDto> catalogueList = manageDocumentsMapper.findCatalogueList(manageCatalogueVo.getLang());
|
||||||
|
return R.success(catalogueList);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.m2pool.manage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.m2pool.manage.entity.ManageWalletOutIn;
|
||||||
|
import com.m2pool.manage.mapper.ManageWalletOutInMapper;
|
||||||
|
import com.m2pool.manage.service.ManageWalletOutInService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 广播信息 服务实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ManageWalletOutInServiceImpl extends ServiceImpl<ManageWalletOutInMapper, ManageWalletOutIn> implements ManageWalletOutInService {
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.m2pool.manage.task;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.m2pool.manage.entity.ManageWalletOutIn;
|
||||||
|
import com.m2pool.manage.mapper.ManageWalletOutInMapper;
|
||||||
|
import com.m2pool.manage.service.ManageWalletOutInService;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 后台管理系统 定时任务
|
||||||
|
* @Date 2025/7/15 15:45
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableScheduling
|
||||||
|
public class ManageTask {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageWalletOutInService manageWalletOutInService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ManageWalletOutInMapper manageWalletOutInMapper;
|
||||||
|
|
||||||
|
@Scheduled(cron = "22 21 0/1 * * ?")
|
||||||
|
public void insertDataToWalletOutInDb(){
|
||||||
|
ManageWalletOutIn manageWalletOutIn = manageWalletOutInMapper.selectOne(new LambdaQueryWrapper<ManageWalletOutIn>().orderByDesc(
|
||||||
|
ManageWalletOutIn::getDate
|
||||||
|
).last("limit 1"));
|
||||||
|
LocalDateTime startDate = null;
|
||||||
|
if (manageWalletOutIn != null){
|
||||||
|
startDate = manageWalletOutIn.getDate();
|
||||||
|
}
|
||||||
|
List<ManageWalletOutIn> walletInfo = manageWalletOutInMapper.getWalletInfo(startDate);
|
||||||
|
boolean b = manageWalletOutInService.saveBatch(walletInfo);
|
||||||
|
System.out.println("walletOutIn 插入结果"+b);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,6 @@ public class ManageBaseVo {
|
||||||
@ApiModelProperty(value = "id",example = "1")
|
@ApiModelProperty(value = "id",example = "1")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "语言",example = "zh")
|
@ApiModelProperty(value = "语言",example = "zh")
|
||||||
private String lang;
|
private String lang;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
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 TODO
|
||||||
|
* @Date 2025/7/10 15:39
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ApiModel(value = "ManageCatalogueVo",description = "文档目录请求对象")
|
||||||
|
public class ManageCatalogueVo{
|
||||||
|
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "语言",example = "zh")
|
||||||
|
private String lang;
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.m2pool.manage.vo;
|
||||||
|
|
||||||
|
import com.m2pool.common.core.web.Result.PageResult;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档请求对象
|
||||||
|
* @Date 2025/5/22 17:18
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "ManageDocumentVo",description = "文档请求对象")
|
||||||
|
public class ManageDocumentVo {
|
||||||
|
@ApiModelProperty(value = "id",example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题",example = "文档标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "副标题",example = "文档副标题")
|
||||||
|
private String subTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容",example = "文档内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文档类型",example = "0其他 1服务条款 2api文档 3挖矿教程")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "语言",example = "zh中文 en英文")
|
||||||
|
private String lang;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.m2pool.manage.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 文档搜索请求对象
|
||||||
|
* @Date 2025/7/8 13:35
|
||||||
|
* @Author yyb
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "ManageSearchDocumentVo",description = "文档搜索请求对象")
|
||||||
|
public class ManageSearchDocumentVo extends PageVo{
|
||||||
|
@ApiModelProperty(value = "搜索关键字",example = "挖矿")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "语言",example = "zh")
|
||||||
|
private String lang;
|
||||||
|
}
|
|
@ -34,25 +34,25 @@
|
||||||
coin,
|
coin,
|
||||||
`user`,
|
`user`,
|
||||||
address,
|
address,
|
||||||
create_date,
|
`date`,
|
||||||
should_out_date,
|
should_out_date as shouldOutDate,
|
||||||
max_height,
|
max_height,
|
||||||
amount,
|
allocation_amount as allocationAmount,
|
||||||
state
|
transfer_amount as transferAmount
|
||||||
FROM
|
FROM
|
||||||
wallet_in
|
manage_wallet_out_in
|
||||||
<where>
|
<where>
|
||||||
coin = #{coin} AND `user` = #{user}
|
coin = #{coin} AND `user` = #{user}
|
||||||
<choose>
|
<choose>
|
||||||
<when test="startDate != null and endDate != null">
|
<when test="startDate != null and endDate != null">
|
||||||
and `create_date` >= #{startDate} and `create_date`<![CDATA[ <= ]]> #{endDate}
|
and `date` >= #{startDate} and `date`<![CDATA[ <= ]]> #{endDate}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
and `create_date` >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
|
and `date` >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
|
order by `date` desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getHistoryBalance" resultType="com.m2pool.manage.dto.HistoryBalanceDto">
|
<select id="getHistoryBalance" resultType="com.m2pool.manage.dto.HistoryBalanceDto">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.m2pool.manage.mapper.ManageDocumentsMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getListDataByPage" resultType="com.m2pool.manage.dto.ManageDocumentDto">
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
sub_title as subTitle,
|
||||||
|
content,
|
||||||
|
create_user as createUser,
|
||||||
|
update_user as updateUser,
|
||||||
|
update_time as updateTime,
|
||||||
|
create_time as createTime,
|
||||||
|
type
|
||||||
|
FROM
|
||||||
|
manage_documents
|
||||||
|
<where>
|
||||||
|
del = false
|
||||||
|
<if test="keyword != null">
|
||||||
|
AND title like CONCAT('%',#{keyword},'%') OR sub_title like CONCAT('%',#{keyword},'%') OR content like CONCAT('%',#{keyword},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
<select id="getListDataEnByPage" resultType="com.m2pool.manage.dto.ManageDocumentDto">
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
title_en as `title`,
|
||||||
|
sub_title_en as subTitle,
|
||||||
|
content_en as content,
|
||||||
|
create_user as createUser,
|
||||||
|
update_user as updateUser,
|
||||||
|
update_time as updateTime,
|
||||||
|
create_time as createTime,
|
||||||
|
type
|
||||||
|
FROM
|
||||||
|
manage_documents
|
||||||
|
<where>
|
||||||
|
del = false
|
||||||
|
<if test="keyword != null">
|
||||||
|
AND title_en like CONCAT('%',#{keyword},'%') OR sub_title_en like CONCAT('%',#{keyword},'%') OR content_en like CONCAT('%',#{keyword},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY id DESC
|
||||||
|
</select>
|
||||||
|
<select id="findCatalogueList" resultType="com.m2pool.manage.dto.ManageCatalogueDto">
|
||||||
|
select
|
||||||
|
type,
|
||||||
|
case when #{lang} = 'zh' then description else description_en end as description
|
||||||
|
from
|
||||||
|
manage_documents_type
|
||||||
|
where del = false
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="findCatalogueDocumentList" resultType="com.m2pool.manage.dto.ManageCatalogueDocumentDto">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
case when #{lang} = 'zh' then title else title_en end as title,
|
||||||
|
case when #{lang} = 'zh' then sub_title else sub_title_en end as subTitle,
|
||||||
|
create_user as createUser,
|
||||||
|
update_user as updateUser,
|
||||||
|
update_time as updateTime,
|
||||||
|
create_time as createTime,
|
||||||
|
type
|
||||||
|
from
|
||||||
|
manage_documents
|
||||||
|
where del = false and type = #{type}
|
||||||
|
order by id desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.m2pool.manage.mapper.ManageWalletOutInMapper">
|
||||||
|
|
||||||
|
<select id="getWalletInfo" resultType="com.m2pool.manage.entity.ManageWalletOutIn">
|
||||||
|
SELECT
|
||||||
|
wi.coin,
|
||||||
|
wi.`user`,
|
||||||
|
wi.should_out_date AS shouldOutDate,
|
||||||
|
wi.amount AS allocationAmount,
|
||||||
|
wo.address,
|
||||||
|
wo.`date`,
|
||||||
|
wo.max_height AS maxHeight,
|
||||||
|
wo.tx_id AS txId,
|
||||||
|
wo.amount AS transferAmount
|
||||||
|
FROM
|
||||||
|
wallet_in wi
|
||||||
|
LEFT JOIN wallet_outv2 wo
|
||||||
|
ON
|
||||||
|
DATE(wi.create_date) = DATE(wo.`date`) AND wi.coin = wo.coin AND wi.`user` = wo.`user`
|
||||||
|
<where>
|
||||||
|
wo.`date` <![CDATA[ <= ]]> NOW()
|
||||||
|
<if test="startDate != null">
|
||||||
|
AND wo.`date` > #{startDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
wi.coin,
|
||||||
|
wi.`user`,
|
||||||
|
wi.should_out_date AS shouldOutDate,
|
||||||
|
wi.amount AS allocationAmount,
|
||||||
|
wo.address,
|
||||||
|
wo.`date`,
|
||||||
|
wo.max_height AS maxHeight,
|
||||||
|
wo.tx_id AS txId,
|
||||||
|
wo.amount AS transferAmount
|
||||||
|
FROM
|
||||||
|
wallet_in wi
|
||||||
|
RIGHT JOIN wallet_outv2 wo
|
||||||
|
ON
|
||||||
|
DATE(wi.create_date) = DATE(wo.`date`) AND wi.coin = wo.coin AND wi.`user` = wo.`user`
|
||||||
|
<where>
|
||||||
|
wo.`date` <![CDATA[ <= ]]> NOW()
|
||||||
|
<if test="startDate != null">
|
||||||
|
AND wo.`date` > #{startDate}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -15,7 +15,7 @@ public class ScheduledTaskConfig implements SchedulingConfigurer {
|
||||||
@Override
|
@Override
|
||||||
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
||||||
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
|
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
|
||||||
taskScheduler.setPoolSize(20);
|
taskScheduler.setPoolSize(8);
|
||||||
taskScheduler.initialize();
|
taskScheduler.initialize();
|
||||||
taskRegistrar.setTaskScheduler(taskScheduler);
|
taskRegistrar.setTaskScheduler(taskScheduler);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.m2pool.pool.dto;
|
package com.m2pool.pool.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -12,6 +14,8 @@ import java.util.Date;
|
||||||
* @Author dy
|
* @Author dy
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class PowerLineDto implements Serializable {
|
public class PowerLineDto implements Serializable {
|
||||||
|
|
||||||
/** 日期 */
|
/** 日期 */
|
||||||
|
|
|
@ -31,9 +31,9 @@ public interface PoolMapper {
|
||||||
@HashRateDB
|
@HashRateDB
|
||||||
public Double getNowPoolPower(@Param("table") String table);
|
public Double getNowPoolPower(@Param("table") String table);
|
||||||
|
|
||||||
public List<PowerLineDto> get30mPoolPowerList(@Param("table") String table);
|
public List<PowerLineDto> get30mPoolPowerList(@Param("table") String table,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
|
||||||
|
|
||||||
public List<PowerLineDto> getDailyPoolPowerList(@Param("table") String table);
|
public List<PowerLineDto> getDailyPoolPowerList(@Param("table") String table,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
|
||||||
|
|
||||||
public List<PowerLineDto> getHourNetPowerList(@Param("table") String table);
|
public List<PowerLineDto> getHourNetPowerList(@Param("table") String table);
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -134,6 +137,41 @@ public class PoolServiceImpl implements PoolService {
|
||||||
return AjaxResult.success(dto);
|
return AjaxResult.success(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据补零 30分钟时间端
|
||||||
|
* @param dataList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<PowerLineDto> fillMissingOnlineData(List<PowerLineDto> dataList,Date startTime,Date endTime,String unit,int interval) {
|
||||||
|
|
||||||
|
List<PowerLineDto> resultList = new ArrayList<>();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
|
|
||||||
|
calendar.setTime(startTime);
|
||||||
|
Map<Long, PowerLineDto> timeDataMap = new HashMap<>();
|
||||||
|
for (PowerLineDto data : dataList) {
|
||||||
|
timeDataMap.put(data.getDate().getTime(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (calendar.getTime().getTime() <= endTime.getTime()) {
|
||||||
|
long currentTime = calendar.getTime().getTime();
|
||||||
|
PowerLineDto data = timeDataMap.get(currentTime);
|
||||||
|
if (data != null) {
|
||||||
|
resultList.add(data);
|
||||||
|
} else {
|
||||||
|
if (calendar.getTime().getTime() != endTime.getTime()){
|
||||||
|
resultList.add(new PowerLineDto(calendar.getTime(),BigDecimal.valueOf(0), BigDecimal.valueOf(0),0,unit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 增加 30 分钟
|
||||||
|
calendar.add(Calendar.MINUTE, interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getPoolPower(CoinVo vo) {
|
public AjaxResult getPoolPower(CoinVo vo) {
|
||||||
|
|
||||||
|
@ -150,18 +188,29 @@ public class PoolServiceImpl implements PoolService {
|
||||||
|
|
||||||
int scale = PoolProfitScale.getScaleByCoin(pool.getCoin());
|
int scale = PoolProfitScale.getScaleByCoin(pool.getCoin());
|
||||||
|
|
||||||
|
|
||||||
if("1h".equals(vo.getInterval()) || "rt".equals(vo.getInterval())){
|
if("1h".equals(vo.getInterval()) || "rt".equals(vo.getInterval())){
|
||||||
|
// 获取当前日期
|
||||||
|
Date currentDate = DateUtils.getPreviousHalfHourOrFullHour(new Date());
|
||||||
|
// 获取一天前的日期时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(currentDate);
|
||||||
|
calendar.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
Date oneDayAgo = calendar.getTime();
|
||||||
//30m
|
//30m
|
||||||
PageHelper.clearPage();
|
PageHelper.clearPage();
|
||||||
//矿池算力从$coin_pool_30m拿 获取的 算力单位为MH/S
|
//矿池算力从$coin_pool_30m拿 获取的 算力单位为MH/S
|
||||||
List<PowerLineDto> list = poolMapper.get30mPoolPowerList(pool.getPoolTable()+"_30m");
|
List<PowerLineDto> list = poolMapper.get30mPoolPowerList(pool.getPoolTable()+"_30m",oneDayAgo,currentDate);
|
||||||
Collections.reverse(list);
|
|
||||||
|
|
||||||
//根据币种做参数处理
|
//根据币种做参数处理
|
||||||
PowerLineDto maxPv = list.stream().max(Comparator.comparing(PowerLineDto::getPv)).orElse(new PowerLineDto());
|
PowerLineDto maxPv = list.stream().max(Comparator.comparing(PowerLineDto::getPv)).orElse(new PowerLineDto());
|
||||||
PowerUnitUtils.NetPowerUnit powerUnit = PowerUnitUtils.getPowerUnit(maxPv.getPv().multiply(BigDecimal.valueOf(1000 * 1000)));
|
PowerUnitUtils.NetPowerUnit powerUnit = PowerUnitUtils.getPowerUnit(maxPv.getPv().multiply(BigDecimal.valueOf(1000 * 1000)));
|
||||||
list = changeUnit(powerUnit, list, pool,BigDecimal.valueOf(1000 * 1000));
|
list = changeUnit(powerUnit, list, pool,BigDecimal.valueOf(1000 * 1000));
|
||||||
|
|
||||||
|
//数据补零
|
||||||
|
list = fillMissingOnlineData(list,oneDayAgo,currentDate,powerUnit.getUnit(),30);
|
||||||
|
|
||||||
|
//通过全网算力接口 获取到的时间段价格补充到矿池算力接口的价格中
|
||||||
list.stream().forEach(e -> priceList.stream().anyMatch(p ->{
|
list.stream().forEach(e -> priceList.stream().anyMatch(p ->{
|
||||||
if(p.getDate().equals(e.getDate())){
|
if(p.getDate().equals(e.getDate())){
|
||||||
e.setPrice(p.getPrice());
|
e.setPrice(p.getPrice());
|
||||||
|
@ -171,19 +220,23 @@ public class PoolServiceImpl implements PoolService {
|
||||||
|
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}else if ("1d".equals(vo.getInterval())){
|
}else if ("1d".equals(vo.getInterval())){
|
||||||
|
|
||||||
|
//获取当天零点时间
|
||||||
|
LocalDateTime todayStart = LocalDate.now().atStartOfDay();
|
||||||
|
Date currentDate = Date.from(todayStart.atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
// 获取一个月前的日期
|
||||||
|
Date oneMonthAgo = DateUtils.getOneMonthAgo(currentDate);
|
||||||
PageHelper.clearPage();
|
PageHelper.clearPage();
|
||||||
//矿池算力从$coin_pool_1d拿
|
//矿池算力从$coin_pool_1d拿
|
||||||
List<PowerLineDto> list = poolMapper.getDailyPoolPowerList(pool.getPoolTable()+"_24h");
|
List<PowerLineDto> list = poolMapper.getDailyPoolPowerList(pool.getPoolTable()+"_24h",oneMonthAgo,currentDate);
|
||||||
Collections.reverse(list);
|
|
||||||
|
|
||||||
//根据币种做参数处理
|
//根据币种做参数处理
|
||||||
list.stream().forEach(e -> {
|
list.stream().forEach(e -> {
|
||||||
e.setDate(DateUtils.addDays(e.getDate(),-1));
|
e.setDate(DateUtils.addDays(e.getDate(),-1));
|
||||||
});
|
});
|
||||||
//根据币种做参数处理
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//从hashRate库中获取最后一天数据用作当天实时24h算力
|
||||||
List<MinerDataDto> lastList = poolMapper.getMinerInfoList(pool.getMhs());
|
List<MinerDataDto> lastList = poolMapper.getMinerInfoList(pool.getMhs());
|
||||||
BigDecimal mhs = lastList.stream().map(e -> {
|
BigDecimal mhs = lastList.stream().map(e -> {
|
||||||
return BigDecimal.valueOf(e.getMhs24h());
|
return BigDecimal.valueOf(e.getMhs24h());
|
||||||
|
@ -193,22 +246,12 @@ public class PoolServiceImpl implements PoolService {
|
||||||
lastPLDto.setDate(now);
|
lastPLDto.setDate(now);
|
||||||
lastPLDto.setPv(mhs);
|
lastPLDto.setPv(mhs);
|
||||||
list.add(lastPLDto);
|
list.add(lastPLDto);
|
||||||
|
//根据集合中最大算力一个对象转换的后单位,把集合中所有元素都转换成该单位
|
||||||
PowerLineDto maxPv = list.stream().max(Comparator.comparing(PowerLineDto::getPv)).orElse(new PowerLineDto());
|
PowerLineDto maxPv = list.stream().max(Comparator.comparing(PowerLineDto::getPv)).orElse(new PowerLineDto());
|
||||||
PowerUnitUtils.NetPowerUnit powerUnit = PowerUnitUtils.getPowerUnit(maxPv.getPv() .multiply(BigDecimal.valueOf(1000 * 1000)));
|
PowerUnitUtils.NetPowerUnit powerUnit = PowerUnitUtils.getPowerUnit(maxPv.getPv() .multiply(BigDecimal.valueOf(1000 * 1000)));
|
||||||
list = changeUnit(powerUnit, list, pool,BigDecimal.valueOf(1000 * 1000));
|
list = changeUnit(powerUnit, list, pool,BigDecimal.valueOf(1000 * 1000));
|
||||||
//todo 最后一天数据用当天实时24h算力
|
|
||||||
//List<MinerDataDto> lastList = poolMapper.getMinerInfoList(pool.getMhs());
|
|
||||||
//BigDecimal mhs = lastList.stream().map(e -> {
|
|
||||||
// return BigDecimal.valueOf(e.getMhs24h());
|
|
||||||
//}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
//
|
|
||||||
//PowerLineDto lastPLDto= new PowerLineDto();
|
|
||||||
//Date now = DateUtils.parseDate(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
|
|
||||||
//lastPLDto.setDate(now);
|
|
||||||
//lastPLDto.setPv(mhs);
|
|
||||||
//list.add(lastPLDto);
|
|
||||||
|
|
||||||
|
list = fillMissingOnlineData(list,oneMonthAgo,currentDate,powerUnit.getUnit(),24*60);
|
||||||
list.stream().forEach(e -> priceList.stream().anyMatch(p ->{
|
list.stream().forEach(e -> priceList.stream().anyMatch(p ->{
|
||||||
if(p.getDate().equals(e.getDate())){
|
if(p.getDate().equals(e.getDate())){
|
||||||
e.setPrice(p.getPrice());
|
e.setPrice(p.getPrice());
|
||||||
|
|
|
@ -41,5 +41,7 @@ public class SocketDemo {
|
||||||
Date endDate = DateUtils.getPreviousHalfHourOrFullHour(new Date());
|
Date endDate = DateUtils.getPreviousHalfHourOrFullHour(new Date());
|
||||||
Date startDate = DateUtils.getOneMonthAgo(endDate);
|
Date startDate = DateUtils.getOneMonthAgo(endDate);
|
||||||
System.out.println(startDate+" "+endDate);
|
System.out.println(startDate+" "+endDate);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,22 +15,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by `date` desc limit 1
|
order by `date` desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="get30mPoolPowerList" resultType="com.m2pool.pool.dto.PowerLineDto" statementType="STATEMENT">
|
<select id="get30mPoolPowerList" resultType="com.m2pool.pool.dto.PowerLineDto">
|
||||||
select
|
select
|
||||||
`date`,
|
`date`,
|
||||||
mhs pv
|
mhs as pv
|
||||||
from
|
from
|
||||||
${table}
|
${table}
|
||||||
order by `date` desc limit 48
|
where
|
||||||
|
`date` >= #{startDate} AND `date` <![CDATA[ <= ]]> #{endDate}
|
||||||
|
order by `date`
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDailyPoolPowerList" resultType="com.m2pool.pool.dto.PowerLineDto" statementType="STATEMENT">
|
<select id="getDailyPoolPowerList" resultType="com.m2pool.pool.dto.PowerLineDto" >
|
||||||
select
|
select
|
||||||
`date`,
|
`date`,
|
||||||
mhs pv
|
mhs as pv
|
||||||
from
|
from
|
||||||
${table}
|
${table}
|
||||||
order by `date` desc limit 30
|
where
|
||||||
|
`date` >= #{startDate} AND `date` <![CDATA[ <= ]]> #{endDate}
|
||||||
|
order by `date`
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue