Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
4696b821
Commit
4696b821
authored
Dec 10, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
c2a189bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
29 deletions
+64
-29
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceCalibrationService.java
.../java/pps/core/space/service/SpaceCalibrationService.java
+20
-26
C11-space/pps-core-space/src/main/resources/mybatis/mapper/pps/core/space/SpaceCalibrationPeriodViewMapper.xml
...apper/pps/core/space/SpaceCalibrationPeriodViewMapper.xml
+44
-3
No files found.
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceCalibrationService.java
View file @
4696b821
...
...
@@ -62,10 +62,7 @@ public class SpaceCalibrationService {
@XApiPost
@XText
(
"校准周期--新增"
)
public
XServiceResult
createSpaceCalibrationPeriod
(
XContext
context
,
CreateSpaceCalibrationPeriodInput
input
)
{
PpsUserSession
session
=
context
.
getSession
(
PpsUserSession
.
class
);
SpaceCalibrationPeriodMapper
mapper
=
context
.
getBean
(
SpaceCalibrationPeriodMapper
.
class
);
SpaceCalibrationPeriodEnt
periodEnt
=
this
.
getPeriodEntByParam
(
mapper
,
input
.
getLineId
(),
input
.
getOuId
());
if
(
ObjectUtil
.
isNotNull
(
periodEnt
))
{
if
(
ObjectUtil
.
isNotNull
(
this
.
getPeriodEntByParam
(
context
,
input
.
getLineId
(),
input
.
getOuId
())))
{
return
XServiceResult
.
error
(
context
,
BusinessError
.
LineExists
);
}
SpaceCalibrationPeriodEnt
entity
=
XCopyUtils
.
copyNewObject
(
input
,
SpaceCalibrationPeriodEnt
.
class
);
...
...
@@ -73,14 +70,14 @@ public class SpaceCalibrationService {
String
lineId
=
entity
.
getLineId
();
//取当前时间
DateTime
date
=
DateUtil
.
date
();
String
sameDay
=
date
.
toString
(
BusinessConstant
.
DATE_FORMAT_DAY
);
DateTime
beginOfDay
=
DateUtil
.
beginOfDay
(
date
);
SpaceInstitutionDetailMapper
detailMapper
=
context
.
getBean
(
SpaceInstitutionDetailMapper
.
class
);
List
<
SpaceInstitutionDetailEnt
>
detailEntList
=
detailMapper
.
selectList
(
new
LambdaQueryWrapper
<
SpaceInstitutionDetailEnt
>()
.
eq
(
BaseModel:
:
getIsDeleted
,
BusinessConstant
.
ONE
)
.
eq
(
SpaceInstitutionDetailEnt:
:
getIsCurrentBasic
,
BusinessConstant
.
ZERO
)
.
eq
(
SpaceInstitutionDetailEnt:
:
getLineId
,
lineId
)
.
le
(
SpaceInstitutionDetailEnt:
:
getInstitutionStartDate
,
same
Day
)
.
ge
(
SpaceInstitutionDetailEnt:
:
getInstitutionEndDate
,
same
Day
)
.
le
(
SpaceInstitutionDetailEnt:
:
getInstitutionStartDate
,
beginOf
Day
)
.
ge
(
SpaceInstitutionDetailEnt:
:
getInstitutionEndDate
,
beginOf
Day
)
);
List
<
SpaceCalibrationHistoryView
>
historyViewList
=
new
ArrayList
<>(
8
);
if
(
CollUtil
.
isNotEmpty
(
detailEntList
))
{
...
...
@@ -90,8 +87,8 @@ public class SpaceCalibrationService {
}
}
return
XTransactionHelper
.
begin
(
context
,
()
->
{
BaseUtils
.
setBaseModelDefault
(
entity
,
session
);
mapper
.
insert
(
entity
);
BaseUtils
.
setBaseModelDefault
(
entity
,
context
.
getSession
(
PpsUserSession
.
class
)
);
context
.
getBean
(
SpaceCalibrationPeriodMapper
.
class
)
.
insert
(
entity
);
SpaceCalibrationHistoryViewMapper
historyViewMapper
=
context
.
getBean
(
SpaceCalibrationHistoryViewMapper
.
class
);
if
(
CollUtil
.
isNotEmpty
(
historyViewList
))
{
historyViewMapper
.
batchInsertList
(
historyViewList
);
...
...
@@ -139,11 +136,10 @@ public class SpaceCalibrationService {
public
XSingleResult
<
GetSpaceCalibrationPeriodViewOutput
>
getSpaceCalibrationPeriodView
(
XContext
context
,
GetSpaceCalibrationPeriodViewInput
input
)
{
String
lineId
=
input
.
getLineId
();
String
ouId
=
input
.
getOuId
();
SpaceCalibrationPeriodMapper
mapper
=
context
.
getBean
(
SpaceCalibrationPeriodMapper
.
class
);
SpaceCalibrationPeriodEnt
entity
=
this
.
getPeriodEntByParam
(
mapper
,
lineId
,
ouId
);
SpaceCalibrationPeriodView
view
=
this
.
getPeriodEntByParam
(
context
,
lineId
,
ouId
);
GetSpaceCalibrationPeriodViewOutput
output
=
new
GetSpaceCalibrationPeriodViewOutput
();
if
(
ObjectUtil
.
isNotNull
(
entity
))
{
XCopyUtils
.
copyObject
(
entity
,
output
);
if
(
ObjectUtil
.
isNotNull
(
view
))
{
XCopyUtils
.
copyObject
(
view
,
output
);
}
output
.
setLineName
(
ServiceUtil
.
getPowerLineNameById
(
context
,
lineId
)
...
...
@@ -318,20 +314,18 @@ public class SpaceCalibrationService {
/**
* 通过参数获取周期
*
* @param
mapper 映射器
* @param lineId 线路id
* @param ouId
ou-
id
* @return {@link SpaceCalibrationPeriod
Ent
}
* @param
context 上下文
* @param lineId
线路id
* @param ouId
你
id
* @return {@link SpaceCalibrationPeriod
View
}
*/
private
SpaceCalibrationPeriodEnt
getPeriodEntByParam
(
SpaceCalibrationPeriodMapper
mapper
,
String
lineId
,
String
ouId
)
{
return
mapper
.
selectOne
(
new
LambdaQueryWrapper
<
SpaceCalibrationPeriodEnt
>()
.
eq
(
BaseModel:
:
getIsDeleted
,
BusinessConstant
.
ONE
)
.
eq
(
SpaceCalibrationPeriodEnt:
:
getLineId
,
lineId
)
.
eq
(
SpaceCalibrationPeriodEnt:
:
getOuId
,
ouId
)
.
orderByDesc
(
BaseModel:
:
getModifyTime
)
.
last
(
BaseUtils
.
getLastLimit
())
);
private
SpaceCalibrationPeriodView
getPeriodEntByParam
(
XContext
context
,
String
lineId
,
String
ouId
)
{
SpaceCalibrationPeriodViewMapper
mapper
=
context
.
getBean
(
SpaceCalibrationPeriodViewMapper
.
class
);
SpaceCalibrationPeriodView
view
=
new
SpaceCalibrationPeriodView
();
view
.
setIsDeleted
(
BusinessConstant
.
ONE
);
view
.
setLineId
(
lineId
);
view
.
setOuId
(
ouId
);
return
mapper
.
selectOne
(
view
);
}
/**
...
...
C11-space/pps-core-space/src/main/resources/mybatis/mapper/pps/core/space/SpaceCalibrationPeriodViewMapper.xml
View file @
4696b821
...
...
@@ -30,12 +30,53 @@
DAY_NUMBER
</sql>
<select
id=
"selectOne"
parameterType=
"pps.core.space.entity.SpaceCalibrationPeriodView"
resultMap=
"BaseResultMap"
>
<select
id=
"selectOne"
parameterType=
"pps.core.space.entity.SpaceCalibrationPeriodView"
resultMap=
"BaseResultMap"
databaseId=
"MySQL"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM SPACE_CALIBRATION_PERIOD
WHERE
ID=#{id}
<where>
<if
test=
"isDeleted != null"
>
AND IS_DELETED = #{isDeleted}
</if>
<if
test=
"lineId != null and lineId != ''"
>
AND LINE_ID = #{lineId}
</if>
<if
test=
"ouId != null and ouId != ''"
>
AND OU_ID = #{ouId}
</if>
<if
test=
"id != null and id != ''"
>
AND ID = #{id}
</if>
</where>
ORDER BY
MODIFY_TIME DESC
LIMIT 1
</select>
<select
id=
"selectOne"
parameterType=
"pps.core.space.entity.SpaceCalibrationPeriodView"
resultMap=
"BaseResultMap"
databaseId=
"Oracle"
>
SELECT * FROM (
SELECT
<include
refid=
"Base_Column_List"
/>
FROM SPACE_CALIBRATION_PERIOD
<where>
<if
test=
"isDeleted != null"
>
AND IS_DELETED = #{isDeleted}
</if>
<if
test=
"lineId != null and lineId != ''"
>
AND LINE_ID = #{lineId}
</if>
<if
test=
"ouId != null and ouId != ''"
>
AND OU_ID = #{ouId}
</if>
<if
test=
"id != null and id != ''"
>
AND ID = #{id}
</if>
</where>
ORDER BY
MODIFY_TIME DESC
) WHERE ROWNUM = 1
</select>
<select
id=
"selectList"
parameterType=
"pps.core.space.entity.SpaceCalibrationPeriodView"
resultMap=
"BaseResultMap"
>
...
...
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