Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
常超
map-parent
Commits
b31b6c88
Commit
b31b6c88
authored
Apr 28, 2022
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海南人像轨迹、比对、回溯、摄像头落地接口提交
parent
9565b9ca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
482 additions
and
12 deletions
+482
-12
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/CameraData.java
+19
-0
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/CameraFaceResult.java
+2
-0
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/FaceSearchParam.java
+9
-0
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/FaceSearchResult.java
+1
-1
common/common_utils/src/main/java/com/founder/commonutils/util/HttpUtil.java
+36
-1
common/common_utils/src/main/java/com/founder/commonutils/util/RsaUtil.java
+130
-0
common/common_utils/src/main/java/com/founder/commonutils/util/TokenUtils.java
+64
-3
common/common_utils/src/main/resources/token.properties
+9
-3
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/controller/ImageController.java
+89
-0
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/mapper/CameraInfoMapper.java
+26
-0
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/mapper/xml/CameraInfoMapper.xml
+61
-0
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/service/ImageService.java
+30
-0
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/service/impl/ImageServiceImpl.java
+0
-0
serviceapi/peopleapi/src/main/resources/bootstrap.properties
+6
-4
No files found.
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/CameraData.java
0 → 100644
View file @
b31b6c88
package
com
.
founder
.
commonutils
.
peopleEntity
;
import
lombok.Data
;
/**
* 翻译结果
* @Author yangyang
* @Date 2022/04/28
*/
@Data
public
class
CameraData
{
private
String
deviceId
;
private
String
deviceName
;
private
String
longitude
;
private
String
latitude
;
private
String
deviceAddress
;
private
String
gbCode
;
}
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/CameraFaceResult.java
View file @
b31b6c88
...
...
@@ -12,6 +12,8 @@ public class CameraFaceResult {
//摄像头id(云天)
private
String
cameraId
;
//摄像头名称
private
String
cameraName
;
//抓拍时间
...
...
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/FaceSearchParam.java
View file @
b31b6c88
...
...
@@ -62,6 +62,7 @@ public class FaceSearchParam {
private
String
mask
=
""
;
private
Integer
maskConfidence
=
1
;
private
List
<
String
>
tagIds
;
private
String
base64Img
;
public
String
getFaceSize
()
{
return
faceSize
;
...
...
@@ -310,4 +311,12 @@ public class FaceSearchParam {
public
void
setTagIds
(
List
<
String
>
tagIds
)
{
this
.
tagIds
=
tagIds
;
}
public
String
getBase64Img
()
{
return
base64Img
;
}
public
void
setBase64Img
(
String
base64Img
)
{
this
.
base64Img
=
base64Img
;
}
}
common/common_utils/src/main/java/com/founder/commonutils/peopleEntity/FaceSearchResult.java
View file @
b31b6c88
...
...
@@ -9,7 +9,7 @@ public class FaceSearchResult {
private
String
id
;
//人脸id (faceId)
private
String
cameraId
;
//摄像头id
private
String
cameraName
;
//摄像头名称
private
String
file
;
//图片路径
private
String
file
;
//
人脸
图片路径
private
String
imageUrl
;
//大图路径
private
String
time
;
//拍摄时间
private
String
score
;
//相似度
...
...
common/common_utils/src/main/java/com/founder/commonutils/util/HttpUtil.java
View file @
b31b6c88
...
...
@@ -66,7 +66,7 @@ public class HttpUtil {
e
.
printStackTrace
();
}
StringBuffer
sb
=
new
StringBuffer
();
//
System.out.println(response.getStatusLine());
//
System.out.println(response.getStatusLine());
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
InputStream
instream
=
null
;
...
...
@@ -126,6 +126,41 @@ public class HttpUtil {
return
sb
.
toString
();
}
public
static
String
doGetKyCamera
(
String
uri
)
{
HttpClient
httpclient
=
new
DefaultHttpClient
();
HttpGet
httpget
=
new
HttpGet
(
uri
);
httpget
.
setHeader
(
"Authorization"
,
TokenUtils
.
getHnKyToken
());
httpget
.
setHeader
(
"Content-Type"
,
"application/json"
);
HttpResponse
response
=
null
;
try
{
response
=
httpclient
.
execute
(
httpget
);
}
catch
(
ClientProtocolException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
StringBuffer
sb
=
new
StringBuffer
();
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
InputStream
instream
=
null
;
try
{
instream
=
entity
.
getContent
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
instream
,
"UTF-8"
));
String
temp
=
null
;
while
((
temp
=
reader
.
readLine
())!=
null
){
sb
.
append
(
temp
);
}
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
}
}
httpclient
.
getConnectionManager
().
shutdown
();
return
sb
.
toString
();
}
public
static
String
doGetEsb
(
String
uri
,
String
id
)
{
HttpClient
httpclient
=
new
DefaultHttpClient
();
...
...
common/common_utils/src/main/java/com/founder/commonutils/util/RsaUtil.java
0 → 100644
View file @
b31b6c88
package
com
.
founder
.
commonutils
.
util
;
import
org.apache.commons.codec.binary.Base64
;
import
java.security.*
;
import
java.security.spec.PKCS8EncodedKeySpec
;
import
java.security.spec.X509EncodedKeySpec
;
/**
* SHA1WithRSA-数字签名工具类
* Created by yangyang on 2022/04/27.
*/
public
class
RsaUtil
{
//加密算法
public
static
final
String
SIGN_ALGORITHMS
=
"SHA1WithRSA"
;
//私钥
private
static
final
String
privateKey
=
"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANF/IIsbi9+v5V0V"
+
"lXeDWp3LlWNXf1gQ3EYjbdj4qMJJoVaLUv2T6fsQq4MTGO6h0HaPQPb80g2VXXgt"
+
"wOBAGhTN5ifi8VLkHp8h+sU3/hmR2q3eyUeUEaX8t53leWQiI462O23bysectI5l"
+
"mqzkL/68LTzSpu8z308XSWOFdXKVAgMBAAECgYA7qjIxjCndDjKLvT7xZ8aiFD46"
+
"qcvJ4BtsGmEJn2Ao3WGGzW1YbQ0BhTDjxseeBxXg/lGpRj3ownZ5aMZ616bVa8xF"
+
"dI9agmElnM78RhUgJNtOelY4yB3vMQmdpYxhA6Zp+Z10DCvKyxiostqrLw/zdSr8"
+
"ZkmRof1DUMml5FZzYQJBAPe8zQsHqXeGSjvAEpPpBX87Wzc7/T6tObuOokxOrWfP"
+
"mZFO7qy2rsdOkmn8LghIhzvOognoT6DiBhO4UIgJAMkCQQDYe9Kfju7JhbhE0SRh"
+
"+1hSRRV8+6vRmpTIxJpy+AN3Oc6oeiQ6UE7/ZxyeZ0pDgmBZGJDBHoX1rIYrsuMm"
+
"grVtAkEA0YwHO88tTwZuAABFNoshtS71xtCdMsi/TqAlM7pQ/sAgu0IyrDCRwc/6"
+
"FF/UZ/lBOhtcAFlaEVFdpox+wbIr0QJBAM9BJHF7ruKiMbs4m2Nu9ay11Q+2BlYC"
+
"b0US7Gb7SJ4hatdjMEHf1vGvrvd8Hd4p+MHzwcoRxeBhToaRmeSpqLUCQFFTCNRl"
+
"E/0Qo8hKLJlu8NpN00/VznTp+llGsSelmpOJ3QVWWoFR4egxfkvS5k+lU3Xwwu4l"
+
"jXh7gLxPRfTprgk="
;
//公钥
private
static
final
String
publicKey
=
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRfyCLG4vfr+VdFZV3g1qdy5Vj\n"
+
"V39YENxGI23Y+KjCSaFWi1L9k+n7EKuDExjuodB2j0D2/NINlV14LcDgQBoUzeYn"
+
"4vFS5B6fIfrFN/4Zkdqt3slHlBGl/Led5XlkIiOOtjtt28rHnLSOZZqs5C/+vC08"
+
"0qbvM99PF0ljhXVylQIDAQAB"
;
/**
* 使用私钥给入参签名
* @param param 签名的数据
* @return 返回入参签名16进制字符串
* */
public
static
String
sign
(
String
param
)
{
try
{
//获取privatekey
byte
[]
privateKeyByte
=
new
Base64
().
decode
(
privateKey
);
KeyFactory
keyfactory
=
KeyFactory
.
getInstance
(
"RSA"
);
PKCS8EncodedKeySpec
encoderule
=
new
PKCS8EncodedKeySpec
(
privateKeyByte
);
PrivateKey
key
=
keyfactory
.
generatePrivate
(
encoderule
);
//用私钥给入参加签
Signature
sign
=
Signature
.
getInstance
(
SIGN_ALGORITHMS
);
sign
.
initSign
(
key
);
sign
.
update
(
param
.
getBytes
());
byte
[]
signature
=
sign
.
sign
();
//将签名的入参转换成16进制字符串
return
bytesToHexStr
(
signature
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 用公钥验证签名
* @param param 入参
* @param signature 使用私钥签名的入参字符串
* @param publicKey 公钥
* @return 返回验证结果
* */
public
static
boolean
verifyRes
(
String
param
,
String
signature
,
String
publicKey
){
try
{
//获取公钥
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
"RSA"
);
byte
[]
publicKeyByte
=
new
Base64
().
decode
(
publicKey
);
X509EncodedKeySpec
encodeRule
=
new
X509EncodedKeySpec
(
publicKeyByte
);
PublicKey
key
=
keyFactory
.
generatePublic
(
encodeRule
);
//用获取到的公钥对 入参中未加签参数param入参中的加签之后的参数signature进行验签
Signature
sign
=
Signature
.
getInstance
(
SIGN_ALGORITHMS
);
sign
.
initVerify
(
key
);
sign
.
update
(
param
.
getBytes
());
//将16进制码转成字符数组
byte
[]
hexByte
=
hexStrToBytes
(
signature
);
//验证签名
return
sign
.
verify
(
hexByte
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
/**
* byte数组转换成十六进制字符串
* @param bytes byte数组
* @return 返回十六进制字符串
*/
private
static
String
bytesToHexStr
(
byte
[]
bytes
)
{
StringBuffer
stringBuffer
=
new
StringBuffer
(
""
);
for
(
int
i
=
0
;
i
<
bytes
.
length
;
++
i
)
{
stringBuffer
.
append
(
Integer
.
toHexString
(
0x0100
+
(
bytes
[
i
]
&
0x00FF
)).
substring
(
1
).
toUpperCase
());
}
return
stringBuffer
.
toString
();
}
/**
* 十六进制字符串转成byte数组
* @param hexStr 十六进制字符串
* @return 返回byte数组
* */
private
static
byte
[]
hexStrToBytes
(
String
hexStr
)
{
byte
[]
bytes
=
new
byte
[
hexStr
.
length
()
/
2
];
for
(
int
i
=
0
;
i
<
bytes
.
length
;
i
++)
{
bytes
[
i
]
=
(
byte
)
Integer
.
parseInt
(
hexStr
.
substring
(
2
*
i
,
2
*
i
+
2
),
16
);
}
return
bytes
;
}
public
static
void
main
(
String
[]
args
)
{
String
param
=
"yanshao"
;
String
sign
=
sign
(
param
);
System
.
out
.
println
(
"签名后的参数>>>"
+
sign
);
System
.
out
.
println
(
"验证结果>>>"
+
verifyRes
(
param
,
sign
,
publicKey
));
}
}
\ No newline at end of file
common/common_utils/src/main/java/com/founder/commonutils/util/TokenUtils.java
View file @
b31b6c88
...
...
@@ -16,7 +16,6 @@ import org.apache.http.impl.client.CloseableHttpClient;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.message.BasicNameValuePair
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
...
...
@@ -24,9 +23,9 @@ import java.util.*;
/**
* @ClassName: HttpClient
* @Auther:
杨洋
* @Auther:
yangyang
* @Description: java类作用描述
* @CreateDate: 202
1-03-1
8
* @CreateDate: 202
2-04-2
8
* @Version: 1.0
*/
@Component
...
...
@@ -161,4 +160,66 @@ public class TokenUtils {
}
return
resultString
;
}
// 海南凯亚token获取
public
static
String
getHnKyToken
(){
String
result_token
=
""
;
try
{
//先比较已有token是否过期
long
nowtime
=
new
Date
().
getTime
();
//获取绝对路径下的token属性文件
String
token
=
PropertieUtil
.
readTokenValue
(
"tokenKy"
,
tokenPath
);;
String
expiration
=
PropertieUtil
.
readTokenValue
(
"expirationKy"
,
tokenPath
);
if
(
StringUtils
.
isEmpty
(
token
)
||
StringUtils
.
isEmpty
(
expiration
)){
result_token
=
readeWriteHnKyToken
(
nowtime
);
}
else
{
//token值已过期
if
(
nowtime
>
Long
.
valueOf
(
expiration
)){
result_token
=
readeWriteHnKyToken
(
nowtime
);
}
else
{
result_token
=
token
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
e
.
getMessage
());
}
return
result_token
;
}
//读和写海南凯亚的token值
public
static
String
readeWriteHnKyToken
(
long
nowtime
){
String
result_token
=
""
;
//如果过期先获取新的token值
Map
headerMap
=
new
HashMap
();
String
username
=
PropertieUtil
.
readTokenValue
(
"usernameKy"
,
tokenPath
);
String
token_url
=
PropertieUtil
.
readTokenValue
(
"token_url"
,
tokenPath
);
String
clientUid
=
getClientUid
(
token_url
);
// 随机码
String
password
=
RsaUtil
.
sign
(
clientUid
+
"."
+
username
);
// 随机码+“.”+用户名 RSA私钥进行SHA1WithRSA数字签名
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"username"
,
username
);
object
.
put
(
"password"
,
password
);
object
.
put
(
"clientUid"
,
clientUid
);
try
{
String
resultString
=
doPostUrlEncodedFormEntity
(
token_url
+
"/auth/login"
,
headerMap
,
JSONObject
.
toJSONString
(
object
));
if
(!
StringUtils
.
isEmpty
(
resultString
))
{
JSONObject
result
=
JSONObject
.
parseObject
(
resultString
);
result_token
=
result
.
getString
(
"authorization"
);
String
expires_in
=
result
.
getString
(
"expiresTime"
);
//有效时间段 单位为秒 1800秒
String
result_expiration
=
nowtime
+
Integer
.
parseInt
(
expires_in
)*
1000
+
""
;
//写入新的token值和本次token的过期时间
PropertieUtil
.
writeTokenProperties
(
tokenPath
,
"tokenKy"
,
result_token
);
PropertieUtil
.
writeTokenProperties
(
tokenPath
,
"expirationKy"
,
result_expiration
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
info
(
"获取token错误"
+
e
.
getMessage
());
}
return
result_token
;
}
// 获取海南凯亚的clientUid
public
static
String
getClientUid
(
String
token_url
){
return
com
.
founder
.
commonutils
.
util
.
HttpUtil
.
doGet
(
token_url
+
"/auth/getClientUid"
);
}
}
common/common_utils/src/main/resources/token.properties
View file @
b31b6c88
...
...
@@ -15,10 +15,16 @@ token=
#\u8FC7\u671F\u65F6\u95F4
expiration
=
####################云天励飞请求token配置参数##结束#################
####################云天励飞开始########################
image_url
=
http://26.3.12.56:8083
####################云天励飞结束########################
####################海南凯亚请求token配置参数##开始#################
token_urlKy
=
http://74.10.30.174:18093
#body
usernameKy
=
diapp-digitaldf-xx
#token\u503C
tokenKy
=
#\u8FC7\u671F\u65F6\u95F4
expirationKy
=
####################海南凯亚请求token配置参数##结束#################
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/controller/ImageController.java
0 → 100644
View file @
b31b6c88
package
com
.
founder
.
peopleapi
.
controller
;
import
com.founder.commonutils.carEntity.CarKkXxParams
;
import
com.founder.commonutils.peopleEntity.CameraFaceTask
;
import
com.founder.commonutils.peopleEntity.FaceSearchParam
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.commonutils.util.TokenUtils
;
import
com.founder.peopleapi.service.ImageService
;
import
com.founder.servicebase.logs.OperLog
;
import
com.founder.servicebase.logs.OperationType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
/**
* <p>
* 人像相关接口管理
* </p>
*
* @author yangyang
* @since 2022-04-28
*/
@Api
(
description
=
"第三方图像接口管理-海南"
)
@RestController
@RequestMapping
(
"/image"
)
@Component
public
class
ImageController
{
@Autowired
private
ImageService
imageService
;
@OperLog
(
message
=
"token获取"
,
operation
=
OperationType
.
QUERY
)
@ApiOperation
(
value
=
"token获取"
)
@PostMapping
(
"/token"
)
public
MapRestResult
getToken
()
{
//获取token
String
accessToken
=
TokenUtils
.
getHnKyToken
();
return
MapRestResult
.
build
(
202
,
"成功获取token信息"
,
accessToken
);
}
//@OperLog(message = "人脸动态检索接口",operation = OperationType.QUERY)
@ApiOperation
(
value
=
"人脸动态检索接口"
)
@PostMapping
(
value
=
"/getFaceImageByUploadImage"
)
public
MapRestResult
getFaceIdsByUploadImage
(
@RequestPart
(
value
=
"files"
)
MultipartFile
[]
files
,
FaceSearchParam
faceSearchParam
)
{
long
startTime
=
new
Date
().
getTime
();
MapRestResult
result
=
imageService
.
getFaceImageByUploadImage
(
files
,
faceSearchParam
);
long
endTime
=
new
Date
().
getTime
();
long
timeDiffer
=
endTime
-
startTime
;
System
.
out
.
println
(
"人脸检索**请求时长**********"
+
timeDiffer
+
"毫秒"
);
return
result
;
}
//@OperLog(message = "人像回溯接口",operation = OperationType.QUERY)
@ApiOperation
(
value
=
"人像回溯接口"
)
@PostMapping
(
value
=
"/sendTask"
)
public
MapRestResult
sendTask
(
@RequestBody
CameraFaceTask
cameraFaceTask
)
{
return
imageService
.
sendTask
(
cameraFaceTask
);
}
//@OperLog(message = "范围内人像点位数据接口",operation = OperationType.QUERY)
@ApiOperation
(
value
=
"范围内人像点位数据接口"
)
@PostMapping
(
value
=
"/selectRxXx"
)
public
MapRestResult
selectRxXx
(
@RequestBody
CarKkXxParams
carKkXxParams
)
{
return
imageService
.
selectRxXx
(
carKkXxParams
.
getQsjd
(),
carKkXxParams
.
getQswd
(),
carKkXxParams
.
getJsjd
(),
carKkXxParams
.
getJswd
());
}
//@OperLog(message = "人像比对接口",operation = OperationType.QUERY)
@PostMapping
(
"/getRxbd"
)
@ApiOperation
(
value
=
"发起人像比对任务"
,
notes
=
"发起人像比对任务"
)
public
MapRestResult
getRxbd
(
@RequestParam
(
value
=
"file"
,
required
=
false
)
MultipartFile
file
,
@RequestParam
(
value
=
"base64Img"
,
required
=
false
)
String
base64Img
,
@RequestParam
(
value
=
"fjmc"
,
required
=
false
)
String
fjmc
,
@RequestParam
(
value
=
"threshold"
,
required
=
false
)
String
threshold
,
@RequestParam
(
value
=
"topNumber"
,
required
=
false
)
String
topNumber
,
@RequestParam
(
value
=
"model"
,
required
=
false
)
String
model
,
HttpServletRequest
request
)
{
return
imageService
.
getFqRxbdjgrw
(
file
,
base64Img
,
request
,
fjmc
,
threshold
,
topNumber
,
model
);
}
//@OperLog(message = "人像比对接口",operation = OperationType.QUERY)
@PostMapping
(
"/getAllCamera"
)
@ApiOperation
(
value
=
"获取所有摄像机落地"
,
notes
=
"获取所有摄像机落地"
)
public
MapRestResult
getAllCamera
()
{
return
imageService
.
getAllCamera
();
}
}
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/mapper/CameraInfoMapper.java
0 → 100644
View file @
b31b6c88
package
com
.
founder
.
peopleapi
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.founder.commonutils.peopleEntity.Camera
;
import
com.founder.commonutils.peopleEntity.CameraData
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Mapper
@Component
public
interface
CameraInfoMapper
extends
BaseMapper
<
Camera
>
{
List
<
Camera
>
getCameraInfoByIds
(
@Param
(
value
=
"cameraIds"
)
String
cameraIds
);
List
<
Camera
>
getCameraInfoByQsJwd
(
@Param
(
value
=
"qsjd"
)
String
qsjd
,
@Param
(
value
=
"qswd"
)
String
qswd
,
@Param
(
value
=
"jsjd"
)
String
jsjd
,
@Param
(
value
=
"jswd"
)
String
jswd
);
int
getCameraInfoByDeviceId
(
@Param
(
value
=
"deviceId"
)
String
deviceId
);
void
insertCameraInfo
(
CameraData
cameraData
);
}
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/mapper/xml/CameraInfoMapper.xml
0 → 100644
View file @
b31b6c88
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.founder.publicapi.mapper.CameraInfoMapper"
>
<!--根据起始经纬度获取人像点位数据-->
<select
id=
"getCameraInfoByIds"
parameterType=
"java.lang.String"
resultType=
"com.founder.commonutils.peopleEntity.Camera"
>
select
t.ID as cameraId,
t.NAME as cameraName,
(select name from sys_dictitem where groupid = 'CODE_UNIT' and code = substr(t.camera_code,0,6)||'000000') as districtCodeName,
substr(t.camera_code,0,6)|| '000000' as districtCode,
(select name from sys_dictitem where groupid = 'CODE_XZQH' and code = substr(t.camera_code,0,6)) as areaCodeName,
substr(t.camera_code,0,6) as areaCode,
t.CITY as areaName,
x as x,
y as y,
NAME as cameraType
from tb_zy_camera t where 1=1
<if
test=
"cameraIds!=null and cameraIds!=''"
>
and id in ${cameraIds}
</if>
</select>
<!--根据起始经纬度获取人像点位数据-->
<select
id=
"getCameraInfoByQsJwd"
parameterType=
"java.lang.String"
resultType=
"com.founder.commonutils.peopleEntity.Camera"
>
select
ID as cameraId,
NAME as cameraName,
CITY as areaName,
(select name from sys_dictitem where groupid = 'CODE_UNIT' and code = substr(t.camera_code,0,6)||'000000') as districtCodeName,
substr(t.camera_code,0,6)|| '000000' as districtCode,
(select name from sys_dictitem where groupid = 'CODE_XZQH' and code = substr(t.camera_code,0,6)) as areaCodeName,
substr(t.camera_code,0,6) as areaCode,
x as x,
y as y,
NAME as cameraType
from tb_zy_camera t where 1=1
<if
test=
"qsjd!=null and qsjd!='' and qsjd!=null and qsjd!='' and qswd!=null and qswd!='' and jswd!=null and jswd!=''"
>
AND x
<![CDATA[>=]]>
#{qsjd,jdbcType=VARCHAR} AND x
<![CDATA[<=]]>
#{jsjd,jdbcType=VARCHAR}
AND y
<![CDATA[>=]]>
#{qswd,jdbcType=VARCHAR} AND y
<![CDATA[<=]]>
#{jswd,jdbcType=VARCHAR}
</if>
</select>
<!--根据摄像头id获取摄像头-->
<select
id=
"getCameraInfoByDeviceId"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
select
count(*)
from tb_zy_camera t where deviceId = #{deviceId}
</select>
<!--摄像头数据落地-->
<insert
id=
"insertCameraInfo"
parameterType=
"com.founder.commonutils.peopleEntity.CameraData"
>
INSERT INTO tb_zy_camera (
deviceId,deviceName,longitude,latitude,deviceAddress,gbCode;
)
VALUES(
#{deviceId, jdbcType=VARCHAR}
,#{deviceName, jdbcType=VARCHAR}
,#{longitude, jdbcType=VARCHAR}
,#{latitude, jdbcType=VARCHAR}
,#{deviceAddress, jdbcType=VARCHAR}
,#{gbCode, jdbcType=VARCHAR}
)
</insert>
</mapper>
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/service/ImageService.java
0 → 100644
View file @
b31b6c88
package
com
.
founder
.
peopleapi
.
service
;
import
com.founder.commonutils.peopleEntity.CameraFaceTask
;
import
com.founder.commonutils.peopleEntity.FaceJtSearchParam
;
import
com.founder.commonutils.peopleEntity.FaceSearchParam
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
/**
* <p>
* 云天接口 服务类
* </p>
*
* @author yangyang
* @since 2021-03-19
*/
public
interface
ImageService
{
MapRestResult
getFaceImageByUploadImage
(
MultipartFile
[]
files
,
FaceSearchParam
faceSearchParam
);
MapRestResult
sendTask
(
CameraFaceTask
cameraFaceTask
);
MapRestResult
selectRxXx
(
String
qsjd
,
String
qswd
,
String
jsjd
,
String
jswd
);
MapRestResult
getFqRxbdjgrw
(
MultipartFile
file
,
String
base64Img
,
HttpServletRequest
request
,
String
fjmc
,
String
threshold
,
String
topNumber
,
String
model
);
MapRestResult
getAllCamera
();
}
serviceapi/peopleapi/src/main/java/com/founder/peopleapi/service/impl/ImageServiceImpl.java
0 → 100644
View file @
b31b6c88
This diff is collapsed.
Click to expand it.
serviceapi/peopleapi/src/main/resources/bootstrap.properties
View file @
b31b6c88
...
...
@@ -9,10 +9,12 @@ logging.level.root=INFO
#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#oracle数据库连接
spring.datasource.driver-class-name
=
oracle.jdbc.driver.OracleDriver
spring.datasource.url
=
jdbc:oracle:thin:@
47.92.129.99:1560:orcl
spring.datasource.url
=
jdbc:oracle:thin:@
10.184.17.3:1521:HNXZXT1
spring.datasource.username
=
XZXT
spring.datasource.password
=
Xz
Pwd#11022
spring.datasource.password
=
Xz
xtPwd#46
#xml扫包
mybatis-plus.mapper-locations
=
classpath:com/founder/peopleapi/mapper/xml/*.xml
#单位
ssdw
=
460000000000
\ No newline at end of file
ssdw
=
460000000000
#海南凯亚人像请求公共地址
imageUrl
=
http://74.10.30.174:18093
\ 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