Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
09665044
Commit
09665044
authored
Jul 19, 2024
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏监管-中屏-各地市数据统计、大屏监管-中屏-当前区域数据统计接口提交
parent
06b58638
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
12 deletions
+107
-12
DPMapStatisticsItemEnum.java
...mos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
+3
-1
JgUseRegistrationManageMapper.java
...t/module/jg/api/mapper/JgUseRegistrationManageMapper.java
+3
-3
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+12
-0
DPStatisticsController.java
...boot/module/jg/biz/controller/DPStatisticsController.java
+23
-4
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+53
-4
EquipmentCategoryMapper.java
...s/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
+2
-0
EquipmentCategoryMapper.xml
...api/src/main/resources/mapper/EquipmentCategoryMapper.xml
+11
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
View file @
09665044
...
@@ -28,7 +28,9 @@ public enum DPMapStatisticsItemEnum {
...
@@ -28,7 +28,9 @@ public enum DPMapStatisticsItemEnum {
CONSTRUCTION_UNITS
(
"安改维单位 (家)"
,
"constructionUnits"
,
""
),
CONSTRUCTION_UNITS
(
"安改维单位 (家)"
,
"constructionUnits"
,
""
),
USERS_UNITS
(
"使用单位 (家)"
,
"usersUnits"
,
""
),
USERS_UNITS
(
"使用单位 (家)"
,
"usersUnits"
,
""
),
GAS_UNITS
(
"充装单位 (家)"
,
"gasUnits"
,
""
),
GAS_UNITS
(
"充装单位 (家)"
,
"gasUnits"
,
""
),
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
);
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
),
DEVICE_COUNT
(
"已纳管设备数"
,
"deviceCount"
,
""
),
CERTIFICATE_COUNT
(
"登记证总量"
,
"certificateCount"
,
""
);
private
String
label
;
private
String
label
;
private
String
code
;
private
String
code
;
private
String
category
;
private
String
category
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgUseRegistrationManageMapper.java
View file @
09665044
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
...
@@ -25,4 +23,6 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
...
@@ -25,4 +23,6 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
Page
<
JgUseRegistrationManageDto
>
queryForPage
(
@Param
(
"page"
)
Page
<
JgUseRegistrationManageDto
>
page
,
Page
<
JgUseRegistrationManageDto
>
queryForPage
(
@Param
(
"page"
)
Page
<
JgUseRegistrationManageDto
>
page
,
@Param
(
"dto"
)
JgUseRegistrationManageDto
dto
,
@Param
(
"dto"
)
JgUseRegistrationManageDto
dto
,
@Param
(
"sort"
)
SortVo
sortMap
);
@Param
(
"sort"
)
SortVo
sortMap
);
Long
countCertificateByReginCode
(
String
orgCode
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
09665044
...
@@ -134,4 +134,16 @@
...
@@ -134,4 +134,16 @@
tjurm.rec_date DESC
tjurm.rec_date DESC
</where>
</where>
</select>
</select>
<select
id=
"countCertificateByReginCode"
resultType=
"java.lang.Long"
>
select
count(1)
from
tzs_jg_use_registration_manage tjurm
left join
privilege_company pc
on tjurm.receive_company_code = pc.company_code
where
pc.org_code like concat (#{reginCode},'%')
and tjurm.certificate_status = '已登记'
</select>
</mapper>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DPStatisticsController.java
View file @
09665044
...
@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
@@ -224,4 +221,26 @@ public class DPStatisticsController {
...
@@ -224,4 +221,26 @@ public class DPStatisticsController {
}
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
newRegCount
(
dpFilterParamDto
));
return
ResponseHelper
.
buildResponse
(
statisticsService
.
newRegCount
(
dpFilterParamDto
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏监管-中屏-各地市数据统计"
,
notes
=
"大屏监管-中屏-各地市数据统计"
)
@PostMapping
(
value
=
"/jg/centre/dataStatistic"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
dataStatisticByReginCode
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
dataStatisticByReginCode
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"大屏监管-中屏-当前区域数据统计"
,
notes
=
"大屏监管-中屏-当前区域数据统计"
)
@PostMapping
(
value
=
"/jg/centre/dataStatisticCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
dataStatisticCountByReginCode
(
@Validated
@RequestBody
DPFilterParamDto
dpFilterParamDto
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
dataStatisticCountByReginCode
(
dpFilterParamDto
));
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
View file @
09665044
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.LegendDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto
;
...
@@ -35,7 +34,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilde
...
@@ -35,7 +34,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilde
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.
Collection
Utils
;
import
org.springframework.util.
Object
Utils
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -88,7 +87,7 @@ public class DPStatisticsServiceImpl {
...
@@ -88,7 +87,7 @@ public class DPStatisticsServiceImpl {
*/
*/
private
final
static
String
COMPANY_TYPE_FILLING
=
"充装单位"
;
private
final
static
String
COMPANY_TYPE_FILLING
=
"充装单位"
;
@Autowired
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
private
JgUseRegistrationMapper
useRegistrationMapper
;
private
JgUseRegistrationMapper
useRegistrationMapper
;
...
@@ -113,10 +112,11 @@ public class DPStatisticsServiceImpl {
...
@@ -113,10 +112,11 @@ public class DPStatisticsServiceImpl {
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
List
<
RegionModel
>
regionModels
=
new
ArrayList
<>();
private
static
List
<
RegionModel
>
regionModels
=
new
ArrayList
<>();
@Resource
@Resource
private
DPStatisticsMapper
dpStatisticsMapper
;
private
DPStatisticsMapper
dpStatisticsMapper
;
@Autowired
private
JgUseRegistrationManageMapper
jgUseRegistrationManageMapper
;
public
DPStatisticsServiceImpl
(
EquipmentCategoryMapper
equipmentCategoryMapper
,
JgUseRegistrationMapper
useRegistrationMapper
,
EquipTechParamPipelineMapper
techParamsPipelineMapper
,
JgEnableDisableMapper
enableDisableMapper
,
JgScrapCancelMapper
scrapCancelMapper
,
RestHighLevelClient
restHighLevelClient
,
TzBaseEnterpriseInfoMapper
enterpriseInfoMapper
,
CommonMapper
commonMapper
,
TzsUserInfoMapper
userInfoMapper
)
{
public
DPStatisticsServiceImpl
(
EquipmentCategoryMapper
equipmentCategoryMapper
,
JgUseRegistrationMapper
useRegistrationMapper
,
EquipTechParamPipelineMapper
techParamsPipelineMapper
,
JgEnableDisableMapper
enableDisableMapper
,
JgScrapCancelMapper
scrapCancelMapper
,
RestHighLevelClient
restHighLevelClient
,
TzBaseEnterpriseInfoMapper
enterpriseInfoMapper
,
CommonMapper
commonMapper
,
TzsUserInfoMapper
userInfoMapper
)
{
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
...
@@ -1276,6 +1276,55 @@ public class DPStatisticsServiceImpl {
...
@@ -1276,6 +1276,55 @@ public class DPStatisticsServiceImpl {
}
}
public
List
<
Map
<
String
,
Object
>>
dataStatisticByReginCode
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
result
=
regionModels
.
parallelStream
().
filter
(
e
->
e
.
getParentRegionCode
()
!=
null
&&
(
e
.
getParentRegionCode
().
toString
()).
equals
(
dpFilterParamDto
.
getCityCode
())).
map
(
r
->
{
DPFilterParamDto
filterParamDto
=
new
DPFilterParamDto
();
filterParamDto
.
setCityCode
(
r
.
getRegionCode
().
toString
());
Map
<
String
,
Object
>
itemResult
=
staticsCenterMapCountDataForRegin
(
filterParamDto
);
if
(
itemResult
==
null
)
{
itemResult
=
new
HashMap
<>();
}
itemResult
.
put
(
"regionCode"
,
r
.
getRegionCode
());
itemResult
.
put
(
"regionName"
,
r
.
getRegionName
());
return
itemResult
;
}).
collect
(
Collectors
.
toList
());
return
result
;
}
private
Map
<
String
,
Object
>
staticsCenterMapCountDataForRegin
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
orgCode
=
commonMapper
.
getOrgCodeByCompanyCode
(
dpFilterParamDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
result
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
0
);
result
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
0
);
return
result
;
}
regionCodeOrgCodeMap
.
put
(
dpFilterParamDto
.
getCityCode
(),
orgCode
);
}
Long
certificateCount
=
jgUseRegistrationManageMapper
.
countCertificateByReginCode
(
orgCode
);
Long
deviceCount
=
equipmentCategoryMapper
.
countEquipByReginCode
(
orgCode
);
result
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
certificateCount
);
result
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
deviceCount
);
return
result
;
}
public
Map
<
String
,
Object
>
dataStatisticCountByReginCode
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
mapList
=
this
.
dataStatisticByReginCode
(
dpFilterParamDto
);
if
(
ObjectUtils
.
isEmpty
(
mapList
)){
resultMap
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
0
);
resultMap
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
0
);
return
resultMap
;
}
long
certificateCount
=
mapList
.
stream
().
mapToLong
(
x
->
(
Long
)
x
.
get
(
"certificateCount"
)).
sum
();
long
deviceCount
=
mapList
.
stream
().
mapToLong
(
x
->
(
Long
)
x
.
get
(
"deviceCount"
)).
sum
();
resultMap
.
put
(
DPMapStatisticsItemEnum
.
CERTIFICATE_COUNT
.
getCode
(),
certificateCount
);
resultMap
.
put
(
DPMapStatisticsItemEnum
.
DEVICE_COUNT
.
getCode
(),
deviceCount
);
return
resultMap
;
}
public
Map
<
String
,
Object
>
newRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
public
Map
<
String
,
Object
>
newRegEquCount
(
DPFilterParamDto
dpFilterParamDto
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
View file @
09665044
...
@@ -89,5 +89,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
...
@@ -89,5 +89,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List
<
String
>
selectXiXianNew
();
List
<
String
>
selectXiXianNew
();
Long
countEquipByReginCode
(
String
orgCode
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/EquipmentCategoryMapper.xml
View file @
09665044
...
@@ -680,4 +680,15 @@
...
@@ -680,4 +680,15 @@
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领';
AND "CLAIM_STATUS" = '已认领';
</select>
</select>
<select
id=
"countEquipByReginCode"
resultType=
"java.lang.Long"
>
select
count(1)
from
idx_biz_jg_use_info ibjui,
idx_biz_jg_supervision_info ibjsi
where
ibjui."RECORD" = ibjsi."RECORD"
and ibjsi."ORG_BRANCH_CODE" like concat (#{reginCode},'%')
and ibjui."IS_INTO_MANAGEMENT" = true
</select>
</mapper>
</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