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
7fa8137a
Commit
7fa8137a
authored
Oct 22, 2018
by
HuangBingGui
Browse files
no commit message
parent
6c859da2
Changes
202
Hide whitespace changes
Inline
Side-by-side
JeeSpringCloud/src/main/java/com/JeeSpringDriver.java
View file @
7fa8137a
...
...
@@ -11,6 +11,7 @@ import com.jeespring.modules.sys.service.SystemService;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.coyote.http11.Http11NioProtocol
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
...
...
@@ -36,49 +37,59 @@ import java.io.IOException;
* springboot的启动类
* * * @author 黄炳桂 516821420@qq.com
* Created on 2017/1/8 16:20
*
* @EnableAutoConfiguration(exclude = {
* org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
* org.activiti.spring.boot.SecurityAutoConfiguration.class,
* })
* 使用lazyInit缩短Spring Boot启动时间//, lazyInit = true
*/
@EnableCaching
@SpringBootApplication
@ServletComponentScan
(
value
=
{
"com.jeespring"
,
"com.company"
})
@ComponentScan
(
value
=
{
"com.jeespring"
,
"com.company"
})
//,lazyInit = true
@ServletComponentScan
(
basePackages
=
{
"com.jeespring"
,
"com.company"
,
"cn.xxx"
})
@ComponentScan
(
basePackages
=
{
"com.jeespring"
,
"com.company"
,
"cn.xxx"
})
@MapperScan
(
basePackages
={
"com.jeespring.modules.**.dao"
,
"com.company.project.modules.*.dao"
,
"cn.xxx.xxx.modules.*.dao"
})
@EnableScheduling
@ComponentScan
@EnableAutoConfiguration
@Configuration
//@EnableAutoConfiguration(exclude = {
// org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
// org.activiti.spring.boot.SecurityAutoConfiguration.class,
//})
public
class
JeeSpringDriver
{
@Value
(
"${http.port}"
)
private
Integer
port
;
public
static
void
main
(
String
[]
args
)
{
//Spring boot run
//Spring boot run
new
SpringApplicationBuilder
(
JeeSpringDriver
.
class
).
web
(
true
).
run
(
args
);
SystemService
.
printKeyLoadMessage
();
//IM WebSocker
WebSockertFilter
w
=
new
WebSockertFilter
();
WebSockertFilter
w
=
new
WebSockertFilter
();
w
.
startWebsocketChatServer
();
printGods
();
printAnimalsGods
();
printLadyGods
();
printPoetries
();
}
@Bean
public
EmbeddedServletContainerFactory
servletContainer
()
{
TomcatEmbeddedServletContainerFactory
tomcat
=
new
TomcatEmbeddedServletContainerFactory
();
tomcat
.
addAdditionalTomcatConnectors
(
createStandardConnector
());
// 添加http
// 添加http
tomcat
.
addAdditionalTomcatConnectors
(
createStandardConnector
());
return
tomcat
;
}
// 配置http
/**
* 配置http
* @return Connector
*/
private
Connector
createStandardConnector
()
{
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
connector
.
setPort
(
port
);
return
connector
;
}
p
ublic
static
void
printGods
(){
p
rivate
static
void
printGods
()
{
System
.
out
.
println
(
"--------------- 佛祖保佑 神兽护体 女神助攻 流量冲天 ---------------\n"
+
" _ooOoo_ \n"
+
...
...
@@ -102,6 +113,9 @@ public class JeeSpringDriver {
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n"
+
" 佛祖保佑 永不宕机 永无BUG 流量冲天 \n"
+
""
);
}
private
static
void
printAnimalsGods
(){
System
.
out
.
println
(
"\n"
+
" ┏┓ ┏┓+ + \n"
+
...
...
@@ -146,6 +160,9 @@ public class JeeSpringDriver {
" ┃ ┫ ┫ ┃ ┫ ┫ \n"
+
" ┗━┻━┛ ┗━┻━┛ \n"
+
""
);
}
private
static
void
printLadyGods
(){
System
.
out
.
println
(
"\n"
+
" .::::. \n"
+
...
...
@@ -167,6 +184,9 @@ public class JeeSpringDriver {
" ```` ':. ':::::::::' ::::.. \n"
+
" '.:::::' ':'````.. \n"
+
""
);
}
private
static
void
printPoetries
()
{
System
.
out
.
println
(
"\n"
+
" 唐伯虎:\n"
+
...
...
JeeSpringCloud/src/main/java/com/company/project/modules/ylttrip/dao/TfTicketDao.java
View file @
7fa8137a
...
...
@@ -10,7 +10,7 @@ import com.company.project.modules.ylttrip.entity.TfTicket;
/**
* 订单DAO接口
* @author JeeSpring
* @version 2018-10-1
2
* @version 2018-10-1
5
*/
@Mapper
public
interface
TfTicketDao
extends
InterfaceBaseDao
<
TfTicket
>
{
...
...
JeeSpringCloud/src/main/java/com/company/project/modules/ylttrip/entity/TfTicket.java
View file @
7fa8137a
...
...
@@ -17,7 +17,7 @@ import com.jeespring.modules.sys.utils.DictUtils;
/**
* 订单Entity
* @author JeeSpring
* @version 2018-10-1
2
* @version 2018-10-1
5
*/
public
class
TfTicket
extends
AbstractBaseEntity
<
TfTicket
>
{
...
...
JeeSpringCloud/src/main/java/com/company/project/modules/ylttrip/rest/TfTicketRestController.java
View file @
7fa8137a
...
...
@@ -42,7 +42,7 @@ import org.springframework.web.bind.annotation.*;
/**
* 订单Controller
* @author JeeSpring
* @version 2018-10-1
2
* @version 2018-10-1
5
*/
@RestController
@RequestMapping
(
value
=
"/rest/ylttrip/tfTicket"
)
...
...
JeeSpringCloud/src/main/java/com/company/project/modules/ylttrip/service/ITfTicketService.java
View file @
7fa8137a
...
...
@@ -10,7 +10,7 @@ import com.company.project.modules.ylttrip.entity.TfTicket;
/**
* I订单Service
* @author JeeSpring
* @version 2018-10-1
2
* @version 2018-10-1
5
*/
public
interface
ITfTicketService
extends
InterfaceBaseService
<
TfTicket
>
{
}
\ No newline at end of file
JeeSpringCloud/src/main/java/com/company/project/modules/ylttrip/web/TfTicketController.java
View file @
7fa8137a
...
...
@@ -32,14 +32,12 @@ import com.jeespring.common.utils.StringUtils;
import
com.jeespring.common.utils.excel.ExportExcel
;
import
com.jeespring.common.utils.excel.ImportExcel
;
import
com.company.project.modules.ylttrip.entity.TfTicket
;
import
com.company.project.modules.ylttrip.service.TfTicketService
;
import
com.company.project.modules.ylttrip.service.ITfTicketService
;
import
com.alibaba.dubbo.config.annotation.Reference
;
/**
* 订单Controller
* @author JeeSpring
* @version 2018-10-1
2
* @version 2018-10-1
5
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/ylttrip/tfTicket"
)
...
...
@@ -95,18 +93,21 @@ public class TfTicketController extends AbstractBaseController {
//x轴数据
xAxisData
.
add
(
tfTicketItem
.
getTotalDate
());
countList
.
add
(
Double
.
valueOf
(
tfTicketItem
.
getTotalCount
()));
if
(
tfTicketItem
.
getSumGoodsNum
()!=
null
)
if
(
tfTicketItem
.
getSumGoodsNum
()!=
null
)
{
sumGoodsNumList
.
add
(
Double
.
valueOf
(
tfTicketItem
.
getSumGoodsNum
()));
else
}
else
{
tfTicketItem
.
setSumGoodsNum
(
0
D
);
if
(
tfTicketItem
.
getSumPrice
()!=
null
)
}
if
(
tfTicketItem
.
getSumPrice
()!=
null
)
{
sumPriceList
.
add
(
Double
.
valueOf
(
tfTicketItem
.
getSumPrice
()));
else
}
else
{
tfTicketItem
.
setSumPrice
(
0
D
);
if
(
tfTicketItem
.
getSumSalePrice
()!=
null
)
}
if
(
tfTicketItem
.
getSumSalePrice
()!=
null
)
{
sumSalePriceList
.
add
(
Double
.
valueOf
(
tfTicketItem
.
getSumSalePrice
()));
else
}
else
{
tfTicketItem
.
setSumSalePrice
(
0
D
);
}
}
yAxisData
.
put
(
"数量"
,
countList
);
yAxisData
.
put
(
"商品数量"
,
sumGoodsNumList
);
...
...
@@ -197,8 +198,9 @@ public class TfTicketController extends AbstractBaseController {
public
String
form
(
TfTicket
tfTicket
,
Model
model
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
model
.
addAttribute
(
"action"
,
request
.
getParameter
(
"action"
));
model
.
addAttribute
(
"tfTicket"
,
tfTicket
);
if
(
request
.
getParameter
(
"ViewFormType"
)!=
null
&&
request
.
getParameter
(
"ViewFormType"
)
.
equals
(
"FormTwo"
))
if
(
request
.
getParameter
(
"ViewFormType"
)!=
null
&&
"FormTwo"
.
equals
(
request
.
getParameter
(
"ViewFormType"
)))
{
return
"modules/ylttrip/tfTicketFormTwo"
;
}
return
"modules/ylttrip/tfTicketForm"
;
}
...
...
@@ -244,7 +246,7 @@ public class TfTicketController extends AbstractBaseController {
@RequiresPermissions
(
"ylttrip:tfTicket:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
String
deleteAll
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
tfTicketService
.
delete
(
tfTicketService
.
get
(
id
));
}
...
...
@@ -258,7 +260,7 @@ public class TfTicketController extends AbstractBaseController {
@RequiresPermissions
(
value
={
"ylttrip:tfTicket:del"
,
"ylttrip:tfTicket:delByLogic"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"deleteAllByLogic"
)
public
String
deleteAllByLogic
(
String
ids
,
RedirectAttributes
redirectAttributes
)
{
String
idArray
[]
=
ids
.
split
(
","
);
String
[]
idArray
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
tfTicketService
.
deleteByLogic
(
tfTicketService
.
get
(
id
));
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/config/Global.java
View file @
7fa8137a
...
...
@@ -90,8 +90,9 @@ public class Global {
if
(
value
==
null
)
{
try
{
value
=
resolver
.
getProperty
(
key
);
if
(
StringUtils
.
isBlank
(
value
))
if
(
StringUtils
.
isBlank
(
value
))
{
throw
new
RuntimeException
(
"value null"
);
}
map
.
put
(
key
,
value
);
}
catch
(
Exception
e
)
{
value
=
loader
.
getProperty
(
key
);
...
...
@@ -171,8 +172,9 @@ public class Global {
}
public
static
String
getJdbcType
()
{
if
(
map
.
containsKey
(
"spring.datasource.url"
))
if
(
map
.
containsKey
(
"spring.datasource.url"
))
{
return
map
.
get
(
"spring.datasource.url"
);
}
try
{
String
url
=
resolver
.
getProperty
(
"spring.datasource.url"
);
String
type
=
getDbType
(
url
);
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/config/ShiroConfig.java
View file @
7fa8137a
...
...
@@ -225,7 +225,7 @@ public class ShiroConfig {
)
{
DefaultWebSecurityManager
defaultWebSecurityManager
=
new
DefaultWebSecurityManager
();
defaultWebSecurityManager
.
setSessionManager
(
sessionManager
);
if
(
redisRun
.
equals
(
"true"
)
&&
"true"
.
equals
(
shiroRedis
)){
if
(
"true"
.
equals
(
redisRun
)
&&
"true"
.
equals
(
shiroRedis
)){
try
{
// 加入缓存管理器
defaultWebSecurityManager
.
setCacheManager
(
redisCacheManager
(
redisHostName
,
reidsPassword
,
redisPort
,
expireTimeShiro
));
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/filter/OnlineSessionFilter.java
View file @
7fa8137a
...
...
@@ -66,8 +66,9 @@ public class OnlineSessionFilter //extends AccessControlFilter
{
onlineSession
.
setUserId
(
user
.
getId
());
onlineSession
.
setLoginName
(
user
.
getLoginName
());
if
(
user
.
getOffice
()!=
null
)
if
(
user
.
getOffice
()!=
null
)
{
onlineSession
.
setDeptName
(
user
.
getOffice
().
getName
());
}
onlineSession
.
markAttributeChanged
();
UserAgent
userAgent
=
UserAgent
.
parseUserAgentString
(
ServletUtils
.
getRequest
().
getHeader
(
"User-Agent"
));
// 获取客户端操作系统
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/mail/MailAuthenticator.java
View file @
7fa8137a
...
...
@@ -14,7 +14,8 @@ public class MailAuthenticator extends Authenticator{
this
.
userName
=
username
;
this
.
password
=
password
;
}
protected
PasswordAuthentication
getPasswordAuthentication
(){
@Override
protected
PasswordAuthentication
getPasswordAuthentication
(){
return
new
PasswordAuthentication
(
userName
,
password
);
}
}
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/AbstractBaseEntity.java
View file @
7fa8137a
...
...
@@ -40,7 +40,9 @@ public abstract class AbstractBaseEntity<T> extends AbstractEntity<T> {
protected
String
totalType
;
public
void
setExtendMap
(
String
item
,
Object
object
)
{
if
(
extendMap
==
null
)
extendMap
=
new
HashMap
<
String
,
Object
>();
if
(
extendMap
==
null
)
{
extendMap
=
new
HashMap
<
String
,
Object
>();
}
extendMap
.
put
(
item
,
object
);
}
...
...
@@ -49,7 +51,9 @@ public abstract class AbstractBaseEntity<T> extends AbstractEntity<T> {
}
public
JSONObject
setExtendObject
(
String
item
,
Object
object
){
if
(
jsonObject
==
null
)
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
this
));
if
(
jsonObject
==
null
)
{
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
this
));
}
jsonObject
.
put
(
item
,
object
);
return
jsonObject
;
}
...
...
@@ -144,7 +148,9 @@ public abstract class AbstractBaseEntity<T> extends AbstractEntity<T> {
@JSONField
(
serialize
=
false
)
@Length
(
min
=
1
,
max
=
1
)
public
String
getDelFlag
()
{
if
(
delFlag
==
null
)
delFlag
=
"0"
;
if
(
delFlag
==
null
)
{
delFlag
=
"0"
;
}
return
delFlag
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/ActEntity.java
View file @
7fa8137a
/**
* Copyright © 2012-2016 <a href="https://git
hub
.com/
thinkgem/jeesite
">JeeS
ite
</a> All rights reserved.
* Copyright © 2012-2016 <a href="https://git
ee
.com/
JeeHuangBingGui/jeeSpringCloud
">JeeS
pring
</a> All rights reserved.
*/
package
com.jeespring.common.persistence
;
...
...
@@ -10,7 +10,7 @@ import com.jeespring.modules.act.entity.Act;
/**
* Activiti Entity类
* @author
ThinkGem
* @author
JeeSpring
* @version 2013-05-28
*/
public
abstract
class
ActEntity
<
T
>
extends
AbstractBaseEntity
<
T
>
implements
Serializable
{
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/InterfaceBaseService.java
View file @
7fa8137a
...
...
@@ -74,8 +74,8 @@ public interface InterfaceBaseService<T> {
* @param entity
* @return
* @see public int delete(T entity)
* @Deprecated
*/
@Deprecated
void
delete
(
T
entity
);
/**
...
...
@@ -83,8 +83,8 @@ public interface InterfaceBaseService<T> {
* @param entity
* @see public int delete(T entity)
* @return
* @Deprecated
*/
@Deprecated
void
deleteByLogic
(
T
entity
);
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/dialect/H2Dialect.java
View file @
7fa8137a
...
...
@@ -14,6 +14,7 @@ import com.jeespring.common.persistence.dialect.Dialect;
*/
public
class
H2Dialect
implements
Dialect
{
@Override
public
boolean
supportsLimit
()
{
return
true
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/dialect/MySQLDialect.java
View file @
7fa8137a
...
...
@@ -21,6 +21,7 @@ public class MySQLDialect implements Dialect {
Integer
.
toString
(
limit
));
}
@Override
public
boolean
supportsLimit
()
{
return
true
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/dialect/PostgreSQLDialect.java
View file @
7fa8137a
...
...
@@ -13,6 +13,7 @@ import com.jeespring.common.persistence.dialect.Dialect;
*/
public
class
PostgreSQLDialect
implements
Dialect
{
@Override
public
boolean
supportsLimit
()
{
return
true
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/dialect/SQLServerDialect.java
View file @
7fa8137a
...
...
@@ -14,6 +14,7 @@ import com.jeespring.common.persistence.dialect.Dialect;
*/
public
class
SQLServerDialect
implements
Dialect
{
@Override
public
boolean
supportsLimit
()
{
return
true
;
}
...
...
@@ -24,6 +25,7 @@ public class SQLServerDialect implements Dialect {
return
selectIndex
+
(
selectDistinctIndex
==
selectIndex
?
15
:
6
);
}
@Override
public
String
getLimitString
(
String
sql
,
int
offset
,
int
limit
)
{
return
getLimit
(
sql
,
offset
,
limit
);
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/persistence/dialect/SybaseDialect.java
View file @
7fa8137a
...
...
@@ -15,6 +15,7 @@ import com.jeespring.common.persistence.dialect.Dialect;
*/
public
class
SybaseDialect
implements
Dialect
{
@Override
public
boolean
supportsLimit
()
{
return
false
;
}
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/redis/JedisUtils.java
View file @
7fa8137a
...
...
@@ -24,7 +24,7 @@ import redis.clients.jedis.exceptions.JedisException;
/**
* Jedis Cache 工具类
*
* @author
ThinkGem
* @author
JeeSpring
* @version 2014-6-29
*/
public
class
JedisUtils
{
...
...
JeeSpringCloud/src/main/java/com/jeespring/common/redis/RedisRestController.java
View file @
7fa8137a
...
...
@@ -87,10 +87,11 @@ public class RedisRestController {
@RequestMapping
(
value
=
"/exists"
,
method
={
RequestMethod
.
POST
,
RequestMethod
.
GET
})
@ApiOperation
(
value
=
"Redis exists接口(Content-Type为text/html)"
,
notes
=
"Redis exists接口(Content-Type为text/html)"
)
public
Result
exists
(
@RequestParam
(
required
=
false
)
String
key
)
{
if
(
redisUtils
.
exists
(
key
))
if
(
redisUtils
.
exists
(
key
))
{
return
ResultFactory
.
getSuccessResult
(
"存在!"
);
else
}
else
{
return
ResultFactory
.
getErrorResult
(
"不存在!"
);
}
}
/**
...
...
@@ -105,8 +106,9 @@ public class RedisRestController {
if
(
redisUtils
.
exists
(
key
)){
Result
result
=
ResultFactory
.
getSuccessResult
();
Object
obj
=
redisUtils
.
get
(
key
);
if
(
obj
!=
null
)
if
(
obj
!=
null
)
{
result
.
setResultObject
(
obj
.
toString
());
}
return
result
;
}
else
{
return
ResultFactory
.
getErrorResult
(
"不存在!"
);
...
...
Prev
1
2
3
4
5
…
11
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