Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
cfb1416f
Commit
cfb1416f
authored
Jun 26, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b159c911
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
334 additions
and
76 deletions
+334
-76
common-utils/src/main/java/com/zq/common/entity/VChildWelfareStats.java
+6
-0
portal-server/src/main/java/com/zq/portal/controller/admin/EtStatsAdminController.java
+12
-0
portal-server/src/main/java/com/zq/portal/controller/app/CjStatsController.java
+10
-4
portal-server/src/main/java/com/zq/portal/controller/app/ShjzStatsController.java
+52
-0
portal-server/src/main/java/com/zq/portal/dao/CjStatsDao.java
+15
-0
portal-server/src/main/java/com/zq/portal/dao/EtStatsDao.java
+8
-0
portal-server/src/main/java/com/zq/portal/dao/VShjzAchieveDao.java
+10
-0
portal-server/src/main/java/com/zq/portal/dao/VShjzProvideDao.java
+9
-0
portal-server/src/main/java/com/zq/portal/manager/PortalCacheKeys.java
+11
-1
portal-server/src/main/java/com/zq/portal/service/CjStatsService.java
+83
-4
portal-server/src/main/java/com/zq/portal/service/EtStatsService.java
+13
-11
portal-server/src/main/java/com/zq/portal/service/HyStatsService.java
+11
-11
portal-server/src/main/java/com/zq/portal/service/ShjzStatsService.java
+40
-38
portal-server/src/main/java/com/zq/portal/service/ShzzStatsService.java
+7
-7
portal-server/src/main/java/com/zq/portal/vo/StatsVo.java
+2
-0
portal-server/src/main/resources/mapper/CjStatsMapper.xml
+28
-0
portal-server/src/main/resources/mapper/EtStatsMapper.xml
+17
-0
No files found.
common-utils/src/main/java/com/zq/common/entity/VChildWelfareStats.java
View file @
cfb1416f
...
...
@@ -61,6 +61,12 @@ public class VChildWelfareStats {
private
Integer
childNum
;
/**
* 事实无人领养
*/
@ApiModelProperty
(
"事实无人领养"
)
private
Integer
factUnadopted
;
/**
* 日期
*/
@ApiModelProperty
(
"日期"
)
...
...
portal-server/src/main/java/com/zq/portal/controller/admin/EtStatsAdminController.java
View file @
cfb1416f
...
...
@@ -34,4 +34,16 @@ public class EtStatsAdminController {
return
ResultVo
.
success
(
etStatsService
.
getCacheAgencyUnderChildStatsList
(
vo
));
}
@ApiOperation
(
"统计该区域的机构和儿童数量"
)
@PostMapping
(
value
=
"/getAgencyChildStats"
)
public
ResultVo
<
Object
>
getAgencyChildStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
etStatsService
.
getCacheAgencyChildStats
(
vo
));
}
@ApiOperation
(
"获取区域机构占比"
)
@PostMapping
(
value
=
"/getAgencyPercentageStats"
)
public
ResultVo
<
Object
>
getAgencyPercentageStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
etStatsService
.
getCacheAgencyPercentageStats
(
vo
));
}
}
portal-server/src/main/java/com/zq/portal/controller/app/CjStatsController.java
View file @
cfb1416f
...
...
@@ -19,10 +19,16 @@ public class CjStatsController {
public
final
CjStatsService
cjStatsService
;
@ApiOperation
(
"残疾人两项补贴"
)
@PostMapping
(
value
=
"/cjTwoSubsidies"
)
public
ResultVo
cjTwoSubsidies
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
cjStatsService
.
cjTwoSubsidies
(
vo
));
@ApiOperation
(
"近五年发放人数和金额统计"
)
@PostMapping
(
value
=
"/getPeopleAmountStats"
)
public
ResultVo
getPeopleAmountStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
cjStatsService
.
getCachePeopleAmountStats
());
}
@ApiOperation
(
"获取残疾等级统计"
)
@PostMapping
(
value
=
"/getDisabledLevelStats"
)
public
ResultVo
getDisabledLevelStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
cjStatsService
.
getCacheDisabledLevelStats
(
vo
));
}
}
portal-server/src/main/java/com/zq/portal/controller/app/ShjzStatsController.java
0 → 100644
View file @
cfb1416f
package
com
.
zq
.
portal
.
controller
.
app
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.portal.service.ShjzStatsService
;
import
com.zq.portal.vo.StatsReqVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Api
(
tags
=
"社会救助统计相关接口"
)
@RequiredArgsConstructor
@RestController
@RequestMapping
(
value
=
"/portal/app/stats"
)
public
class
ShjzStatsController
{
public
final
ShjzStatsService
shjzStatsService
;
@ApiOperation
(
"获取近五年城市农村低保发放金额统计"
)
@PostMapping
(
value
=
"/getFivesYearShjzProvideStats"
)
public
ResultVo
getFivesYearShjzProvideStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
shjzStatsService
.
getFivesYearShjzProvideStats
(
vo
));
}
@ApiOperation
(
"获取近三年城市农村低保发放金额统计"
)
@PostMapping
(
value
=
"/getThreeYearShjzProvideStats"
)
public
ResultVo
getThreeYearShjzProvideStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
shjzStatsService
.
getThreeYearShjzProvideStats
(
vo
));
}
@ApiOperation
(
"获取近五年城市农村低保发放人数统计"
)
@PostMapping
(
value
=
"/getFivesYearShjzAchieveStats"
)
public
ResultVo
getFivesYearShjzAchieveStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
shjzStatsService
.
getFivesYearShjzAchieveStats
(
vo
));
}
@ApiOperation
(
"获取近三年城市农村低保发放人数统计"
)
@PostMapping
(
value
=
"/getThreeYearShjzAchieveStats"
)
public
ResultVo
getThreeYearShjzAchieveStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
shjzStatsService
.
getThreeYearShjzAchieveStats
(
vo
));
}
@ApiOperation
(
"获取区域统计列表"
)
@PostMapping
(
value
=
"/getAreaShjzStats"
)
public
ResultVo
getAreaShjzStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
shjzStatsService
.
getAreaShjzStats
(
vo
));
}
}
portal-server/src/main/java/com/zq/portal/dao/CjStatsDao.java
View file @
cfb1416f
...
...
@@ -2,11 +2,26 @@ package com.zq.portal.dao;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.zq.common.constant.DBName
;
import
com.zq.portal.vo.StatsReqVo
;
import
com.zq.portal.vo.StatsVo
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@DS
(
DBName
.
GXCJ
)
@Repository
public
interface
CjStatsDao
{
/**
* 统计进5年发放人数和金额
*
* @return
*/
List
<
StatsVo
>
getPeopleAmountStats
();
/**
* 残疾等级统计
*/
List
<
StatsVo
>
getDisabledLevelStats
(
StatsReqVo
vo
);
}
portal-server/src/main/java/com/zq/portal/dao/EtStatsDao.java
View file @
cfb1416f
...
...
@@ -36,4 +36,12 @@ public interface EtStatsDao {
*/
List
<
StatsVo
>
getAgencyUnderChildStats
(
StatsReqVo
vo
);
/**
* 事实无人领养
*
* @param vo
* @return
*/
StatsVo
getFactUnadoptedStats
(
StatsReqVo
vo
);
}
portal-server/src/main/java/com/zq/portal/dao/VShjzAchieveDao.java
View file @
cfb1416f
...
...
@@ -32,4 +32,14 @@ public interface VShjzAchieveDao extends BaseMapper<VShjzAchieve> {
"\tiscity"
)
List
<
Map
<
String
,
Object
>>
getFivesYearStats
(
@Param
(
"date"
)
String
date
);
@Select
(
value
=
"SELECT\n"
+
"\tget_upunitname 'city',\n"
+
"\ts_${year} 'achieveNum' \n"
+
"FROM\n"
+
"\t`v_shjz_achieve` \n"
+
"WHERE\n"
+
"\tDATE_FORMAT( create_time, '%Y-%m-%d' ) = '2021-06-26' \n"
+
"\tAND iscity = '低保'"
)
List
<
Map
<
String
,
Object
>>
getStatsByYear
(
@Param
(
"year"
)
Integer
year
);
}
portal-server/src/main/java/com/zq/portal/dao/VShjzProvideDao.java
View file @
cfb1416f
...
...
@@ -32,4 +32,13 @@ public interface VShjzProvideDao extends BaseMapper<VShjzProvide> {
"\tiscity"
)
List
<
Map
<
String
,
Object
>>
getFivesYearStats
(
@Param
(
"date"
)
String
date
);
@Select
(
value
=
"SELECT\n"
+
"\tget_upunitname 'city',\n"
+
"\tsum_year_${year} 'provideNum' \n"
+
"FROM\n"
+
"\t`v_shjz_provide` \n"
+
"WHERE\n"
+
"\tDATE_FORMAT( create_time, '%Y-%m-%d' ) = '2021-06-26' \n"
+
"\tAND iscity = '低保'"
)
List
<
Map
<
String
,
Object
>>
getStatsByYear
(
@Param
(
"year"
)
Integer
year
);
}
portal-server/src/main/java/com/zq/portal/manager/CacheKeys.java
→
portal-server/src/main/java/com/zq/portal/manager/
Portal
CacheKeys.java
View file @
cfb1416f
...
...
@@ -2,7 +2,7 @@ package com.zq.portal.manager;
import
com.zq.portal.vo.StatsReqVo
;
public
abstract
class
CacheKeys
{
public
abstract
class
Portal
CacheKeys
{
public
static
final
String
PREFIX
=
"portal."
;
...
...
@@ -60,4 +60,14 @@ public abstract class CacheKeys {
public
static
String
getAgencyUnderChildStatsListKey
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getAgencyUnderChildStatsList."
+
vo
.
getAreaCode
()
+
"."
+
vo
.
getYear
();
}
// 统计进5年发放人数和金额
public
static
String
getPeopleAmountStatsKey
()
{
return
PREFIX
+
"getPeopleAmountStats."
;
}
// 残疾等级统计
public
static
String
getDisabledLevelStatsKey
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getCacheDisabledLevelStats."
+
vo
.
getAreaCode
()
+
"."
+
vo
.
getYear
();
}
}
portal-server/src/main/java/com/zq/portal/service/CjStatsService.java
View file @
cfb1416f
package
com
.
zq
.
portal
.
service
;
import
cn.hutool.core.util.StrUtil
;
import
com.zq.common.config.redis.RedisUtils
;
import
com.zq.common.entity.SystemArea
;
import
com.zq.common.utils.StringUtils
;
import
com.zq.portal.dao.AreaDao
;
import
com.zq.portal.dao.CjStatsDao
;
import
com.zq.portal.manager.PortalCacheKeys
;
import
com.zq.portal.vo.StatsReqVo
;
import
com.zq.portal.vo.StatsVo
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
@Service
@RequiredArgsConstructor
public
class
CjStatsService
{
private
final
CjStatsDao
cjStatsDao
;
private
final
AreaDao
areaDao
;
private
final
RedisUtils
redisUtils
;
/**
* 统计进5年发放人数和金额
*
* @return
*/
public
Object
getCachePeopleAmountStats
()
{
Object
obj
=
redisUtils
.
getObj
(
PortalCacheKeys
.
getPeopleAmountStatsKey
());
if
(
obj
!=
null
)
{
return
obj
;
}
return
getPeopleAmountStats
();
}
/**
* 统计进5年发放人数和金额
*
* @return
*/
public
Object
getPeopleAmountStats
()
{
List
<
StatsVo
>
peopleAmountStats
=
cjStatsDao
.
getPeopleAmountStats
();
peopleAmountStats
.
sort
(
Comparator
.
comparing
(
StatsVo:
:
getYear
));
List
<
String
>
dateList
=
new
ArrayList
<>();
List
<
String
>
numList
=
new
ArrayList
<>();
List
<
String
>
amountList
=
new
ArrayList
<>();
for
(
StatsVo
peopleAmountStat
:
peopleAmountStats
)
{
dateList
.
add
(
peopleAmountStat
.
getYear
());
numList
.
add
(
String
.
valueOf
(
peopleAmountStat
.
getNum
()));
amountList
.
add
(
peopleAmountStat
.
getAmount
());
}
Map
<
String
,
Object
>
returnData
=
new
HashMap
<>();
returnData
.
put
(
"dateList"
,
dateList
);
returnData
.
put
(
"numList"
,
numList
);
returnData
.
put
(
"amountList"
,
amountList
);
redisUtils
.
setObj
(
PortalCacheKeys
.
getPeopleAmountStatsKey
(),
returnData
);
public
Object
cjTwoSubsidies
(
StatsReqVo
vo
)
{
if
(
StringUtils
.
isBlank
(
vo
.
getAreaCode
()))
{
return
returnData
;
}
/**
* 残疾等级统计
*
* @param vo
* @return
*/
public
Object
getCacheDisabledLevelStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
PortalCacheKeys
.
getDisabledLevelStatsKey
(
vo
));
if
(
obj
!=
null
)
{
return
obj
;
}
return
getDisabledLevelStats
(
vo
);
}
/**
* 残疾等级统计
*
* @param vo
* @return
*/
public
Object
getDisabledLevelStats
(
StatsReqVo
vo
)
{
if
(
StrUtil
.
isBlank
(
vo
.
getAreaCode
()))
{
vo
.
setAreaCode
(
"450000000000"
);
}
SystemArea
systemArea
=
areaDao
.
selectById
(
vo
.
getAreaCode
());
vo
.
setSubAreaCode
(
systemArea
.
subAreaCode
());
List
<
Map
<
String
,
Object
>>
returnData
=
new
ArrayList
<>();
List
<
StatsVo
>
disabledLevelStats
=
cjStatsDao
.
getDisabledLevelStats
(
vo
);
for
(
StatsVo
disabledLevelStat
:
disabledLevelStats
)
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"level"
,
disabledLevelStat
.
getType
()
+
"级残疾"
);
data
.
put
(
"num"
,
"总数"
+
disabledLevelStat
.
getNum
());
returnData
.
add
(
data
);
}
redisUtils
.
setObj
(
PortalCacheKeys
.
getDisabledLevelStatsKey
(
vo
),
returnData
);
return
null
;
return
returnData
;
}
}
portal-server/src/main/java/com/zq/portal/service/EtStatsService.java
View file @
cfb1416f
...
...
@@ -9,7 +9,7 @@ import com.zq.common.entity.VChildWelfareStats;
import
com.zq.portal.dao.AreaDao
;
import
com.zq.portal.dao.EtStatsDao
;
import
com.zq.portal.dao.VChildWelfareStatsDao
;
import
com.zq.portal.manager.CacheKeys
;
import
com.zq.portal.manager.
Portal
CacheKeys
;
import
com.zq.portal.vo.StatsReqVo
;
import
com.zq.portal.vo.StatsVo
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -30,7 +30,7 @@ public class EtStatsService {
private
final
RedisUtils
redisUtils
;
public
VChildWelfareStats
getCacheAgencyChildStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getAgencyChildStatsKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getAgencyChildStatsKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
VChildWelfareStats
)
obj
;
}
...
...
@@ -38,7 +38,7 @@ public class EtStatsService {
}
/**
* 统计该区域的机构和
孩子
数量
* 统计该区域的机构和
儿童
数量
*
* @param vo
* @return
...
...
@@ -61,8 +61,10 @@ public class EtStatsService {
build
.
setAgencyNum
(
orgStat
.
getNum
());
StatsVo
childStats
=
etStatsDao
.
getAreaChildStats
(
vo
);
build
.
setChildNum
(
childStats
.
getNum
());
StatsVo
factUnadoptedStats
=
etStatsDao
.
getFactUnadoptedStats
(
vo
);
build
.
setFactUnadopted
(
factUnadoptedStats
.
getNum
());
redisUtils
.
setObj
(
CacheKeys
.
getAgencyChildStatsKey
(
vo
),
build
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAgencyChildStatsKey
(
vo
),
build
);
// 放进数据库 有时间条件的不存库
VChildWelfareStats
childWelfareStats
=
vChildWelfareStatsDao
.
selectOne
(
Wrappers
.
lambdaQuery
(
VChildWelfareStats
.
builder
().
year
(
vo
.
getYear
()
==
null
?
0
:
vo
.
getYear
()).
areaCode
(
systemArea
.
getCode
()).
createTime
(
DateUtil
.
parseDate
(
DateUtil
.
today
())).
build
()));
...
...
@@ -74,7 +76,7 @@ public class EtStatsService {
}
public
List
<
VChildWelfareStats
>
getCacheAgencyChildStatsList
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getAgencyChildStatsListKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getAgencyChildStatsListKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
List
<
VChildWelfareStats
>)
obj
;
}
...
...
@@ -82,7 +84,7 @@ public class EtStatsService {
}
/**
* 获取区域下的福利机构和儿童数量统计
* 获取区域下的福利机构和儿童数量统计
列表
*
* @param vo
* @return
...
...
@@ -101,7 +103,7 @@ public class EtStatsService {
returnData
.
add
(
etAgencyWelfareStats
);
}
redisUtils
.
setObj
(
CacheKeys
.
getAgencyChildStatsListKey
(
vo
),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAgencyChildStatsListKey
(
vo
),
returnData
);
return
returnData
;
}
...
...
@@ -113,7 +115,7 @@ public class EtStatsService {
* @return
*/
public
Object
getCacheAgencyPercentageStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getAgencyChildStatsListKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getAgencyChildStatsListKey
(
vo
));
if
(
obj
!=
null
)
{
return
obj
;
}
...
...
@@ -136,13 +138,13 @@ public class EtStatsService {
data
.
put
(
"vakue"
,
childWelfareStats
.
getAgencyNum
());
}
redisUtils
.
setObj
(
CacheKeys
.
getAgencyPercentageStatsKey
(
vo
),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAgencyPercentageStatsKey
(
vo
),
returnData
);
return
returnData
;
}
public
Object
getCacheAgencyUnderChildStatsList
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getAgencyUnderChildStatsListKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getAgencyUnderChildStatsListKey
(
vo
));
if
(
obj
!=
null
)
{
return
obj
;
}
...
...
@@ -164,7 +166,7 @@ public class EtStatsService {
List
<
StatsVo
>
agencyUnderChildStats
=
etStatsDao
.
getAgencyUnderChildStats
(
vo
);
redisUtils
.
setObj
(
CacheKeys
.
getAgencyUnderChildStatsListKey
(
vo
),
agencyUnderChildStats
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAgencyUnderChildStatsListKey
(
vo
),
agencyUnderChildStats
);
return
agencyUnderChildStats
;
}
...
...
portal-server/src/main/java/com/zq/portal/service/HyStatsService.java
View file @
cfb1416f
...
...
@@ -9,7 +9,7 @@ import com.zq.common.utils.StringUtils;
import
com.zq.portal.dao.AreaDao
;
import
com.zq.portal.dao.HyStatsDao
;
import
com.zq.portal.dao.VMarriageStatsDao
;
import
com.zq.portal.manager.CacheKeys
;
import
com.zq.portal.manager.
Portal
CacheKeys
;
import
com.zq.portal.vo.LineDataVo
;
import
com.zq.portal.vo.StatsReqVo
;
import
com.zq.portal.vo.StatsVo
;
...
...
@@ -35,7 +35,7 @@ public class HyStatsService {
* @return
*/
public
VMarriageStats
getCacheMarriageStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getMarriageStatsKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getMarriageStatsKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
VMarriageStats
)
obj
;
}
...
...
@@ -94,9 +94,9 @@ public class HyStatsService {
// 放进缓存
if
(
vo
.
getYear
()
!=
null
)
{
// 有时间条件的设置过期时间避免内存暂用
redisUtils
.
setObj
(
CacheKeys
.
getMarriageStatsKey
(
vo
),
build
,
1
,
TimeUnit
.
DAYS
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getMarriageStatsKey
(
vo
),
build
,
1
,
TimeUnit
.
DAYS
);
}
else
{
redisUtils
.
setObj
(
CacheKeys
.
getMarriageStatsKey
(
vo
),
build
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getMarriageStatsKey
(
vo
),
build
);
}
// 放进数据库 有时间条件的不存库
...
...
@@ -115,7 +115,7 @@ public class HyStatsService {
* @return
*/
public
List
<
VMarriageStats
>
getCacheAreaUnderMarriageStatsList
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
List
<
VMarriageStats
>)
obj
;
}
...
...
@@ -143,9 +143,9 @@ public class HyStatsService {
if
(
vo
.
getYear
()
!=
null
)
{
// 搜索的有过期时间避免内存暂用
redisUtils
.
setObj
(
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
),
returnData
,
1
,
TimeUnit
.
DAYS
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
),
returnData
,
1
,
TimeUnit
.
DAYS
);
}
else
{
redisUtils
.
setObj
(
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getAreaUnderMarriageStatsListKey
(
vo
),
returnData
);
}
return
returnData
;
...
...
@@ -170,7 +170,7 @@ public class HyStatsService {
* @return
*/
public
Object
getCacheFivesYearMarriageLine
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getFivesYearMarriageLineKey
(
vo
.
getAreaCode
()));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getFivesYearMarriageLineKey
(
vo
.
getAreaCode
()));
if
(
obj
!=
null
)
{
return
obj
;
}
...
...
@@ -236,7 +236,7 @@ public class HyStatsService {
returnData
.
put
(
"admin"
,
adminData
);
returnData
.
put
(
"app"
,
appData
);
redisUtils
.
setObj
(
CacheKeys
.
getFivesYearMarriageLineKey
(
vo
.
getAreaCode
()),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getFivesYearMarriageLineKey
(
vo
.
getAreaCode
()),
returnData
);
return
returnData
;
}
...
...
@@ -247,7 +247,7 @@ public class HyStatsService {
* @return
*/
public
Object
getCacheMonthMarriageLine
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getMonthMarriageLineKey
(
vo
.
getAreaCode
()));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getMonthMarriageLineKey
(
vo
.
getAreaCode
()));
if
(
obj
!=
null
)
{
return
obj
;
}
...
...
@@ -313,7 +313,7 @@ public class HyStatsService {
returnData
.
put
(
"admin"
,
adminData
);
returnData
.
put
(
"app"
,
appData
);
redisUtils
.
setObj
(
CacheKeys
.
getMonthMarriageLineKey
(
vo
.
getAreaCode
()),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getMonthMarriageLineKey
(
vo
.
getAreaCode
()),
returnData
);
return
returnData
;
}
...
...
portal-server/src/main/java/com/zq/portal/service/ShjzStatsService.java
View file @
cfb1416f
...
...
@@ -7,6 +7,7 @@ import com.zq.portal.vo.StatsReqVo;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.*
;
@Service
...
...
@@ -68,13 +69,13 @@ public class ShjzStatsService {
// 总金额
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
int
villageToatlAmount
=
0
;
int
cityToatlAmount
=
0
;
BigDecimal
villageToatlAmount
=
BigDecimal
.
ZERO
;
BigDecimal
cityToatlAmount
=
BigDecimal
.
ZERO
;
for
(
Map
<
String
,
Object
>
fivesYearStat
:
fivesYearStats
)
{
if
(
"城市低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
cityToatlAmount
=
getFivesYearTotal
Amount
(
cityToatlAmount
,
fivesYearStat
);
cityToatlAmount
=
getFivesYearTotal
Num
(
cityToatlAmount
,
fivesYearStat
);
}
else
if
(
"农村低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
villageToatlAmount
=
getFivesYearTotal
Amount
(
villageToatlAmount
,
fivesYearStat
);
villageToatlAmount
=
getFivesYearTotal
Num
(
villageToatlAmount
,
fivesYearStat
);
}
}
totalData
.
put
(
"villageToatlAmount"
,
villageToatlAmount
);
...
...
@@ -136,13 +137,13 @@ public class ShjzStatsService {
// 总金额
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
int
villageToatlAmount
=
0
;
int
cityToatlAmount
=
0
;
BigDecimal
villageToatlAmount
=
BigDecimal
.
ZERO
;
BigDecimal
cityToatlAmount
=
BigDecimal
.
ZERO
;
for
(
Map
<
String
,
Object
>
fivesYearStat
:
fivesYearStats
)
{
if
(
"城市低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
cityToatlAmount
=
getThreeYearTotal
Amount
(
cityToatlAmount
,
fivesYearStat
);
cityToatlAmount
=
getThreeYearTotal
Num
(
cityToatlAmount
,
fivesYearStat
);
}
else
if
(
"农村低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
villageToatlAmount
=
getThreeYearTotal
Amount
(
villageToatlAmount
,
fivesYearStat
);
villageToatlAmount
=
getThreeYearTotal
Num
(
villageToatlAmount
,
fivesYearStat
);
}
}
totalData
.
put
(
"villageToatlAmount"
,
villageToatlAmount
);
...
...
@@ -156,22 +157,6 @@ public class ShjzStatsService {
return
returnData
;
}
private
int
getFivesYearTotalAmount
(
int
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2017"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2018"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2019"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2020"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2021"
).
toString
());
return
toatlAmount
;
}
private
int
getThreeYearTotalAmount
(
int
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2019"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2020"
).
toString
());
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2021"
).
toString
());
return
toatlAmount
;
}
/**
* 获取近5年发放人数折线
*
...
...
@@ -224,8 +209,8 @@ public class ShjzStatsService {
// 总金额
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
int
villageToatlNum
=
0
;
int
cityToatlNum
=
0
;
BigDecimal
villageToatlNum
=
BigDecimal
.
ZERO
;
BigDecimal
cityToatlNum
=
BigDecimal
.
ZERO
;
for
(
Map
<
String
,
Object
>
fivesYearStat
:
fivesYearStats
)
{
if
(
"城市低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
cityToatlNum
=
getFivesYearTotalNum
(
cityToatlNum
,
fivesYearStat
);
...
...
@@ -292,8 +277,8 @@ public class ShjzStatsService {
// 总金额
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
int
villageToatlNum
=
0
;
int
cityToatlNum
=
0
;
BigDecimal
villageToatlNum
=
BigDecimal
.
ZERO
;
BigDecimal
cityToatlNum
=
BigDecimal
.
ZERO
;
for
(
Map
<
String
,
Object
>
fivesYearStat
:
fivesYearStats
)
{
if
(
"城市低保"
.
equals
(
fivesYearStat
.
get
(
"iscity"
).
toString
()))
{
cityToatlNum
=
getThreeYearTotalNum
(
cityToatlNum
,
fivesYearStat
);
...
...
@@ -312,19 +297,36 @@ public class ShjzStatsService {
return
returnData
;
}
private
int
getFivesYearTotalNum
(
int
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2017"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2018"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2019"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2020"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2021"
).
toString
(
));
private
BigDecimal
getFivesYearTotalNum
(
BigDecimal
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2017"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2018"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2019"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2020"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2021"
).
toString
()
));
return
toatlAmount
;
}
private
int
getThreeYearTotalNum
(
int
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2019"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2020"
).
toString
(
));
toatlAmount
+=
Integer
.
parseInt
(
fivesYearStat
.
get
(
"s2021"
).
toString
(
));
private
BigDecimal
getThreeYearTotalNum
(
BigDecimal
toatlAmount
,
Map
<
String
,
Object
>
fivesYearStat
)
{
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2019"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2020"
).
toString
()
));
toatlAmount
=
toatlAmount
.
add
(
new
BigDecimal
(
fivesYearStat
.
get
(
"s2021"
).
toString
()
));
return
toatlAmount
;
}
public
Object
getAreaShjzStats
(
StatsReqVo
vo
)
{
List
<
Map
<
String
,
Object
>>
achieveStats
=
vShjzAchieveDao
.
getStatsByYear
(
vo
.
getYear
());
List
<
Map
<
String
,
Object
>>
provideStats
=
vShjzProvideDao
.
getStatsByYear
(
vo
.
getYear
());
for
(
Map
<
String
,
Object
>
achieveStat
:
achieveStats
)
{
String
city
=
achieveStat
.
get
(
"city"
).
toString
();
for
(
Map
<
String
,
Object
>
provideStat
:
provideStats
)
{
if
(
provideStat
.
get
(
"city"
).
toString
().
equals
(
city
))
{
achieveStat
.
put
(
"provideNum"
,
provideStat
.
get
(
"provideNum"
));
}
}
}
return
achieveStats
;
}
}
portal-server/src/main/java/com/zq/portal/service/ShzzStatsService.java
View file @
cfb1416f
...
...
@@ -9,7 +9,7 @@ import com.zq.common.entity.VSoorganStats;
import
com.zq.portal.dao.AreaDao
;
import
com.zq.portal.dao.ShzzStatsDao
;
import
com.zq.portal.dao.VSoorganStatsDao
;
import
com.zq.portal.manager.CacheKeys
;
import
com.zq.portal.manager.
Portal
CacheKeys
;
import
com.zq.portal.vo.StatsReqVo
;
import
com.zq.portal.vo.StatsVo
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -36,7 +36,7 @@ public class ShzzStatsService {
* @return
*/
public
VSoorganStats
getCacheSoorganStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getSoorganStatsKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getSoorganStatsKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
VSoorganStats
)
obj
;
}
...
...
@@ -77,7 +77,7 @@ public class ShzzStatsService {
}
}
redisUtils
.
setObj
(
CacheKeys
.
getSoorganStatsKey
(
vo
),
build
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getSoorganStatsKey
(
vo
),
build
);
// 放进数据库 有时间条件的不存库
VSoorganStats
soorganStats
=
vSoorganStatsDao
.
selectOne
(
Wrappers
.
lambdaQuery
(
VSoorganStats
.
builder
().
year
(
vo
.
getYear
()
==
null
?
0
:
vo
.
getYear
()).
areaCode
(
systemArea
.
getCode
()).
createTime
(
DateUtil
.
parseDate
(
DateUtil
.
today
())).
build
()));
...
...
@@ -95,7 +95,7 @@ public class ShzzStatsService {
* @return
*/
public
List
<
VSoorganStats
>
getCacheAreaUnderSoorganStatsList
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getSoorganStatsListKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getSoorganStatsListKey
(
vo
));
if
(
obj
!=
null
)
{
return
(
List
<
VSoorganStats
>)
obj
;
}
...
...
@@ -123,7 +123,7 @@ public class ShzzStatsService {
returnData
.
add
(
soorganStats
);
}
redisUtils
.
setObj
(
CacheKeys
.
getSoorganStatsListKey
(
vo
),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getSoorganStatsListKey
(
vo
),
returnData
);
return
returnData
;
}
...
...
@@ -135,7 +135,7 @@ public class ShzzStatsService {
* @return
*/
public
Object
getCacheSoorganPercentageStats
(
StatsReqVo
vo
)
{
Object
obj
=
redisUtils
.
getObj
(
CacheKeys
.
getSoorganPercentageStatsKey
(
vo
));
Object
obj
=
redisUtils
.
getObj
(
Portal
CacheKeys
.
getSoorganPercentageStatsKey
(
vo
));
if
(
obj
!=
null
)
{
return
obj
;
}
...
...
@@ -164,7 +164,7 @@ public class ShzzStatsService {
returnData
.
add
(
data
);
}
redisUtils
.
setObj
(
CacheKeys
.
getSoorganPercentageStatsKey
(
vo
),
returnData
);
redisUtils
.
setObj
(
Portal
CacheKeys
.
getSoorganPercentageStatsKey
(
vo
),
returnData
);
return
returnData
;
}
...
...
portal-server/src/main/java/com/zq/portal/vo/StatsVo.java
View file @
cfb1416f
...
...
@@ -15,4 +15,6 @@ public class StatsVo {
private
String
name
;
private
String
amount
;
}
portal-server/src/main/resources/mapper/CjStatsMapper.xml
0 → 100644
View file @
cfb1416f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zq.portal.dao.CjStatsDao"
>
<select
id=
"getPeopleAmountStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT COUNT(1) 'num', SUM( SUBSIDY_STANDARD_MONEY ) 'amount', `YEAR` 'year'
FROM `cjrjz_application`
WHERE CHECK_STATUS = 1
AND `STATUS` = 0
AND APPROVE_DATE IS NOT NULL
GROUP BY `YEAR`
ORDER BY `YEAR` DESC LIMIT 5
</select>
<select
id=
"getDisabledLevelStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT ENSURE_LEVEL_ID 'type', COUNT( 1 ) 'num'
FROM `cjrjz_proposer`
WHERE ENSURE_LEVEL_ID IS NOT NULL
<if
test=
"subAreaCode != null and subAreaCode != ''"
>
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if
test=
"year != null"
>
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
GROUP BY ENSURE_LEVEL_ID
</select>
</mapper>
portal-server/src/main/resources/mapper/EtStatsMapper.xml
View file @
cfb1416f
...
...
@@ -50,4 +50,21 @@
LIMIT 15
</select>
<!--事实无人领养-->
<select
id=
"getFactUnadoptedStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT
COUNT(1) 'num'
FROM
jep08 j1
LEFT JOIN jep01 j2 ON j1.AJEP0100 = j2.AJEP0100
WHERE 1=1
j2.AXAA0001 LIKE CONCAT(#{subAreaCode},'%')
<if
test=
"subAreaCode !=null and subAreaCode != ''"
>
AND j2.AXAA0001 LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if
test=
"year != null"
>
AND DATE_FORMAT(j1.AJEP0120, "%Y") = #{year}
</if>
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment