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
fdecf097
Commit
fdecf097
authored
Aug 16, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register_to_0715' of…
Merge branch 'develop_tzs_register_to_0715' of
http://36.40.66.175:5000/moa/amos-boot-biz
into develop_tzs_register_to_0715
parents
0523f2d7
588469ba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
18 deletions
+84
-18
EquCategoryVo.java
...oin/amos/boot/module/statistics/api/vo/EquCategoryVo.java
+22
-0
StCommonController.java
...t/module/statistcs/biz/controller/StCommonController.java
+15
-4
StCommonServiceImpl.java
...odule/statistcs/biz/service/impl/StCommonServiceImpl.java
+34
-2
ZLDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/ZLDPStatisticsServiceImpl.java
+13
-12
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/vo/EquCategoryVo.java
0 → 100644
View file @
fdecf097
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EquCategoryVo
{
public
String
value
;
public
String
title
;
public
List
<
EquCategoryVo
>
children
;
public
EquCategoryVo
(
String
title
,
String
value
)
{
this
.
title
=
title
;
this
.
value
=
value
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/StCommonController.java
View file @
fdecf097
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl
;
import
com.yeejoin.amos.boot.module.statistics.api.vo.EquCategoryVo
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
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.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
...
@@ -36,4 +35,16 @@ public class StCommonController extends BaseController {
...
@@ -36,4 +35,16 @@ public class StCommonController extends BaseController {
List
<
RegionModel
>
regionList
=
commonService
.
getUserRegionCode
(
getSelectedOrgInfo
());
List
<
RegionModel
>
regionList
=
commonService
.
getUserRegionCode
(
getSelectedOrgInfo
());
return
ResponseHelper
.
buildResponse
(
regionList
);
return
ResponseHelper
.
buildResponse
(
regionList
);
}
}
/**
* 获取设备类型
* @return Map
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getEquCategoryTree"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"获取设备类型"
,
notes
=
"获取设备类型"
)
public
ResponseModel
<
EquCategoryVo
>
getEquCategoryTree
(
@RequestBody
DPFilterParamForDetailDto
paramDto
){
return
ResponseHelper
.
buildResponse
(
commonService
.
getEquCategoryTree
(
paramDto
));
}
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/StCommonServiceImpl.java
View file @
fdecf097
...
@@ -6,15 +6,17 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...
@@ -6,15 +6,17 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant
;
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.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CommonBaseMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.CommonBaseMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.mapper.ZLStatisticsMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.statistics.api.vo.EquCategoryVo
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
...
@@ -31,7 +33,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms;
...
@@ -31,7 +33,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
...
@@ -303,4 +304,35 @@ public class StCommonServiceImpl {
...
@@ -303,4 +304,35 @@ public class StCommonServiceImpl {
return
zlStatisticsMapper
.
countCompanyForCertDateTimeOut
(
dpFilterParamDto
,
orgCode
,
limitDate
);
return
zlStatisticsMapper
.
countCompanyForCertDateTimeOut
(
dpFilterParamDto
,
orgCode
,
limitDate
);
}
}
public
EquCategoryVo
getEquCategoryTree
(
DPFilterParamForDetailDto
paramDto
)
{
final
List
<
EquipmentCategoryDto
>
equipmentCategoryList
=
getEquipmentCategory
();
List
<
EquipmentCategoryDto
>
updatedCategoryList
=
addSpecialCategory
(
equipmentCategoryList
);
return
createEquCategoryVo
(
updatedCategoryList
);
}
/**
* 向设备分类列表中添加特定类别
* @param equipmentCategoryList 原始设备分类列表
* @return 添加了特定类别的新列表
*/
private
List
<
EquipmentCategoryDto
>
addSpecialCategory
(
List
<
EquipmentCategoryDto
>
equipmentCategoryList
)
{
List
<
EquipmentCategoryDto
>
newList
=
new
ArrayList
<>(
equipmentCategoryList
);
EquipmentCategoryDto
specialCategory
=
new
EquipmentCategoryDto
();
specialCategory
.
setName
(
"气瓶"
);
specialCategory
.
setCode
(
CylinderTypeEnum
.
CYLINDER
.
getCode
());
newList
.
add
(
specialCategory
);
return
newList
;
}
/**
* 创建设备类别树的根节点
* @param equipmentCategoryList 设备分类数据传输对象列表
* @return 根节点的 EquCategoryVo 对象
*/
private
EquCategoryVo
createEquCategoryVo
(
List
<
EquipmentCategoryDto
>
equipmentCategoryList
)
{
List
<
EquCategoryVo
>
children
=
equipmentCategoryList
.
stream
()
.
map
(
dto
->
new
EquCategoryVo
(
dto
.
getName
(),
dto
.
getCode
()))
.
collect
(
Collectors
.
toList
());
return
new
EquCategoryVo
(
null
,
"全部设备"
,
children
);
}
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZLDPStatisticsServiceImpl.java
View file @
fdecf097
...
@@ -682,8 +682,8 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -682,8 +682,8 @@ public class ZLDPStatisticsServiceImpl {
public
Map
<
String
,
Object
>
getEquipManagementRateStatistics
(
DPFilterParamForDetailDto
paramDto
)
{
public
Map
<
String
,
Object
>
getEquipManagementRateStatistics
(
DPFilterParamForDetailDto
paramDto
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
legendData
=
new
ArrayList
<>();
legendData
.
add
(
createLegend
(
"设备认领总数"
,
"equipTotal"
));
legendData
.
add
(
createLegend
(
"设备认领总数"
,
"equipTotal"
,
"bar"
));
legendData
.
add
(
createLegend
(
"设备认领率"
,
"claimRate"
));
legendData
.
add
(
createLegend
(
"设备认领率"
,
"claimRate"
,
"line"
));
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
"610000"
);
List
<
RegionModel
>
regionList
=
stCommonService
.
setRegionIfRootParentAndNoAccessIf3Level
(
"610000"
);
// 获取区域名称并过滤
// 获取区域名称并过滤
...
@@ -707,7 +707,7 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -707,7 +707,7 @@ public class ZLDPStatisticsServiceImpl {
.
map
(
region
->
{
.
map
(
region
->
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
region
.
getRegionCode
().
toString
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
region
.
getRegionCode
().
toString
());
Long
equipIsManageNum
=
staticsCenterMapCountDataForEquipIsManage
(
orgCode
,
paramDto
);
Long
equipIsManageNum
=
staticsCenterMapCountDataForEquipIsManage
(
orgCode
,
paramDto
);
Long
equipTotal
=
getEquipTotalForCode
(
paramDto
.
get
EquListCod
e
(),
region
.
getRegionCode
().
toString
());
Long
equipTotal
=
getEquipTotalForCode
(
paramDto
.
get
TreeValu
e
(),
region
.
getRegionCode
().
toString
());
CountDto
dto
=
new
CountDto
();
CountDto
dto
=
new
CountDto
();
dto
.
setLongValue
(
equipTotal
);
dto
.
setLongValue
(
equipTotal
);
dto
.
setStrValue
(
calculateClaimRate
(
equipTotal
,
equipIsManageNum
,
decimalFormat
));
dto
.
setStrValue
(
calculateClaimRate
(
equipTotal
,
equipIsManageNum
,
decimalFormat
));
...
@@ -715,11 +715,11 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -715,11 +715,11 @@ public class ZLDPStatisticsServiceImpl {
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
private
Long
getEquipTotalForCode
(
String
equListCod
e
,
String
regionCode
)
{
private
Long
getEquipTotalForCode
(
String
treeValu
e
,
String
regionCode
)
{
if
(
equListCod
e
==
null
)
{
if
(
treeValu
e
==
null
)
{
return
screenMapper
.
getEquipTotal
(
regionCode
);
return
screenMapper
.
getEquipTotal
(
regionCode
);
}
}
switch
(
equListCod
e
)
{
switch
(
treeValu
e
)
{
case
"1000"
:
case
"1000"
:
return
screenMapper
.
getEquListTotal
(
"boiler"
,
regionCode
);
// 锅炉
return
screenMapper
.
getEquListTotal
(
"boiler"
,
regionCode
);
// 锅炉
case
"2000"
:
case
"2000"
:
...
@@ -743,10 +743,11 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -743,10 +743,11 @@ public class ZLDPStatisticsServiceImpl {
}
}
}
}
private
Map
<
String
,
Object
>
createLegend
(
String
value
,
String
dataKey
)
{
private
Map
<
String
,
Object
>
createLegend
(
String
value
,
String
dataKey
,
String
chartType
)
{
return
new
HashMap
<
String
,
Object
>()
{{
return
new
HashMap
<
String
,
Object
>()
{{
put
(
"value"
,
value
);
put
(
"value"
,
value
);
put
(
"dataKey"
,
dataKey
);
put
(
"dataKey"
,
dataKey
);
put
(
"chartType"
,
chartType
);
}};
}};
}
}
...
@@ -772,11 +773,11 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -772,11 +773,11 @@ public class ZLDPStatisticsServiceImpl {
// 设备类别精确查询气瓶
// 设备类别精确查询气瓶
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
if
(
StringUtils
.
isNotEmpty
(
paramDto
.
get
EquListCod
e
()))
{
if
(
StringUtils
.
isNotEmpty
(
paramDto
.
get
TreeValu
e
()))
{
if
(
"2300"
.
equals
(
paramDto
.
get
EquListCod
e
())){
if
(
"2300"
.
equals
(
paramDto
.
get
TreeValu
e
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
paramDto
.
get
EquListCod
e
().
toLowerCase
())));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
paramDto
.
get
TreeValu
e
().
toLowerCase
())));
}
else
{
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
paramDto
.
get
EquListCod
e
().
toLowerCase
())));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
paramDto
.
get
TreeValu
e
().
toLowerCase
())));
}
}
}
}
// 且8大类,目的去掉脏数据
// 且8大类,目的去掉脏数据
...
@@ -820,7 +821,7 @@ public class ZLDPStatisticsServiceImpl {
...
@@ -820,7 +821,7 @@ public class ZLDPStatisticsServiceImpl {
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"superviseUnitName"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"superviseUnitName"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
map
.
getString
(
"superviseUnitName"
));
String
test
=
QueryParser
.
escape
(
map
.
getString
(
"superviseUnitName"
));
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"ORG_BRANCH_
COD
E"
,
"*"
+
test
+
"*"
));
query
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"ORG_BRANCH_
NAM
E"
,
"*"
+
test
+
"*"
));
boolMust
.
must
(
query
);
boolMust
.
must
(
query
);
}
}
...
...
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