Commit fe694fe2 by xieshixiang

修改BUG

parent 89d807be
......@@ -12,6 +12,7 @@ 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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -58,19 +59,19 @@ public class BindInfoControlller extends BaseController {
/**
* 解绑用户信息的接口
*
* @param info
* @param query
* @return Result
* @author: xsx
* @date: 2020/6/19 10:27
*/
@PostMapping("unbind")
public Response unbindInfo(@RequestBody BindInfo info) {
if (info == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
info.setStatus("0");
info.setUnbindTime(DateTime.now().toString());
return mapper.unbind(info) > 0 ? ResponseGenerator.success() : ResponseGenerator.fail("");
public Response unbindInfo(@RequestBody @Validated BindInfoQuery query) {
BindInfo bindInfo = new BindInfo();
bindInfo.setUnqId(query.getUnqId());
bindInfo.setStatus("0");
bindInfo.setUnbindTime(DateTime.now().toString());
return mapper.unbind(bindInfo) > 0 ? ResponseGenerator.success() : ResponseGenerator.fail("");
}
/**
......@@ -83,10 +84,8 @@ public class BindInfoControlller extends BaseController {
*/
@PostMapping("query")
@ResponseEncryptAnnotation
public Response<ResultList<BindInfo>> bindInfoQery(@RequestBody BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
public Response<ResultList<BindInfo>> bindInfoQery(@RequestBody @Validated BindInfoQuery query) {
return ResponseGenerator.success(new ResultList<BindInfo>(mapper.selectByQuery(query).getDataItems()));
}
......
......@@ -16,7 +16,12 @@ 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.request.CheckVerifyCodeReq;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.request.SendVerifyCodeReq;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.*;
import com.hikcreate.edl.pub.web.mobile.infra.model.param.response.CheckValidityRes;
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.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......@@ -59,9 +64,7 @@ public class H5Controller {
*/
@PostMapping("yearCheckInfo")
public Response<YearCheckInfoRes> yearCheckInfo(@RequestBody @Validated BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
return service.yearCheckInfo(query);
}
......@@ -75,9 +78,7 @@ public class H5Controller {
*/
@PostMapping("violationInfo")
public Response<ResultList<ViolationInfoRes>> violationInfo(@RequestBody @Validated BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
return service.violationInfo(query);
}
......@@ -91,9 +92,7 @@ public class H5Controller {
*/
@PostMapping("insuranceInfo")
public Response<InsuranceInfoRes> insuranceInfo(@RequestBody @Validated BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
return service.insuranceInfo(query);
}
......@@ -108,9 +107,7 @@ public class H5Controller {
*/
@PostMapping("drivingLicenseInfo")
public Response<DrivingLicenseInfoRes> drivingLicenseInfo(@RequestBody @Validated BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
return service.drivingLicenseInfo(query);
}
......@@ -121,9 +118,7 @@ public class H5Controller {
*/
@PostMapping("checkValidity")
public Response<CheckValidityRes> checkValidity( @RequestBody @Validated BindInfoQuery query) {
if (query == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
VerifyInfo verifyInfo = verifyInfoMapper.checkValidity(query.getPhone(), query.getUserId(),
DateUtil.offsetDay(DateTime.now(), -10));
......@@ -147,9 +142,7 @@ public class H5Controller {
*/
@PostMapping("sendVerifyCode")
public Response<Void> sendVerifyCode(@RequestBody @Validated SendVerifyCodeReq req) {
if (req == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
SendVerifyCodeMicReq micReq = new SendVerifyCodeMicReq();
micReq.setPhone(req.getPhone());
micReq.setVerifyCode(VerifyCodeUtil.getCode());
......@@ -167,9 +160,7 @@ public class H5Controller {
*/
@PostMapping("checkVerifyCode")
public Response<Void> sendVerifyCode(@RequestBody @Validated CheckVerifyCodeReq req) {
if (req == null) {
return ResponseGenerator.fail(StatusCode.PARAM_ERROR);
}
CheckVerifyCodeMicReq micReq = new CheckVerifyCodeMicReq();
micReq.setPhone(req.getPhone());
micReq.setVerifyCode(req.getVerifyCode());
......
......@@ -145,6 +145,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, BindInfo> imple
}
InsuranceInfoRes insuranceInfoRes = new InsuranceInfoRes();
insuranceInfoRes.setPlateNum(bindInfo.getPlateNum());
insuranceInfoRes.setInsuranceType("交强险");
if (StrUtil.isNotBlank(vehicleRes.getBxzzrq())) {
Long time = DateUtil.parse(vehicleRes.getBxzzrq(), "yyyy-MM-dd HH:mm:ss").getTime();
if (time >= System.currentTimeMillis()) {
......
......@@ -25,5 +25,8 @@ public class InsuranceInfoRes {
* 保险状态
*/
private String status;
/**
* 保险类型
*/
private String insuranceType;
}
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