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
5f2bd8be
Commit
5f2bd8be
authored
Jun 25, 2023
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.代码提交
parent
6069faab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
TrainStationMapper.java
...eecg/modules/subwayNetwork/mapper/TrainStationMapper.java
+1
-0
SubwaySectionServiceImpl.java
.../subwayNetwork/service/impl/SubwaySectionServiceImpl.java
+1
-1
TrainStationServiceImpl.java
...s/subwayNetwork/service/impl/TrainStationServiceImpl.java
+23
-10
No files found.
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/mapper/TrainStationMapper.java
View file @
5f2bd8be
...
...
@@ -16,4 +16,5 @@ import org.jeecg.modules.subwayNetwork.vo.TrainStationVO;
public
interface
TrainStationMapper
extends
BaseMapper
<
TrainStation
>
{
IPage
<
TrainStationVO
>
queryPageList
(
IPage
<
LightRailQueryVO
>
page
,
TrainStationQueryDTO
query
);
}
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/service/impl/SubwaySectionServiceImpl.java
View file @
5f2bd8be
...
...
@@ -60,7 +60,7 @@ public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, S
// 车站数量
int
trainStationNum
=
endTrainStation
.
getSeq
()
-
startTrainStation
.
getSeq
();
int
trainStationNum
=
endTrainStation
.
getSeq
()
-
startTrainStation
.
getSeq
()
+
1
;
record
.
setTrainStationNum
(
trainStationNum
);
}
...
...
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/subwayNetwork/service/impl/TrainStationServiceImpl.java
View file @
5f2bd8be
...
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @Description: 线路车站-地铁站
...
...
@@ -36,26 +37,38 @@ public class TrainStationServiceImpl extends ServiceImpl<TrainStationMapper, Tra
@Override
public
void
edit
(
TrainStationEditDTO
dto
)
{
// 1.计算当前线路下面有多少个站台
Long
count
=
this
.
lambdaQuery
()
.
eq
(
TrainStation:
:
getLightRailId
,
dto
.
getLightRailId
())
.
count
();
// 2.计算站长度:终点里程-起始里程
// 1.计算站长度:终点里程-起始里程
BigDecimal
length
=
dto
.
getEndMileage
().
subtract
(
dto
.
getStartingMileage
());
// 3.通过id判断是保存还是修改
// 2.通过id判断是保存还是修改
if
(
ObjectUtil
.
isEmpty
(
dto
.
getId
()))
{
//
Integer
seq
=
1
;
TrainStation
exist
=
this
.
lambdaQuery
().
eq
(
TrainStation:
:
getLightRailId
,
dto
.
getLightRailId
())
.
eq
(
TrainStation:
:
getStationName
,
dto
.
getStationName
())
.
last
(
"limit 1"
)
.
one
();
if
(
ObjectUtil
.
isEmpty
(
exist
))
{
List
<
TrainStation
>
list
=
this
.
lambdaQuery
()
.
eq
(
TrainStation:
:
getLightRailId
,
dto
.
getLightRailId
())
.
groupBy
(
TrainStation:
:
getStationName
)
.
list
();
seq
=
list
.
size
()
+
1
;
}
else
{
seq
=
exist
.
getSeq
();
}
TrainStation
trainStation
=
BeanUtil
.
copyProperties
(
dto
,
TrainStation
.
class
);
trainStation
.
setLength
(
length
);
trainStation
.
setSeq
(
count
.
intValue
()
+
1
);
trainStation
.
setSeq
(
seq
);
this
.
save
(
trainStation
);
}
else
{
TrainStation
trainStation
=
BeanUtil
.
copyProperties
(
dto
,
TrainStation
.
class
);
trainStation
.
setLength
(
length
);
trainStation
.
setSeq
(
count
.
intValue
()
+
1
);
this
.
updateById
(
trainStation
);
}
}
}
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