Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-api-report
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
雷紫添
xzxt-api-report
Commits
39beb8d2
Commit
39beb8d2
authored
Sep 03, 2019
by
雷紫添
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加内蒙测试按钮
parent
f1c4ae9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
13 deletions
+71
-13
src/main/java/com/founder/controller/FaceController.java
+46
-12
src/main/java/com/founder/test.java
+14
-1
src/main/resources/templates/index.html
+11
-0
No files found.
src/main/java/com/founder/controller/FaceController.java
View file @
39beb8d2
package
com
.
founder
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.founder.common.CodeMsg
;
import
com.founder.model.Face
;
import
com.founder.model.Jccj
;
import
com.founder.service.AutoSeqService
;
import
com.founder.service.FaceService
;
import
com.founder.service.impl.JccjServiceImpl
;
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.RestController
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.Base64
;
import
java.util.List
;
import
java.util.Map
;
@Controller
@RestController
public
class
FaceController
{
@Autowired
private
FaceService
faceService
;
@Autowired
private
AutoSeqService
autoSeqService
;
@Autowired
private
CodeMsg
codeMsg
;
@ResponseBody
@RequestMapping
(
"/query"
)
public
String
query
()
{
List
<
Face
>
face
=
faceService
.
query
();
/*
List<Face> face = faceService.query();
for (Map<String, String> item : codeMsg.getStatus()) {
if (item.get("code").equals("001"))
System.out.println( item.get("name"));
...
...
@@ -31,9 +35,39 @@ public class FaceController {
if("001".equals(item.get("code"))){
System.out.println(item.get("name"));
}
});
String
noo
=
autoSeqService
.
xxzjbhFnVal
(
"TB_ST_ASJ"
,
"1400000000000"
);
return
noo
;
});*/
final
Base64
.
Decoder
decoder
=
Base64
.
getDecoder
();
final
Base64
.
Encoder
encoder
=
Base64
.
getEncoder
();
Jccj
jccj
=
new
Jccj
();
try
{
URL
url
=
new
URL
(
"http://47.92.129.99/neimeng/FZXZ/201909/JCXX-R1100000500002014070008.zip"
);
InputStream
inStream
=
null
;
inStream
=
url
.
openStream
();
ByteArrayOutputStream
swapStream
=
new
ByteArrayOutputStream
();
byte
[]
buff
=
new
byte
[
100
];
//buff用于存放循环读取的临时数据
int
rc
=
0
;
while
((
rc
=
inStream
.
read
(
buff
,
0
,
100
))
>
0
)
{
swapStream
.
write
(
buff
,
0
,
rc
);
}
byte
[]
in_b
=
swapStream
.
toByteArray
();
//in_b为转换之后的结果
final
String
encodedText
=
encoder
.
encodeToString
(
in_b
);
//编码
jccj
.
setXxsb_zip
(
encodedText
);
jccj
.
setTaskid
(
"JCXX-R1100000500002014070008"
);
jccj
.
setUser_id
(
"142728188997588823"
);
jccj
.
setUser_dept
(
"1400000000"
);
jccj
.
setVersion
(
"1.00"
);
//发送,httpclient 包含zip包
JSONObject
jsonResult
=
JccjServiceImpl
.
requestByPost
(
"http://www.xzxt.nm:9061/jccj/xxbs"
,
jccj
);
System
.
out
.
println
(
"返回的参数为::"
+
jsonResult
.
toJSONString
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
"已执行"
;
}
}
src/main/java/com/founder/test.java
View file @
39beb8d2
...
...
@@ -7,8 +7,11 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.Base64
;
@Component
public
class
test
{
...
...
@@ -17,7 +20,16 @@ public class test {
try
{
final
Base64
.
Decoder
decoder
=
Base64
.
getDecoder
();
final
Base64
.
Encoder
encoder
=
Base64
.
getEncoder
();
/*直接从服务器获取zip包并转成base64 URL url = new URL("http://47.92.129.99/neimeng/FZXZ/201909/JCXX-R1100000500002014070008.zip");
InputStream inStream = url.openStream();
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100]; //buff用于存放循环读取的临时数据
int rc = 0;
while ((rc = inStream.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
byte[] in_b = swapStream.toByteArray(); //in_b为转换之后的结果
final String encodedText = encoder.encodeToString(in_b);*/
Jccj
jccj
=
new
Jccj
();
File
file
=
new
File
(
"D:/JCXX-R1100000500002014070008.zip"
);
FileInputStream
inputFile
=
new
FileInputStream
(
file
);
...
...
@@ -26,6 +38,7 @@ public class test {
inputFile
.
close
();
//编码
final
String
encodedText
=
encoder
.
encodeToString
(
buffer
);
jccj
.
setXxsb_zip
(
encodedText
);
jccj
.
setTaskid
(
"JCXX-R1100000500002014070008"
);
jccj
.
setUser_id
(
"142728188997588823"
);
...
...
src/main/resources/templates/index.html
0 → 100644
View file @
39beb8d2
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
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