14 files modified
6 files added
| | |
| | | |
| | | @Getter |
| | | public enum DataDictionaryEnum { |
| | | //充值金额 |
| | | CHARGE_AMOUNT("CHARGE_AMOUNT","CHARGE_AMOUNT"), |
| | | //充值地址 |
| | | CHARGE_ADDRESS("CHARGE_ADDRESS","CHARGE_ADDRESS"), |
| | | //卖方确认获取5%的GSD |
| | | FCM_GSD_IN("FCM_GSD_IN","FCM_GSD_IN"), |
| | | //卡牌互转手续费 |
| | |
| | | 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.enumerates.FlowTypeNewEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeNewEnum; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.common.utils.ShareCodeUtil; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelSheetPO; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelUtil; |
| | |
| | | import cc.mrbird.febs.common.utils.excl.ResponseHeadUtil; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberAmountMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberChargeMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberWalletMapper; |
| | | import cc.mrbird.febs.mall.service.IAdminMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.mall.vo.AdminAgentLevelOptionTreeVo; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | |
| | | |
| | | private final IAdminMallMemberService mallMemberService; |
| | | private final MallMemberWalletMapper mallMemberWalletMapper; |
| | | private final MallMemberAmountMapper mallMemberAmountMapper; |
| | | private final MallMemberMapper mallMemberMapper; |
| | | private final IApiMallMemberService apiMallMemberService; |
| | | private final MallMemberChargeMapper mallMemberChargeMapper; |
| | | private final IMallMoneyFlowService mallMoneyFlowService; |
| | | |
| | | |
| | | @GetMapping("confirmOrder") |
| | | @ControllerEndpoint(operation = "批量充值", exceptionMessage = "操作失败") |
| | | public FebsResponse confirmOrder(MemberChargrDto memberChargrDto){ |
| | | String orderIds = memberChargrDto.getOrderIds(); |
| | | List<String> ids = StrUtil.splitTrim(orderIds, ","); |
| | | for(String id : ids){ |
| | | long orderId = Long.parseLong(id); |
| | | MallMemberCharge mallMemberCharge = mallMemberChargeMapper.selectById(orderId); |
| | | if(1 != mallMemberCharge.getState()){ |
| | | continue; |
| | | } |
| | | MallMemberAmount mallMemberAmount = mallMemberAmountMapper.selectByMemberId(mallMemberCharge.getMemberId()); |
| | | mallMemberAmount.setFcmCntAva(mallMemberAmount.getFcmCntAva().add(mallMemberCharge.getAmount())); |
| | | mallMemberAmountMapper.updateFcmCntAvaById(mallMemberAmount); |
| | | |
| | | mallMemberCharge.setState(2); |
| | | mallMemberChargeMapper.updateById(mallMemberCharge); |
| | | |
| | | String orderNo = MallUtils.getOrderNum("BF"); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | mallMemberCharge.getMemberId(), |
| | | mallMemberCharge.getAmount(), |
| | | MoneyFlowTypeNewEnum.FCM_INSIDE_IN.getValue(), |
| | | orderNo, |
| | | mallMemberCharge.getMemberId(), |
| | | FlowTypeNewEnum.FCM_COIN.getValue(), |
| | | MoneyFlowTypeNewEnum.FCM_INSIDE_IN.getDescrition()); |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("confirmCancel") |
| | | @ControllerEndpoint(operation = "批量取消", exceptionMessage = "操作失败") |
| | | public FebsResponse confirmCancel(MemberChargrDto memberChargrDto){ |
| | | String orderIds = memberChargrDto.getOrderIds(); |
| | | List<String> ids = StrUtil.splitTrim(orderIds, ","); |
| | | for(String id : ids){ |
| | | long orderId = Long.parseLong(id); |
| | | MallMemberCharge mallMemberCharge = mallMemberChargeMapper.selectById(orderId); |
| | | if(1 != mallMemberCharge.getState()){ |
| | | continue; |
| | | } |
| | | mallMemberCharge.setState(3); |
| | | mallMemberChargeMapper.updateById(mallMemberCharge); |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 充值列表 |
| | | */ |
| | | @GetMapping("memberChargeList") |
| | | public FebsResponse memberChargeList(MoneyChargeListDto moneyChargeListDto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(mallMemberService.memberChargeList(moneyChargeListDto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 平台账单 |
| | |
| | | return memberService.updatePayment(updatePaymentDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "FCM-充值", notes = "FCM-充值") |
| | | @PostMapping(value = "/chargeBalance") |
| | | public FebsResponse chargeBalance(@RequestBody @Valid ApiChargeBalanceDto apiChargeBalanceDto) { |
| | | return memberService.chargeBalance(apiChargeBalanceDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "FCM-推出登录", notes = "FCM-推出登录") |
| | | @PostMapping(value = "/logout") |
| | | public FebsResponse logout() { |
New file |
| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-05-13 |
| | | **/ |
| | | @Controller("basicTestView") |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/basicTest") |
| | | @RequiredArgsConstructor |
| | | public class ViewBasicTestController { |
| | | |
| | | private final IMallNewsInfoService mallNewsInfoService; |
| | | |
| | | /** |
| | | * 新闻中心-列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("newsInfoList") |
| | | @RequiresPermissions("newsInfoList:view") |
| | | public String newsInfoList() { |
| | | return FebsUtil.view("modules/news/newsInfoList"); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-新增 |
| | | * @return |
| | | */ |
| | | @GetMapping("newsInfoAdd") |
| | | @RequiresPermissions("newsInfoAdd:add") |
| | | public String newsInfoAdd() { |
| | | return FebsUtil.view("modules/news/newsInfoAdd"); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-详情 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("newsInfoUpdate/{id}") |
| | | @RequiresPermissions("newsInfoUpdate:update") |
| | | public String newsInfoUpdate(@PathVariable long id, Model model) { |
| | | MallNewsInfo data = mallNewsInfoService.getNewsInfoById(id); |
| | | model.addAttribute("newsInfo", data); |
| | | return FebsUtil.view("modules/news/newsInfoUpdate"); |
| | | } |
| | | |
| | | @GetMapping("newsCategory") |
| | | @RequiresPermissions("news:category:view") |
| | | public String newsCategory() { |
| | | return FebsUtil.view("modules/news/newsCategory"); |
| | | } |
| | | |
| | | @GetMapping("addCategory") |
| | | @RequiresPermissions("news:category:add") |
| | | public String addCategory(Long id, Model model) { |
| | | if (id != null) { |
| | | MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id); |
| | | model.addAttribute("obj", obj); |
| | | } |
| | | return FebsUtil.view("modules/news/newsCategoryAdd"); |
| | | } |
| | | |
| | | @GetMapping("updateCategory/{id}") |
| | | @RequiresPermissions("news:category:update") |
| | | public String updateCategory(@PathVariable Long id, Model model) { |
| | | if (id != null) { |
| | | MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id); |
| | | model.addAttribute("obj", obj); |
| | | } |
| | | return FebsUtil.view("modules/news/newsCategoryAdd"); |
| | | } |
| | | } |
| | |
| | | public static long idFromScoreAchieveRelease; |
| | | |
| | | /** |
| | | * 充值列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("memberChargeList") |
| | | @RequiresPermissions("memberChargeList:view") |
| | | public String memberChargeList() { |
| | | return FebsUtil.view("modules/mallMember/memberChargeList"); |
| | | } |
| | | |
| | | /** |
| | | * 平台账单 |
| | | * @return |
| | | */ |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiChargeBalanceDto", description = "参数接收类") |
| | | public class ApiChargeBalanceDto { |
| | | |
| | | @NotNull(message = "参数不能为空") |
| | | @ApiModelProperty(value = "金额", example = "1") |
| | | private BigDecimal amount; |
| | | |
| | | @NotNull(message = "交易密码不能为空") |
| | | @ApiModelProperty(value = "交易密码", example = "1") |
| | | private String tradePassword; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "MemberChargrDto", description = "参数接收类") |
| | | public class MemberChargrDto { |
| | | |
| | | private String orderIds; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.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("mall_member_charge") |
| | | public class MallMemberCharge extends BaseEntity { |
| | | private Long memberId; |
| | | private BigDecimal amount; |
| | | private Integer state;//1-进行中 2-成功 3-失败 |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String accountLogin; |
| | | } |
| | |
| | | private Long rtMemberId; |
| | | |
| | | /** |
| | | * 提现状态 1-提现中2-成功 3-拒绝 |
| | | * 提现状态 1-进行中2-成功 3-拒绝 |
| | | */ |
| | | private Integer status; |
| | | |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallMemberCharge; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | public interface MallMemberChargeMapper extends BaseMapper<MallMemberCharge> { |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.AgentDto; |
| | | import cc.mrbird.febs.mall.dto.AgentLevelDto; |
| | | import cc.mrbird.febs.mall.dto.RankAwardDto; |
| | | import cc.mrbird.febs.mall.dto.RankListDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.AppVersion; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMemberCharge; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | IPage<AdminMallMemberVo> getFcmMallMemberList(Page<AdminMallMemberVo> page, @Param("record")MallMember mallMember); |
| | | |
| | | MallMemberVo getMallmemberAmountByMemberId(@Param("memberId")long id); |
| | | |
| | | IPage<MallMemberCharge> getMemberChargeListInPage(Page<MallMemberCharge> page, @Param("record")MoneyChargeListDto moneyChargeListDto); |
| | | } |
| | |
| | | FebsResponse updateSystemPayInfo(MallSystemPayDto mallSystemPayDto); |
| | | |
| | | MallMemberVo getMallmemberAmountByMemberId(long id); |
| | | |
| | | IPage<MallMemberCharge> memberChargeList(MoneyChargeListDto moneyChargeListDto, QueryRequest request); |
| | | } |
| | |
| | | FebsResponse memberSpeak(ApiMemberSpeakDto memberSpeakDto); |
| | | |
| | | FebsResponse moneyFlowInside(MoneyFlowDto moneyFlowDto); |
| | | |
| | | FebsResponse chargeBalance(ApiChargeBalanceDto apiChargeBalanceDto); |
| | | } |
| | |
| | | void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType, String description); |
| | | void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType, String description,Integer isReturn); |
| | | |
| | | |
| | | |
| | | void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType,Integer status, String description); |
| | | |
| | | } |
| | |
| | | return mallMemberVo; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MallMemberCharge> memberChargeList(MoneyChargeListDto moneyChargeListDto, QueryRequest request) { |
| | | Page<MallMemberCharge> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<MallMemberCharge> mallMemberChargeIPage = mallMemberMapper.getMemberChargeListInPage(page, moneyChargeListDto); |
| | | return mallMemberChargeIPage; |
| | | } |
| | | |
| | | private String refererIds(String parentId) { |
| | | boolean flag = false; |
| | | if (StrUtil.isBlank(parentId)) { |
| | |
| | | private final MallProductBuyRecordMapper mallProductBuyRecordMapper; |
| | | private final MallProductBuyMapper mallProductBuyMapper; |
| | | private final MallMemberSpeakMapper mallMemberSpeakMapper; |
| | | private final MallMemberChargeMapper mallMemberChargeMapper; |
| | | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | |
| | | DataDictionaryEnum.FCM_INSIDE_NFT_PERCENT.getCode() |
| | | ); |
| | | mallMemberVo.setInsideNFTPercent(insideNFTPercentDic.getValue()); |
| | | |
| | | DataDictionaryCustom chargeAddressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.CHARGE_ADDRESS.getType(), |
| | | DataDictionaryEnum.CHARGE_ADDRESS.getCode() |
| | | ); |
| | | mallMemberVo.setChargeAddress(chargeAddressDic.getValue()); |
| | | return new FebsResponse().success().data(mallMemberVo); |
| | | } |
| | | |
| | |
| | | return new FebsResponse().success().data(pages); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse chargeBalance(ApiChargeBalanceDto apiChargeBalanceDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember mallMember = this.baseMapper.selectById(memberId); |
| | | BigDecimal amount = apiChargeBalanceDto.getAmount(); |
| | | DataDictionaryCustom chargeAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.CHARGE_AMOUNT.getType(), |
| | | DataDictionaryEnum.CHARGE_AMOUNT.getCode() |
| | | ); |
| | | BigDecimal chargeAmount = new BigDecimal(chargeAmountDic.getValue()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | if(chargeAmount.compareTo(amount) > 0){ |
| | | throw new FebsException("充值金额需要大于"+chargeAmount); |
| | | } |
| | | |
| | | if (StrUtil.isBlank(mallMember.getTradePassword())) { |
| | | throw new FebsException("请设置交易密码"); |
| | | } |
| | | |
| | | if (!mallMember.getTradePassword().equals(SecureUtil.md5(apiChargeBalanceDto.getTradePassword()))) { |
| | | throw new FebsException("交易密码错误"); |
| | | } |
| | | MallMemberCharge mallMemberCharge = new MallMemberCharge(); |
| | | mallMemberCharge.setMemberId(memberId); |
| | | mallMemberCharge.setAmount(chargeAmount); |
| | | mallMemberCharge.setState(1); |
| | | mallMemberChargeMapper.insert(mallMemberCharge); |
| | | |
| | | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // Set<String> objectsAccount = new HashSet<>(); |
| | | // Set<String> objects = new HashSet<>(); |
| | |
| | | public void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType, String description, Integer isReturn) { |
| | | this.addMoneyFlow(memberId, amount, type, orderNo, description, null, rtMemberId, null, flowType, isReturn); |
| | | } |
| | | |
| | | @Override |
| | | public void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType, Integer status, String description) { |
| | | this.addMoneyFlow(memberId, amount, type, orderNo, description, null, rtMemberId, status, flowType, null); |
| | | } |
| | | } |
| | |
| | | private BigDecimal totalPerk; |
| | | @ApiModelProperty(value = "卡牌互转手续费") |
| | | private String insideNFTPercent; |
| | | @ApiModelProperty(value = "充值地址") |
| | | private String chargeAddress; |
| | | |
| | | } |
| | |
| | | FROM mall_member_amount a |
| | | where a.member_id = #{memberId} |
| | | </select> |
| | | |
| | | <select id="getMemberChargeListInPage" resultType="cc.mrbird.febs.mall.entity.MallMemberCharge"> |
| | | select |
| | | a.*, |
| | | b.account_login accountLogin |
| | | from mall_member_charge a |
| | | left join mall_member b on a.member_id = b.id |
| | | <where> |
| | | <if test="record.accountLogin!=null and record.accountLogin!=''"> |
| | | and b.account_login like concat('%', #{record.accountLogin},'%') |
| | | </if> |
| | | <if test="record.status!=null"> |
| | | and a.state = #{record.status} |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-member-charge" 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="withdraw-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="accountLogin" autocomplete="off" placeholder="登录账户" 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="status"> |
| | | <option value=""></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="memberChargeTable" lay-data="{id: 'memberChargeTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .layui-table-cell { |
| | | height: auto !important; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="withdraw-status"> |
| | | {{# |
| | | var state = { |
| | | 1: {title: '进行中'}, |
| | | 2: {title: '成功'}, |
| | | 3: {title: '失败'} |
| | | }[d.state]; |
| | | }} |
| | | <span>{{ state.title }}</span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="tableToolBarOrder"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="confirmOrder">提现确认</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="confirmCancel">提现取消</button> |
| | | </div> |
| | | </script> |
| | | |
| | | |
| | | <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-charge'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | initTable(); |
| | | |
| | | table.on('toolbar(memberChargeTable)', function(obj){ |
| | | var event = obj.event; |
| | | var id = obj.config.id; |
| | | var checkStatus = table.checkStatus(id); |
| | | if(event === 'confirmOrder'){ |
| | | var data = checkStatus.data; |
| | | let ids = ""; |
| | | let totalAmount = 0; |
| | | for(let i = 0;i < data.length;i++){ |
| | | if(data[i].status != 1){ |
| | | febs.alert.warn('请选择审核中的记录'); |
| | | return; |
| | | }else{ |
| | | ids = ids + data[i].id+","; |
| | | totalAmount = totalAmount + data[i].amount; |
| | | } |
| | | } |
| | | if(ids == null || ids == ""){ |
| | | febs.alert.warn('请选择审核中的记录'); |
| | | return; |
| | | } |
| | | |
| | | febs.modal.confirm('USDT提现', '总额为:'+totalAmount, function () { |
| | | confirmOrder(ids); |
| | | }); |
| | | } |
| | | if(event === 'confirmCancel'){ |
| | | var data = checkStatus.data; |
| | | let ids = ""; |
| | | let totalAmount = 0; |
| | | for(let i = 0;i < data.length;i++){ |
| | | if(data[i].status != 1){ |
| | | febs.alert.warn('请选择审核中的记录'); |
| | | return; |
| | | }else{ |
| | | ids = ids + data[i].id+","; |
| | | totalAmount = totalAmount + data[i].amount; |
| | | } |
| | | } |
| | | if(ids == null || ids == ""){ |
| | | febs.alert.warn('请选择审核中的记录'); |
| | | return; |
| | | } |
| | | |
| | | febs.modal.confirm('提现取消', '总额为:'+totalAmount, function () { |
| | | confirmCancel(ids); |
| | | }); |
| | | } |
| | | }); |
| | | function confirmOrder(ids) { |
| | | febs.get(ctx + 'admin/mallMember/confirmOrder?&orderIds='+ids, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | |
| | | }); |
| | | } |
| | | function confirmCancel(ids) { |
| | | febs.get(ctx + 'admin/mallMember/confirmCancel?&orderIds='+ids, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | |
| | | }); |
| | | } |
| | | |
| | | table.on('sort(memberChargeTable)', function (obj) { |
| | | sortObject = obj; |
| | | tableIns.reload({ |
| | | initSort: obj, |
| | | where: $.extend(getQueryParams(), { |
| | | field: obj.field, |
| | | order: obj.type |
| | | }) |
| | | }); |
| | | }); |
| | | |
| | | $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}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'memberChargeTable', |
| | | url: ctx + 'admin/mallMember/memberChargeList', |
| | | toolbar: '#tableToolBarOrder', |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'}, |
| | | {field: 'accountLogin', title: '账户', minWidth: 180}, |
| | | {field: 'amount', title: '金额(USDT)', minWidth: 130}, |
| | | {title: '提现状态', templet: '#withdraw-status'}, |
| | | {field: 'createdTime', title: '创建时间', minWidth: 180}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | function getQueryParams() { |
| | | return { |
| | | accountLogin: $searchForm.find('input[name="accountLogin"]').val().trim(), |
| | | status: $searchForm.find("select[name='status']").val(), |
| | | invalidate_ie_cache: new Date() |
| | | }; |
| | | } |
| | | |
| | | function changeStatus(url) { |
| | | febs.post(ctx + url, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | }) |
| | | </script> |