Explorar el Código

修复活码出现custservice_id为0的情况

leon hace 4 años
padre
commit
c5fdf3b9ce

+ 3 - 0
src/main/java/com/mokamrp/privates/service/pangu/impl/PromoteQrcodePoolServiceImpl.java

@@ -144,6 +144,9 @@ public class PromoteQrcodePoolServiceImpl extends ServiceImpl<PromoteQrcodePoolM
     }
     }
 
 
     public Boolean addRedis(Integer promoteId, Integer custserviceId, Integer weight) {
     public Boolean addRedis(Integer promoteId, Integer custserviceId, Integer weight) {
+        if (custserviceId == null || custserviceId.equals(0)){
+            return false;
+        }
         String scoreStr = BigDecimal.valueOf(weight.doubleValue() / 1000).setScale(4, RoundingMode.HALF_EVEN).stripTrailingZeros().toPlainString();
         String scoreStr = BigDecimal.valueOf(weight.doubleValue() / 1000).setScale(4, RoundingMode.HALF_EVEN).stripTrailingZeros().toPlainString();
         float score = Float.parseFloat(scoreStr);
         float score = Float.parseFloat(scoreStr);
         Long index = stringRedisTemplate.opsForZSet().rank(RedisKey.PanCustServiceIdView + promoteId, Integer.toString(custserviceId));
         Long index = stringRedisTemplate.opsForZSet().rank(RedisKey.PanCustServiceIdView + promoteId, Integer.toString(custserviceId));

+ 3 - 0
src/main/java/com/mokamrp/privates/task/pangu/ResetCustserviceViewTask.java

@@ -66,6 +66,9 @@ public class ResetCustserviceViewTask {
     }
     }
 
 
     public Boolean addRedis(Integer promoteId, Integer custserviceId, Integer weight) {
     public Boolean addRedis(Integer promoteId, Integer custserviceId, Integer weight) {
+        if (custserviceId == null || custserviceId.equals(0)){
+            return false;
+        }
         String scoreStr = BigDecimal.valueOf(weight.doubleValue()/1000).setScale(4, RoundingMode.HALF_EVEN).stripTrailingZeros().toPlainString();
         String scoreStr = BigDecimal.valueOf(weight.doubleValue()/1000).setScale(4, RoundingMode.HALF_EVEN).stripTrailingZeros().toPlainString();
         float score = Float.parseFloat(scoreStr);
         float score = Float.parseFloat(scoreStr);
         Long index = stringRedisTemplate.opsForZSet().rank(RedisKey.PanCustServiceIdView + promoteId, Integer.toString(custserviceId));
         Long index = stringRedisTemplate.opsForZSet().rank(RedisKey.PanCustServiceIdView + promoteId, Integer.toString(custserviceId));