New file |
| | |
| | | package com.xcong.excoin.modules.yunding.controller; |
| | | |
| | | import com.xcong.excoin.common.controller.BaseController; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.trademanage.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.service.IBasicSettingService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/yd") |
| | | public class BasicSettingController extends BaseController { |
| | | |
| | | private final IBasicSettingService basicSettingService; |
| | | |
| | | /** |
| | | * 订单查询 |
| | | */ |
| | | @GetMapping("getOrderList") |
| | | public FebsResponse getOrderList(YdOrderEntity ydOrderEntity, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(basicSettingService.getOrderList(ydOrderEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | /** |
| | | * 产品查询 |
| | | */ |
| | | @GetMapping("getYdProductList") |
| | | public FebsResponse getYdProductList(YdProductEntity ydProductEntity, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(basicSettingService.getYdProductList(ydProductEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | /** |
| | | * 会员算力查询 |
| | | */ |
| | | @GetMapping("getYdMemberList") |
| | | public FebsResponse getYdMemberList(YdOrderEntity ydOrderEntity, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(basicSettingService.getYdMemberList(ydOrderEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.controller; |
| | | |
| | | import com.xcong.excoin.common.entity.FebsConstant; |
| | | import com.xcong.excoin.common.utils.FebsUtil; |
| | | import com.xcong.excoin.modules.yunding.service.IBasicSettingService; |
| | | 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("yundingView") |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/yunding") |
| | | @RequiredArgsConstructor |
| | | public class ViewController { |
| | | |
| | | private final IBasicSettingService basicSettingService; |
| | | |
| | | /** |
| | | * 订单查询 |
| | | * @return |
| | | */ |
| | | @GetMapping("yundingOrderList") |
| | | @RequiresPermissions("yundingOrderList:view") |
| | | public String memberOrderList() { |
| | | return FebsUtil.view("modules/yunding/yundingOrderList"); |
| | | } |
| | | |
| | | /** |
| | | * 产品查询 |
| | | * @return |
| | | */ |
| | | @GetMapping("ydProductList") |
| | | @RequiresPermissions("ydProductList:view") |
| | | public String ydProductList() { |
| | | return FebsUtil.view("modules/yunding/ydProductList"); |
| | | } |
| | | |
| | | /** |
| | | * 会员算力查询 |
| | | * @return |
| | | */ |
| | | @GetMapping("ydMemberList") |
| | | @RequiresPermissions("ydMemberList:view") |
| | | public String ydMemberList() { |
| | | return FebsUtil.view("modules/yunding/ydMemberList"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | //会员级别设置表 |
| | | @Data |
| | | @TableName("basic_level_setting") |
| | | public class BasicLevelSettingEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | //等级名称 |
| | | private String name; |
| | | //等级编码 |
| | | private String code; |
| | | //XCH返佣比例 |
| | | private BigDecimal xchRatio; |
| | | //USDT返佣比例 |
| | | private BigDecimal usdtRatio; |
| | | //成为代理条件(充值USDT的数量) |
| | | private BigDecimal chargeUsdt; |
| | | //成为代理条件(购买算力的数量) |
| | | private BigDecimal calculationPower; |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | //基础参数设置表 |
| | | @Data |
| | | @TableName("basic_setting") |
| | | public class BasicSettingEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | //合伙人收益比例 |
| | | private BigDecimal partnerRatio; |
| | | |
| | | //当前每T预计产生收益 |
| | | private BigDecimal prifitT; |
| | | |
| | | //全网算力 |
| | | private BigDecimal allPower; |
| | | |
| | | //日平均收益 |
| | | private BigDecimal profitDay; |
| | | |
| | | //矿机模式 |
| | | private String powerModel; |
| | | |
| | | //24小时爆块 |
| | | private BigDecimal explosiveBlock; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xcong.excoin.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | //yd_order订单表 |
| | | @Data |
| | | @TableName("yd_order") |
| | | public class YdOrderEntity extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 会员ID |
| | | */ |
| | | |
| | | private Long memberId; |
| | | |
| | | /** |
| | | * 产品ID |
| | | */ |
| | | |
| | | private Long productId; |
| | | |
| | | /** |
| | | * 购买数量 |
| | | */ |
| | | |
| | | private Integer quantity; |
| | | /** |
| | | * 返利状态 1:待返利 2:已返利 |
| | | */ |
| | | |
| | | private Integer returnState; |
| | | |
| | | public static final int RETURN_STATE_READY = 1; |
| | | public static final int RETURN_STATE_DONE = 2; |
| | | /** |
| | | * 返利类型 1:USDT 2:XCH |
| | | */ |
| | | |
| | | private Integer returnType; |
| | | |
| | | /** |
| | | * 总金额 |
| | | */ |
| | | |
| | | private BigDecimal amount; |
| | | |
| | | /** |
| | | * 累计收益 |
| | | */ |
| | | |
| | | private BigDecimal totalProfit; |
| | | |
| | | /** |
| | | * 今日收益 |
| | | */ |
| | | |
| | | private BigDecimal todayProfit; |
| | | |
| | | /** |
| | | * 1:待生效 2:生效中 3:已终止 |
| | | */ |
| | | |
| | | private Integer state; |
| | | public static final int ORDER_STATE_READY = 1; |
| | | public static final int ORDER_STATE_WORK = 2; |
| | | public static final int ORDER_STATE_END = 3; |
| | | |
| | | /** |
| | | * 购买日期 |
| | | */ |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date buyTime; |
| | | |
| | | /** |
| | | * 生效日期 |
| | | */ |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date workTime; |
| | | |
| | | /** |
| | | * 终止日期 |
| | | */ |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String account; |
| | | |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | @TableField(exist = false) |
| | | private String inviteId; |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @TableField(exist = false) |
| | | private String proUnit; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | //yd_product矿机产品表 |
| | | @Data |
| | | @TableName("yd_product") |
| | | public class YdProductEntity{ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | |
| | | private String name; |
| | | |
| | | /** |
| | | * 编码 |
| | | */ |
| | | |
| | | private String code; |
| | | |
| | | /** |
| | | * 产品总数 |
| | | */ |
| | | |
| | | private BigDecimal totalT; |
| | | |
| | | /** |
| | | * 剩余产品数量 |
| | | */ |
| | | |
| | | private BigDecimal surplusT; |
| | | |
| | | /** |
| | | * 产品售价 |
| | | */ |
| | | |
| | | private BigDecimal salePrice; |
| | | |
| | | /** |
| | | * 服务周期 |
| | | */ |
| | | |
| | | private Integer proCycle; |
| | | |
| | | /** |
| | | * 管理费 |
| | | */ |
| | | |
| | | private BigDecimal manageExpense; |
| | | |
| | | /** |
| | | * 上架天数 |
| | | */ |
| | | |
| | | private Integer shelvesDays; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | |
| | | private String proUnit; |
| | | |
| | | /** |
| | | * 产品币种 |
| | | */ |
| | | |
| | | private String coin; |
| | | |
| | | /** |
| | | * 限购 |
| | | */ |
| | | |
| | | private Integer limitedNum; |
| | | |
| | | /** |
| | | * 1:体验 2:正式 |
| | | */ |
| | | |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 产品类型1:期货 2:现货 |
| | | */ |
| | | |
| | | private Integer typeCoin; |
| | | |
| | | /** |
| | | * 优惠 1:免除电费 |
| | | */ |
| | | |
| | | private Integer favourable; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xcong.excoin.modules.yunding.entity.BasicLevelSettingEntity; |
| | | |
| | | public interface BasicLevelSettingMapper extends BaseMapper<BasicLevelSettingEntity> { |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xcong.excoin.modules.yunding.entity.BasicSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.vo.YdMemberVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public interface BasicSettingMapper extends BaseMapper<BasicSettingEntity> { |
| | | |
| | | IPage<YdOrderEntity> getOrderList(Page<YdOrderEntity> page, @Param("record") YdOrderEntity ydOrderEntity); |
| | | |
| | | IPage<YdProductEntity> getYdProductList(Page<YdProductEntity> page, @Param("record") YdProductEntity ydProductEntity); |
| | | |
| | | IPage<YdMemberVo> getYdMemberList(Page<YdMemberVo> page, @Param("record")YdOrderEntity ydOrderEntity); |
| | | |
| | | int selectPowerByMemberIdAndState(@Param("memberId")long memberId, @Param("state")int orderStateReady); |
| | | |
| | | BigDecimal selectAmountByMemberId(@Param("memberId")long memberId); |
| | | |
| | | BigDecimal selectChargeAmountByMemberIdAndStatus(@Param("memberId")long memberId, @Param("status")int status); |
| | | |
| | | BigDecimal selectWithdrawAmountByMemberIdAndStatusAndIsInside(@Param("memberId")long memberId, |
| | | @Param("status")int status, |
| | | @Param("isInside")String isInside); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.yunding.entity.BasicSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.vo.YdMemberVo; |
| | | |
| | | public interface IBasicSettingService extends IService<BasicSettingEntity> { |
| | | |
| | | IPage<YdOrderEntity> getOrderList(YdOrderEntity ydOrderEntity, QueryRequest request); |
| | | |
| | | IPage<YdProductEntity> getYdProductList(YdProductEntity ydProductEntity, QueryRequest request); |
| | | |
| | | IPage<YdMemberVo> getYdMemberList(YdOrderEntity ydOrderEntity, QueryRequest request); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity; |
| | | import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper; |
| | | import com.xcong.excoin.modules.yunding.entity.BasicSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; |
| | | import com.xcong.excoin.modules.yunding.entity.YdProductEntity; |
| | | import com.xcong.excoin.modules.yunding.mapper.BasicSettingMapper; |
| | | import com.xcong.excoin.modules.yunding.service.IBasicSettingService; |
| | | import com.xcong.excoin.modules.yunding.vo.YdMemberVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class BasicSettingServiceImpl extends ServiceImpl<BasicSettingMapper, BasicSettingEntity> implements IBasicSettingService { |
| | | |
| | | @Resource |
| | | private BasicSettingMapper basicSettingMapper; |
| | | @Resource |
| | | private MemberWalletCoinMapper memberWalletCoinMapper; |
| | | |
| | | @Override |
| | | public IPage<YdOrderEntity> getOrderList(YdOrderEntity ydOrderEntity, QueryRequest request) { |
| | | log.info("订单列表"); |
| | | Page<YdOrderEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<YdOrderEntity> ydOrderEntitys = basicSettingMapper.getOrderList(page, ydOrderEntity); |
| | | return ydOrderEntitys; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<YdProductEntity> getYdProductList(YdProductEntity ydProductEntity, QueryRequest request) { |
| | | log.info("产品列表"); |
| | | Page<YdProductEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<YdProductEntity> ydProductEntitys = basicSettingMapper.getYdProductList(page, ydProductEntity); |
| | | return ydProductEntitys; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<YdMemberVo> getYdMemberList(YdOrderEntity ydOrderEntity, QueryRequest request) { |
| | | log.info("会员算力查询"); |
| | | Page<YdMemberVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<YdMemberVo> ydMemberVos = basicSettingMapper.getYdMemberList(page, ydOrderEntity); |
| | | List<YdMemberVo> records = ydMemberVos.getRecords(); |
| | | if(CollUtil.isNotEmpty(records)){ |
| | | for(YdMemberVo ydMemberVo : records){ |
| | | long memberId = ydMemberVo.getId(); |
| | | int quantityReady = basicSettingMapper.selectPowerByMemberIdAndState(memberId,YdOrderEntity.ORDER_STATE_READY); |
| | | ydMemberVo.setQuantityReady(quantityReady); |
| | | int quantityWork = basicSettingMapper.selectPowerByMemberIdAndState(memberId,YdOrderEntity.ORDER_STATE_WORK); |
| | | ydMemberVo.setQuantityWork(quantityWork); |
| | | int quantityEnd = basicSettingMapper.selectPowerByMemberIdAndState(memberId,YdOrderEntity.ORDER_STATE_END); |
| | | ydMemberVo.setQuantityEnd(quantityEnd); |
| | | BigDecimal totalUsed = basicSettingMapper.selectAmountByMemberId(memberId); |
| | | ydMemberVo.setTotalUsed(totalUsed); |
| | | MemberWalletCoinEntity memberWalletCoinEntity = memberWalletCoinMapper.findWalletCoinByMemberIdAndWalletCode(memberId, "USDT"); |
| | | ydMemberVo.setAvailableBalance(memberWalletCoinEntity.getAvailableBalance()); |
| | | BigDecimal inBalance = basicSettingMapper.selectChargeAmountByMemberIdAndStatus(memberId,1); |
| | | ydMemberVo.setInBalance(inBalance); |
| | | BigDecimal outBalance = basicSettingMapper.selectWithdrawAmountByMemberIdAndStatusAndIsInside(memberId,2,"N"); |
| | | ydMemberVo.setOutBalance(outBalance); |
| | | } |
| | | } |
| | | return ydMemberVos; |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.yunding.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.xcong.excoin.common.utils.BigDecimalSerialize; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class YdMemberVo { |
| | | |
| | | private String phone; |
| | | private long id; |
| | | private int quantityReady; |
| | | private int quantityWork; |
| | | private int quantityEnd; |
| | | |
| | | //购买算力总花费USDT |
| | | @JsonSerialize(using = BigDecimalSerialize.class) |
| | | private BigDecimal totalUsed; |
| | | //账户余额 |
| | | @JsonSerialize(using = BigDecimalSerialize.class) |
| | | private BigDecimal availableBalance; |
| | | //充值金额 |
| | | @JsonSerialize(using = BigDecimalSerialize.class) |
| | | private BigDecimal inBalance; |
| | | //提现金额 |
| | | @JsonSerialize(using = BigDecimalSerialize.class) |
| | | private BigDecimal outBalance; |
| | | |
| | | } |
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="com.xcong.excoin.modules.yunding.mapper.BasicSettingMapper"> |
| | | |
| | | |
| | | <select id="getOrderList" resultType="com.xcong.excoin.modules.yunding.entity.YdOrderEntity"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | yd_order a |
| | | left join yd_product b on b.id = a.product_id |
| | | left join member c on c.id = a.member_id |
| | | <if test="record != null"> |
| | | <where> |
| | | <if test="record.state != null" > |
| | | and a.state=#{record.state} |
| | | </if> |
| | | <if test="record.account!=null and record.account!=''"> |
| | | and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | ORDER BY a.create_time DESC |
| | | </select> |
| | | |
| | | <select id="getYdProductList" resultType="com.xcong.excoin.modules.yunding.entity.YdProductEntity"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | yd_product a |
| | | </select> |
| | | |
| | | <select id="getYdMemberList" resultType="com.xcong.excoin.modules.yunding.vo.YdMemberVo"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | member c |
| | | <if test="record != null"> |
| | | <where> |
| | | <if test="record.account!=null and record.account!=''"> |
| | | and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account}) |
| | | </if> |
| | | </where> |
| | | </if> |
| | | ORDER BY c.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectPowerByMemberIdAndState" resultType="java.lang.Integer"> |
| | | SELECT |
| | | IFNULL(sum(quantity),0) |
| | | FROM |
| | | yd_order a |
| | | where a.member_id = #{memberId} |
| | | and a.state = #{state} |
| | | </select> |
| | | |
| | | <select id="selectAmountByMemberId" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | IFNULL(sum(amount),0) |
| | | FROM |
| | | yd_order a |
| | | where a.member_id = #{memberId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectChargeAmountByMemberIdAndStatus" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | IFNULL(sum(amount),0) |
| | | FROM |
| | | member_coin_charge a |
| | | where a.member_id = #{memberId} |
| | | and a.status = #{status} |
| | | </select> |
| | | |
| | | <select id="selectWithdrawAmountByMemberIdAndStatusAndIsInside" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | IFNULL(sum(amount),0) |
| | | FROM |
| | | member_coin_withdraw a |
| | | where a.member_id = #{memberId} |
| | | and a.status = #{status} |
| | | and a.is_inside = #{isInside} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="trader-profit" 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"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" 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="state"> |
| | | <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="userTable" lay-data="{id: 'userTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#trader-profit'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'edit') { |
| | | febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'seeFollowerInfo') { |
| | | febs.modal.open('跟随者详情', 'modules/documentary/seeFollowerInfo/' + data.id, { |
| | | area: $(window).width() <= 750 ? '90%' : '80%', |
| | | offset: '30px', |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | cancel: function(){ |
| | | var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name |
| | | parent.layer.close(index);//关闭当前窗口 |
| | | window.parent.location.reload();//刷新 |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'modifyProfitRatio') { |
| | | febs.modal.open('收益率修改', 'modules/documentary/modifyProfitRatio/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'getOut') { |
| | | febs.modal.confirm('确认', '您是否要踢出该交易员?', function () { |
| | | confirmUsers(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOn') { |
| | | febs.modal.confirm('确认', '您是否推荐当前交易员?', function () { |
| | | confirmUsersGetOn(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOutFrist') { |
| | | febs.modal.confirm('确认', '您是否取消推荐当前交易员?', function () { |
| | | confirmUsersGetOutFrist(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getFull') { |
| | | febs.modal.confirm('确认', '您是否要设置成【满员】状态?', function () { |
| | | cancelUsers(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function confirmUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetOut/' + id, null, function () { |
| | | febs.alert.success('踢出成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOn(id) { |
| | | febs.get(ctx + 'documentary/traderGetOn/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOutFrist(id) { |
| | | febs.get(ctx + 'documentary/traderGetOutFrist/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function cancelUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetFull/' + 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: 'userTable', |
| | | url: ctx + 'yd/getYdMemberList', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, |
| | | {field: 'availableBalance', title: '账户余额', |
| | | templet: function (d) { |
| | | if (d.availableBalance > 0) { |
| | | return '<span style="color:green;">'+d.availableBalance+'</span>' |
| | | }else{ |
| | | return '<span>'+d.availableBalance+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'totalUsed', title: '购买金额', |
| | | templet: function (d) { |
| | | if (d.totalUsed > 0) { |
| | | return '<span style="color:green;">'+d.totalUsed+'</span>' |
| | | }else{ |
| | | return '<span>'+d.totalUsed+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'inBalance', title: '充值金额', |
| | | templet: function (d) { |
| | | if (d.inBalance > 0) { |
| | | return '<span style="color:green;">'+d.inBalance+'</span>' |
| | | }else{ |
| | | return '<span>'+d.inBalance+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'outBalance', title: '提现金额', |
| | | templet: function (d) { |
| | | if (d.outBalance > 0) { |
| | | return '<span style="color:red;">'+d.outBalance+'</span>' |
| | | }else{ |
| | | return '<span>'+d.outBalance+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'quantityReady', title: '待生效算力', |
| | | templet: function (d) { |
| | | if (d.quantityReady > 0) { |
| | | return '<span style="color:blue;">'+d.quantityReady+'</span>' |
| | | }else{ |
| | | return '<span>'+d.quantityReady+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'quantityWork', title: '生效算力', |
| | | templet: function (d) { |
| | | if (d.quantityWork > 0) { |
| | | return '<span style="color:blue;">'+d.quantityWork+'</span>' |
| | | }else{ |
| | | return '<span>'+d.quantityWork+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'quantityEnd', title: '已终止算力', |
| | | templet: function (d) { |
| | | if (d.quantityEnd > 0) { |
| | | return '<span style="color:blue;">'+d.quantityEnd+'</span>' |
| | | }else{ |
| | | return '<span>'+d.quantityEnd+'</span>' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | state: $searchForm.find("select[name='state']").val(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="trader-profit" 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"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input"> |
| | | </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="userTable" lay-data="{id: 'userTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#trader-profit'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'edit') { |
| | | febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'seeFollowerInfo') { |
| | | febs.modal.open('跟随者详情', 'modules/documentary/seeFollowerInfo/' + data.id, { |
| | | area: $(window).width() <= 750 ? '90%' : '80%', |
| | | offset: '30px', |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | cancel: function(){ |
| | | var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name |
| | | parent.layer.close(index);//关闭当前窗口 |
| | | window.parent.location.reload();//刷新 |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'modifyProfitRatio') { |
| | | febs.modal.open('收益率修改', 'modules/documentary/modifyProfitRatio/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'getOut') { |
| | | febs.modal.confirm('确认', '您是否要踢出该交易员?', function () { |
| | | confirmUsers(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOn') { |
| | | febs.modal.confirm('确认', '您是否推荐当前交易员?', function () { |
| | | confirmUsersGetOn(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOutFrist') { |
| | | febs.modal.confirm('确认', '您是否取消推荐当前交易员?', function () { |
| | | confirmUsersGetOutFrist(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getFull') { |
| | | febs.modal.confirm('确认', '您是否要设置成【满员】状态?', function () { |
| | | cancelUsers(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function confirmUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetOut/' + id, null, function () { |
| | | febs.alert.success('踢出成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOn(id) { |
| | | febs.get(ctx + 'documentary/traderGetOn/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOutFrist(id) { |
| | | febs.get(ctx + 'documentary/traderGetOutFrist/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function cancelUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetFull/' + 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: 'userTable', |
| | | url: ctx + 'yd/getYdProductList', |
| | | cols: [[ |
| | | {field: 'name', title: '产品名称', minWidth: 200,align:'center'}, |
| | | {field: 'totalT', title: '总数', minWidth: 80,align:'center'}, |
| | | {field: 'surplusT', title: '剩余数量', minWidth: 80,align:'center'}, |
| | | {field: 'salePrice', title: '产品售价', minWidth: 80,align:'center'}, |
| | | {field: 'shelvesDays', title: '上架天数', minWidth: 80,align:'center'}, |
| | | {field: 'proCycle', title: '服务周期', minWidth: 80,align:'center'}, |
| | | {field: 'manageExpense', title: '管理费', minWidth: 80,align:'center'}, |
| | | {field: 'proUnit', title: '单位', minWidth: 80,align:'center'}, |
| | | {field: 'coin', title: '产品币种', minWidth: 80,align:'center'}, |
| | | {field: 'limitedNum', title: '限购数量', minWidth: 80,align:'center'}, |
| | | {field: 'typeCoin', title: '产品类型', |
| | | templet: function (d) { |
| | | if (d.typeCoin === 1) { |
| | | return '<span style="color:blue;">期货</span>' |
| | | } else if (d.typeCoin === 2) { |
| | | return '<span style="color:#008000;">现货</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'favourable', title: '优惠', |
| | | templet: function (d) { |
| | | if (d.favourable === 1) { |
| | | return '<span style="color:blue;">免除电费</span>' |
| | | } else { |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="trader-profit" 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"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号/邮箱/邀请码" name="account" 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="state"> |
| | | <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="userTable" lay-data="{id: 'userTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#trader-profit'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'edit') { |
| | | febs.modal.open('交易员审核', 'modules/documentary/traderDetail/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'seeFollowerInfo') { |
| | | febs.modal.open('跟随者详情', 'modules/documentary/seeFollowerInfo/' + data.id, { |
| | | area: $(window).width() <= 750 ? '90%' : '80%', |
| | | offset: '30px', |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | cancel: function(){ |
| | | var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name |
| | | parent.layer.close(index);//关闭当前窗口 |
| | | window.parent.location.reload();//刷新 |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'modifyProfitRatio') { |
| | | febs.modal.open('收益率修改', 'modules/documentary/modifyProfitRatio/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | $query.click(); |
| | | } |
| | | if (layEvent === 'getOut') { |
| | | febs.modal.confirm('确认', '您是否要踢出该交易员?', function () { |
| | | confirmUsers(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOn') { |
| | | febs.modal.confirm('确认', '您是否推荐当前交易员?', function () { |
| | | confirmUsersGetOn(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getOutFrist') { |
| | | febs.modal.confirm('确认', '您是否取消推荐当前交易员?', function () { |
| | | confirmUsersGetOutFrist(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'getFull') { |
| | | febs.modal.confirm('确认', '您是否要设置成【满员】状态?', function () { |
| | | cancelUsers(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function confirmUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetOut/' + id, null, function () { |
| | | febs.alert.success('踢出成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOn(id) { |
| | | febs.get(ctx + 'documentary/traderGetOn/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function confirmUsersGetOutFrist(id) { |
| | | febs.get(ctx + 'documentary/traderGetOutFrist/' + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function cancelUsers(id) { |
| | | febs.get(ctx + 'documentary/traderGetFull/' + 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: 'userTable', |
| | | url: ctx + 'yd/getOrderList', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'}, |
| | | {field: 'name', title: '产品名称', minWidth: 80,align:'center'}, |
| | | {field: 'quantity', title: '购买数量', minWidth: 80,align:'center'}, |
| | | {field: 'proUnit', title: '单位', minWidth: 80,align:'center'}, |
| | | {field: 'amount', title: '总金额', minWidth: 80,align:'center'}, |
| | | {field: 'buyTime', title: '购买日期', minWidth: 80,align:'center'}, |
| | | {field: 'workTime', title: '生效日期', minWidth: 80,align:'center'}, |
| | | {field: 'endTime', title: '终止日期', minWidth: 80,align:'center'}, |
| | | {field: 'totalProfit', title: '累计收益', minWidth: 80,align:'center'}, |
| | | {field: 'returnState', title: '今日收益状态', |
| | | templet: function (d) { |
| | | if (d.returnState === 1) { |
| | | return '<span style="color:red;">待收益</span>' |
| | | } else if (d.returnState === 2) { |
| | | return '<span style="color:green;">已收益</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'returnType', title: '收益类型', |
| | | templet: function (d) { |
| | | if (d.returnType === 1) { |
| | | return '<span style="color:blue;">USDT</span>' |
| | | } else if (d.returnType === 2) { |
| | | return '<span style="color:green;">XCH</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'todayProfit', title: '今日收益', minWidth: 80,align:'center'}, |
| | | {field: 'state', title: '状态', |
| | | templet: function (d) { |
| | | if (d.state === 1) { |
| | | return '<span style="color:blue;">待生效</span>' |
| | | } else if (d.state === 2) { |
| | | return '<span style="color:green;">生效中</span>' |
| | | }else if (d.state === 3) { |
| | | return '<span style="color:red;">已终止</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | state: $searchForm.find("select[name='state']").val(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |