|
|
@@ -20,6 +20,7 @@ import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
|
|
|
import com.jzg.commons.entity.agreement.dispatch.vo.ValidateDispatchRuleVo;
|
|
|
import com.jzg.commons.entity.costs.vo.ValidateSchemeRuleVo;
|
|
|
import com.jzg.commons.entity.po.*;
|
|
|
+import com.jzg.commons.entity.po.jyxSetting;
|
|
|
import com.jzg.commons.entity.quote.vo.SalespersonInfoVo;
|
|
|
import com.jzg.commons.entity.scheme.po.*;
|
|
|
import com.jzg.commons.entity.scheme.vo.*;
|
|
|
@@ -92,6 +93,9 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
@Autowired
|
|
|
SysUserJzgInfoService sysUserJzgInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ jyxSettingMapper jyxSettingMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 添加方案
|
|
|
* @param ptlSchemeSaveVo 车险报价的方案
|
|
|
@@ -487,10 +491,14 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public SchemeResultVo getSchemeResult(String companyId, String productId) {
|
|
|
+ public SchemeResultVo getSchemeResult(String companyId, String productId,String seatCount) {
|
|
|
log.info("根据保司Id和产品id查询协议信息。 companyId=[{}],productId=[{}]", companyId, productId);
|
|
|
List<SchemeResultVo.SchemeVo> schemeInsuranceInfo = ptlSchemeMapper.getSchemeInsuranceInfo(companyId, productId);
|
|
|
List<SchemeResultVo.SchemeVo> schemeDrivingInfo = ptlSchemeMapper.getSchemeDrivingInfo(companyId, productId);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 创建一个 Map,Key: info.id, Value: List<Driving>
|
|
|
Map<String, List<SchemeResultVo.Driving>> drivingMap = new HashMap<>();
|
|
|
|
|
|
@@ -500,6 +508,26 @@ public class PtlSchemeServiceImpl extends ServiceImpl<PtlSchemeMapper, PtlScheme
|
|
|
drivingMap.put(info.getId(), info.getDrivings());
|
|
|
}
|
|
|
}
|
|
|
+ // 处理驾意险中的座位险逻辑,根据座位数匹配实际保险金额
|
|
|
+ if (StrUtil.isNotBlank(seatCount)) {
|
|
|
+ int seats = Integer.parseInt(seatCount);
|
|
|
+ drivingMap.forEach((infoId, drivings) -> {
|
|
|
+ drivings.forEach(driving -> {
|
|
|
+ jyxSetting setting = jyxSettingMapper.selectOne(
|
|
|
+ new LambdaQueryWrapper<jyxSetting>()
|
|
|
+ .eq(jyxSetting::getJyxConfigId, driving.getId())
|
|
|
+ .eq(jyxSetting::getSeats, seats)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (setting != null) {
|
|
|
+ driving.setProductCode(setting.getProductCode());
|
|
|
+ driving.setPremium(setting.getPremium() != null ? setting.getPremium().toString() : null);
|
|
|
+ driving.setCoverage(setting.getCoverage() != null ? setting.getCoverage().toString() : null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 遍历 schemeInsuranceInfo,把 drivings 合并
|
|
|
for (SchemeResultVo.SchemeVo insuranceScheme : schemeInsuranceInfo) {
|