Browse Source

调整

master
zouhantao 1 month ago
parent
commit
a9b7092cf5

+ 6
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/ass/ActiveController.java View File

@@ -45,4 +45,10 @@ public class ActiveController extends MyValidController {
return ApiResponse.of(resDto).setMessage("保存成功");
}

@ApiOperation(value = "校验验证码")
@PostMapping(value = "/saveRecords")
public ApiResponse checkSendCode(@Valid @RequestBody CheckCodeRequest reqDto) throws ManagerException {
manager.checkSendCode(reqDto);
return ApiResponse.success().setMessage("操作成功");
}
}

+ 24
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/dto/ass/active/CheckCodeRequest.java View File

@@ -0,0 +1,24 @@
package cn.com.taiji.iaw.dto.ass.active;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import cn.com.taiji.core.dto.AbstractBizRequestDTO;
import cn.com.taiji.core.model.comm.protocol.valid.RegexConstant;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@Accessors(chain = true)
public class CheckCodeRequest extends AbstractBizRequestDTO {

@Pattern(regexp = RegexConstant.REGEX_MOBILE, message = "手机号格式不正确")
@NotBlank(message = "手机号码不能为空")
private String mobile;
@NotBlank(message = "短信验证码不能为空")
private String code;

}

+ 1
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/ActiveManager.java View File

@@ -11,4 +11,5 @@ public interface ActiveManager {
SaveRecordResponseDTO saveRecord(SaveRecordRequestDTO requestDTO) throws ManagerException;
QueryVehicleResponseDTO queryVehicle(QueryVehicleRequestDTO requestDTO) throws ManagerException;
ActivateDetailsResponseDTO saveRecords(ActivateDetailsRequestDTO requestDTO) throws ManagerException;
void checkSendCode(CheckCodeRequest request) throws ManagerException;
}

+ 21
- 13
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/ass/ActiveManagerImpl.java View File

@@ -4,30 +4,29 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.core.entity.ass.AssDeviceReactivate;
import cn.com.taiji.core.entity.ass.AssOrderinfo;
import cn.com.taiji.core.entity.basic.QtkCardInfo;
import cn.com.taiji.core.entity.basic.QtkObuInfo;
import cn.com.taiji.core.entity.dict.AuditStatus;
import cn.com.taiji.core.entity.dict.ass.AssOrderStatus;
import cn.com.taiji.core.entity.dict.ass.AssOrderType;
import cn.com.taiji.core.entity.dict.basic.CardStatus;
import cn.com.taiji.core.repo.jpa.ass.AssDeviceReactivateRepo;
import cn.com.taiji.core.repo.jpa.ass.AssOrderinfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkObuInfoRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.pub.BeanTools;
import cn.com.taiji.core.entity.ass.AssDeviceReactivate;
import cn.com.taiji.core.entity.ass.AssOrderinfo;
import cn.com.taiji.core.entity.basic.QtkCardInfo;
import cn.com.taiji.core.entity.basic.QtkCustomerInfo;
import cn.com.taiji.core.entity.basic.QtkVehicleInfo;
import cn.com.taiji.core.entity.dict.AuditStatus;
import cn.com.taiji.core.entity.dict.ass.AssOrderStatus;
import cn.com.taiji.core.entity.dict.ass.AssOrderType;
import cn.com.taiji.core.entity.issue.IssueOrderinfo;
import cn.com.taiji.core.entity.managew.ActiveRecord;
import cn.com.taiji.core.manager.cache.RedisKeyGenerator;
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError;
import cn.com.taiji.core.repo.jpa.ass.AssDeviceReactivateRepo;
import cn.com.taiji.core.repo.jpa.ass.AssOrderinfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkCardInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkCustomerInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkObuInfoRepo;
import cn.com.taiji.core.repo.jpa.basic.QtkVehicleInfoRepo;
import cn.com.taiji.core.repo.jpa.issue.IssueOrderinfoRepo;
import cn.com.taiji.core.repo.jpa.managew.ActiveRecordRepo;
@@ -166,4 +165,13 @@ public class ActiveManagerImpl extends AbstractCommManager implements ActiveMana
saveRecord(saveRecordRequestDTO);
return new ActivateDetailsResponseDTO();
}
@Override
public void checkSendCode(CheckCodeRequest request) throws ManagerException {
request.validate();
String smsCode = redisManager.get(RedisKeyGenerator.getSmsCodeKey(request.getMobile(), request.getLoginSource(), 4));
if (!hasText(smsCode))
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("短信验证码已过期,请重新发送");
if (!smsCode.equals(request.getCode()))
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("短信验证码错误!");
}
}

Loading…
Cancel
Save