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
ac4071a9
Commit
ac4071a9
authored
Jul 19, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.检验检测大屏接口接口开发
parent
c692702c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
JyjcInspectionApplicationMapper.xml
...main/resources/mapper/JyjcInspectionApplicationMapper.xml
+2
-2
DPStatisticsServiceImpl.java
...module/jyjc/biz/service/impl/DPStatisticsServiceImpl.java
+12
-10
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionApplicationMapper.xml
View file @
ac4071a9
...
@@ -285,10 +285,10 @@
...
@@ -285,10 +285,10 @@
a.inspection_unit_code= b.use_unit_code
a.inspection_unit_code= b.use_unit_code
and a.status != '6610' and a.status != '6615'
and a.status != '6610' and a.status != '6615'
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
and b.supervise_org_code like CONCAT(#{orgCode}, '%')
<if
test=
"dto.beginDate !=null"
>
<if
test=
"dto.beginDate !=null
and dto.beginDate !=''
"
>
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
</if>
</if>
<if
test=
"dto.endDate !=null"
>
<if
test=
"dto.endDate !=null
and dto.endDate !=''
"
>
and date_le(CAST(a.application_date as date),#{dto.endDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
</if>
</if>
</select>
</select>
...
...
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/DPStatisticsServiceImpl.java
View file @
ac4071a9
...
@@ -465,12 +465,13 @@ public class DPStatisticsServiceImpl {
...
@@ -465,12 +465,13 @@ public class DPStatisticsServiceImpl {
private
void
buildYDataForJyTime
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
private
void
buildYDataForJyTime
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
// 1.检验检测临期设备数数量统计
// 1.检验检测临期设备数数量统计
staticsCenterMapCountDataForJyTimeTemporary
(
result
,
dpFilterParamDto
,
equipmentCategoryDtos
);
result
.
put
(
"approach"
,
staticsCenterMapCountDataForJyTimeTemporary
(
dpFilterParamDto
,
equipmentCategoryDtos
)
);
// 2.检验检测超期设备数数量统计
// 2.检验检测超期设备数数量统计
staticsCenterMapCountDataForJyTimeOverdue
(
result
,
dpFilterParamDto
,
equipmentCategoryDtos
);
result
.
put
(
"overdue"
,
staticsCenterMapCountDataForJyTimeOverdue
(
dpFilterParamDto
,
equipmentCategoryDtos
)
);
}
}
private
void
staticsCenterMapCountDataForJyTimeTemporary
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
private
List
<
Long
>
staticsCenterMapCountDataForJyTimeTemporary
(
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
List
<
Long
>
seresData
=
new
ArrayList
<>();
SearchRequest
request
=
new
SearchRequest
();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
...
@@ -480,12 +481,10 @@ public class DPStatisticsServiceImpl {
...
@@ -480,12 +481,10 @@ public class DPStatisticsServiceImpl {
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
// 且在用状态设备
// 且在用状态设备
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_STATE"
,
EquimentEnum
.
ZAIYONG
.
getCode
()));
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_STATE"
,
EquimentEnum
.
ZAIYONG
.
getCode
()));
// 且下次检验日期大于等于当天
// 且下次检验日期大于等于当天
且查询 下次检验日期 <= 当前天+30天 极为临期
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
).
getTime
();
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
currentDayTime
));
// 且查询 下次检验日期 <= 当前天+30天 极为临期
long
currentDayAfter30DayTime
=
DateUtil
.
offsetDay
(
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
),
30
).
getTime
();
long
currentDayAfter30DayTime
=
DateUtil
.
offsetDay
(
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
),
30
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lte
(
currentDayAfter30DayTime
));
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
currentDayTime
).
lte
(
currentDayAfter30DayTime
));
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
builder
.
query
(
boolMust
);
builder
.
query
(
boolMust
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count_by_equ_list_code"
).
field
(
"EQU_LIST_CODE"
);
TermsAggregationBuilder
aggregationBuilder
=
AggregationBuilders
.
terms
(
"count_by_equ_list_code"
).
field
(
"EQU_LIST_CODE"
);
...
@@ -500,14 +499,16 @@ public class DPStatisticsServiceImpl {
...
@@ -500,14 +499,16 @@ public class DPStatisticsServiceImpl {
}
}
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
equipmentCategoryDtos
.
forEach
(
c
->
{
equipmentCategoryDtos
.
forEach
(
c
->
{
result
.
put
(
c
.
getName
(),
countMap
.
getOrDefault
(
c
.
getCode
(),
0L
));
seresData
.
add
(
countMap
.
getOrDefault
(
c
.
getCode
(),
0L
));
});
});
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
return
seresData
;
}
}
private
void
staticsCenterMapCountDataForJyTimeOverdue
(
Map
<
String
,
Object
>
result
,
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
private
List
<
Long
>
staticsCenterMapCountDataForJyTimeOverdue
(
DPFilterParamDto
dpFilterParamDto
,
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
)
{
List
<
Long
>
seresData
=
new
ArrayList
<>();
SearchRequest
request
=
new
SearchRequest
();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
"idx_biz_view_jg_all"
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
...
@@ -534,11 +535,12 @@ public class DPStatisticsServiceImpl {
...
@@ -534,11 +535,12 @@ public class DPStatisticsServiceImpl {
}
}
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
equipmentCategoryDtos
.
forEach
(
c
->
{
equipmentCategoryDtos
.
forEach
(
c
->
{
result
.
put
(
c
.
getName
(),
countMap
.
getOrDefault
(
c
.
getCode
(),
0L
));
seresData
.
add
(
countMap
.
getOrDefault
(
c
.
getCode
(),
0L
));
});
});
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
return
seresData
;
}
}
private
Object
getLegendDataForJyTime
()
{
private
Object
getLegendDataForJyTime
()
{
...
...
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