|
|
|
@ -35,6 +35,8 @@ import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.time.format.DateTimeParseException; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
@ -403,6 +405,27 @@ public class YbsjHandsetServiceImpl implements YbsjHandsetService { |
|
|
|
|
return ServerResponse.createBySuccess(param); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<Map<String, Object>> selectScjCount(Integer dateType) { |
|
|
|
|
List<Map<String, Object>> selectScjCount =ybsjHandsetMapper.selectScjCount(dateType); |
|
|
|
|
List<Map<String, Object>> selectScjCountTwo = ybsjHandsetMapper.selectScjCountTwo(dateType); |
|
|
|
|
List<Map<String, Object>> mergedList = Stream.concat(selectScjCount.stream(), selectScjCountTwo.stream()) |
|
|
|
|
.collect(Collectors.groupingBy( |
|
|
|
|
map -> String.valueOf(map.get("generated_date")) , |
|
|
|
|
Collectors.summingInt(map -> Integer.parseInt(map.get("total_data").toString()) ) |
|
|
|
|
)) |
|
|
|
|
.entrySet() |
|
|
|
|
.stream() |
|
|
|
|
.map(entry -> { |
|
|
|
|
Map<String, Object> newMap = new HashMap<>(); |
|
|
|
|
newMap.put("generated_date", entry.getKey()); |
|
|
|
|
newMap.put("total_data", entry.getValue()); |
|
|
|
|
return newMap; |
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
return mergedList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 18位身份证正则
|
|
|
|
|
private static final Pattern ID_PATTERN = Pattern.compile("^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$"); |
|
|
|
|
|
|
|
|
|