Commit 0a37ab8e by 牟邦恺

添加驾驶证图片反面查看

parent 55e3e63b
...@@ -17,7 +17,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.configbean.FastDfsConfigBean; ...@@ -17,7 +17,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.configbean.FastDfsConfigBean;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.DrivingLicenseFeign; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.DrivingLicenseFeign;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.request.CreditIdCardMicReq; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.request.CreditIdCardMicReq;
import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.response.DrivingLicenseMicRes; import com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.response.DrivingLicenseMicRes;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseSendSmsCodeReq;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidReq; import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidReq;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidSmsCodeReq; import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidSmsCodeReq;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes; import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes;
...@@ -67,9 +66,9 @@ public class DrivingLicenseController { ...@@ -67,9 +66,9 @@ public class DrivingLicenseController {
return ResultGenerator.success(drivingLicenseValidRes); return ResultGenerator.success(drivingLicenseValidRes);
} }
@PostMapping("/sendSmsCode") @GetMapping("/sendSmsCode")
public Result<Void> sendSmsCode(@RequestBody @Validated DrivingLicenseSendSmsCodeReq req) { public Result<Void> sendSmsCode(@RequestParam("userId") String userId) {
drivingLicenseService.sendSmsCode(req.getUserId()); drivingLicenseService.sendSmsCode(userId);
return ResultGenerator.success(); return ResultGenerator.success();
} }
...@@ -79,7 +78,7 @@ public class DrivingLicenseController { ...@@ -79,7 +78,7 @@ public class DrivingLicenseController {
return ResultGenerator.success(); return ResultGenerator.success();
} }
@GetMapping("/drivingLicenseInfo") @GetMapping("/info")
public Result<DrivingLicenseInfoRes> getDrivingLicenseInfo(@RequestParam("userId") String userId) { public Result<DrivingLicenseInfoRes> getDrivingLicenseInfo(@RequestParam("userId") String userId) {
DrivingLicenseInfoRes drivingLicenseInfoRes = drivingLicenseService.getDrivingLicenseInfo(userId); DrivingLicenseInfoRes drivingLicenseInfoRes = drivingLicenseService.getDrivingLicenseInfo(userId);
return ResultGenerator.success(drivingLicenseInfoRes); return ResultGenerator.success(drivingLicenseInfoRes);
...@@ -88,13 +87,13 @@ public class DrivingLicenseController { ...@@ -88,13 +87,13 @@ public class DrivingLicenseController {
@GetMapping("/image") @GetMapping("/image")
public void image(@RequestParam("userId") String userId, @RequestParam("idCard") String idCard, @RequestParam("type") Integer type, HttpServletResponse response) { public void image(@RequestParam("userId") String userId, @RequestParam("idCard") String idCard, @RequestParam("type") Integer type, HttpServletResponse response) {
// 验证是否有查看权限 // 验证是否有查看权限
if (!drivingLicenseService.checkValid(userId, idCard) && !iBindService.checkValid(userId,idCard)) { if (!drivingLicenseService.checkValid(userId, idCard) && !iBindService.checkValid(userId, idCard)) {
throw new BusinessException(StatusCode.PARAM_ERROR); throw new BusinessException(StatusCode.PARAM_ERROR);
} }
DrivingLicenseMicRes drivingLicenseMicRes = drivingLicenseFeign.getByIdCard(new CreditIdCardMicReq().setIdCard(idCard)).fallback().getData(); DrivingLicenseMicRes drivingLicenseMicRes = drivingLicenseFeign.getByIdCard(new CreditIdCardMicReq().setIdCard(idCard)).fallback().getData();
ByteArrayOutputStream outputStream; ByteArrayOutputStream outputStream;
if(type == null || Objects.equals(type, 1)) { if (type == null || Objects.equals(type, 1)) {
DlImageDO dlImageDO = new DlImageDO(); DlImageDO dlImageDO = new DlImageDO();
dlImageDO.setAddress(drivingLicenseMicRes.getAddress()); dlImageDO.setAddress(drivingLicenseMicRes.getAddress());
dlImageDO.setBelowLicenseNumber(drivingLicenseMicRes.getIdCard()); dlImageDO.setBelowLicenseNumber(drivingLicenseMicRes.getIdCard());
......
...@@ -44,6 +44,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService { ...@@ -44,6 +44,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
private static final String REDIS_KEY = "drv:idcard"; private static final String REDIS_KEY = "drv:idcard";
private static final String REDIS_SMS_KEY = "drv:idcard:sms"; private static final String REDIS_SMS_KEY = "drv:idcard:sms";
private static final String SMS_CODE = "PARK_DRIVING_LICENSE_IDCARD";
@Override @Override
public DrivingLicenseValidRes checkIdCard(String idCard, String userId) { public DrivingLicenseValidRes checkIdCard(String idCard, String userId) {
...@@ -58,9 +59,9 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService { ...@@ -58,9 +59,9 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
drivingLicenseValidRes.setPhone(drivingLicenseMicRes.getPhone()); drivingLicenseValidRes.setPhone(drivingLicenseMicRes.getPhone());
// 检查短信发送 // 检查短信发送
if (checkSmsValid(userId, idCard, drivingLicenseMicRes.getPhone())) { if (checkSmsValid(userId, idCard, drivingLicenseMicRes.getPhone())) {
drivingLicenseValidRes.setSendSmsFlag(true);
} else {
drivingLicenseValidRes.setSendSmsFlag(false); drivingLicenseValidRes.setSendSmsFlag(false);
} else {
drivingLicenseValidRes.setSendSmsFlag(true);
} }
return drivingLicenseValidRes; return drivingLicenseValidRes;
} }
...@@ -71,7 +72,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService { ...@@ -71,7 +72,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
SendVerifyCodeMicReq micReq = new SendVerifyCodeMicReq(); SendVerifyCodeMicReq micReq = new SendVerifyCodeMicReq();
micReq.setPhone(drivingLicenseMicRes.getPhone()); micReq.setPhone(drivingLicenseMicRes.getPhone());
micReq.setVerifyCode(VerifyCodeUtil.getCode()); micReq.setVerifyCode(VerifyCodeUtil.getCode());
micReq.setTemplateCode("PARK_DRIVING_LICENSE_IDCARD"); micReq.setTemplateCode(SMS_CODE);
smsFeign.sendVerifyCode(micReq).fallback(); smsFeign.sendVerifyCode(micReq).fallback();
} }
...@@ -81,7 +82,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService { ...@@ -81,7 +82,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
CheckVerifyCodeMicReq req = new CheckVerifyCodeMicReq(); CheckVerifyCodeMicReq req = new CheckVerifyCodeMicReq();
req.setPhone(drivingLicenseMicRes.getPhone()); req.setPhone(drivingLicenseMicRes.getPhone());
req.setVerifyCode(smsCode); req.setVerifyCode(smsCode);
req.setTemplateCode("PARK_DRIVING_LICENSE_IDCARD"); req.setTemplateCode(SMS_CODE);
smsFeign.checkVerifyCode(req).fallback(); smsFeign.checkVerifyCode(req).fallback();
// 保存验证redis // 保存验证redis
saveSmsValid(userId, drivingLicenseMicRes.getIdCard(), drivingLicenseMicRes.getPhone()); saveSmsValid(userId, drivingLicenseMicRes.getIdCard(), drivingLicenseMicRes.getPhone());
......
package com.hikcreate.edl.pub.web.mobile.infra.core.config; package com.hikcreate.edl.pub.web.mobile.infra.core.config;
import com.hikcreate.edl.common.image.builder.refactor.material.DlBackMaterial;
import com.hikcreate.edl.common.image.builder.refactor.material.DlMaterial; import com.hikcreate.edl.common.image.builder.refactor.material.DlMaterial;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -18,4 +19,10 @@ public class DrawConfig { ...@@ -18,4 +19,10 @@ public class DrawConfig {
return new DlMaterial(); return new DlMaterial();
} }
@Bean
@ConfigurationProperties("biz.image.builder.dl-back")
public DlBackMaterial dlBackMaterial() {
return new DlBackMaterial();
}
} }
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