|
@@ -205,11 +205,29 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czrk.setStartTime(DateUtils.getTodayStartStr());
|
|
|
czrk.setEndTime(DateUtils.getTodayEndStr());
|
|
|
startPage();
|
|
|
- List<Czrk> czrks = czrkMapper.listByXz(czrk);
|
|
|
- // 居住地址
|
|
|
- List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
+ czrk.setRegionId("340882000000");
|
|
|
+ List<Czrk> czrks = new ArrayList<>();
|
|
|
+ if(czrk.getQueryType().equals(Czrk.HJ)){
|
|
|
+ czrks = czrkMapper.listByXz(czrk);
|
|
|
+ // 居住地址
|
|
|
+ List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
+ handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
+ }else{
|
|
|
+ String regionId = "340882000000";
|
|
|
+ String status = "Y";
|
|
|
+ //居住信息
|
|
|
+ List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(),DateUtils.getTodayEndStr(),regionId,status);
|
|
|
+
|
|
|
+ if(isNotEmpty(czrkJzdzList)){
|
|
|
+ List<String> czrkIdCardList = map(czrkJzdzList, CzrkJzdz::getIdCard);
|
|
|
+ //户籍信息
|
|
|
+ czrks = czrkMapper.listByIdCard(czrkIdCardList);
|
|
|
+ handleList(czrks, Czrk.CZ, czrkJzdzList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
//packAddr(czrks);
|
|
|
return czrks;
|
|
|
}
|
|
@@ -223,11 +241,30 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czrk.setStartTime(DateUtils.getTodayStartStr());
|
|
|
czrk.setEndTime(DateUtils.getTodayEndStr());
|
|
|
startPage();
|
|
|
- List<Czrk> czrks = czrkMapper.listByJs(czrk);
|
|
|
- // 居住地址
|
|
|
- List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
+ czrk.setRegionId("340882000000");
|
|
|
+ List<Czrk> czrks = new ArrayList<>();
|
|
|
+ if(czrk.getQueryType().equals(Czrk.HJ)){
|
|
|
+ czrks = czrkMapper.listByJs(czrk);
|
|
|
+ // 居住地址
|
|
|
+ List<CzrkJzdz> czrkJzdzList = getCzrkJzdzs(czrks);
|
|
|
+
|
|
|
+ handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
+ }else {
|
|
|
+ String regionId = "340882000000";
|
|
|
+ String status = "N";
|
|
|
+ //居住信息
|
|
|
+ List<CzrkJzdz> czrkJzdzList = czrkJzdzService.getCzrkJzdzByTime(DateUtils.getTodayStartStr(),DateUtils.getTodayEndStr(),regionId,status);
|
|
|
+
|
|
|
+ if(isNotEmpty(czrkJzdzList)){
|
|
|
+ List<String> czrkIdCardList = map(czrkJzdzList, CzrkJzdz::getIdCard);
|
|
|
+ //户籍信息
|
|
|
+ czrks = czrkMapper.listByIdCard(czrkIdCardList);
|
|
|
+ handleList(czrks, Czrk.CZ, czrkJzdzList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- handleList(czrks, Czrk.HJ, czrkJzdzList);
|
|
|
//packAddr(czrks);
|
|
|
return czrks;
|
|
|
}
|
|
@@ -437,13 +474,23 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ String startTime = DateUtils.getTodayStartStr();
|
|
|
+ String endTime = DateUtils.getTodayEndStr();
|
|
|
+
|
|
|
+ Timestamp s = Timestamp.valueOf(startTime);
|
|
|
+ Timestamp e = Timestamp.valueOf(endTime);
|
|
|
+
|
|
|
//判断新增的是否是潜山市人口(户籍判断)
|
|
|
if(!ObjectUtils.isEmpty(czrk) && czrk.getRegionId().equals("340882000000")){
|
|
|
//总户籍人数
|
|
|
- jsonObjects.put("hjzrs",(int)jsonObjects.get("hjzrs")+1);
|
|
|
+ jsonObjects.put("hjzrs",(Integer)jsonObjects.get("hjzrs")+1);
|
|
|
//户籍新增人数
|
|
|
- jsonObjects.put("hjxz",(int)jsonObjects.get("hjxz")+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
|
|
|
List<SysDept> allDepts = remoteDeptService.selectByAreaId(czrk.getVillageTownsId());
|
|
|
for (SysDept allDept : allDepts) {
|
|
@@ -451,11 +498,18 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject jsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- jsonObjectz.put("hjzrs",(int)jsonObjectz.get("hjzrs")+1);
|
|
|
+ jsonObjectz.put("hjzrs",(Integer)jsonObjectz.get("hjzrs")+1);
|
|
|
//镇户籍新增人数
|
|
|
- jsonObjectz.put("hjxz",(int)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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//镇户籍人数占比
|
|
|
- jsonObjectz.put("hjbfb", NumberUtils.percent((int)jsonObjectz.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectz.put("hjbfb", NumberUtils.percent((Integer)jsonObjectz.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), jsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
@@ -463,11 +517,18 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("hjzrs",(int)stringObjectMap.get("hjzrs")+1);
|
|
|
+ stringObjectMap.put("hjzrs",(Integer)stringObjectMap.get("hjzrs")+1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("hjxz",(int)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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("hjbfb", NumberUtils.percent((int)stringObjectMap.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
+ stringObjectMap.put("hjbfb", NumberUtils.percent((Integer)stringObjectMap.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -475,29 +536,39 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillagerGroupId());
|
|
|
- for (SysDept sysDept : allDeptC) {
|
|
|
- JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
- if (isEmpty(jsonObjectC)) {
|
|
|
- continue;
|
|
|
+ if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillageId());
|
|
|
+ for (SysDept sysDept : allDeptC) {
|
|
|
+ JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
+ if (isEmpty(jsonObjectC)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //村总户籍人数
|
|
|
+ jsonObjectC.put("hjzrs",(Integer)jsonObjectC.get("hjzrs")+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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //村户籍人数占比
|
|
|
+ jsonObjectC.put("hjbfb", NumberUtils.percent((Integer)jsonObjectC.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
- //村总户籍人数
|
|
|
- jsonObjectC.put("hjzrs",(int)jsonObjectC.get("hjzrs")+1);
|
|
|
- //村户籍新增人数
|
|
|
- jsonObjectC.put("hjxz",(int)jsonObjectC.get("hjxz")+1);
|
|
|
- //村户籍人数占比
|
|
|
- jsonObjectC.put("hjbfb", NumberUtils.percent((int)jsonObjectC.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
- setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(czrkJzdzList.size()>0){
|
|
|
for (CzrkJzdz czrkJzdz : czrkJzdzList) {
|
|
|
if(czrkJzdz.getRegionId().equals("340882000000")){
|
|
|
//总常驻人数
|
|
|
- jsonObjects.put("czzrs",(int)jsonObjects.get("czzrs")+1);
|
|
|
+ jsonObjects.put("czzrs",(Integer)jsonObjects.get("czzrs")+1);
|
|
|
//常驻新增人数
|
|
|
- jsonObjects.put("czxz",(int)jsonObjects.get("czxz")+1);
|
|
|
+ jsonObjects.put("czxz",(Integer)jsonObjects.get("czxz")+1);
|
|
|
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
|
List<SysDept> cAllDepts = remoteDeptService.selectByAreaId(czrkJzdz.getTownId());
|
|
@@ -506,11 +577,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject cJsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- cJsonObjectz.put("czzrs",(int)cJsonObjectz.get("czzrs")+1);
|
|
|
+ cJsonObjectz.put("czzrs",(Integer)cJsonObjectz.get("czzrs")+1);
|
|
|
//镇户籍新增人数
|
|
|
- cJsonObjectz.put("czxz",(int)cJsonObjectz.get("czxz")+1);
|
|
|
+ cJsonObjectz.put("czxz",(Integer)cJsonObjectz.get("czxz")+1);
|
|
|
//镇户籍人数占比
|
|
|
- cJsonObjectz.put("czbfb", NumberUtils.percent((int)cJsonObjectz.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectz.put("czbfb", NumberUtils.percent((Integer)cJsonObjectz.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), cJsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
@@ -518,11 +589,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("czzrs",(int)stringObjectMap.get("czzrs")+1);
|
|
|
+ stringObjectMap.put("czzrs",(Integer)stringObjectMap.get("czzrs")+1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("czxz",(int)stringObjectMap.get("czxz")+1);
|
|
|
+ stringObjectMap.put("czxz",(Integer)stringObjectMap.get("czxz")+1);
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("czbfb", NumberUtils.percent((int)stringObjectMap.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
+ stringObjectMap.put("czbfb", NumberUtils.percent((Integer)stringObjectMap.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -530,21 +601,23 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
- for (SysDept sysDept : cAllDeptC) {
|
|
|
- JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
- if (isEmpty(cJsonObjectC)) {
|
|
|
- continue;
|
|
|
+ if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
+ for (SysDept sysDept : cAllDeptC) {
|
|
|
+ JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
+ if (isEmpty(cJsonObjectC)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //村总户籍人数
|
|
|
+ cJsonObjectC.put("czzrs",(Integer)cJsonObjectC.get("czzrs")+1);
|
|
|
+ //村户籍新增人数
|
|
|
+ cJsonObjectC.put("czxz",(Integer)cJsonObjectC.get("czxz")+1);
|
|
|
+ //村户籍人数占比
|
|
|
+ cJsonObjectC.put("czbfb", NumberUtils.percent((Integer)cJsonObjectC.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
}
|
|
|
- //村总户籍人数
|
|
|
- cJsonObjectC.put("czzrs",(int)cJsonObjectC.get("czzrs")+1);
|
|
|
- //村户籍新增人数
|
|
|
- cJsonObjectC.put("czxz",(int)cJsonObjectC.get("czxz")+1);
|
|
|
- //村户籍人数占比
|
|
|
- cJsonObjectC.put("czbfb", NumberUtils.percent((int)cJsonObjectC.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
- setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
+ break;
|
|
|
}
|
|
|
- break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -565,12 +638,24 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ String startTime = DateUtils.getTodayStartStr();
|
|
|
+ String endTime = DateUtils.getTodayEndStr();
|
|
|
+
|
|
|
+ Timestamp s = Timestamp.valueOf(startTime);
|
|
|
+ Timestamp e = Timestamp.valueOf(endTime);
|
|
|
+
|
|
|
//判断新增的是否是潜山市人口(户籍判断)
|
|
|
if(!ObjectUtils.isEmpty(czrk) && czrk.getRegionId().equals("340882000000")){
|
|
|
//总户籍人数
|
|
|
- jsonObjects.put("hjzrs",(int)jsonObjects.get("hjzrs")+1);
|
|
|
+ jsonObjects.put("hjzrs",(Integer)jsonObjects.get("hjzrs")-1);
|
|
|
//户籍新增人数
|
|
|
- jsonObjects.put("hjjs",(int)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);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
|
List<SysDept> allDepts = remoteDeptService.selectByAreaId(czrk.getVillageTownsId());
|
|
@@ -579,11 +664,16 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject jsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- jsonObjectz.put("hjzrs",(int)jsonObjectz.get("hjzrs")+1);
|
|
|
+ jsonObjectz.put("hjzrs",(Integer)jsonObjectz.get("hjzrs")-1);
|
|
|
//镇户籍新增人数
|
|
|
- jsonObjectz.put("hjjs",(int)jsonObjectz.get("hjjs")+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((int)jsonObjectz.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
+ jsonObjectz.put("hjbfb", NumberUtils.percent((Integer)jsonObjectz.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), jsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
@@ -591,11 +681,18 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("hjzrs",(int)stringObjectMap.get("hjzrs")+1);
|
|
|
+ stringObjectMap.put("hjzrs",(Integer)stringObjectMap.get("hjzrs")-1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("hjjs",(int)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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("hjbfb", NumberUtils.percent((int)stringObjectMap.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
+ stringObjectMap.put("hjbfb", NumberUtils.percent((Integer)stringObjectMap.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -603,29 +700,39 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillageId());
|
|
|
- for (SysDept sysDept : allDeptC) {
|
|
|
- JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
- if (isEmpty(jsonObjectC)) {
|
|
|
- continue;
|
|
|
+ if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ List<SysDept> allDeptC = remoteDeptService.selectByAreaId(czrk.getVillageId());
|
|
|
+ for (SysDept sysDept : allDeptC) {
|
|
|
+ JSONObject jsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
+ if (isEmpty(jsonObjectC)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //村总户籍人数
|
|
|
+ jsonObjectC.put("hjzrs",(Integer)jsonObjectC.get("hjzrs")-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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //村户籍人数占比
|
|
|
+ jsonObjectC.put("hjbfb", NumberUtils.percent((Integer)jsonObjectC.get("hjzrs"), (Integer)jsonObjects.get("hjzrs")));
|
|
|
+ setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
- //村总户籍人数
|
|
|
- jsonObjectC.put("hjzrs",(int)jsonObjectC.get("hjzrs")+1);
|
|
|
- //村户籍新增人数
|
|
|
- jsonObjectC.put("hjjs",(int)jsonObjectC.get("hjjs")+1);
|
|
|
- //村户籍人数占比
|
|
|
- jsonObjectC.put("hjbfb", NumberUtils.percent((int)jsonObjectC.get("hjzrs"), (int)jsonObjects.get("hjzrs")));
|
|
|
- setIntoRedis(packRedisKey("village:" + sysDept.getId()), jsonObjectC);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(czrkJzdzList.size()>0){
|
|
|
for (CzrkJzdz czrkJzdz : czrkJzdzList) {
|
|
|
if(czrkJzdz.getRegionId().equals("340882000000")){
|
|
|
//总常驻人数
|
|
|
- jsonObjects.put("czzrs",(int)jsonObjects.get("czzrs")+1);
|
|
|
+ jsonObjects.put("czzrs",(Integer)jsonObjects.get("czzrs")-1);
|
|
|
//常驻新增人数
|
|
|
- jsonObjects.put("czjs",(int)jsonObjects.get("czjs")+1);
|
|
|
+ jsonObjects.put("czjs",(Integer)jsonObjects.get("czjs")+1);
|
|
|
|
|
|
//根据人员的乡镇区划编号去部门表里查询dept_id
|
|
|
List<SysDept> cAllDepts = remoteDeptService.selectByAreaId(czrkJzdz.getTownId());
|
|
@@ -634,11 +741,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//从redis取出镇数据
|
|
|
JSONObject cJsonObjectz = redisService.getCacheObject(packRedisKey("town:" + allDept.getId()));
|
|
|
//镇总户籍人数
|
|
|
- cJsonObjectz.put("czzrs",(int)cJsonObjectz.get("czzrs")+1);
|
|
|
+ cJsonObjectz.put("czzrs",(Integer)cJsonObjectz.get("czzrs")-1);
|
|
|
//镇户籍新增人数
|
|
|
- cJsonObjectz.put("czjs",(int)cJsonObjectz.get("czjs")+1);
|
|
|
+ cJsonObjectz.put("czjs",(Integer)cJsonObjectz.get("czjs")+1);
|
|
|
//镇户籍人数占比
|
|
|
- cJsonObjectz.put("czbfb", NumberUtils.percent((int)cJsonObjectz.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
+ cJsonObjectz.put("czbfb", NumberUtils.percent((Integer)cJsonObjectz.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
setIntoRedis(packRedisKey("town:" + allDept.getId()), cJsonObjectz);
|
|
|
|
|
|
//修改市数据里的乡镇数据
|
|
@@ -646,11 +753,11 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
for (JSONObject stringObjectMap : jsList) {
|
|
|
if(allDept.getDeptName().equals(stringObjectMap.get("zhen"))){
|
|
|
//镇总户籍人数
|
|
|
- stringObjectMap.put("czzrs",(int)stringObjectMap.get("czzrs")+1);
|
|
|
+ stringObjectMap.put("czzrs",(Integer)stringObjectMap.get("czzrs")-1);
|
|
|
//镇户籍新增人数
|
|
|
- stringObjectMap.put("czjs",(int)stringObjectMap.get("czjs")+1);
|
|
|
+ stringObjectMap.put("czjs",(Integer)stringObjectMap.get("czjs")+1);
|
|
|
//镇户籍人数占比
|
|
|
- stringObjectMap.put("czbfb", NumberUtils.percent((int)stringObjectMap.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
+ stringObjectMap.put("czbfb", NumberUtils.percent((Integer)stringObjectMap.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -658,21 +765,24 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//查找村数据
|
|
|
//根据人员的村区划编号去部门表里查询dept_id
|
|
|
- List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
- for (SysDept sysDept : cAllDeptC) {
|
|
|
- JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
- if (isEmpty(cJsonObjectC)) {
|
|
|
- continue;
|
|
|
+ if(StringUtils.isNotEmpty(czrk.getVillageId())){
|
|
|
+ List<SysDept> cAllDeptC = remoteDeptService.selectByAreaId(czrkJzdz.getVillageId());
|
|
|
+ for (SysDept sysDept : cAllDeptC) {
|
|
|
+ JSONObject cJsonObjectC = redisService.getCacheObject(packRedisKey("village:" + sysDept.getId()));
|
|
|
+ if (isEmpty(cJsonObjectC)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //村总户籍人数
|
|
|
+ cJsonObjectC.put("czzrs",(Integer)cJsonObjectC.get("czzrs")-1);
|
|
|
+ //村户籍新增人数
|
|
|
+ cJsonObjectC.put("czjs",(Integer)cJsonObjectC.get("czjs")+1);
|
|
|
+ //村户籍人数占比
|
|
|
+ cJsonObjectC.put("czbfb", NumberUtils.percent((Integer)cJsonObjectC.get("czzrs"), (Integer)jsonObjects.get("czzrs")));
|
|
|
+ setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
}
|
|
|
- //村总户籍人数
|
|
|
- cJsonObjectC.put("czzrs",(int)cJsonObjectC.get("czzrs")+1);
|
|
|
- //村户籍新增人数
|
|
|
- cJsonObjectC.put("czjs",(int)cJsonObjectC.get("czjs")+1);
|
|
|
- //村户籍人数占比
|
|
|
- cJsonObjectC.put("czbfb", NumberUtils.percent((int)cJsonObjectC.get("czzrs"), (int)jsonObjects.get("czzrs")));
|
|
|
- setIntoRedis(packRedisKey("village:" + sysDept.getId()), cJsonObjectC);
|
|
|
+ break;
|
|
|
}
|
|
|
- break;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -894,7 +1004,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czrkQianchu.setConfirmInfoUser("");
|
|
|
czrkQianchu.setChangNikeUser("");
|
|
|
czrkQianchu.setConfirmInfoUserTime(null);
|
|
|
- czrkQianchu.setStatus("1");
|
|
|
+ czrkQianchu.setStatus(status);
|
|
|
czrkMapper.updateCzrk(czrkQianchu);
|
|
|
|
|
|
//迁出;
|
|
@@ -1104,6 +1214,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czrk.setIsRl("是");
|
|
|
czrk.setDeptId(sysUser.getDeptId());
|
|
|
czrk.setRlTime(DateUtils.getNowDate());
|
|
|
+ czrk.setStatus("1");
|
|
|
int count = czrkMapper.updateCzrk(czrk);
|
|
|
if (count <= 0) return AjaxResult.error();
|
|
|
czrkJzdzService.deleteByCzrkId(czrk.getId());
|
|
@@ -1374,12 +1485,12 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
|
|
|
//循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
for (Czrk czrk : czrkList) {
|
|
|
- if ("Y".equals(czrk.getIsDel())) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
hjzrs--;
|
|
|
}
|
|
|
//判断是否是在今天操作的人员信息
|
|
|
- if (s.before(czrk.getCreateTime()) && czrk.getCreateTime().before(e)) {
|
|
|
- if ("Y".equals(czrk.getIsDel())) {
|
|
|
+ if (s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
hjjs++;
|
|
|
} else {
|
|
|
hjxz++;
|
|
@@ -1414,7 +1525,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czzrs--;
|
|
|
}
|
|
|
//判断是否是在今天操作的人员信息
|
|
|
- if (s.before(czrkJzdz.getCreateTime()) && czrkJzdz.getCreateTime().before(e)) {
|
|
|
+ if (s.before(czrkJzdz.getUpdateTime()) && czrkJzdz.getUpdateTime().before(e)) {
|
|
|
if ("N".equals(czrkJzdz.getStatus())) {
|
|
|
czjs++;
|
|
|
} else {
|
|
@@ -1597,12 +1708,12 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
//循环所有人判断当前总人数,该镇 户籍人口今日新增,该镇 户籍人口今日减少
|
|
|
for (Czrk czrk : czrkList) {
|
|
|
if (StringUtils.isNotEmpty(czrk.getVillageTownsId()) && String.valueOf(czrk.getVillageTownsId()).equals(areaId)) {
|
|
|
- if ("N".equals(czrk.getIsDel())) {
|
|
|
+ if ("1".equals(czrk.getStatus())) {
|
|
|
hjzrs++;
|
|
|
}
|
|
|
//判断是否是在今天操作的人员信息
|
|
|
- if (s.before(czrk.getCreateTime()) && czrk.getCreateTime().before(e)) {
|
|
|
- if ("Y".equals(czrk.getIsDel())) {
|
|
|
+ if (s.before(czrk.getUpdateTime()) && czrk.getUpdateTime().before(e)) {
|
|
|
+ if (!"1".equals(czrk.getStatus())) {
|
|
|
hjjs++;
|
|
|
} else {
|
|
|
hjxz++;
|
|
@@ -1634,7 +1745,7 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
|
czzrs++;
|
|
|
}
|
|
|
//判断是否是在今天操作的人员信息
|
|
|
- if (s.before(czrkJzdz.getCreateTime()) && czrkJzdz.getCreateTime().before(e)) {
|
|
|
+ if (s.before(czrkJzdz.getUpdateTime()) && czrkJzdz.getUpdateTime().before(e)) {
|
|
|
if ("N".equals(czrkJzdz.getStatus())) {
|
|
|
czjs++;
|
|
|
} else {
|