Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
rszt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
rszt
Commits
1b304b90
提交
1b304b90
authored
12月 14, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
21d117f8
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
45 行删除
+6
-45
ImageLibraryController.java
...ce/bg/controller/imagelibrary/ImageLibraryController.java
+3
-16
ImageLibraryMapper.java
...x/resource/bg/mapper/imagelibrary/ImageLibraryMapper.java
+3
-28
ImageLibrarySerivceImpl.java
...urce/bg/service/imagelibrary/ImageLibrarySerivceImpl.java
+0
-1
没有找到文件。
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/imagelibrary/ImageLibraryController.java
浏览文件 @
1b304b90
package
com
.
zrqx
.
resource
.
bg
.
controller
.
imagelibrary
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -18,29 +16,21 @@ import org.springframework.web.bind.annotation.RestController;
import
com.zrqx.core.constant.resource.ResourceRequestPath
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.exception.BusinessValidateException
;
import
com.zrqx.core.exception.ParameterValidateException
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
import
com.zrqx.core.form.resource.bg.QueryResourceRelationForm
;
import
com.zrqx.core.form.resource.bg.SaveResourceRelationForm
;
import
com.zrqx.core.form.resource.bg.ebook.UpdateEbookRelationForm
;
import
com.zrqx.core.form.resource.bg.imagelibrary.BatchUpdateImageLibraryForm
;
import
com.zrqx.core.form.resource.bg.imagelibrary.QueryImageLibraryForm
;
import
com.zrqx.core.form.resource.bg.imagelibrary.SaveImageLibraryForm
;
import
com.zrqx.core.form.resource.bg.imagelibrary.SaveUpdateImageLibraryForm
;
import
com.zrqx.core.model.resource.imagelibrary.ImageLibrary
;
import
com.zrqx.core.model.resource.imagelibrary.ImageLibraryDiyType
;
import
com.zrqx.core.model.resource.imagelibrary.ImageResource
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
import
com.zrqx.core.vo.resource.imagelibrary.ImageLibraryListVO
;
import
com.zrqx.core.vo.resource.imagelibrary.ImageLibraryOneVO
;
import
com.zrqx.resource.bg.service.ResourceRelationService
;
import
com.zrqx.resource.bg.service.imagelibrary.ImageLibraryDiyTypeRelationService
;
import
com.zrqx.resource.bg.service.imagelibrary.ImageLibraryDiyTypeService
;
import
com.zrqx.resource.bg.service.imagelibrary.ImageLibraryService
;
import
com.zrqx.resource.bg.service.imagelibrary.ImageResourceService
;
...
...
@@ -128,9 +118,6 @@ public class ImageLibraryController {
example
.
createCriteria
().
andIn
(
"id"
,
ids
);
List
<
ImageLibrary
>
list
=
service
.
selectByExample
(
example
);
for
(
ImageLibrary
entity
:
list
)
{
if
(
entity
.
getBookId
()
!=
null
){
throw
new
BusinessValidateException
(
"图书内拆分出来的图片不支持单独上、下架、删除操作"
);
}
if
(
entity
.
getStatus
()
==
LibraryStatusEnum
.
STATUS_1
.
getCode
())
{
throw
new
BusinessValidateException
(
"不能删除已上架的资源"
);
}
...
...
@@ -157,9 +144,9 @@ public class ImageLibraryController {
if
(
form
.
getId
()
==
null
)
{
throw
new
ParameterValidateException
(
"分类不能为空"
);
}
Image
Resource
resource
=
resourceS
ervice
.
selectByPrimaryKey
(
form
.
getId
());
resource
.
setSort
(
form
.
getSort
());
resourceService
.
updateByPrimaryKeySelective
(
resource
);
Image
Library
entity
=
s
ervice
.
selectByPrimaryKey
(
form
.
getId
());
entity
.
setSort
(
form
.
getSort
());
service
.
updateByPrimaryKeySelective
(
entity
);
return
CallBack
.
success
();
}
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/imagelibrary/ImageLibraryMapper.java
浏览文件 @
1b304b90
...
...
@@ -15,41 +15,16 @@ import com.zrqx.core.vo.resource.imagelibrary.ImageLibraryListVO;
*/
public
interface
ImageLibraryMapper
extends
BaseMapper
<
ImageLibrary
>
{
@Select
(
"<script>"
+
"select distinct a.id,a.name,a.bookName,a.source,a.realprice,a.image,DATE_FORMAT(a.uploadTime,'%Y-%m-%d') uploadTime,a.status "
+
"from res_Image_Library a left join res_Image_Library_Diy_Type ad "
+
"on a.id = ad.ilid "
+
"select distinct a.id,a.name,a.source,a.sort,a.image,DATE_FORMAT(a.uploadTime,'%Y-%m-%d') uploadTime,a.status "
+
"from res_Image_Library a "
+
"where 1=1 "
+
"<if test='form.nationsType != null '>"
+
"and a.nationsType = #{form.nationsType} "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'>"
+
"and ad.code like concat(#{form.diyTypeCode},'%') "
+
"</if>"
/*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>"
+ "and ad.dtid in "
+ " <foreach collection=\"form.diyTypeId\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>" */
+
"<if test = '"
+
NOTBLANK
+
"(form.name)'>"
+
" and a.name like concat('%',#{form.name},'%') "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.source)'>"
+
" and (a.source like concat('%',#{form.source},'%') or a.bookName like concat('%',#{form.source},'%') ) "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.bookName)'>"
+
"and a.bookName like concat('%',#{form.bookName},'%') "
+
"</if>"
+
"<if test='form.status != null'>"
+
"and a.status = #{form.status}"
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'>"
+
"and a.uploadTime >= concat(#{form.beginTime}, ' 00:00:00' )"
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.endTime)'>"
+
"and a.uploadTime <= concat(#{form.endTime}, ' 23:59:59')"
+
"</if>"
+
" order by a.uploadTime desc"
+
" order by a.sort,a.uploadTime desc"
+
"</script>"
)
List
<
ImageLibraryListVO
>
query
(
@Param
(
"form"
)
QueryImageLibraryForm
form
);
@Select
(
"<script>"
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/imagelibrary/ImageLibrarySerivceImpl.java
浏览文件 @
1b304b90
...
...
@@ -165,7 +165,6 @@ public class ImageLibrarySerivceImpl extends BaseServiceImpl<ImageLibrary,String
public
PageInfo
<
ImageLibraryListVO
>
page
(
QueryImageLibraryForm
form
,
PageParam
pageParam
)
{
startPage
(
pageParam
);
//暂不用自定义分类id 做in查询
form
.
setDiyTypeId
(
null
);
List
<
ImageLibraryListVO
>
list
=
mapper
.
query
(
form
);
return
new
PageInfo
<
ImageLibraryListVO
>(
list
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论