Pārlūkot izejas kodu

iaw 车牌校验

master
chenchaod pirms 1 mēnesi
vecāks
revīzija
71a3515b50

+ 38
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/api/issue/PlateCheckController.java Parādīt failu

@@ -0,0 +1,38 @@
package cn.com.taiji.iaw.api.issue;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.web.ApiResponse;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckRequest;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckResponse;
import cn.com.taiji.iaw.api.MyValidController;
import cn.com.taiji.iaw.manager.issue.PlateCheckManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

/**
* @Author ChenChao
* @Date 2024/9/13 18:45
* @Description
*/
@Api(tags = {"车牌校验"})
@RestController
@RequestMapping("/app/issue/plateCheck")
public class PlateCheckController extends MyValidController {

@Autowired
private PlateCheckManager manager;

@ApiOperation(value = "车牌校验")
@PostMapping(value = "/check")
public ApiResponse<VehiclePlateCheckResponse> processAdd(@Valid @RequestBody VehiclePlateCheckRequest reqDto) throws ManagerException {
VehiclePlateCheckResponse query = manager.query(reqDto);
return ApiResponse.of(query);
}

}

+ 15
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/PlateCheckManager.java Parādīt failu

@@ -0,0 +1,15 @@
package cn.com.taiji.iaw.manager.issue;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckRequest;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckResponse;

/**
* @Author:ChenChao
* @Date:2025/7/9 20:51
* @Filename:PlateCheckManager
* @description:
*/
public interface PlateCheckManager {
VehiclePlateCheckResponse query(VehiclePlateCheckRequest reqDto) throws ManagerException;
}

+ 32
- 0
zhywpt-app-iaw/src/main/java/cn/com/taiji/iaw/manager/issue/PlateCheckManagerImpl.java Parādīt failu

@@ -0,0 +1,32 @@
package cn.com.taiji.iaw.manager.issue;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckRequest;
import cn.com.taiji.core.model.comm.protocol.ias.vaild.VehiclePlateCheckResponse;
import cn.com.taiji.iaw.manager.AbstractIawManager;
import org.springframework.stereotype.Service;

/**
* @Author:ChenChao
* @Date:2025/7/9 20:51
* @Filename:PlateCheckManagerImpl
* @description:
*/
@Service
public class PlateCheckManagerImpl extends AbstractIawManager implements PlateCheckManager{
@Override
public VehiclePlateCheckResponse query(VehiclePlateCheckRequest reqDto) throws ManagerException {
VehiclePlateCheckResponse response = null;
try {
response = jsonPostRepeat(reqDto);
}catch (ManagerException e){
if (e.getMessage().contains("车牌发行校验失败")) {
throw new ManagerException("请核对车牌号和车牌颜色");
}else {
throw e;
}
}
return response;
}
}

Notiek ielāde…
Atcelt
Saglabāt