|
|
@@ -1,99 +1,99 @@
|
|
|
-//package com.ydtech.modules.ins.service.impl;
|
|
|
-//
|
|
|
-//import com.alibaba.fastjson.JSON;
|
|
|
-//import com.alibaba.fastjson.JSONObject;
|
|
|
-//import com.alibaba.fastjson.TypeReference;
|
|
|
-//import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
-//import com.ydtech.components.InsTaskHistoryComponents;
|
|
|
-//import com.ydtech.components.OrderComponents;
|
|
|
-//import com.ydtech.components.ZhongmeiRequestComponents;
|
|
|
-//import com.ydtech.components.queue.ZmQuoteConsumer;
|
|
|
-////import com.ydtech.components.queue.ZmQuoteProducer;
|
|
|
-//import com.ydtech.constants.InsTaskHistoryEnum;
|
|
|
-//import com.ydtech.constants.RedisConstant;
|
|
|
-//import com.ydtech.core.page.HttpResult;
|
|
|
-//import com.ydtech.exception.SystemException;
|
|
|
-//import com.ydtech.modules.esm.model.InsTaskImage;
|
|
|
-//import com.ydtech.modules.esm.service.InsTaskImageService;
|
|
|
-//import com.ydtech.modules.ins.convert.QuoteInfoConvert;
|
|
|
-//import com.ydtech.modules.ins.convert.ZhongmeiCarModelConvert;
|
|
|
-//import com.ydtech.modules.ins.model.InsOrder;
|
|
|
-//import com.ydtech.modules.ins.model.InsTaskHistory;
|
|
|
-//import com.ydtech.modules.ins.model.request.QuoteInfo;
|
|
|
-//import com.ydtech.modules.ins.model.request.Response;
|
|
|
-//import com.ydtech.modules.ins.model.request.ZhongmeiQuoteResponse;
|
|
|
-//import com.ydtech.modules.ins.model.ya.CarModelDTO;
|
|
|
-//import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
|
-//import com.ydtech.modules.ins.model.zm.ZmCarModel;
|
|
|
-//import com.ydtech.modules.ins.service.InsOrderService;
|
|
|
-//import com.ydtech.modules.ins.service.InsTaskHistoryService;
|
|
|
-//import com.ydtech.modules.ins.service.InsZhongmeiService;
|
|
|
-//import com.ydtech.modules.ins.vo.*;
|
|
|
-//import com.ydtech.modules.ins.vo.req.InsZmUploadImageVo;
|
|
|
-//import com.ydtech.modules.ins.vo.res.ZmVerifyPaymentVo;
|
|
|
-//import com.ydtech.utils.idgen.IdGenerate;
|
|
|
-//import lombok.extern.slf4j.Slf4j;
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-//import org.springframework.core.ParameterizedTypeReference;
|
|
|
-//import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
-//import org.springframework.stereotype.Service;
|
|
|
-//import org.springframework.util.StringUtils;
|
|
|
-//
|
|
|
-//import java.io.IOException;
|
|
|
-//import java.text.SimpleDateFormat;
|
|
|
-//import java.util.*;
|
|
|
-//
|
|
|
-//
|
|
|
-//@Slf4j
|
|
|
-//@Service
|
|
|
-//public class InsZhongmeiServiceImpl implements InsZhongmeiService {
|
|
|
-//
|
|
|
-// private final OrderComponents orderComponents;
|
|
|
-//
|
|
|
-// private final InsOrderService insOrderService;
|
|
|
-//
|
|
|
-// private final InsTaskHistoryService insTaskHistoryService;
|
|
|
-//
|
|
|
-// private final StringRedisTemplate redisTemplate;
|
|
|
-//
|
|
|
-// private final InsTaskImageService insTaskImageService;
|
|
|
-//
|
|
|
-// private final ZhongmeiRequestComponents zhongmeiRequestComponents;
|
|
|
-//
|
|
|
-// private final InsTaskHistoryComponents insTaskHistoryComponents;
|
|
|
-//
|
|
|
-// private final ZmQuoteConsumer zmQuoteConsumer;
|
|
|
-//
|
|
|
-//// @Autowired
|
|
|
-//// private ZmQuoteProducer zmMessageQueue;
|
|
|
-//
|
|
|
-// public InsZhongmeiServiceImpl(InsTaskImageService insTaskImageService, OrderComponents orderComponents, InsOrderService insOrderService, InsTaskHistoryService insTaskHistoryService, StringRedisTemplate redisTemplate, ZhongmeiRequestComponents zhongmeiRequestComponents, InsTaskHistoryComponents insTaskHistoryComponents, ZmQuoteConsumer zmQuoteConsumer) {
|
|
|
-// this.insTaskImageService = insTaskImageService;
|
|
|
-// this.orderComponents = orderComponents;
|
|
|
-// this.insOrderService = insOrderService;
|
|
|
-// this.insTaskHistoryService = insTaskHistoryService;
|
|
|
-// this.redisTemplate = redisTemplate;
|
|
|
-// this.zhongmeiRequestComponents = zhongmeiRequestComponents;
|
|
|
-// this.insTaskHistoryComponents = insTaskHistoryComponents;
|
|
|
-// this.zmQuoteConsumer = zmQuoteConsumer;
|
|
|
+package com.ydtech.modules.ins.service.impl;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.ydtech.components.InsTaskHistoryComponents;
|
|
|
+import com.ydtech.components.OrderComponents;
|
|
|
+import com.ydtech.components.ZhongmeiRequestComponents;
|
|
|
+import com.ydtech.components.queue.ZmQuoteConsumer;
|
|
|
+//import com.ydtech.components.queue.ZmQuoteProducer;
|
|
|
+import com.ydtech.constants.InsTaskHistoryEnum;
|
|
|
+import com.ydtech.constants.RedisConstant;
|
|
|
+import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
+import com.ydtech.modules.esm.model.InsTaskImage;
|
|
|
+import com.ydtech.modules.esm.service.InsTaskImageService;
|
|
|
+import com.ydtech.modules.ins.convert.QuoteInfoConvert;
|
|
|
+import com.ydtech.modules.ins.convert.ZhongmeiCarModelConvert;
|
|
|
+import com.ydtech.modules.ins.model.InsOrder;
|
|
|
+import com.ydtech.modules.ins.model.InsTaskHistory;
|
|
|
+import com.ydtech.modules.ins.model.request.QuoteInfo;
|
|
|
+import com.ydtech.modules.ins.model.request.Response;
|
|
|
+import com.ydtech.modules.ins.model.request.ZhongmeiQuoteResponse;
|
|
|
+import com.ydtech.modules.ins.model.ya.CarModelDTO;
|
|
|
+import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
|
|
|
+import com.ydtech.modules.ins.model.zm.ZmCarModel;
|
|
|
+import com.ydtech.modules.ins.service.InsOrderService;
|
|
|
+import com.ydtech.modules.ins.service.InsTaskHistoryService;
|
|
|
+import com.ydtech.modules.ins.service.InsZhongmeiService;
|
|
|
+import com.ydtech.modules.ins.vo.*;
|
|
|
+import com.ydtech.modules.ins.vo.req.InsZmUploadImageVo;
|
|
|
+import com.ydtech.modules.ins.vo.res.ZmVerifyPaymentVo;
|
|
|
+import com.ydtech.utils.idgen.IdGenerate;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.ParameterizedTypeReference;
|
|
|
+import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+public class InsZhongmeiServiceImpl implements InsZhongmeiService {
|
|
|
+
|
|
|
+ private final OrderComponents orderComponents;
|
|
|
+
|
|
|
+ private final InsOrderService insOrderService;
|
|
|
+
|
|
|
+ private final InsTaskHistoryService insTaskHistoryService;
|
|
|
+
|
|
|
+ private final StringRedisTemplate redisTemplate;
|
|
|
+
|
|
|
+ private final InsTaskImageService insTaskImageService;
|
|
|
+
|
|
|
+ private final ZhongmeiRequestComponents zhongmeiRequestComponents;
|
|
|
+
|
|
|
+ private final InsTaskHistoryComponents insTaskHistoryComponents;
|
|
|
+
|
|
|
+ private final ZmQuoteConsumer zmQuoteConsumer;
|
|
|
+
|
|
|
+// @Autowired
|
|
|
+// private ZmQuoteProducer zmMessageQueue;
|
|
|
+
|
|
|
+ public InsZhongmeiServiceImpl(InsTaskImageService insTaskImageService, OrderComponents orderComponents, InsOrderService insOrderService, InsTaskHistoryService insTaskHistoryService, StringRedisTemplate redisTemplate, ZhongmeiRequestComponents zhongmeiRequestComponents, InsTaskHistoryComponents insTaskHistoryComponents, ZmQuoteConsumer zmQuoteConsumer) {
|
|
|
+ this.insTaskImageService = insTaskImageService;
|
|
|
+ this.orderComponents = orderComponents;
|
|
|
+ this.insOrderService = insOrderService;
|
|
|
+ this.insTaskHistoryService = insTaskHistoryService;
|
|
|
+ this.redisTemplate = redisTemplate;
|
|
|
+ this.zhongmeiRequestComponents = zhongmeiRequestComponents;
|
|
|
+ this.insTaskHistoryComponents = insTaskHistoryComponents;
|
|
|
+ this.zmQuoteConsumer = zmQuoteConsumer;
|
|
|
+ }
|
|
|
+
|
|
|
+// @Override
|
|
|
+// public HttpResult quoteMq(YaQuoteInfoVo yaQuoteInfoVo) {
|
|
|
+// // 1. 生成订单
|
|
|
+// InsOrder insOrder = orderComponents.geneOrder(yaQuoteInfoVo, "中煤财险", "000019");
|
|
|
+// String orderNo = insOrder.getOrderno();
|
|
|
+// // 2. 将订单信息存入redis
|
|
|
+// String s = JSON.toJSONString(insOrder);
|
|
|
+// redisTemplate.opsForValue().set(RedisConstant.ORDER_NUMBER + orderNo, s);
|
|
|
+// // 3. RabbitMq 发送消息
|
|
|
+// QuoteInfo quoteInfo = QuoteInfoConvert.INSTANCE.convert(yaQuoteInfoVo);
|
|
|
+// quoteInfo.setOrderNo(orderNo);
|
|
|
+// zmMessageQueue.send(quoteInfo);
|
|
|
+// // 4. 将订单号返回
|
|
|
+// return HttpResult.ok("成功", orderNo);
|
|
|
// }
|
|
|
-//
|
|
|
-//// @Override
|
|
|
-//// public HttpResult quoteMq(YaQuoteInfoVo yaQuoteInfoVo) {
|
|
|
-//// // 1. 生成订单
|
|
|
-//// InsOrder insOrder = orderComponents.geneOrder(yaQuoteInfoVo, "中煤财险", "000019");
|
|
|
-//// String orderNo = insOrder.getOrderno();
|
|
|
-//// // 2. 将订单信息存入redis
|
|
|
-//// String s = JSON.toJSONString(insOrder);
|
|
|
-//// redisTemplate.opsForValue().set(RedisConstant.ORDER_NUMBER + orderNo, s);
|
|
|
-//// // 3. RabbitMq 发送消息
|
|
|
-//// QuoteInfo quoteInfo = QuoteInfoConvert.INSTANCE.convert(yaQuoteInfoVo);
|
|
|
-//// quoteInfo.setOrderNo(orderNo);
|
|
|
-//// zmMessageQueue.send(quoteInfo);
|
|
|
-//// // 4. 将订单号返回
|
|
|
-//// return HttpResult.ok("成功", orderNo);
|
|
|
-//// }
|
|
|
-//
|
|
|
+
|
|
|
// @Override
|
|
|
// public HttpResult getQuoteResult(String orderNo) {
|
|
|
// String s = redisTemplate.opsForValue().get(RedisConstant.ORDER_RESULT + orderNo);
|
|
|
@@ -102,31 +102,31 @@
|
|
|
// }
|
|
|
// return HttpResult.error("稍后重试");
|
|
|
// }
|
|
|
-//
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public HttpResult modelQuery(String modelName) {
|
|
|
-//
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("modelName", modelName);
|
|
|
-// Response<List<ZmCarModel>> model = zhongmeiRequestComponents.modelQuery(map, new ParameterizedTypeReference<Response<List<ZmCarModel>>>() {
|
|
|
-// });
|
|
|
-// List<ZmCarModel> data = model.getData();
|
|
|
-// List<CarModelDTO> map1 = ZhongmeiCarModelConvert.INSTANCE.map(data);
|
|
|
-//
|
|
|
-// return HttpResult.ok(map1);
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public HttpResult vinSearch(String vin) {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("vin", vin);
|
|
|
-// Response<List<ZmCarModel>> model = zhongmeiRequestComponents.vinSearch(map, new ParameterizedTypeReference<Response<List<ZmCarModel>>>() {
|
|
|
-// });
|
|
|
-// List<ZmCarModel> data = model.getData();
|
|
|
-// List<CarModelDTO> map1 = ZhongmeiCarModelConvert.INSTANCE.map(data);
|
|
|
-// return HttpResult.ok(map1);
|
|
|
-// }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpResult modelQuery(String modelName) {
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("modelName", modelName);
|
|
|
+ Response<List<ZmCarModel>> model = zhongmeiRequestComponents.modelQuery(map, new ParameterizedTypeReference<Response<List<ZmCarModel>>>() {
|
|
|
+ });
|
|
|
+ List<ZmCarModel> data = model.getData();
|
|
|
+ List<CarModelDTO> map1 = ZhongmeiCarModelConvert.INSTANCE.map(data);
|
|
|
+
|
|
|
+ return HttpResult.ok(map1);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpResult vinSearch(String vin) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("vin", vin);
|
|
|
+ Response<List<ZmCarModel>> model = zhongmeiRequestComponents.vinSearch(map, new ParameterizedTypeReference<Response<List<ZmCarModel>>>() {
|
|
|
+ });
|
|
|
+ List<ZmCarModel> data = model.getData();
|
|
|
+ List<CarModelDTO> map1 = ZhongmeiCarModelConvert.INSTANCE.map(data);
|
|
|
+ return HttpResult.ok(map1);
|
|
|
+ }
|
|
|
//
|
|
|
//
|
|
|
// @Override
|
|
|
@@ -296,6 +296,6 @@
|
|
|
// assert response != null;
|
|
|
// return response.getContractMainNo();
|
|
|
// }
|
|
|
-//
|
|
|
-//
|
|
|
-//}
|
|
|
+
|
|
|
+
|
|
|
+}
|