|
@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@ -90,8 +91,8 @@ public class StatisticsService extends BaseService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean peopleNumToRedis() {
|
|
|
List<PopulationBase> peopleNums = peopleNumDao.findByYear(Calendar.getInstance().get(Calendar.YEAR));
|
|
|
public boolean peopleNumToRedis() throws Exception {
|
|
|
List<PopulationBase> peopleNums = peopleNumDao.findByYear(Integer.valueOf(Constant.getNowYear()));
|
|
|
|
|
|
for (PopulationBase peopleNum : peopleNums) {
|
|
|
redisTemplate.opsForValue().set("people:num:" + peopleNum.getCode(), new JSONObject(peopleNum).toString());
|