fix exchange rate

master
eason.qian 7 years ago
parent d21d2210c6
commit cff32aa65d

@ -2051,16 +2051,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
checkOrgPermission(manager, client);
if (!StringUtils.isNotBlank(master_merchant)) {
throw new NotFoundException("Invalid Input");
}
JSONObject master_client = getClientInfoByMoniker(master_merchant);
if (master_client == null) {
throw new InvalidShortIdException();
}
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
throw new BadRequestException("Master Merchant is not valid");
//throw new NotFoundException("Invalid Input");
JSONObject master_client = getClientInfoByMoniker(master_merchant);
if (master_client == null) {
throw new InvalidShortIdException();
}
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
throw new BadRequestException("Master Merchant is not valid");
}
client.put("parent_client_id", master_client.getIntValue("client_id"));
}else {
client.put("parent_client_id", null);
}
client.put("parent_client_id", master_client.getIntValue("client_id"));
clientMapper.update(client);
}

@ -589,25 +589,15 @@
</select>
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT
t.exchange_rate,
date(t.transaction_time) `date`
FROM
pmt_transactions t
INNER JOIN (
SELECT max(t.transaction_time) mx
SELECT max(t.transaction_time) mx,t.exchange_rate,date(t.transaction_time) `date`
FROM
pmt_transactions t
WHERE date(t.transaction_time) >= #{begin} AND date(t.transaction_time) <= #{end} AND
t.transaction_type = 'Credit'AND t.channel = #{channel}
WHERE date(t.transaction_time) >= #{begin} #AND date(t.transaction_time) <= #{end} AND
and t.transaction_type ='Credit' AND t.channel =#{channel}
GROUP BY
date(t.transaction_time)
) o
ON
t.transaction_time = o.mx
ORDER BY
`date` ASC
order by `date` asc
]]>
</select>

Loading…
Cancel
Save