Merge branch 'hotfix' into develop

master
wangning 7 years ago
commit 38e6a7debb

@ -38,4 +38,6 @@ public interface ClientRateMapper {
@Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName); @Param("clean_days") Integer cleanDays, @Param("rate_name") String rateName);
List<JSONObject> minExpiryTime(@Param("client_id")int client_id,@Param("rate_name") String rate_name); List<JSONObject> minExpiryTime(@Param("client_id")int client_id,@Param("rate_name") String rate_name);
List<JSONObject> latestConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name);
} }

@ -1903,7 +1903,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")"); client.put("company_name_acn", client.getString("company_name") + " (ABN " + client.getString("abn") + ")");
} }
List<JSONObject> clientRate = clientRateMapper.minExpiryTime(client.getIntValue("client_id"), null); List<JSONObject> clientRate = clientRateMapper.latestConfig(client.getIntValue("client_id"), null);
if (CollectionUtils.isEmpty(clientRate)) { if (CollectionUtils.isEmpty(clientRate)) {
throw new BadRequestException("The Partner's Rate is not config!"); throw new BadRequestException("The Partner's Rate is not config!");
} }

@ -100,4 +100,16 @@
order by expiry_time desc order by expiry_time desc
</select> </select>
<select id="latestConfig" resultType="com.alibaba.fastjson.JSONObject">
SELECT * FROM
sys_client_rates
WHERE client_id = #{client_id}
AND active_time =
(
SELECT max(active_time) FROM sys_client_rates
WHERE client_id = #{client_id}
)
order by expiry_time desc
</select>
</mapper> </mapper>
Loading…
Cancel
Save