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
89d807be
Commit
89d807be
authored
Jun 21, 2020
by
lixian7
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
2919089c
45329c1b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
11 deletions
+36
-11
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+1
-1
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+17
-7
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
+2
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
+0
-3
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/DrivingLicenseInfoRes.java
+4
-0
infra/src/main/resources/mapper/BindInfoMapper.xml
+12
-0
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
89d807be
...
...
@@ -70,7 +70,7 @@ public class BindInfoControlller extends BaseController {
}
info
.
setStatus
(
"0"
);
info
.
setUnbindTime
(
DateTime
.
now
().
toString
());
return
mapper
.
u
pdateByI
d
(
info
)
>
0
?
ResponseGenerator
.
success
()
:
ResponseGenerator
.
fail
(
""
);
return
mapper
.
u
nbin
d
(
info
)
>
0
?
ResponseGenerator
.
success
()
:
ResponseGenerator
.
fail
(
""
);
}
/**
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
89d807be
...
...
@@ -26,7 +26,11 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.mapper.VerifyInfoMapper;
import
com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.VerifyInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.*
;
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.ResultList
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ViolationInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
...
...
@@ -72,7 +76,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
//判断规则1:用户已绑定的车辆不超过3辆,包括已解绑但未过一个月的车辆
QueryWrapper
boundQuery
=
new
QueryWrapper
();
boundQuery
.
eq
(
"user_id"
,
info
.
get
Phone
());
boundQuery
.
eq
(
"user_id"
,
info
.
get
UserId
());
Integer
bound
=
mapper
.
selectCount
(
boundQuery
);
if
(
bound
>=
3
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
);
...
...
@@ -90,8 +94,13 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
if
(
info
.
getPlateType
()
==
null
||
info
.
getPlateType
().
equals
(
""
))
{
return
ResponseGenerator
.
fail
(
StatusCode
.
DATA_ERROR
);
}
return
mapper
.
insert
(
info
)
>
0
?
ResponseGenerator
.
success
(
info
.
getUnqId
())
:
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
);
try
{
mapper
.
insert
(
info
);
return
ResponseGenerator
.
success
(
info
.
getUnqId
());
}
catch
(
Exception
e
)
{
return
ResponseGenerator
.
fail
(
StatusCode
.
BUSINESS_ERROR
);
}
}
@Override
...
...
@@ -109,10 +118,10 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
}
YearCheckInfoRes
yearCheckInfoRes
=
new
YearCheckInfoRes
();
yearCheckInfoRes
.
setPlateNum
(
bindInfo
.
getPlateNum
());
if
(
StrUtil
.
isNotBlank
(
vehicleRes
.
getYxqz
())
)
{
yearCheckInfoRes
.
setValidityTime
(
vehicleRes
.
getYxqz
().
substring
(
0
,
10
));
if
(
StrUtil
.
isNotBlank
(
vehicleRes
.
getYxqz
())
)
{
yearCheckInfoRes
.
setValidityTime
(
vehicleRes
.
getYxqz
().
substring
(
0
,
10
));
Long
checkTime
=
DateUtil
.
parse
(
vehicleRes
.
getYxqz
(),
"yyyy-MM-dd HH:mm:ss"
).
getTime
();
if
(
checkTime
>=
System
.
currentTimeMillis
()
)
{
if
(
checkTime
>=
System
.
currentTimeMillis
()
)
{
yearCheckInfoRes
.
setStatus
(
"未到期"
);
}
else
{
yearCheckInfoRes
.
setStatus
(
"已到期"
);
...
...
@@ -237,6 +246,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
result
.
setPlateNum
(
drivingLicenseRes
.
getSfzmhm
());
result
.
setValidityTime
(
drivingLicenseRes
.
getYxqz
());
result
.
setStatus
(
drivingLicenseRes
.
getZtValue
());
result
.
setSurplusGrade
(
String
.
valueOf
(
12
-
Integer
.
parseInt
(
drivingLicenseRes
.
getLjjf
())));
return
ResponseGenerator
.
success
(
result
);
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
View file @
89d807be
...
...
@@ -19,4 +19,6 @@ public interface BindInfoMapper extends BaseMapper<BindInfo> {
Integer
clearPast
(
DateTime
dateTime
);
Integer
unbind
(
BindInfo
info
);
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
View file @
89d807be
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 绑定信息实体类
...
...
@@ -56,5 +54,4 @@ public class BindInfo implements Serializable {
private
String
unbindTime
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/DrivingLicenseInfoRes.java
View file @
89d807be
...
...
@@ -25,5 +25,9 @@ public class DrivingLicenseInfoRes {
* 姓名
*/
private
String
driverName
;
/**
* 剩余计分
*/
private
String
surplusGrade
;
}
infra/src/main/resources/mapper/BindInfoMapper.xml
View file @
89d807be
<?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.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper"
>
<insert
id=
"bindInfoInsert"
parameterType=
"com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo"
>
insert ignore into edl_public.bind_info(unq_id,user_id,phone,plate_color,plate_num,plate_type,gmt_bind_time)
values (#{unqId},#{userId},#{phone},#{plateColor},#{plateNum},#{plateType},#{gmtBindTime})
</insert>
<select
id=
"selectByQuery"
parameterType=
"com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery"
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo"
>
select b.unq_id, b.user_id, b.phone,
...
...
@@ -29,6 +36,11 @@
</if>
</select>
<update
id=
"unbind"
>
update edl_public.bind_info as b set b.status="0",b.unbind_time=#{unbindTime} where b.unq_id=#{unqId}
</update>
<delete
id=
"clearPast"
>
delete from edl_public.bind_info as b where b.unbind_time
<![CDATA[ <= ]]>
#{dateTime} and b.status='0'
...
...
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