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
9aa67b65
Commit
9aa67b65
authored
Aug 07, 2018
by
曲欣红
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://13384825689@gitlab.egolm.com/key/admin.git
parents
de09544f
8515fac5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
258 additions
and
1 deletion
+258
-1
PlatformLayoutController.java
.../com/egolm/admin/controller/PlatformLayoutController.java
+154
-0
PlatformLayoutService.java
...n/java/com/egolm/admin/service/PlatformLayoutService.java
+16
-0
PlatformLayoutServiceImpl.java
...m/egolm/admin/service/impl/PlatformLayoutServiceImpl.java
+85
-0
messages.properties
src/main/resources/messages.properties
+1
-0
messages_en.properties
src/main/resources/messages_en.properties
+1
-1
messages_zh_CN.properties
src/main/resources/messages_zh_CN.properties
+1
-0
No files found.
src/main/java/com/egolm/admin/controller/PlatformLayoutController.java
0 → 100644
View file @
9aa67b65
package
com
.
egolm
.
admin
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.egolm.admin.pojo.TPlatformLayout
;
import
com.egolm.admin.pojo.TPlatformTheme
;
import
com.egolm.admin.service.PlatformLayoutService
;
import
com.egolm.admin.service.ThemeTemplateService
;
import
com.egolm.admin.util.AdminContstrant
;
import
com.egolm.admin.util.I18NUtils
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"平台主题配置"
})
@RestController
@RequestMapping
(
"layout"
)
public
class
PlatformLayoutController
{
@Autowired
private
PlatformLayoutService
platformLayoutService
;
@Autowired
private
ThemeTemplateService
themeTemplateService
;
@ApiOperation
(
"查询(只有一条)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
})
@RequestMapping
(
value
=
"/query"
,
method
=
RequestMethod
.
GET
)
public
String
query
(
HttpServletRequest
request
)
{
String
LangID
=
request
.
getParameter
(
"LangID"
);
if
(!
StringUtil
.
isNotEmpty
(
LangID
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Parameter_empty"
)).
toJson
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
List
<
Map
<
String
,
Object
>>
layoutList
=
platformLayoutService
.
query
(
params
);
if
(
layoutList
!=
null
&&
layoutList
.
size
()
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
"detail"
,
layoutList
.
get
(
0
)).
toString
();
}
else
{
return
Rjx
.
jsonOk
().
set
(
"detail"
,
new
HashMap
<
String
,
Object
>()).
toString
();
}
}
@ApiOperation
(
"保存或修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"LangID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"platformNO"
,
dataType
=
"String"
,
required
=
false
,
value
=
"平台编号(为空表示新增,不为空表示修改)"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"platformName"
,
dataType
=
"String"
,
required
=
false
,
value
=
"平台名称"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"logoPath1"
,
dataType
=
"String"
,
required
=
true
,
value
=
"logo1"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"logoPath2"
,
dataType
=
"String"
,
required
=
true
,
value
=
"logo2"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"logoPath3"
,
dataType
=
"String"
,
required
=
true
,
value
=
"logo3"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"themeNO"
,
dataType
=
"String"
,
required
=
false
,
value
=
"主题编号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"memo"
,
dataType
=
"String"
,
required
=
false
,
value
=
"备注"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"userNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"用户NO"
,
defaultValue
=
""
),
})
@RequestMapping
(
value
=
"/saveUpdate"
,
method
=
RequestMethod
.
POST
)
public
String
saveUpdate
(
HttpServletRequest
request
)
{
String
LangID
=
request
.
getParameter
(
"LangID"
);
String
platformNO
=
request
.
getParameter
(
"platformNO"
);
String
platformName
=
request
.
getParameter
(
"platformName"
);
String
logoPath1
=
request
.
getParameter
(
"logoPath1"
);
String
logoPath2
=
request
.
getParameter
(
"logoPath2"
);
String
logoPath3
=
request
.
getParameter
(
"logoPath3"
);
String
themeNO
=
request
.
getParameter
(
"themeNO"
);
String
memo
=
request
.
getParameter
(
"memo"
);
String
userNO
=
request
.
getParameter
(
"userNO"
);
Rjx
rjx
=
null
;
String
themeJSON
=
""
;
if
(
StringUtil
.
isNotUndefinedAndNull
(
themeNO
,
LangID
))
{
//验证主题是否存在,取主题配置
try
{
TPlatformTheme
tPlatformTheme
=
themeTemplateService
.
selectByNO
(
themeNO
,
LangID
);
if
(
tPlatformTheme
!=
null
)
{
themeJSON
=
tPlatformTheme
.
getsThemeJson
();
}
}
catch
(
Exception
e
)
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_No_Template"
)).
toJson
();
}
}
if
(
StringUtil
.
isNotUndefinedAndNull
(
platformNO
))
{
//修改
if
(!
StringUtil
.
isNotEmpty
(
LangID
,
userNO
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Parameter_empty"
)).
toJson
();
}
TPlatformLayout
layout
=
platformLayoutService
.
getLayoutByNO
(
platformNO
);
if
(
layout
!=
null
)
{
layout
.
setsPlatformName
(
platformName
);
layout
.
setsLogoPath1
(
logoPath1
);
layout
.
setsLogoPath2
(
logoPath2
);
layout
.
setsLogoPath3
(
logoPath3
);
layout
.
setsThemeNO
(
themeNO
);
layout
.
setsThemeJson
(
themeJSON
);
layout
.
setsMemo
(
memo
);
rjx
=
platformLayoutService
.
saveOrUpdate
(
layout
);
}
else
{
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_No_Template"
)).
toJson
();
//主题不存在
}
}
else
{
//新增
if
(!
StringUtil
.
isNotEmpty
(
LangID
,
platformName
,
logoPath1
,
logoPath2
,
logoPath3
,
userNO
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Parameter_empty"
)).
toJson
();
}
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
//检查是否存在平台主题 存在不允许新增
List
<
Map
<
String
,
Object
>>
layoutList
=
platformLayoutService
.
query
(
params
);
if
(
layoutList
!=
null
&&
layoutList
.
size
()
>
0
)
{
return
Rjx
.
jsonErr
().
setCode
(-
100
).
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Layout_exists"
)).
toJson
();
}
TPlatformLayout
layout
=
new
TPlatformLayout
();
layout
.
setsPlatformName
(
platformName
);
layout
.
setsLogoPath1
(
logoPath1
);
layout
.
setsLogoPath2
(
logoPath2
);
layout
.
setsLogoPath3
(
logoPath3
);
layout
.
setsThemeNO
(
themeNO
);
layout
.
setsThemeJson
(
themeJSON
);
layout
.
setsMemo
(
memo
);
layout
.
setnTag
(
0
);
layout
.
setsCreateUser
(
userNO
);
layout
.
setsUpdateUser
(
userNO
);
rjx
=
platformLayoutService
.
saveOrUpdate
(
layout
);
}
Rjx
result
=
Rjx
.
json
();
result
.
setCode
(
rjx
.
getCode
());
result
.
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
rjx
.
get
(
AdminContstrant
.
I18n_KEY
)+
""
));
return
result
.
toJson
();
}
}
src/main/java/com/egolm/admin/service/PlatformLayoutService.java
0 → 100644
View file @
9aa67b65
package
com
.
egolm
.
admin
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.admin.pojo.TPlatformLayout
;
import
com.egolm.common.bean.Rjx
;
public
interface
PlatformLayoutService
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
public
Rjx
saveOrUpdate
(
TPlatformLayout
layout
);
public
TPlatformLayout
getLayoutByNO
(
String
NO
);
}
src/main/java/com/egolm/admin/service/impl/PlatformLayoutServiceImpl.java
0 → 100644
View file @
9aa67b65
package
com
.
egolm
.
admin
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
com.egolm.admin.pojo.TPlatformLayout
;
import
com.egolm.admin.service.PlatformLayoutService
;
import
com.egolm.admin.util.AdminContstrant
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.JdbcTemplate
;
/**
*
* @ClassName: PlatformLayoutServiceImpl
* @Description:平台基本配置表
* @author: zhang.yong
* @date: 2018年8月7日 下午4:24:28
*
*/
@Service
public
class
PlatformLayoutServiceImpl
implements
PlatformLayoutService
{
@Autowired
@Qualifier
(
"shopJdbcTemplate"
)
private
JdbcTemplate
jdbcTemplate
;
@Override
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
String
sql
=
"SELECT sPlatformNO playformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
return
jdbcTemplate
.
queryForList
(
sql
);
}
/**
* 保存或修改
* <p>Title: saveOrUpdate</p>
* <p>Description: </p>
* @param layout
* @return
* @see com.egolm.admin.service.PlatformLayoutService#saveOrUpdate(com.egolm.admin.pojo.TPlatformLayout)
*/
@Override
public
Rjx
saveOrUpdate
(
TPlatformLayout
layout
)
{
String
platformNO
=
layout
.
getsPlatformNO
();
layout
.
setdUpdateDate
(
new
Date
());
layout
.
setdLastUpdateTime
(
new
Date
());
if
(
StringUtil
.
isNotEmpty
(
platformNO
))
{
//修改
int
i
=
jdbcTemplate
.
update
(
layout
);
if
(
i
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
AdminContstrant
.
I18n_KEY
,
"Msg_Update_Success"
);
//.setMessage("更新成功");
}
else
{
return
Rjx
.
jsonErr
().
set
(
AdminContstrant
.
I18n_KEY
,
"Msg_Update_Error"
);
//.setMessage("更新失败");
}
}
else
{
//新增
layout
.
setsPlatformNO
(
StringUtil
.
getId
(
30
));
layout
.
setdCreateDate
(
new
Date
());
int
i
=
jdbcTemplate
.
save
(
layout
);
if
(
i
>
0
)
{
return
Rjx
.
jsonOk
().
set
(
AdminContstrant
.
I18n_KEY
,
"Msg_Save_Success"
);
//.setMessage("保存成功");
}
else
{
return
Rjx
.
jsonErr
().
set
(
AdminContstrant
.
I18n_KEY
,
"Msg_Save_Error"
);
//.setMessage("保存失败");
}
}
}
@Override
public
TPlatformLayout
getLayoutByNO
(
String
NO
)
{
try
{
String
sql
=
"select * from tPlatformLayout where nTag&1=0 and sPlatformNO = ?"
;
return
jdbcTemplate
.
queryForBean
(
sql
,
TPlatformLayout
.
class
,
NO
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
}
src/main/resources/messages.properties
View file @
9aa67b65
...
@@ -6,6 +6,7 @@ Msg_Save_Success=保存成功
...
@@ -6,6 +6,7 @@ Msg_Save_Success=保存成功
Msg_Save_Error
=
保存失败
Msg_Save_Error
=
保存失败
Msg_Update_Success
=
更新成功
Msg_Update_Success
=
更新成功
Msg_Update_Error
=
更新失败
Msg_Update_Error
=
更新失败
Msg_Layout_exists
=
已存在平台主题,不允许新增
#qu
#qu
Msg_Query_Error
=
查询失败
Msg_Query_Error
=
查询失败
...
...
src/main/resources/messages_en.properties
View file @
9aa67b65
...
@@ -6,7 +6,7 @@ Msg_Save_Success= Save success
...
@@ -6,7 +6,7 @@ Msg_Save_Success= Save success
Msg_Save_Error
=
Save failure
Msg_Save_Error
=
Save failure
Msg_Update_Success
=
Update success
Msg_Update_Success
=
Update success
Msg_Update_Error
=
Update failure
Msg_Update_Error
=
Update failure
Msg_Layout_exists
=
There is a platform theme that is not allowed to add
#qu
#qu
Msg_Query_Error
=
Query failure
Msg_Query_Error
=
Query failure
Msg_No_Template
=
Without this template
Msg_No_Template
=
Without this template
...
...
src/main/resources/messages_zh_CN.properties
View file @
9aa67b65
...
@@ -6,6 +6,7 @@ Msg_Save_Success=\u4FDD\u5B58\u6210\u529F
...
@@ -6,6 +6,7 @@ Msg_Save_Success=\u4FDD\u5B58\u6210\u529F
Msg_Save_Error
=
\u
4FDD
\u
5B58
\u5931\u
8D25
Msg_Save_Error
=
\u
4FDD
\u
5B58
\u5931\u
8D25
Msg_Update_Success
=
\u
66F4
\u
65B0
\u6210\u
529F
Msg_Update_Success
=
\u
66F4
\u
65B0
\u6210\u
529F
Msg_Update_Error
=
\u
66F4
\u
65B0
\u5931\u
8D25
Msg_Update_Error
=
\u
66F4
\u
65B0
\u5931\u
8D25
Msg_Layout_exists
=
\u
5DF2
\u
5B58
\u5728\u
5E73
\u
53F0
\u
4E3B
\u9898
,
\u
4E0D
\u5141\u
8BB8
\u
65B0
\u
589E
#qu
#qu
Msg_Query_Error
=
\u
67e5
\u
8be2
\u5931\u
8d25
Msg_Query_Error
=
\u
67e5
\u
8be2
\u5931\u
8d25
...
...
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