Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
admin
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
曲欣亮
admin
Commits
19bc0833
Commit
19bc0833
authored
Aug 07, 2018
by
曲欣红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
20095e65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
31 deletions
+138
-31
ThemeTemplateConfController.java
...m/egolm/admin/controller/ThemeTemplateConfController.java
+85
-24
ThemeTemplateServiceImpl.java
...om/egolm/admin/service/impl/ThemeTemplateServiceImpl.java
+53
-7
No files found.
src/main/java/com/egolm/admin/controller/ThemeTemplateConfController.java
View file @
19bc0833
...
@@ -20,6 +20,7 @@ import com.egolm.admin.config.XException;
...
@@ -20,6 +20,7 @@ import com.egolm.admin.config.XException;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.admin.service.impl.ThemeTemplateServiceImpl
;
import
com.egolm.admin.service.impl.ThemeTemplateServiceImpl
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.Page
;
...
@@ -29,6 +30,13 @@ import io.swagger.annotations.ApiImplicitParam;
...
@@ -29,6 +30,13 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
/**
*
* @author qu133
* @date 2018年8月7日
* @className ThemeTemplateConfController
* @Description 主题模板配置
*/
@Api
(
tags
={
"主题模板配置"
})
@Api
(
tags
={
"主题模板配置"
})
@RestController
@RestController
@RequestMapping
(
"theme"
)
@RequestMapping
(
"theme"
)
...
@@ -39,20 +47,40 @@ public class ThemeTemplateConfController {
...
@@ -39,20 +47,40 @@ public class ThemeTemplateConfController {
@Autowired
@Autowired
private
ThemeTemplateService
ttService
;
private
ThemeTemplateService
ttService
;
/**
*
* @Title: insert
* @Description: TODO(新增主题)
* @return Object 返回类型
* @param sMemo
* @param sThemeAuthor
* @param sSnapshot1
* @param sSnapshot2
* @param sThemeNO
* @param nTag
* @param sCaption
* @param sCreateUser
* @param sThemeJson
* @param sThemeName
* @param sSnapshot3
* @return
* @throws
*/
@ApiOperation
(
"新增主题"
)
@ApiOperation
(
"新增主题"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号
varchar(50)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称
varchar(100)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者
varchar(50)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCaption"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题说明"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCaption"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题说明
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeJson"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题配置"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeJson"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题配置
text(0)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot1"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot1"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照1
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态
int(0)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCreateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"创建人"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCreateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"创建人
varchar(30)
"
),
})
})
@ResponseBody
@ResponseBody
@PostMapping
(
value
=
"/insert"
)
@PostMapping
(
value
=
"/insert"
)
...
@@ -87,24 +115,44 @@ public class ThemeTemplateConfController {
...
@@ -87,24 +115,44 @@ public class ThemeTemplateConfController {
d
,
d
,
sSnapshot3
sSnapshot3
);
);
logger
.
info
(
"新增主题》》》"
+
GsonUtil
.
toJson
(
tPlatformTheme
));
ttService
.
insert
(
tPlatformTheme
);
ttService
.
insert
(
tPlatformTheme
);
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
selectByNO
(
sThemeNO
)).
toString
();
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
selectByNO
(
sThemeNO
)).
toString
();
}
}
@ApiOperation
(
"新增主题"
)
/**
*
* @Title: update
* @Description: TODO(修改主题)
* @return Object 返回类型
* @param sMemo
* @param sThemeAuthor
* @param sSnapshot1
* @param sSnapshot2
* @param sThemeNO
* @param nTag
* @param sCaption
* @param sUpdateUser
* @param sThemeJson
* @param sThemeName
* @param sSnapshot3
* @return
* @throws
*/
@ApiOperation
(
"修改主题"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号
varchar(50)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称
varchar(100)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者
varchar(50)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCaption"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题说明"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCaption"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题说明
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeJson"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题配置"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeJson"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题配置
text(0)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot1"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot1"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照1
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注
varchar(300)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态
int(0)
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sUpdateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"修改人"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sUpdateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"修改人
varchar(30)
"
),
})
})
@ResponseBody
@ResponseBody
@PostMapping
(
value
=
"/update"
)
@PostMapping
(
value
=
"/update"
)
...
@@ -139,10 +187,22 @@ public class ThemeTemplateConfController {
...
@@ -139,10 +187,22 @@ public class ThemeTemplateConfController {
d
,
//dUpdateDate更新日期
d
,
//dUpdateDate更新日期
sSnapshot3
//sSnapshot3快照3
sSnapshot3
//sSnapshot3快照3
);
);
logger
.
info
(
"修改主题》》》"
+
GsonUtil
.
toJson
(
tPlatformTheme
));
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
update
(
tPlatformTheme
)).
toString
();
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
update
(
tPlatformTheme
)).
toString
();
}
}
@ApiOperation
(
"用户列表查询"
)
/**
*
* @Title: query
* @Description: TODO(主题列表查询)
* @return Object 返回类型
* @param searchKey
* @param index
* @param limit
* @return
* @throws
*/
@ApiOperation
(
"主题列表查询"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"searchKey"
,
dataType
=
"String"
,
required
=
false
,
value
=
"用户编码/名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"searchKey"
,
dataType
=
"String"
,
required
=
false
,
value
=
"用户编码/名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"long"
,
required
=
false
,
value
=
"页码"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"long"
,
required
=
false
,
value
=
"页码"
),
...
@@ -151,6 +211,7 @@ public class ThemeTemplateConfController {
...
@@ -151,6 +211,7 @@ public class ThemeTemplateConfController {
@ResponseBody
@ResponseBody
@GetMapping
(
"/getUserList"
)
@GetMapping
(
"/getUserList"
)
public
Object
query
(
String
searchKey
,
Long
index
,
Long
limit
){
public
Object
query
(
String
searchKey
,
Long
index
,
Long
limit
){
logger
.
info
(
"主题列表查询》》》searchKey: "
+
searchKey
+
", index: "
+
index
+
", limit: "
+
limit
);
if
(
StringUtil
.
isEmpty
(
index
)){
if
(
StringUtil
.
isEmpty
(
index
)){
index
=
1L
;
index
=
1L
;
}
}
...
...
src/main/java/com/egolm/admin/service/impl/ThemeTemplateServiceImpl.java
View file @
19bc0833
...
@@ -3,27 +3,37 @@ package com.egolm.admin.service.impl;
...
@@ -3,27 +3,37 @@ package com.egolm.admin.service.impl;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.egolm.admin.config.XException
;
import
com.egolm.admin.config.XException
;
import
com.egolm.admin.controller.OSSFileController
;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.Page
;
/**
*
* @author qu133
* @date 2018年8月7日
* @className ThemeTemplateServiceImpl
* @Description 主题模板管理相关业务逻辑
*/
@Service
@Service
public
class
ThemeTemplateServiceImpl
implements
ThemeTemplateService
{
public
class
ThemeTemplateServiceImpl
implements
ThemeTemplateService
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ThemeTemplateServiceImpl
.
class
);
@Autowired
@Autowired
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
/**
*
* @Title: insert
* @Description: TODO(新增主题模板)
* @param theme
* @return
* @throws
*/
@Override
@Override
public
TPlatformTheme
insert
(
TPlatformTheme
theme
)
{
public
TPlatformTheme
insert
(
TPlatformTheme
theme
)
{
try
{
try
{
...
@@ -34,6 +44,14 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
...
@@ -34,6 +44,14 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
return
selectByNO
(
theme
.
getsThemeNO
());
return
selectByNO
(
theme
.
getsThemeNO
());
}
}
/**
*
* @Title: selectByNO
* @Description: TODO(查询主题模板)
* @param themeNO
* @return
* @throws
*/
@Override
@Override
public
TPlatformTheme
selectByNO
(
String
themeNO
)
{
public
TPlatformTheme
selectByNO
(
String
themeNO
)
{
try
{
try
{
...
@@ -44,9 +62,22 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
...
@@ -44,9 +62,22 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
}
}
}
}
/**
*
* @Title: update
* @Description: TODO(修改主题模板)
* @param theme
* @return
* @throws
*/
@Override
@Override
public
TPlatformTheme
update
(
TPlatformTheme
theme
)
{
public
TPlatformTheme
update
(
TPlatformTheme
theme
)
{
try
{
try
{
String
sThemeNO
=
theme
.
getsThemeNO
();
boolean
haveTheme
=
haveTheme
(
sThemeNO
);
if
(!
haveTheme
){
throw
new
XException
(
"无此模板:"
+
sThemeNO
);
}
String
sql
=
"update tPlatformTheme set sThemeName = ?, sThemeAuthor = ?, sCaption = ?, sThemeJson = ?, sSnapshot1 = ?, sSnapshot2 = ?, sSnapshot3 = ?, sMemo = ?, nTag = ?, sUpdateUser = ?, dUpdateDate = ?, dLastUpdateTime = ? where sThemeNO = ?"
;
String
sql
=
"update tPlatformTheme set sThemeName = ?, sThemeAuthor = ?, sCaption = ?, sThemeJson = ?, sSnapshot1 = ?, sSnapshot2 = ?, sSnapshot3 = ?, sMemo = ?, nTag = ?, sUpdateUser = ?, dUpdateDate = ?, dLastUpdateTime = ? where sThemeNO = ?"
;
jdbcTemplate
.
update
(
jdbcTemplate
.
update
(
sql
,
sql
,
...
@@ -62,14 +93,29 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
...
@@ -62,14 +93,29 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
theme
.
getsUpdateUser
(),
theme
.
getsUpdateUser
(),
theme
.
getdUpdateDate
(),
theme
.
getdUpdateDate
(),
theme
.
getdLastUpdateTime
(),
theme
.
getdLastUpdateTime
(),
theme
.
getsThemeNO
()
sThemeNO
);
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
throw
new
XException
(
"修改失败"
,
e
);
throw
new
XException
(
"修改失败"
,
e
);
}
}
return
selectByNO
(
theme
.
getsThemeNO
());
return
selectByNO
(
theme
.
getsThemeNO
());
}
}
private
boolean
haveTheme
(
String
sThemeNO
){
String
sql
=
"select count(1) from tPlatformTheme where sThemeNO = ? and nTag&1 = 0"
;
Integer
count
=
jdbcTemplate
.
queryForInt
(
sql
,
sThemeNO
);
return
count
>
0
;
}
/**
*
* @Title: queryList
* @Description: TODO(查询主题模板列表)
* @param searchKey
* @param page
* @return
* @throws
*/
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
)
{
try
{
try
{
...
@@ -84,7 +130,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
...
@@ -84,7 +130,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
}
}
return
themes
;
return
themes
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
throw
new
XException
(
"
修改
失败"
,
e
);
throw
new
XException
(
"
查询
失败"
,
e
);
}
}
}
}
...
...
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