|
|
@@ -132,6 +132,8 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
|
|
|
TradeOrderRespVO orderInfo = tradeOrderMapper.getOrderInfo(orderId);
|
|
|
VoyageDO voyage = voyageService.getVoyage(orderInfo.getVoyageId());
|
|
|
+ InsuranceDO insuranceDO = new InsuranceDO();
|
|
|
+ Long id = IdWorker.getId(insuranceDO);
|
|
|
|
|
|
InsuranceApplyReqDTO insuranceApplyReqDTO = new InsuranceApplyReqDTO();
|
|
|
insuranceApplyReqDTO.setService("applyTeam");
|
|
|
@@ -142,8 +144,8 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
InsuranceOrderInfoDTO insuranceOrderInfoDTO = new InsuranceOrderInfoDTO();
|
|
|
|
|
|
//投保人信息
|
|
|
- insuranceOrderInfoDTO.setExternalOrderNo(orderInfo.getOrderNo());
|
|
|
- insuranceOrderInfoDTO.setExternalPolicyNumber(orderInfo.getId().toString());
|
|
|
+ insuranceOrderInfoDTO.setExternalOrderNo(id.toString());
|
|
|
+ insuranceOrderInfoDTO.setExternalPolicyNumber(id.toString());
|
|
|
insuranceOrderInfoDTO.setTeamCode(orderInfo.getGroupNo());
|
|
|
//TODO: 当前写死
|
|
|
insuranceOrderInfoDTO.setProductNo("RBLY_JH1");
|
|
|
@@ -191,21 +193,20 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
throw exception0(commonResult.getCode(), commonResult.getMsg());
|
|
|
}
|
|
|
//保存投保信息
|
|
|
- InsuranceDO insuranceDO = new InsuranceDO();
|
|
|
+ insuranceMapper.deleteByOrderId(orderId);
|
|
|
+
|
|
|
insuranceDO.setOrderId(orderId);
|
|
|
insuranceDO.setInsuranceStatus(InsuranceStatusEnum.INSURE.getValue());
|
|
|
insuranceDO.setInsuredNum(insuredList.size());
|
|
|
insuranceDO.setInsuranceNo(orderInfo.getOrderNo());
|
|
|
- insuranceDO.setInsuranceNo(orderInfo.getOrderNo());
|
|
|
insuranceDO.setTenantId(voyage.getTenantId());
|
|
|
insuranceDO.setRationType(insuranceOrderInfoDTO.getProductNo());
|
|
|
insuranceDO.setResMsg(String.valueOf(commonResult.getCheckedData()));
|
|
|
- insuranceDO.setInsuranceEffectDate(LocalDateTime.parse(DateUtil.format(voyage.getBoardingTime(), "yyyy-MM-dd")));
|
|
|
- Long id = IdWorker.getId(insuranceDO);
|
|
|
+ insuranceDO.setInsuranceEffectDate(voyage.getBoardingTime());
|
|
|
insuranceDO.setId(id);
|
|
|
insuranceMapper.insert(insuranceDO);
|
|
|
// 发送查询投保接口通知
|
|
|
- tradePublishUtils.publishInsuranceQueryMsg(orderInfo.getOrderNo());
|
|
|
+ tradePublishUtils.publishInsuranceQueryMsg(id.toString());
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -270,14 +271,14 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
//订单对象, 一个订单下可以有一批被保险人
|
|
|
InsuranceOrderInfoCancelDTO insuranceOrderInfoDTO = new InsuranceOrderInfoCancelDTO();
|
|
|
|
|
|
- insuranceOrderInfoDTO.setExternalOrderNo(orderInfo.getOrderNo());
|
|
|
+ insuranceOrderInfoDTO.setExternalOrderNo(id.toString());
|
|
|
insuranceOrderInfoDTO.setBeginDate(DateUtil.format(voyage.getBoardingTime(), "yyyy-MM-dd"));
|
|
|
insuranceOrderInfoDTO.setEndDate(DateUtil.format(voyage.getLeaveTime(), "yyyy-MM-dd"));
|
|
|
insuranceCancelReqDTO.setOrder(insuranceOrderInfoDTO);
|
|
|
|
|
|
List<InsuredCancelDTO> insuredList = new ArrayList<>();
|
|
|
InsuredCancelDTO insuredDTO = new InsuredCancelDTO();
|
|
|
- insuredDTO.setExternalPolicyNumber(orderInfo.getId().toString());
|
|
|
+ insuredDTO.setExternalPolicyNumber(id.toString());
|
|
|
insuredDTO.setPolicyNo(insuranceDO.getPolicyNo());
|
|
|
insuredList.add(insuredDTO);
|
|
|
insuranceCancelReqDTO.setInsureds(insuredList);
|
|
|
@@ -309,8 +310,8 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void handleInsuranceQuery(BigDecimal amount, String policyNo, Long orderId, String status) {
|
|
|
- InsuranceDO insuranceDO = insuranceMapper.selectByOrderId(orderId);
|
|
|
+ public void handleInsuranceQuery(BigDecimal amount, String policyNo, Long id, String status) {
|
|
|
+ InsuranceDO insuranceDO = insuranceMapper.selectById(id);
|
|
|
insuranceDO.setPremium(amount);
|
|
|
insuranceDO.setPolicyNo(policyNo);
|
|
|
Integer insuranceStatus = InsuranceStatusEnum.INSURE.getValue();
|