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
42549f2e
Commit
42549f2e
authored
Aug 07, 2019
by
hcong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
栏目属性
parent
2e2dc065
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
14 deletions
+35
-14
ColumnAction.java
src/main/java/net/mingsoft/cms/action/ColumnAction.java
+35
-14
No files found.
src/main/java/net/mingsoft/cms/action/ColumnAction.java
View file @
42549f2e
...
@@ -9,6 +9,8 @@ import java.util.List;
...
@@ -9,6 +9,8 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
net.mingsoft.basic.util.ArrysUtil
;
import
net.mingsoft.mdiy.util.DictUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -41,7 +43,7 @@ import net.mingsoft.mdiy.util.ParserUtil;
...
@@ -41,7 +43,7 @@ import net.mingsoft.mdiy.util.ParserUtil;
/**
/**
* 铭飞MS平台,通用栏目分类,为了区分文章栏目与其他栏目的权限,该类是从basic模块复制过来
* 铭飞MS平台,通用栏目分类,为了区分文章栏目与其他栏目的权限,该类是从basic模块复制过来
* @author 铭飞开发团队
* @author 铭飞开发团队
* @version
* @version
* 版本号:100-000-000<br/>
* 版本号:100-000-000<br/>
* 创建日期:2017年8月9日<br/>
* 创建日期:2017年8月9日<br/>
* 历史修订:<br/>
* 历史修订:<br/>
...
@@ -49,8 +51,8 @@ import net.mingsoft.mdiy.util.ParserUtil;
...
@@ -49,8 +51,8 @@ import net.mingsoft.mdiy.util.ParserUtil;
@Controller
(
"articleColumnAction"
)
@Controller
(
"articleColumnAction"
)
@RequestMapping
(
"/${ms.manager.path}/cms/column"
)
@RequestMapping
(
"/${ms.manager.path}/cms/column"
)
public
class
ColumnAction
extends
BaseAction
{
public
class
ColumnAction
extends
BaseAction
{
/**
/**
* 栏目业务层
* 栏目业务层
*/
*/
...
@@ -58,7 +60,7 @@ public class ColumnAction extends BaseAction{
...
@@ -58,7 +60,7 @@ public class ColumnAction extends BaseAction{
private
IColumnBiz
columnBiz
;
private
IColumnBiz
columnBiz
;
@Autowired
@Autowired
private
ICategoryBiz
categoryBiz
;
private
ICategoryBiz
categoryBiz
;
/**
/**
* 模块业务层注入
* 模块业务层注入
*/
*/
...
@@ -75,7 +77,7 @@ public class ColumnAction extends BaseAction{
...
@@ -75,7 +77,7 @@ public class ColumnAction extends BaseAction{
}
}
/**
/**
* 栏目添加跳转页面
* 栏目添加跳转页面
*
*
* @return
* @return
*/
*/
@RequestMapping
(
"/add"
)
@RequestMapping
(
"/add"
)
...
@@ -84,6 +86,8 @@ public class ColumnAction extends BaseAction{
...
@@ -84,6 +86,8 @@ public class ColumnAction extends BaseAction{
int
appId
=
BasicUtil
.
getAppId
();
int
appId
=
BasicUtil
.
getAppId
();
List
<
ColumnEntity
>
list
=
columnBiz
.
queryAll
(
appId
,
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
List
<
ColumnEntity
>
list
=
columnBiz
.
queryAll
(
appId
,
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
ColumnEntity
columnSuper
=
new
ColumnEntity
();
ColumnEntity
columnSuper
=
new
ColumnEntity
();
// 栏目属性
model
.
addAttribute
(
"columnFlag"
,
DictUtil
.
list
(
"栏目属性"
));
model
.
addAttribute
(
"appId"
,
appId
);
model
.
addAttribute
(
"appId"
,
appId
);
model
.
addAttribute
(
"columnSuper"
,
columnSuper
);
model
.
addAttribute
(
"columnSuper"
,
columnSuper
);
model
.
addAttribute
(
"column"
,
new
ColumnEntity
());
model
.
addAttribute
(
"column"
,
new
ColumnEntity
());
...
@@ -114,7 +118,7 @@ public class ColumnAction extends BaseAction{
...
@@ -114,7 +118,7 @@ public class ColumnAction extends BaseAction{
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
false
,
getResString
(
"err.empty"
,
this
.
getResString
(
"columnType"
)));
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
false
,
getResString
(
"err.empty"
,
this
.
getResString
(
"columnType"
)));
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
...
@@ -154,9 +158,9 @@ public class ColumnAction extends BaseAction{
...
@@ -154,9 +158,9 @@ public class ColumnAction extends BaseAction{
columnBiz
.
updateEntity
(
column
);
columnBiz
.
updateEntity
(
column
);
//生成文件夹
//生成文件夹
File
fileName
=
new
File
(
file
);
File
fileName
=
new
File
(
file
);
fileName
.
mkdir
();
fileName
.
mkdir
();
}
}
/**
/**
* @param column 栏目表实体
* @param column 栏目表实体
* <i>column参数包含字段信息参考:</i><br/>
* <i>column参数包含字段信息参考:</i><br/>
...
@@ -180,7 +184,7 @@ public class ColumnAction extends BaseAction{
...
@@ -180,7 +184,7 @@ public class ColumnAction extends BaseAction{
};
};
this
.
outJson
(
response
,
true
);
this
.
outJson
(
response
,
true
);
}
}
/**
/**
* 栏目更新页面跳转
* 栏目更新页面跳转
* @param columnId 栏目ID
* @param columnId 栏目ID
...
@@ -199,6 +203,8 @@ public class ColumnAction extends BaseAction{
...
@@ -199,6 +203,8 @@ public class ColumnAction extends BaseAction{
list
=
columnBiz
.
queryAll
(
appId
,
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
list
=
columnBiz
.
queryAll
(
appId
,
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
//查询当前栏目实体
//查询当前栏目实体
ColumnEntity
column
=
(
ColumnEntity
)
columnBiz
.
getEntity
(
columnId
);
ColumnEntity
column
=
(
ColumnEntity
)
columnBiz
.
getEntity
(
columnId
);
// 栏目属性
model
.
addAttribute
(
"columnFlag"
,
DictUtil
.
list
(
"栏目属性"
));
model
.
addAttribute
(
"appId"
,
appId
);
model
.
addAttribute
(
"appId"
,
appId
);
model
.
addAttribute
(
"column"
,
column
);
model
.
addAttribute
(
"column"
,
column
);
model
.
addAttribute
(
"columnc"
,
column
.
getCategoryId
());
model
.
addAttribute
(
"columnc"
,
column
.
getCategoryId
());
...
@@ -212,7 +218,7 @@ public class ColumnAction extends BaseAction{
...
@@ -212,7 +218,7 @@ public class ColumnAction extends BaseAction{
model
.
addAttribute
(
"model"
,
"cms"
);
model
.
addAttribute
(
"model"
,
"cms"
);
return
"/basic/column/form"
;
return
"/basic/column/form"
;
}
}
/**
/**
* 栏目首页面列表显示
* 栏目首页面列表显示
*/
*/
...
@@ -227,10 +233,10 @@ public class ColumnAction extends BaseAction{
...
@@ -227,10 +233,10 @@ public class ColumnAction extends BaseAction{
EUListBean
_list
=
new
EUListBean
(
list
,
list
.
size
());
EUListBean
_list
=
new
EUListBean
(
list
,
list
.
size
());
this
.
outJson
(
response
,
net
.
mingsoft
.
base
.
util
.
JSONArray
.
toJSONString
(
_list
));
this
.
outJson
(
response
,
net
.
mingsoft
.
base
.
util
.
JSONArray
.
toJSONString
(
_list
));
}
}
/**
/**
* 栏目添加
* 栏目添加
*
*
* @param column
* @param column
* 栏目对象
* 栏目对象
* @return 返回页面跳转
* @return 返回页面跳转
...
@@ -245,6 +251,13 @@ public class ColumnAction extends BaseAction{
...
@@ -245,6 +251,13 @@ public class ColumnAction extends BaseAction{
column
.
setCategoryManagerId
(
getManagerBySession
(
request
).
getManagerId
());
column
.
setCategoryManagerId
(
getManagerBySession
(
request
).
getManagerId
());
column
.
setCategoryDateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()));
column
.
setCategoryDateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()));
column
.
setCategoryModelId
(
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
column
.
setCategoryModelId
(
BasicUtil
.
getModelCodeId
(
net
.
mingsoft
.
cms
.
constant
.
ModelCode
.
CMS_COLUMN
.
toString
()));
String
checkboxType
=
BasicUtil
.
getString
(
"checkboxType"
);
//如果选择一个属性不做排序操作
if
(!
StringUtils
.
isEmpty
(
checkboxType
)
&&
checkboxType
.
length
()>
2
){
column
.
setColumnFlag
(
ArrysUtil
.
sort
(
checkboxType
,
","
)+
","
);
}
else
{
column
.
setColumnFlag
(
checkboxType
);
}
if
(
column
.
getColumnType
()==
ColumnEntity
.
ColumnTypeEnum
.
COLUMN_TYPE_COVER
.
toInt
()){
if
(
column
.
getColumnType
()==
ColumnEntity
.
ColumnTypeEnum
.
COLUMN_TYPE_COVER
.
toInt
()){
column
.
setColumnListUrl
(
null
);
column
.
setColumnListUrl
(
null
);
}
}
...
@@ -252,7 +265,7 @@ public class ColumnAction extends BaseAction{
...
@@ -252,7 +265,7 @@ public class ColumnAction extends BaseAction{
this
.
columnPath
(
request
,
column
);
this
.
columnPath
(
request
,
column
);
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
true
,
null
,
JSONArray
.
toJSONString
(
column
.
getCategoryId
()));
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
true
,
null
,
JSONArray
.
toJSONString
(
column
.
getCategoryId
()));
}
}
/**
/**
* 更新栏目
* 更新栏目
* @param column 栏目实体
* @param column 栏目实体
...
@@ -274,6 +287,13 @@ public class ColumnAction extends BaseAction{
...
@@ -274,6 +287,13 @@ public class ColumnAction extends BaseAction{
}
}
column
.
setCategoryManagerId
(
getManagerBySession
(
request
).
getManagerId
());
column
.
setCategoryManagerId
(
getManagerBySession
(
request
).
getManagerId
());
column
.
setAppId
(
websiteId
);
column
.
setAppId
(
websiteId
);
String
checkboxType
=
BasicUtil
.
getString
(
"checkboxType"
);
//如果选择一个属性不做排序操作
if
(!
StringUtils
.
isEmpty
(
checkboxType
)
&&
checkboxType
.
length
()>
2
){
column
.
setColumnFlag
(
ArrysUtil
.
sort
(
checkboxType
,
","
)+
","
);
}
else
{
column
.
setColumnFlag
(
checkboxType
);
}
columnBiz
.
updateCategory
(
column
);
columnBiz
.
updateCategory
(
column
);
this
.
columnPath
(
request
,
column
);
this
.
columnPath
(
request
,
column
);
//查询当前栏目是否有子栏目,
//查询当前栏目是否有子栏目,
...
@@ -291,4 +311,4 @@ public class ColumnAction extends BaseAction{
...
@@ -291,4 +311,4 @@ public class ColumnAction extends BaseAction{
}
}
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
true
,
null
,
JSONArray
.
toJSONString
(
column
.
getCategoryId
()));
this
.
outJson
(
response
,
ModelCode
.
COLUMN
,
true
,
null
,
JSONArray
.
toJSONString
(
column
.
getCategoryId
()));
}
}
}
}
\ No newline at end of file
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