9 files added
2 files modified
New file |
| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.dapp.entity.MemberCoinWithdrawEntity; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.AdminOperationService; |
| | | import cc.mrbird.febs.system.entity.User; |
| | | import cc.mrbird.febs.system.service.IUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/admin/walletCoin") |
| | | public class AdminWalletCoinController extends BaseController { |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final AdminOperationService adminOperationService; |
| | | private final IUserService userService; |
| | | |
| | | /** |
| | | * IGT获取提现转账列表 |
| | | */ |
| | | @GetMapping("findWithdrawInPage") |
| | | public FebsResponse findWithdrawInPage(MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) { |
| | | // User user = super.getCurrentUser(); |
| | | User currentUser = FebsUtil.getCurrentUser(); |
| | | if (currentUser.getDeptId() == null) { |
| | | memberCoinWithdrawEntity.setCurrentUser(currentUser.getUserId()); |
| | | } |
| | | Map<String, Object> data = getDataTable(adminOperationService.findMemberWithdrawCoinAllOneInPage(memberCoinWithdrawEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * IGT获取提现转账列表-同意 |
| | | */ |
| | | @GetMapping("agreeWithdraw/{id}") |
| | | @ControllerEndpoint(operation = "IGT获取提现转账列表-同意", exceptionMessage = "操作失败") |
| | | public FebsResponse agreeWithdraw(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminOperationService.agreeWithdraw(id); |
| | | } |
| | | |
| | | /** |
| | | * IGT获取提现转账列表-拒绝 |
| | | */ |
| | | @GetMapping("disagreeWithdraw/{id}") |
| | | @ControllerEndpoint(operation = "IGT获取提现转账列表-拒绝", exceptionMessage = "操作失败") |
| | | public FebsResponse disagreeWithdraw(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminOperationService.disagreeWithdraw(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | @Controller("walletCoinView") |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "walletCoinView") |
| | | @RequiredArgsConstructor |
| | | public class ViewWalletCoinController { |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | /** |
| | | * 提现转账-列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("transferInsideList") |
| | | @RequiresPermissions("transferInsideList:view") |
| | | public String newsInfoList() { |
| | | return FebsUtil.view("walletCoin/transferInsideList"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 会员提币表 |
| | | */ |
| | | @Data |
| | | @TableName("member_coin_withdraw") |
| | | public class MemberCoinWithdrawEntity extends BaseEntity { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 会员ID |
| | | */ |
| | | private Long memberId; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 提币数量 |
| | | */ |
| | | private BigDecimal amount; |
| | | /** |
| | | * 手续费 |
| | | */ |
| | | private BigDecimal feeAmount; |
| | | /** |
| | | * 币种 |
| | | */ |
| | | private String symbol; |
| | | /** |
| | | * 状态 1进行中 2同意 3拒绝 |
| | | */ |
| | | private int status; |
| | | public static final int STATUS_DOING = 1; |
| | | public static final int STATUS_YES = 2; |
| | | public static final int STATUS_NO = 3; |
| | | /** |
| | | * 是否内部转账 Y-是N-不是 |
| | | */ |
| | | private String isInside; |
| | | public static final String ISINSIDE_YES = "Y"; |
| | | public static final String ISINSIDE_NO = "N"; |
| | | |
| | | private String label; |
| | | |
| | | private String tag; |
| | | |
| | | /** |
| | | * 后台操作用户的标识 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String description; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.dapp.mapper; |
| | | |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletCoinEntity; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | public interface DappWalletCoinDao extends BaseMapper<DappWalletCoinEntity> { |
| | | |
| | |
| | | IPage<DappWalletCoinEntity> selectInPage(@Param("record") DappWalletCoinEntity walletCoin, Page<DappWalletCoinEntity> page); |
| | | |
| | | int updateWithLock(@Param("record") DappWalletCoinEntity dappWalletCoinEntity); |
| | | |
| | | Integer addAvailableAndDelFrozenById(@Param("id") Long id, @Param("balance") BigDecimal balance); |
| | | |
| | | Integer addFrozenAndDelAvailableById(@Param("id") Long id, @Param("balance") BigDecimal amount); |
| | | |
| | | Integer delTotalAndDelFrozenById(@Param("id") Long id, @Param("balance") BigDecimal amount); |
| | | |
| | | Integer addTotalAndaddAvailableById(@Param("id") Long id, @Param("balance") BigDecimal amount); |
| | | |
| | | Integer delAvailableDelTotalById(@Param("id") Long id, @Param("balance") BigDecimal amount); |
| | | |
| | | DappWalletCoinEntity selectWalletCoinBymIdAndCode(@Param("memberId") Long memberId, @Param("walletCode") String walletCode); |
| | | |
| | | int updateFrozenBalance(@Param("memberId") Long memberId, @Param("id") Long id, @Param("amount") BigDecimal amount); |
| | | |
| | | int subFrozenBalance(@Param("memberId") Long memberId, @Param("id") Long id, @Param("amount") BigDecimal amount); |
| | | |
| | | int updateBlockBalance(@Param("id") Long id, @Param("availableAmount") BigDecimal availableAmount, @Param("earlyAmount") BigDecimal earlyAmount, @Param("blockNumber") Integer blockNumber); |
| | | |
| | | int reduceFrozenBalance(@Param("id") Long id, @Param("amount") BigDecimal amount); |
| | | |
| | | List<DappMemberEntity> selectTotalAmount(); |
| | | |
| | | void addTotalAndaddAvailableByMemberId(@Param("memberId")Long id, @Param("balance")BigDecimal multiply); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.mapper; |
| | | |
| | | import cc.mrbird.febs.dapp.entity.MemberCoinWithdrawEntity; |
| | | import cc.mrbird.febs.dapp.vo.AdminMemberCoinWithdrawVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface MemberCoinWithdrawDao extends BaseMapper<MemberCoinWithdrawEntity> { |
| | | |
| | | IPage<AdminMemberCoinWithdrawVo> findMemberWithdrawCoinInPage(Page<MemberCoinWithdrawEntity> page, @Param("record")MemberCoinWithdrawEntity memberCoinWithdrawEntity); |
| | | |
| | | Integer selectByMemberIdAndCreateTime(@Param("memberId")Long memberIdOut, @Param("createTime")String createTime, @Param("type")String type); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.service; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.MemberCoinWithdrawEntity; |
| | | import cc.mrbird.febs.dapp.vo.AdminMemberCoinWithdrawVo; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface AdminOperationService extends IService<DappMemberEntity> { |
| | | |
| | | IPage<AdminMemberCoinWithdrawVo> findMemberWithdrawCoinAllOneInPage(MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request); |
| | | |
| | | FebsResponse agreeWithdraw(Long id); |
| | | |
| | | FebsResponse disagreeWithdraw(Long id); |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.dapp.entity.DappAccountMoneyChangeEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappMemberEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappWalletCoinEntity; |
| | | import cc.mrbird.febs.dapp.entity.MemberCoinWithdrawEntity; |
| | | import cc.mrbird.febs.dapp.mapper.DappAccountMoneyChangeDao; |
| | | import cc.mrbird.febs.dapp.mapper.DappMemberDao; |
| | | import cc.mrbird.febs.dapp.mapper.DappWalletCoinDao; |
| | | import cc.mrbird.febs.dapp.mapper.MemberCoinWithdrawDao; |
| | | import cc.mrbird.febs.dapp.service.AdminOperationService; |
| | | import cc.mrbird.febs.dapp.vo.AdminMemberCoinWithdrawVo; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class AdminOperationServiceImpl extends ServiceImpl<DappMemberDao, DappMemberEntity> implements AdminOperationService { |
| | | |
| | | private final MemberCoinWithdrawDao memberCoinWithdrawDao; |
| | | private final DappWalletCoinDao dappWalletCoinDao; |
| | | private final DappMemberDao dappMemberDao; |
| | | private final DappAccountMoneyChangeDao dappAccountMoneyChangeDao; |
| | | |
| | | @Override |
| | | public IPage<AdminMemberCoinWithdrawVo> findMemberWithdrawCoinAllOneInPage(MemberCoinWithdrawEntity memberCoinWithdrawEntity, QueryRequest request) { |
| | | Page<MemberCoinWithdrawEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<AdminMemberCoinWithdrawVo> adminMemberCoinWithdrawVoIPage = memberCoinWithdrawDao.findMemberWithdrawCoinInPage(page, memberCoinWithdrawEntity); |
| | | return adminMemberCoinWithdrawVoIPage; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public FebsResponse agreeWithdraw(Long id) { |
| | | MemberCoinWithdrawEntity memberCoinWithdrawEntity = memberCoinWithdrawDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(memberCoinWithdrawEntity)){ |
| | | throw new FebsException("刷新页面重试"); |
| | | } |
| | | memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_YES); |
| | | memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity); |
| | | //转出账户,总额减少,冻结减少 |
| | | BigDecimal amount = memberCoinWithdrawEntity.getAmount().setScale(4,BigDecimal.ROUND_DOWN); |
| | | Long memberIdOut = memberCoinWithdrawEntity.getMemberId(); |
| | | DappWalletCoinEntity dappWalletCoinEntityOut = dappWalletCoinDao.selectByMemberId(memberIdOut); |
| | | dappWalletCoinDao.delTotalAndDelFrozenById(dappWalletCoinEntityOut.getId(),amount); |
| | | |
| | | String isInside = memberCoinWithdrawEntity.getIsInside(); |
| | | String content = ""; |
| | | Integer type = 0; |
| | | if(MemberCoinWithdrawEntity.ISINSIDE_NO.equals(isInside)){ |
| | | content = "提现"; |
| | | type = 2; |
| | | }else{ |
| | | content = "转账"; |
| | | type = 4; |
| | | } |
| | | //转出账户生成一条账户资金变化记录 |
| | | DappAccountMoneyChangeEntity dappAccountMoneyChangeEntityOut = new DappAccountMoneyChangeEntity(memberIdOut, |
| | | dappWalletCoinEntityOut.getTotalAmount().setScale(4,BigDecimal.ROUND_DOWN), |
| | | amount.negate(), |
| | | dappWalletCoinEntityOut.getTotalAmount().setScale(4,BigDecimal.ROUND_DOWN).subtract(amount), |
| | | content, |
| | | type); |
| | | dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntityOut); |
| | | |
| | | //转入账户,总额增加,余额增加 |
| | | //转账 |
| | | // if(MemberCoinWithdrawEntity.ISINSIDE_YES.equals(isInside)){ |
| | | // String addressIn = memberCoinWithdrawEntity.getAddress(); |
| | | // DappMemberEntity dappMemberEntityIn = dappMemberDao.selectMemberInfoByInviteId(addressIn); |
| | | // if(ObjectUtil.isEmpty(dappMemberEntityIn)){ |
| | | // throw new FebsException("系统异常,联系开发人员"); |
| | | // } |
| | | // DappWalletCoinEntity dappWalletCoinEntityIn = dappWalletCoinDao.selectByMemberId(dappMemberEntityIn.getId()); |
| | | // Integer countIn = dappWalletCoinDao.addTotalAndaddAvailableById(dappWalletCoinEntityIn.getId(), memberCoinWithdrawEntity.getAmount()); |
| | | // if(1 != countIn){ |
| | | // throw new FebsException("系统异常,联系开发人员"); |
| | | // } |
| | | // //生成流水记录 |
| | | // DappAccountMoneyChangeEntity dappAccountMoneyChangeEntityIn = new DappAccountMoneyChangeEntity(dappMemberEntityIn.getId(), |
| | | // dappWalletCoinEntityIn.getTotalAmount().setScale(4,BigDecimal.ROUND_DOWN), |
| | | // amount, |
| | | // dappWalletCoinEntityIn.getTotalAmount().setScale(4,BigDecimal.ROUND_DOWN).add(amount), |
| | | // "转账", |
| | | // 4); |
| | | // dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntityIn); |
| | | // } |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public FebsResponse disagreeWithdraw(Long id) { |
| | | MemberCoinWithdrawEntity memberCoinWithdrawEntity = memberCoinWithdrawDao.selectById(id); |
| | | if(ObjectUtil.isEmpty(memberCoinWithdrawEntity)){ |
| | | throw new FebsException("刷新页面重试"); |
| | | } |
| | | memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_NO); |
| | | memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity); |
| | | |
| | | DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberCoinWithdrawEntity.getMemberId()); |
| | | Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(dappWalletCoinEntity.getId(),memberCoinWithdrawEntity.getAmount()); |
| | | if(1 != count){ |
| | | throw new FebsException("系统异常,联系开发人员"); |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.dapp.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class AdminMemberCoinWithdrawVo { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | /** |
| | | * 发起人用户名 |
| | | */ |
| | | private String username; |
| | | /** |
| | | * 地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 提币数量 |
| | | */ |
| | | private BigDecimal amount; |
| | | /** |
| | | * 到账金额 |
| | | */ |
| | | private BigDecimal realAmount; |
| | | /** |
| | | * 手续费 |
| | | */ |
| | | private BigDecimal feeAmount; |
| | | /** |
| | | * 币种 |
| | | */ |
| | | private String symbol; |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private int status; |
| | | private String label; |
| | | private String tag; |
| | | |
| | | /** |
| | | * 是否内部转账 Y-是N-不是 |
| | | */ |
| | | private String isInside; |
| | | |
| | | /** |
| | | * 收款方 |
| | | */ |
| | | private String usernameIn; |
| | | |
| | | } |
| | |
| | | version=version+1 |
| | | where id=#{record.id} and version=#{record.version} |
| | | </update> |
| | | |
| | | <update id="addAvailableAndDelFrozenById"> |
| | | update dapp_wallet_coin |
| | | set |
| | | available_amount = available_amount + #{balance}, |
| | | frozen_amount = frozen_amount - #{balance} |
| | | where |
| | | id = #{id} |
| | | and frozen_amount - #{balance} <![CDATA[ >= ]]> 0 |
| | | </update> |
| | | |
| | | <update id="addFrozenAndDelAvailableById"> |
| | | update dapp_wallet_coin |
| | | set |
| | | available_amount = available_amount - #{balance}, |
| | | frozen_amount = frozen_amount + #{balance} |
| | | where |
| | | id = #{id} |
| | | and available_amount - #{balance} <![CDATA[ >= ]]> 0 |
| | | </update> |
| | | |
| | | <update id="delTotalAndDelFrozenById"> |
| | | update dapp_wallet_coin |
| | | set |
| | | total_amount = total_amount - #{balance}, |
| | | frozen_amount = frozen_amount - #{balance} |
| | | where |
| | | id = #{id} |
| | | and total_amount - #{balance} <![CDATA[ >= ]]> 0 |
| | | and frozen_amount - #{balance} <![CDATA[ >= ]]> 0 |
| | | </update> |
| | | |
| | | <update id="addTotalAndaddAvailableById"> |
| | | update dapp_wallet_coin |
| | | set |
| | | total_amount = total_amount + #{balance}, |
| | | available_amount = available_amount + #{balance} |
| | | where |
| | | id = #{id} |
| | | </update> |
| | | |
| | | <update id="delAvailableDelTotalById"> |
| | | update dapp_wallet_coin |
| | | set |
| | | total_amount = total_amount - #{balance}, |
| | | available_amount = available_amount - #{balance} |
| | | where |
| | | id = #{id} |
| | | and total_amount - #{balance} <![CDATA[ >= ]]> 0 |
| | | </update> |
| | | |
| | | |
| | | <select id="selectWalletCoinBymIdAndCode" resultType="cc.mrbird.febs.dapp.entity.DappWalletCoinEntity"> |
| | | select * from dapp_wallet_coin where member_id = #{memberId} and wallet_code = #{walletCode} |
| | | </select> |
| | | |
| | | <update id="updateFrozenBalance" parameterType="map"> |
| | | UPDATE dapp_wallet_coin |
| | | SET available_amount = available_amount - #{amount}, |
| | | frozen_amount = frozen_amount + #{amount} |
| | | WHERE |
| | | id = #{id} |
| | | AND member_id = #{memberId} |
| | | </update> |
| | | |
| | | <update id="subFrozenBalance" parameterType="map"> |
| | | UPDATE dapp_wallet_coin |
| | | SET available_amount = available_amount + #{amount}, |
| | | frozen_amount = frozen_amount - #{amount} |
| | | WHERE |
| | | id = #{id} |
| | | AND member_id = #{memberId} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateBlockBalance"> |
| | | update dapp_wallet_coin |
| | | set |
| | | available_amount = IFNULL(available_amount, 0) + #{availableAmount}, |
| | | total_amount = IFNULL(total_amount, 0) + #{availableAmount}, |
| | | early_amount = IFNULL(early_amount, 0) + #{earlyAmount}, |
| | | block_number = IFNULL(block_number, 0) + #{blockNumber} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="reduceFrozenBalance"> |
| | | update dapp_wallet_coin |
| | | set frozen_amount = frozen_amount - #{amount}, |
| | | total_amount = total_amount - #{amount} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <select id="selectTotalAmount" resultType="cc.mrbird.febs.dapp.entity.DappMemberEntity"> |
| | | select |
| | | b.id, |
| | | b.invite_id, |
| | | b.referer_id, |
| | | b.identity, |
| | | b.referer_ids |
| | | from |
| | | dapp_wallet_coin a |
| | | inner join dapp_member b on a.member_id = b.id |
| | | where a.total_amount <![CDATA[ >= ]]> 51 |
| | | </select> |
| | | |
| | | <update id="addTotalAndaddAvailableByMemberId"> |
| | | update dapp_wallet_coin |
| | | set |
| | | total_amount = total_amount + #{balance}, |
| | | available_amount = available_amount + #{balance} |
| | | where |
| | | member_id = #{memberId} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?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="cc.mrbird.febs.dapp.mapper.MemberCoinWithdrawDao"> |
| | | |
| | | <select id="findMemberWithdrawCoinInPage" resultType="cc.mrbird.febs.dapp.vo.AdminMemberCoinWithdrawVo"> |
| | | SELECT |
| | | s.* |
| | | FROM |
| | | member_coin_withdraw s |
| | | left join dapp_member m on m.id = s.member_id |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.currentUser != null"> |
| | | and m.referer_id = (select invite_id from dapp_user_member_relate where user_id=#{record.currentUser}) |
| | | </if> |
| | | <if test="record.isInside!=null and record.isInside!=''"> |
| | | and s.is_inside= #{record.isInside} |
| | | </if> |
| | | <if test="record.address!=null and record.address!=''"> |
| | | and s.address= #{record.address} |
| | | </if> |
| | | <if test="record.status!=null and record.status!=''"> |
| | | and s.status= #{record.status} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by s.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectByMemberIdAndCreateTime" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count (a.id) |
| | | FROM |
| | | member_coin_withdraw a |
| | | where a.member_id = #{memberId} |
| | | and date_format(a.create_time, '%Y-%m-%d') = #{createTime} |
| | | and a.is_inside = #{type} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-member-withDraw" lay-title="提现列表"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label layui-form-label-sm">操作类型</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="isInsideOption">--> |
| | | <!-- <option value=""></option>--> |
| | | <!-- <option value="Y">内部转账</option>--> |
| | | <!-- <option value="N">提现</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="address" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="statusOption"> |
| | | <option value="0"></option> |
| | | <option value="1">等待审核</option> |
| | | <option value="2">同意</option> |
| | | <option value="3">拒绝</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="withdrawTable" lay-data="{id: 'withdrawTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .layui-table-cell { |
| | | height: auto !important; |
| | | } |
| | | </style> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'laydate', 'form', 'table', 'febs', 'treeSelect'], function () { |
| | | var $ = layui.jquery, |
| | | laydate = layui.laydate, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | dropdown = layui.dropdown, |
| | | $view = $('#febs-member-withDraw'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | initTable(); |
| | | |
| | | table.on('tool(withdrawTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'agree') { |
| | | febs.modal.confirm('同意', '是否同意操作?', function () { |
| | | agree(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'disagree') { |
| | | febs.modal.confirm('拒绝', '是否拒绝操作?', function () { |
| | | disagree(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function agree(id) { |
| | | febs.get(ctx + 'admin/walletCoin/agreeWithdraw/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function disagree(id) { |
| | | febs.get(ctx + 'admin/walletCoin/disagreeWithdraw/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | }); |
| | | |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'withdrawTable', |
| | | url: ctx + 'admin/walletCoin/findWithdrawInPage', |
| | | totalRow: true, |
| | | cols: [[ |
| | | {field: 'address', title: '提币地址', |
| | | templet: function (d) { |
| | | if (d.isInside === 'Y') { |
| | | return '' |
| | | } else if (d.isInside === 'N') { |
| | | return '<span>'+d.address+'</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 300, align: 'center'}, |
| | | {field: 'isInside', title: '类型', |
| | | templet: function (d) { |
| | | if (d.isInside === 'Y') { |
| | | return '<span>内部转账</span>' |
| | | } else if (d.isInside === 'N') { |
| | | return '<span>提现</span>' |
| | | }else{ |
| | | return |
| | | } |
| | | }, minWidth: 100, align: 'center'}, |
| | | {field: 'symbol', title: '币种', minWidth: 100, align: 'center'}, |
| | | {field: 'amount', title: '提币数量', minWidth: 120, align: 'center', totalRow: true}, |
| | | {field: 'feeAmount', title: '手续费', minWidth: 120, align: 'center', totalRow: true}, |
| | | // {field: 'realAmount', title: '到账数量', minWidth: 120, align: 'center', totalRow: true}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | | if (d.status === 1) { |
| | | return '<span>进行中</span>' |
| | | } else if (d.status === 2) { |
| | | return '<span>同意</span>' |
| | | }else if (d.status === 3) { |
| | | return '<span>拒绝</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 120, align: 'center', totalRow: true}, |
| | | {field: 'createTime', title: '提币时间', minWidth: 180, align: 'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.status === 1){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>' |
| | | +'<button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-danger" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | |
| | | |
| | | },minWidth: 120,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | function getQueryParams() { |
| | | return { |
| | | status: $searchForm.find("select[name='statusOption']").val(), |
| | | address: $searchForm.find('input[name="address"]').val().trim(), |
| | | // isInside: $searchForm.find("select[name='isInsideOption']").val() |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |