feat(可回溯): 重构

增加feign实现
This commit is contained in:
BrandWang
2023-05-09 11:17:23 +08:00
parent 875a14f2b7
commit 1b1f2392d7
4 changed files with 48 additions and 4 deletions
@@ -0,0 +1,37 @@
package com.wabestway.recall.feign;
import com.alibaba.fastjson.JSON;
import com.wabestway.commons.http.ResObj;
import com.wabestway.recall.api.dto.TraceUpDTO;
import com.wabestway.recall.api.feign.TraceFeignClient;
import com.wabestway.recall.trace.entity.RecallOrderEntity;
import com.wabestway.recall.trace.service.RecallOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
public class TraceFeignClientImpl implements TraceFeignClient {
@Autowired
private RecallOrderService recallOrderService;
@Override
public ResObj batchTraceUp(TraceUpDTO traceUpDTO) {
log.info("同步请求数据:{}", JSON.toJSONString(traceUpDTO));
traceUpDTO.getRecords().forEach(order -> {
RecallOrderEntity recallOrderEntity = recallOrderService.queryRecallOrderByOrderId(order.getOrderId());
if (recallOrderEntity != null) {
recallOrderEntity.setPolicyNo(order.getPolicyNo());
recallOrderEntity.setHolderName(order.getHolderName());
recallOrderEntity.setHolderPhone(order.getHolderPhone());
recallOrderEntity.setStartDate(order.getStartDate());
recallOrderEntity.setEndDate(order.getEndDate());
recallOrderEntity.setSupplierName(order.getSupplierName());
recallOrderEntity.setUpdateTime(System.currentTimeMillis());
recallOrderService.updateRecallOrderById(recallOrderEntity);
}
});
return ResObj.ok();
}
}
@@ -1,7 +1,6 @@
package com.wabestway.recall.trace.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;