InsZhongmeiController.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. package com.ydtech.modules.ins.controller;
  2. import com.fasterxml.jackson.core.JsonProcessingException;
  3. import com.ydtech.aop.request.MethodLogAnnotation;
  4. import com.ydtech.aop.request.RequestSingleParam;
  5. import com.ydtech.components.ZhongmeiRequestComponents;
  6. import com.ydtech.core.page.HttpResult;
  7. import com.ydtech.exception.SystemException;
  8. import com.ydtech.modules.admin.dao.SysMethodLogDao;
  9. import com.ydtech.modules.esm.model.InsTaskImage;
  10. import com.ydtech.modules.ins.model.InsOrder;
  11. import com.ydtech.modules.ins.model.ya.CarModel_Req;
  12. import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
  13. import com.ydtech.modules.ins.service.InsZhongmeiService;
  14. import com.ydtech.modules.ins.service.YongAnService;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.util.StringUtils;
  19. import org.springframework.web.bind.annotation.*;
  20. import org.springframework.web.client.RestClientException;
  21. import java.io.IOException;
  22. @Api(tags = "中煤财险")
  23. @RestController
  24. @RequestMapping("/insZhongmei")
  25. public class InsZhongmeiController {
  26. @Autowired
  27. private SysMethodLogDao sysMethodLogDao;
  28. @Autowired
  29. private ZhongmeiRequestComponents zhongmeiRequestComponents;
  30. private final InsZhongmeiService insZhongmeiService;
  31. @Autowired
  32. private YongAnService yongAnService;
  33. public InsZhongmeiController(InsZhongmeiService insZhongmeiService) {
  34. this.insZhongmeiService = insZhongmeiService;
  35. }
  36. @PostMapping("/modelQuery")
  37. @ApiOperation("车型查询")
  38. public HttpResult modelQuery(@RequestSingleParam(value = "modelName") String modelName) {
  39. if (StringUtils.isEmpty(modelName)) {
  40. throw new SystemException("车型不能为空");
  41. }
  42. CarModel_Req carModelReq = new CarModel_Req();
  43. carModelReq.setModelName(modelName);
  44. return yongAnService.modelsQuery(carModelReq);
  45. // return insZhongmeiService.modelQuery(modelName);
  46. }
  47. @GetMapping("/vinSearch")
  48. @ApiOperation("vin码查询")
  49. public HttpResult vinSearch(@RequestParam String frameNo) {
  50. return insZhongmeiService.vinSearch(frameNo);
  51. }
  52. // @GetMapping("/hi")
  53. // @ApiOperation("测试一下")
  54. // @MethodLogAnnotation(title = "中煤-报价")
  55. // public HttpResult test(String a,String b) {
  56. // try {
  57. // // 这个方法需要调用500毫秒
  58. // Thread.sleep(500);
  59. // } catch (InterruptedException e) {
  60. // e.printStackTrace();
  61. // }
  62. // return HttpResult.ok();
  63. // }
  64. // @PostMapping("/quote")
  65. // @ApiOperation(value = "报价")
  66. // @MethodLogAnnotation(title = "中煤-报价")
  67. // public HttpResult quote(@RequestBody YaQuoteInfoVo yaQuoteInfoVo) throws JsonProcessingException {
  68. // try {
  69. // return insZhongmeiService.quote(yaQuoteInfoVo);
  70. // } catch (RestClientException e) {
  71. // throw new SystemException("中煤接口调用失败");
  72. // }
  73. // }
  74. // @PostMapping("/audit")
  75. // @ApiOperation(value = "核保")
  76. // @MethodLogAnnotation(title = "中煤-核保")
  77. // public HttpResult audit(@RequestSingleParam(value = "orderno") String orderno) throws IOException {
  78. // try {
  79. // return insZhongmeiService.audit(orderno);
  80. // } catch (RestClientException e) {
  81. // throw new SystemException("中煤接口调用失败");
  82. // }
  83. // }
  84. //
  85. // @PostMapping(value = "/uploadImage")
  86. // @ApiOperation(value = "上传影像")
  87. // public HttpResult UploadImage(@RequestBody InsTaskImage record) {
  88. // return insZhongmeiService.UploadImage(record);
  89. // }
  90. //
  91. // @PostMapping(value = "/submitImage")
  92. // @ApiOperation(value = "提交影像信息")
  93. // public HttpResult submitImage(@RequestSingleParam(value = "orderno") String orderno) throws IOException {
  94. // try {
  95. // return insZhongmeiService.submitImage(orderno);
  96. // } catch (RestClientException e) {
  97. // e.printStackTrace();
  98. // throw new SystemException("提交影像失败");
  99. // }
  100. // }
  101. //
  102. // @PostMapping(value = "/verifyPayment")
  103. // @ApiOperation(value = "验证是否支付")
  104. // public HttpResult VerifyPayment(@RequestSingleParam(value = "orderno") String orderno) throws IOException {
  105. // return insZhongmeiService.VerifyPayment(orderno);
  106. // }
  107. //
  108. // @ApiOperation(value = "电子保单")
  109. // @PostMapping("/getPolicyPrint")
  110. // public HttpResult getPolicyPrint(@RequestSingleParam(value = "orderno") String orderno) throws IOException {
  111. // return insZhongmeiService.getPolicyPrint(orderno);
  112. // }
  113. //
  114. //// @PostMapping("/quoteMq")
  115. //// @ApiOperation(value = "消息队列报价")
  116. //// public HttpResult quoteMq(@RequestBody YaQuoteInfoVo yaQuoteInfoVo) {
  117. //// return insZhongmeiService.quoteMq(yaQuoteInfoVo);
  118. //// }
  119. //
  120. // @PostMapping("/getQuoteResult")
  121. // @ApiOperation(value = "获取报价结果")
  122. // public HttpResult getQuoteResult(@RequestSingleParam(value = "orderno") String orderNo) {
  123. // if(StringUtils.isEmpty(orderNo)){
  124. // throw new SystemException("订单号不能为空");
  125. // }
  126. // return insZhongmeiService.getQuoteResult(orderNo);
  127. // }
  128. }