From 2f1b0accd6e985fcb0870b8856e07839a0d69471 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 21 May 2020 19:06:13 +0800
Subject: [PATCH] 20200521 资产划转
---
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java | 124 +-
src/main/resources/mapper/member/MemberWalletContractDao.xml | 17
src/main/resources/mapper/platform/CnyUsdtExchangeDao.xml | 13
src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java | 60 +
src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java | 453 ++++++++++++++
src/main/java/com/xcong/excoin/modules/coin/dao/platform/CnyUsdtExchangeDao.java | 12
src/main/resources/mapper/member/MemberWalletCoinDao.xml | 20
src/main/java/com/xcong/excoin/common/response/Result.java | 133 ++-
src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java | 16
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java | 113 +-
src/main/resources/mapper/member/MemberWalletAgentDao.xml | 14
src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java | 35 +
src/main/resources/i18n/messages_en_US.properties | 224 ++++++
src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java | 7
src/main/resources/i18n/messages_zh_CN.properties | 225 ++++++
src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java | 187 +++++
src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java | 26
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java | 19
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java | 17
src/main/java/com/xcong/excoin/modules/coin/entity/CnyUsdtExchange.java | 28
src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java | 27
src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml | 19
src/main/java/com/xcong/excoin/common/enumerates/MemberWalletCoinEnum.java | 44 +
src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java | 44 +
24 files changed, 1,655 insertions(+), 222 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/common/enumerates/MemberWalletCoinEnum.java b/src/main/java/com/xcong/excoin/common/enumerates/MemberWalletCoinEnum.java
new file mode 100644
index 0000000..bb4ecee
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/common/enumerates/MemberWalletCoinEnum.java
@@ -0,0 +1,44 @@
+package com.xcong.excoin.common.enumerates;
+
+public enum MemberWalletCoinEnum {
+
+ WALLETCOINUSDT("walletCoinUsdt", "usdt"),
+ WALLETCOINLIST("walletCoinList", "walletList"),
+ WALLETCOINCNY("walletCoinCny", "cny"),
+ WALLETAGENTCNY("walletCoinCny", "wallet"),
+
+ CONTENTTOCONTRACT("0001","转出至合约账户"),
+ CONTENTFROMWALLETCOIN("0002","由币币账户转入"),
+
+ CONTENTTOWALLETCOIN("0003","转出至币币账户"),
+ CONTENTFROMCONTRACT("0004","由合约账户转入"),
+
+ CONTENTFROMAGENT("0005","由代理账户转入"),
+
+ WALLETCOINCODE("USDT", "USDT")
+ ;
+
+ private String name;
+ private String value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ private MemberWalletCoinEnum(String name, String value) {
+ this.name = name;
+ this.value = value;
+ }
+}
diff --git a/src/main/java/com/xcong/excoin/common/response/Result.java b/src/main/java/com/xcong/excoin/common/response/Result.java
index d75ad2b..f47e154 100644
--- a/src/main/java/com/xcong/excoin/common/response/Result.java
+++ b/src/main/java/com/xcong/excoin/common/response/Result.java
@@ -1,62 +1,71 @@
-package com.xcong.excoin.common.response;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * @author wzy
- * @date 2020-04-29 11:27
- **/
-@Data
-@ApiModel(value = "返回基类", description = "基础返回类")
-public class Result implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private static final int SUCCESS = 0;
-
- private static final int FAIL = -1;
-
- private static final int LOGIN_FAIL = -2;
-
- @ApiModelProperty(value = "状态码", example = "0")
- private int code;
-
- @ApiModelProperty(value = "提示消息")
- private String msg;
-
- @ApiModelProperty(value = "数据对象")
- private Object data;
-
- public static Result ok(String msg) {
- Result result = new Result();
- result.code = SUCCESS;
- result.msg = msg;
- return result;
- }
-
- public static Result ok(String msg, Object data) {
- Result result = new Result();
- result.code = SUCCESS;
- result.msg = msg;
- result.data = data;
- return result;
- }
-
- public static Result fail(String msg) {
- Result result = new Result();
- result.code = FAIL;
- result.msg = msg;
- return result;
- }
-
- public static Result loginFail(String msg) {
- Result result = new Result();
- result.code = LOGIN_FAIL;
- result.msg = msg;
- return result;
- }
-}
+package com.xcong.excoin.common.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author wzy
+ * @date 2020-04-29 11:27
+ **/
+@Data
+@ApiModel(value = "返回基类", description = "基础返回类")
+public class Result implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final int SUCCESS = 0;
+
+ private static final String SUCCESS_MSG = "success";
+
+ private static final int FAIL = -1;
+
+ private static final int LOGIN_FAIL = -2;
+
+ @ApiModelProperty(value = "状态码", example = "0")
+ private int code;
+
+ @ApiModelProperty(value = "提示消息")
+ private String msg;
+
+ @ApiModelProperty(value = "数据对象")
+ private Object data;
+
+ public static Result ok(String msg) {
+ Result result = new Result();
+ result.code = SUCCESS;
+ result.msg = msg;
+ return result;
+ }
+
+ public static Result ok(String msg, Object data) {
+ Result result = new Result();
+ result.code = SUCCESS;
+ result.msg = msg;
+ result.data = data;
+ return result;
+ }
+ public static Result ok(Object data) {
+ Result result = new Result();
+ result.code = SUCCESS;
+ result.msg = SUCCESS_MSG;
+ result.data = data;
+ return result;
+ }
+
+ public static Result fail(String msg) {
+ Result result = new Result();
+ result.code = FAIL;
+ result.msg = msg;
+ return result;
+ }
+
+ public static Result loginFail(String msg) {
+ Result result = new Result();
+ result.code = LOGIN_FAIL;
+ result.msg = msg;
+ return result;
+ }
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java b/src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java
new file mode 100644
index 0000000..f1bfdbc
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java
@@ -0,0 +1,187 @@
+package com.xcong.excoin.modules.coin.controller;
+
+import java.math.BigDecimal;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.coin.parameter.dto.TransferOfBalanceDto;
+import com.xcong.excoin.modules.coin.service.CoinService;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@Api(value = "会员资产接口", tags = "会员资产接口")
+@RestController
+@RequestMapping(value = "/api/coin")
+public class CoinController {
+
+ @Resource
+ private CoinService coinService;
+
+ /**
+ * 获取我的币币资产信息
+ * @return
+ */
+ @ApiOperation(value = "获取我的币币账户信息", notes = "获取我的币币账户信息")
+ @GetMapping(value = "/getWalletCoin")
+ public Result getWalletCoin() {
+ return coinService.getWalletCoin();
+ }
+
+ /**
+ * 获取币币账户某个币种信息
+ * @return
+ */
+ @ApiOperation(value="获取币币账户某个币种信息", notes="获取币币账户某个币种信息")
+ @GetMapping(value = "/getWalletCoinById")
+ public Result getWalletCoinById(@RequestParam("id") Long id) {
+ return coinService.getWalletCoinById(id);
+ }
+
+ /**
+ * --todo
+ * 获取我的合约资产信息
+ * @return
+ */
+ @ApiOperation(value="获取我的合约账户信息", notes="获取我的合约账户信息")
+ @GetMapping(value="/getWalletContractById")
+ public Result getWalletContractById() {
+ return coinService.getWalletContractById();
+ }
+
+ /**
+ * 查询合约账户里面的资产余额
+ * @return
+ */
+ @ApiOperation(value="查询合约账户里面的资产余额", notes="查询合约账户里面的资产余额")
+ @GetMapping(value="/findWalletContractBySymbol")
+ public Result findWalletContractBySymbol(String symbol) {
+ return coinService.findWalletContractBySymbol(symbol);
+ }
+
+ /**
+ * 查询币币账户里面的可用资产余额
+ * @return
+ */
+ @ApiOperation(value="查询币币账户里面的可用资产余额", notes="查询币币账户里面的可用资产余额")
+ @GetMapping(value="/findWalletCoinBySymbol")
+ public Result findWalletCoinBysymbol(String symbol) {
+ return coinService.findWalletCoinBySymbol(symbol);
+ }
+
+ /**
+ * 查询代理账户里面的资产余额
+ * @return
+ */
+ @ApiOperation(value="查询代理账户里面的资产余额", notes="查询代理账户里面的资产余额")
+ @GetMapping(value="/findWalletAgentBySymbol")
+ public Result findWalletAgentBySymbol() {
+ return coinService.findWalletAgentBySymbol();
+ }
+
+ /**
+ * 获取币币资产交易记录
+ * @return
+ */
+ @ApiOperation(value="获取币币资产交易记录", notes="获取币币资产交易记录")
+ @GetMapping(value="/getWalletCoinRecords")
+ public Result getWalletCoinRecords() {
+ return coinService.getWalletCoinRecords();
+ }
+
+ /**
+ * 获取合约资产交易记录
+ * @return
+ */
+ @ApiOperation(value="获取合约资产交易记录", notes="获取合约资产交易记录")
+ @GetMapping(value="/getWalletContractRecords")
+ public Result getWalletContractRecords(String symbol) {
+ return coinService.getWalletContractRecords(symbol);
+ }
+
+ /**
+ * 获取代理资产交易记录
+ * @return
+ */
+ @ApiOperation(value="获取代理资产交易记录", notes="获取代理资产交易记录")
+ @GetMapping(value="/getWalletAgentRecords")
+ public Result getWalletAgentRecords() {
+ return coinService.getWalletAgentRecords();
+ }
+
+ /**
+ * 币币账户USDT划转到合约账户
+ * @return
+ */
+ @ApiOperation(value="币币账户USDT划转到合约账户", notes="币币账户USDT划转到合约账户")
+ @PostMapping(value="/coinWalletTransferToContract")
+ public Result coinWalletTransferToContract(@RequestBody @Valid TransferOfBalanceDto transferOfBalanceDto) {
+ BigDecimal balance = transferOfBalanceDto.getBalance();
+ String symbol = transferOfBalanceDto.getSymbol();
+ return coinService.coinWalletTransferToContract(balance,symbol);
+ }
+
+ /**
+ * 合约账户划转到币币USDT账户
+ * @return
+ */
+ @ApiOperation(value="合约账户划转到币币USDT账户", notes="合约账户划转到币币USDT账户")
+ @PostMapping(value="/contractTransferToWalletCoin")
+ public Result contractTransferToWalletCoin(@RequestBody @Valid TransferOfBalanceDto transferOfBalanceDto) {
+ BigDecimal balance = transferOfBalanceDto.getBalance();
+ String symbol = transferOfBalanceDto.getSymbol();
+ return coinService.contractTransferToWalletCoin(balance,symbol);
+ }
+
+ /**
+ * 代理账户划转到USDT账户
+ * @return
+ */
+ @ApiOperation(value="代理账户划转到USDT账户", notes="代理账户划转到USDT账户")
+ @PostMapping(value="/agentTransferToWalletCoin")
+ @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "body")
+ public Result agentTransferToWalletCoin(@RequestBody @Valid TransferOfBalanceDto transferOfBalanceDto) {
+ BigDecimal balance = transferOfBalanceDto.getBalance();
+ Integer transfertype = transferOfBalanceDto.getTransfertype();
+ return coinService.agentTransferToWalletCoin(balance,transfertype);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java b/src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java
new file mode 100644
index 0000000..ff1c2fc
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/dao/MemberAccountMoneyChangeDao.java
@@ -0,0 +1,16 @@
+package com.xcong.excoin.modules.coin.dao;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange;
+
+public interface MemberAccountMoneyChangeDao extends BaseMapper<MemberAccountMoneyChange>{
+
+ List<MemberAccountMoneyChange> selectWalletCoinRecordsByMemIdTypeSymbol(Long memberId);
+
+ List<MemberAccountMoneyChange> selectWalletContractRecordsByMemIdTypeSymbol(String symbol, Long memberId);
+
+ List<MemberAccountMoneyChange> selectWalletAgentRecordByMemIdTypeSymbol(String symbol, Long memberId);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/dao/platform/CnyUsdtExchangeDao.java b/src/main/java/com/xcong/excoin/modules/coin/dao/platform/CnyUsdtExchangeDao.java
new file mode 100644
index 0000000..0d9b4f3
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/dao/platform/CnyUsdtExchangeDao.java
@@ -0,0 +1,12 @@
+package com.xcong.excoin.modules.coin.dao.platform;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.coin.entity.CnyUsdtExchange;
+
+public interface CnyUsdtExchangeDao extends BaseMapper<CnyUsdtExchange> {
+
+ CnyUsdtExchange getCNYAndUSDTOne();
+
+ void updateUsdt(double value);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/entity/CnyUsdtExchange.java b/src/main/java/com/xcong/excoin/modules/coin/entity/CnyUsdtExchange.java
new file mode 100644
index 0000000..4c3f99d
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/entity/CnyUsdtExchange.java
@@ -0,0 +1,28 @@
+package com.xcong.excoin.modules.coin.entity;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.system.base.BaseEntity;
+
+import lombok.Data;
+
+/**
+ * 行情人民币与usdt兑现价格表
+ */
+@Data
+@TableName("platform_cny_usdt_exchange")
+public class CnyUsdtExchange extends BaseEntity{
+
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ /**
+ * CNY/USDT
+ */
+ private BigDecimal value;
+
+ private BigDecimal diff;
+
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java b/src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java
new file mode 100644
index 0000000..8a893f9
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/entity/MemberAccountMoneyChange.java
@@ -0,0 +1,60 @@
+package com.xcong.excoin.modules.coin.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.system.base.BaseEntity;
+
+import lombok.Data;
+
+@Data
+@TableName("member_account_money_change")
+public class MemberAccountMoneyChange extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 类型【1:币币资产2:合约资产3:代理资产】
+ */
+ public static final Integer TYPE_WALLET_COIN = 1;
+ public static final Integer TYPE_WALLET_CONTRACT = 2;
+ public static final Integer TYPE_WALLET_AGENT = 3;
+ /**
+ * 状态【0:待审核 1:成功2:失败】
+ */
+ public static final Integer STATUS_WAIT_INTEGER = 0;
+ public static final Integer STATUS_SUCCESS_INTEGER = 1;
+ public static final Integer STATUS_FAIL_INTEGER = 2;
+
+ private Long id;
+
+ private Long memberId;
+
+ /**
+ * 币种
+ */
+ private String symbol;
+
+ /**
+ * 金额
+ */
+ private BigDecimal price;
+ /**
+ * 时间
+ */
+ private Date time;
+ /**
+ * 记录内容
+ */
+ private String content;
+ /**
+ * 类型【1:币币资产2:合约资产3:代理资产】
+ */
+ private int type;
+ /**
+ * 状态【0:待审核 1:成功2:失败】
+ */
+ private int status;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java b/src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java
new file mode 100644
index 0000000..3bf19e0
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/parameter/dto/TransferOfBalanceDto.java
@@ -0,0 +1,26 @@
+package com.xcong.excoin.modules.coin.parameter.dto;
+
+import java.math.BigDecimal;
+
+import javax.validation.constraints.NotNull;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "资金划转参数接收类", description = "资金划转参数接收类")
+public class TransferOfBalanceDto {
+
+ @NotNull(message = "划转金额不能为空")
+ @ApiModelProperty(value = "划转金额", example = "100")
+ private BigDecimal balance;
+
+ @NotNull(message = "币种不能为空")
+ @ApiModelProperty(value = "币种", example = "USDT")
+ private String symbol;
+
+ @NotNull(message = "账户类型不能为空")
+ @ApiModelProperty(value = "账户类型", example = "1")
+ private Integer transfertype;
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java b/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java
new file mode 100644
index 0000000..e6d2268
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/parameter/vo/MemberWalletCoinVo.java
@@ -0,0 +1,44 @@
+package com.xcong.excoin.modules.coin.parameter.vo;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel(value = "币币账户信息返回", description = "币币账户信息返回")
+public class MemberWalletCoinVo extends MemberWalletCoinEntity{
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "账户总USDT")
+ private BigDecimal totalUsdt;
+
+ @ApiModelProperty(value = "账户总RMB")
+ private BigDecimal totalCny;
+
+ @ApiModelProperty(value = "币种详情")
+ private List<MemberWalletCoinEntity> walletCoinEntities;
+
+ public BigDecimal getTotalUsdt() {
+ return totalUsdt;
+ }
+ public void setTotalUsdt(BigDecimal totalUsdt) {
+ this.totalUsdt = totalUsdt;
+ }
+ public BigDecimal getTotalCny() {
+ return totalCny;
+ }
+ public void setTotalCny(BigDecimal totalCny) {
+ this.totalCny = totalCny;
+ }
+ public List<MemberWalletCoinEntity> getWalletCoinEntities() {
+ return walletCoinEntities;
+ }
+ public void setWalletCoinEntities(List<MemberWalletCoinEntity> walletCoinEntities) {
+ this.walletCoinEntities = walletCoinEntities;
+ }
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java b/src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java
new file mode 100644
index 0000000..71e1a7d
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java
@@ -0,0 +1,35 @@
+package com.xcong.excoin.modules.coin.service;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
+
+public interface CoinService extends IService<MemberWalletCoinEntity>{
+
+ public Result getWalletCoin();
+
+ public Result getWalletCoinById(Long id);
+
+ public Result getWalletContractById();
+
+ public Result coinWalletTransferToContract(BigDecimal balance, String symbol);
+
+ public Result contractTransferToWalletCoin(BigDecimal balance, String symbol);
+
+ public Result findWalletContractBySymbol(String symbol);
+
+ public Result findWalletCoinBySymbol(String symbol);
+
+ public Result getWalletCoinRecords();
+
+ public Result getWalletContractRecords(String symbol);
+
+ public Result getWalletAgentRecords();
+
+ public Result agentTransferToWalletCoin(BigDecimal balance, Integer transfertype);
+
+ public Result findWalletAgentBySymbol();
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
new file mode 100644
index 0000000..f5ff2fb
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
@@ -0,0 +1,453 @@
+package com.xcong.excoin.modules.coin.service.impl;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xcong.excoin.common.LoginUserUtils;
+import com.xcong.excoin.common.enumerates.CoinTypeEnum;
+import com.xcong.excoin.common.enumerates.MemberWalletCoinEnum;
+import com.xcong.excoin.common.response.Result;
+import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao;
+import com.xcong.excoin.modules.coin.dao.platform.CnyUsdtExchangeDao;
+import com.xcong.excoin.modules.coin.entity.CnyUsdtExchange;
+import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange;
+import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletCoinVo;
+import com.xcong.excoin.modules.coin.service.CoinService;
+import com.xcong.excoin.modules.member.dao.MemberWalletAgentDao;
+import com.xcong.excoin.modules.member.dao.MemberWalletCoinDao;
+import com.xcong.excoin.modules.member.dao.MemberWalletContractDao;
+import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity;
+import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
+import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
+import com.xcong.excoin.utils.MessageSourceUtils;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+
+@Service
+public class CoinServiceImpl extends ServiceImpl<MemberWalletCoinDao, MemberWalletCoinEntity> implements CoinService{
+
+ //@Resource
+ //SymbolsService symbolsService;
+ @Resource
+ CnyUsdtExchangeDao cnyUsdtExchangeDao;
+ @Resource
+ MemberWalletCoinDao memberWalletCoinDao;
+ @Resource
+ MemberWalletContractDao memberWalletContractDao;
+ @Resource
+ MemberAccountMoneyChangeDao memberAccountMoneyChangeDao;
+ @Resource
+ MemberWalletAgentDao memberWalletAgentDao;
+
+
+ @Override
+ public Result getWalletCoin() {
+ try {
+ BigDecimal totalUsdt = BigDecimal.ZERO;
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
+ BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
+
+ if(!StrUtil.isEmpty(memberId.toString())) {
+
+ List<MemberWalletCoinEntity> MemberWalletCoinlist = memberWalletCoinDao.selectMemberWalletCoinsByMemberId(memberId);
+
+ if(CollUtil.isNotEmpty(MemberWalletCoinlist)) {
+ for(MemberWalletCoinEntity walletCoin : MemberWalletCoinlist) {
+ if(MemberWalletCoinEnum.WALLETCOINCODE.getValue().equals(walletCoin.getWalletCode())) {
+ totalUsdt = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
+ BigDecimal totalCny = totalUsdt.multiply(cnyUsdt);
+ walletCoin.setTotalBalance(totalCny.setScale(4, BigDecimal.ROUND_DOWN));
+ }else {
+ BigDecimal amount = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
+ BigDecimal closePrice = new BigDecimal("10.0000");
+ //Double closePrice = symbolsService.getCloseSymbolsBySymbolsName(walletCoin.getWalletCode()+"/USDT");
+ totalUsdt = totalUsdt.add(amount.multiply(closePrice));
+ walletCoin.setTotalBalance(totalUsdt.multiply(closePrice).multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
+ }
+ }
+ }
+ MemberWalletCoinVo memberWalletCoinVo = new MemberWalletCoinVo();
+ memberWalletCoinVo.setTotalUsdt(totalUsdt.setScale(4, BigDecimal.ROUND_DOWN));
+ memberWalletCoinVo.setTotalCny(totalUsdt.multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
+ memberWalletCoinVo.setWalletCoinEntities(MemberWalletCoinlist);
+ return Result.ok(memberWalletCoinVo);
+ }else {
+ List<MemberWalletCoinEntity> MemberWalletCoinlist = new ArrayList<MemberWalletCoinEntity>();
+ MemberWalletCoinEntity coin = new MemberWalletCoinEntity();
+ coin.setAvailableBalance(BigDecimal.ZERO);
+ coin.setTotalBalance(BigDecimal.ZERO);
+ coin.setFrozenBalance(BigDecimal.ZERO);
+ coin.setWalletCode(CoinTypeEnum.BTC.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.ETH.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.LTC.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.BCH.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.USDT.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.EOS.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.XRP.toString());
+ MemberWalletCoinlist.add(coin);
+ coin.setWalletCode(CoinTypeEnum.ETC.toString());
+ MemberWalletCoinlist.add(coin);
+ MemberWalletCoinVo memberWalletCoinVo = new MemberWalletCoinVo();
+ memberWalletCoinVo.setTotalUsdt(totalUsdt.setScale(4, BigDecimal.ROUND_DOWN));
+ memberWalletCoinVo.setTotalCny(totalUsdt.multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
+ memberWalletCoinVo.setWalletCoinEntities(MemberWalletCoinlist);
+ return Result.ok(memberWalletCoinVo);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return Result.fail(MessageSourceUtils.getString("member_service_0003"));
+ }
+ }
+
+ @Override
+ public Result getWalletCoinById(Long id) {
+ try {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+ MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectById(id);
+
+ if(!StrUtil.isEmpty(memberId.toString())) {
+ CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
+ BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
+ BigDecimal total = walletCoin.getAvailableBalance().add(walletCoin.getFrozenBalance());
+
+ if(MemberWalletCoinEnum.WALLETCOINCODE.getValue().equals(walletCoin.getWalletCode())) {
+ walletCoin.setTotalBalance(total.multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
+
+ }else {
+ BigDecimal closePrice = new BigDecimal("10.0000");
+ //Double closePrice = symbolsService.getCloseSymbolsBySymbolsName(wallet.getCode()+"/USDT");
+ walletCoin.setTotalBalance(total.multiply(closePrice).multiply(cnyUsdt).setScale(4, BigDecimal.ROUND_DOWN));
+ }
+ }
+ return Result.ok(walletCoin);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return Result.fail(MessageSourceUtils.getString("member_service_0003"));
+ }
+ }
+
+ @Override
+ public Result getWalletContractById() {
+
+ return Result.fail(MessageSourceUtils.getString("member_service_0002"));
+
+ }
+
+ @Override
+ @Transactional
+ public Result coinWalletTransferToContract(BigDecimal balance, String symbol) {
+ try {
+ if(balance.compareTo(BigDecimal.ZERO) <= 0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0004"));
+ }
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ if(!StrUtil.isEmpty(memberId.toString())) {
+ String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
+ MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId,walletCode);
+ BigDecimal available = walletCoin.getAvailableBalance();
+ // 扣币
+ BigDecimal total = available.subtract(balance);
+ if(total.compareTo(BigDecimal.ZERO)<0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0005"));
+ }
+ BigDecimal subtract = walletCoin.getTotalBalance().subtract(balance);
+ if(subtract.compareTo(BigDecimal.ZERO)<0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0005"));
+ }
+ walletCoin.setAvailableBalance(total.setScale(4, BigDecimal.ROUND_DOWN));
+ walletCoin.setTotalBalance(subtract.setScale(4, BigDecimal.ROUND_DOWN));
+ int updateWalletCoinById = memberWalletCoinDao.updateById(walletCoin);
+ if(updateWalletCoinById < 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ // 加币
+ // 查询合约账户
+ MemberWalletContractEntity walletContract = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberId, walletCode);
+ BigDecimal availableBalance = walletContract.getAvailableBalance();
+ BigDecimal add = availableBalance.add(balance);
+ walletContract.setAvailableBalance(add.setScale(4, BigDecimal.ROUND_DOWN));
+ BigDecimal totalBalance = walletContract.getTotalBalance();
+ BigDecimal totalBigDecimal = totalBalance.add(balance);
+ walletContract.setTotalBalance(totalBigDecimal.setScale(4, BigDecimal.ROUND_DOWN));
+ int updateWalletContractById = memberWalletContractDao.updateById(walletContract);
+ if(updateWalletContractById < 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ //添加币币资金划转历史记录
+ MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange();
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTTOCONTRACT.getValue());
+ memberAccountRecord.setMemberId(memberId);
+ memberAccountRecord.setPrice(balance.negate().setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER);
+ memberAccountRecord.setSymbol(MemberWalletCoinEnum.WALLETCOINCODE.getValue());
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN);
+ memberAccountRecord.setTime(new Date());
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+
+ //添加合约资金划转历史记录
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTFROMWALLETCOIN.getValue());
+ memberAccountRecord.setSymbol(MemberWalletCoinEnum.WALLETCOINCODE.getValue());
+ memberAccountRecord.setPrice(balance.setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_CONTRACT);
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ return Result.ok(MessageSourceUtils.getString("member_service_0006"));
+ }
+
+ @Override
+ @Transactional
+ public Result contractTransferToWalletCoin(BigDecimal balance, String symbol) {
+ try {
+ if(balance.compareTo(BigDecimal.ZERO)<=0){
+ return Result.fail(MessageSourceUtils.getString("member_service_0004"));
+ }
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
+ MemberWalletContractEntity walletContract = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberId, walletCode);
+ BigDecimal availableBalance = walletContract.getAvailableBalance();
+ // 扣币
+ BigDecimal availableSubtract = availableBalance.subtract(balance);
+ if(availableSubtract.compareTo(BigDecimal.ZERO) < 0 ) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0007"));
+ }
+ BigDecimal totalBalance = walletContract.getTotalBalance();
+ BigDecimal totalSubtract = totalBalance.subtract(balance);
+
+ walletContract.setAvailableBalance(availableSubtract.setScale(4, BigDecimal.ROUND_DOWN));
+ walletContract.setTotalBalance(totalSubtract.setScale(4, BigDecimal.ROUND_DOWN));
+ int updateWalletCoinById = memberWalletContractDao.updateById(walletContract);
+ if(updateWalletCoinById < 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ // 加币
+ MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode);
+ BigDecimal walletCoinAvailableBalance = walletCoin.getAvailableBalance();
+ walletCoinAvailableBalance.add(balance);
+ BigDecimal walletCoinTotalBalance = walletCoin.getTotalBalance();
+ walletCoinTotalBalance.add(balance);
+
+ walletCoin.setAvailableBalance(walletCoinAvailableBalance.setScale(4, BigDecimal.ROUND_DOWN));
+ walletCoin.setTotalBalance(walletCoinTotalBalance.setScale(4, BigDecimal.ROUND_DOWN));
+ int updateById = memberWalletCoinDao.updateById(walletCoin);
+ if(updateById < 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+
+ //添加资金划转历史记录
+ MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange();
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTTOWALLETCOIN.getValue());
+ memberAccountRecord.setMemberId(memberId);
+ memberAccountRecord.setPrice(balance.negate().setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER);
+ memberAccountRecord.setSymbol(walletCode);
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_CONTRACT);
+ memberAccountRecord.setTime(new Date());
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+
+ //添加资金划转历史记录
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTFROMCONTRACT.getValue());
+ memberAccountRecord.setSymbol(walletCode);
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN);
+ memberAccountRecord.setPrice(balance.setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ return Result.ok(MessageSourceUtils.getString("member_service_0006"));
+ }
+
+ @Override
+ public Result findWalletContractBySymbol(String symbol) {
+ /**
+ * ---todo
+ */
+ return null;
+ }
+
+ @Override
+ public Result findWalletCoinBySymbol(String symbol) {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, symbol);
+ BigDecimal availableBalance = walletCoin.getAvailableBalance().setScale(4, BigDecimal.ROUND_DOWN);
+ walletCoin.setAvailableBalance(availableBalance);
+ return Result.ok(walletCoin);
+ }
+
+ @Override
+ public Result getWalletCoinRecords() {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ List<MemberAccountMoneyChange> coinRecordList = memberAccountMoneyChangeDao.selectWalletCoinRecordsByMemIdTypeSymbol(memberId);
+ return Result.ok(coinRecordList);
+ }
+
+ @Override
+ public Result getWalletContractRecords(String symbol) {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ List<MemberAccountMoneyChange> contractRecordList = memberAccountMoneyChangeDao.selectWalletContractRecordsByMemIdTypeSymbol(symbol,memberId);
+ return Result.ok(contractRecordList);
+ }
+
+ @Override
+ public Result getWalletAgentRecords() {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ List<MemberAccountMoneyChange> contractRecordList =
+ memberAccountMoneyChangeDao.selectWalletAgentRecordByMemIdTypeSymbol(MemberWalletCoinEnum.WALLETCOINCODE.getValue(),memberId);
+ return Result.ok(contractRecordList);
+ }
+
+ @Override
+ @Transactional
+ public Result agentTransferToWalletCoin(BigDecimal balance, Integer transfertype) {
+ try {
+ if(balance.compareTo(BigDecimal.ZERO) <= 0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0004"));
+ }
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+
+ // 扣币
+ String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
+ MemberWalletAgentEntity walletAgent = memberWalletAgentDao.selectWalletAgentBymIdAndCode(memberId, walletCode);
+ BigDecimal availableBalance = walletAgent.getAvailableBalance();
+ BigDecimal totalBalance = walletAgent.getTotalBalance();
+
+ BigDecimal available = availableBalance.subtract(balance);
+ if(available.compareTo(BigDecimal.ZERO)<0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0008"));
+ }
+ BigDecimal total = totalBalance.subtract(balance);
+ if(total.compareTo(BigDecimal.ZERO)<0) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0008"));
+ }
+
+ walletAgent.setAvailableBalance(available.setScale(4, BigDecimal.ROUND_DOWN));
+ walletAgent.setTotalBalance(total.setScale(4, BigDecimal.ROUND_DOWN));
+
+ int i = memberWalletAgentDao.updateById(walletAgent);
+ if(i< 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0095"));
+ }
+ //添加资金划转历史记录
+ MemberAccountMoneyChange memberAccountRecord = new MemberAccountMoneyChange();
+ //代理账户转币币
+ if(MemberAccountMoneyChange.TYPE_WALLET_COIN.equals(transfertype)) {
+ MemberWalletCoinEntity walletCoin = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, walletCode);
+ BigDecimal walletCoinAvailableBalance = walletCoin.getAvailableBalance();
+ BigDecimal walletCoinTotalBalance = walletCoin.getTotalBalance();
+
+ walletCoin.setAvailableBalance(walletCoinAvailableBalance.add(balance).setScale(4, BigDecimal.ROUND_DOWN));
+ walletCoin.setTotalBalance(walletCoinTotalBalance.add(balance).setScale(4, BigDecimal.ROUND_DOWN));
+
+ int updateById = memberWalletCoinDao.updateById(walletCoin);
+ if(updateById< 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0095"));
+ }
+ //添加资金划转历史记录
+ memberAccountRecord.setMemberId(memberId);
+ memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER);
+ memberAccountRecord.setSymbol(walletCode);
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTFROMAGENT.getValue());
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_COIN);
+ memberAccountRecord.setTime(new Date());
+ memberAccountRecord.setPrice(balance.setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTTOWALLETCOIN.getValue());
+
+ }else if(MemberAccountMoneyChange.TYPE_WALLET_CONTRACT.equals(transfertype)) {
+ //代理账户转合约
+ MemberWalletContractEntity walletContract = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberId, walletCode);
+ BigDecimal walletContractAvailableBalance = walletContract.getAvailableBalance();
+ BigDecimal walletContractTotalBalance = walletContract.getTotalBalance();
+
+ walletContract.setAvailableBalance(walletContractAvailableBalance.add(balance).setScale(4, BigDecimal.ROUND_DOWN));
+ walletContract.setTotalBalance(walletContractTotalBalance.add(balance).setScale(4, BigDecimal.ROUND_DOWN));
+
+ int updateById = memberWalletContractDao.updateById(walletContract);
+ if(updateById< 1) {
+ return Result.fail(MessageSourceUtils.getString("member_service_0095"));
+ }
+
+ //添加资金划转历史记录
+ memberAccountRecord.setMemberId(memberId);
+ memberAccountRecord.setStatus(MemberAccountMoneyChange.STATUS_SUCCESS_INTEGER);
+ memberAccountRecord.setSymbol(walletCode);
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTFROMAGENT.getValue());
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_CONTRACT);
+ memberAccountRecord.setTime(new Date());
+ memberAccountRecord.setPrice(balance.setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+ memberAccountRecord.setContent(MemberWalletCoinEnum.CONTENTTOCONTRACT.getValue());
+ }
+ memberAccountRecord.setPrice(balance.negate().setScale(4, BigDecimal.ROUND_DOWN));
+ memberAccountRecord.setType(MemberAccountMoneyChange.TYPE_WALLET_AGENT);
+ memberAccountRecord.setTime(new Date());
+ memberAccountMoneyChangeDao.insert(memberAccountRecord);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ return Result.fail(MessageSourceUtils.getString("member_service_0096"));
+ }
+ return Result.ok(MessageSourceUtils.getString("member_service_0006"));
+ }
+
+ @Override
+ public Result findWalletAgentBySymbol() {
+ //获取用户ID
+ Long memberId = LoginUserUtils.getAppLoginUser().getId();
+ String walletCode = MemberWalletCoinEnum.WALLETCOINCODE.getValue();
+
+ MemberWalletAgentEntity walletAgent = memberWalletAgentDao.selectWalletAgentBymIdAndCode(memberId, walletCode);
+ BigDecimal availableBalance = walletAgent.getAvailableBalance();
+
+ CnyUsdtExchange cnyUsdtExchange =cnyUsdtExchangeDao.getCNYAndUSDTOne();
+ BigDecimal cnyUsdt = cnyUsdtExchange.getValue();
+
+ BigDecimal multiply = availableBalance.multiply(cnyUsdt);
+
+ walletAgent.setAvailableBalance(availableBalance);
+ Map<String,Object> map = new HashMap<String, Object>();
+ map.put(MemberWalletCoinEnum.WALLETCOINUSDT.getValue(), availableBalance.setScale(4, BigDecimal.ROUND_DOWN));
+ map.put(MemberWalletCoinEnum.WALLETAGENTCNY.getValue(), walletAgent);
+ map.put(MemberWalletCoinEnum.WALLETCOINCNY.getValue(), multiply.setScale(4, BigDecimal.ROUND_DOWN));
+ return Result.ok(map);
+ }
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java
index 9830c79..f1b83f5 100644
--- a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java
+++ b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletAgentDao.java
@@ -1,7 +1,10 @@
-package com.xcong.excoin.modules.member.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity;
-
-public interface MemberWalletAgentDao extends BaseMapper<MemberWalletAgentEntity> {
-}
+package com.xcong.excoin.modules.member.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity;
+
+public interface MemberWalletAgentDao extends BaseMapper<MemberWalletAgentEntity> {
+
+ MemberWalletAgentEntity selectWalletAgentBymIdAndCode(Long memberId, String walletCode);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java
index 71d7fa9..ba65eee 100644
--- a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java
+++ b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletCoinDao.java
@@ -1,10 +1,17 @@
-package com.xcong.excoin.modules.member.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
-
-/**
- * @author wzy
- */
-public interface MemberWalletCoinDao extends BaseMapper<MemberWalletCoinEntity> {
-}
+package com.xcong.excoin.modules.member.dao;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity;
+
+/**
+ * @author wzy
+ */
+public interface MemberWalletCoinDao extends BaseMapper<MemberWalletCoinEntity> {
+
+ List<MemberWalletCoinEntity> selectMemberWalletCoinsByMemberId(Long memberId);
+
+ MemberWalletCoinEntity selectWalletCoinBymIdAndCode(Long memberId,String walletCode);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java
index 0ad4586..ceabe18 100644
--- a/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java
+++ b/src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java
@@ -1,7 +1,12 @@
-package com.xcong.excoin.modules.member.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
-
-public interface MemberWalletContractDao extends BaseMapper<MemberWalletContractEntity> {
-}
+package com.xcong.excoin.modules.member.dao;
+
+import org.springframework.transaction.annotation.Transactional;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity;
+
+public interface MemberWalletContractDao extends BaseMapper<MemberWalletContractEntity> {
+
+ MemberWalletContractEntity findWalletContractByMemberIdAndSymbol(Long memberId, String symbol);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java
index 94c97df..bb067cf 100644
--- a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletAgentEntity.java
@@ -1,54 +1,59 @@
-package com.xcong.excoin.modules.member.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.xcong.excoin.common.contants.AppContants;
-import com.xcong.excoin.common.system.base.BaseEntity;
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-/**
- * 代理用户钱包
- *
- * @author wzy
- * @date 2020-05-18
- **/
-@Data
-@TableName("member_wallet_agent")
-public class MemberWalletAgentEntity extends BaseEntity {
-
- /**
- * 用户Id
- */
- private Long memberId;
-
- /**
- * 可用余额
- */
- private BigDecimal availableBalance = AppContants.INIT_MONEY;
-
- /**
- * 总金额
- */
- private BigDecimal totalBalance = AppContants.INIT_MONEY;
-
- /**
- * 冻结金额
- */
- private BigDecimal frozenBalance = AppContants.INIT_MONEY;
-
- /**
- * 借入资产金额
- */
- private BigDecimal borrowedFund = AppContants.INIT_MONEY;
-
- /**
- * 钱包标识
- */
- private String walletCode;
-
- /**
- * 钱包地址
- */
- private String walletAddress;
-}
+package com.xcong.excoin.modules.member.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.contants.AppContants;
+import com.xcong.excoin.common.system.base.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 代理用户钱包
+ *
+ * @author wzy
+ * @date 2020-05-18
+ **/
+@Data
+@TableName("member_wallet_agent")
+public class MemberWalletAgentEntity extends BaseEntity {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户Id
+ */
+ private Long memberId;
+
+ /**
+ * 可用余额
+ */
+ private BigDecimal availableBalance = AppContants.INIT_MONEY;
+
+ /**
+ * 总金额
+ */
+ private BigDecimal totalBalance = AppContants.INIT_MONEY;
+
+ /**
+ * 冻结金额
+ */
+ private BigDecimal frozenBalance = AppContants.INIT_MONEY;
+
+ /**
+ * 借入资产金额
+ */
+ private BigDecimal borrowedFund = AppContants.INIT_MONEY;
+
+ /**
+ * 钱包标识
+ */
+ private String walletCode;
+
+ /**
+ * 钱包地址
+ */
+ private String walletAddress;
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java
index cab2390..f2bd58c 100644
--- a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletCoinEntity.java
@@ -1,61 +1,63 @@
-package com.xcong.excoin.modules.member.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.xcong.excoin.common.system.base.BaseEntity;
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-/**
- * @author wzy
- * @date 2020-05-18
- **/
-@Data
-@TableName("member_wallet_coin")
-public class MemberWalletCoinEntity extends BaseEntity {
-
- /**
- * 用户Id
- */
- private Long memberId;
-
- /**
- * 可用余额
- */
- private BigDecimal availableBalance;
-
- /**
- * 总金额
- */
- private BigDecimal totalBalance;
-
- /**
- * 冻结金额
- */
- private BigDecimal frozenBalance;
-
- /**
- * 借入资产金额
- */
- private BigDecimal borrowedFund;
-
- /**
- * 钱包标识
- */
- private String walletCode;
-
- /**
- * 钱包地址
- */
- private String walletAddress;
-
- /**
- * 上次余额
- */
- private BigDecimal earlyBalance;
-
- /**
- * 区块编号
- */
- private int blockNumber;
-}
+package com.xcong.excoin.modules.member.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.system.base.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author wzy
+ * @date 2020-05-18
+ **/
+@Data
+@TableName("member_wallet_coin")
+public class MemberWalletCoinEntity extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户Id
+ */
+ private Long memberId;
+
+ /**
+ * 可用余额
+ */
+ private BigDecimal availableBalance;
+
+ /**
+ * 总金额
+ */
+ private BigDecimal totalBalance;
+
+ /**
+ * 冻结金额
+ */
+ private BigDecimal frozenBalance;
+
+ /**
+ * 借入资产金额
+ */
+ private BigDecimal borrowedFund;
+
+ /**
+ * 钱包标识
+ */
+ private String walletCode;
+
+ /**
+ * 钱包地址
+ */
+ private String walletAddress;
+
+ /**
+ * 上次余额
+ */
+ private BigDecimal earlyBalance;
+
+ /**
+ * 区块编号
+ */
+ private int blockNumber;
+}
diff --git a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java
index b0ca556..91cd275 100644
--- a/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/member/entity/MemberWalletContractEntity.java
@@ -13,7 +13,12 @@
@Data
@TableName("member_wallet_contract")
public class MemberWalletContractEntity extends BaseEntity {
- private Long memberId;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long memberId;
private BigDecimal availableBalance;
diff --git a/src/main/resources/i18n/messages_en_US.properties b/src/main/resources/i18n/messages_en_US.properties
index cb5b84d..38ffc9c 100644
--- a/src/main/resources/i18n/messages_en_US.properties
+++ b/src/main/resources/i18n/messages_en_US.properties
@@ -1,2 +1,222 @@
-test=test
-111=this is test msg
\ No newline at end of file
+test=test
+
+blockchain_service_0001=Invalid login information
+blockchain_service_0002=User does not exist
+
+member_controller_0001=Please conduct real name authentication
+member_controller_0002=Please configure the transaction password first
+member_controller_0003=Please enter the transaction password
+member_controller_0004=Please enter the correct transaction password
+member_controller_0005=The system is busy. Please try again later
+member_controller_0006=Please pay in time if the purchase is successful
+member_controller_0007=Confirm success
+member_controller_0008=Login information has expired
+member_controller_0009=Please go to the Security Center for real name authentication
+member_controller_0010=Please go to the security center to configure the transaction password
+
+member_controller_0011=Please enter the transaction password
+member_controller_0012=Please enter the correct transaction password
+member_controller_0013=Your current available usdt quota is not enough
+member_controller_0014=Please enter the withdrawal amount
+member_controller_0015=Your current available usdt quota is not enough
+member_controller_0016=Please configure the collection method
+member_controller_0017=Insufficient available usdt balance
+member_controller_0018=checkout success
+member_controller_0019=Login user is invalid
+member_controller_0020=Undo successful
+
+member_controller_0021=Confirm success
+member_controller_0022=This type of collection is not supported
+member_controller_0023=Login user is invalid
+member_controller_0024=Undo successful
+
+member_service_0001=Wallet address does not exist
+member_service_0002=Invalid login information
+member_service_0003=User does not exist
+member_service_0004=Transfer amount cannot be less than 0
+member_service_0005=Insufficient available balance of currency account
+member_service_0006=Transfer succeeded
+member_service_0007=The available balance of contract account usdt is insufficient
+member_service_0008=Insufficient available balance of agent account usdt
+member_service_0009=Mobile number cannot be empty
+member_service_0010=Sent successfully
+
+member_service_0011=Fail in send
+member_service_0012=The verification code has expired, please request again
+member_service_0013=Wrong verification code
+member_service_0014=Phone number binding succeeded
+member_service_0015=Submit failed
+member_service_0016=Mailbox cannot be empty
+member_service_0017=Verification code cannot be empty
+member_service_0018=Binding succeeded
+member_service_0019=Binding failed
+member_service_0020=Get failed
+
+member_service_0021=Please enter the address of withdrawal
+member_service_0022=Please enter notes
+member_service_0023=Please select currency
+member_service_0024=Submitted successfully
+member_service_0025=Get failed
+member_service_0026=Set successfully
+member_service_0027=Setting failed
+member_service_0028=Set successfully
+member_service_0029=Setting failed
+member_service_0030=Delete succeeded
+
+member_service_0031=Delete failed
+member_service_0032=User failure
+member_service_0033=Successfully added
+member_service_0034=Delete succeeded
+member_service_0035=Delete failed
+member_service_0036=Update successful
+member_service_0037=Update failed
+member_service_0038=Verification code is invalid
+member_service_0039=Verification code error
+member_service_0040=Modification succeeded
+
+member_service_0041=Modification failed
+member_service_0042=Please enter your mobile number
+member_service_0043=Please enter the verification code
+member_service_0044=Please input a password
+member_service_0045=Verification code is invalid, please resend
+member_service_0046=The verification code entered is wrong, please re-enter
+member_service_0047=The mobile number does not exist, please register and log in
+member_service_0048=Modification succeeded, please log in
+member_service_0049=Verification code is invalid
+member_service_0050=Verification code error
+
+member_service_0051=Reset successful
+member_service_0052=Modification failed
+member_service_0053=Sent successfully
+member_service_0054=fail in send
+member_service_0055=Submitted, pending review
+member_service_0056=Audit passed
+member_service_0057=Please enter country
+member_service_0058=Last name cannot be blank, please enter
+member_service_0059=The name cannot be empty. Please enter
+member_service_0060=ID card has been used
+
+member_service_0061=Image missing, please upload
+member_service_0062=Submitted successfully
+member_service_0063=Failed to submit, please resubmit
+member_service_0064=The transaction password is wrong, please check and re-enter
+member_service_0065=Verification code is invalid
+member_service_0066=Wrong verification code
+member_service_0067=Submit failed
+member_service_0068=Transaction password set successfully
+member_service_0069=Transaction password modified successfully
+member_service_0070=User does not exist
+
+member_service_0071=Exit successful
+member_service_0072=Exit failed
+member_service_0073=Get failed
+member_service_0074=Failure of user login information
+member_service_0075=User does not exist
+member_service_0076=Get failed
+member_service_0077=No real name authentication
+member_service_0078=Submitted successfully
+member_service_0079=Submit failed
+member_service_0080=No real name authentication
+
+member_service_0081=Transaction password not set
+member_service_0082=Wrong transaction password entered
+member_service_0083=Cell phone number is empty
+member_service_0084=Verification code error
+member_service_0085=Insufficient available balance
+member_service_0086=Submitted successfully, waiting for approval
+member_service_0087=Wallet does not exist
+member_service_0088=User login is invalid
+member_service_0089=Network exception
+member_service_0090=Already logged in
+
+member_service_0091=Not logged in
+member_service_0092=The account has been restricted
+member_service_0093=The user does not exist. Please register and log in again
+member_service_0094=Insufficient available balance of contract usdt account
+member_service_0095=Insufficient available balance of agent usdt account
+member_service_0096=Transfer fail
+
+order_service_0001=Wrong parameter value
+order_service_0002=Not logged in
+order_service_0003=Submit failed
+order_service_0004=Parameter error
+order_service_0005=Invalid login information
+order_service_0006=User does not exist
+order_service_0007=No real name authentication, please go to the Security Center for real name authentication
+order_service_0008=Wrong parameter
+order_service_0009=Server exception
+order_service_0010=Insufficient amount available
+
+order_service_0011=Submitted successfully
+order_service_0012=Do not repeat cancellation
+order_service_0013=Cancellation successful
+order_service_0014=Please log in
+order_service_0015=Add self selection succeeded
+order_service_0016=Delete self selection succeeded
+order_service_0017=No wallet account
+order_service_0018=User does not exist
+order_service_0019=Wrong parameter
+order_service_0020=User wallet does not exist
+
+order_service_0021=Parameter error
+order_service_0022=The entrusted open price cannot be higher than the market price
+order_service_0023=The entrusted open price cannot be lower than the market price
+order_service_0024=The available amount is insufficient, please recharge before purchasing
+order_service_0025=Submitted successfully
+order_service_0026=User not logged in
+order_service_0027=Order does not exist
+order_service_0028=The order has been closed
+order_service_0029=Margin adjustment failed
+order_service_0030=Margin adjusted
+
+order_service_0031=User login failed
+order_service_0032=Do not repeat cancellation
+order_service_0033=Cancellation successful
+order_service_0034=Closed position
+order_service_0035=Get failed
+order_service_0036=Failure of user login information
+order_service_0037=Operation successful
+order_service_0038=Server exception
+order_service_0039=Frequent operation, please try again later
+order_service_0040=Insufficient available balance
+
+order_service_0041=Set successfully
+order_service_0042=Setting failed
+order_service_0043=Cancellation failed
+order_service_0044=Successful closing
+order_service_0045=This order cannot be closed temporarily
+order_service_0046=No open order
+
+symbols_controller_0001=Success
+
+symbols_service_0001=Details obtained successfully
+symbols_service_0002=Failed to get data
+symbols_service_0003=Load failed
+
+home_controller_0001=Number registered
+home_controller_0002=Number registration available
+home_controller_0003=Correct number
+home_controller_0004=Number not registered
+home_controller_0005=Sent successfully
+home_controller_0006=Failed to send, please resend
+home_controller_0007=The verification code is invalid, please resend!
+home_controller_0008=Verification code error
+home_controller_0009=Verification code succeeded
+
+home_service_0001=Please enter your mobile number
+home_service_0002=Please input a password
+home_service_0003=The user does not exist. Please register and log in again
+home_service_0004=The account has been restricted
+home_service_0005=Wrong password
+home_service_0006=Wrong format of mobile number entered
+home_service_0007=The mobile number has been registered. Please log in
+home_service_0008=login has failed
+home_service_0009=Registration succeeded, please log in
+home_service_0010=Verification code is invalid, please resend
+
+home_service_0011=The verification code entered is wrong, please re-enter
+home_service_0012=Please enter the verification code
+home_service_0013=Modification succeeded, please log in
+home_service_0014=The mobile number does not exist, please register and log in
+
+uploadFile_controller_0001=Upload failed
\ No newline at end of file
diff --git a/src/main/resources/i18n/messages_zh_CN.properties b/src/main/resources/i18n/messages_zh_CN.properties
index 81795a5..e24d581 100644
--- a/src/main/resources/i18n/messages_zh_CN.properties
+++ b/src/main/resources/i18n/messages_zh_CN.properties
@@ -1,2 +1,223 @@
-test=测试
-111=这是测试消息
\ No newline at end of file
+test=测�
+
+blockchain_service_0001=登录信息失效
+blockchain_service_0002=用户不存在
+
+member_controller_0001=请先实名认证
+member_controller_0002=请先配置交易密码
+member_controller_0003=请输入交易密码
+member_controller_0004=请输入正确的交易密码
+member_controller_0005=系统繁忙,请稍后再试
+member_controller_0006=购买成功,请及时付款
+member_controller_0007=确认成功
+member_controller_0008=登录信息已失效
+member_controller_0009=请前往安全中心进行实名认证
+member_controller_0010=请前往安全中心配置交易密码
+
+member_controller_0011=请输入交易密码
+member_controller_0012=请输入正确的交易密码
+member_controller_0013=您当前可用USDT额度不够
+member_controller_0014=请输入提币量
+member_controller_0015=您当前可用USDT额度不够
+member_controller_0016=请配置收款方式
+member_controller_0017=可用USDT余额不足
+member_controller_0018=下单成功
+member_controller_0019=登录用户已失效
+member_controller_0020=撤销成功
+
+member_controller_0021=确认成功
+member_controller_0022=不支持此类收款
+member_controller_0023=登录用户已失效
+member_controller_0024=撤销成功
+
+member_service_0001=钱包地址不存在
+member_service_0002=用户登录信息失效
+member_service_0003=用户不存在
+member_service_0004=转账金额不能小于0
+member_service_0005=币币账户可用余额不足
+member_service_0006=划转成功
+member_service_0007=合约账户USDT可用余额不足
+member_service_0008=代理账户USDT可用余额不足
+member_service_0009=手机号不能为空
+member_service_0010=发送成功
+
+member_service_0011=发送失败
+member_service_0012=验证码已失效,请重新请求
+member_service_0013=验证码有误
+member_service_0014=手机号绑定成功
+member_service_0015=提交失败
+member_service_0016=邮箱不能为空
+member_service_0017=验证码不能为空
+member_service_0018=绑定成功
+member_service_0019=绑定失败
+member_service_0020=获取失败
+
+member_service_0021=请输入提币地址
+member_service_0022=请输入备注信息
+member_service_0023=请选择币种
+member_service_0024=提交成功
+member_service_0025=获取失败
+member_service_0026=设置成功
+member_service_0027=设置失败
+member_service_0028=获取成功
+member_service_0029=获取失败
+member_service_0030=删除成功
+
+member_service_0031=删除失败
+member_service_0032=用户失效
+member_service_0033=添加成功
+member_service_0034=删除成功
+member_service_0035=删除失败
+member_service_0036=更新成功
+member_service_0037=更新失败
+member_service_0038=验证码已失效
+member_service_0039=验证码错误
+member_service_0040=修改成功
+
+member_service_0041=修改失败
+member_service_0042=请输入手机号码
+member_service_0043=请输入验证码
+member_service_0044=请输入密码
+member_service_0045=验证码已失效,请重新发送
+member_service_0046=输入的验证码有误,请重新输入
+member_service_0047=不存在该手机号码,请进行注册登录
+member_service_0048=修改成功,请登录
+member_service_0049=验证码已失效
+member_service_0050=验证码错误
+
+member_service_0051=重置成功
+member_service_0052=修改失败
+member_service_0053=发送成功
+member_service_0054=发送失败
+member_service_0055=已提交,等待审核
+member_service_0056=审核已通过
+member_service_0057=请输入国家
+member_service_0058=姓不能为空,请输入
+member_service_0059=名不能为空,请输入
+member_service_0060=身份证已被使用
+
+member_service_0061=缺少图片,请上传
+member_service_0062=提交成功
+member_service_0063=提交失败,请重新提交
+member_service_0064=输入交易密码有误,请检查重新输入
+member_service_0065=验证码已失效
+member_service_0066=验证码有误
+member_service_0067=提交失败
+member_service_0068=交易密码设置成功
+member_service_0069=交易密码修改成功
+member_service_0070=用户不存在
+
+member_service_0071=退出成功
+member_service_0072=退出失败
+member_service_0073=获取失败
+member_service_0074=用户登录信息失效
+member_service_0075=用户不存在
+member_service_0076=获取失败
+member_service_0077=未实名认证
+member_service_0078=提交成功
+member_service_0079=提交失败
+member_service_0080=未实名认证
+
+member_service_0081=未设置交易密码
+member_service_0082=输入的交易密码有误
+member_service_0083=手机号为空
+member_service_0084=验证码错误
+member_service_0085=可用余额不足
+member_service_0086=提交成功,等待审核
+member_service_0087=钱包不存在
+member_service_0088=用户登陆已失效
+member_service_0089=网络异常
+member_service_0090=已经登陆
+
+member_service_0091=未登录
+member_service_0092=该账户已限制登录
+member_service_0093=用户不存在,请注册后再登录
+member_service_0094=合约USDT账户可用余额不足
+member_service_0095=代理USDT账户可用余额不足
+member_service_0096=划转失败
+
+order_service_0001=参值有误
+order_service_0002=未登录
+order_service_0003=提交失败
+order_service_0004=参数错误
+order_service_0005=登录信息失效
+order_service_0006=用户不存在
+order_service_0007=未实名认证,请去安全中心里进行实名认证
+order_service_0008=参数有误
+order_service_0009=服务器异常
+order_service_0010=可用金额不足
+
+order_service_0011=提交成功
+order_service_0012=请勿重复撤单
+order_service_0013=撤单成功
+order_service_0014=请登录
+order_service_0015=添加自选成功
+order_service_0016=删除自选成功
+order_service_0017=无钱包账号
+order_service_0018=用户不存在
+order_service_0019=参数有误
+order_service_0020=用户钱包不存在
+
+order_service_0021=参数错误
+order_service_0022=委托开多价不能高于市场价
+order_service_0023=委托开多价不能低于市场价
+order_service_0024=可用金额不足,请充值后再购买
+order_service_0025=提交成功
+order_service_0026=用户未登录
+order_service_0027=订单不存在
+order_service_0028=该订单已平仓
+order_service_0029=保证金调整失败
+order_service_0030=保证金已调整
+
+order_service_0031=用户登录已失效
+order_service_0032=请勿重复撤单
+order_service_0033=撤单成功
+order_service_0034=已平仓
+order_service_0035=获取失败
+order_service_0036=用户登录信息失效
+order_service_0037=操作成功
+order_service_0038=服务器异常
+order_service_0039=操作频繁,请稍后再试
+order_service_0040=可用余额不足
+
+order_service_0041=设置成功
+order_service_0042=设置失败
+order_service_0043=撤单失败
+order_service_0044=平仓成功
+order_service_0045=该订单暂不能平仓
+order_service_0046=没有可平仓的订单
+
+symbols_controller_0001=成功
+
+symbols_service_0001=获取详情成功
+symbols_service_0002=获取数据失败
+symbols_service_0003=加载失败
+
+home_controller_0001=号码已注册
+home_controller_0002=号码可用注册
+home_controller_0003=号码正确
+home_controller_0004=号码没注册
+home_controller_0005=发送成功
+home_controller_0006=发送失败,请重新发送
+home_controller_0007=验证码已失效,请重新发送!
+home_controller_0008=验证码错误
+home_controller_0009=验证码成功
+
+home_service_0001=请输入手机号码
+home_service_0002=请输入密码
+home_service_0003=用户不存在,请注册后再登录
+home_service_0004=该账户已限制登录
+home_service_0005=密码有误
+home_service_0006=输入的手机号码格式有误
+home_service_0007=该手机号码已被注册,请去登录
+home_service_0008=注册失败
+home_service_0009=注册成功,请去登录
+home_service_0010=验证码已失效,请重新发送
+
+home_service_0011=输入的验证码有误,请重新输入
+home_service_0012=请输入验证码
+home_service_0013=修改成功,请登录
+home_service_0014=不存在该手机号码,请进行注册登录
+
+uploadFile_controller_0001=上传失败
+
diff --git a/src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml b/src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml
new file mode 100644
index 0000000..63b8fbb
--- /dev/null
+++ b/src/main/resources/mapper/member/MemberAccountMoneyChangeDao.xml
@@ -0,0 +1,19 @@
+<?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.coin.dao.MemberAccountMoneyChangeDao">
+
+ <select id="selectWalletCoinRecordsByMemIdTypeSymbol" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
+ select * from member_account_money_change where type = 1 and member_id = #{memberId} order by id desc
+ </select>
+
+ <select id="selectWalletContractRecordsByMemIdTypeSymbol" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
+ select * from member_account_money_change where type = 2 and member_id = #{memberId} order by id desc
+ </select>
+
+ <select id="selectWalletAgentRecordByMemIdTypeSymbol" resultType="com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange">
+ select * from member_account_money_change where type = 3 and member_id = #{memberId} order by id desc
+ </select>
+
+
+
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/member/MemberWalletAgentDao.xml b/src/main/resources/mapper/member/MemberWalletAgentDao.xml
index f192492..c898b37 100644
--- a/src/main/resources/mapper/member/MemberWalletAgentDao.xml
+++ b/src/main/resources/mapper/member/MemberWalletAgentDao.xml
@@ -1,6 +1,10 @@
-<?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.member.dao.MemberWalletAgentDao">
-
-
+<?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.member.dao.MemberWalletAgentDao">
+
+ <select id="selectWalletAgentBymIdAndCode" resultMap="com.xcong.excoin.modules.member.entity.MemberWalletAgentEntity">
+ select * from member_wallet_agent where member_id=#{memberId} and wallet_code = #{walletCode}
+ </select>
+
+
</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/member/MemberWalletCoinDao.xml b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
index 9bd74b7..fed0917 100644
--- a/src/main/resources/mapper/member/MemberWalletCoinDao.xml
+++ b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
@@ -1,7 +1,15 @@
-<?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.member.dao.MemberWalletCoinDao">
-
-
-
+<?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.member.dao.MemberWalletCoinDao">
+
+ <select id="selectMemberWalletCoinsByMemberId" resultType="com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity">
+ select * from member_wallet_coin where member_id = #{memberId}
+ </select>
+
+ <select id="selectWalletCoinBymIdAndCode" resultType="com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity">
+ select * from member_wallet_coin where member_id = #{memberId} and wallet_code = #{walletCode}
+ </select>
+
+
+
</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/member/MemberWalletContractDao.xml b/src/main/resources/mapper/member/MemberWalletContractDao.xml
index 0c74801..074cd51 100644
--- a/src/main/resources/mapper/member/MemberWalletContractDao.xml
+++ b/src/main/resources/mapper/member/MemberWalletContractDao.xml
@@ -1,6 +1,13 @@
-<?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.member.dao.MemberWalletContractDao">
-
-
+<?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.member.dao.MemberWalletContractDao">
+ <select id="findWalletContractByMemberIdAndSymbol" resultType="com.xcong.excoin.modules.member.entity.MemberWalletContractEntity">
+ select *
+ from member_wallet_contract
+ where member_id = #{memberId}
+ <if test = "symbol != null and symbol !=''">
+ and wallet_code = #{symbol}
+ </if>
+ </select>
+
</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/platform/CnyUsdtExchangeDao.xml b/src/main/resources/mapper/platform/CnyUsdtExchangeDao.xml
new file mode 100644
index 0000000..a8facd5
--- /dev/null
+++ b/src/main/resources/mapper/platform/CnyUsdtExchangeDao.xml
@@ -0,0 +1,13 @@
+<?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.coin.dao.platform.CnyUsdtExchangeDao">
+
+ <select id="getCNYAndUSDTOne" resultType="com.xcong.excoin.modules.coin.entity.CnyUsdtExchange">
+ select * from platform_cny_usdt_exchange limit 1
+ </select>
+
+ <update id="updateUsdt">
+ update platform_cny_usdt_exchange set value = #{value}
+ </update>
+
+</mapper>
--
Gitblit v1.9.1