Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
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
ZTGK
hzsomms
Commits
6359c104
Commit
6359c104
authored
Sep 12, 2023
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
b690f3e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
AnalysisAlgorithm.java
...es/dynamicStaticAnalysis/algorithm/AnalysisAlgorithm.java
+27
-16
No files found.
jeecg-module-system/src/main/java/org/jeecg/modules/dynamicStaticAnalysis/algorithm/AnalysisAlgorithm.java
View file @
6359c104
...
...
@@ -163,7 +163,7 @@ public class AnalysisAlgorithm {
BigDecimal
labourCheckScore
=
(
BigDecimal
)
unitDevice
.
get
(
"labourCheckScore"
);
if
(
labourCheckScore
==
null
)
{
analysisBatchUnitDevice
.
setLabourCheck
(
0
);
analysisBatchUnitDevice
.
setLabourCheckScore
(
n
ew
BigDecimal
(
"-1"
));
analysisBatchUnitDevice
.
setLabourCheckScore
(
n
ull
);
// 设置空值
}
else
{
analysisBatchUnitDevice
.
setLabourCheck
(
1
);
analysisBatchUnitDevice
.
setLabourCheckScore
(
labourCheckScore
);
...
...
@@ -174,7 +174,7 @@ public class AnalysisAlgorithm {
BigDecimal
railDeviceCheckScore
=
(
BigDecimal
)
unitDevice
.
get
(
"railDeviceCheckScore"
);
if
(
null
==
railDeviceCheckScore
)
{
analysisBatchUnitDevice
.
setRailDeviceCheck
(
0
);
analysisBatchUnitDevice
.
setRailDeviceCheckScore
(
n
ew
BigDecimal
(
"-1"
)
);
analysisBatchUnitDevice
.
setRailDeviceCheckScore
(
n
ull
);
}
else
{
analysisBatchUnitDevice
.
setRailDeviceCheck
(
1
);
analysisBatchUnitDevice
.
setRailDeviceCheckScore
(
railDeviceCheckScore
);
...
...
@@ -190,7 +190,7 @@ public class AnalysisAlgorithm {
BigDecimal
railVehicleCheckScore
=
(
BigDecimal
)
unitDevice
.
get
(
"railVehicleCheckScore"
);
if
(
null
==
railVehicleCheckScore
)
{
analysisBatchUnitDevice
.
setRailVehicleCheck
(
0
);
analysisBatchUnitDevice
.
setRailVehicleCheckScore
(
n
ew
BigDecimal
(
"-1"
)
);
analysisBatchUnitDevice
.
setRailVehicleCheckScore
(
n
ull
);
}
else
{
analysisBatchUnitDevice
.
setRailVehicleCheck
(
1
);
analysisBatchUnitDevice
.
setRailVehicleCheckScore
(
railVehicleCheckScore
);
...
...
@@ -205,7 +205,7 @@ public class AnalysisAlgorithm {
BigDecimal
addInstrumentCheckScore
=
(
BigDecimal
)
unitDevice
.
get
(
"addInstrumentCheckScore"
);
if
(
null
==
addInstrumentCheckScore
)
{
analysisBatchUnitDevice
.
setAddDeviceCheck
(
0
);
analysisBatchUnitDevice
.
setAddDeviceCheckScore
(
n
ew
BigDecimal
(
"-1"
)
);
analysisBatchUnitDevice
.
setAddDeviceCheckScore
(
n
ull
);
}
else
{
analysisBatchUnitDevice
.
setAddDeviceCheck
(
1
);
analysisBatchUnitDevice
.
setAddDeviceCheckScore
(
railVehicleCheckScore
);
...
...
@@ -234,7 +234,7 @@ public class AnalysisAlgorithm {
}
}
}
else
{
unitScore
=
n
ew
BigDecimal
(
"-1"
)
;
unitScore
=
n
ull
;
unitScoreLevelStr
=
"无"
;
unitScoreLevel
=
4
;
}
...
...
@@ -1289,11 +1289,23 @@ public class AnalysisAlgorithm {
List
<
MovementCheckDataUnitDeviceMap
>
movementCheckDataUnitDeviceMaps
=
new
ArrayList
<>();
// 1 获取轨检仪静态检查
List
<
RailInspectionEquipmentItem
>
checkItemList
=
railInspectionEquipmentItemService
.
lambdaQuery
().
eq
(
RailInspectionEquipmentItem:
:
getRailInspectionEquipmentId
,
checkDataMap
.
getEkId
()).
list
();
// 1.1 获取轨检仪静态检查
List
<
RailInspectionEquipmentItem
>
checkItemList
=
railInspectionEquipmentItemService
.
lambdaQuery
()
.
eq
(
RailInspectionEquipmentItem:
:
getRailInspectionEquipmentId
,
checkDataMap
.
getEkId
())
.
orderByAsc
(
RailInspectionEquipmentItem:
:
getCourseStartingMileage
)
.
list
();
List
<
RailInspectionEquipmentItemDetail
>
checkItemItemDetailList
=
railInspectionEquipmentItemDetailService
.
lambdaQuery
().
eq
(
RailInspectionEquipmentItemDetail:
:
getRailInspectionEquipmentId
,
checkDataMap
.
getEkId
()).
list
();
Map
<
String
,
List
<
RailInspectionEquipmentItemDetail
>>
checkItemItemDetailMap
=
checkItemItemDetailList
.
stream
().
collect
(
Collectors
.
groupingBy
(
RailInspectionEquipmentItemDetail:
:
getRailInspectionEquipmentItemId
));
// 1.2 处理检查项目的开始-结束里程
for
(
RailInspectionEquipmentItem
checkItem
:
checkItemList
)
{
// 1.2 处理检查项目是公里的情况
BigDecimal
checkItemStartingMileage
=
checkItem
.
getCourseStartingMileage
().
multiply
(
new
BigDecimal
(
"1000"
));
BigDecimal
checkItemEndMileage
=
checkItem
.
getCourseEndMileage
().
multiply
(
new
BigDecimal
(
"1000"
));
checkItem
.
setCourseStartingMileage
(
checkItemStartingMileage
);
checkItem
.
setCourseEndMileage
(
checkItemEndMileage
);
}
// 2.循环单元设备根据单元设备的中心里程落在检查项目【开始-结束】这个区间视为这个区间的单元设备第第一个就行了
for
(
Map
<
String
,
Object
>
unitDevice
:
unitDeviceList
)
{
...
...
@@ -1301,16 +1313,13 @@ public class AnalysisAlgorithm {
BigDecimal
centerMileage
=
Convert
.
toBigDecimal
(
unitDevice
.
get
(
"centerMileage"
));
// 2.1 循环遍历检查项目比较【开始-结束】来映射关联关系
System
.
out
.
println
(
"单元设备名称="
+
unitDevice
.
get
(
"unitCode"
));
System
.
out
.
println
(
"单元中心里程="
+
centerMileage
);
for
(
RailInspectionEquipmentItem
checkItem
:
checkItemList
)
{
// 1.2 处理检查项目是公里的情况
BigDecimal
checkItemStartingMileage
=
checkItem
.
getCourseStartingMileage
().
multiply
(
new
BigDecimal
(
"1000"
));
checkItem
.
setCourseStartingMileage
(
checkItemStartingMileage
);
BigDecimal
checkItemEndMileage
=
checkItem
.
getCourseEndMileage
().
multiply
(
new
BigDecimal
(
"1000"
));
checkItem
.
setCourseEndMileage
(
checkItemEndMileage
);
if
(
checkItemStartingMileage
.
compareTo
(
checkItemEndMileage
)
>
0
)
{
checkItemStartingMileage
=
checkItem
.
getCourseEndMileage
();
checkItemEndMileage
=
checkItem
.
getCourseStartingMileage
();
}
BigDecimal
checkItemStartingMileage
=
checkItem
.
getCourseStartingMileage
();
BigDecimal
checkItemEndMileage
=
checkItem
.
getCourseEndMileage
();
System
.
out
.
printf
(
"检查项目[开始-结束]=["
+
centerMileage
+
"-"
+
checkItemEndMileage
+
"]"
);
// 2.2.1 命中检查项目
if
(
checkItemStartingMileage
.
compareTo
(
centerMileage
)
<=
0
&&
checkItemEndMileage
.
compareTo
(
centerMileage
)
>
0
)
{
...
...
@@ -1360,6 +1369,8 @@ public class AnalysisAlgorithm {
break
;
}
}
System
.
out
.
printf
(
"\n\r"
);
}
...
...
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