Commit 49a234a7 authored by 杨锐's avatar 杨锐

app - 申请修改手机号Step_2 协议修改。

parent 45f80845
......@@ -5,6 +5,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.AuditReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.JsonResult;
......@@ -35,7 +36,7 @@ public class ModifyPhoneNoController implements IBaseController {
@ApiOperation("app - 查询用户手机号修改进度")
@GetMapping("/progress")
public JsonResult progress() {
public JsonResult<ProgressResp> progress() {
User user = getCurrentUserFromRedis();
if (user == null) {
return JsonResult.buildErrorStateResult("系统错误", null);
......
package cn.quantgroup.xyqb.controller.modifyphoneno.resp;
import lombok.Data;
/**
* 用户手机号修改进度
* <p>
* Date: 2019/11/11
* Time: 下午4:34
*
* @author: yangrui
*/
@Data
public class ProgressResp {
/**
* 进度
* 0初始化(用户未填写过申请单或提交过的申请单均已处理完成且反馈);
* 1已填写基本信息,未上传身份证图片;
* 2已填写基本信息,且已上传身份证图片
*/
private Integer progress;
/**
* 当progress = 1时,该值不为空,为api step2需要的id。
*/
private Long id;
}
......@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.AuditReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import org.springframework.data.domain.Page;
......@@ -25,7 +26,7 @@ public interface IModifyPhoneNoService {
*/
void saveStep2(Step2Req step2Req);
Integer progress(Long id);
ProgressResp progress(Long id);
Page<ModifyPhoneNo> list(ModifyPhoneNoQueryReq modifyPhoneNoQueryReq);
......
......@@ -7,6 +7,7 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.req.AuditReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step1Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.Step2Req;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.controller.modifyphoneno.resp.UserLoanStatusResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.exception.DataException;
......@@ -105,23 +106,27 @@ public class ModifyPhoneNoServiceImpl implements IModifyPhoneNoService {
* 查询用户手机号修改进度
*
* @param userId user.id
* @return 进度 0初始化(用户未填写过申请单或提交过的申请单均已处理完成且反馈);
* 1已填写基本信息,未上传身份证图片;
* 2已填写基本信息,且已上传身份证图片
* @return
*/
@Override
public Integer progress(Long userId) {
public ProgressResp progress(Long userId) {
ProgressResp progressResp = new ProgressResp();
ModifyPhoneNo modifyPhoneNo = modifyPhoneNoRepository.findFirstByUserIdAndApplyStatus(userId, ModifyPhoneNoApplyStatusEnum.INIT.ordinal());
if (modifyPhoneNo == null) {
return 0;
progressResp.setProgress(0);
return progressResp;
}
if (StringUtils.isBlank(modifyPhoneNo.getIdCardFaceUrl()) && StringUtils.isBlank(modifyPhoneNo.getIdCardRearUrl()) && StringUtils.isBlank(modifyPhoneNo.getIdCardHoldUrl())) {
return 1;
progressResp.setProgress(1);
progressResp.setId(modifyPhoneNo.getId());
return progressResp;
}
if (StringUtils.isNotBlank(modifyPhoneNo.getIdCardFaceUrl()) && StringUtils.isNotBlank(modifyPhoneNo.getIdCardRearUrl()) && StringUtils.isNotBlank(modifyPhoneNo.getIdCardHoldUrl())) {
return 2;
progressResp.setProgress(2);
return progressResp;
}
return -1;
progressResp.setProgress(-1);
return progressResp;
}
@Override
......
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