|
@@ -36,6 +36,7 @@ import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.sql.Timestamp;
|
|
@@ -218,23 +219,23 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
startPage();
|
|
|
czrk.setRegionId("340882000000");
|
|
|
List<Czrk> czrks = new ArrayList<>();
|
|
|
- if(czrk.getQueryType().equals(Czrk.HJ)){
|
|
|
+ if (czrk.getQueryType().equals(Czrk.HJ)) {
|
|
|
czrks = czrkMapper.listByXz(czrk);
|
|
|
- if(isNotEmpty(czrks)){
|
|
|
+ if (isNotEmpty(czrks)) {
|
|
|
// 居住地址
|
|
|
List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
czrks = new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
String regionId = "340882000000";
|
|
|
String status = "Y";
|
|
|
//居住信息
|
|
|
- List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(),DateUtils.getTodayEndStr(),regionId,status);
|
|
|
+ List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(), DateUtils.getTodayEndStr(), regionId, status);
|
|
|
|
|
|
- if(isNotEmpty(czrkJzdzList)){
|
|
|
+ if (isNotEmpty(czrkJzdzList)) {
|
|
|
List<String> czrkIdCardList = map(czrkJzdzList, CzrkJzdz::getIdCard);
|
|
|
//户籍信息
|
|
|
czrks = czrkMapper.listByIdCard(czrkIdCardList);
|
|
@@ -259,24 +260,24 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
startPage();
|
|
|
czrk.setRegionId("340882000000");
|
|
|
List<Czrk> czrks = new ArrayList<>();
|
|
|
- if(czrk.getQueryType().equals(Czrk.HJ)){
|
|
|
+ if (czrk.getQueryType().equals(Czrk.HJ)) {
|
|
|
czrks = czrkMapper.listByJs(czrk);
|
|
|
- if(isNotEmpty(czrks)){
|
|
|
+ if (isNotEmpty(czrks)) {
|
|
|
// 居住地址
|
|
|
List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
|
|
|
handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
czrks = new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
String regionId = "340882000000";
|
|
|
String status = "N";
|
|
|
//居住信息
|
|
|
- List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(),DateUtils.getTodayEndStr(),regionId,status);
|
|
|
+ List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(), DateUtils.getTodayEndStr(), regionId, status);
|
|
|
|
|
|
- if(isNotEmpty(czrkJzdzList)){
|
|
|
+ if (isNotEmpty(czrkJzdzList)) {
|
|
|
List<String> czrkIdCardList = map(czrkJzdzList, CzrkJzdz::getIdCard);
|
|
|
//户籍信息
|
|
|
czrks = czrkMapper.listByIdCard(czrkIdCardList);
|
|
@@ -285,7 +286,6 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
//packAddr(czrks);
|
|
|
return czrks;
|
|
|
}
|
|
@@ -480,7 +480,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
}
|
|
|
|
|
|
//人员信息新增成功
|
|
|
- if(childCount > 0){
|
|
|
+ if (childCount > 0) {
|
|
|
addExtracted(czrk, czrkJzdzList);
|
|
|
}
|
|
|
return childCount > 0 ? AjaxResult.success() : AjaxResult.error();
|
|
@@ -502,14 +502,14 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
Timestamp e = Timestamp.valueOf(endTime);
|
|
|
|
|
|
//判断新增的是否是潜山市人口(户籍判断)
|
|
|
- if(!ObjectUtils.isEmpty(czrk) && StringUtils.isNotEmpty(czrk.getRegionId()) && czrk.getRegionId().equals("340882000000")){
|
|
|
+ if (!ObjectUtils.isEmpty(czrk) && StringUtils.isNotEmpty(czrk.getRegionId()) && czrk.getRegionId().equals("340882000000")) {
|
|
|
//总户籍人数
|
|
|
- jsonObjects.put("hjzrs",(Integer)jsonObjects.get("hjzrs")+1);
|
|
|
+ jsonObjects.put("hjzrs", (Integer) jsonObjects.get("hjzrs") + 1);
|
|
|
//户籍新增人数
|
|
|
- jsonObjects.put("hjxz",(Integer)jsonObjects.get("hjxz")+1);
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjects.get("hjjs")>0){
|
|
|
- jsonObjects.put("hjjs",(Integer)jsonObjects.get("hjjs")-1);
|
|
|
+ jsonObjects.put("hjxz", (Integer) jsonObjects.get("hjxz") + 1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjects.get("hjjs") > 0) {
|
|
|
+ jsonObjects.put("hjjs", (Integer) jsonObjects.get("hjjs") - 1);
|
|
|
}
|
|
|
}
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
@@ -519,37 +519,37 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject jsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- jsonObjectz.put("hjzrs",(Integer)jsonObjectz.get("hjzrs")+1);
|
|
|
+ jsonObjectz.put("hjzrs", (Integer) jsonObjectz.get("hjzrs") + 1);
|
|
|
//镇户籍新增人数
|
|
|
- jsonObjectz.put("hjxz",(Integer)jsonObjectz.get("hjxz")+1);
|
|
|
+ jsonObjectz.put("hjxz", (Integer) jsonObjectz.get("hjxz") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjectz.get("hjjs")>0){
|
|
|
- jsonObjectz.put("hjjs",(Integer)jsonObjectz.get("hjjs")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjectz.get("hjjs") > 0) {
|
|
|
+ jsonObjectz.put("hjjs", (Integer) jsonObjectz.get("hjjs") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//镇户籍人数占比
|
|
|
- jsonObjectz.put("hjbfb", NumberUtils.percent((Integer)jsonObjectz.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectz.put("hjbfb", NumberUtils.percent((Integer) jsonObjectz.get("hjzrs"), (Integer) jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), jsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
|
- List<JSONObject> jsList = (List<JSONObject>)jsonObjects.get("townDatas");
|
|
|
+ List<JSONObject> jsList = (List<JSONObject>) jsonObjects.get("townDatas");
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
- if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
+ if (allDept.getDeptName().equals(stringObjectMap.get("zhen"))) {
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("hjzrs",(Integer)stringObjectMap.get("hjzrs")+1);
|
|
|
+ stringObjectMap.put("hjzrs", (Integer) stringObjectMap.get("hjzrs") + 1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("hjxz",(Integer)stringObjectMap.get("hjxz")+1);
|
|
|
+ stringObjectMap.put("hjxz", (Integer) stringObjectMap.get("hjxz") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)stringObjectMap.get("hjjs")>0){
|
|
|
- stringObjectMap.put("hjjs",(Integer)stringObjectMap.get("hjjs")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) stringObjectMap.get("hjjs") > 0) {
|
|
|
+ stringObjectMap.put("hjjs", (Integer) stringObjectMap.get("hjjs") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("hjbfb", NumberUtils.percent((Integer)stringObjectMap.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ stringObjectMap.put("hjbfb", NumberUtils.percent((Integer) stringObjectMap.get("hjzrs"), (Integer) jsonObjects.get("hjzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -557,7 +557,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageId())) {
|
|
|
List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillageId());
|
|
|
for (SysDept sysDept : allDeptC) {
|
|
|
JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
@@ -565,31 +565,31 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
continue;
|
|
|
}
|
|
|
//村总户籍人数
|
|
|
- jsonObjectC.put("hjzrs",(Integer)jsonObjectC.get("hjzrs")+1);
|
|
|
+ jsonObjectC.put("hjzrs", (Integer) jsonObjectC.get("hjzrs") + 1);
|
|
|
//村户籍新增人数
|
|
|
- jsonObjectC.put("hjxz",(Integer)jsonObjectC.get("hjxz")+1);
|
|
|
+ jsonObjectC.put("hjxz", (Integer) jsonObjectC.get("hjxz") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjectC.get("hjjs")>0){
|
|
|
- jsonObjectC.put("hjjs",(Integer)jsonObjectC.get("hjjs")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjectC.get("hjjs") > 0) {
|
|
|
+ jsonObjectC.put("hjjs", (Integer) jsonObjectC.get("hjjs") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//村户籍人数占比
|
|
|
- jsonObjectC.put("hjbfb", NumberUtils.percent((Integer)jsonObjectC.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectC.put("hjbfb", NumberUtils.percent((Integer) jsonObjectC.get("hjzrs"), (Integer) jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(czrkJzdzList.size()>0){
|
|
|
+ if (czrkJzdzList.size() > 0) {
|
|
|
for (CzrkJzdz czrkJzdz : czrkJzdzList) {
|
|
|
- if(StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && czrkJzdz.getRegionId().equals("340882000000")){
|
|
|
+ if (StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && czrkJzdz.getRegionId().equals("340882000000")) {
|
|
|
//总常驻人数
|
|
|
- jsonObjects.put("czzrs",(Integer)jsonObjects.get("czzrs")+1);
|
|
|
+ jsonObjects.put("czzrs", (Integer) jsonObjects.get("czzrs") + 1);
|
|
|
//常驻新增人数
|
|
|
- jsonObjects.put("czxz",(Integer)jsonObjects.get("czxz")+1);
|
|
|
+ jsonObjects.put("czxz", (Integer) jsonObjects.get("czxz") + 1);
|
|
|
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
|
List<SysDept> cAllDepts = remoteDeptService.selectByAreaId(czrkJzdz.getTownId());
|
|
@@ -598,23 +598,23 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject cJsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- cJsonObjectz.put("czzrs",(Integer)cJsonObjectz.get("czzrs")+1);
|
|
|
+ cJsonObjectz.put("czzrs", (Integer) cJsonObjectz.get("czzrs") + 1);
|
|
|
//镇户籍新增人数
|
|
|
- cJsonObjectz.put("czxz",(Integer)cJsonObjectz.get("czxz")+1);
|
|
|
+ cJsonObjectz.put("czxz", (Integer) cJsonObjectz.get("czxz") + 1);
|
|
|
//镇户籍人数占比
|
|
|
- cJsonObjectz.put("czbfb", NumberUtils.percent((Integer)cJsonObjectz.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectz.put("czbfb", NumberUtils.percent((Integer) cJsonObjectz.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), cJsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
|
- List<JSONObject> jsList = (List<JSONObject>)jsonObjects.get("townDatas");
|
|
|
+ List<JSONObject> jsList = (List<JSONObject>) jsonObjects.get("townDatas");
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
- if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
+ if (allDept.getDeptName().equals(stringObjectMap.get("zhen"))) {
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("czzrs",(Integer)stringObjectMap.get("czzrs")+1);
|
|
|
+ stringObjectMap.put("czzrs", (Integer) stringObjectMap.get("czzrs") + 1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("czxz",(Integer)stringObjectMap.get("czxz")+1);
|
|
|
+ stringObjectMap.put("czxz", (Integer) stringObjectMap.get("czxz") + 1);
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("czbfb", NumberUtils.percent((Integer)stringObjectMap.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ stringObjectMap.put("czbfb", NumberUtils.percent((Integer) stringObjectMap.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -622,7 +622,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageId())) {
|
|
|
List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
for (SysDept sysDept : cAllDeptC) {
|
|
|
JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
@@ -630,11 +630,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
continue;
|
|
|
}
|
|
|
//村总户籍人数
|
|
|
- cJsonObjectC.put("czzrs",(Integer)cJsonObjectC.get("czzrs")+1);
|
|
|
+ cJsonObjectC.put("czzrs", (Integer) cJsonObjectC.get("czzrs") + 1);
|
|
|
//村户籍新增人数
|
|
|
- cJsonObjectC.put("czxz",(Integer)cJsonObjectC.get("czxz")+1);
|
|
|
+ cJsonObjectC.put("czxz", (Integer) cJsonObjectC.get("czxz") + 1);
|
|
|
//村户籍人数占比
|
|
|
- cJsonObjectC.put("czbfb", NumberUtils.percent((Integer)cJsonObjectC.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectC.put("czbfb", NumberUtils.percent((Integer) cJsonObjectC.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
}
|
|
|
break;
|
|
@@ -649,7 +649,6 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
private void reduceExtracted(Czrk czrk, List<CzrkJzdz> czrkJzdzList) {
|
|
|
//同步修改redis缓存数据
|
|
|
//修改潜山市总数居
|
|
@@ -666,15 +665,15 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
Timestamp e = Timestamp.valueOf(endTime);
|
|
|
|
|
|
//判断新增的是否是潜山市人口(户籍判断)
|
|
|
- if(!ObjectUtils.isEmpty(czrk) && StringUtils.isNotEmpty(czrk.getRegionId()) && czrk.getRegionId().equals("340882000000")){
|
|
|
+ if (!ObjectUtils.isEmpty(czrk) && StringUtils.isNotEmpty(czrk.getRegionId()) && czrk.getRegionId().equals("340882000000")) {
|
|
|
//总户籍人数
|
|
|
- jsonObjects.put("hjzrs",(Integer)jsonObjects.get("hjzrs")-1);
|
|
|
+ jsonObjects.put("hjzrs", (Integer) jsonObjects.get("hjzrs") - 1);
|
|
|
//户籍新增人数
|
|
|
- jsonObjects.put("hjjs",(Integer)jsonObjects.get("hjjs")+1);
|
|
|
+ jsonObjects.put("hjjs", (Integer) jsonObjects.get("hjjs") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjects.get("hjxz")>0){
|
|
|
- jsonObjects.put("hjxz",(Integer)jsonObjects.get("hjxz")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjects.get("hjxz") > 0) {
|
|
|
+ jsonObjects.put("hjxz", (Integer) jsonObjects.get("hjxz") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -685,35 +684,35 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject jsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- jsonObjectz.put("hjzrs",(Integer)jsonObjectz.get("hjzrs")-1);
|
|
|
+ jsonObjectz.put("hjzrs", (Integer) jsonObjectz.get("hjzrs") - 1);
|
|
|
//镇户籍新增人数
|
|
|
- jsonObjectz.put("hjjs",(Integer)jsonObjectz.get("hjjs")+1);
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjectz.get("hjxz")>0){
|
|
|
- jsonObjectz.put("hjxz",(Integer)jsonObjectz.get("hjxz")-1);
|
|
|
+ jsonObjectz.put("hjjs", (Integer) jsonObjectz.get("hjjs") + 1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjectz.get("hjxz") > 0) {
|
|
|
+ jsonObjectz.put("hjxz", (Integer) jsonObjectz.get("hjxz") - 1);
|
|
|
}
|
|
|
}
|
|
|
//镇户籍人数占比
|
|
|
- jsonObjectz.put("hjbfb", NumberUtils.percent((Integer)jsonObjectz.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectz.put("hjbfb", NumberUtils.percent((Integer) jsonObjectz.get("hjzrs"), (Integer) jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), jsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
|
- List<JSONObject> jsList = (List<JSONObject>)jsonObjects.get("townDatas");
|
|
|
+ List<JSONObject> jsList = (List<JSONObject>) jsonObjects.get("townDatas");
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
- if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
+ if (allDept.getDeptName().equals(stringObjectMap.get("zhen"))) {
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("hjzrs",(Integer)stringObjectMap.get("hjzrs")-1);
|
|
|
+ stringObjectMap.put("hjzrs", (Integer) stringObjectMap.get("hjzrs") - 1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("hjjs",(Integer)stringObjectMap.get("hjjs")+1);
|
|
|
+ stringObjectMap.put("hjjs", (Integer) stringObjectMap.get("hjjs") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)stringObjectMap.get("hjxz")>0){
|
|
|
- stringObjectMap.put("hjxz",(Integer)stringObjectMap.get("hjxz")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) stringObjectMap.get("hjxz") > 0) {
|
|
|
+ stringObjectMap.put("hjxz", (Integer) stringObjectMap.get("hjxz") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("hjbfb", NumberUtils.percent((Integer)stringObjectMap.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
+ stringObjectMap.put("hjbfb", NumberUtils.percent((Integer) stringObjectMap.get("hjzrs"), (int) jsonObjects.get("hjzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -721,7 +720,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageId())) {
|
|
|
List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillageId());
|
|
|
for (SysDept sysDept : allDeptC) {
|
|
|
JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
@@ -729,31 +728,31 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
continue;
|
|
|
}
|
|
|
//村总户籍人数
|
|
|
- jsonObjectC.put("hjzrs",(Integer)jsonObjectC.get("hjzrs")-1);
|
|
|
+ jsonObjectC.put("hjzrs", (Integer) jsonObjectC.get("hjzrs") - 1);
|
|
|
//村户籍新增人数
|
|
|
- jsonObjectC.put("hjjs",(Integer)jsonObjectC.get("hjjs")+1);
|
|
|
+ jsonObjectC.put("hjjs", (Integer) jsonObjectC.get("hjjs") + 1);
|
|
|
|
|
|
- if(null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)){
|
|
|
- if((Integer)jsonObjectC.get("hjxz")>0){
|
|
|
- jsonObjectC.put("hjxz",(Integer)jsonObjectC.get("hjxz")-1);
|
|
|
+ if (null != czrk.getUpdateTime() && s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if ((Integer) jsonObjectC.get("hjxz") > 0) {
|
|
|
+ jsonObjectC.put("hjxz", (Integer) jsonObjectC.get("hjxz") - 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//村户籍人数占比
|
|
|
- jsonObjectC.put("hjbfb", NumberUtils.percent((Integer)jsonObjectC.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectC.put("hjbfb", NumberUtils.percent((Integer) jsonObjectC.get("hjzrs"), (Integer) jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(czrkJzdzList.size()>0){
|
|
|
+ if (czrkJzdzList.size() > 0) {
|
|
|
for (CzrkJzdz czrkJzdz : czrkJzdzList) {
|
|
|
- if(StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && czrkJzdz.getRegionId().equals("340882000000")){
|
|
|
+ if (StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && StringUtils.isNotEmpty(czrkJzdz.getRegionId()) && czrkJzdz.getRegionId().equals("340882000000")) {
|
|
|
//总常驻人数
|
|
|
- jsonObjects.put("czzrs",(Integer)jsonObjects.get("czzrs")-1);
|
|
|
+ jsonObjects.put("czzrs", (Integer) jsonObjects.get("czzrs") - 1);
|
|
|
//常驻新增人数
|
|
|
- jsonObjects.put("czjs",(Integer)jsonObjects.get("czjs")+1);
|
|
|
+ jsonObjects.put("czjs", (Integer) jsonObjects.get("czjs") + 1);
|
|
|
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
|
List<SysDept> cAllDepts = remoteDeptService.selectByAreaId(czrkJzdz.getTownId());
|
|
@@ -762,23 +761,23 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject cJsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- cJsonObjectz.put("czzrs",(Integer)cJsonObjectz.get("czzrs")-1);
|
|
|
+ cJsonObjectz.put("czzrs", (Integer) cJsonObjectz.get("czzrs") - 1);
|
|
|
//镇户籍新增人数
|
|
|
- cJsonObjectz.put("czjs",(Integer)cJsonObjectz.get("czjs")+1);
|
|
|
+ cJsonObjectz.put("czjs", (Integer) cJsonObjectz.get("czjs") + 1);
|
|
|
//镇户籍人数占比
|
|
|
- cJsonObjectz.put("czbfb", NumberUtils.percent((Integer)cJsonObjectz.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectz.put("czbfb", NumberUtils.percent((Integer) cJsonObjectz.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), cJsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
|
- List<JSONObject> jsList = (List<JSONObject>)jsonObjects.get("townDatas");
|
|
|
+ List<JSONObject> jsList = (List<JSONObject>) jsonObjects.get("townDatas");
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
- if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
+ if (allDept.getDeptName().equals(stringObjectMap.get("zhen"))) {
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("czzrs",(Integer)stringObjectMap.get("czzrs")-1);
|
|
|
+ stringObjectMap.put("czzrs", (Integer) stringObjectMap.get("czzrs") - 1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("czjs",(Integer)stringObjectMap.get("czjs")+1);
|
|
|
+ stringObjectMap.put("czjs", (Integer) stringObjectMap.get("czjs") + 1);
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("czbfb", NumberUtils.percent((Integer)stringObjectMap.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ stringObjectMap.put("czbfb", NumberUtils.percent((Integer) stringObjectMap.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -786,7 +785,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageId())) {
|
|
|
List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
for (SysDept sysDept : cAllDeptC) {
|
|
|
JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
@@ -794,11 +793,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
continue;
|
|
|
}
|
|
|
//村总户籍人数
|
|
|
- cJsonObjectC.put("czzrs",(Integer)cJsonObjectC.get("czzrs")-1);
|
|
|
+ cJsonObjectC.put("czzrs", (Integer) cJsonObjectC.get("czzrs") - 1);
|
|
|
//村户籍新增人数
|
|
|
- cJsonObjectC.put("czjs",(Integer)cJsonObjectC.get("czjs")+1);
|
|
|
+ cJsonObjectC.put("czjs", (Integer) cJsonObjectC.get("czjs") + 1);
|
|
|
//村户籍人数占比
|
|
|
- cJsonObjectC.put("czbfb", NumberUtils.percent((Integer)cJsonObjectC.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectC.put("czbfb", NumberUtils.percent((Integer) cJsonObjectC.get("czzrs"), (Integer) jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
}
|
|
|
break;
|
|
@@ -1042,10 +1041,10 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czrkMapper.changeCzrk(czrk);
|
|
|
|
|
|
//变更redis数据(正常(1)是新增,迁出(2)、失踪(3)、死亡(4)是减少)
|
|
|
- if(StringUtils.isNotBlank(status)){
|
|
|
- if("1".equals(status)){
|
|
|
+ if (StringUtils.isNotBlank(status)) {
|
|
|
+ if ("1".equals(status)) {
|
|
|
addExtracted(czrkQianchu, new ArrayList<CzrkJzdz>());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
reduceExtracted(czrkQianchu, new ArrayList<CzrkJzdz>());
|
|
|
}
|
|
|
}
|
|
@@ -1081,7 +1080,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
@Override
|
|
|
public List<Czrk> getAllCzrk(Czrk czrk) {
|
|
|
SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
|
|
|
- setQueryRole(czrk,sysUser,Czrk.HJ);
|
|
|
+ setQueryRole(czrk, sysUser, Czrk.HJ);
|
|
|
setAgeScope(czrk);
|
|
|
List<Czrk> czrkList = czrkMapper.getAllCzrk(czrk);
|
|
|
|
|
@@ -1094,7 +1093,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
).collect(Collectors.toList());*/
|
|
|
|
|
|
CzrkUtils.packAddr(czrkList);
|
|
|
- if(czrkList==null || czrkList.size()<=0){
|
|
|
+ if (czrkList == null || czrkList.size() <= 0) {
|
|
|
throw new BaseException("请下载属于本乡镇数据");
|
|
|
}
|
|
|
//packAddr(czrkList);
|
|
@@ -1103,25 +1102,25 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public String importUser(List<ThirdPartInfo> thirdPartInfoList,String source) {
|
|
|
+ public String importUser(List<ThirdPartInfo> thirdPartInfoList, String source) {
|
|
|
if (StringUtils.isNull(thirdPartInfoList) || thirdPartInfoList.size() == 0) {
|
|
|
throw new CustomException("导入数据不能为空!");
|
|
|
}
|
|
|
//获取上传死亡人员第三方数据remoteDictDataService
|
|
|
- String sourceName = remoteDictDataService.selectDictLabel("data_sources",source);
|
|
|
+ String sourceName = remoteDictDataService.selectDictLabel("data_sources", source);
|
|
|
//获取登录人员
|
|
|
SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
|
|
|
int successNum = 0;
|
|
|
int failureNum = 0;
|
|
|
StringBuilder successMsg = new StringBuilder();
|
|
|
StringBuilder failureMsg = new StringBuilder();
|
|
|
- try{
|
|
|
+ try {
|
|
|
for (ThirdPartInfo thirdPartInfo : thirdPartInfoList) {
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(thirdPartInfo.getCremationTime())){
|
|
|
- Calendar calendar = new GregorianCalendar(1900,0,-1);
|
|
|
+ if (StringUtils.isNotEmpty(thirdPartInfo.getCremationTime())) {
|
|
|
+ Calendar calendar = new GregorianCalendar(1900, 0, -1);
|
|
|
Date date = calendar.getTime();
|
|
|
- Date dd = DateUtils.addDays(date,Integer.valueOf(thirdPartInfo.getCremationTime()));
|
|
|
+ Date dd = DateUtils.addDays(date, Integer.valueOf(thirdPartInfo.getCremationTime()));
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
thirdPartInfo.setCremationTime(format.format(dd));
|
|
|
}
|
|
@@ -1155,32 +1154,32 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
thirdPartInfo.setIsLocal("否");
|
|
|
//去数据库根据人员身份证号查询人员
|
|
|
Czrk czrkSjk = czrkMapper.getCzrkByIdCard(thirdPartInfo.getIdCard());
|
|
|
- if(ObjectUtils.isNotEmpty(czrkSjk)){
|
|
|
+ if (ObjectUtils.isNotEmpty(czrkSjk)) {
|
|
|
//数据库存在该人员
|
|
|
czrkSjk.setStatus("4");
|
|
|
czrkSjk.setChangUser(sourceName);
|
|
|
czrkSjk.setChangNikeUser(sourceName);
|
|
|
czrkMapper.changeCzrk(czrkSjk);
|
|
|
thirdPartInfo.setIsLocal("是");
|
|
|
- if(StringUtils.isNotEmpty(czrkSjk.getVillageTownsId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrkSjk.getVillageTownsId())) {
|
|
|
thirdPartInfo.setVillageTownsId(czrkSjk.getVillageTownsId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(czrkSjk.getVillageTowns())){
|
|
|
+ if (StringUtils.isNotEmpty(czrkSjk.getVillageTowns())) {
|
|
|
thirdPartInfo.setVillageTowns(czrkSjk.getVillageTowns());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(czrkSjk.getVillageId())){
|
|
|
+ if (StringUtils.isNotEmpty(czrkSjk.getVillageId())) {
|
|
|
thirdPartInfo.setVillageId(czrkSjk.getVillageId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(czrkSjk.getVillage())){
|
|
|
+ if (StringUtils.isNotEmpty(czrkSjk.getVillage())) {
|
|
|
thirdPartInfo.setVillage(czrkSjk.getVillage());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//获取乡镇
|
|
|
//乡镇deptId
|
|
|
Long deptId = null;
|
|
|
- if(isNotEmpty(thirdPartInfo.getTownship())){
|
|
|
+ if (isNotEmpty(thirdPartInfo.getTownship())) {
|
|
|
for (SysDept allDept : allDepts) {
|
|
|
- if(allDept.getDeptName().equals(thirdPartInfo.getTownship()+"乡") || allDept.getDeptName().equals(thirdPartInfo.getTownship()+"镇")){
|
|
|
+ if (allDept.getDeptName().equals(thirdPartInfo.getTownship() + "乡") || allDept.getDeptName().equals(thirdPartInfo.getTownship() + "镇")) {
|
|
|
thirdPartInfo.setVillageTownsId(allDept.getAreaId());
|
|
|
thirdPartInfo.setVillageTowns(allDept.getDeptName());
|
|
|
deptId = allDept.getId();
|
|
@@ -1189,10 +1188,10 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
}
|
|
|
}
|
|
|
//获取村
|
|
|
- if(isEmpty(deptId) && isNotEmpty(thirdPartInfo.getVillageGroup()) && thirdPartInfo.getVillageGroup().contains("村")){
|
|
|
- String cun = thirdPartInfo.getVillageGroup().substring(0,thirdPartInfo.getVillageGroup().indexOf("村"));
|
|
|
+ if (isEmpty(deptId) && isNotEmpty(thirdPartInfo.getVillageGroup()) && thirdPartInfo.getVillageGroup().contains("村")) {
|
|
|
+ String cun = thirdPartInfo.getVillageGroup().substring(0, thirdPartInfo.getVillageGroup().indexOf("村"));
|
|
|
for (SysDept allDept : allDepts) {
|
|
|
- if(allDept.getParentId().equals(deptId) && allDept.getDeptName().contains(cun)){
|
|
|
+ if (allDept.getParentId().equals(deptId) && allDept.getDeptName().contains(cun)) {
|
|
|
thirdPartInfo.setVillageId(allDept.getAreaId());
|
|
|
thirdPartInfo.setVillage(allDept.getDeptName());
|
|
|
break;
|
|
@@ -1205,7 +1204,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
thirdPartInfoMapper.insertThirdPartInfoList(thirdPartInfoList);
|
|
|
|
|
|
return "导入成功";
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return "导入失败";
|
|
|
}
|
|
@@ -1230,7 +1229,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
@Override
|
|
|
public AjaxResult delecteDie(String idCard) {
|
|
|
int i = thirdPartInfoMapper.delecteDie(idCard);
|
|
|
- return i>0?AjaxResult.success("删除成功"):AjaxResult.error("删除失败");
|
|
|
+ return i > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1256,19 +1255,333 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
hjInfo.setGender(sex);
|
|
|
hjInfo.setBirthday(birthday);
|
|
|
|
|
|
- return AjaxResult.success("成功",hjInfo);
|
|
|
+ return AjaxResult.success("成功", hjInfo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult addBabyCzrk(Czrk czrk) {
|
|
|
AjaxResult ajaxResult = insertCzrk(czrk);
|
|
|
- if((int)ajaxResult.get("code") == 200 ){
|
|
|
+ if ((int) ajaxResult.get("code") == 200) {
|
|
|
//修改新生儿表状态(身份证号)
|
|
|
birthRecordsMapper.updataBirthRecordsInfo(czrk.getIdCard());
|
|
|
}
|
|
|
return ajaxResult;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public AjaxResult vaccineStatistics(String code,String lenth) {
|
|
|
+
|
|
|
+ JSONObject results = new JSONObject(16);
|
|
|
+
|
|
|
+ SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
|
|
|
+ SysDept dept = sysUser.getDept();
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(code)){
|
|
|
+ //判断账号权限
|
|
|
+ List<String> roleKeySets = map(sysUser.getRoles(), SysRole::getRoleKey);
|
|
|
+ if (roleKeySets.contains("province") || roleKeySets.contains("city") || roleKeySets.contains("region") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
|
|
|
+ List<SysDept> allDepts = remoteDeptService.listChildrenDepts(1L);
|
|
|
+ //查找潜山市户籍人口总数
|
|
|
+ List<Czrk> czrkList = czrkMapper.getAllCzrkRegionId("340882000000");
|
|
|
+
|
|
|
+
|
|
|
+ /* //潜山市户籍人口总数
|
|
|
+ int hjzrs = czrkList.size();
|
|
|
+
|
|
|
+ //潜山市 潜山市接种疫苗人数
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs--;
|
|
|
+ }
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //潜山市总人数
|
|
|
+ results.put("hjzrs", hjzrs);
|
|
|
+ //潜山市接种疫苗人数
|
|
|
+ results.put("hjymjz", hjymjz);
|
|
|
+ //接种百分比
|
|
|
+ results.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));*/
|
|
|
+
|
|
|
+
|
|
|
+ //所有乡镇集合
|
|
|
+ List<SysDept> townsDepts = new ArrayList<>(16);
|
|
|
+
|
|
|
+ for (SysDept allDept : allDepts) {
|
|
|
+ if (isEmpty(allDept.getParentId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (allDept.getParentId() == (1L)) {
|
|
|
+ townsDepts.add(allDept);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 以各个镇为单位单独处理 townsDepts
|
|
|
+ ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
|
|
|
+ for (SysDept townsDept : townsDepts) {
|
|
|
+ JSONObject townsResult = new JSONObject(16);
|
|
|
+ townStsvaccine(townsResult, townsDept, czrkList);
|
|
|
+ towsDataList.add(townsResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ results.put("townDatas", towsDataList);
|
|
|
+ results.put("type", "1");
|
|
|
+
|
|
|
+
|
|
|
+ } else if (roleKeySets.contains("villageTowns")) {
|
|
|
+ // 镇领导,只能查看本镇下人员
|
|
|
+ //获取本镇下所有乡村
|
|
|
+ List<SysDept> allDepts = remoteDeptService.listChildrenDepts(dept.getId());
|
|
|
+ //获取本镇所有人员
|
|
|
+ List<Czrk> czrkList = czrkMapper.getAllCzrkVillageTownsId(dept.getAreaId());
|
|
|
+
|
|
|
+ /*//潜山市户籍人口总数
|
|
|
+ int hjzrs = czrkList.size();
|
|
|
+
|
|
|
+ //潜山市 潜山市接种疫苗人数
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs--;
|
|
|
+ }
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //镇总人数
|
|
|
+ results.put("hjzrs", hjzrs);
|
|
|
+ //镇接种疫苗人数
|
|
|
+ results.put("hjymjz", hjymjz);
|
|
|
+ //镇接种百分比
|
|
|
+ results.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));*/
|
|
|
+
|
|
|
+ // 以各个镇为单位单独处理 townsDepts
|
|
|
+ ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
|
|
|
+ for (SysDept townsDept : allDepts) {
|
|
|
+ JSONObject townsResult = new JSONObject(16);
|
|
|
+ townStsvaccineCun(townsResult, townsDept, czrkList);
|
|
|
+ towsDataList.add(townsResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ results.put("townDatas", towsDataList);
|
|
|
+ results.put("type", "2");
|
|
|
+
|
|
|
+
|
|
|
+ } else if (roleKeySets.contains("village")) {
|
|
|
+
|
|
|
+ ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
|
|
|
+ JSONObject townsResult = new JSONObject(16);
|
|
|
+ // 村领导
|
|
|
+ //获取本村所有人员
|
|
|
+ List<Czrk> czrkList = czrkMapper.getAllCzrkVillageId(dept.getAreaId());
|
|
|
+
|
|
|
+ //潜山市户籍人口总数
|
|
|
+ int hjzrs = czrkList.size();
|
|
|
+
|
|
|
+ //潜山市 潜山市接种疫苗人数
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs--;
|
|
|
+ }
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //镇总人数
|
|
|
+ townsResult.put("hjzrs", hjzrs);
|
|
|
+ //镇接种疫苗人数
|
|
|
+ townsResult.put("hjymjz", hjymjz);
|
|
|
+ //镇接种百分比
|
|
|
+ townsResult.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));
|
|
|
+
|
|
|
+ townsResult.put("name", dept.getDeptName());
|
|
|
+ towsDataList.add(townsResult);
|
|
|
+ results.put("townDatas", towsDataList);
|
|
|
+ results.put("type", "3");
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(lenth.equals("1")){
|
|
|
+ // 镇领导,只能查看本镇下人员
|
|
|
+ //获取本镇下所有乡村
|
|
|
+ List<SysDept> allDept = remoteDeptService.listChildrenDepts(1L);
|
|
|
+ Long deptId = null;
|
|
|
+ for (SysDept sysDept : allDept) {
|
|
|
+ if(sysDept.getAreaId().equals(code)){
|
|
|
+ deptId = sysDept.getId();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<SysDept> allDepts = remoteDeptService.listChildrenDepts(deptId);
|
|
|
+ //获取本镇所有人员
|
|
|
+ List<Czrk> czrkList = czrkMapper.getAllCzrkVillageTownsId(code);
|
|
|
+
|
|
|
+ /* //潜山市户籍人口总数
|
|
|
+ int hjzrs = czrkList.size();
|
|
|
+
|
|
|
+ //潜山市 潜山市接种疫苗人数
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs--;
|
|
|
+ }
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //镇总人数
|
|
|
+ results.put("hjzrs", hjzrs);
|
|
|
+ //镇接种疫苗人数
|
|
|
+ results.put("hjymjz", hjymjz);
|
|
|
+ //镇接种百分比
|
|
|
+ results.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));*/
|
|
|
+
|
|
|
+ // 以各个镇为单位单独处理 townsDepts
|
|
|
+ ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
|
|
|
+ for (SysDept townsDept : allDepts) {
|
|
|
+ JSONObject townsResult = new JSONObject(16);
|
|
|
+ townStsvaccineCun(townsResult, townsDept, czrkList);
|
|
|
+ towsDataList.add(townsResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ results.put("townDatas", towsDataList);
|
|
|
+ results.put("type", "2");
|
|
|
+ }else{
|
|
|
+ ArrayList<JSONObject> towsDataList = new ArrayList<>(20);
|
|
|
+ JSONObject townsResult = new JSONObject(16);
|
|
|
+ String name = "";
|
|
|
+ // 村领导
|
|
|
+ //获取本村所有人员
|
|
|
+ List<Czrk> czrkList = czrkMapper.getAllCzrkVillageId(code);
|
|
|
+
|
|
|
+ //潜山市户籍人口总数
|
|
|
+ int hjzrs = czrkList.size();
|
|
|
+
|
|
|
+ //潜山市 潜山市接种疫苗人数
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs--;
|
|
|
+ }
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isEmpty(name) && StringUtils.isEmpty(czrk.getVillage())){
|
|
|
+ name = czrk.getVillage();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //镇总人数
|
|
|
+ townsResult.put("hjzrs", hjzrs);
|
|
|
+ //镇接种疫苗人数
|
|
|
+ townsResult.put("hjymjz", hjymjz);
|
|
|
+ //镇接种百分比
|
|
|
+ townsResult.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));
|
|
|
+
|
|
|
+ townsResult.put("name", name);
|
|
|
+
|
|
|
+ towsDataList.add(townsResult);
|
|
|
+ results.put("townDatas", towsDataList);
|
|
|
+ results.put("type", "3");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return AjaxResult.success("成功",results);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void townStsvaccine(JSONObject result, SysDept sysDept, List<Czrk> czrkList) {
|
|
|
+ String startTime = DateUtils.getTodayStartStr();
|
|
|
+ String endTime = DateUtils.getTodayEndStr();
|
|
|
+ Timestamp s = Timestamp.valueOf(startTime);
|
|
|
+ Timestamp e = Timestamp.valueOf(endTime);
|
|
|
+ Long deptId = sysDept.getId();
|
|
|
+ String deptName = sysDept.getDeptName();
|
|
|
+ String areaId = sysDept.getAreaId();
|
|
|
+
|
|
|
+ if (czrkList == null) {
|
|
|
+ czrkList = new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ //该镇户籍人口总数
|
|
|
+ int hjzrs = 0;
|
|
|
+
|
|
|
+ //该镇 接种人员数据
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageTownsId()) && String.valueOf(czrk.getVillageTownsId()).equals(areaId)) {
|
|
|
+ if ("1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.put("hjzrs", hjzrs);
|
|
|
+ result.put("hjymjz", hjymjz);
|
|
|
+ result.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));
|
|
|
+ result.put("name", deptName);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void townStsvaccineCun(JSONObject result, SysDept sysDept, List<Czrk> czrkList) {
|
|
|
+ Long deptId = sysDept.getId();
|
|
|
+ String deptName = sysDept.getDeptName();
|
|
|
+ String areaId = sysDept.getAreaId();
|
|
|
+
|
|
|
+
|
|
|
+ if (czrkList == null) {
|
|
|
+ czrkList = new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ //该村户籍人口总数
|
|
|
+ int hjzrs = 0;
|
|
|
+
|
|
|
+ //该村接种人员数据
|
|
|
+ int hjymjz = 0;
|
|
|
+
|
|
|
+ //循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
+ for (Czrk czrk : czrkList) {
|
|
|
+ if (StringUtils.isNotEmpty(czrk.getVillageTownsId()) && String.valueOf(czrk.getVillageTownsId()).equals(areaId)) {
|
|
|
+ if ("1".equals(czrk.getStatus())) {
|
|
|
+ hjzrs++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if("Y".equals(czrk.getIsNucleicAcid())){
|
|
|
+ hjymjz++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.put("hjzrs", hjzrs);
|
|
|
+ result.put("hjymjz", hjymjz);
|
|
|
+ result.put("hjbfb", NumberUtils.percent(hjymjz, hjzrs));
|
|
|
+ result.put("name", deptName);
|
|
|
+ }
|
|
|
@Override
|
|
|
public Czrk getById(Long id) {
|
|
|
if (isEmpty(id)) {
|
|
@@ -1433,7 +1746,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
childCount += czrkJzdzService.insertCzrkJzdz(czrkJzdz);
|
|
|
}
|
|
|
|
|
|
- if(czrkJzdzList.size()>0){
|
|
|
+ if (czrkJzdzList.size() > 0) {
|
|
|
addExtracted(czrk, czrkJzdzList);
|
|
|
}
|
|
|
|
|
@@ -1522,8 +1835,8 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
// 市领导
|
|
|
List<String> roleKeySets = map(sysUser.getRoles(), SysRole::getRoleKey);
|
|
|
- if (roleKeySets.contains("province") ||roleKeySets.contains("city") || roleKeySets.contains("region") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
|
|
|
- JSONObject jsonObject = redisService.getCacheObject(packRedisKey(deptId+""));
|
|
|
+ if (roleKeySets.contains("province") || roleKeySets.contains("city") || roleKeySets.contains("region") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
|
|
|
+ JSONObject jsonObject = redisService.getCacheObject(packRedisKey(deptId + ""));
|
|
|
if (isNotEmpty(jsonObject)) {
|
|
|
QIANSHANSHI_SINGEL = jsonObject;
|
|
|
return jsonObject;
|
|
@@ -1622,7 +1935,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//townSts(result, deptId, sysUser.getDept().getDeptName(), true);
|
|
|
// redisService.setCacheObject(packRedisKey("town:" + deptId), result, 1L, TimeUnit.DAYS);
|
|
|
//setIntoRedis(packRedisKey("town:" + deptId), result);
|
|
|
- }else if (roleKeySets.contains("village")) {
|
|
|
+ } else if (roleKeySets.contains("village")) {
|
|
|
JSONObject jsonObject = redisService.getCacheObject(packRedisKey("village:" + deptId));
|
|
|
if (isNotEmpty(jsonObject)) {
|
|
|
CUN = jsonObject;
|
|
@@ -1658,7 +1971,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
Long deptId = sysUser.getDeptId();
|
|
|
|
|
|
// 市领导 todo 此处不应该写死
|
|
|
- if (roleKeySets.contains("province") ||roleKeySets.contains("city") || roleKeySets.contains("region") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
|
|
|
+ if (roleKeySets.contains("province") || roleKeySets.contains("city") || roleKeySets.contains("region") || roleKeySets.contains("admin") || roleKeySets.contains("yanshi")) {
|
|
|
JSONObject jsonObject = redisService.getCacheObject(packRedisKey(deptId + ""));
|
|
|
if (isNotEmpty(jsonObject)) {
|
|
|
QIANSHANSHI = jsonObject;
|