Ver Fonte

1.紫金财险修改

wks há 3 anos atrás
pai
commit
0c3e9a84fc

+ 0 - 32
src/main/java/com/ydtech/modules/ins/controller/InsPinganController.java

@@ -1,32 +0,0 @@
-package com.ydtech.modules.ins.controller;
-
-import com.ydtech.core.page.HttpResult;
-import com.ydtech.exception.SystemException;
-import com.ydtech.modules.ins.service.InsPinganService;
-import io.swagger.annotations.Api;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@Api(tags = "平安财险")
-@RestController
-@RequestMapping("/ins/pingan")
-public class InsPinganController {
-
-    private final InsPinganService insPinganService;
-
-    public InsPinganController(InsPinganService insPinganService) {
-        this.insPinganService = insPinganService;
-    }
-
-    @GetMapping("/searchVin")
-    public HttpResult vinSearch(@RequestParam String frameNo) {
-        if (org.springframework.util.StringUtils.isEmpty(frameNo)) {
-            throw new SystemException("车架号不能为空");
-        }
-        return insPinganService.vinSearch(frameNo);
-    }
-
-}

+ 0 - 9
src/main/java/com/ydtech/modules/ins/service/InsPinganService.java

@@ -1,9 +0,0 @@
-package com.ydtech.modules.ins.service;
-
-
-import com.ydtech.core.page.HttpResult;
-
-public interface InsPinganService {
-
-    HttpResult vinSearch(String vin);
-}

+ 0 - 52
src/main/java/com/ydtech/modules/ins/service/impl/InsPinganServiceImpl.java

@@ -1,52 +0,0 @@
-package com.ydtech.modules.ins.service.impl;
-
-import com.ydtech.core.page.HttpResult;
-import com.ydtech.exception.SystemException;
-import com.ydtech.modules.ins.convert.PinganCarInfoConvert;
-import com.ydtech.modules.ins.model.request.PinganCarInfo;
-import com.ydtech.modules.ins.model.request.PinganVinSearchBody;
-import com.ydtech.modules.ins.model.request.RenbaoCarSearchResponse;
-import com.ydtech.modules.ins.model.ya.CarModelDTO;
-import com.ydtech.modules.ins.service.InsPinganService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class InsPinganServiceImpl implements InsPinganService {
-
-    @Value("${pa.vin.search.url}")
-    private String paVinSearchUrl;
-
-    private final RestTemplate restTemplate;
-
-    public InsPinganServiceImpl(RestTemplate restTemplate) {
-        this.restTemplate = restTemplate;
-    }
-
-    @Override
-    public HttpResult vinSearch(String vin) {
-        HttpHeaders httpHeaders = new HttpHeaders();
-        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
-        Map<String, Object> map = new HashMap<>();
-        map.put("vin", vin);
-        HttpEntity<Map<String, Object>> mapHttpEntity = new HttpEntity<>(map, httpHeaders);
-        ResponseEntity<PinganVinSearchBody> entity = restTemplate.postForEntity(paVinSearchUrl, mapHttpEntity, PinganVinSearchBody.class);
-        PinganVinSearchBody body = entity.getBody();
-        if (body == null) {
-            throw new SystemException("平安接口请求失败");
-        }
-        List<PinganCarInfo> encodeDict = body.getEncodeDict();
-        List<CarModelDTO> carModelDTOList = PinganCarInfoConvert.INSTANCE.map(encodeDict);
-        return HttpResult.ok(carModelDTOList);
-    }
-}

+ 7 - 1
src/main/java/com/ydtech/modules/order/entity/api/zj/constants/enums/ResultEnum.java

@@ -5,6 +5,9 @@ import com.ydtech.exception.SystemException;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * @description: 接口返回代码
  * @author: wenks
@@ -24,8 +27,11 @@ public enum ResultEnum {
 
     private final String desc;
 
+
     public static void verify(String rtnCode, String rtnMsg) {
-        if (R_9999.getCode().equals(rtnCode) || R_999.getCode().equals(rtnCode)) {
+        String[] s = new String[]{"0000", "4001", "9980"};
+        List<String> list = Arrays.asList(s);
+        if (!list.contains(rtnCode)) {
             throw new SystemException(rtnMsg);
         }
     }

+ 0 - 4
src/main/resources/application-prod.yml

@@ -77,10 +77,6 @@ mybatis-plus:
 netUrl: http://baoxianzhanggui.com:8080/
 
 
-pa:
-  vin:
-    search:
-      url: http://172.24.144.213:8888/pingan/vinSearch
 pagehelper:
   helper-dialect: mysql
   params: count=countSql

+ 0 - 6
src/main/resources/application-test.yml

@@ -92,12 +92,6 @@ mybatis-plus:
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 ##测试地址
 netUrl: http://47.92.254.66:8080/
-##平安
-pa:
-  vin:
-    search:
-      #平安vin码查询
-      url: http://47.92.254.66:8888/pingan/vinSearch
 
 #================ mybatis pagehelper ==============#
 pagehelper: