update 优化订单支付定时任务批量修改金额相关sql
This commit is contained in:
@@ -111,15 +111,13 @@ public class LeaseProductController {
|
||||
}
|
||||
|
||||
|
||||
//TODO 2025-11-21 查询店铺的矿机列表,不存在商品了
|
||||
|
||||
@ApiOperation("获取店铺商品列表用于新增绑定店铺钱包")
|
||||
@ApiOperation("获取店铺商品列表用于新增绑定店铺钱包-v1")
|
||||
@PostMapping("/getProductListForShopWalletConfig")
|
||||
public Result<List<ProductForWalletConfigDto>> getProductListForShopWalletConfig() {
|
||||
return leaseProductService.getProductListForShopWalletConfig();
|
||||
}
|
||||
|
||||
//TODO 2025-11-21 修改这些矿机的价格,并且绑定新钱包
|
||||
|
||||
@ApiOperation("新增绑定店铺钱包并设置店铺下面每个矿机该钱包币种的售价 + 钱包绑定")
|
||||
@PostMapping("/updateProductListForShopWalletConfig")
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.m2pool.lease.controller;
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.dto.v2.MachineForWalletConfigDto;
|
||||
import com.m2pool.lease.dto.v2.MachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.SellerMachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.ShopInfoDto;
|
||||
@@ -104,7 +105,11 @@ public class LeaseProductMachineV2Controller {
|
||||
return leaseMachineService.getSupportAlgo(coin);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取店铺商品列表用于新增绑定店铺钱包-v2")
|
||||
@PostMapping("/getProductListForShopWalletConfig")
|
||||
public Result<List<MachineForWalletConfigDto>> getProductListForShopWalletConfig() {
|
||||
return leaseMachineService.getProductListForShopWalletConfig();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ProductMachineForWalletConfigVo {
|
||||
public static class PriceVo{
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long productMachineId;
|
||||
@ApiModelProperty(value = "单价,可以多个以逗号隔开")
|
||||
@ApiModelProperty(value = "单价")
|
||||
private String price;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "钱包配置修改矿机支付方式返回对象",value = "MachineForWalletConfigDto" )
|
||||
public class MachineForWalletConfigDto {
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long productMachineId;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器型号0 ASIC 1 GPU")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出 2售出中")
|
||||
private Integer saleState;
|
||||
|
||||
|
||||
|
||||
//@ApiModelProperty(value = "挖矿币种")
|
||||
//private String coin;
|
||||
//
|
||||
//@ApiModelProperty(value = "算力单位")
|
||||
//private String unit;
|
||||
//
|
||||
//@ApiModelProperty(value = "理论算力(卖方手动填写)")
|
||||
//private BigDecimal theoryPower;
|
||||
//
|
||||
//@ApiModelProperty(value = "单机理论收入(每日) 单位币种")
|
||||
//private BigDecimal theoryIncome;
|
||||
//
|
||||
//@ApiModelProperty(value = "单机理论收入(每日) 单位USDT")
|
||||
//private BigDecimal theoryUsdtIncome;
|
||||
//
|
||||
//@ApiModelProperty(value = "功耗 单位kw/h",example = "10")
|
||||
//private BigDecimal powerDissipation;
|
||||
//
|
||||
//@ApiModelProperty(value = "单价")
|
||||
//private BigDecimal price;
|
||||
//
|
||||
//@ApiModelProperty(value = "支付链")
|
||||
//private BigDecimal chain;
|
||||
//
|
||||
//@ApiModelProperty(value = "支付币种")
|
||||
//private BigDecimal symbol;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import com.m2pool.lease.dto.ProductMachineForWalletConfigDto;
|
||||
import com.m2pool.lease.dto.v2.*;
|
||||
import com.m2pool.lease.entity.LeaseMachine;
|
||||
import com.m2pool.lease.vo.v2.SellerMachineVo;
|
||||
@@ -162,4 +163,10 @@ public interface LeaseMachineMapper extends BaseMapper<LeaseMachine> {
|
||||
*/
|
||||
int checkHasSaleMachineByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
/**
|
||||
* 获取店铺下可出售的矿机列表
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
List<MachineForWalletConfigDto> getProductListForShopWalletConfig(@Param("shopId") Long shopId);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.m2pool.lease.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.ProductMachineForWalletConfigDto;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.v2.MachineForWalletConfigDto;
|
||||
import com.m2pool.lease.dto.v2.MachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.SellerMachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.ShopInfoDto;
|
||||
@@ -92,4 +94,11 @@ public interface LeaseMachineService extends IService<LeaseMachine> {
|
||||
* @return
|
||||
*/
|
||||
Result<List<String>> getSupportAlgo( String coin);
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺商品列表用于新增绑定店铺钱包
|
||||
* @return
|
||||
*/
|
||||
Result<List<MachineForWalletConfigDto>> getProductListForShopWalletConfig();
|
||||
}
|
||||
|
||||
@@ -467,4 +467,15 @@ public class LeaseMachineServiceImpl extends ServiceImpl<LeaseMachineMapper, Lea
|
||||
List<String> supportAlgo = leaseMachineMapper.getSupportAlgo(coin);
|
||||
return Result.success(supportAlgo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<MachineForWalletConfigDto>> getProductListForShopWalletConfig() {
|
||||
LeaseShop leaseShop = leaseShopMapper.selectOne(new LambdaQueryWrapper<LeaseShop>()
|
||||
.select(LeaseShop::getId)
|
||||
.eq(LeaseShop::getUserEmail, SecurityUtils.getUsername())
|
||||
.eq(LeaseShop::getDel, false));
|
||||
List<MachineForWalletConfigDto> machineForWalletConfigDtoList = leaseMachineMapper.getProductListForShopWalletConfig(leaseShop.getId());
|
||||
|
||||
return Result.success(machineForWalletConfigDtoList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ public class LeaseProductServiceImpl extends ServiceImpl<LeaseProductMapper, Lea
|
||||
|
||||
@Override
|
||||
public Result<List<PayTypeDto>> getSupportPayType() {
|
||||
Long shopId = getShopIdByProductId();
|
||||
Long shopId = getShopIdByUsername();
|
||||
List<PayTypeDto> supportPayType = leaseProductMapper.getSupportPayType(shopId);
|
||||
return Result.success(supportPayType);
|
||||
}
|
||||
@@ -430,7 +430,7 @@ public class LeaseProductServiceImpl extends ServiceImpl<LeaseProductMapper, Lea
|
||||
|
||||
@Override
|
||||
public Result<List<ProductForWalletConfigDto>> getProductListForShopWalletConfig() {
|
||||
Long shopId = getShopIdByProductId();
|
||||
Long shopId = getShopIdByUsername();
|
||||
//1.获取商品列表
|
||||
List<ProductForWalletConfigDto> productForShopWalletConfigDtoList = leaseProductMapper.getProductListForShopWalletConfig(shopId);
|
||||
if (productForShopWalletConfigDtoList.isEmpty()){
|
||||
@@ -455,7 +455,7 @@ public class LeaseProductServiceImpl extends ServiceImpl<LeaseProductMapper, Lea
|
||||
return Result.success(productForShopWalletConfigDtoList);
|
||||
}
|
||||
|
||||
public Long getShopIdByProductId(){
|
||||
public Long getShopIdByUsername(){
|
||||
LeaseShop leaseShop = leaseShopMapper.selectOne(new LambdaQueryWrapper<LeaseShop>()
|
||||
.select(LeaseShop::getId)
|
||||
.eq(LeaseShop::getUserEmail, SecurityUtils.getUsername())
|
||||
|
||||
@@ -491,6 +491,7 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
|
||||
//4.查询店铺中是否存在要删除链的钱包 的订单,存在订单不能删除
|
||||
Long l = leaseOrderItemMapper.selectCount(new LambdaQueryWrapper<LeaseOrderItem>()
|
||||
.eq(LeaseOrderItem::getChain, config.getChain())
|
||||
.eq(LeaseOrderItem::getFromSymbol, config.getPayCoin())
|
||||
.ne(LeaseOrderItem::getStatus, 0)
|
||||
);
|
||||
if (l > 0){
|
||||
@@ -505,6 +506,7 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
|
||||
leaseMachinePriceMapper.update(LeaseMachinePrice.builder().del(true).build(),
|
||||
new LambdaQueryWrapper<LeaseMachinePrice>()
|
||||
.eq(LeaseMachinePrice::getChain, config.getChain())
|
||||
.eq(LeaseMachinePrice::getCoin, config.getPayCoin())
|
||||
.in(LeaseMachinePrice::getMachineId,ids)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user