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
7b4a899e
Commit
7b4a899e
authored
Jul 19, 2024
by
刘林
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…
Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents
0a7c0921
7a7a46ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
403 additions
and
20 deletions
+403
-20
DPFilterParamDto.java
...oin/amos/boot/module/common/api/dto/DPFilterParamDto.java
+5
-0
DPMapStatisticsItemEnum.java
...mos/boot/module/jg/api/enums/DPMapStatisticsItemEnum.java
+3
-1
DPStatisticsMapper.java
...in/amos/boot/module/jg/api/mapper/DPStatisticsMapper.java
+11
-0
JgUseRegistrationManageMapper.java
...t/module/jg/api/mapper/JgUseRegistrationManageMapper.java
+3
-3
DPStatisticsMapper.xml
...e-jg-api/src/main/resources/mapper/DPStatisticsMapper.xml
+108
-0
JgUseRegistrationManageMapper.xml
...c/main/resources/mapper/JgUseRegistrationManageMapper.xml
+12
-0
DPStatisticsController.java
...boot/module/jg/biz/controller/DPStatisticsController.java
+45
-4
DPStatisticsServiceImpl.java
...t/module/jg/biz/service/impl/DPStatisticsServiceImpl.java
+170
-4
DPSubServiceImpl.java
...s/boot/module/jyjc/biz/service/impl/DPSubServiceImpl.java
+27
-7
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+6
-1
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-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DPFilterParamDto.java
View file @
7b4a899e
...
...
@@ -31,4 +31,9 @@ public class DPFilterParamDto {
* 业务类型0告知管理,1使用登记,2变更登记,3停用启用,4注销报废
*/
private
String
businessKey
;
/**
* month , year
*/
private
String
searchType
;
}
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 @
7b4a899e
...
...
@@ -28,7 +28,9 @@ public enum DPMapStatisticsItemEnum {
CONSTRUCTION_UNITS
(
"安改维单位 (家)"
,
"constructionUnits"
,
""
),
USERS_UNITS
(
"使用单位 (家)"
,
"usersUnits"
,
""
),
GAS_UNITS
(
"充装单位 (家)"
,
"gasUnits"
,
""
),
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
);
OPERATORS
(
"作业人员 (人)"
,
"operators"
,
""
),
DEVICE_COUNT
(
"已纳管设备数"
,
"deviceCount"
,
""
),
CERTIFICATE_COUNT
(
"登记证总量"
,
"certificateCount"
,
""
);
private
String
label
;
private
String
code
;
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/DPStatisticsMapper.java
View file @
7b4a899e
...
...
@@ -56,4 +56,15 @@ public interface DPStatisticsMapper {
List
<
Map
<
String
,
Object
>>
changeUnitEquCount
(
@Param
(
"cityCode"
)
String
cityCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
Map
<
String
,
Object
>>
vehicleEquCount
(
@Param
(
"cityCode"
)
String
cityCode
,
@Param
(
"startTime"
)
String
startTime
);
List
<
Map
<
String
,
Object
>>
newRegEquCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newVehicleEquCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newRegEquCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
List
<
Map
<
String
,
Object
>>
newVehicleEquCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
String
newVehicleCountByYear
(
@Param
(
"cityCode"
)
String
cityCode
);
String
newVehicleCountByMonth
(
@Param
(
"cityCode"
)
String
cityCode
);
}
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 @
7b4a899e
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.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.entity.JgUseRegistrationManage
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -25,4 +23,6 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
Page
<
JgUseRegistrationManageDto
>
queryForPage
(
@Param
(
"page"
)
Page
<
JgUseRegistrationManageDto
>
page
,
@Param
(
"dto"
)
JgUseRegistrationManageDto
dto
,
@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/DPStatisticsMapper.xml
View file @
7b4a899e
...
...
@@ -415,5 +415,113 @@
jri.equ_category
</select>
<select
id=
"newRegEquCountByMonth"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.audit_status = '已完成'
INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleEquCountByMonth"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
INNER JOIN tzs_jg_vehicle_information_eq te ON te.vehicle_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m-%d')
ORDER BY
ur.rec_date
</select>
<select
id=
"newRegEquCountByYear"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.audit_status = '已完成'
INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleEquCountByYear"
resultType=
"java.util.Map"
>
SELECT COUNT
( 1 ) ,
DATE_FORMAT(ur.rec_date,'%Y-%m')
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
INNER JOIN tzs_jg_vehicle_information_eq te ON te.vehicle_id = ur.sequence_nbr
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleCountByYear"
resultType=
"String"
>
SELECT COUNT
( 1 )
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y')
ORDER BY
ur.rec_date
</select>
<select
id=
"newVehicleCountByMonth"
resultType=
"String"
>
SELECT COUNT
( 1 )
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_vehicle_information ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
WHERE
pc.company_code = #{cityCode}
AND ur.rec_date like concat('%',DATE_FORMAT(CURDATE(), '%Y-%m') ,'%')
GROUP BY
DATE_FORMAT(ur.rec_date,'%Y-%m')
ORDER BY
ur.rec_date
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationManageMapper.xml
View file @
7b4a899e
...
...
@@ -134,4 +134,16 @@
tjurm.rec_date DESC
</where>
</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>
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 @
7b4a899e
...
...
@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.annotation.Validated
;
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
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -202,4 +199,48 @@ public class DPStatisticsController {
}
return
ResponseHelper
.
buildResponse
(
statisticsService
.
getRegEquCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管大屏-左侧新增情况"
,
notes
=
"监管大屏-左侧新增情况"
)
@PostMapping
(
value
=
"/newRegEquCount"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
newRegEquCount
(
@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
.
newRegEquCount
(
dpFilterParamDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管大屏-新增登记新增设备统计"
,
notes
=
"监管大屏-新增登记新增设备统计"
)
@PostMapping
(
value
=
"/newRegCount"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
newRegCount
(
@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
.
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 @
7b4a899e
...
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import
cn.hutool.core.date.DateUtil
;
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.LegendDataDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto
;
...
...
@@ -35,7 +34,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilde
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.
Collection
Utils
;
import
org.springframework.util.
Object
Utils
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
...
...
@@ -88,7 +87,7 @@ public class DPStatisticsServiceImpl {
*/
private
final
static
String
COMPANY_TYPE_FILLING
=
"充装单位"
;
@Autowired
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
private
JgUseRegistrationMapper
useRegistrationMapper
;
...
...
@@ -113,10 +112,11 @@ public class DPStatisticsServiceImpl {
private
static
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
private
static
List
<
RegionModel
>
regionModels
=
new
ArrayList
<>();
@Resource
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
)
{
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
...
...
@@ -1275,4 +1275,170 @@ public class DPStatisticsServiceImpl {
return
resultMap
;
}
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
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"dataKey"
,
"newRegisterEq"
);
map
.
put
(
"value"
,
"新增登记设备"
);
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
legendData
.
add
(
map
);
resultMap
.
put
(
"legendData"
,
legendData
);
List
xDataList
=
new
ArrayList
<>();
List
newRegisterEq
=
new
ArrayList
<>();
Map
<
String
,
Object
>
useCountMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
vehicleCountMap
=
new
HashMap
<>();
if
(
"month"
.
equals
(
dpFilterParamDto
.
getSearchType
())){
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++){
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++){
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getDayOfMonth
();
i
++){
xDataList
.
add
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusDays
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)),
0
)+
""
));
}
}
else
if
(
"year"
.
equals
(
dpFilterParamDto
.
getSearchType
())){
List
<
Map
<
String
,
Object
>>
useCountList
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
List
<
Map
<
String
,
Object
>>
vehicleCountList
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
for
(
int
i
=
0
;
i
<
useCountList
.
size
();
i
++){
useCountMap
.
put
(
useCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
useCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
vehicleCountList
.
size
();
i
++){
vehicleCountMap
.
put
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"date_format"
,
""
)+
""
,
Integer
.
valueOf
(
vehicleCountList
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
));
}
for
(
int
i
=
0
;
i
<
LocalDate
.
now
().
getMonth
().
getValue
();
i
++){
xDataList
.
add
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)));
newRegisterEq
.
add
(
Integer
.
valueOf
(
useCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
)
+
Integer
.
valueOf
(
vehicleCountMap
.
getOrDefault
(
LocalDate
.
now
().
minusMonths
(
i
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM"
)),
0
)+
""
));
}
}
Collections
.
reverse
(
xDataList
);
Collections
.
reverse
(
newRegisterEq
);
resultMap
.
put
(
"xdata"
,
xDataList
);
resultMap
.
put
(
"newRegisterEq"
,
newRegisterEq
);
return
resultMap
;
}
public
List
<
Map
<
String
,
Object
>>
newRegCount
(
DPFilterParamDto
dpFilterParamDto
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
//年使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListYear
=
dpStatisticsMapper
.
newRegEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListYear
=
dpStatisticsMapper
.
newVehicleEquCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月使用登记设备
List
<
Map
<
String
,
Object
>>
useEquCountListMonth
=
dpStatisticsMapper
.
newRegEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记设备
List
<
Map
<
String
,
Object
>>
vehicleEquCountListMonth
=
dpStatisticsMapper
.
newVehicleEquCountByMonth
(
dpFilterParamDto
.
getCityCode
());
//年气瓶使用登记
String
vehicleCountYear
=
dpStatisticsMapper
.
newVehicleCountByYear
(
dpFilterParamDto
.
getCityCode
());
//月气瓶使用登记
String
vehicleCountListMonth
=
dpStatisticsMapper
.
newVehicleCountByMonth
(
dpFilterParamDto
.
getCityCode
());
/**
* [ { "name": "本年新增登记", "value": 52 }, { "name": "本年新增设备", "value": 83 },
* { "name": "本月新增登记", "value": 16 }, { "name": "本月新增设备", "value": 50 } ]
*/
int
useYear
=
0
;
int
useMonth
=
0
;
int
usrEqYear
=
0
;
int
usrEqMonth
=
0
;
//本年新增登记
for
(
int
i
=
0
;
i
<
useEquCountListYear
.
size
()
;
i
++){
useYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqYear
+=
Integer
.
valueOf
(
useEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
useYear
+=
StringUtils
.
isBlank
(
vehicleCountYear
)?
0
:
Integer
.
valueOf
(
vehicleCountYear
);
//本年新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListYear
.
size
()
;
i
++){
usrEqYear
+=
Integer
.
valueOf
(
vehicleEquCountListYear
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
//本月新增登记
for
(
int
i
=
0
;
i
<
useEquCountListMonth
.
size
()
;
i
++){
useMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
usrEqMonth
+=
Integer
.
valueOf
(
useEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
useMonth
+=
StringUtils
.
isBlank
(
vehicleCountListMonth
)?
0
:
Integer
.
valueOf
(
vehicleCountListMonth
);
//本月新增设备
for
(
int
i
=
0
;
i
<
vehicleEquCountListMonth
.
size
()
;
i
++){
usrEqMonth
+=
Integer
.
valueOf
(
vehicleEquCountListMonth
.
get
(
i
).
getOrDefault
(
"count"
,
0
)+
""
);
}
for
(
int
i
=
0
;
i
<
4
;
i
++){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
i
==
0
){
map
.
put
(
"name"
,
"本年新增登记"
);
map
.
put
(
"value"
,
useYear
);
}
else
if
(
i
==
1
){
map
.
put
(
"name"
,
"本年新增设备"
);
map
.
put
(
"value"
,
usrEqYear
);
}
else
if
(
i
==
2
){
map
.
put
(
"name"
,
"本月新增登记"
);
map
.
put
(
"value"
,
useMonth
);
}
else
if
(
i
==
3
){
map
.
put
(
"name"
,
"本月新增设备"
);
map
.
put
(
"value"
,
usrEqMonth
);
}
resultList
.
add
(
map
);
}
return
resultList
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/DPSubServiceImpl.java
View file @
7b4a899e
...
...
@@ -93,16 +93,22 @@ public class DPSubServiceImpl {
this
.
processShowHideRules
(
children
,
showHideRules
,
apiResult
);
List
<
Object
>
noHiddenChildren
=
children
.
stream
().
filter
(
x
->
!
"hidden"
.
equals
(
JsonValueUtils
.
getValueByKey
(
x
,
"visualParams"
,
"visualParams.behavior"
))).
collect
(
Collectors
.
toList
());
// 设置一个图片附件分组
JSONObject
matinfo
=
new
JSONObject
();
matinfo
.
put
(
"displayName"
,
"图片附件"
);
matinfo
.
put
(
"renderType"
,
"matui"
);
matinfo
.
put
(
"datas"
,
new
JSONArray
());
for
(
int
i
=
0
;
i
<
noHiddenChildren
.
size
();
i
++)
{
JSONObject
yObj
=
(
JSONObject
)
noHiddenChildren
.
get
(
i
);
if
(
"pageSection"
.
equals
(
yObj
.
get
(
"componentKey"
))
||
"columnsLayout"
.
equals
(
yObj
.
get
(
"componentKey"
)))
{
// 分组或者布局容器
List
<
Object
>
mergedArray
=
mergedList
(
yObj
.
getJSONArray
(
"children"
));
// 第一组去除标题
if
(
i
==
0
||
ValidationUtil
.
isEmpty
(
map
.
get
(
"datas"
)))
{
this
.
buildContentData
(
map
,
mergedArray
,
apiResult
);
this
.
buildContentData
(
map
,
mergedArray
,
apiResult
,
matinfo
);
}
else
{
this
.
buildSubContentData
(
map
,
i
,
yObj
,
mergedArray
,
apiResult
);
this
.
buildSubContentData
(
map
,
i
,
yObj
,
mergedArray
,
apiResult
,
matinfo
);
}
}
else
if
(
"subForm"
.
equals
(
yObj
.
get
(
"componentKey"
)))
{
// 子表单
this
.
buildSubFormData
(
map
,
i
,
yObj
,
apiResult
);
...
...
@@ -124,6 +130,11 @@ public class DPSubServiceImpl {
content
.
put
(
tab
.
getString
(
"key"
),
map
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
matinfo
.
getJSONArray
(
"datas"
))){
matinfo
.
put
(
"columns"
,
map
.
getJSONObject
(
"basic"
).
getString
(
"columns"
));
map
.
getJSONArray
(
"subs"
).
add
(
matinfo
);
}
}
else
{
if
(
ValidationUtil
.
isEmpty
(
map
))
{
content
.
put
(
tab
.
getString
(
"key"
),
apiResult
);
...
...
@@ -275,7 +286,7 @@ public class DPSubServiceImpl {
return
mergedArray
;
}
public
JSONObject
buildContentData
(
JSONObject
map
,
List
<
Object
>
mergedArray
,
JSONObject
apiResult
)
{
public
JSONObject
buildContentData
(
JSONObject
map
,
List
<
Object
>
mergedArray
,
JSONObject
apiResult
,
JSONObject
matinfo
)
{
JSONArray
datas
=
new
JSONArray
();
// 处理二维码
mergedArray
.
stream
().
filter
(
x
->
"QRCode"
.
equals
(
JsonValueUtils
.
getValueByKey
(
x
,
"componentKey"
,
null
))).
findFirst
().
ifPresent
(
x
->
{
...
...
@@ -302,17 +313,18 @@ public class DPSubServiceImpl {
});
mergedArray
=
mergedArray
.
stream
().
filter
(
x
->
!
"QRCode"
.
equals
(
JsonValueUtils
.
getValueByKey
(
x
,
"componentKey"
,
null
))).
collect
(
Collectors
.
toList
());
mergedArray
.
stream
().
forEach
(
x
->
{
Object
fieldKey
=
JsonValueUtils
.
getValueByKey
(
x
,
"visualParams"
,
"visualParams.fieldKey"
);
if
(!
ValidationUtil
.
isEmpty
(
fieldKey
))
{
this
.
processWidgets
(
datas
,
x
,
fieldKey
.
toString
(),
apiResult
);
this
.
processWidgets
(
datas
,
x
,
fieldKey
.
toString
(),
apiResult
,
matinfo
);
}
});
map
.
put
(
"datas"
,
datas
);
return
map
;
}
public
JSONObject
buildSubContentData
(
JSONObject
map
,
int
i
,
JSONObject
yObj
,
List
<
Object
>
mergedArray
,
JSONObject
apiResult
)
{
public
JSONObject
buildSubContentData
(
JSONObject
map
,
int
i
,
JSONObject
yObj
,
List
<
Object
>
mergedArray
,
JSONObject
apiResult
,
JSONObject
matinfo
)
{
JSONArray
subs
=
map
.
getJSONArray
(
"subs"
);
JSONArray
children
=
yObj
.
getJSONArray
(
"children"
);
List
<
Object
>
columnsArray
=
children
.
stream
().
filter
(
x
->
{
...
...
@@ -330,7 +342,7 @@ public class DPSubServiceImpl {
mergedArray
.
stream
().
forEach
(
x
->
{
Object
fieldKey
=
JsonValueUtils
.
getValueByKey
(
x
,
"visualParams"
,
"visualParams.fieldKey"
);
if
(!
ValidationUtil
.
isEmpty
(
fieldKey
))
{
this
.
processWidgets
(
datas
,
x
,
fieldKey
.
toString
(),
apiResult
);
this
.
processWidgets
(
datas
,
x
,
fieldKey
.
toString
(),
apiResult
,
matinfo
);
subObj
.
put
(
"datas"
,
datas
);
}
});
...
...
@@ -347,18 +359,26 @@ public class DPSubServiceImpl {
* @param apiResult
* @return
*/
public
JSONArray
processWidgets
(
JSONArray
datas
,
Object
x
,
String
fieldKey
,
JSONObject
apiResult
)
{
public
JSONArray
processWidgets
(
JSONArray
datas
,
Object
x
,
String
fieldKey
,
JSONObject
apiResult
,
JSONObject
matinfo
)
{
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
xObj
=
(
JSONObject
)
x
;
JSONObject
visualParams
=
xObj
.
getJSONObject
(
"visualParams"
);
jsonObject
.
put
(
"label"
,
visualParams
.
getString
(
"label"
));
Object
value
=
apiResult
.
get
(
fieldKey
);
if
(
"upload"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
jsonObject
.
put
(
"type"
,
"img"
);
if
(!
ValidationUtil
.
isEmpty
(
value
))
{
jsonObject
.
put
(
"value"
,
((
JSONArray
)
value
).
getJSONObject
(
0
).
getString
(
"url"
));
}
}
else
if
(
"attachmentUpload"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
JSONArray
attachmentUploadDatas
=
matinfo
.
getJSONArray
(
"datas"
);
if
(!
ValidationUtil
.
isEmpty
(
value
))
{
JSONObject
attachmentUploadDatasObj
=
new
JSONObject
();
attachmentUploadDatasObj
.
put
(
"value"
,
value
);
attachmentUploadDatas
.
add
(
attachmentUploadDatasObj
);
}
}
else
if
(
"checkbox"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
jsonObject
.
put
(
"type"
,
"text"
);
ResponseModel
checkboxResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
7b4a899e
...
...
@@ -277,7 +277,12 @@ public class TzBaseEnterpriseInfoServiceImpl
resultMap
.
remove
(
"tzsBaseInstitution"
);
resultMap
.
put
(
"unitAddress"
,
resultMap
.
get
(
"province"
)
+
"/"
+
resultMap
.
get
(
"city"
)
+
"/"
+
resultMap
.
get
(
"district"
));
resultMap
.
put
(
"longitudeLatitude"
,
resultMap
.
get
(
"address"
));
Map
<
String
,
Object
>
longitudeLatitudeMap
=
new
HashMap
<>();
longitudeLatitudeMap
.
put
(
"address"
,
resultMap
.
get
(
"address"
));
longitudeLatitudeMap
.
put
(
"latitude"
,
resultMap
.
get
(
"latitude"
));
longitudeLatitudeMap
.
put
(
"longitude"
,
resultMap
.
get
(
"longitude"
));
resultMap
.
put
(
"longitudeLatitude"
,
longitudeLatitudeMap
);
resultMap
.
put
(
"problemTime"
,
ObjectUtils
.
isEmpty
(
problemInfo
)
?
null
:
problemInfo
.
get
(
"problem_time"
));
resultMap
.
put
(
"problemStatus"
,
(
ObjectUtils
.
isEmpty
(
resultMap
.
get
(
"status"
))
||
"null"
.
equals
(
resultMap
.
get
(
"status"
)))
?
ProblemStatusEnum
.
NORMAL
.
getName
()
:
ProblemStatusEnum
.
getName
.
get
(
resultMap
.
get
(
"status"
)));
...
...
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 @
7b4a899e
...
...
@@ -89,5 +89,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
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 @
7b4a899e
...
...
@@ -680,4 +680,15 @@
AND ( ibjoi."CODE96333" NOT LIKE'31%' OR ibjoi."CODE96333" IS NULL )
AND "CLAIM_STATUS" = '已认领';
</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>
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