Commit df4d607f authored by 1486327116's avatar 1486327116

Merge remote-tracking branch 'origin/master'

parents d89557e5 1f2b8c65
...@@ -360,6 +360,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined) ...@@ -360,6 +360,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined)
} }
let res = await addCoin2Core(dbSymbol.symbol, dbSymbol.id); let res = await addCoin2Core(dbSymbol.symbol, dbSymbol.id);
if (!res.is_success) { if (!res.is_success) {
RobotUtil.sendRobotMessage(RobotUtil.ROBOT_KEYS.COMMON_KEY, res.err_msg);
throw ErrorCode.ADD_PAIR_TO_CORE_ERR; throw ErrorCode.ADD_PAIR_TO_CORE_ERR;
} }
await coinType.prototype.update({ main_status: 1 }, { await coinType.prototype.update({ main_status: 1 }, {
......
...@@ -269,7 +269,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined) ...@@ -269,7 +269,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined)
//检查交易对中的币种是否存在于coin_type 中 //检查交易对中的币种是否存在于coin_type 中
await checkPairInCoinType(pair); await checkPairInCoinType(pair);
//检查交易对是否存在 //检查交易对是否存在
await checkPairExist(pair, type); await checkPairExistBeforeCreate(pair, type);
let insertInfo = { let insertInfo = {
symbol: pair, symbol: pair,
...@@ -366,7 +366,9 @@ export async function review(id: any, currentUser: any, ip: string | undefined) ...@@ -366,7 +366,9 @@ export async function review(id: any, currentUser: any, ip: string | undefined)
param["max_order_value"] = dbPair.max_order_value; param["max_order_value"] = dbPair.max_order_value;
} }
let optResult = await addPairToCore(param); let optResult = await addPairToCore(param);
addOptLog(currentUser.userId, 0, '上新交易对申请审核-提交到撮合', ip, `param:${JSON.stringify(param)}`, '交易上下线管理');
if (!optResult.is_success) { if (!optResult.is_success) {
RobotUtil.sendRobotMessage(RobotUtil.ROBOT_KEYS.COMMON_KEY, optResult.err_msg);
throw ErrorCode.ADD_PAIR_TO_CORE_ERR; throw ErrorCode.ADD_PAIR_TO_CORE_ERR;
} }
//现货 //现货
...@@ -428,7 +430,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined) ...@@ -428,7 +430,7 @@ export async function review(id: any, currentUser: any, ip: string | undefined)
} }
//管理后台操作日志 //管理后台操作日志
addOptLog(currentUser.userId, 0, '上新交易对申请审核', ip, `msg:${reason},dbInfo:${JSON.stringify(dbApply)}`, '交易上下线管理'); addOptLog(currentUser.userId, 0, '上新交易对申请审核', ip, `msg:${reason},dbInfo:${dbApply.id}`, '交易上下线管理');
return 'success'; return 'success';
} }
...@@ -508,3 +510,24 @@ async function checkPairExist(pair: string, type: number) { ...@@ -508,3 +510,24 @@ async function checkPairExist(pair: string, type: number) {
return dbPair; return dbPair;
} }
async function checkPairExistBeforeCreate(pair: string, type: number) {
let dbPair: any;
//现货
if (type == 1) {
dbPair = await spotPairs.prototype.findOne({
where: { symbol: pair },
raw: true
});
}
else {//合约
dbPair = await contractPairs.prototype.findOne({
where: { symbol: pair },
raw: true
});
}
if (dbPair) {
throw ErrorCode.PAIR_EXIST;
}
return dbPair;
}
...@@ -140,6 +140,12 @@ export const update = async (param: AddParam, currentUserId: any, ip: any) => { ...@@ -140,6 +140,12 @@ export const update = async (param: AddParam, currentUserId: any, ip: any) => {
if (param.quantity_increment) { if (param.quantity_increment) {
updateInfo['quantity_increment'] = param.quantity_increment updateInfo['quantity_increment'] = param.quantity_increment
} }
if (param.maker_fee) {
updateInfo['maker_fee'] = param.maker_fee
}
if (param.taker_fee) {
updateInfo['taker_fee'] = param.taker_fee
}
updateInfo['is_active'] = param.is_active ? param.is_active : 0; updateInfo['is_active'] = param.is_active ? param.is_active : 0;
updateInfo['is_hide'] = param.is_hide ? param.is_hide : 0; updateInfo['is_hide'] = param.is_hide ? param.is_hide : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment