Commit efd9a41e by xieshixiang

查询违法信息

parent 96821097
...@@ -88,17 +88,17 @@ public class BindInfoControlller extends BaseController { ...@@ -88,17 +88,17 @@ public class BindInfoControlller extends BaseController {
} }
/** /**
* 鉴权接口 * 年检信息查询接口
* *
* @param query * @param query
* @return Result * @return Result
* @author: xsx * @author: xsx
* @date: 2020/6/19 10:32 * @date: 2020/6/19 10:32
*/ */
@GetMapping("yearCheckInfo") @PostMapping("yearCheckInfo")
public Result yearCheckInfo(@RequestBody BindInfoQuery query) { public Result yearCheckInfo(@RequestBody BindInfoQuery query) {
if (query == null) { if (query == null) {
return Result.errorResult(ResultCode.PARAMETER_ERROR, "参数不能为空"); return Result.errorResult(ResultCode.PARAMETER_ERROR, "鉴权失败");
} }
PageResult<BindInfo> bindInfos = mapper.selectByQuery(query); PageResult<BindInfo> bindInfos = mapper.selectByQuery(query);
return bindInfos.getAllCount() > 0 ? Result.successResult(bindInfos) : return bindInfos.getAllCount() > 0 ? Result.successResult(bindInfos) :
...@@ -106,6 +106,18 @@ public class BindInfoControlller extends BaseController { ...@@ -106,6 +106,18 @@ public class BindInfoControlller extends BaseController {
} }
@PostMapping("drivingLicenseInfo")
public Result drivingLicenseInfo(@RequestBody BindInfoQuery query) {
if (query == null) {
return Result.errorResult(ResultCode.PARAMETER_ERROR, "鉴权失败");
}
return service.drivingLicenseInfo(query);
}
......
...@@ -26,4 +26,17 @@ public interface IBindService extends IService<BindInfo> { ...@@ -26,4 +26,17 @@ public interface IBindService extends IService<BindInfo> {
Result yearCheckInfo(BindInfoQuery query); Result yearCheckInfo(BindInfoQuery query);
/**
* 违法信息查询接口
*
* @param query
* @return Result
* @author: xsx
* @date: 2020/6/19 16:06
*/
Result violationInfo(BindInfoQuery query);
Result drivingLicenseInfo(BindInfoQuery query);
} }
...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hikcreate.edl.pub.web.mobile.domain.IBindService; import com.hikcreate.edl.pub.web.mobile.domain.IBindService;
import com.hikcreate.edl.pub.web.mobile.infra.core.Result; import com.hikcreate.edl.pub.web.mobile.infra.core.Result;
import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode; import com.hikcreate.edl.pub.web.mobile.infra.core.enums.ResultCode;
import com.hikcreate.edl.pub.web.mobile.infra.core.page.PageResult;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.VechicleFeign; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.VechicleFeign;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.ViolationFeign;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.PlateNumQueryReq; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.PlateNumQueryReq;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.ViolationPlateNumAndTypeQueryReq;
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.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.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;
...@@ -38,6 +40,8 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple ...@@ -38,6 +40,8 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
BindInfoMapper mapper; BindInfoMapper mapper;
@Resource @Resource
VechicleFeign vechicle; VechicleFeign vechicle;
@Resource
ViolationFeign violatio;
...@@ -46,7 +50,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple ...@@ -46,7 +50,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
info.setUnqId(UUID.randomUUID().toString()); info.setUnqId(UUID.randomUUID().toString());
info.setEditorTime(DateTime.now()); info.setEditorTime(DateTime.now());
//判断规则1:用户已绑定的车辆不超过3辆 //判断规则1:用户已绑定的车辆不超过3辆,包括已解绑但未过一个月的车辆
QueryWrapper boundQuery = new QueryWrapper(); QueryWrapper boundQuery = new QueryWrapper();
boundQuery.eq("user_id", info.getUserId()); boundQuery.eq("user_id", info.getUserId());
Integer bound = mapper.selectCount(boundQuery); Integer bound = mapper.selectCount(boundQuery);
...@@ -76,8 +80,25 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple ...@@ -76,8 +80,25 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
return Result.errorResult(ResultCode.DATA_ERROR,"车辆绑定信息不存在,或已过期!"); return Result.errorResult(ResultCode.DATA_ERROR,"车辆绑定信息不存在,或已过期!");
} }
return Result.successResult(); return Result.successResult();
}
@Override
public Result violationInfo(BindInfoQuery query) {
BindInfo bindInfo = mapper.selectById(query.getUnqId());
if (bindInfo==null || "0".equals(bindInfo.getStatus())){
return Result.errorResult(ResultCode.DATA_ERROR,"车辆绑定信息不存在,或已过期!");
}
ViolationPlateNumAndTypeQueryReq req = new ViolationPlateNumAndTypeQueryReq();
req.setPlateNum(bindInfo.getPlateNum());
req.setPlateType(bindInfo.getPlateType());
List<ViolationRes> byPlateNumAndType = violatio.getByPlateNumAndType(req);
return Result.successResult(byPlateNumAndType);
}
@Override
public Result drivingLicenseInfo(BindInfoQuery query) {
return null;
} }
...@@ -92,4 +113,6 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple ...@@ -92,4 +113,6 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
} }
} }
...@@ -5,9 +5,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.par ...@@ -5,9 +5,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.par
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author: xieshixiang * @author: xieshixiang
......
...@@ -3,13 +3,11 @@ package com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle; ...@@ -3,13 +3,11 @@ package com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.ViolationIdCardQueryReq; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.ViolationIdCardQueryReq;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.ViolationPlateNumAndTypeQueryReq; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.dcp_service_vehicle.param.request.ViolationPlateNumAndTypeQueryReq;
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.feign.dcp_service_vehicle.param.response.ViolationRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 违法信息查询远程调用 * 违法信息查询远程调用
...@@ -17,6 +15,7 @@ import java.util.Map; ...@@ -17,6 +15,7 @@ import java.util.Map;
* @author: xieshixiang * @author: xieshixiang
* @time:2020/6/19 15:26 * @time:2020/6/19 15:26
**/ **/
@FeignClient(value = "dcp-service-vem", path = "violation")
public interface ViolationFeign { public interface ViolationFeign {
/** /**
...@@ -35,7 +34,7 @@ public interface ViolationFeign { ...@@ -35,7 +34,7 @@ public interface ViolationFeign {
* @return * @return
*/ */
@PostMapping("/getByPlateNumAndType") @PostMapping("/getByPlateNumAndType")
public List<ViolationRes> getByPlateNumAndType(@RequestBody ViolationPlateNumAndTypeQueryReq req); List<ViolationRes> getByPlateNumAndType(@RequestBody ViolationPlateNumAndTypeQueryReq req);
} }
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
when '0' then '未绑定' when '0' then '未绑定'
when '1' then '已绑定' when '1' then '已绑定'
end status, end status,
b.plate_num,b.plate_type,b.editor_time from edl_public.bind_info as b b.plate_num,b.plate_type,b.editor_time from edl_public.bind_info as b where b.status='1'
<where>
<if test="userId!=null and nuserId!=''"> <if test="userId!=null and nuserId!=''">
and b.user_id=#{userId} and b.user_id=#{userId}
</if> </if>
...@@ -37,13 +36,9 @@ ...@@ -37,13 +36,9 @@
<if test="plateType!=null and plateType!=''"> <if test="plateType!=null and plateType!=''">
and b.plate_type=#{plateType} and b.plate_type=#{plateType}
</if> </if>
<if test="status!=null and status!=''">
and b.status=#{status}
</if>
<if test="editorTime!=null "> <if test="editorTime!=null ">
and b.editor_time=#{editorTime} and b.editor_time=#{editorTime}
</if> </if>
</where>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment