Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bme-access-guangdong-upload
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
1
Merge Requests
1
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
李洪明
bme-access-guangdong-upload
Commits
bd7009f7
Commit
bd7009f7
authored
Dec 18, 2025
by
李洪明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加上传进出口信息接口
parent
5e5899cc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
164 additions
and
16 deletions
+164
-16
InOutGateMapper.java
...in/java/com/bme/access/guangdong/dao/InOutGateMapper.java
+12
-0
InOutGate.java
src/main/java/com/bme/access/guangdong/model/InOutGate.java
+8
-0
InOutGateInfo.java
...in/java/com/bme/access/guangdong/model/InOutGateInfo.java
+12
-0
InOutGateOriginalInfo.java
...com/bme/access/guangdong/model/InOutGateOriginalInfo.java
+17
-0
EnterpriseService.java
...a/com/bme/access/guangdong/service/EnterpriseService.java
+13
-14
InOutGateService.java
...va/com/bme/access/guangdong/service/InOutGateService.java
+101
-0
NoRoadVehicleInfoService.java
...me/access/guangdong/service/NoRoadVehicleInfoService.java
+1
-2
No files found.
src/main/java/com/bme/access/guangdong/dao/InOutGateMapper.java
0 → 100644
View file @
bd7009f7
package
com
.
bme
.
access
.
guangdong
.
dao
;
import
com.bme.access.guangdong.model.InOutGateOriginalInfo
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
InOutGateMapper
{
List
<
InOutGateOriginalInfo
>
getInOutGateInfos
();
}
src/main/java/com/bme/access/guangdong/model/InOutGate.java
0 → 100644
View file @
bd7009f7
package
com
.
bme
.
access
.
guangdong
.
model
;
import
lombok.Data
;
@Data
public
class
InOutGate
extends
InOutGateInfo
{
private
String
SIGN
;
}
src/main/java/com/bme/access/guangdong/model/InOutGateInfo.java
0 → 100644
View file @
bd7009f7
package
com
.
bme
.
access
.
guangdong
.
model
;
import
lombok.Data
;
@Data
public
class
InOutGateInfo
{
private
String
QYBH
;
private
String
CRKBH
;
private
String
CRKMC
;
private
String
SFYSSSP
;
private
String
RTSPURL
;
}
src/main/java/com/bme/access/guangdong/model/InOutGateOriginalInfo.java
0 → 100644
View file @
bd7009f7
package
com
.
bme
.
access
.
guangdong
.
model
;
import
lombok.Data
;
@Data
public
class
InOutGateOriginalInfo
{
// 企业编号
private
String
enterpriseNo
;
// 出入口编号
private
String
gateNo
;
// 出入口名称
private
String
gateName
;
// 是否有实时视频
private
Integer
hasVideo
;
// 实时视频地址
private
String
videoUrl
;
}
src/main/java/com/bme/access/guangdong/service/EnterpriseService.java
View file @
bd7009f7
...
...
@@ -7,7 +7,6 @@ import com.bme.access.guangdong.model.Enterprise;
import
com.bme.access.guangdong.model.EnterpriseInfo
;
import
com.bme.access.guangdong.model.EnterpriseOriginalInfo
;
import
com.bme.access.guangdong.model.LoginResult
;
import
com.bme.access.guangdong.utils.AESPKCS7PaddingUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.json.JSONObject
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -49,21 +48,21 @@ public class EnterpriseService {
if
(
Objects
.
nonNull
(
loginResult
)
&&
Objects
.
nonNull
(
loginResult
.
getData
()))
{
key
=
loginResult
.
getData
().
getAes_secret
();
}
enterprise
.
setSIGN
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getSIGN
(),
key
));
enterprise
.
setQYBH
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getQYBH
(),
key
));
enterprise
.
setQYMC
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getQYMC
(),
key
));
enterprise
.
setTYSHXYDM
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getTYSHXYDM
(),
key
));
enterprise
.
setXZQHDM
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getXZQHDM
(),
key
));
enterprise
.
setQYDZ
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getQYDZ
(),
key
));
//
enterprise.setSIGN(AESPKCS7PaddingUtils.encrypt(enterprise.getSIGN(), key));
//
enterprise.setQYBH(AESPKCS7PaddingUtils.encrypt(enterprise.getQYBH(), key));
//
enterprise.setQYMC(AESPKCS7PaddingUtils.encrypt(enterprise.getQYMC(), key));
//
enterprise.setTYSHXYDM(AESPKCS7PaddingUtils.encrypt(enterprise.getTYSHXYDM(), key));
//
enterprise.setXZQHDM(AESPKCS7PaddingUtils.encrypt(enterprise.getXZQHDM(), key));
//
enterprise.setQYDZ(AESPKCS7PaddingUtils.encrypt(enterprise.getQYDZ(), key));
// enterprise.setJD(AESPKCS7PaddingUtils.encrypt(enterprise.getSIGN(), key))
// enterprise.setWD(AESPKCS7PaddingUtils.encrypt(enterprise.getSIGN(), key))
enterprise
.
setFRDB
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getFRDB
(),
key
));
enterprise
.
setHYFZ
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getHYFZ
(),
key
));
enterprise
.
setJXFJGK
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getJXFJGK
(),
key
));
enterprise
.
setLXR
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getLXR
(),
key
));
enterprise
.
setLXRDH
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getLXRDH
(),
key
));
enterprise
.
setPWXKZBH
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getPWXKZBH
(),
key
));
enterprise
.
setPWDJBH
(
AESPKCS7PaddingUtils
.
encrypt
(
enterprise
.
getPWDJBH
(),
key
));
//
enterprise.setFRDB(AESPKCS7PaddingUtils.encrypt(enterprise.getFRDB(), key));
//
enterprise.setHYFZ(AESPKCS7PaddingUtils.encrypt(enterprise.getHYFZ(), key));
//
enterprise.setJXFJGK(AESPKCS7PaddingUtils.encrypt(enterprise.getJXFJGK(), key));
//
enterprise.setLXR(AESPKCS7PaddingUtils.encrypt(enterprise.getLXR(), key));
//
enterprise.setLXRDH(AESPKCS7PaddingUtils.encrypt(enterprise.getLXRDH(), key));
//
enterprise.setPWXKZBH(AESPKCS7PaddingUtils.encrypt(enterprise.getPWXKZBH(), key));
//
enterprise.setPWDJBH(AESPKCS7PaddingUtils.encrypt(enterprise.getPWDJBH(), key));
String
jsonData
=
JSON
.
toJSONString
(
enterprise
);
try
{
HttpUtils
.
sendPost
(
host
,
url
,
null
,
jsonData
);
...
...
src/main/java/com/bme/access/guangdong/service/InOutGateService.java
0 → 100644
View file @
bd7009f7
package
com
.
bme
.
access
.
guangdong
.
service
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.bme.access.guangdong.common.HttpUtils
;
import
com.bme.access.guangdong.dao.InOutGateMapper
;
import
com.bme.access.guangdong.model.*
;
import
com.bme.access.guangdong.utils.AESPKCS7PaddingUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.json.JSONObject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.TreeMap
;
@Service
@Slf4j
public
class
InOutGateService
{
@Autowired
private
LoginService
loginService
;
@Autowired
private
InOutGateMapper
mapper
;
private
static
String
host
=
"http://113.96.111.154:18830"
;
private
static
String
url
=
"/api/qymj/pushGate"
;
public
void
uploadInOutGateInfo
()
{
// 查询企业信息
InOutGateInfo
inOutGateInfo
;
List
<
InOutGateOriginalInfo
>
originalInfos
=
mapper
.
getInOutGateInfos
();
if
(
CollectionUtil
.
isNotEmpty
(
originalInfos
))
{
for
(
InOutGateOriginalInfo
originalInfo
:
originalInfos
)
{
inOutGateInfo
=
convertInfo
(
originalInfo
);
String
jsonStr
=
JSON
.
toJSONString
(
inOutGateInfo
);
String
sign
=
getSign
(
jsonStr
);
// 使用AES密钥进行加密
InOutGate
inOutGate
=
new
InOutGate
();
BeanUtils
.
copyProperties
(
inOutGateInfo
,
inOutGate
);
inOutGate
.
setSIGN
(
sign
);
LoginResult
loginResult
=
loginService
.
login
();
String
key
=
""
;
if
(
Objects
.
nonNull
(
loginResult
)
&&
Objects
.
nonNull
(
loginResult
.
getData
()))
{
key
=
loginResult
.
getData
().
getAes_secret
();
}
inOutGate
.
setSIGN
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getSIGN
(),
key
));
inOutGate
.
setQYBH
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getQYBH
(),
key
));
inOutGate
.
setCRKBH
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getCRKBH
(),
key
));
inOutGate
.
setSFYSSSP
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getSFYSSSP
(),
key
));
inOutGate
.
setRTSPURL
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getRTSPURL
(),
key
));
inOutGate
.
setCRKMC
(
AESPKCS7PaddingUtils
.
encrypt
(
inOutGate
.
getCRKMC
(),
key
));
String
jsonData
=
JSON
.
toJSONString
(
inOutGate
);
try
{
HttpUtils
.
sendPost
(
host
,
url
,
null
,
jsonData
);
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
());
}
}
}
}
private
String
getSign
(
String
jsonStr
)
{
org
.
json
.
JSONObject
jsonObj
=
new
org
.
json
.
JSONObject
(
jsonStr
);
Map
<
String
,
Object
>
sortedMap
=
new
TreeMap
<>(
jsonObj
.
toMap
());
// 使用TreeMap自动排序键值对
String
sortedJsonStr
=
new
JSONObject
(
sortedMap
).
toString
();
// 将排序后的Map转换回JSON字符串
try
{
MessageDigest
digest
=
MessageDigest
.
getInstance
(
"SHA-256"
);
byte
[]
encodedhash
=
digest
.
digest
(
sortedJsonStr
.
getBytes
());
// 生成哈希值字节数组
return
bytesToHex
(
encodedhash
);
// 将字节数组转换为十六进制字符串
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
}
return
""
;
}
private
static
String
bytesToHex
(
byte
[]
bytes
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
bytes
.
length
;
i
++)
{
sb
.
append
(
String
.
format
(
"%02x"
,
bytes
[
i
]));
}
return
sb
.
toString
();
}
private
InOutGateInfo
convertInfo
(
InOutGateOriginalInfo
originalInfo
)
{
InOutGateInfo
inOutGateInfo
=
new
InOutGateInfo
();
inOutGateInfo
.
setRTSPURL
(
originalInfo
.
getVideoUrl
());
inOutGateInfo
.
setSFYSSSP
(
String
.
valueOf
(
originalInfo
.
getHasVideo
()));
inOutGateInfo
.
setCRKBH
(
originalInfo
.
getGateNo
());
inOutGateInfo
.
setCRKMC
(
originalInfo
.
getGateName
());
inOutGateInfo
.
setQYBH
(
originalInfo
.
getEnterpriseNo
());
return
inOutGateInfo
;
}
}
src/main/java/com/bme/access/guangdong/service/NoRoadVehicleInfoService.java
View file @
bd7009f7
...
...
@@ -4,8 +4,7 @@ import org.springframework.stereotype.Service;
@Service
public
class
NoRoadVehicleInfoService
{
public
void
uploadInfo
()
{
public
void
uploadInfo
()
{
}
}
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