Authored by Lixiaodi

bug修改

... ... @@ -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);
... ...
... ... @@ -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 &gt;= 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"/>
... ...
... ... @@ -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) {
... ...