From 2f44e2a77f45d9fd52d8656ca427cc4c4df4796e Mon Sep 17 00:00:00 2001
From: wanggeng <450292408@qq.com>
Date: Sun, 25 Dec 2022 16:41:36 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=BB=9F=E8=AE=A1=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 3 +-
.../DefaultHomePageAppController.java | 60 ++++++++++---------
...application-ws.yml => application-dev.yml} | 32 ++++++----
3 files changed, 53 insertions(+), 42 deletions(-)
rename src/main/resources/{application-ws.yml => application-dev.yml} (82%)
diff --git a/pom.xml b/pom.xml
index 69cc66a..fdc4361 100644
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,8 @@
org.projectlombok
lombok
- 1.16.18
+ 1.18.24
+ compile
diff --git a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java
index 0da8dd1..bd63445 100644
--- a/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java
+++ b/src/main/java/cn/com/tenlion/commonpopulation/controller/app/defaulthomepage/DefaultHomePageAppController.java
@@ -103,45 +103,45 @@ public class DefaultHomePageAppController extends DefaultBaseController {
}
@GetMapping("release/gender-age")
- public Object getGenderAge() throws SearchException{
+ public Object getGenderAge() throws SearchException {
Map params = requestParams();
List population = basePopulationInfoService.listBasePopulationInfo(params);
- Integer[] man = {0,0,0,0,0};
- Integer[] woMan = {0,0,0,0,0};
- for(BasePopulationInfoDTO item : population ){
+ Integer[] man = {0, 0, 0, 0, 0};
+ Integer[] woMan = {0, 0, 0, 0, 0};
+ for (BasePopulationInfoDTO item : population) {
String gender = IdCardVerifyUtil.getIdCardGender(item.getIdCardNumber());
Integer age = IdCardVerifyUtil.getAgeFromIdCardNumber(item.getIdCardNumber());
- if("1".equals(gender)){
- if(age < 20){
+ if ("1".equals(gender)) {
+ if (age < 20) {
man[0]++;
}
- if(age >= 20 && age <30){
+ if (age >= 20 && age < 30) {
man[1]++;
}
- if(age >=30 && age < 45){
+ if (age >= 30 && age < 45) {
man[2]++;
}
- if(age >= 45 && age < 55){
+ if (age >= 45 && age < 55) {
man[3]++;
}
- if(age >= 55){
+ if (age >= 55) {
man[4]++;
}
}
- if("0".equals(gender)){
- if(age < 20){
+ if ("0".equals(gender)) {
+ if (age < 20) {
woMan[0]++;
}
- if(age >= 20 && age <30){
+ if (age >= 20 && age < 30) {
woMan[1]++;
}
- if(age >=30 && age < 45){
+ if (age >= 30 && age < 45) {
woMan[2]++;
}
- if(age >= 45 && age < 55){
+ if (age >= 45 && age < 55) {
woMan[3]++;
}
- if(age >= 55){
+ if (age >= 55) {
woMan[4]++;
}
}
@@ -158,17 +158,17 @@ public class DefaultHomePageAppController extends DefaultBaseController {
Map query = new HashMap<>(8);
List areaNames = new ArrayList<>();
List counts = new ArrayList<>();
- for (AreaDTO item : area){
+ for (AreaDTO item : area) {
String areaCoed = item.getAreaCode();
String[] areaCodeSplit = IdCardVerifyUtil.splitStringByLength(areaCoed, 2);
String areaCodeLike = "";
- for(int i = 5 ; i >= 0; i--){
- if(!"00".equals(areaCodeSplit[i])){
- areaCodeLike = areaCoed.substring(0, (i + 1) * 2 );
+ for (int i = 5; i >= 0; i--) {
+ if (!"00".equals(areaCodeSplit[i])) {
+ areaCodeLike = areaCoed.substring(0, (i + 1) * 2);
break;
}
}
- query.put("areaCodeLike",areaCodeLike);
+ query.put("areaCodeLike", areaCodeLike);
List areaPeopleList = basePopulationInfoService.listBasePopulationInfo(query);
areaNames.add(item.getAreaName());
counts.add(areaPeopleList.size());
@@ -180,19 +180,20 @@ public class DefaultHomePageAppController extends DefaultBaseController {
}
@GetMapping("release/get-education")
- public Object getEducation() throws SearchException{
+ public Object getEducation() throws SearchException {
Map params = requestParams();
List