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
b106cfc5
Commit
b106cfc5
authored
Jun 21, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回结果类封装
parent
19deeea7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
36 deletions
+96
-36
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
+21
-6
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/VerifyInfoMapper.java
+18
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
+6
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/DrivingLicenseInfoRes.java
+7
-3
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/InsuranceInfoRes.java
+10
-3
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ViolationInfoRes.java
+12
-5
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/YearCheckInfoRes.java
+9
-2
infra/src/main/resources/mapper/BindInfoMapper.xml
+2
-14
infra/src/main/resources/mapper/VerifyInfoMapper.xml
+10
-0
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
b106cfc5
...
...
@@ -67,7 +67,7 @@ public class BindInfoControlller extends BaseController {
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
}
info
.
setStatus
(
"0"
);
info
.
set
Editor
Time
(
DateTime
.
now
());
info
.
set
Unbind
Time
(
DateTime
.
now
());
return
mapper
.
updateById
(
info
)
>
0
?
Result
.
successResult
()
:
Result
.
errorResult
();
}
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
b106cfc5
...
...
@@ -15,8 +15,10 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.par
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.response.VehicleRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.response.ViolationRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper
;
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.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
;
...
...
@@ -49,12 +51,14 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
VechicleFeign
vechicle
;
@Resource
ViolationFeign
violatio
;
@Resource
VerifyInfoMapper
verifyInfo
;
@Override
public
Result
bind
(
BindInfo
info
)
{
info
.
setUnqId
(
UUID
.
randomUUID
().
toString
());
info
.
set
Editor
Time
(
DateTime
.
now
());
info
.
set
GmtBind
Time
(
DateTime
.
now
());
//判断规则1:用户已绑定的车辆不超过3辆,包括已解绑但未过一个月的车辆
QueryWrapper
boundQuery
=
new
QueryWrapper
();
...
...
@@ -76,7 +80,8 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
if
(
info
.
getPlateType
()
==
null
||
info
.
getPlateType
().
equals
(
""
))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
return
mapper
.
insert
(
info
)
>
0
?
Result
.
successResult
(
info
.
getUnqId
())
:
Result
.
errorResult
();
return
mapper
.
insert
(
info
)
>
0
?
Result
.
successResult
(
info
.
getUnqId
())
:
Result
.
errorResult
(
ResultCode
.
SERVICE_ERROR
);
}
@Override
...
...
@@ -109,10 +114,14 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
req
.
setPlateNum
(
bindInfo
.
getPlateNum
());
req
.
setPlateType
(
bindInfo
.
getPlateType
());
List
<
ViolationRes
>
byPlateNumAndType
=
violatio
.
getByPlateNumAndType
(
req
);
List
<
ViolationInfoRes
>
violationInfoResList
=
new
ArrayList
<>();
for
(
ViolationRes
res
:
byPlateNumAndType
){
List
<
ViolationInfoRes
>
violationInfoResList
=
new
ArrayList
<>();
for
(
ViolationRes
res
:
byPlateNumAndType
)
{
ViolationInfoRes
info
=
new
ViolationInfoRes
();
BeanUtil
.
copyProperties
(
res
,
info
);
info
.
setPlateNum
(
res
.
getHphm
());
info
.
setAction
(
res
.
getWfxw
());
info
.
setAddress
(
res
.
getWfdz
());
info
.
setGrade
(
res
.
getWfjfs
());
info
.
setMoney
(
res
.
getfk
);
violationInfoResList
.
add
(
info
);
}
return
Result
.
successResult
(
new
ResultList
<>(
violationInfoResList
));
...
...
@@ -124,7 +133,13 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
return
null
;
VerifyInfo
verifyInfo
=
this
.
verifyInfo
.
checkValidity
(
query
.
getPhone
(),
query
.
getUserId
(),
DateUtil
.
offsetDay
(
DateTime
.
now
(),
-
10
));
if
(
verifyInfo
==
null
)
{
}
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/VerifyInfoMapper.java
0 → 100644
View file @
b106cfc5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
data
.
mapper
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.VerifyInfo
;
import
org.apache.ibatis.annotations.Param
;
/**
* 短信验证通过记录信息操作接口
*
* @author: xieshixiang
* @time:2020/6/19 18:34
**/
public
interface
VerifyInfoMapper
extends
BaseMapper
<
VerifyInfo
>
{
VerifyInfo
checkValidity
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"time"
)
DateTime
last
);
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
View file @
b106cfc5
...
...
@@ -45,9 +45,13 @@ public class BindInfo implements Serializable {
*/
private
String
status
;
/**
*
信息的编辑
时间
*
绑定
时间
*/
private
DateTime
editorTime
;
private
DateTime
gmtBindTime
;
/**
* 解绑时间
*/
private
DateTime
unbindTime
;
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/DrivingLicenseInfoRes.java
View file @
b106cfc5
...
...
@@ -10,16 +10,20 @@ import lombok.Data;
public
class
DrivingLicenseInfoRes
{
/**
* 车牌号
*/
private
String
plateNum
;
/**
*有效期止
*/
private
String
yxqz
;
private
String
validityTime
;
/**
* 驾驶证状态
*/
private
String
zt
;
private
String
status
;
/**
* 姓名
*/
private
String
xm
;
private
String
driverName
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/InsuranceInfoRes.java
View file @
b106cfc5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.Data
;
/**
* @author: xieshixiang
* @time:2020/6/19 17:06
**/
@Data
public
class
InsuranceInfoRes
{
/**
* 车牌号
*/
private
String
plateNum
;
/**
* 有效期始
*/
private
String
yxqs
;
private
String
validityTimeStart
;
/**
* 有效期止
*/
private
String
yxqz
;
private
String
validityTimeEnd
;
/**
* 保险状态
*/
private
String
zt
;
private
String
status
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ViolationInfoRes.java
View file @
b106cfc5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.Data
;
import
java.util.List
;
/**
...
...
@@ -8,26 +10,31 @@ import java.util.List;
* @author: xieshixiang
* @time:2020/6/19 16:48
**/
@Data
public
class
ViolationInfoRes
{
/**
* 车牌号
*/
private
String
plateNum
;
/**
* 违法行为
*/
private
String
wfxw
;
private
String
action
;
/**
* 处理时间
*/
private
String
clsj
;
private
String
time
;
/**
* 违法地址
*/
private
String
wfdz
;
private
String
address
;
/**
* 罚款金额
*/
private
String
fkje
;
private
String
money
;
/**
* 违法计分
*/
private
String
wfjfs
;
private
String
grade
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/YearCheckInfoRes.java
View file @
b106cfc5
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.Data
;
/**
* 年检信息返回实体类
* @author: xieshixiang
* @time:2020/6/19 16:45
**/
@Data
public
class
YearCheckInfoRes
{
/**
* 车牌号
*/
private
String
plateNum
;
/**
*有效期止
*/
private
String
yxqz
;
private
String
validityTime
;
/**
* 年检状态
*/
private
String
zt
;
private
String
status
;
}
infra/src/main/resources/BindInfoMapper.xml
→
infra/src/main/resources/
mapper/
BindInfoMapper.xml
View file @
b106cfc5
...
...
@@ -20,30 +20,18 @@
when '0' then '未绑定'
when '1' then '已绑定'
end status,
b.plate_num,b.plate_type,b.
editor
_time from edl_public.bind_info as b where b.status='1'
b.plate_num,b.plate_type,b.
gmt_bind
_time from edl_public.bind_info as b where b.status='1'
<if
test=
"userId!=null and nuserId!=''"
>
and b.user_id=#{userId}
</if>
<if
test=
"phone!=null and phone!=''"
>
and b.phone=#{phone}
</if>
<if
test=
"plateColor!=null and plateColor!=''"
>
and b.plate_color=#{plateColor}
</if>
<if
test=
"plateNum!=null and plateNum!=''"
>
and b.plate_num=#{plateNum}
</if>
<if
test=
"plateType!=null and plateType!=''"
>
and b.plate_type=#{plateType}
</if>
<if
test=
"editorTime!=null "
>
and b.editor_time=#{editorTime}
</if>
</select>
<delete
id=
"clearPast"
>
delete from edl_public.bind_info as b where b.
editor
_time
<![CDATA[ <= ]]>
#{dateTime} and b.status='0'
delete from edl_public.bind_info as b where b.
unbind
_time
<![CDATA[ <= ]]>
#{dateTime} and b.status='0'
</delete>
</mapper>
infra/src/main/resources/mapper/VerifyInfoMapper.xml
0 → 100644
View file @
b106cfc5
<?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.VerifyInfoMapper"
>
<select
id=
"checkValidity"
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.VerifyInfo"
>
select id, user_id, verify_code, phone,pass_time from edl_public.verify_info as v
where pass_time
<![CDATA[ >= ]]>
#{time} and phone=#{phone} and user_id=#{userId}
</select>
</mapper>
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