|
|
@@ -690,7 +690,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
|
|
|
//获取车辆信息
|
|
|
InsOrdersCarInfo insOrdersCarInfo = insOrdersCarInfoService.getById(insOrders.getCarInfoId());
|
|
|
- insOrdersEditingVo.setCarinfo(insOrdersCarInfo);
|
|
|
+// insOrdersEditingVo.setCarinfo(insOrdersCarInfo);
|
|
|
//获取车主信息
|
|
|
InsOrdersCarUserInfo ownerInfo = new InsOrdersCarUserInfo();
|
|
|
InsOrdersCarUserInfo applyInfo = new InsOrdersCarUserInfo();
|
|
|
@@ -798,78 +798,70 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
@Transactional
|
|
|
public void updateInsOrders(InsOrdersBo insOrdersBo) {
|
|
|
InsOrders insOrders = new InsOrders(insOrdersBo);
|
|
|
- //先查找车主信息
|
|
|
+ //先查找车辆信息
|
|
|
CarInfoVo carinfo = insOrdersBo.getCarinfo();
|
|
|
- //是否存在车主信息
|
|
|
InsOrdersCarInfo insOrdersCarInfo = insOrdersCarInfoService.getCarInfoByFrameNo(carinfo.getFrameNo());
|
|
|
if(Objects.isNull(insOrdersCarInfo)){
|
|
|
- BeanUtils.copyProperties(carinfo, insOrdersCarInfo);
|
|
|
- insOrders.setCarInfoId(IdGenerate.nextId());
|
|
|
- insOrdersCarInfoService.save(insOrdersCarInfo);
|
|
|
+ InsOrdersCarInfo ordersCarInfo = new InsOrdersCarInfo(carinfo);
|
|
|
+ insOrders.setCarInfoId(ordersCarInfo.getId());
|
|
|
+ insOrdersCarInfoService.save(ordersCarInfo);
|
|
|
}else{
|
|
|
- insOrders.setCarInfoId(insOrdersCarInfo.getId());
|
|
|
- insOrdersCarInfoService.updateById(insOrdersCarInfo);
|
|
|
+ //判断是否修改数据
|
|
|
+ if(!insOrdersCarInfo.compare(carinfo)){
|
|
|
+ insOrdersCarInfo.copyProperties(carinfo);
|
|
|
+ insOrdersCarInfoService.updateById(insOrdersCarInfo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//更新车主信息
|
|
|
- CustomerInfoVo ownerinfo = insOrdersBo.getOwnerinfo();
|
|
|
- InsOrdersCarUserInfo ownerUserInfo = insOrdersCarUserInfoService.getCarUserInfoByIdCard(ownerinfo.getIdentifyNumber());
|
|
|
+ CustomerInfoVo ownerInfo = insOrdersBo.getOwnerinfo();
|
|
|
+ InsOrdersCarUserInfo ownerUserInfo = insOrdersCarUserInfoService.getCarUserInfoByIdCard(ownerInfo.getIdentifyNumber());
|
|
|
//如果车主信息不存在 添加一条
|
|
|
if(Objects.isNull(ownerUserInfo)) {
|
|
|
- BeanUtils.copyProperties(ownerinfo, ownerUserInfo);
|
|
|
- ownerUserInfo.setId(IdGenerate.nextId());
|
|
|
- insOrders.setOwnerId(ownerUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.save(ownerUserInfo);
|
|
|
+ InsOrdersCarUserInfo ordersCarUserInfo = new InsOrdersCarUserInfo(ownerInfo);
|
|
|
+ insOrders.setOwnerId(ordersCarUserInfo.getId());
|
|
|
+ insOrdersCarUserInfoService.save(ordersCarUserInfo);
|
|
|
}else{
|
|
|
- insOrders.setOwnerId(ownerUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.updateById(ownerUserInfo);
|
|
|
- }
|
|
|
-
|
|
|
- //投保人信息和车主是否一致
|
|
|
- CustomerInfoVo applyinfo = insOrdersBo.getApplyinfo();
|
|
|
- InsOrdersCarUserInfo applyUserInfo;
|
|
|
- if(!applyinfo.isOwner()){
|
|
|
- //查询投保人信息
|
|
|
- applyUserInfo = insOrdersCarUserInfoService.getCarUserInfoByIdCard(applyinfo.getIdentifyNumber());
|
|
|
- //投保人信息是否存在
|
|
|
- if(Objects.isNull(applyUserInfo)){
|
|
|
- BeanUtils.copyProperties(applyinfo, applyUserInfo);
|
|
|
- applyUserInfo.setId(IdGenerate.nextId());
|
|
|
- insOrders.setApplyId(applyUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.save(applyUserInfo);
|
|
|
- }else{
|
|
|
- insOrders.setApplyId(applyUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.updateById(applyUserInfo);
|
|
|
+ //是否更新数据
|
|
|
+ if(!ownerUserInfo.compare(ownerInfo)){
|
|
|
+ ownerUserInfo.copyProperties(ownerInfo);
|
|
|
+ insOrdersCarUserInfoService.updateById(ownerUserInfo);
|
|
|
}
|
|
|
- }else{
|
|
|
- insOrders.setApplyId(ownerUserInfo.getId());
|
|
|
- applyUserInfo = ownerUserInfo;
|
|
|
}
|
|
|
|
|
|
- //更新被保人信息
|
|
|
+
|
|
|
+ CustomerInfoVo applyInfo = insOrdersBo.getApplyinfo();
|
|
|
CustomerInfoVo insureInfo = insOrdersBo.getInsureinfo();
|
|
|
- if(insureInfo.isOwner() || insureInfo.isInsuranceHolder()){
|
|
|
- if(insureInfo.isOwner()){
|
|
|
- insOrders.setInsureId(ownerUserInfo.getId());
|
|
|
- }
|
|
|
- if(insureInfo.isInsuranceHolder()){
|
|
|
- insOrders.setInsureId(applyUserInfo.getId());
|
|
|
- }
|
|
|
- }else{
|
|
|
- //查询被保人信息
|
|
|
- InsOrdersCarUserInfo insureUserInfo = insOrdersCarUserInfoService.getCarUserInfoByIdCard(insureInfo.getIdentifyNumber());
|
|
|
- //被保人信息是否存在
|
|
|
- if(Objects.isNull(insureUserInfo)){
|
|
|
- BeanUtils.copyProperties(insureInfo, insureUserInfo);
|
|
|
- insureUserInfo.setId(IdGenerate.nextId());
|
|
|
- insOrders.setInsureId(insureUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.save(insureUserInfo);
|
|
|
- }else{
|
|
|
- insOrders.setInsureId(insureUserInfo.getId());
|
|
|
- insOrdersCarUserInfoService.updateById(insureUserInfo);
|
|
|
- }
|
|
|
+ //投保人 和 被保人 是否和车主一致
|
|
|
+ if(applyInfo.isOwner() && insureInfo.isOwner()){
|
|
|
+ insOrders.setApplyId(ownerUserInfo.getId());
|
|
|
+ insOrders.setInsureId(ownerUserInfo.getId());
|
|
|
}
|
|
|
|
|
|
+// //更新被保人信息
|
|
|
+// CustomerInfoVo insureInfo = insOrdersBo.getInsureinfo();
|
|
|
+// if(insureInfo.isOwner() || insureInfo.isInsuranceHolder()){
|
|
|
+// if(insureInfo.isOwner()){
|
|
|
+// insOrders.setInsureId(ownerUserInfo.getId());
|
|
|
+// }
|
|
|
+// if(insureInfo.isInsuranceHolder()){
|
|
|
+// insOrders.setInsureId(applyUserInfo.getId());
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// //查询被保人信息
|
|
|
+// InsOrdersCarUserInfo insureUserInfo = insOrdersCarUserInfoService.getCarUserInfoByIdCard(insureInfo.getIdentifyNumber());
|
|
|
+// //被保人信息是否存在
|
|
|
+// if(Objects.isNull(insureUserInfo)){
|
|
|
+// BeanUtils.copyProperties(insureInfo, insureUserInfo);
|
|
|
+// insureUserInfo.setId(IdGenerate.nextId());
|
|
|
+// insOrders.setInsureId(insureUserInfo.getId());
|
|
|
+// insOrdersCarUserInfoService.save(insureUserInfo);
|
|
|
+// }else{
|
|
|
+// insOrders.setInsureId(insureUserInfo.getId());
|
|
|
+// insOrdersCarUserInfoService.updateById(insureUserInfo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
//更新risk
|
|
|
List<RiskInfoVo> riskInfoVos = insOrdersBo.getRisk();
|
|
|
List<InsOrdersRisk> insOrdersRisks = new ArrayList<>();
|
|
|
@@ -929,6 +921,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean compareAndUpdateLink(QuoteInfoVo quoteInfoVo) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@Override
|