Commit db959bc2 authored by tangwei's avatar tangwei

修改bug

parent 98a7ca1e
...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.enums.SourceTypeEnum; import com.yeejoin.equipmanage.common.enums.SourceTypeEnum;
import com.yeejoin.equipmanage.service.ISourceStatistics; import com.yeejoin.equipmanage.service.ISourceStatistics;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.SpringContextHelper; import org.typroject.tyboot.core.foundation.context.SpringContextHelper;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
...@@ -56,9 +58,13 @@ public class SourcesStatisticsImpl implements ISourceStatistics { ...@@ -56,9 +58,13 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
} }
private int sumNumber(Set<String> keys) { private int sumNumber(Set<String> keys) {
return keys.stream().filter(k -> redisUtil.get(k) != null).mapToInt(k -> Integer.parseInt(redisUtil.get(k).toString())).sum(); // return keys.stream().filter(k -> redisUtil.get(k) != null).mapToInt(k -> Integer.parseInt(redisUtil.get(k).toString())).sum();
return keys.stream().mapToInt(k -> redisUtil.get(k) != null?Integer.parseInt(redisUtil.get(k).toString()):0).sum();
} }
private String subStringZero(String categoryCode) { private String subStringZero(String categoryCode) {
String reverse = new StringBuffer(categoryCode).reverse().toString(); String reverse = new StringBuffer(categoryCode).reverse().toString();
int noZero = Integer.parseInt(reverse); int noZero = Integer.parseInt(reverse);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment