update 优化订单支付定时任务批量修改金额相关sql
This commit is contained in:
@@ -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