|
@@ -46,8 +46,8 @@ import java.util.concurrent.TimeUnit;
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class WycChannelServiceImpl implements WycChannelService {
|
|
|
- @Autowired
|
|
|
- private ObjectMapper objectMapper;
|
|
|
+ @Autowired
|
|
|
+ private ObjectMapper objectMapper;
|
|
|
@Autowired
|
|
|
SupplierProperties supplierProperties;
|
|
|
@Autowired
|
|
@@ -68,7 +68,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
|
|
|
@Override
|
|
|
public ChannelTypeHandleResponseObject WycInfoRequest(HttpServletRequest request,
|
|
|
- String channelId, Integer outTime, String customBody) {
|
|
|
+ String channelId, Integer outTime, String customBody) {
|
|
|
int money = Integer.parseInt(request.getHeader(Constant.ROUTE_PRICE));
|
|
|
int secondMoney = Integer.parseInt(request.getHeader(Constant.ROUTE_SECOND_PRICE));
|
|
|
|
|
@@ -85,18 +85,18 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
log.info("WycInfoRequest---customBody={},outTime={}",customBody,outTime);
|
|
|
WycInfoRequestObject wycInfoRequestObject = objectMapper.readValue(customBody,
|
|
|
WycInfoRequestObject.class);
|
|
|
- if (StringUtils.isBlank(wycInfoRequestObject.getName()) ||
|
|
|
+ if (StringUtils.isBlank(wycInfoRequestObject.getName()) ||
|
|
|
!PatternTools.checkResult(Constant.PATTERN_CN_NAME_REGEX, wycInfoRequestObject.getName())) {
|
|
|
- ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
|
|
|
- ret.setResultBody(Constant.INVALID_PARAMETER);
|
|
|
- ret.setResultDesc(Constant.INVALID_PARAMETER);
|
|
|
- return ret;
|
|
|
+ ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
|
|
|
+ ret.setResultBody(Constant.INVALID_PARAMETER);
|
|
|
+ ret.setResultDesc(Constant.INVALID_PARAMETER);
|
|
|
+ return ret;
|
|
|
} else if (StringUtils.isBlank(wycInfoRequestObject.getIdCode())
|
|
|
|| !PatternTools.checkResult(Constant.PATTERN_ID_NUMBER_REGEX, wycInfoRequestObject.getIdCode())) {
|
|
|
- ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
|
|
|
- ret.setResultBody(Constant.INVALID_PARAMETER);
|
|
|
- ret.setResultDesc(Constant.INVALID_PARAMETER);
|
|
|
- return ret;
|
|
|
+ ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
|
|
|
+ ret.setResultBody(Constant.INVALID_PARAMETER);
|
|
|
+ ret.setResultDesc(Constant.INVALID_PARAMETER);
|
|
|
+ return ret;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -106,23 +106,23 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
// 创建一个请求 Builder
|
|
|
Request.Builder builder = new Request.Builder();
|
|
|
Request okRequest = new Request.Builder()
|
|
|
- .get()
|
|
|
- .url(supplierProperties.getUrl())
|
|
|
- .build();
|
|
|
+ .get()
|
|
|
+ .url(supplierProperties.getUrl())
|
|
|
+ .build();
|
|
|
HttpUrl.Builder urlBuilder = okRequest.url().newBuilder();
|
|
|
urlBuilder.addQueryParameter("company_id",supplierProperties.getCompany_id());
|
|
|
urlBuilder.addQueryParameter("dri_name",wycInfoRequestObject.getName());
|
|
|
urlBuilder.addQueryParameter("idcard",wycInfoRequestObject.getIdCode());
|
|
|
builder.url(urlBuilder.build());
|
|
|
|
|
|
- OkHttpClient client = okHttpClient.newBuilder()
|
|
|
- .connectTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
- .readTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
- .writeTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
+ OkHttpClient client = okHttpClient.newBuilder()
|
|
|
+ .connectTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
+ .readTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
+ .writeTimeout(outTime, TimeUnit.MILLISECONDS)
|
|
|
|
|
|
- .build();
|
|
|
- Response response = client.newCall(builder.build()).execute();
|
|
|
- String responseContext = response.body().string();
|
|
|
+ .build();
|
|
|
+ Response response = client.newCall(builder.build()).execute();
|
|
|
+ String responseContext = response.body().string();
|
|
|
//
|
|
|
log.info("supplier10000036.WycInfoRequest接口responseContext={}",responseContext);
|
|
|
|
|
@@ -163,8 +163,8 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
String resultBody = objectMapper.writeValueAsString(mapResult);
|
|
|
resultBody = resultBody.replace("'","");
|
|
|
ret.setResultBody(resultBody);
|
|
|
- ret.setJfFree(money);
|
|
|
- ret.setJflx(3);
|
|
|
+ ret.setJfFree(money);
|
|
|
+ ret.setJflx(3);
|
|
|
ret.setResultDesc("查询成功,查有结果");
|
|
|
}else{//其他
|
|
|
ret.setResultCode(Constant.OTHER_ERROR_CODE);
|
|
@@ -446,7 +446,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
}
|
|
|
}
|
|
|
} catch(IOException e){
|
|
|
- log.error("exception:{}", e);
|
|
|
+ log.error("exception:{}", e);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -530,7 +530,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
}
|
|
|
|
|
|
private boolean validateEncryptRequestParams(ChannelTypeHandleResponseObject ret, String returnType,
|
|
|
- String customBody) {
|
|
|
+ String customBody) {
|
|
|
JSONObject requestParamObject = JSONObject.parseObject(customBody);
|
|
|
if (requestParamObject.get("params") == null) {
|
|
|
if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
|
|
@@ -922,7 +922,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
|
|
|
@Override
|
|
|
public ChannelTypeHandleResponseObject WycInfoDecodeRequestV2(HttpServletRequest request, String channelId,
|
|
|
- Integer outTime, String customBody, String encryptType) {
|
|
|
+ Integer outTime, String customBody, String encryptType) {
|
|
|
int money = Integer.parseInt(request.getHeader(Constant.ROUTE_PRICE));
|
|
|
int secondMoney = Integer.parseInt(request.getHeader(Constant.ROUTE_SECOND_PRICE));
|
|
|
|
|
@@ -1105,7 +1105,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
return false;
|
|
|
} else if (encryptType.equals("MD5")
|
|
|
&& (wycInfoRequestObject.getIdCode().length() != 32
|
|
|
- || wycInfoRequestObject.getName().length() !=32)) {
|
|
|
+ || wycInfoRequestObject.getName().length() !=32)) {
|
|
|
ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
|
|
|
ret.setResultBody(Constant.INVALID_PARAMETER);
|
|
|
ret.setResultDesc(Constant.INVALID_PARAMETER);
|
|
@@ -1168,7 +1168,7 @@ public class WycChannelServiceImpl implements WycChannelService {
|
|
|
}
|
|
|
|
|
|
private boolean validateVehicleInfoRequestParams(ChannelTypeHandleResponseObject ret, String returnType,
|
|
|
- VehicleInfoQueryV2RequestObject jsonResolveObject) {
|
|
|
+ VehicleInfoQueryV2RequestObject jsonResolveObject) {
|
|
|
if (StringUtils.isBlank(jsonResolveObject.getVin())
|
|
|
|| StringUtils.isBlank(jsonResolveObject.getBusinessType())
|
|
|
|| StringUtils.isBlank(jsonResolveObject.getCompanyName())) {
|