Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
Overview
Overview
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
首航-临时账号
api
Commits
be65cb50
Commit
be65cb50
authored
Mar 14, 2024
by
罗胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-3-14
parent
c23939ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
5 deletions
+62
-5
RequestBean.java
src/com/ejweb/core/api/RequestBean.java
+6
-1
RouteVerifyController.java
src/com/ejweb/modules/route/api/RouteVerifyController.java
+47
-4
RouteVerifyService.java
src/com/ejweb/modules/route/service/RouteVerifyService.java
+9
-0
No files found.
src/com/ejweb/core/api/RequestBean.java
View file @
be65cb50
...
...
@@ -5,7 +5,9 @@ import cn.hutool.core.util.ClassUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ejweb.core.exception.CommonException
;
import
com.ejweb.modules.airport.service.StatisticalService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.log4j.Logger
;
import
org.apache.poi.util.SystemOutLogger
;
import
org.hibernate.validator.constraints.NotEmpty
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -28,6 +30,8 @@ import java.util.stream.Collectors;
*/
public
class
RequestBean
{
@NotEmpty
(
message
=
"参数sign不能为NULL"
)
private
String
sign
;
@NotEmpty
(
message
=
"参数content不能为NULL"
)
...
...
@@ -60,6 +64,7 @@ public class RequestBean {
* @return
*/
public
<
T
>
T
getObjectBean
(
Class
<
T
>
clazz
){
if
(
content
==
null
)
return
null
;
try
{
...
...
@@ -98,7 +103,7 @@ public class RequestBean {
* @param obj
* @return
*/
public
static
boolean
containsSqlInjection
(
Object
obj
){
public
boolean
containsSqlInjection
(
Object
obj
){
String
str
=
obj
.
toString
().
toLowerCase
();
if
(
StringUtils
.
contains
(
str
,
"Extractvalue(1,CONCAT(0x7e,Version()))"
)){
return
true
;
...
...
src/com/ejweb/modules/route/api/RouteVerifyController.java
View file @
be65cb50
package
com
.
ejweb
.
modules
.
route
.
api
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ejweb.core.api.RequestBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.base.PageEntity
;
...
...
@@ -14,10 +15,11 @@ import com.ejweb.modules.route.service.RouteVerifyService;
import
com.ejweb.modules.verify.bean.AirlineVerifiedAddBean
;
import
com.ejweb.modules.verify.service.AirlineVerifyService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -39,6 +41,7 @@ import java.util.List;
@RequestMapping
(
value
=
"/api/route/verify"
)
public
class
RouteVerifyController
{
@Autowired
RouteVerifyService
routeVerifyService
;
...
...
@@ -48,9 +51,9 @@ public class RouteVerifyController {
@ResponseBody
@RequestMapping
(
value
=
"/list"
)
public
ResponseBean
getRiskAssessmentList
(
RequestBean
requestBean
)
{
PageEntity
<
AirlineVerifyEntity
>
list
=
null
;
ResponseBean
responseBean
=
new
ResponseBean
();
LOG
.
info
(
"getRiskAssessmentList"
+
requestBean
);
AirlineVerifyBean
bean
=
requestBean
.
getObjectBean
(
AirlineVerifyBean
.
class
);
String
message
=
airlineVerifyService
.
validate
(
bean
);
if
(
message
==
null
)
{
// 通过参数校验
...
...
@@ -165,7 +168,7 @@ public class RouteVerifyController {
public
ResponseBean
updateStatus
(
RequestBean
requestBean
)
{
ResponseBean
responseBean
=
new
ResponseBean
();
VerifyUpdateBean
bean
=
requestBean
.
getObjectBean
(
VerifyUpdateBean
.
class
);
VerifyUpdateBean
bean
=
JSONObject
.
parseObject
(
requestBean
.
getContent
(),
VerifyUpdateBean
.
class
);
String
message
=
routeVerifyService
.
validate
(
bean
);
if
(
"00"
.
equals
(
bean
.
getVerifyStatus
()))
{
...
...
@@ -189,6 +192,46 @@ public class RouteVerifyController {
return
responseBean
;
}
private
final
static
Logger
LOG
=
Logger
.
getLogger
(
RouteVerifyController
.
class
);
/**
* 判断论证状态是否都完成
*/
@ResponseBody
@RequestMapping
(
value
=
"/judge"
)
public
ResponseBean
judge
(
RequestBean
requestBean
)
{
LOG
.
info
(
"参数:"
+
requestBean
);
System
.
out
.
println
(
"requestBean = "
+
requestBean
);
ResponseBean
responseBean
=
new
ResponseBean
();
RouteVerifyBean
bean
=
JSONObject
.
parseObject
(
requestBean
.
getContent
(),
RouteVerifyBean
.
class
);
String
message
=
routeVerifyService
.
validate
(
bean
);
// 通过参数校验
if
(
message
==
null
)
{
try
{
message
=
routeVerifyService
.
judgeConditionCount
(
bean
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
if
(
StringUtils
.
isBlank
(
message
))
{
responseBean
.
setData
(
true
);
}
else
{
responseBean
.
setData
(
false
);
}
LOG
.
info
(
"responseBean = "
+
responseBean
);
return
responseBean
;
}
// 参数校验为通过
responseBean
.
setMessage
(
message
);
responseBean
.
setData
(
false
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
public
static
void
main
(
String
[]
args
)
{
String
content
=
"<p>\r\n\t<p> &lt;p&gt; &amp;lt;p style=&amp;quot;text-indent:20pt;&amp;quot;&amp;gt; 6月30日,在首届世界智能大会的&amp;amp;amp;ldquo;智能城市与社会论坛&amp;amp;amp;rdquo;上,中新天津生态城管委会与太极计算机股份有限公司、中国智慧城市产业技术创新战略联盟、中国软件行业协会三家单位签署战略合作协议。今后,生态城将与各方在智慧城市建设等领域展开全方位战略合作,共同推进智慧民生、智慧管理和智慧经济快速发展。作为智能领域全球首个大型高端交流平台,世界智能大会不仅致力于打造世界级先进智能科技成果发布平台、创新合作平台、产业聚集平台和投融资对接平台,更重在智能领域促进中国与世界的交流合作,将先进的科技成果和发展理念引入国内。此次由中新天津生态城承办的&amp;amp;amp;ldquo;智慧城市与社会论坛;,正是在创新、协调、绿色、开放、共享发展理念不断深入,城市与社会被赋予新内涵、新要求的大背景下,展开的一场以&amp;amp;amp;ldquo;智慧城市与社会&amp;amp;amp;rdquo;为主题的观点交锋和头脑风暴。&amp;amp;lt;/p&amp;amp;gt; &amp;amp;lt;p style=&amp;amp;quot;margin: 8px auto auto; padding: inherit; clear: both; line-height: 26px; color: rgb(128, 128, 128); font-family: Verdana, Arial, sans-serif, &amp;amp;amp;quot;Times New Roman&amp;amp;amp;quot;, 宋体; white-space: normal;&amp;amp;quot;&amp;amp;gt; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp;会议邀请到中国工程院院士李伯虎、阿里巴巴集团副总裁刘松、世界工程组织联合会(WFEO)当选主席Marlene Kanga等10余位国内外嘉宾,以主题演讲和高峰对话等形式,深入探讨了&amp;amp;amp;ldquo;人工智能2.0&amp;amp;amp;rdquo;、&amp;amp;amp;ldquo;智能化思维构建行业大脑&amp;amp;amp;rdquo;、&amp;amp;amp;ldquo;智慧城市行业中智能技术的应用&amp;amp;amp;rdquo;等热点话题,分享新型智慧城市规划、建设与管理运营理念,以及城市智慧治理与社会服务创新的相关成果,为200多位与会者献上了一场精彩的观点盛宴。&amp;amp;lt;/p&amp;amp;gt; &amp;amp;lt;p style=&amp;amp;quot;margin: 8px auto auto; padding: inherit; clear: both; line-height: 26px; color: rgb(128, 128, 128); font-family: Verdana, Arial, sans-serif, &amp;amp;amp;quot;Times New Roman&amp;amp;amp;quot;, 宋体; white-space: normal;&amp;amp;quot;&amp;amp;gt; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp;论坛上,中新天津生态城管委会与太极计算机股份有限公司、中国智慧城市产业技术创新战略联盟、中国软件行业协会三家单位签署战略合作协议,将在智慧城市运营管理,生态城大数据分析,推动科技、信息产业园区建设,共享产业专家智库等方面加强合作。双方今后将积极探索生态城的智慧城市建设、运营、管理新模式,以科技信息手段,助力生态城智慧城市体系建设,推动城市管理向立体化、精细化发展。与此同时,三家单位将充分发挥在各自领域的优势,结合生态城的发展实际和未来需求,推荐品牌企业入驻,通过建设具有国际领先水平的智慧城市智库、研发中心、创新创业基地、示范和体验基地,促进政、产、学、研、用等合作,推动技术创新成果产业转化,加速生态城智慧城市体系建设和产业转型升级。&amp;amp;lt;/p&amp;amp;gt; &amp;amp;lt;p style=&amp;amp;quot;margin: 8px auto auto; padding: inherit; clear: both; line-height: 26px; color: rgb(128, 128, 128); font-family: Verdana, Arial, sans-serif, &amp;amp;amp;quot;Times New Roman&amp;amp;amp;quot;, 宋体; white-space: normal;&amp;amp;quot;&amp;amp;gt; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp; &amp;amp;amp;nbsp;作为中国、新加坡两国政府间的战略性合作项目,中新天津生态城一直致力于提升现有城市发展和服务水平,通过智慧城市综合应用中心、智慧城市大数据平台等项目,推动城市发展。生态城智慧城市项目自启动以来,各项目进展顺利。此次生态城与三家单位签署战略合作协议,将提高政府行政管理和服务能力,促进经济转型升级、培育智慧经济,加快生态城的智慧城市建设步伐。&amp;amp;lt;/p&amp;amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;</p></p>"
;
if
(
content
!=
null
&&
content
.
indexOf
(
">"
)
!=
-
1
&&
content
.
lastIndexOf
(
"<"
)
!=
-
1
&&
content
.
indexOf
(
">"
)
<
content
.
lastIndexOf
(
"<"
))
{
...
...
src/com/ejweb/modules/route/service/RouteVerifyService.java
View file @
be65cb50
...
...
@@ -692,6 +692,15 @@ public class RouteVerifyService extends BaseService<RouteVerifyDao> {
return
""
;
}
public
String
judgeConditionCount
(
RouteVerifyBean
bean
){
FullRouteVerifyEntity
fullRouteVerifyEntity
=
checkRouteVerifyExist
(
bean
.
getVerifId
(),
bean
.
getUserCode
());
int
count
=
conditionDao
.
getUndoneCondition
(
fullRouteVerifyEntity
.
getId
());
if
(
count
!=
0
)
{
return
"条件未反馈完毕"
;
}
return
""
;
}
public
void
sendmail
(
VerifyStatusBean
bean
)
{
List
<
String
>
mails
=
verifyDao
.
getmail
(
"6"
);
...
...
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