Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
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
hlcm
leaf-hlcm
Commits
3105fbe1
Commit
3105fbe1
authored
Sep 19, 2024
by
5743
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
机易查初版框架性开发提交v1.0
parent
5eb17a31
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
1 deletion
+96
-1
pom.xml
pom.xml
+6
-1
JYCInterfaceController.java
...s/hlcm/hlinteface/controllers/JYCInterfaceController.java
+69
-0
standardSecurity.xml
src/main/resources/spring/standardSecurity.xml
+1
-0
jyc_equno_query.lwm
src/main/webapp/WEB-INF/classes/cont/jyc_equno_query.lwm
+20
-0
No files found.
pom.xml
View file @
3105fbe1
...
@@ -222,7 +222,12 @@
...
@@ -222,7 +222,12 @@
<artifactId>
commons-codec
</artifactId>
<artifactId>
commons-codec
</artifactId>
<version>
1.10
</version>
<version>
1.10
</version>
</dependency>
</dependency>
<!-- 机易查接口限流使用 -->
<dependency>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<version>
29.0-jre
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<groupId>
org.apache.httpcomponents
</groupId>
...
...
src/main/java/com/hand/hls/hlcm/hlinteface/controllers/JYCInterfaceController.java
0 → 100644
View file @
3105fbe1
package
com
.
hand
.
hls
.
hlcm
.
hlinteface
.
controllers
;
import
com.alibaba.fastjson.JSONObject
;
import
com.hand.hap.system.controllers.BaseController
;
import
leaf.database.service.DatabaseServiceFactory
;
import
leaf.utils.ObjectRegistryHolder
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
com.google.common.util.concurrent.RateLimiter
;
import
java.util.List
;
import
leaf.database.service.BusinessModelService
;
import
uncertain.composite.CompositeMap
;
import
java.io.IOException
;
@Controller
public
class
JYCInterfaceController
extends
BaseController
{
private
static
final
RateLimiter
rateLimiter
=
RateLimiter
.
create
(
1.0
);
// 每秒允许1个请求
@RequestMapping
(
value
=
"/wjflwar2/getEquStatus"
)
@ResponseBody
public
JSONObject
getEquStatus
(
@RequestParam
(
value
=
"equNo"
,
required
=
true
)
String
equNo
,
@RequestParam
(
value
=
"type"
,
required
=
true
)
String
type
,
@RequestParam
(
value
=
"reqClientIp"
,
required
=
true
)
String
reqClientIp
,
HttpServletResponse
response
)
{
//机易查接口
JSONObject
resultjson
=
new
JSONObject
();
if
(
rateLimiter
.
tryAcquire
()){
try
{
DatabaseServiceFactory
dsf
=
ObjectRegistryHolder
.
getInstanceOfType
(
DatabaseServiceFactory
.
class
);
String
queryBm
=
"cont.jyc_equno_query"
;
CompositeMap
context
=
new
CompositeMap
();
CompositeMap
param
=
new
CompositeMap
();
Boolean
existsFlag
=
false
;
if
(
equNo
!=
null
)
{
param
.
put
(
"machine_number"
,
equNo
);
}
BusinessModelService
bms
=
dsf
.
getModelService
(
queryBm
,
context
);
CompositeMap
result
=
bms
.
queryAsMap
(
param
);
if
(
result
!=
null
)
{
List
<
CompositeMap
>
valueList
=
result
.
getChilds
();
if
(
valueList
!=
null
)
{
for
(
CompositeMap
child
:
valueList
)
{
if
(
child
==
null
)
{
continue
;
}
Long
existcont
=
child
.
getLong
(
"existcont"
);
if
(
existcont
>
0
)
{
existsFlag
=
true
;
}
}
}
}
if
(
existsFlag
)
{
resultjson
.
put
(
"message"
,
"查得"
);
}
else
{
resultjson
.
put
(
"message"
,
"未查得"
);
}
}
catch
(
Exception
e
){
resultjson
.
put
(
"message"
,
"接口故障"
);
}
}
else
{
resultjson
.
put
(
"message"
,
"接口次数超出限制"
);
}
return
resultjson
;
}
}
src/main/resources/spring/standardSecurity.xml
View file @
3105fbe1
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/wx_update_trailer_result.lsc"
/>
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/wx_update_trailer_result.lsc"
/>
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/get_wx_trailer_Info.lsc"
/>
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/get_wx_trailer_Info.lsc"
/>
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/get_wx_usedcar_Info.lsc"
/>
<http
security=
"none"
pattern=
"/modules/interface/INTERFACE_WX/get_wx_usedcar_Info.lsc"
/>
<http
security=
"none"
pattern=
"/wjflwar2/getEquStatus"
/>
<http
security=
"none"
pattern=
"/contract/signature/**"
/>
<http
security=
"none"
pattern=
"/contract/signature/**"
/>
<http
security=
"none"
pattern=
"/jacob/**"
/>
<http
security=
"none"
pattern=
"/jacob/**"
/>
<!--<http security="none" pattern="/**/*.lsc"/>-->
<!--<http security="none" pattern="/**/*.lsc"/>-->
...
...
src/main/webapp/WEB-INF/classes/cont/jyc_equno_query.lwm
0 → 100644
View file @
3105fbe1
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: lpc 9874
$Date: 2017/11/21 9:39:12
$Revision: 1.0
$Purpose:
-->
<bm:model
xmlns:s=
"leaf.plugin.script"
xmlns:bm=
"http://www.leaf-framework.org/schema/bm"
needAccessControl=
"false"
>
<bm:operations>
<bm:operation
name=
"query"
>
<bm:query-sql>
<![CDATA[
select count(1) existcont from prj_project_lease_item li where li.machine_number=${@machine_number}
]]>
</bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field
name=
"existcont"
databaseType=
"NUMBER"
datatype=
"java.lang.Long"
/>
</bm:fields>
</bm:model>
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