Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zcq
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zcq
Commits
173184c7
提交
173184c7
authored
7月 24, 2019
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
1c244f2f
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
115 行增加
和
16 行删除
+115
-16
SalesWayEnum.java
....core/src/main/java/com/zrqx/core/enums/SalesWayEnum.java
+84
-0
SaveUpdateArticleLibraryForm.java
...ource/bg/articlelibrary/SaveUpdateArticleLibraryForm.java
+0
-1
ArticleLibraryController.java
...g/controller/articlelibrary/ArticleLibraryController.java
+20
-1
ArticleLibraryMapper.java
...source/bg/mapper/articlelibrary/ArticleLibraryMapper.java
+7
-12
ArticleLibrarySerivceImpl.java
.../bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
+4
-2
没有找到文件。
com.zrqx.core/src/main/java/com/zrqx/core/enums/SalesWayEnum.java
0 → 100644
浏览文件 @
173184c7
package
com
.
zrqx
.
core
.
enums
;
import
java.util.HashMap
;
import
org.apache.commons.lang3.StringUtils
;
/**
* 销售方式 0 内容公开 1普通会员免费 2VIP会员免费 3购买单品4:不可售
* @author ycw
* @date 2019年3月15日上午9:23:49
*/
public
enum
SalesWayEnum
{
/** 0:会员可见*/
STATUS_0
(
0
,
"内容公开"
),
/** 1:普通会员免费*/
STATUS_1
(
1
,
"普通会员免费"
),
/** 2:VIP会员免费*/
STATUS_2
(
2
,
"VIP会员免费"
),
/** 3:购买单品*/
STATUS_3
(
3
,
"购买单品"
),
/** 4:不可售*/
STATUS_4
(
4
,
"不可售"
);
private
final
Integer
code
;
private
final
String
name
;
private
SalesWayEnum
(
Integer
code
,
String
name
){
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
SalesWayEnum
valueOfCode
(
String
code
)
{
if
(
StringUtils
.
isBlank
(
code
))
{
throw
new
IllegalArgumentException
(
"Library Status "
+
code
+
" is blank"
);
}
for
(
SalesWayEnum
mt
:
values
())
{
if
(
mt
.
getCode
().
toString
().
equals
(
code
))
{
return
mt
;
}
}
throw
new
IllegalArgumentException
(
"Library Status "
+
code
+
" is not exist"
);
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public
static
String
getName
(
Integer
code
)
{
if
(
code
==
null
)
{
return
null
;
}
for
(
SalesWayEnum
mt
:
values
())
{
if
(
mt
.
getCode
().
equals
(
code
))
{
return
mt
.
getName
();
}
}
return
null
;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public
static
HashMap
<
String
,
String
>
getAllEnumMap
()
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
for
(
SalesWayEnum
mt
:
values
())
{
map
.
put
(
mt
.
getCode
()+
""
,
mt
.
getName
());
}
return
map
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/articlelibrary/SaveUpdateArticleLibraryForm.java
浏览文件 @
173184c7
...
...
@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import
java.util.List
;
import
com.zrqx.core.model.resource.articlelibrary.ArticleLibraryDiyType
;
import
com.zrqx.core.model.resource.articlelibrary.ArticleLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/articlelibrary/ArticleLibraryController.java
浏览文件 @
173184c7
...
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -51,6 +52,7 @@ import com.zrqx.resource.bg.service.articlelibrary.ArticleLibraryService;
import
com.zrqx.resource.bg.service.articlelibrary.ArticleResourceService
;
import
com.zrqx.resource.bg.service.audiolibrary.AudioLibraryService
;
import
com.zrqx.resource.bg.service.pdffilelibrary.PdfLibraryService
;
import
com.zrqx.resource.bg.service.recommend.RecommendResourceService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryService
;
/**
...
...
@@ -71,7 +73,9 @@ public class ArticleLibraryController {
private
ResourceRelationService
resourceRelationService
;
@Autowired
private
ArticleLibraryLabelContentDiyTypeService
alcdService
;
/** 推荐位内容*/
@Autowired
private
RecommendResourceService
recommendResourceService
;
@Autowired
private
AudioLibraryService
audioLibraryService
;
...
...
@@ -158,6 +162,21 @@ public class ArticleLibraryController {
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
ResourceRequestPath
.
DELETE_OID
)
public
CallBack
<
Boolean
>
delete
(
@PathVariable
String
oid
)
{
ArticleLibrary
entity
=
service
.
selectByPrimaryKey
(
oid
);
if
(
entity
.
getBookId
()
!=
null
)
{
throw
new
BusinessValidateException
(
"图书内拆分出来的文章不支持单独上、下架、删除操作"
);
}
if
(
entity
.
getStatus
()
==
LibraryStatusEnum
.
STATUS_1
.
getCode
())
{
throw
new
BusinessValidateException
(
"不能删除已上架的资源"
);
}
//这里需要级联删除其他接口关联资源
//----推荐位内容
recommendResourceService
.
delectByResourceIds
(
Arrays
.
asList
(
oid
),
entity
.
getResourceType
());
return
CallBack
.
success
(
service
.
deleteByPrimaryKey
(
oid
));
}
@ApiOperation
(
value
=
"批量删除"
,
notes
=
"批量删除"
)
@PostMapping
(
value
=
ResourceRequestPath
.
BATCH
+
ResourceRequestPath
.
DELETE
)
public
CallBack
<
Boolean
>
deleteByIds
(
@RequestBody
List
<
String
>
ids
)
{
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/articlelibrary/ArticleLibraryMapper.java
浏览文件 @
173184c7
...
...
@@ -32,6 +32,9 @@ public interface ArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
+
"on a.id = ad.alid "
+
"where 1=1 and a.isDelete = 1 "
+
"</if>"
+
"<if test='form.resourceType != null' >"
+
"and a.resourceType = #{form.resourceType} "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'>"
+
"and ad.code like concat(#{form.diyTypeCode},'%') "
+
"</if>"
...
...
@@ -41,22 +44,14 @@ public interface ArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
+
"#{id}"
+
"</foreach>"
+
"</if>"
+
"<if test = 'form.option!=null'>"
+
"<if test='form.option==1'>"
+
"<if test = '"
+
NOTBLANK
+
"(form.title)'>"
+
" and a.title like concat('%',#{form.title},'%') "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.name)'>"
+
"and a.name like concat('%',#{form.name},'%') "
+
"</if>"
+
"<if test='form.option==2'>"
+
"<if test = '"
+
NOTBLANK
+
"(form.author)'>"
+
" and a.author like concat('%',#{form.author},'%') "
+
"</if>"
+
"and a.author like concat('%',#{form.author},'%') "
+
"</if>"
+
"<if test='form.option==3'>"
+
"<if test = '"
+
NOTBLANK
+
"(form.source)'>"
+
" and a.source like concat('%',#{form.source},'%') "
+
"</if>"
+
"</if>"
+
"and ( a.source like concat('%',#{form.source},'%') or a.bookName like concat('%',#{form.source},'%') ) "
+
"</if>"
+
"<if test='form.status != null'>"
+
"and a.status = #{form.status}"
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
浏览文件 @
173184c7
...
...
@@ -8,11 +8,11 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
com.zrqx.core.enums.ArticleTypeEnum
;
import
com.zrqx.core.enums.AuditStatusEnum
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.enums.resource.SalesWayEnum
;
import
com.zrqx.core.exception.BusinessValidateException
;
import
com.zrqx.core.exception.ParameterValidateException
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
...
...
@@ -36,6 +36,8 @@ import com.zrqx.resource.bg.mapper.audiolibrary.AudioLibraryMapper;
import
com.zrqx.resource.bg.mapper.pdffilelibrary.PdfLibraryMapper
;
import
com.zrqx.resource.bg.mapper.videolibrary.VideoLibraryMapper
;
import
tk.mybatis.mapper.entity.Example
;
/**
* 文章库
*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论