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); checkOrgPermission(manager, client);
if (!StringUtils.isNotBlank(master_merchant)) { if (!StringUtils.isNotBlank(master_merchant)) {
throw new NotFoundException("Invalid Input"); //throw new NotFoundException("Invalid Input");
} JSONObject master_client = getClientInfoByMoniker(master_merchant);
JSONObject master_client = getClientInfoByMoniker(master_merchant); if (master_client == null) {
if (master_client == null) { throw new InvalidShortIdException();
throw new InvalidShortIdException(); }
} if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) { throw new BadRequestException("Master Merchant is not valid");
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); clientMapper.update(client);
} }

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

Loading…
Cancel
Save