update 租赁系统1.1.0 钱包地址参数加密,gpu矿机新增到订单流程测试修改等
This commit is contained in:
@@ -2,6 +2,7 @@ package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.dto.OrderInfoDto;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.PaymentRecordDto;
|
||||
@@ -38,6 +39,7 @@ public class LeaseOrderInfoController {
|
||||
|
||||
@ApiOperation("创建订单及订单详情 + 支付订单(返回二维码内容)")
|
||||
@PostMapping("/addOrders")
|
||||
@Decrypt
|
||||
public Result<String> addOrders(@RequestBody OrderAndCodeVo orderAndCodeVo) {
|
||||
return leaseOrderInfoService.addOrders(orderAndCodeVo);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.v2.PayWithdrawSellerRecordDto;
|
||||
import com.m2pool.lease.dto.v2.ShopWalletInfoDto;
|
||||
import com.m2pool.lease.service.LeaseShopService;
|
||||
import com.m2pool.lease.vo.BalancePageVo;
|
||||
import com.m2pool.lease.vo.BalanceVo;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.PageVo;
|
||||
import com.m2pool.lease.vo.v2.ShopWalletInfoVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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;
|
||||
@@ -46,12 +50,14 @@ public class LeaseShopV2Controller {
|
||||
|
||||
@PostMapping("/withdrawBalanceForSeller")
|
||||
@ApiOperation(value = "卖家店铺钱包余额提现")
|
||||
@Decrypt
|
||||
public Result<String> withdrawBalanceForSeller(@RequestBody BalanceVo balanceVo){
|
||||
return leaseShopService.withdrawBalanceForSeller(balanceVo);
|
||||
}
|
||||
|
||||
@ApiOperation("钱包配置----根据配置id 修改商铺收款钱包配置")
|
||||
@PostMapping("/updateShopConfigV2")
|
||||
@Decrypt
|
||||
public Result<String> updateShopConfigV2(@RequestBody ShopWalletInfoVo shopWalletInfoVo) {
|
||||
return leaseShopService.updateShopConfigV2(shopWalletInfoVo);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseUserService;
|
||||
import com.m2pool.lease.vo.*;
|
||||
@@ -52,6 +53,7 @@ public class LeaseUserController {
|
||||
|
||||
@PostMapping("/withdrawBalance")
|
||||
@ApiOperation(value = "申请余额提现")
|
||||
@Decrypt
|
||||
public Result<String> withdrawBalance(@RequestBody BalanceVo balanceVo){
|
||||
return leaseUserService.withdrawBalance(balanceVo);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -33,6 +34,7 @@ public class OrderMiningInfoDto {
|
||||
private Long machineId;
|
||||
|
||||
@ApiModelProperty(value = "挖矿钱包(用户自己输入)")
|
||||
@EncryptedField
|
||||
private String walletAddress;
|
||||
|
||||
@ApiModelProperty(value = "挖矿账号(用户自己输入)")
|
||||
|
||||
@@ -155,4 +155,11 @@ public interface LeaseMachineMapper extends BaseMapper<LeaseMachine> {
|
||||
* @return
|
||||
*/
|
||||
boolean updateBatchSaleNumbers(@Param("list") List<LeaseMachine> list);
|
||||
|
||||
/**
|
||||
* 检测店铺下是否有已出售的矿机
|
||||
* @return
|
||||
*/
|
||||
int checkHasSaleMachineByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,11 +19,6 @@ public class ChannelManager {
|
||||
*/
|
||||
private static final Map<String, Channel> channelMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* key channel value mac
|
||||
*/
|
||||
public static final Map<Channel, String> macMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* key channel value id
|
||||
*/
|
||||
@@ -49,9 +44,7 @@ public class ChannelManager {
|
||||
Channel channel = channelMap.get(ip);
|
||||
if (channel != null){
|
||||
idMap.remove(channel);
|
||||
macMap.remove(channel);
|
||||
channelMap.remove(ip);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -68,21 +61,20 @@ public class ChannelManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据mac地址获取Channel
|
||||
* @param mac
|
||||
* 根据id: 邮箱::mac地址获取Channel
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static Channel getChannelByMac(String mac) {
|
||||
Optional<Channel> key = macMap.entrySet()
|
||||
public static Channel getChannelById(String id) {
|
||||
Optional<Channel> key = idMap.entrySet()
|
||||
.stream()
|
||||
.filter(entry -> mac.equals(entry.getValue()))
|
||||
.filter(entry -> id.equals(entry.getValue()))
|
||||
.map(Map.Entry::getKey)
|
||||
.findFirst();
|
||||
return key.orElse(null);
|
||||
}
|
||||
public static boolean sendToClient(String mac, Object message) {
|
||||
|
||||
Channel channel = getChannelByMac(mac);
|
||||
public static boolean sendToClient(String id, Object message) {
|
||||
Channel channel = getChannelById(id);
|
||||
if (channel != null && channel.isActive()) {
|
||||
channel.writeAndFlush(message).syncUninterruptibly();
|
||||
return false;
|
||||
|
||||
@@ -210,6 +210,9 @@ public class LeaseMachineServiceImpl extends ServiceImpl<LeaseMachineMapper, Lea
|
||||
@Override
|
||||
public PageResult<SellerMachineInfoDto> getShopMachineListForSeller(SellerMachineVo sellerMachineVo) {
|
||||
LeaseShop leaseShop = getShopById();
|
||||
if (leaseShop == null){
|
||||
return PageResult.fail(new ArrayList<>(), "暂无店铺");
|
||||
}
|
||||
PageHelper.startPage(sellerMachineVo.getPageNum(), sellerMachineVo.getPageSize());
|
||||
List<SellerMachineInfoDto> machineInfoDtoList = leaseMachineMapper.getShopMachineListForSeller(sellerMachineVo,leaseShop.getId());
|
||||
PageInfo<SellerMachineInfoDto> pageInfo = new PageInfo<>(machineInfoDtoList);
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.m2pool.lease.task.info;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description 算法信息类
|
||||
* @Date 2025/12/16 15:43
|
||||
* @Author yyb
|
||||
*/
|
||||
@Data
|
||||
public class BlockInfo {
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 每日报块数
|
||||
*/
|
||||
private String blocks;
|
||||
|
||||
/**
|
||||
* 报块间隔
|
||||
*/
|
||||
private BigDecimal blockInterval;
|
||||
|
||||
/**
|
||||
* 报块奖励
|
||||
*/
|
||||
private BigDecimal blockReward;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.m2pool.lease.vo;
|
||||
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.poi.openxml4j.opc.PackageRelationship;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -48,11 +48,13 @@ public class BalanceVo {
|
||||
private BigDecimal serviceCharge;
|
||||
|
||||
@ApiModelProperty(value = "绑定的地址",required = true)
|
||||
@EncryptedField
|
||||
private String fromAddress;
|
||||
/**
|
||||
* 提现地址(用户自定义)
|
||||
*/
|
||||
@ApiModelProperty(value = "提现地址(用户自定义)",required = true)
|
||||
@EncryptedField
|
||||
private String toAddress;
|
||||
|
||||
@ApiModelProperty(value = "谷歌双重验证验证码",required = true)
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
FROM
|
||||
lease_machine lm
|
||||
JOIN
|
||||
lease_machine_config gpc ON lm.id = gpc.machine_id AND lm.type = #{shopMachineVo.type} AND lm.shop_id = #{shopMachineVo.shopId} AND lm.online_status = true AND lm.sale_state = 0
|
||||
lease_machine_config gpc ON lm.id = gpc.machine_id AND lm.type = #{shopMachineVo.type} AND lm.shop_id = #{shopMachineVo.shopId} AND lm.online_status = true AND lm.sale_state = 0 AND lm.state = 0
|
||||
GROUP BY lm.id,gpc.coin,gpc.algorithm
|
||||
) sub
|
||||
LEFT JOIN lease_machine_price mp
|
||||
@@ -139,7 +139,6 @@
|
||||
<if test="shopMachineVo.keyword != null and shopMachineVo.keyword != ''">
|
||||
AND (sub.coin LIKE CONCAT('%', #{shopMachineVo.keyword}, '%') OR sub.algorithm LIKE CONCAT('%', #{shopMachineVo.keyword}, '%'))
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@@ -445,6 +444,8 @@
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateBatchSaleNumbers">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
UPDATE lease_machine
|
||||
@@ -456,4 +457,15 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="checkHasSaleMachineByShopId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
lease_machine
|
||||
WHERE
|
||||
shop_id = #{shopId}
|
||||
and `sale_state` = 1
|
||||
and `del` = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user