Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
New MineTRS_java
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
kiritoausna
New MineTRS_java
Commits
7ca60176
Commit
7ca60176
authored
Jul 09, 2025
by
ankh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
坡度比优化
parent
2f9eb135
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
DbData.java
...m/src/main/java/me/zhengjie/gemho/entity/data/DbData.java
+1
-1
DbDataServiceImpl.java
...e/zhengjie/gemho/service/data/impl/DbDataServiceImpl.java
+19
-0
pom.xml
pom.xml
+1
-0
No files found.
eladmin-system/src/main/java/me/zhengjie/gemho/entity/data/DbData.java
View file @
7ca60176
...
@@ -27,7 +27,7 @@ import java.util.List;
...
@@ -27,7 +27,7 @@ import java.util.List;
@ApiModel
(
value
=
"干滩"
)
@ApiModel
(
value
=
"干滩"
)
@Getter
@Getter
@Setter
@Setter
@TableName
(
"tb_
n
db_data"
)
@TableName
(
"tb_db_data"
)
public
class
DbData
implements
Serializable
{
public
class
DbData
implements
Serializable
{
public
static
final
long
serialVersionUID
=
1L
;
public
static
final
long
serialVersionUID
=
1L
;
...
...
eladmin-system/src/main/java/me/zhengjie/gemho/service/data/impl/DbDataServiceImpl.java
View file @
7ca60176
...
@@ -287,6 +287,24 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
...
@@ -287,6 +287,24 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
Page
<
DbData
>
dbDataPage
=
new
Page
<>(
page
+
1
,
size
);
Page
<
DbData
>
dbDataPage
=
new
Page
<>(
page
+
1
,
size
);
dbDataPage
=
dbDataMapper
.
selectPage
(
dbDataPage
,
dbDataQueryWrapper
);
dbDataPage
=
dbDataMapper
.
selectPage
(
dbDataPage
,
dbDataQueryWrapper
);
List
<
DbData
>
records
=
dbDataPage
.
getRecords
();
List
<
DbData
>
records
=
dbDataPage
.
getRecords
();
// 插入计算 lenth / safeheight * 1000 并 setAngle 的逻辑
for
(
DbData
record
:
records
)
{
if
(
record
.
getLenth
()
!=
null
&&
record
.
getSafeheight
()
!=
null
&&
!
record
.
getSafeheight
().
equals
(
"0"
))
{
try
{
double
lenthValue
=
Double
.
parseDouble
(
record
.
getLenth
());
double
safeheightValue
=
Double
.
parseDouble
(
record
.
getSafeheight
());
double
result
=
(
safeheightValue
/
lenthValue
)
*
1000
;
record
.
setAngle
(
String
.
format
(
"%.4f"
,
result
));
// 存入 angle 字段
}
catch
(
NumberFormatException
e
)
{
record
.
setAngle
(
null
);
}
}
else
{
record
.
setAngle
(
null
);
}
}
long
total
=
dbDataPage
.
getTotal
();
long
total
=
dbDataPage
.
getTotal
();
//获取编码-名字map
//获取编码-名字map
HashMap
<
String
,
String
>
noName
=
ServiceUtil
.
getNoName
(
request
);
HashMap
<
String
,
String
>
noName
=
ServiceUtil
.
getNoName
(
request
);
...
@@ -344,6 +362,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
...
@@ -344,6 +362,7 @@ public class DbDataServiceImpl extends ServiceImpl<DbDataMapper, DbData> impleme
record
.
setDanwei
(
noDan
.
get
(
record
.
getSensorid
()));
record
.
setDanwei
(
noDan
.
get
(
record
.
getSensorid
()));
}
}
}
}
map
.
put
(
"list"
,
records
);
map
.
put
(
"list"
,
records
);
map
.
put
(
"total"
,
total
);
map
.
put
(
"total"
,
total
);
return
map
;
return
map
;
...
...
pom.xml
View file @
7ca60176
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.6.7
</version>
<version>
2.6.7
</version>
<relativePath/>
</parent>
</parent>
<properties>
<properties>
...
...
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