Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JeeSpringCloud
Commits
08c32267
Commit
08c32267
authored
Dec 13, 2018
by
Sun
Browse files
no commit message
parent
e9629e7a
Changes
412
Show whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 412+
files are displayed.
Plain diff
Email patch
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/service/PieClassService.java
0 → 100644
View file @
08c32267
/**
* Copyright © 2015-2020 <a href="http://www.jeespring.org/">JeeSpring</a> All rights reserved.
*/
package
com.jeespring.modules.echarts.service
;
import
java.util.List
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.jeespring.common.persistence.Page
;
import
com.jeespring.common.service.AbstractBaseService
;
import
com.jeespring.modules.echarts.entity.PieClass
;
import
com.jeespring.modules.echarts.dao.PieClassDao
;
/**
* 班级Service
* @author JeeSpring
* @version 2016-05-26
*/
@Service
@Transactional
(
readOnly
=
true
)
public
class
PieClassService
extends
AbstractBaseService
<
PieClassDao
,
PieClass
>
{
@Override
public
PieClass
get
(
String
id
)
{
return
super
.
get
(
id
);
}
@Override
public
List
<
PieClass
>
findList
(
PieClass
pieClass
)
{
return
super
.
findList
(
pieClass
);
}
@Override
public
Page
<
PieClass
>
findPage
(
Page
<
PieClass
>
page
,
PieClass
pieClass
)
{
return
super
.
findPage
(
page
,
pieClass
);
}
@Override
@Transactional
(
readOnly
=
false
)
public
void
save
(
PieClass
pieClass
)
{
super
.
save
(
pieClass
);
}
@Override
@Transactional
(
readOnly
=
false
)
public
void
delete
(
PieClass
pieClass
)
{
super
.
delete
(
pieClass
);
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/BarController.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.echarts.web
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.jeespring.common.web.AbstractBaseController
;
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/bar"
)
public
class
BarController
extends
AbstractBaseController
{
private
static
final
long
serialVersionUID
=
-
6886697421555222670L
;
private
List
<
String
>
xAxisData
;
private
Map
<
String
,
List
<
Double
>>
yAxisData
;
private
Map
<
String
,
Integer
>
yAxisIndex
;
@RequestMapping
(
value
=
{
"index"
,
""
})
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
//x轴数据
request
.
setAttribute
(
"xAxisData"
,
getxAxisData
());
//y轴数据
request
.
setAttribute
(
"yAxisData"
,
getyAxisData
());
//Y轴双轴情况下的位置定位
request
.
setAttribute
(
"yAxisIndex"
,
getyAxisIndex
());
return
"modules/echarts/bar"
;
}
public
List
<
String
>
getxAxisData
(){
xAxisData
=
new
ArrayList
<
String
>();
xAxisData
.
add
(
"2015-10-10"
);
xAxisData
.
add
(
"2015-10-11"
);
xAxisData
.
add
(
"2015-10-12"
);
xAxisData
.
add
(
"2015-10-13"
);
xAxisData
.
add
(
"2015-10-14"
);
return
xAxisData
;
}
public
Map
<
String
,
List
<
Double
>>
getyAxisData
(){
Random
random
=
new
Random
();
yAxisData
=
new
HashMap
<
String
,
List
<
Double
>>();
List
<
Double
>
data1
=
new
ArrayList
<
Double
>();
data1
.
add
(
random
.
nextDouble
());
data1
.
add
(
random
.
nextDouble
());
data1
.
add
(
random
.
nextDouble
());
data1
.
add
(
random
.
nextDouble
());
data1
.
add
(
random
.
nextDouble
());
yAxisData
.
put
(
"柱状一"
,
data1
);
List
<
Double
>
data2
=
new
ArrayList
<
Double
>();
data2
.
add
(
random
.
nextDouble
());
data2
.
add
(
random
.
nextDouble
());
data2
.
add
(
random
.
nextDouble
());
data2
.
add
(
random
.
nextDouble
());
data2
.
add
(
random
.
nextDouble
());
yAxisData
.
put
(
"柱状二"
,
data2
);
return
yAxisData
;
}
public
Map
<
String
,
Integer
>
getyAxisIndex
(){
yAxisIndex
=
new
HashMap
<
String
,
Integer
>();
yAxisIndex
.
put
(
"柱状一"
,
0
);
yAxisIndex
.
put
(
"柱状二"
,
1
);
return
yAxisIndex
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/ChinaWeatherDataBeanController.java
0 → 100644
View file @
08c32267
/**
* Copyright © 2015-2020 <a href="http://www.jeespring.org/">JeeSpring</a> All rights reserved.
*/
package
com.jeespring.modules.echarts.web
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolationException
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.mvc.support.RedirectAttributes
;
import
com.google.common.collect.Lists
;
import
com.jeespring.common.config.Global
;
import
com.jeespring.common.persistence.Page
;
import
com.jeespring.common.utils.DateUtils
;
import
com.jeespring.common.utils.MyBeanUtils
;
import
com.jeespring.common.utils.StringUtils
;
import
com.jeespring.common.utils.excel.ExportExcel
;
import
com.jeespring.common.utils.excel.ImportExcel
;
import
com.jeespring.common.web.AbstractBaseController
;
import
com.jeespring.modules.echarts.entity.ChinaWeatherDataBean
;
import
com.jeespring.modules.echarts.service.ChinaWeatherDataBeanService
;
/**
* 城市气温Controller
* @author JeeSpring
* @version 2016-05-26
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/chinaWeatherDataBean"
)
public
class
ChinaWeatherDataBeanController
extends
AbstractBaseController
{
@Autowired
private
ChinaWeatherDataBeanService
chinaWeatherDataBeanService
;
@ModelAttribute
public
ChinaWeatherDataBean
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
ChinaWeatherDataBean
entity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
)){
entity
=
chinaWeatherDataBeanService
.
get
(
id
);
}
if
(
entity
==
null
){
entity
=
new
ChinaWeatherDataBean
();
}
return
entity
;
}
/**
* 城市气温列表页面
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:list"
)
@RequestMapping
(
value
=
{
"list"
,
""
})
public
String
list
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Page
<
ChinaWeatherDataBean
>
page
=
chinaWeatherDataBeanService
.
findPage
(
new
Page
<
ChinaWeatherDataBean
>(
request
,
response
),
chinaWeatherDataBean
);
model
.
addAttribute
(
"page"
,
page
);
//折线图列表数据
//X轴的数据
List
<
String
>
xAxisData
=
new
ArrayList
<
String
>();
//Y轴的数据
Map
<
String
,
List
<
Double
>>
yAxisData
=
new
HashMap
<
String
,
List
<
Double
>>();
//Y轴双轴情况下的位置定位
Map
<
String
,
Integer
>
yAxisIndex
=
new
HashMap
<
String
,
Integer
>();
List
<
ChinaWeatherDataBean
>
weatherDataList
=
chinaWeatherDataBeanService
.
findList
(
chinaWeatherDataBean
);
List
<
Double
>
beijingMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
beijingMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
changchunMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
changchunMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
shenyangMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
shenyangMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
haerbinMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
haerbinMinTemp
=
new
ArrayList
<
Double
>();
for
(
ChinaWeatherDataBean
chinaWeatherDataBeanTemp:
weatherDataList
){
//x轴数据
xAxisData
.
add
(
chinaWeatherDataBeanTemp
.
getDatestr
().
toLocaleString
());
//北京最高温度
beijingMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getBeijingMaxTemp
());
//北京最低温度
beijingMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getBeijingMinTemp
());
//长春最高温度
changchunMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getChangchunMaxTemp
());
//长春最高温度
changchunMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getChangchunMinTemp
());
//沈阳最高温度
shenyangMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getShenyangMaxTemp
());
//沈阳最高温度
shenyangMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getShenyangMinTemp
());
//哈尔滨最高温度
haerbinMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getHaerbinMaxTemp
());
//哈尔滨最高温度
haerbinMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getHaerbinMinTemp
());
}
//y轴数据
yAxisData
.
put
(
"北京 最高温度"
,
beijingMaxTemp
);
yAxisData
.
put
(
"北京 最低温度"
,
beijingMinTemp
);
yAxisData
.
put
(
"长春 最高温度"
,
changchunMaxTemp
);
yAxisData
.
put
(
"长春 最低温度"
,
changchunMinTemp
);
yAxisData
.
put
(
"沈阳 最高温度"
,
shenyangMaxTemp
);
yAxisData
.
put
(
"沈阳 最低温度"
,
shenyangMinTemp
);
yAxisData
.
put
(
"哈尔滨 最高温度"
,
haerbinMinTemp
);
yAxisData
.
put
(
"哈尔滨 最低温度"
,
haerbinMinTemp
);
//Y轴双轴情况下的位置定位
yAxisIndex
.
put
(
"北京 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"长春 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"沈阳 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"哈尔滨 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"北京 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"长春 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"沈阳 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"哈尔滨 最低温度"
,
1
);
//1表示Y轴右轴
request
.
setAttribute
(
"yAxisIndex"
,
yAxisIndex
);
request
.
setAttribute
(
"xAxisData"
,
xAxisData
);
request
.
setAttribute
(
"yAxisData"
,
yAxisData
);
return
"modules/echarts/chinaWeatherDataBeanList"
;
}
/**
* 查看,增加,编辑城市气温表单页面
*/
@RequiresPermissions
(
value
={
"echarts:chinaWeatherDataBean:view"
,
"echarts:chinaWeatherDataBean:add"
,
"echarts:chinaWeatherDataBean:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"form"
)
public
String
form
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
Model
model
)
{
model
.
addAttribute
(
"chinaWeatherDataBean"
,
chinaWeatherDataBean
);
return
"modules/echarts/chinaWeatherDataBeanForm"
;
}
/**
* 保存城市气温
*/
@RequiresPermissions
(
value
={
"echarts:chinaWeatherDataBean:add"
,
"echarts:chinaWeatherDataBean:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"save"
)
public
String
save
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
Model
model
,
RedirectAttributes
redirectAttributes
)
throws
Exception
{
if
(!
beanValidator
(
model
,
chinaWeatherDataBean
)){
return
form
(
chinaWeatherDataBean
,
model
);
}
if
(!
chinaWeatherDataBean
.
getIsNewRecord
()){
//编辑表单保存
ChinaWeatherDataBean
t
=
chinaWeatherDataBeanService
.
get
(
chinaWeatherDataBean
.
getId
());
//从数据库取出记录的值
MyBeanUtils
.
copyBeanNotNull2Bean
(
chinaWeatherDataBean
,
t
);
//将编辑表单中的非NULL值覆盖数据库记录中的值
chinaWeatherDataBeanService
.
save
(
t
);
//保存
}
else
{
//新增表单保存
chinaWeatherDataBeanService
.
save
(
chinaWeatherDataBean
);
//保存
}
addMessage
(
redirectAttributes
,
"保存城市气温成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
/**
* 删除城市气温
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:del"
)
@RequestMapping
(
value
=
"delete"
)
public
String
delete
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
RedirectAttributes
redirectAttributes
)
{
chinaWeatherDataBeanService
.
delete
(
chinaWeatherDataBean
);
addMessage
(
redirectAttributes
,
"删除城市气温成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
/**
* 批量删除城市气温
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
chinaWeatherDataBeanService
.
delete
(
chinaWeatherDataBeanService
.
get
(
id
));
}
addMessage
(
redirectAttributes
,
"删除城市气温成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
/**
* 导出excel文件
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:export"
)
@RequestMapping
(
value
=
"export"
,
method
=
RequestMethod
.
POST
)
public
String
exportFile
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
HttpServletRequest
request
,
HttpServletResponse
response
,
RedirectAttributes
redirectAttributes
)
{
try
{
String
fileName
=
"城市气温"
+
DateUtils
.
getDate
(
"yyyyMMddHHmmss"
)+
".xlsx"
;
Page
<
ChinaWeatherDataBean
>
page
=
chinaWeatherDataBeanService
.
findPage
(
new
Page
<
ChinaWeatherDataBean
>(
request
,
response
,
-
1
),
chinaWeatherDataBean
);
new
ExportExcel
(
"城市气温"
,
ChinaWeatherDataBean
.
class
).
setDataList
(
page
.
getList
()).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导出城市气温记录失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
/**
* 导入Excel数据
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:import"
)
@RequestMapping
(
value
=
"import"
,
method
=
RequestMethod
.
POST
)
public
String
importFile
(
MultipartFile
file
,
RedirectAttributes
redirectAttributes
)
{
try
{
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
failureMsg
=
new
StringBuilder
();
ImportExcel
ei
=
new
ImportExcel
(
file
,
1
,
0
);
List
<
ChinaWeatherDataBean
>
list
=
ei
.
getDataList
(
ChinaWeatherDataBean
.
class
);
for
(
ChinaWeatherDataBean
chinaWeatherDataBean
:
list
){
try
{
chinaWeatherDataBeanService
.
save
(
chinaWeatherDataBean
);
successNum
++;
}
catch
(
ConstraintViolationException
ex
){
failureNum
++;
}
catch
(
Exception
ex
)
{
failureNum
++;
}
}
if
(
failureNum
>
0
){
failureMsg
.
insert
(
0
,
",失败 "
+
failureNum
+
" 条城市气温记录。"
);
}
addMessage
(
redirectAttributes
,
"已成功导入 "
+
successNum
+
" 条城市气温记录"
+
failureMsg
);
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导入城市气温失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
/**
* 下载导入城市气温数据模板
*/
@RequiresPermissions
(
"echarts:chinaWeatherDataBean:import"
)
@RequestMapping
(
value
=
"import/template"
)
public
String
importFileTemplate
(
HttpServletResponse
response
,
RedirectAttributes
redirectAttributes
)
{
try
{
String
fileName
=
"城市气温数据导入模板.xlsx"
;
List
<
ChinaWeatherDataBean
>
list
=
Lists
.
newArrayList
();
new
ExportExcel
(
"城市气温数据"
,
ChinaWeatherDataBean
.
class
,
1
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导入模板下载失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/chinaWeatherDataBean/?repage"
;
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/LineController.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.echarts.web
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.jeespring.common.web.AbstractBaseController
;
import
com.jeespring.modules.echarts.entity.ChinaWeatherDataBean
;
import
com.jeespring.modules.echarts.service.ChinaWeatherDataBeanService
;
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/line"
)
public
class
LineController
extends
AbstractBaseController
{
private
static
final
long
serialVersionUID
=
-
6886697421555222670L
;
@Autowired
private
ChinaWeatherDataBeanService
chinaWeatherDataBeanService
;
@RequestMapping
(
value
=
{
"index"
,
""
})
public
String
index
(
ChinaWeatherDataBean
chinaWeatherDataBean
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
//X轴的数据
List
<
String
>
xAxisData
=
new
ArrayList
<
String
>();
//Y轴的数据
Map
<
String
,
List
<
Double
>>
yAxisData
=
new
HashMap
<
String
,
List
<
Double
>>();
//Y轴双轴情况下的位置定位
Map
<
String
,
Integer
>
yAxisIndex
=
new
HashMap
<
String
,
Integer
>();
List
<
ChinaWeatherDataBean
>
weatherDataList
=
chinaWeatherDataBeanService
.
findList
(
chinaWeatherDataBean
);
List
<
Double
>
beijingMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
beijingMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
changchunMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
changchunMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
shenyangMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
shenyangMinTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
haerbinMaxTemp
=
new
ArrayList
<
Double
>();
List
<
Double
>
haerbinMinTemp
=
new
ArrayList
<
Double
>();
for
(
ChinaWeatherDataBean
chinaWeatherDataBeanTemp:
weatherDataList
){
//x轴数据
xAxisData
.
add
(
chinaWeatherDataBeanTemp
.
getDatestr
().
toLocaleString
());
//北京最高温度
beijingMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getBeijingMaxTemp
());
//北京最低温度
beijingMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getBeijingMinTemp
());
//长春最高温度
changchunMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getChangchunMaxTemp
());
//长春最高温度
changchunMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getChangchunMinTemp
());
//沈阳最高温度
shenyangMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getShenyangMaxTemp
());
//沈阳最高温度
shenyangMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getShenyangMinTemp
());
//哈尔滨最高温度
haerbinMaxTemp
.
add
(
chinaWeatherDataBeanTemp
.
getHaerbinMaxTemp
());
//哈尔滨最高温度
haerbinMinTemp
.
add
(
chinaWeatherDataBeanTemp
.
getHaerbinMinTemp
());
}
//y轴数据
yAxisData
.
put
(
"北京 最高温度"
,
beijingMaxTemp
);
yAxisData
.
put
(
"北京 最低温度"
,
beijingMinTemp
);
yAxisData
.
put
(
"长春 最高温度"
,
changchunMaxTemp
);
yAxisData
.
put
(
"长春 最低温度"
,
changchunMinTemp
);
yAxisData
.
put
(
"沈阳 最高温度"
,
shenyangMaxTemp
);
yAxisData
.
put
(
"沈阳 最低温度"
,
shenyangMinTemp
);
yAxisData
.
put
(
"哈尔滨 最高温度"
,
haerbinMinTemp
);
yAxisData
.
put
(
"哈尔滨 最低温度"
,
haerbinMinTemp
);
//Y轴双轴情况下的位置定位
yAxisIndex
.
put
(
"北京 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"长春 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"沈阳 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"哈尔滨 最高温度"
,
0
);
//0表示Y轴左轴
yAxisIndex
.
put
(
"北京 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"长春 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"沈阳 最低温度"
,
1
);
//1表示Y轴右轴
yAxisIndex
.
put
(
"哈尔滨 最低温度"
,
1
);
//1表示Y轴右轴
request
.
setAttribute
(
"yAxisIndex"
,
yAxisIndex
);
request
.
setAttribute
(
"xAxisData"
,
xAxisData
);
request
.
setAttribute
(
"yAxisData"
,
yAxisData
);
return
"modules/echarts/line"
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/LineDoubleNumController.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.echarts.web
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.jeespring.common.web.AbstractBaseController
;
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/linedoublenum"
)
public
class
LineDoubleNumController
extends
AbstractBaseController
{
private
static
final
long
serialVersionUID
=
-
6886697421555222670L
;
private
Map
<
String
,
Double
[][]>
axisDataArr
;
@RequestMapping
(
value
=
{
"index"
,
""
})
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
//x+y轴数据Double[x轴数据][y轴数据]
request
.
setAttribute
(
"axisDataArr"
,
getaxisDataArr
());
return
"modules/echarts/lineDoubleNum"
;
}
public
Map
<
String
,
Double
[][]>
getaxisDataArr
(){
Random
random
=
new
Random
();
axisDataArr
=
new
HashMap
<
String
,
Double
[][]>();
Double
[][]
data1
=
new
Double
[
10
][
2
];
for
(
int
i
=
0
;
i
<
10
;
i
++){
data1
[
i
][
0
]=
i
+
0.0
;
data1
[
i
][
1
]=
random
.
nextInt
(
10
)+
0.0
;
}
axisDataArr
.
put
(
"曲线一"
,
data1
);
Double
[][]
data2
=
new
Double
[
10
][
2
];
for
(
int
i
=
0
;
i
<
10
;
i
++){
data2
[
i
][
0
]=
i
+
1.0
;
data2
[
i
][
1
]=
random
.
nextInt
(
10
)+
0.0
;
}
axisDataArr
.
put
(
"曲线二"
,
data2
);
return
axisDataArr
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/PieClassController.java
0 → 100644
View file @
08c32267
/**
* Copyright © 2015-2020 <a href="http://www.jeespring.org/">JeeSpring</a> All rights reserved.
*/
package
com.jeespring.modules.echarts.web
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolationException
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.servlet.mvc.support.RedirectAttributes
;
import
com.google.common.collect.Lists
;
import
com.jeespring.common.utils.DateUtils
;
import
com.jeespring.common.utils.MyBeanUtils
;
import
com.jeespring.common.config.Global
;
import
com.jeespring.common.persistence.Page
;
import
com.jeespring.common.web.AbstractBaseController
;
import
com.jeespring.common.utils.StringUtils
;
import
com.jeespring.common.utils.excel.ExportExcel
;
import
com.jeespring.common.utils.excel.ImportExcel
;
import
com.jeespring.modules.echarts.entity.PieClass
;
import
com.jeespring.modules.echarts.service.PieClassService
;
/**
* 班级Controller
* @author lgf
* @version 2016-05-26
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/pieClass"
)
public
class
PieClassController
extends
AbstractBaseController
{
@Autowired
private
PieClassService
pieClassService
;
@ModelAttribute
public
PieClass
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
PieClass
entity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
)){
entity
=
pieClassService
.
get
(
id
);
}
if
(
entity
==
null
){
entity
=
new
PieClass
();
}
return
entity
;
}
/**
* 班级列表页面
*/
@RequiresPermissions
(
"echarts:pieClass:list"
)
@RequestMapping
(
value
=
{
"list"
,
""
})
public
String
list
(
PieClass
pieClass
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Page
<
PieClass
>
page
=
pieClassService
.
findPage
(
new
Page
<
PieClass
>(
request
,
response
),
pieClass
);
model
.
addAttribute
(
"page"
,
page
);
//生成报表数据
Map
<
String
,
Object
>
orientData
=
new
HashMap
<
String
,
Object
>();
List
<
PieClass
>
list
=
pieClassService
.
findList
(
pieClass
);
for
(
PieClass
pie:
list
){
orientData
.
put
(
pie
.
getClassName
(),
pie
.
getNum
());
}
model
.
addAttribute
(
"orientData"
,
orientData
);
return
"modules/echarts/pieClassList"
;
}
/**
* 查看,增加,编辑班级表单页面
*/
@RequiresPermissions
(
value
={
"echarts:pieClass:view"
,
"echarts:pieClass:add"
,
"echarts:pieClass:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"form"
)
public
String
form
(
PieClass
pieClass
,
Model
model
)
{
model
.
addAttribute
(
"pieClass"
,
pieClass
);
return
"modules/echarts/pieClassForm"
;
}
/**
* 保存班级
*/
@RequiresPermissions
(
value
={
"echarts:pieClass:add"
,
"echarts:pieClass:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"save"
)
public
String
save
(
PieClass
pieClass
,
Model
model
,
RedirectAttributes
redirectAttributes
)
throws
Exception
{
if
(!
beanValidator
(
model
,
pieClass
)){
return
form
(
pieClass
,
model
);
}
if
(!
pieClass
.
getIsNewRecord
()){
//编辑表单保存
PieClass
t
=
pieClassService
.
get
(
pieClass
.
getId
());
//从数据库取出记录的值
MyBeanUtils
.
copyBeanNotNull2Bean
(
pieClass
,
t
);
//将编辑表单中的非NULL值覆盖数据库记录中的值
pieClassService
.
save
(
t
);
//保存
}
else
{
//新增表单保存
pieClassService
.
save
(
pieClass
);
//保存
}
addMessage
(
redirectAttributes
,
"保存班级成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
/**
* 删除班级
*/
@RequiresPermissions
(
"echarts:pieClass:del"
)
@RequestMapping
(
value
=
"delete"
)
public
String
delete
(
PieClass
pieClass
,
RedirectAttributes
redirectAttributes
)
{
pieClassService
.
delete
(
pieClass
);
addMessage
(
redirectAttributes
,
"删除班级成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
/**
* 批量删除班级
*/
@RequiresPermissions
(
"echarts:pieClass:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
pieClassService
.
delete
(
pieClassService
.
get
(
id
));
}
addMessage
(
redirectAttributes
,
"删除班级成功"
);
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
/**
* 导出excel文件
*/
@RequiresPermissions
(
"echarts:pieClass:export"
)
@RequestMapping
(
value
=
"export"
,
method
=
RequestMethod
.
POST
)
public
String
exportFile
(
PieClass
pieClass
,
HttpServletRequest
request
,
HttpServletResponse
response
,
RedirectAttributes
redirectAttributes
)
{
try
{
String
fileName
=
"班级"
+
DateUtils
.
getDate
(
"yyyyMMddHHmmss"
)+
".xlsx"
;
Page
<
PieClass
>
page
=
pieClassService
.
findPage
(
new
Page
<
PieClass
>(
request
,
response
,
-
1
),
pieClass
);
new
ExportExcel
(
"班级"
,
PieClass
.
class
).
setDataList
(
page
.
getList
()).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导出班级记录失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
/**
* 导入Excel数据
*/
@RequiresPermissions
(
"echarts:pieClass:import"
)
@RequestMapping
(
value
=
"import"
,
method
=
RequestMethod
.
POST
)
public
String
importFile
(
MultipartFile
file
,
RedirectAttributes
redirectAttributes
)
{
try
{
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
failureMsg
=
new
StringBuilder
();
ImportExcel
ei
=
new
ImportExcel
(
file
,
1
,
0
);
List
<
PieClass
>
list
=
ei
.
getDataList
(
PieClass
.
class
);
for
(
PieClass
pieClass
:
list
){
try
{
pieClassService
.
save
(
pieClass
);
successNum
++;
}
catch
(
ConstraintViolationException
ex
){
failureNum
++;
}
catch
(
Exception
ex
)
{
failureNum
++;
}
}
if
(
failureNum
>
0
){
failureMsg
.
insert
(
0
,
",失败 "
+
failureNum
+
" 条班级记录。"
);
}
addMessage
(
redirectAttributes
,
"已成功导入 "
+
successNum
+
" 条班级记录"
+
failureMsg
);
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导入班级失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
/**
* 下载导入班级数据模板
*/
@RequiresPermissions
(
"echarts:pieClass:import"
)
@RequestMapping
(
value
=
"import/template"
)
public
String
importFileTemplate
(
HttpServletResponse
response
,
RedirectAttributes
redirectAttributes
)
{
try
{
String
fileName
=
"班级数据导入模板.xlsx"
;
List
<
PieClass
>
list
=
Lists
.
newArrayList
();
new
ExportExcel
(
"班级数据"
,
PieClass
.
class
,
1
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
addMessage
(
redirectAttributes
,
"导入模板下载失败!失败信息:"
+
e
.
getMessage
());
}
return
"redirect:"
+
Global
.
getAdminPath
()+
"/echarts/pieClass/?repage"
;
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/PieController.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.echarts.web
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.jeespring.common.web.AbstractBaseController
;
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/pie"
)
public
class
PieController
extends
AbstractBaseController
{
private
static
final
long
serialVersionUID
=
7375363226310112119L
;
private
Map
<
String
,
Object
>
orientData
;
@RequestMapping
(
value
=
{
"index"
,
""
})
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
request
.
setAttribute
(
"orientData"
,
getorientData
());
return
"modules/echarts/pie"
;
}
public
Map
<
String
,
Object
>
getorientData
(){
orientData
=
new
HashMap
<
String
,
Object
>();
orientData
.
put
(
"直接访问"
,
335
);
orientData
.
put
(
"邮件营销"
,
310
);
orientData
.
put
(
"联盟广告"
,
234
);
orientData
.
put
(
"视频广告"
,
135
);
orientData
.
put
(
"搜索引擎"
,
1548
);
return
orientData
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/echarts/web/RadarController.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.echarts.web
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.jeespring.common.web.AbstractBaseController
;
@Controller
@RequestMapping
(
value
=
"${adminPath}/echarts/radar"
)
public
class
RadarController
extends
AbstractBaseController
{
private
static
final
long
serialVersionUID
=
7375363226310112119L
;
private
List
<
Map
<
String
,
Object
>>
orientData
;
@RequestMapping
(
value
=
{
"index"
,
""
})
public
String
index
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
request
.
setAttribute
(
"orientData"
,
getorientData8
());
return
"modules/echarts/radar"
;
}
public
List
<
Map
<
String
,
Object
>>
getorientData8
(){
orientData
=
new
ArrayList
<
Map
<
String
,
Object
>>();
Double
[]
dataArr1
=
new
Double
[]{
0.1
*
100
,
0.2
*
100
,
0.3
*
100
,
0.1
*
100
,
0.05
*
100
,
0.05
*
100
,
0.1
*
100
,
0.1
*
100
};
Map
<
String
,
Object
>
mapData1
=
new
HashMap
<
String
,
Object
>();
mapData1
.
put
(
"dataArr"
,
dataArr1
);
mapData1
.
put
(
"title"
,
"玫瑰图1"
);
orientData
.
add
(
mapData1
);
Double
[]
dataArr2
=
new
Double
[]{
0.05
*
100
,
0.05
*
100
,
0.1
*
100
,
0.1
*
100
,
0.1
*
100
,
0.2
*
100
,
0.3
*
100
,
0.1
*
100
};
Map
<
String
,
Object
>
mapData2
=
new
HashMap
<
String
,
Object
>();
mapData2
.
put
(
"dataArr"
,
dataArr2
);
mapData2
.
put
(
"title"
,
"玫瑰图2"
);
orientData
.
add
(
mapData2
);
return
orientData
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/dao/ChatHistoryDao.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.dao
;
import
java.util.List
;
import
com.jeespring.common.persistence.InterfaceBaseDao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.jeespring.modules.iim.entity.ChatHistory
;
/**
* 聊天记录DAO接口
* * * * @author 黄炳桂 516821420@qq.com
* @version 2015-12-29
*/
@Mapper
public
interface
ChatHistoryDao
extends
InterfaceBaseDao
<
ChatHistory
>
{
/**
* 查询列表数据
* @param entity
* @return
*/
List
<
ChatHistory
>
findLogList
(
ChatHistory
entity
);
int
findUnReadCount
(
ChatHistory
chatHistory
);
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/dao/MailBoxDao.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.dao
;
import
com.jeespring.common.persistence.InterfaceBaseDao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.jeespring.modules.iim.entity.MailBox
;
/**
* 发件箱DAO接口
* * * * @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
@Mapper
public
interface
MailBoxDao
extends
InterfaceBaseDao
<
MailBox
>
{
int
getCount
(
MailBox
entity
);
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/dao/MailComposeDao.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.dao
;
import
com.jeespring.common.persistence.InterfaceBaseDao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.jeespring.modules.iim.entity.MailCompose
;
/**
* 发件箱DAO接口
* * * * @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
@Mapper
public
interface
MailComposeDao
extends
InterfaceBaseDao
<
MailCompose
>
{
int
getCount
(
MailCompose
entity
);
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/dao/MailDao.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.dao
;
import
com.jeespring.common.persistence.InterfaceBaseDao
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.jeespring.modules.iim.entity.Mail
;
/**
* 发件箱DAO接口
* * * * @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
@Mapper
public
interface
MailDao
extends
InterfaceBaseDao
<
Mail
>
{
int
getCount
(
MailDao
entity
);
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/dao/MyCalendarDao.java
0 → 100644
View file @
08c32267
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com.jeespring.modules.iim.dao
;
import
com.jeespring.common.persistence.InterfaceBaseDao
;
import
com.jeespring.modules.iim.entity.MyCalendar
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 日历DAO接口
* @author JeeSpring
* @version 2016-04-19
*/
@Mapper
public
interface
MyCalendarDao
extends
InterfaceBaseDao
<
MyCalendar
>
{
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/ChatHistory.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.entity
;
import
org.hibernate.validator.constraints.Length
;
import
com.jeespring.common.utils.excel.annotation.ExcelField
;
import
com.jeespring.common.persistence.AbstractBaseEntity
;
/**
* 聊天记录Entity
* @author 黄炳桂 516821420@qq.com
* @version 2015-12-29
*/
public
class
ChatHistory
extends
AbstractBaseEntity
<
ChatHistory
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
userid1
;
// userid1 发送者id
private
String
userid2
;
// userid2 接收者id
private
String
msg
;
// msg
private
String
status
;
// status
public
ChatHistory
()
{
super
();
}
public
ChatHistory
(
String
id
){
super
(
id
);
}
@Length
(
min
=
0
,
max
=
64
,
message
=
"userid1长度必须介于 0 和 64 之间"
)
@ExcelField
(
title
=
"userid1"
,
align
=
2
,
sort
=
1
)
public
String
getUserid1
()
{
return
userid1
;
}
public
void
setUserid1
(
String
userid1
)
{
this
.
userid1
=
userid1
;
}
@Length
(
min
=
0
,
max
=
64
,
message
=
"userid2长度必须介于 0 和 64 之间"
)
@ExcelField
(
title
=
"userid2"
,
align
=
2
,
sort
=
2
)
public
String
getUserid2
()
{
return
userid2
;
}
public
void
setUserid2
(
String
userid2
)
{
this
.
userid2
=
userid2
;
}
@Length
(
min
=
0
,
max
=
1024
,
message
=
"msg长度必须介于 0 和 1024 之间"
)
@ExcelField
(
title
=
"msg"
,
align
=
2
,
sort
=
3
)
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
@Length
(
min
=
0
,
max
=
45
,
message
=
"status长度必须介于 0 和 45 之间"
)
@ExcelField
(
title
=
"status"
,
align
=
2
,
sort
=
4
)
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/Friend.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.iim.entity
;
public
class
Friend
{
private
String
id
;
private
String
name
;
private
String
face
;
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getId
()
{
return
id
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setFace
(
String
face
)
{
this
.
face
=
face
;
}
public
String
getFace
()
{
return
face
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/Group.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.iim.entity
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Group
{
private
String
name
;
private
int
nums
;
private
int
id
;
private
List
<
Friend
>
item
=
new
ArrayList
();
public
void
setItem
(
List
item
)
{
this
.
item
=
item
;
}
public
List
getItem
()
{
return
item
;
}
public
void
setNums
(
int
nums
)
{
this
.
nums
=
nums
;
}
public
int
getNums
()
{
return
nums
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getId
()
{
return
id
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/LayJson.java
0 → 100644
View file @
08c32267
package
com.jeespring.modules.iim.entity
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
LayJson
{
private
int
status
;
private
String
msg
;
private
List
<
Group
>
data
=
new
ArrayList
();
public
void
setData
(
List
<
Group
>
data
)
{
this
.
data
=
data
;
}
public
List
<
Group
>
getData
()
{
return
data
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
int
getStatus
()
{
return
status
;
}
}
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/Mail.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.entity
;
import
org.hibernate.validator.constraints.Length
;
import
java.util.List
;
import
com.google.common.collect.Lists
;
import
com.jeespring.common.persistence.AbstractBaseEntity
;
/**
* 发件箱Entity
* @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
public
class
Mail
extends
AbstractBaseEntity
<
Mail
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
title
;
// 标题
private
String
overview
;
// 内容概要
private
String
content
;
// 内容
private
List
<
MailBox
>
mailBoxList
=
Lists
.
newArrayList
();
// 子表列表
private
List
<
MailCompose
>
mailComposeList
=
Lists
.
newArrayList
();
// 子表列表
public
Mail
()
{
super
();
}
public
Mail
(
String
id
){
super
(
id
);
}
@Length
(
min
=
0
,
max
=
128
,
message
=
"标题长度必须介于 0 和 128 之间"
)
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
@Length
(
min
=
0
,
max
=
128
,
message
=
"内容概要长度必须介于 0 和 128 之间"
)
public
String
getOverview
()
{
return
overview
;
}
public
void
setOverview
(
String
overview
)
{
this
.
overview
=
overview
;
}
@Length
(
min
=
0
,
max
=
5096
,
message
=
"内容长度必须介于 0 和 5096 之间"
)
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
List
<
MailBox
>
getMailBoxList
()
{
return
mailBoxList
;
}
public
void
setMailBoxList
(
List
<
MailBox
>
mailBoxList
)
{
this
.
mailBoxList
=
mailBoxList
;
}
public
List
<
MailCompose
>
getMailComposeList
()
{
return
mailComposeList
;
}
public
void
setMailComposeList
(
List
<
MailCompose
>
mailComposeList
)
{
this
.
mailComposeList
=
mailComposeList
;
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/MailBox.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.entity
;
import
org.hibernate.validator.constraints.Length
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.jeespring.common.persistence.AbstractBaseEntity
;
import
com.jeespring.modules.sys.entity.User
;
/**
* 发件箱Entity
* @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
public
class
MailBox
extends
AbstractBaseEntity
<
MailBox
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
readstatus
;
// 状态 0 未读 1 已读
private
User
sender
;
// 发件人
private
User
receiver
;
// 收件人
private
Date
sendtime
;
// 发送时间
private
Mail
mail
;
// 邮件外键 父类
public
MailBox
()
{
super
();
}
public
MailBox
(
String
id
){
super
(
id
);
}
public
MailBox
(
Mail
mail
){
this
.
mail
=
mail
;
}
@Length
(
min
=
0
,
max
=
45
,
message
=
"状态 0 未读 1 已读长度必须介于 0 和 45 之间"
)
public
String
getReadstatus
()
{
return
readstatus
;
}
public
void
setReadstatus
(
String
readstatus
)
{
this
.
readstatus
=
readstatus
;
}
public
User
getSender
()
{
return
sender
;
}
public
void
setSender
(
User
sender
)
{
this
.
sender
=
sender
;
}
public
User
getReceiver
()
{
return
receiver
;
}
public
void
setReceiver
(
User
receiver
)
{
this
.
receiver
=
receiver
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
public
Date
getSendtime
()
{
return
sendtime
;
}
public
void
setSendtime
(
Date
sendtime
)
{
this
.
sendtime
=
sendtime
;
}
@Length
(
min
=
0
,
max
=
64
,
message
=
"邮件外键长度必须介于 0 和 64 之间"
)
public
Mail
getMail
()
{
return
mail
;
}
public
void
setMail
(
Mail
mail
)
{
this
.
mail
=
mail
;
}
}
\ No newline at end of file
JeeSpringCloud/jeespring-framework/src/main/java/com/jeespring/modules/iim/entity/MailCompose.java
0 → 100644
View file @
08c32267
/**
* * Copyright © 2015-2020 <a href="https://gitee.com/JeeHuangBingGui/JeeSpring">JeeSpring</a> All rights reserved..
*/
package
com.jeespring.modules.iim.entity
;
import
org.hibernate.validator.constraints.Length
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.google.common.collect.Lists
;
import
com.jeespring.common.utils.Collections3
;
import
com.jeespring.common.utils.StringUtils
;
import
com.jeespring.common.persistence.AbstractBaseEntity
;
import
com.jeespring.modules.sys.entity.User
;
/**
* 发件箱Entity
* @author 黄炳桂 516821420@qq.com
* @version 2015-11-15
*/
public
class
MailCompose
extends
AbstractBaseEntity
<
MailCompose
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
status
;
// 状态 0 草稿 1 已发送
private
String
readstatus
;
// 状态 0 未读 1 已读
private
User
sender
;
// 发送者
private
User
receiver
;
// 接收者
private
List
<
User
>
receiverList
;
// 接收者
private
Date
sendtime
;
// 发送时间
private
Mail
mail
;
// 邮件id 父类
public
MailCompose
()
{
super
();
}
public
MailCompose
(
String
id
){
super
(
id
);
}
public
MailCompose
(
Mail
mail
){
this
.
mail
=
mail
;
}
@Length
(
min
=
0
,
max
=
45
,
message
=
"状态 0 草稿 1 已发送长度必须介于 0 和 45 之间"
)
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
@Length
(
min
=
0
,
max
=
45
,
message
=
"状态 0 未读 1 已读长度必须介于 0 和 45 之间"
)
public
String
getReadstatus
()
{
return
readstatus
;
}
public
void
setReadstatus
(
String
readstatus
)
{
this
.
readstatus
=
readstatus
;
}
public
User
getSender
()
{
return
sender
;
}
public
void
setSender
(
User
sender
)
{
this
.
sender
=
sender
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
public
Date
getSendtime
()
{
return
sendtime
;
}
public
void
setSendtime
(
Date
sendtime
)
{
this
.
sendtime
=
sendtime
;
}
@Length
(
min
=
0
,
max
=
64
,
message
=
"邮件id长度必须介于 0 和 64 之间"
)
public
Mail
getMail
()
{
return
mail
;
}
public
void
setMail
(
Mail
mail
)
{
this
.
mail
=
mail
;
}
public
void
setReceiverList
(
List
<
User
>
receiverList
)
{
this
.
receiverList
=
receiverList
;
}
public
List
<
User
>
getReceiverList
()
{
return
receiverList
;
}
/**
* 获取收件人用户ID
* @return
*/
public
String
getReceiverIds
()
{
return
Collections3
.
extractToString
(
receiverList
,
"user.id"
,
","
)
;
}
/**
* 设置收件人用户ID
* @return
*/
public
void
setReceiverIds
(
String
receiverIds
)
{
this
.
receiverList
=
Lists
.
newArrayList
();
for
(
String
id
:
StringUtils
.
split
(
receiverIds
,
","
)){
this
.
receiverList
.
add
(
new
User
(
id
));
}
}
/**
* 获取收件人用户Name
* @return
*/
public
String
getReceiverNames
()
{
return
Collections3
.
extractToString
(
receiverList
,
"user.name"
,
","
)
;
}
/**
* 设置发件人用户Name
* @return
*/
public
void
setReceiverNames
(
String
receiverNames
)
{
// 什么也不做
}
public
void
setReceiver
(
User
receiver
)
{
this
.
receiver
=
receiver
;
}
public
User
getReceiver
()
{
return
receiver
;
}
}
\ No newline at end of file
Prev
1
…
14
15
16
17
18
19
20
21
Next
Write
Preview
Supports
Markdown
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