Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Lixiaodi
5 years ago
Commit
0fbd1eaee9945b0f0220543eacae8b3a5a1442e9
1 parent
d2531ff9
bug修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
dal/src/main/java/com/yoho/ufo/dal/ResourcesMapper.java
dal/src/main/resources/META-INF/mybatis/ResourcesMapper.xml
resource/src/main/java/com/yoho/ufo/resource/service/impl/ResourceServiceImpl.java
dal/src/main/java/com/yoho/ufo/dal/ResourcesMapper.java
View file @
0fbd1ea
...
...
@@ -15,6 +15,8 @@ public interface ResourcesMapper {
Resources
selectById
(
@Param
(
"id"
)
Integer
id
);
Resources
selectDefaultByCode
(
String
code
);
Resources
selectActiveByCode
(
String
code
);
int
insert
(
Resources
record
);
int
updateByPrimaryKeySelective
(
Resources
record
);
...
...
dal/src/main/resources/META-INF/mybatis/ResourcesMapper.xml
View file @
0fbd1ea
...
...
@@ -31,6 +31,12 @@
limit 1
</select>
<select
id=
"selectActiveByCode"
resultType=
"com.yoho.ufo.model.resource.Resources"
>
select
<include
refid=
"Base_Column_List"
/>
from resources
where status=1 and code = #{code} and publish_time
>
= unix_timestamp() order by publish_time,id
limit 1
</select>
<select
id=
"selectResourcesByPage"
resultType=
"com.yoho.ufo.model.resource.Resources"
>
select
<include
refid=
"Base_Column_List"
/>
from resources
<include
refid=
"pageCondition"
/>
...
...
resource/src/main/java/com/yoho/ufo/resource/service/impl/ResourceServiceImpl.java
View file @
0fbd1ea
...
...
@@ -226,6 +226,11 @@ public class ResourceServiceImpl implements IResourceService{
if
(
thisResource
==
null
)
{
throw
new
PlatformException
(
"源资源位不存在"
,
500
);
}
Resources
active
=
resourcesMapper
.
selectActiveByCode
(
thisResource
.
getCode
());
if
(
active
.
getId
().
equals
(
bo
.
getId
()))
{
throw
new
PlatformException
(
"正在生效的资源位不能修改"
,
500
);
}
}
// 更新时间
if
(
bo
.
getId
()
!=
null
&&
StringUtils
.
isNotBlank
(
bo
.
getPublishTimeStr
())
&&
bo
.
getCopyFromId
()
==
null
)
{
...
...
Please
register
or
login
to post a comment