Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
8570ff18
Commit
8570ff18
authored
Dec 30, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,代码调整
parent
67d69f24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
IRiskSourceDao.java
...join/amos/fas/business/dao/repository/IRiskSourceDao.java
+1
-2
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+8
-11
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+10
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IRiskSourceDao.java
View file @
8570ff18
...
@@ -24,7 +24,6 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
...
@@ -24,7 +24,6 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
Optional
<
RiskSource
>
findById
(
Long
id
);
Optional
<
RiskSource
>
findById
(
Long
id
);
/**
/**
* 获取厂区下所有区域的rpn值
* 获取厂区下所有区域的rpn值
*
*
...
@@ -41,5 +40,5 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
...
@@ -41,5 +40,5 @@ public interface IRiskSourceDao extends BaseDao<RiskSource, Long> {
Optional
<
RiskSource
>
findByCode
(
String
riskSourceCode
);
Optional
<
RiskSource
>
findByCode
(
String
riskSourceCode
);
List
<
RiskSource
>
findBySourceId
(
Long
instanceId
);
Optional
<
RiskSource
>
findBySourceId
(
Long
instanceId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
8570ff18
...
@@ -329,16 +329,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -329,16 +329,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
list
.
forEach
(
r
->{
list
.
forEach
(
r
->{
r
.
setOrgCode
(
compCode
);
r
.
setOrgCode
(
compCode
);
r
.
setIsRegion
(
RiskSourceRegionEum
.
TRUE
.
getCode
());
r
.
setIsRegion
(
RiskSourceRegionEum
.
TRUE
.
getCode
());
//TODO 注意:id使用了调用接口方的id,这样代码修改量较小
Optional
<
RiskSource
>
op
=
iRiskSourceDao
.
findBySourceId
(
r
.
getId
());
Optional
<
RiskSource
>
op
=
iRiskSourceDao
.
findById
(
r
.
getId
());
if
(
op
.
isPresent
()){
if
(
op
.
isPresent
()){
//有就更新,业务只能调整上级
//有就更新,业务只能调整上级
RiskSource
riskSource
=
op
.
get
();
RiskSource
riskSource
=
op
.
get
();
riskSource
.
setParentId
(
r
.
getParentId
());
riskSource
.
setParentId
(
r
.
getParentId
());
entrys
.
add
(
riskSource
);
entrys
.
add
(
riskSource
);
}
else
{
}
else
{
//无则插入
//无则插入,TODO 注意:id使用了调用接口方的id,这样代码修改量较小
//TODO 注意:id使用了调用接口方的id,这样代码修改量较小
r
.
setCreateDate
(
new
Date
());
r
.
setCreateDate
(
new
Date
());
r
.
setIsIndoor
(
Boolean
.
FALSE
);
r
.
setIsIndoor
(
Boolean
.
FALSE
);
r
.
setSourceId
(
r
.
getId
());
r
.
setSourceId
(
r
.
getId
());
...
@@ -351,14 +349,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -351,14 +349,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Override
public
Boolean
removeBind
(
Long
instanceId
)
{
public
Boolean
removeBind
(
Long
instanceId
)
{
List
<
RiskSource
>
exists
=
iRiskSourceDao
.
findBySourceId
(
instanceId
);
Optional
<
RiskSource
>
exist
=
iRiskSourceDao
.
findBySourceId
(
instanceId
);
if
(!
CollectionUtils
.
isEmpty
(
exists
)){
if
(
exist
.
isPresent
()){
exists
.
forEach
(
e
->{
RiskSource
riskSource
=
exist
.
get
();
e
.
setSourceId
(
null
);
riskSource
.
setSourceId
(
null
);
});
iRiskSourceDao
.
save
(
riskSource
);
exists
=
iRiskSourceDao
.
saveAll
(
exists
);
}
}
return
!
CollectionUtils
.
isEmpty
(
exists
);
return
exist
.
isPresent
(
);
}
}
/**
/**
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
8570ff18
...
@@ -598,4 +598,13 @@
...
@@ -598,4 +598,13 @@
alter table `f_risk_source` add column `source_id` bigint(20) DEFAULT NULL AFTER `status`;
alter table `f_risk_source` add column `source_id` bigint(20) DEFAULT NULL AFTER `status`;
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"shg"
id=
"1609226808866-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"f_risk_source"
columnName=
"source_id"
/>
</preConditions>
<comment>
f_risk_source add UNIQUE source_id
</comment>
<sql>
ALTER TABLE `f_risk_source` ADD UNIQUE unique_idx_source_id(source_id);
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
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