法币模块-修复市商申请bug

pull/1/head
luzhaofeng 5 years ago
parent 9271b536b0
commit ee8ca05ad3
  1. 14
      blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/service/impl/MarketApplyServiceImpl.java

@ -87,11 +87,11 @@ public class MarketApplyServiceImpl implements MarketApplyService {
marketUserService.insertMarketUser(userId);
}
//新建市商申请
//市商申请id
String applyId = insertAgreeMarketApply(userId, MarketApplyConstants.MARKET);
//市商保证金代币
String coinName = configService.selectMarketFreezeCoin();
//新建市商申请
//市商申请id
String applyId = insertAgreeMarketApply(userId, coinName, MarketApplyConstants.MARKET);
//市商保证金数量
BigDecimal amount = configService.selectMarketFreezeAmount();
//防止保证金代币和数量为空
@ -121,8 +121,6 @@ public class MarketApplyServiceImpl implements MarketApplyService {
}
//检查用户广告是否全部已完成或撤销
checkAdWhenCancel(userId);
//新建市商申请
String applyId = insertAgreeMarketApply(userId, MarketApplyConstants.CANCEL);
//更新
marketUser.setStatus(MarketUserConstants.NOTMARKET);
@ -139,6 +137,8 @@ public class MarketApplyServiceImpl implements MarketApplyService {
BigDecimal freezeAmount = freeAmount.multiply(new BigDecimal("-1"));
//解冻的币种
String coinName = marketFreeze.getCoinName();
//新建市商申请
String applyId = insertAgreeMarketApply(userId, coinName, MarketApplyConstants.CANCEL);
//解冻余额
walletService.handleBalance(userId, applyId, coinName, UNIT_NAME, freeAmount, freezeAmount);
//增加余额变更记录
@ -215,15 +215,17 @@ public class MarketApplyServiceImpl implements MarketApplyService {
/***
* 新建状态为'已同意'的申请记录
* @param userId
* @param coinName
* @param applyType
* @return
*/
private String insertAgreeMarketApply(String userId, String applyType) {
private String insertAgreeMarketApply(String userId, String coinName, String applyType) {
MarketApply marketApply = new MarketApply();
Date now = new Date();
String applyId = UUID.randomUUID().toString();
marketApply.setId(applyId);
marketApply.setUserId(userId);
marketApply.setCoinName(coinName);
marketApply.setApplyType(applyType);
marketApply.setCreateTime(now);
marketApply.setModifyTime(now);

Loading…
Cancel
Save