Commit db959bc2 authored by tangwei's avatar tangwei

修改bug

parent 98a7ca1e
......@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.enums.SourceTypeEnum;
import com.yeejoin.equipmanage.service.ISourceStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.SpringContextHelper;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
/**
......@@ -56,16 +58,20 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
}
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) {
String reverse = new StringBuffer(categoryCode).reverse().toString();
int noZero = Integer.parseInt(reverse);
return new StringBuffer(String.valueOf(noZero)).reverse().toString();
}
private String buildPattenKey(String bizOrgCode, String sourceType, String treeCode) {
private String buildPattenKey(String bizOrgCode, String sourceType, String treeCode) {
return PREFIX_CATEGORY_COUNT + bizOrgCode + "*_" + sourceType + "_" + treeCode + "*";
}
......
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