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
f5d7e974
Commit
f5d7e974
authored
Aug 07, 2018
by
曲欣红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
df17eba3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
26 deletions
+29
-26
ThemeTemplateConfController.java
...m/egolm/admin/controller/ThemeTemplateConfController.java
+13
-11
ThemeTemplateService.java
...in/java/com/egolm/admin/service/ThemeTemplateService.java
+4
-4
ThemeTemplateServiceImpl.java
...om/egolm/admin/service/impl/ThemeTemplateServiceImpl.java
+12
-11
No files found.
src/main/java/com/egolm/admin/controller/ThemeTemplateConfController.java
View file @
f5d7e974
...
...
@@ -69,7 +69,7 @@ public class ThemeTemplateConfController {
*/
@ApiOperation
(
"新增主题"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号varchar(50)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称varchar(100)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者varchar(50)"
),
...
...
@@ -79,12 +79,13 @@ public class ThemeTemplateConfController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态int(0)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态int(0)"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sCreateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"创建人varchar(30)"
),
})
@ResponseBody
@PostMapping
(
value
=
"/insert"
)
public
Object
insert
(
String
LangID
,
String
sMemo
,
String
sThemeAuthor
,
String
sSnapshot1
,
...
...
@@ -116,8 +117,7 @@ public class ThemeTemplateConfController {
sSnapshot3
);
logger
.
info
(
"新增主题》》》"
+
GsonUtil
.
toJson
(
tPlatformTheme
));
ttService
.
insert
(
tPlatformTheme
);
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
selectByNO
(
sThemeNO
)).
toString
();
return
Rjx
.
jsonOk
().
set
(
"detail"
,
ttService
.
insert
(
tPlatformTheme
,
LangID
)).
toString
();
}
/**
...
...
@@ -141,7 +141,7 @@ public class ThemeTemplateConfController {
*/
@ApiOperation
(
"修改主题"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题编号varchar(50)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeName"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题名称varchar(100)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sThemeAuthor"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题作者varchar(50)"
),
...
...
@@ -151,12 +151,13 @@ public class ThemeTemplateConfController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照2varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sSnapshot3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"主题快照3varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sMemo"
,
dataType
=
"String"
,
required
=
true
,
value
=
"备注varchar(300)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态int(0)"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"nTag"
,
dataType
=
"int"
,
required
=
true
,
value
=
"状态int(0)"
,
defaultValue
=
"0"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sUpdateUser"
,
dataType
=
"String"
,
required
=
true
,
value
=
"修改人varchar(30)"
),
})
@ResponseBody
@PostMapping
(
value
=
"/update"
)
public
Object
update
(
String
LangID
,
String
sMemo
,
String
sThemeAuthor
,
String
sSnapshot1
,
...
...
@@ -188,7 +189,7 @@ public class ThemeTemplateConfController {
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
,
LangID
)).
toString
();
}
/**
...
...
@@ -204,13 +205,14 @@ public class ThemeTemplateConfController {
*/
@ApiOperation
(
"主题列表查询"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"searchKey"
,
dataType
=
"String"
,
required
=
false
,
value
=
"用户编码/名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"long"
,
required
=
false
,
value
=
"页码"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"long"
,
required
=
false
,
value
=
"每页显示记录条数"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
dataType
=
"long"
,
required
=
false
,
value
=
"页码"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
dataType
=
"long"
,
required
=
false
,
value
=
"每页显示记录条数"
,
defaultValue
=
"10"
),
})
@ResponseBody
@GetMapping
(
"/getThemeList"
)
public
Object
query
(
String
searchKey
,
Long
index
,
Long
limit
){
public
Object
query
(
String
LangID
,
String
searchKey
,
Long
index
,
Long
limit
){
logger
.
info
(
"主题列表查询》》》searchKey: "
+
searchKey
+
", index: "
+
index
+
", limit: "
+
limit
);
if
(
StringUtil
.
isEmpty
(
index
)){
index
=
1L
;
...
...
@@ -223,7 +225,7 @@ public class ThemeTemplateConfController {
page
.
setIndex
(
index
);
page
.
setLimit
(
limit
);
page
.
setLimitKey
(
" dLastUpdateTime desc "
);
List
<
Map
<
String
,
Object
>>
themeList
=
ttService
.
queryList
(
searchKey
,
page
);
List
<
Map
<
String
,
Object
>>
themeList
=
ttService
.
queryList
(
searchKey
,
page
,
LangID
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
themeList
).
setPage
(
page
).
toString
();
}
}
src/main/java/com/egolm/admin/service/ThemeTemplateService.java
View file @
f5d7e974
...
...
@@ -8,11 +8,11 @@ import com.egolm.common.jdbc.Page;
public
interface
ThemeTemplateService
{
public
TPlatformTheme
insert
(
TPlatformTheme
theme
);
public
TPlatformTheme
insert
(
TPlatformTheme
theme
,
String
LangID
);
public
TPlatformTheme
selectByNO
(
String
themeNO
);
public
TPlatformTheme
selectByNO
(
String
themeNO
,
String
LangID
);
public
TPlatformTheme
update
(
TPlatformTheme
theme
);
public
TPlatformTheme
update
(
TPlatformTheme
theme
,
String
LangID
);
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
,
String
LangID
);
}
src/main/java/com/egolm/admin/service/impl/ThemeTemplateServiceImpl.java
View file @
f5d7e974
...
...
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import
com.egolm.admin.config.XException
;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.admin.util.I18NUtils
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
...
...
@@ -35,13 +36,13 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
* @throws
*/
@Override
public
TPlatformTheme
insert
(
TPlatformTheme
theme
)
{
public
TPlatformTheme
insert
(
TPlatformTheme
theme
,
String
LangID
)
{
try
{
jdbcTemplate
.
save
(
theme
);
}
catch
(
Exception
e
){
throw
new
XException
(
"新增失败"
,
e
);
throw
new
XException
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Save_Error"
),
e
);
//新增失败
}
return
selectByNO
(
theme
.
getsThemeNO
());
return
selectByNO
(
theme
.
getsThemeNO
()
,
LangID
);
}
/**
...
...
@@ -53,12 +54,12 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
* @throws
*/
@Override
public
TPlatformTheme
selectByNO
(
String
themeNO
)
{
public
TPlatformTheme
selectByNO
(
String
themeNO
,
String
LangID
)
{
try
{
String
sql
=
"select * from tPlatformTheme where sThemeNO = ?"
;
return
jdbcTemplate
.
queryForBean
(
sql
,
TPlatformTheme
.
class
,
themeNO
);
}
catch
(
Exception
e
){
throw
new
XException
(
"查询失败"
,
e
);
throw
new
XException
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Query_Error"
),
e
);
//查询失败
}
}
...
...
@@ -71,12 +72,12 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
* @throws
*/
@Override
public
TPlatformTheme
update
(
TPlatformTheme
theme
)
{
public
TPlatformTheme
update
(
TPlatformTheme
theme
,
String
LangID
)
{
try
{
String
sThemeNO
=
theme
.
getsThemeNO
();
boolean
haveTheme
=
haveTheme
(
sThemeNO
);
if
(!
haveTheme
){
throw
new
XException
(
"无此模板:"
+
sThemeNO
);
throw
new
XException
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_No_Template"
)+
": "
+
sThemeNO
);
//无此模板
}
String
sql
=
"update tPlatformTheme set sThemeName = ?, sThemeAuthor = ?, sCaption = ?, sThemeJson = ?, sSnapshot1 = ?, sSnapshot2 = ?, sSnapshot3 = ?, sMemo = ?, nTag = ?, sUpdateUser = ?, dUpdateDate = ?, dLastUpdateTime = ? where sThemeNO = ?"
;
jdbcTemplate
.
update
(
...
...
@@ -96,9 +97,9 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
sThemeNO
);
}
catch
(
Exception
e
){
throw
new
XException
(
"修改失败"
,
e
);
throw
new
XException
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Update_Error"
));
//修改失败
}
return
selectByNO
(
theme
.
getsThemeNO
());
return
selectByNO
(
theme
.
getsThemeNO
()
,
LangID
);
}
private
boolean
haveTheme
(
String
sThemeNO
){
...
...
@@ -117,7 +118,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
* @throws
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryList
(
String
searchKey
,
Page
page
,
String
LangID
)
{
try
{
String
sql
=
"select * from tPlatformTheme where nTag&1 = 0"
;
List
<
Map
<
String
,
Object
>>
themes
=
null
;
...
...
@@ -130,7 +131,7 @@ public class ThemeTemplateServiceImpl implements ThemeTemplateService{
}
return
themes
;
}
catch
(
Exception
e
){
throw
new
XException
(
"查询失败"
,
e
);
throw
new
XException
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Query_Error"
));
//查询失败
}
}
...
...
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