|
@@ -74,6 +74,7 @@ import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ExecutionException;
|
|
|
import java.util.concurrent.Future;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -119,7 +120,8 @@ public class WmScorePackageController {
|
|
|
|
|
|
// 如果是草稿,放入缓存
|
|
|
if (wmScorePackage.getP2pDraft()){
|
|
|
- redisTemplate.opsForValue().set(String.format("scorepackage:p2p:%s", wmScorePackage.getId()), wmScorePackage.getP2pAmount().toString());
|
|
|
+ redisTemplate.opsForValue().set(String.format("scorepackage:p2p:amount:%s", wmScorePackage.getId()), wmScorePackage.getP2pAmount().toString(), 180, TimeUnit.DAYS);
|
|
|
+ redisTemplate.opsForValue().set(String.format("scorepackage:p2p:desc:%s", wmScorePackage.getId()), wmScorePackage.getDescription(), 180, TimeUnit.DAYS);
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -197,9 +199,11 @@ public class WmScorePackageController {
|
|
|
if (r.getP2pAmount() != null){
|
|
|
r.setP2pDraft(false);
|
|
|
} else {
|
|
|
- String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:%s", r.getId()));
|
|
|
+ String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:amount:%s", r.getId()));
|
|
|
+ String desc = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:desc:%s", r.getId()));
|
|
|
if (StrUtil.isNotBlank(s)){
|
|
|
r.setP2pAmount(new BigDecimal(s));
|
|
|
+ r.setDescription(desc);
|
|
|
}
|
|
|
r.setP2pDraft(true);
|
|
|
}
|
|
@@ -694,9 +698,11 @@ public class WmScorePackageController {
|
|
|
if (r.getP2pAmount() != null){
|
|
|
r.setP2pDraft(false);
|
|
|
} else {
|
|
|
- String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:%s", r.getId()));
|
|
|
+ String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:amount:%s", r.getId()));
|
|
|
+ String desc = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:desc:%s", r.getId()));
|
|
|
if (StrUtil.isNotBlank(s)){
|
|
|
r.setP2pAmount(new BigDecimal(s));
|
|
|
+ r.setDescription(desc);
|
|
|
}
|
|
|
r.setP2pDraft(true);
|
|
|
}
|
|
@@ -1454,9 +1460,11 @@ public class WmScorePackageController {
|
|
|
if (wmScorePackage.getP2pAmount() != null){
|
|
|
wmScorePackage.setP2pDraft(false);
|
|
|
} else {
|
|
|
- String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:%s", wmScorePackage.getId()));
|
|
|
+ String s = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:amount:%s", wmScorePackage.getId()));
|
|
|
+ String desc = redisTemplate.opsForValue().get(String.format("scorepackage:p2p:desc:%s", wmScorePackage.getId()));
|
|
|
if (StrUtil.isNotBlank(s)){
|
|
|
wmScorePackage.setP2pAmount(new BigDecimal(s));
|
|
|
+ wmScorePackage.setDescription(desc);
|
|
|
}
|
|
|
wmScorePackage.setP2pDraft(true);
|
|
|
}
|