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
a6c5cd16
Commit
a6c5cd16
authored
4 years ago
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回结果类封装
parent
2518a525
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
30 deletions
+57
-30
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+5
-5
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
+5
-4
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+20
-12
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/feign/dcp_service_vehicle/VechicleFeign.java
+1
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/feign/dcp_service_vehicle/ViolationFeign.java
+1
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
+1
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
+24
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ViolationInfoRes.java
+0
-7
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
a6c5cd16
...
@@ -8,6 +8,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode;
...
@@ -8,6 +8,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode;
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.BindInfo
;
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.BindInfoQuery
;
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
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -44,7 +45,7 @@ public class BindInfoControlller extends BaseController {
...
@@ -44,7 +45,7 @@ public class BindInfoControlller extends BaseController {
*/
*/
@PostMapping
(
"bind"
)
@PostMapping
(
"bind"
)
@ResponseEncryptAnnotation
@ResponseEncryptAnnotation
public
Result
bindInfo
(
@RequestBody
BindInfo
info
)
{
public
Result
<
String
>
bindInfo
(
@RequestBody
BindInfo
info
)
{
if
(
info
==
null
)
{
if
(
info
==
null
)
{
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
,
"参数不能为空"
);
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
,
"参数不能为空"
);
}
}
...
@@ -80,14 +81,13 @@ public class BindInfoControlller extends BaseController {
...
@@ -80,14 +81,13 @@ public class BindInfoControlller extends BaseController {
*/
*/
@PostMapping
(
"query"
)
@PostMapping
(
"query"
)
@ResponseEncryptAnnotation
@ResponseEncryptAnnotation
public
Result
<
BindInfo
>
bindInfoQery
(
@RequestBody
BindInfoQuery
query
)
{
public
Result
<
ResultList
<
BindInfo
>
>
bindInfoQery
(
@RequestBody
BindInfoQuery
query
)
{
if
(
query
==
null
)
{
if
(
query
==
null
)
{
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
}
}
return
Result
.
successResult
();
return
Result
.
successResult
(
new
ResultList
<
BindInfo
>(
mapper
.
selectByQuery
(
query
).
getDataItems
()));
}
}
}
}
This diff is collapsed.
Click to expand it.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/H5Controller.java
View file @
a6c5cd16
...
@@ -6,6 +6,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode;
...
@@ -6,6 +6,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode;
import
com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.BindInfoQuery
;
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
;
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.ViolationInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -15,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -15,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestBody;
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
;
import
java.util.List
;
/**
/**
* 对外提供给H5的接口
* 对外提供给H5的接口
*
*
...
@@ -30,6 +29,7 @@ public class H5Controller {
...
@@ -30,6 +29,7 @@ public class H5Controller {
@Autowired
@Autowired
IBindService
service
;
IBindService
service
;
/**
/**
* 年检信息查询接口
* 年检信息查询接口
*
*
...
@@ -55,12 +55,13 @@ public class H5Controller {
...
@@ -55,12 +55,13 @@ public class H5Controller {
* @date: 2020/6/19 16:28
* @date: 2020/6/19 16:28
*/
*/
@GetMapping
(
"violationInfo"
)
@GetMapping
(
"violationInfo"
)
public
Result
<
ViolationInfoRes
>
violationInfo
(
@RequestBody
BindInfoQuery
query
)
{
public
Result
<
ResultList
<
ViolationInfoRes
>
>
violationInfo
(
@RequestBody
BindInfoQuery
query
)
{
if
(
query
==
null
)
{
if
(
query
==
null
)
{
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
}
}
return
service
.
violationInfo
(
query
);
return
service
.
violationInfo
(
query
);
}
}
/**
/**
* 保险信息查询接口
* 保险信息查询接口
*
*
...
@@ -70,7 +71,7 @@ public class H5Controller {
...
@@ -70,7 +71,7 @@ public class H5Controller {
* @date: 2020/6/19 16:28
* @date: 2020/6/19 16:28
*/
*/
@GetMapping
(
"insuranceInfo"
)
@GetMapping
(
"insuranceInfo"
)
public
Result
<
InsuranceInfoRes
>
insuranceInfo
(
@RequestBody
BindInfoQuery
query
){
public
Result
<
InsuranceInfoRes
>
insuranceInfo
(
@RequestBody
BindInfoQuery
query
)
{
if
(
query
==
null
)
{
if
(
query
==
null
)
{
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
PARAMETER_ERROR
);
}
}
...
...
This diff is collapsed.
Click to expand it.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
a6c5cd16
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
domain
.
impl
;
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
domain
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -18,6 +19,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.BindInfo;
...
@@ -18,6 +19,7 @@ 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.BindInfoQuery
;
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
;
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.ViolationInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.YearCheckInfoRes
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -26,6 +28,7 @@ import org.springframework.scheduling.annotation.Scheduled;
...
@@ -26,6 +28,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -48,7 +51,6 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
...
@@ -48,7 +51,6 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
ViolationFeign
violatio
;
ViolationFeign
violatio
;
@Override
@Override
public
Result
bind
(
BindInfo
info
)
{
public
Result
bind
(
BindInfo
info
)
{
info
.
setUnqId
(
UUID
.
randomUUID
().
toString
());
info
.
setUnqId
(
UUID
.
randomUUID
().
toString
());
...
@@ -63,24 +65,24 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
...
@@ -63,24 +65,24 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
}
}
//规则2:客户手机号与车辆对应的车主手机号一致
//规则2:客户手机号与车辆对应的车主手机号一致
PlateNumQueryReq
req
=
new
PlateNumQueryReq
();
PlateNumQueryReq
req
=
new
PlateNumQueryReq
();
req
.
setPlateNum
(
info
.
getPlateNum
());
req
.
setPlateNum
(
info
.
getPlateNum
());
List
<
VehicleRes
>
byPlateNum
=
vechicle
.
getByPlateNum
(
req
);
List
<
VehicleRes
>
byPlateNum
=
vechicle
.
getByPlateNum
(
req
);
for
(
VehicleRes
res
:
byPlateNum
)
{
for
(
VehicleRes
res
:
byPlateNum
)
{
if
(
info
.
getPhone
().
equals
(
res
.
getSjhm
())){
if
(
info
.
getPhone
().
equals
(
res
.
getSjhm
()))
{
info
.
setPlateType
(
res
.
getHpzl
());
info
.
setPlateType
(
res
.
getHpzl
());
}
}
}
}
if
(
info
.
getPlateType
()
==
null
||
info
.
getPlateType
().
equals
(
""
))
{
if
(
info
.
getPlateType
()
==
null
||
info
.
getPlateType
().
equals
(
""
))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
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
();
}
}
@Override
@Override
public
Result
<
YearCheckInfoRes
>
yearCheckInfo
(
BindInfoQuery
query
)
{
public
Result
<
YearCheckInfoRes
>
yearCheckInfo
(
BindInfoQuery
query
)
{
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
}
return
null
;
return
null
;
...
@@ -89,7 +91,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
...
@@ -89,7 +91,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
@Override
@Override
public
Result
<
InsuranceInfoRes
>
insuranceInfo
(
BindInfoQuery
query
)
{
public
Result
<
InsuranceInfoRes
>
insuranceInfo
(
BindInfoQuery
query
)
{
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
}
return
null
;
return
null
;
...
@@ -97,9 +99,9 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
...
@@ -97,9 +99,9 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
@Override
@Override
public
Result
<
ViolationInfoRes
>
violationInfo
(
BindInfoQuery
query
)
{
public
Result
<
ResultList
<
ViolationInfoRes
>
>
violationInfo
(
BindInfoQuery
query
)
{
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
}
...
@@ -107,13 +109,19 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
...
@@ -107,13 +109,19 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
req
.
setPlateNum
(
bindInfo
.
getPlateNum
());
req
.
setPlateNum
(
bindInfo
.
getPlateNum
());
req
.
setPlateType
(
bindInfo
.
getPlateType
());
req
.
setPlateType
(
bindInfo
.
getPlateType
());
List
<
ViolationRes
>
byPlateNumAndType
=
violatio
.
getByPlateNumAndType
(
req
);
List
<
ViolationRes
>
byPlateNumAndType
=
violatio
.
getByPlateNumAndType
(
req
);
return
null
;
List
<
ViolationInfoRes
>
violationInfoResList
=
new
ArrayList
<>();
for
(
ViolationRes
res
:
byPlateNumAndType
){
ViolationInfoRes
info
=
new
ViolationInfoRes
();
BeanUtil
.
copyProperties
(
res
,
info
);
violationInfoResList
.
add
(
info
);
}
return
Result
.
successResult
(
new
ResultList
<>(
violationInfoResList
));
}
}
@Override
@Override
public
Result
<
DrivingLicenseInfoRes
>
drivingLicenseInfo
(
BindInfoQuery
query
)
{
public
Result
<
DrivingLicenseInfoRes
>
drivingLicenseInfo
(
BindInfoQuery
query
)
{
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
BindInfo
bindInfo
=
mapper
.
selectById
(
query
.
getUnqId
());
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
if
(
bindInfo
==
null
||
"0"
.
equals
(
bindInfo
.
getStatus
()))
{
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
return
Result
.
errorResult
(
ResultCode
.
DATA_ERROR
);
}
}
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/feign/dcp_service_vehicle/VechicleFeign.java
View file @
a6c5cd16
...
@@ -11,7 +11,7 @@ import java.util.List;
...
@@ -11,7 +11,7 @@ import java.util.List;
* @author: xieshixiang
* @author: xieshixiang
* @time:2020/6/19 14:26
* @time:2020/6/19 14:26
**/
**/
@FeignClient
(
value
=
"dcp-service-vem"
,
path
=
"vehicle"
)
@FeignClient
(
value
=
"dcp-service-vem"
,
path
=
"vehicle"
,
contextId
=
"dcp-service-vem-vehicle"
)
public
interface
VechicleFeign
{
public
interface
VechicleFeign
{
/**
/**
...
...
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/feign/dcp_service_vehicle/ViolationFeign.java
View file @
a6c5cd16
...
@@ -15,7 +15,7 @@ import java.util.List;
...
@@ -15,7 +15,7 @@ import java.util.List;
* @author: xieshixiang
* @author: xieshixiang
* @time:2020/6/19 15:26
* @time:2020/6/19 15:26
**/
**/
@FeignClient
(
value
=
"dcp-service-vem"
,
path
=
"violation"
)
@FeignClient
(
value
=
"dcp-service-vem"
,
path
=
"violation"
,
contextId
=
"dcp-service-vem-violation"
)
public
interface
ViolationFeign
{
public
interface
ViolationFeign
{
/**
/**
...
...
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/BindInfo.java
View file @
a6c5cd16
...
@@ -14,6 +14,7 @@ import java.util.Date;
...
@@ -14,6 +14,7 @@ import java.util.Date;
*/
*/
@Data
@Data
public
class
BindInfo
implements
Serializable
{
public
class
BindInfo
implements
Serializable
{
/**
/**
* 绑定信息唯一标识,使用UUID
* 绑定信息唯一标识,使用UUID
*/
*/
...
...
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
0 → 100644
View file @
a6c5cd16
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* 返回结果列表包装类
*
* @author: xieshixiang
* @time:2020/6/19 17:52
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
ResultList
<
T
>
{
List
<
T
>
list
;
}
This diff is collapsed.
Click to expand it.
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ViolationInfoRes.java
View file @
a6c5cd16
...
@@ -10,10 +10,6 @@ import java.util.List;
...
@@ -10,10 +10,6 @@ import java.util.List;
**/
**/
public
class
ViolationInfoRes
{
public
class
ViolationInfoRes
{
List
<
ViolationInfo
>
list
;
public
static
class
ViolationInfo
{
/**
/**
* 违法行为
* 违法行为
*/
*/
...
@@ -34,7 +30,4 @@ public class ViolationInfoRes {
...
@@ -34,7 +30,4 @@ public class ViolationInfoRes {
* 违法计分
* 违法计分
*/
*/
private
String
wfjfs
;
private
String
wfjfs
;
}
}
}
This diff is collapsed.
Click to expand it.
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