Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
extend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
park
extend
Commits
92fad2e5
Commit
92fad2e5
authored
Jun 23, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
b65cd7c8
c2d69122
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
106 additions
and
60 deletions
+106
-60
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+5
-4
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
+6
-5
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/ToolController.java
+6
-7
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/IBindService.java
+2
-1
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+23
-7
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
+13
-10
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
+3
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/entity/ParkBindInfo.java
+3
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/entity/ParkVerifyInfo.java
+4
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/UnBindReq.java
+0
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BaseEncryptRes.java
+3
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BindInfoQueryRes.java
+35
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
+2
-1
infra/src/main/resources/mapper/BindInfoMapper.xml
+1
-18
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
92fad2e5
...
@@ -10,6 +10,8 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
...
@@ -10,6 +10,8 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ResultList
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ResultList
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -48,8 +50,7 @@ public class BindInfoControlller extends BaseController {
...
@@ -48,8 +50,7 @@ public class BindInfoControlller extends BaseController {
@PostMapping
(
"bind"
)
@PostMapping
(
"bind"
)
@BodyDecryptAnnotation
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
@ResponseEncryptAnnotation
public
Response
<
String
>
bindInfo
(
@RequestBody
@Validated
BindInfoReq
req
)
{
public
Response
<
BindInfoRes
>
bindInfo
(
@RequestBody
@Validated
BindInfoReq
req
)
{
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
defaultConverter
.
getMapperFacade
().
map
(
req
,
bindInfo
);
defaultConverter
.
getMapperFacade
().
map
(
req
,
bindInfo
);
return
service
.
bind
(
bindInfo
);
return
service
.
bind
(
bindInfo
);
...
@@ -81,8 +82,8 @@ public class BindInfoControlller extends BaseController {
...
@@ -81,8 +82,8 @@ public class BindInfoControlller extends BaseController {
@PostMapping
(
"query"
)
@PostMapping
(
"query"
)
@BodyDecryptAnnotation
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
@ResponseEncryptAnnotation
public
Response
<
ResultList
<
ParkBindInfo
>>
bindInfoQery
(
@RequestBody
@Validated
BindInfoQueryReq
query
)
{
public
Response
<
ResultList
<
BindInfoQueryRes
>>
bindInfoQery
(
@RequestBody
@Validated
BindInfoQueryReq
query
)
{
return
ResponseGenerator
.
success
(
new
ResultList
<
ParkBindInfo
>(
service
.
selectByQuery
(
query
)));
return
ResponseGenerator
.
success
(
new
ResultList
<
BindInfoQueryRes
>(
service
.
selectByQuery
(
query
)));
}
}
}
}
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
View file @
92fad2e5
...
@@ -13,9 +13,9 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.Sms
...
@@ -13,9 +13,9 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.Sms
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.param.request.CheckVerifyCodeMicReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.param.request.CheckVerifyCodeMicReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.param.request.SendVerifyCodeMicReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pub_service_sms.param.request.SendVerifyCodeMicReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.VerifyInfoMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.VerifyInfoMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.CheckVerifyCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.CheckVerifyCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.SendVerifyCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.SendVerifyCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.CheckValidityRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.CheckValidityRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
...
@@ -117,16 +117,17 @@ public class H5Controller {
...
@@ -117,16 +117,17 @@ public class H5Controller {
}
}
/**
/**
* 验证当前手机号是否在10天内,已通过验证
* 验证当前手机号是否在1天内,已通过验证
*
* @param query
* @param query
* @return
* @return
*/
*/
@PostMapping
(
"checkValidity"
)
@PostMapping
(
"checkValidity"
)
@HeaderDecryptAnnotation
@HeaderDecryptAnnotation
public
Response
<
CheckValidityRes
>
checkValidity
(
@RequestBody
@Validated
H5BindInfoQuery
query
)
{
public
Response
<
CheckValidityRes
>
checkValidity
(
@RequestBody
@Validated
H5BindInfoQuery
query
)
{
ParkVerifyInfo
verifyInfo
=
verifyInfoMapper
.
checkValidity
(
query
.
getPhone
(),
query
.
getUserId
(),
ParkVerifyInfo
verifyInfo
=
verifyInfoMapper
.
checkValidity
(
query
.
getPhone
(),
query
.
getUserId
(),
DateUtil
.
offsetDay
(
DateTime
.
now
(),
-
1
0
));
DateUtil
.
offsetDay
(
DateTime
.
now
(),
-
1
));
CheckValidityRes
checkValidityRes
=
new
CheckValidityRes
();
CheckValidityRes
checkValidityRes
=
new
CheckValidityRes
();
defaultConverter
.
getMapperFacade
().
map
(
query
,
checkValidityRes
);
defaultConverter
.
getMapperFacade
().
map
(
query
,
checkValidityRes
);
...
@@ -178,7 +179,7 @@ public class H5Controller {
...
@@ -178,7 +179,7 @@ public class H5Controller {
verifyInfo
.
setUserId
(
req
.
getUserId
());
verifyInfo
.
setUserId
(
req
.
getUserId
());
verifyInfo
.
setVerifyCode
(
req
.
getVerifyCode
());
verifyInfo
.
setVerifyCode
(
req
.
getVerifyCode
());
verifyInfo
.
setPhone
(
req
.
getPhone
());
verifyInfo
.
setPhone
(
req
.
getPhone
());
verifyInfo
.
setPassTime
(
DateTime
.
now
()
.
toString
()
);
verifyInfo
.
setPassTime
(
DateTime
.
now
());
verifyInfoMapper
.
insert
(
verifyInfo
);
verifyInfoMapper
.
insert
(
verifyInfo
);
}
}
return
checkResult
;
return
checkResult
;
...
...
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/ToolController.java
View file @
92fad2e5
...
@@ -5,7 +5,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.configbean.SignKeyConfigBean;
...
@@ -5,7 +5,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.configbean.SignKeyConfigBean;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -19,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -19,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
**/
**/
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/tool"
)
@RequestMapping
(
"/tool"
)
public
class
ToolController
{
public
class
ToolController
{
@Autowired
@Autowired
SignKeyConfigBean
signKeyConfigBean
;
SignKeyConfigBean
signKeyConfigBean
;
...
@@ -30,8 +29,8 @@ public class ToolController {
...
@@ -30,8 +29,8 @@ public class ToolController {
* @param plain 明文
* @param plain 明文
* @return
* @return
*/
*/
@GetMapping
(
value
=
"encrypt"
)
@GetMapping
(
value
=
"encrypt"
)
public
String
encrypt
(
String
plain
)
{
public
String
encrypt
(
String
plain
)
{
return
EncryptStringAes
.
encryptAes
(
plain
,
signKeyConfigBean
.
getKey
());
return
EncryptStringAes
.
encryptAes
(
plain
,
signKeyConfigBean
.
getKey
());
}
}
...
@@ -41,8 +40,8 @@ public class ToolController {
...
@@ -41,8 +40,8 @@ public class ToolController {
* @param cipher 密文
* @param cipher 密文
* @return
* @return
*/
*/
@
PostMapping
(
value
=
"decrypt"
)
@
GetMapping
(
value
=
"decrypt"
)
public
String
decrypt
(
String
cipher
)
{
public
String
decrypt
(
String
cipher
)
{
return
EncryptStringAes
.
decryptAes
(
cipher
,
signKeyConfigBean
.
getKey
());
return
EncryptStringAes
.
decryptAes
(
cipher
,
signKeyConfigBean
.
getKey
());
}
}
...
@@ -51,7 +50,7 @@ public class ToolController {
...
@@ -51,7 +50,7 @@ public class ToolController {
*
*
* @return
* @return
*/
*/
@GetMapping
(
value
=
"timestamp"
)
@GetMapping
(
value
=
"timestamp"
)
public
String
timestamp
()
{
public
String
timestamp
()
{
return
String
.
valueOf
(
System
.
currentTimeMillis
());
return
String
.
valueOf
(
System
.
currentTimeMillis
());
}
}
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/IBindService.java
View file @
92fad2e5
...
@@ -6,6 +6,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
...
@@ -6,6 +6,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,7 +42,7 @@ public interface IBindService extends IService<ParkBindInfo> {
...
@@ -41,7 +42,7 @@ public interface IBindService extends IService<ParkBindInfo> {
* @param query
* @param query
* @return
* @return
*/
*/
List
<
ParkBindInfo
>
selectByQuery
(
BindInfoQueryReq
query
);
List
<
BindInfoQueryRes
>
selectByQuery
(
BindInfoQueryReq
query
);
/**
/**
* 年检信息查询接口
* 年检信息查询接口
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
92fad2e5
...
@@ -28,6 +28,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo;
...
@@ -28,6 +28,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.InsuranceInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.InsuranceInfoRes
;
...
@@ -111,7 +112,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
...
@@ -111,7 +112,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
info
.
setUnqId
(
unqIdUtil
.
getUnqId
());
info
.
setUnqId
(
unqIdUtil
.
getUnqId
());
info
.
setGmtBindTime
(
DateTime
.
now
().
toString
());
info
.
setGmtBindTime
(
new
Date
());
mapper
.
insert
(
info
);
mapper
.
insert
(
info
);
return
ResponseGenerator
.
success
(
new
BindInfoRes
(
info
.
getUnqId
()));
return
ResponseGenerator
.
success
(
new
BindInfoRes
(
info
.
getUnqId
()));
}
}
...
@@ -148,8 +149,21 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
...
@@ -148,8 +149,21 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
* @return
* @return
*/
*/
@Override
@Override
public
List
<
ParkBindInfo
>
selectByQuery
(
BindInfoQueryReq
query
)
{
public
List
<
BindInfoQueryRes
>
selectByQuery
(
BindInfoQueryReq
query
)
{
return
bindCache
.
selectByQuery
(
query
.
getUserId
());
List
<
ParkBindInfo
>
parkBindInfos
=
bindCache
.
selectByQuery
(
query
.
getUserId
());
List
<
BindInfoQueryRes
>
resList
=
new
ArrayList
<>(
3
);
if
(
parkBindInfos
!=
null
&&
!
parkBindInfos
.
isEmpty
())
{
for
(
ParkBindInfo
item
:
parkBindInfos
)
{
BindInfoQueryRes
resultItem
=
new
BindInfoQueryRes
();
resultItem
.
setPlateColor
(
item
.
getPlateColor
());
resultItem
.
setPlateNum
(
item
.
getPlateNum
());
resultItem
.
setUnqId
(
item
.
getUnqId
());
resultItem
.
setGmtBindTime
(
item
.
getGmtBindTime
().
getTime
());
resList
.
add
(
resultItem
);
}
}
return
resList
;
}
}
@Override
@Override
...
@@ -261,10 +275,10 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
...
@@ -261,10 +275,10 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
}
}
/**
/**
* 校验当前电话号码是否在1
0
天内已通过验证
* 校验当前电话号码是否在1天内已通过验证
*/
*/
ParkVerifyInfo
verify
=
verifyInfo
.
checkValidity
(
query
.
getPhone
(),
query
.
getUserId
(),
ParkVerifyInfo
verify
=
verifyInfo
.
checkValidity
(
query
.
getPhone
(),
query
.
getUserId
(),
DateUtil
.
offsetDay
(
DateTime
.
now
(),
-
1
0
));
DateUtil
.
offsetDay
(
DateTime
.
now
(),
-
1
));
if
(
verify
==
null
)
{
if
(
verify
==
null
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
PERMISSION_DENIED
);
return
ResponseGenerator
.
fail
(
StatusCode
.
PERMISSION_DENIED
);
}
}
...
@@ -295,8 +309,10 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
...
@@ -295,8 +309,10 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
*/
*/
DrivingLicenseInfoRes
result
=
new
DrivingLicenseInfoRes
();
DrivingLicenseInfoRes
result
=
new
DrivingLicenseInfoRes
();
result
.
setDriverName
(
drivingLicenseRes
.
getXm
());
result
.
setDriverName
(
drivingLicenseRes
.
getXm
());
result
.
setPlateNum
(
drivingLicenseRes
.
getSfzmhm
());
result
.
setPlateNum
(
byPlateNumAndType
.
getHphm
());
result
.
setValidityTime
(
drivingLicenseRes
.
getYxqz
());
String
validityTime
=
drivingLicenseRes
.
getYxqz
();
validityTime
.
substring
(
0
,
validityTime
.
length
()
-
3
);
result
.
setValidityTime
(
validityTime
);
String
status
=
DateUtil
.
compare
(
DateUtil
.
parseDate
(
drivingLicenseRes
.
getYxqz
()),
new
Date
())
>=
0
?
"有效"
:
String
status
=
DateUtil
.
compare
(
DateUtil
.
parseDate
(
drivingLicenseRes
.
getYxqz
()),
new
Date
())
>=
0
?
"有效"
:
"已过期"
;
"已过期"
;
result
.
setStatus
(
status
);
result
.
setStatus
(
status
);
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
View file @
92fad2e5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
data
.
cache
;
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
data
.
cache
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
...
@@ -10,6 +9,7 @@ import org.springframework.cache.annotation.Caching;
...
@@ -10,6 +9,7 @@ import org.springframework.cache.annotation.Caching;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -25,11 +25,12 @@ public class BindCache {
...
@@ -25,11 +25,12 @@ public class BindCache {
/**
/**
* 获取绑定信息
* 获取绑定信息
*
* @param unqId
* @param unqId
* @return
* @return
*/
*/
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
unless
=
"#result==null"
)
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
unless
=
"#result==null"
)
public
ParkBindInfo
getById
(
String
unqId
)
{
public
ParkBindInfo
getById
(
String
unqId
)
{
LambdaQueryWrapper
<
ParkBindInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ParkBindInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ParkBindInfo:
:
getUnqId
,
unqId
);
queryWrapper
.
eq
(
ParkBindInfo:
:
getUnqId
,
unqId
);
queryWrapper
.
eq
(
ParkBindInfo:
:
getStatus
,
1
);
queryWrapper
.
eq
(
ParkBindInfo:
:
getStatus
,
1
);
...
@@ -38,30 +39,32 @@ public class BindCache {
...
@@ -38,30 +39,32 @@ public class BindCache {
/**
/**
* 查询用户绑定信息
* 查询用户绑定信息
*
* @param userId 第三方用户ID
* @param userId 第三方用户ID
* @return
* @return
*/
*/
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
unless
=
"#result==null or #result.size()==0"
)
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
unless
=
"#result==null or #result.size()==0"
)
public
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
)
{
public
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
)
{
return
mapper
.
selectByQuery
(
userId
);
return
mapper
.
selectByQuery
(
userId
);
}
}
/**
/**
* 解绑
* 解绑
*
* @param unqId 绑定唯一标识
* @param unqId 绑定唯一标识
* @param userId 第三方用户ID
* @param userId 第三方用户ID
* @return
* @return
*/
*/
@Caching
(
evict
=
{
@Caching
(
evict
=
{
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
condition
=
"#unqId!=null"
),
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
condition
=
"#unqId!=null"
),
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
condition
=
"#userId!=null"
)
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
condition
=
"#userId!=null"
)
})
})
public
boolean
unBind
(
String
unqId
,
String
userId
){
public
boolean
unBind
(
String
unqId
,
String
userId
)
{
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
bindInfo
.
setUnqId
(
unqId
);
bindInfo
.
setUnqId
(
unqId
);
bindInfo
.
setStatus
(
"0"
);
bindInfo
.
setStatus
(
"0"
);
bindInfo
.
setUnbindTime
(
DateTime
.
now
().
toString
());
bindInfo
.
setUnbindTime
(
new
Date
());
return
mapper
.
unbind
(
bindInfo
)
>
0
;
return
mapper
.
unbind
(
bindInfo
)
>
0
;
}
}
}
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
View file @
92fad2e5
...
@@ -2,6 +2,7 @@ package com.hikcreate.edl.pub.web.mobile.infra.data.mapper;
...
@@ -2,6 +2,7 @@ package com.hikcreate.edl.pub.web.mobile.infra.data.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -15,10 +16,10 @@ import java.util.List;
...
@@ -15,10 +16,10 @@ import java.util.List;
**/
**/
public
interface
BindInfoMapper
extends
BaseMapper
<
ParkBindInfo
>
{
public
interface
BindInfoMapper
extends
BaseMapper
<
ParkBindInfo
>
{
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
);
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
);
Integer
bindInfoInsert
(
ParkBindInfo
info
);
Integer
bindInfoInsert
(
ParkBindInfo
info
);
Integer
unbind
(
ParkBindInfo
info
);
Integer
unbind
(
ParkBindInfo
info
);
}
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/entity/ParkBindInfo.java
View file @
92fad2e5
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
/**
* 绑定信息实体类
* 绑定信息实体类
...
@@ -47,11 +48,11 @@ public class ParkBindInfo implements Serializable {
...
@@ -47,11 +48,11 @@ public class ParkBindInfo implements Serializable {
/**
/**
* 绑定时间
* 绑定时间
*/
*/
private
String
gmtBindTime
;
private
Date
gmtBindTime
;
/**
/**
* 解绑时间
* 解绑时间
*/
*/
private
String
unbindTime
;
private
Date
unbindTime
;
}
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/entity/ParkVerifyInfo.java
View file @
92fad2e5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
entity
;
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
entity
;
import
cn.hutool.core.date.DateTime
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
/**
/**
* 短信验证通过记录
* 短信验证通过记录
*
*
...
@@ -30,7 +32,7 @@ public class ParkVerifyInfo {
...
@@ -30,7 +32,7 @@ public class ParkVerifyInfo {
/**
/**
* 上次通过验证的时间
* 上次通过验证的时间
*/
*/
private
String
passTime
;
private
Date
passTime
;
}
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/UnBindReq.java
View file @
92fad2e5
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BaseEncryptRes.java
View file @
92fad2e5
...
@@ -2,6 +2,8 @@ package com.hikcreate.edl.pub.web.mobile.infra.model.param.response;
...
@@ -2,6 +2,8 @@ package com.hikcreate.edl.pub.web.mobile.infra.model.param.response;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
/**
* 公共加密返回消息类
* 公共加密返回消息类
* @author lixian
* @author lixian
...
@@ -9,7 +11,7 @@ import lombok.Data;
...
@@ -9,7 +11,7 @@ import lombok.Data;
* @date 2020/6/19 10:44
* @date 2020/6/19 10:44
**/
**/
@Data
@Data
public
class
BaseEncryptRes
{
public
class
BaseEncryptRes
implements
Serializable
{
/**
/**
* 加密字段
* 加密字段
*/
*/
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BindInfoQueryRes.java
0 → 100644
View file @
92fad2e5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 绑定信息查询接口返回结果封装
*
* @author: xieshixiang
* @time:2020/6/22 19:52
**/
@Data
public
class
BindInfoQueryRes
implements
Serializable
{
/**
* 绑定信息唯一标识,使用UUID
*/
private
String
unqId
;
/**
* 车牌颜色:A:白,B:灰,C:黄,D:粉,E:红,
* F:紫,G:绿,H:蓝,I:棕,J:黑',
*/
private
String
plateColor
;
/**
* 车牌号
*/
private
String
plateNum
;
/**
* 绑定时间
*/
private
Long
gmtBindTime
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
View file @
92fad2e5
...
@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
...
@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -15,7 +16,7 @@ import java.util.List;
...
@@ -15,7 +16,7 @@ import java.util.List;
@Data
@Data
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
public
class
ResultList
<
T
>
{
public
class
ResultList
<
T
>
implements
Serializable
{
List
<
T
>
list
;
List
<
T
>
list
;
...
...
infra/src/main/resources/mapper/BindInfoMapper.xml
View file @
92fad2e5
...
@@ -10,24 +10,7 @@
...
@@ -10,24 +10,7 @@
<select
id=
"selectByQuery"
parameterType=
"java.lang.String"
<select
id=
"selectByQuery"
parameterType=
"java.lang.String"
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo"
>
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo"
>
select b.unq_id, b.user_id, b.phone,
select b.unq_id,b.plate_color,b.plate_num,b.gmt_bind_time
case plate_color
when 'A' then '白'
when 'B' then '灰'
when 'C' then '黄'
when 'D' then '粉'
when 'E' then '红'
when 'F' then '紫'
when 'G' then '绿'
when 'H' then '蓝'
when 'I' then '棕'
when 'J' then '黑'
end plateColor,
case status
when '0' then '未绑定'
when '1' then '已绑定'
end status,
b.plate_num,b.plate_type,b.gmt_bind_time
from park_bind_info as b
from park_bind_info as b
where b.status='1'
where b.status='1'
<if
test=
"userId!=null and userId!=''"
>
<if
test=
"userId!=null and userId!=''"
>
...
...
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