Signed-off-by: lixiangrong <lixiangrong@pxene.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,5 +8,6 @@
|
|||||||
target
|
target
|
||||||
com
|
com
|
||||||
*.project
|
*.project
|
||||||
*
|
|
||||||
*.classpath
|
*.classpath
|
||||||
|
/.settings
|
||||||
|
/bin
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ redis.pool.maxWait=1000
|
|||||||
redis.pool.testOnBorrow=true
|
redis.pool.testOnBorrow=true
|
||||||
redis.pool.testOnReturn=true
|
redis.pool.testOnReturn=true
|
||||||
redis.ip=192.168.3.166
|
redis.ip=192.168.3.166
|
||||||
|
#redis.ip=111.235.158.31
|
||||||
redis.port=7379
|
redis.port=7379
|
||||||
redis.password=
|
redis.password=
|
||||||
@@ -1,16 +1,13 @@
|
|||||||
package osc.git.eh3.test;
|
package osc.git.eh3.test;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import osc.git.eh3.redis.JedisUtil;
|
|
||||||
|
|
||||||
public class TestCode {
|
public class TestCode {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
@@ -232,8 +229,19 @@ public class TestCode {
|
|||||||
// System.out.println(JedisUtil.getStr("0000"));
|
// System.out.println(JedisUtil.getStr("0000"));
|
||||||
// Map<String,Integer> result = new HashMap<String, Integer>();
|
// Map<String,Integer> result = new HashMap<String, Integer>();
|
||||||
// System.out.println(result.get("jj"));
|
// System.out.println(result.get("jj"));
|
||||||
double budgets = 10000;
|
// double budgets = 10000;
|
||||||
System.out.println((budgets/100));
|
// System.out.println((budgets/100));
|
||||||
|
|
||||||
|
String str = null;
|
||||||
|
BigDecimal budget = new BigDecimal(str);
|
||||||
|
// budget = budget.subtract(new BigDecimal(10));
|
||||||
|
// if (budget.compareTo(new BigDecimal(0)) <= 0) {
|
||||||
|
// System.out.println("1");
|
||||||
|
// } else {
|
||||||
|
// System.out.println("2");
|
||||||
|
// }
|
||||||
|
|
||||||
|
System.out.println(budget.doubleValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
32
src/main/java/osc/git/eh3/test/TestRedisData.java
Normal file
32
src/main/java/osc/git/eh3/test/TestRedisData.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package osc.git.eh3.test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import osc.git.eh3.redis.JedisUtil;
|
||||||
|
|
||||||
|
public class TestRedisData {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
showSom("fa5f9738-6055-4881-b1be-32f8111a18d1");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showSom(String groupid){
|
||||||
|
String[] keys = JedisUtil.getKeys("dsp_budget_*_"+groupid);
|
||||||
|
BigDecimal totals = new BigDecimal(0);
|
||||||
|
for (String key : keys) {
|
||||||
|
System.out.println(key+"-----------:"+JedisUtil.getStr(key));
|
||||||
|
totals = totals.add(new BigDecimal(JedisUtil.getStr(key)));
|
||||||
|
}
|
||||||
|
System.out.println("budget_balance_"+groupid+"-----------:"+JedisUtil.getStr("budget_balance_"+groupid));
|
||||||
|
totals = totals.add(new BigDecimal(JedisUtil.getStr("budget_balance_"+groupid)));
|
||||||
|
System.out.println(totals.toPlainString());
|
||||||
|
|
||||||
|
keys = JedisUtil.getKeys("dsp_counter_*_"+groupid);
|
||||||
|
for (String key : keys) {
|
||||||
|
System.out.println(key+"-----------:"+JedisUtil.getStr(key));
|
||||||
|
}
|
||||||
|
System.out.println("counter_balance_"+groupid+"-----------:"+JedisUtil.getStr("counter_balance_"+groupid));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user