mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-07 03:20:06 +08:00
保存soc工具方法
This commit is contained in:
@@ -275,8 +275,9 @@ public class SpringBootTestController {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void saveSOCTest() {
|
public void saveSOCTest() {
|
||||||
String transactionCode = "123";
|
String transactionCode = "12345";
|
||||||
YKCUtils.saveSOC(transactionCode, "4");
|
YKCUtils.saveSOC(transactionCode, "4");
|
||||||
|
YKCUtils.saveSOC(transactionCode, "1");
|
||||||
YKCUtils.saveSOC(transactionCode, "3");
|
YKCUtils.saveSOC(transactionCode, "3");
|
||||||
YKCUtils.saveSOC(transactionCode, "5");
|
YKCUtils.saveSOC(transactionCode, "5");
|
||||||
YKCUtils.saveSOC(transactionCode, "10");
|
YKCUtils.saveSOC(transactionCode, "10");
|
||||||
|
|||||||
@@ -337,6 +337,10 @@ public class YKCUtils {
|
|||||||
* @param soc
|
* @param soc
|
||||||
*/
|
*/
|
||||||
public static void saveSOC(String transactionCode, String soc) {
|
public static void saveSOC(String transactionCode, String soc) {
|
||||||
|
if (StringUtils.isBlank(transactionCode) || Double.parseDouble(soc) <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String hashKey = CacheConstants.GET_THE_SOC + transactionCode;
|
String hashKey = CacheConstants.GET_THE_SOC + transactionCode;
|
||||||
RedisCache staticRedisCache = StaticRedisCache.staticRedisCache;
|
RedisCache staticRedisCache = StaticRedisCache.staticRedisCache;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user