Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
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
西魏
cms_sys
Commits
d651a166
Commit
d651a166
authored
Nov 21, 2020
by
xierz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类字段为空注解和字段类型更改
parent
fcd1ac1e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
32 deletions
+21
-32
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+4
-4
ICategoryDao.xml
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
+1
-10
CategoryEntity.java
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
+9
-11
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+7
-7
No files found.
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
d651a166
...
...
@@ -252,17 +252,17 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
categoryParentId
+=
','
+
articleIdList
.
get
(
artId
).
getCategoryParentId
();
}
// 文章的栏目模型编号
String
columnContentModelId
=
articleIdList
.
get
(
artId
).
getMdiyModelId
();
Integer
columnContentModelId
=
articleIdList
.
get
(
artId
).
getMdiyModelId
();
Map
<
String
,
Object
>
parserParams
=
new
HashMap
<
String
,
Object
>();
parserParams
.
put
(
ParserUtil
.
COLUMN
,
articleIdList
.
get
(
artId
));
// 判断当前栏目是否有自定义模型
if
(
StringUtils
.
isNotBlank
(
columnContentModelId
)
&&
Integer
.
parseInt
(
columnContentModelId
)>
0
)
{
if
(
columnContentModelId
!=
null
&&
columnContentModelId
>
0
)
{
// 通过当前栏目的模型编号获取,自定义模型表名
if
(
contentModelMap
.
containsKey
(
columnContentModelId
))
{
parserParams
.
put
(
ParserUtil
.
TABLE_NAME
,
contentModel
.
getModelTableName
());
}
else
{
// 通过栏目模型编号获取自定义模型实体
contentModel
=(
ModelEntity
)
modelBiz
.
getEntity
(
Integer
.
parseInt
(
columnContentModelId
)
);
contentModel
=(
ModelEntity
)
modelBiz
.
getEntity
(
columnContentModelId
);
// 将自定义模型编号设置为key值
contentModelMap
.
put
(
columnContentModelId
,
contentModel
.
getModelTableName
());
parserParams
.
put
(
ParserUtil
.
TABLE_NAME
,
contentModel
.
getModelTableName
());
...
...
@@ -330,7 +330,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
column
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
typeId
+
""
));
// 获取表单类型的id
if
(
column
!=
null
&&
ObjectUtil
.
isNotNull
(
column
.
getMdiyModelId
()))
{
contentModel
=
(
ModelEntity
)
modelBiz
.
getEntity
(
Integer
.
parseInt
(
column
.
getMdiyModelId
()
));
contentModel
=
(
ModelEntity
)
modelBiz
.
getEntity
(
column
.
getMdiyModelId
(
));
if
(
contentModel
!=
null
)
{
Map
<
String
,
String
>
fieldMap
=
contentModel
.
getFieldMap
();
for
(
String
s
:
fieldMap
.
keySet
())
{
...
...
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
View file @
d651a166
...
...
@@ -146,15 +146,6 @@
</where>
limit 0,1
</select>
<sql
id=
"queryWhereCategoryId"
databaseId=
"mysql"
>
find_in_set('${id}',CATEGORY_PARENT_ID)
</sql>
<sql
id=
"queryWhereCategoryId"
databaseId=
"oracle"
>
instr(','||'${id}'||',', ','||CATEGORY_PARENT_ID||',')>0
</sql>
<sql
id=
"queryWhereCategoryId"
databaseId=
"sqlServer"
>
CHARINDEX(','+'${id}'+',' , ','+CATEGORY_PARENT_ID +',')>0
</sql>
<!-- 模糊查询开始 -->
<select
id=
"queryChildren"
resultMap=
"resultMap"
>
...
...
@@ -170,7 +161,7 @@
find_in_set(#{categoryParentId},CATEGORY_PARENT_ID)
</if>
<if
test=
"categoryParentId == null or categoryParentId ==''"
>
<include
refid=
"queryWhereCategoryId"
></include>
find_in_set('${id}',CATEGORY_PARENT_ID)
</if>
<if
test=
"id != null"
>
or id=#{id}
...
...
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
View file @
d651a166
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.FieldStrategy
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
...
@@ -34,6 +35,7 @@ private static final long serialVersionUID = 1574925152750L;
/**
* 所属栏目
*/
@TableField
(
insertStrategy
=
FieldStrategy
.
NOT_EMPTY
,
updateStrategy
=
FieldStrategy
.
NOT_EMPTY
,
whereStrategy
=
FieldStrategy
.
NOT_EMPTY
)
private
String
categoryId
;
/**
* 栏目管理属性
...
...
@@ -70,7 +72,7 @@ private static final long serialVersionUID = 1574925152750L;
/**
* 栏目管理的内容模型id
*/
private
String
mdiyModelId
;
private
Integer
mdiyModelId
;
/**
* 类别发布时间
*/
...
...
@@ -260,19 +262,15 @@ private static final long serialVersionUID = 1574925152750L;
public
String
getCategoryDiyUrl
()
{
return
this
.
categoryDiyUrl
;
}
/**
* 设置栏目管理的内容模型id
*/
public
void
setMdiyModelId
(
String
mdiyModelId
)
{
this
.
mdiyModelId
=
mdiyModelId
;
public
Integer
getMdiyModelId
()
{
return
mdiyModelId
;
}
/**
* 获取栏目管理的内容模型id
*/
public
String
getMdiyModelId
()
{
return
this
.
mdiyModelId
;
public
void
setMdiyModelId
(
Integer
mdiyModelId
)
{
this
.
mdiyModelId
=
mdiyModelId
;
}
/**
* 设置类别发布时间
*/
...
...
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
d651a166
...
...
@@ -72,7 +72,7 @@ public class CmsParserUtil extends ParserUtil {
throws
TemplateNotFoundException
,
MalformedTemplateNameException
,
ParseException
,
IOException
{
try
{
// 文章的栏目模型编号
String
columnContentModelId
=
column
.
getMdiyModelId
();
Integer
columnContentModelId
=
column
.
getMdiyModelId
();
PageBean
page
=
new
PageBean
();
page
.
setSize
(
10
);
//获取分页数量
...
...
@@ -83,9 +83,9 @@ public class CmsParserUtil extends ParserUtil {
String
columnListPath
;
ModelEntity
contentModel
=
null
;
// 判断当前栏目是否有自定义模型
if
(
StringUtils
.
isNotBlank
(
columnContentModelId
)
)
{
if
(
columnContentModelId
!=
null
)
{
// 通过栏目模型编号获取自定义模型实体
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
ModelBizImpl
.
class
).
getEntity
(
Integer
.
parseInt
(
columnContentModelId
)
);
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
ModelBizImpl
.
class
).
getEntity
(
columnContentModelId
);
}
int
pageNo
=
1
;
...
...
@@ -181,8 +181,8 @@ public class CmsParserUtil extends ParserUtil {
// 文章的模板路径
String
columnUrl
=
articleIdList
.
get
(
artId
).
getCategoryUrl
();
// 文章的栏目模型编号
String
columnContentModelId
=
""
;
if
(
StringUtils
.
isNotBlank
(
articleIdList
.
get
(
artId
).
getMdiyModelId
())
&&
Integer
.
parseInt
(
articleIdList
.
get
(
artId
).
getMdiyModelId
())>
0
){
Integer
columnContentModelId
=
null
;
if
(
articleIdList
.
get
(
artId
).
getMdiyModelId
()
!=
null
&&
articleIdList
.
get
(
artId
).
getMdiyModelId
()
>
0
){
columnContentModelId
=
articleIdList
.
get
(
artId
).
getMdiyModelId
();
}
// 文章是否已经生成了,生成了就跳过
...
...
@@ -208,14 +208,14 @@ public class CmsParserUtil extends ParserUtil {
Map
<
String
,
Object
>
parserParams
=
new
HashMap
<
String
,
Object
>();
parserParams
.
put
(
ParserUtil
.
COLUMN
,
articleIdList
.
get
(
artId
));
// 判断当前栏目是否有自定义模型
if
(
StringUtils
.
isNotBlank
(
columnContentModelId
)
)
{
if
(
columnContentModelId
!=
null
)
{
// 通过当前栏目的模型编号获取,自定义模型表名
if
(
contentModelMap
.
containsKey
(
columnContentModelId
))
{
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
getModelTableName
());
}
else
{
// 通过栏目模型编号获取自定义模型实体
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
IModelBiz
.
class
)
.
getEntity
(
Integer
.
parseInt
(
columnContentModelId
)
);
.
getEntity
(
columnContentModelId
);
// 将自定义模型编号设置为key值
contentModelMap
.
put
(
columnContentModelId
,
contentModel
.
getModelTableName
());
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
getModelTableName
());
...
...
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