|
@@ -13,7 +13,6 @@ import com.ydtech.config.DictEnumConfig;
|
|
|
import com.ydtech.constants.InsuranceEnum;
|
|
import com.ydtech.constants.InsuranceEnum;
|
|
|
import com.ydtech.constants.enums.dict.DictionaryData;
|
|
import com.ydtech.constants.enums.dict.DictionaryData;
|
|
|
import com.ydtech.constants.enums.dict.DictionaryManagement;
|
|
import com.ydtech.constants.enums.dict.DictionaryManagement;
|
|
|
-import com.ydtech.constants.enums.dict.FeeAuditAuditstatus;
|
|
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
|
import com.ydtech.constants.enums.dict.insurance.NatureOfVehicleUse;
|
|
import com.ydtech.constants.enums.dict.insurance.NatureOfVehicleUse;
|
|
@@ -51,6 +50,7 @@ import com.ydtech.modules.order.dao.InsOrdersMapper;
|
|
|
import com.ydtech.modules.order.entity.*;
|
|
import com.ydtech.modules.order.entity.*;
|
|
|
import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
|
|
import com.ydtech.modules.order.entity.crawler.response.CrawlerVerifyPaymentResponse;
|
|
|
import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
|
|
import com.ydtech.modules.order.entity.dto.DrivingInsuranceDto;
|
|
|
|
|
+import com.ydtech.modules.order.entity.dto.InquiryDetalsQueryDto;
|
|
|
import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
|
|
import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
|
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
import com.ydtech.modules.order.entity.vo.*;
|
|
|
import com.ydtech.modules.order.entity.vo.guoren.GuoRenQuoteVo;
|
|
import com.ydtech.modules.order.entity.vo.guoren.GuoRenQuoteVo;
|
|
@@ -1153,6 +1153,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
jsonObject.put("planName",accidentObject.getString("projectName"));
|
|
jsonObject.put("planName",accidentObject.getString("projectName"));
|
|
|
jsonObject.put("sumAmount",accidentObject.getString("sumAmount"));
|
|
jsonObject.put("sumAmount",accidentObject.getString("sumAmount"));
|
|
|
jsonObject.put("sumPremium",accidentObject.getString("sumPremium"));
|
|
jsonObject.put("sumPremium",accidentObject.getString("sumPremium"));
|
|
|
|
|
+ taiKangBaseQuoteVo.setAccidentalDrivingVo(jsonObject);
|
|
|
return taiKangBaseQuoteVo;
|
|
return taiKangBaseQuoteVo;
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
@@ -1250,4 +1251,224 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
expirationInsure.setRecords(records);
|
|
expirationInsure.setRecords(records);
|
|
|
return expirationInsure;
|
|
return expirationInsure;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/24 18:14
|
|
|
|
|
+ * @Description: 通过子订单号查询询价详情信息
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public InquiryDetalsVo getInquiryDetalsBySubOrderIds(InquiryDetalsQueryDto inquiryDetalsDto) {
|
|
|
|
|
+ //通过其中一个子订单id查询主订单的id
|
|
|
|
|
+ if(inquiryDetalsDto.getSubOrderNos()==null || inquiryDetalsDto.getSubOrderNos().size()==0){
|
|
|
|
|
+ throw new SystemException("子订单号数组为空不能比价");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(inquiryDetalsDto.getSubOrderNos()!=null && inquiryDetalsDto.getSubOrderNos().size()==1){
|
|
|
|
|
+ throw new SystemException("子订单号数据为一个不能比价");
|
|
|
|
|
+ }
|
|
|
|
|
+ String subOrderNo = inquiryDetalsDto.getSubOrderNos().get(0);
|
|
|
|
|
+ InsAreaCompany insAreaCompany = insAreaCompanyService.getById(subOrderNo);
|
|
|
|
|
+ //主订单信息
|
|
|
|
|
+ InsOrders orders = this.getById(insAreaCompany.getOrderno());
|
|
|
|
|
+ InsOrderVo insOrderVo = getInsOrderVoDetals(orders);
|
|
|
|
|
+ List<List<PriceParityVo>> priceList=new ArrayList<>();
|
|
|
|
|
+ List<PriceParityVo> companyList=new ArrayList<>();
|
|
|
|
|
+ List<String> companyAllList=new ArrayList<>();
|
|
|
|
|
+ companyList.add(new PriceParityVo("公司",false,false));
|
|
|
|
|
+ List<PriceParityVo> jqList=new ArrayList<>();
|
|
|
|
|
+ jqList.add(new PriceParityVo("交强险",false,false));
|
|
|
|
|
+ List<PriceParityVo> syList=new ArrayList<>();
|
|
|
|
|
+ syList.add(new PriceParityVo("商业险",false,false));
|
|
|
|
|
+ List<PriceParityVo> ccList=new ArrayList<>();
|
|
|
|
|
+ ccList.add(new PriceParityVo("车船税",false,false));
|
|
|
|
|
+ List<PriceParityVo> jyList=new ArrayList<>();
|
|
|
|
|
+ jyList.add(new PriceParityVo("驾意险",false,false));
|
|
|
|
|
+ List<PriceParityVo> zbfList=new ArrayList<>();
|
|
|
|
|
+ zbfList.add(new PriceParityVo("总保费",false,false));
|
|
|
|
|
+ List<PriceParityVo> yhjList=new ArrayList<>();
|
|
|
|
|
+ yhjList.add(new PriceParityVo("优惠金额",false,false));
|
|
|
|
|
+ List<PriceParityVo> yhhList=new ArrayList<>();
|
|
|
|
|
+ yhhList.add(new PriceParityVo("优惠后",false,false));
|
|
|
|
|
+ List<String> yhhbjList=new ArrayList<>();
|
|
|
|
|
+ List<SubOrderVo> subOrderVos=new ArrayList<>();
|
|
|
|
|
+ String companyName="";
|
|
|
|
|
+ if(inquiryDetalsDto.getSubOrderNos()!=null && inquiryDetalsDto.getSubOrderNos().size()>0){
|
|
|
|
|
+ for(String subOrderId :inquiryDetalsDto.getSubOrderNos()){
|
|
|
|
|
+ BigDecimal sumyh =BigDecimal.ZERO;
|
|
|
|
|
+ InsAreaCompany insAreaCompanySingle = insAreaCompanyService.getById(subOrderId);
|
|
|
|
|
+ //查询费用信息
|
|
|
|
|
+ InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getOne(new LambdaQueryWrapper<InsFeeOrderNew>()
|
|
|
|
|
+ .eq(InsFeeOrderNew::getInsOrderNo, subOrderNo));
|
|
|
|
|
+ if (!Objects.isNull(insFeeOrderNew)) {
|
|
|
|
|
+ PtlAgreementProductCostsNew ptlAgreementProductCostsNew =
|
|
|
|
|
+ ptlAgreementProductCostsNewService.getById(insFeeOrderNew.getCostsId());
|
|
|
|
|
+ FeeOrderNewVo feeOrderNewVo = feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew, ptlAgreementProductCostsNew);
|
|
|
|
|
+ //优惠信息
|
|
|
|
|
+ if(feeOrderNewVo!=null && feeOrderNewVo.getExportFee()!=null && feeOrderNewVo.getExportFee().size()>0){
|
|
|
|
|
+ sumyh = feeOrderNewVo.getExportFee()
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .map(FeeOrderNewVo.ExportFee::getTotalAmount)
|
|
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ SubOrderVo subOrderVo = new SubOrderVo(insAreaCompanySingle.getInscompany(), insAreaCompanySingle.getJqpremium(), getJQRiskList(insAreaCompanySingle),
|
|
|
|
|
+ insAreaCompanySingle.getSypremium(), insAreaCompanySingle.getKindinfo()==null?new JSONArray():insAreaCompanySingle.getKindinfo(),
|
|
|
|
|
+ insAreaCompanySingle.getTaxamount(), insAreaCompanySingle.getJypremium(), getJYRiskList(insAreaCompanySingle), insAreaCompanySingle.getSumpremium());
|
|
|
|
|
+ //保险公司名称
|
|
|
|
|
+ companyAllList.add(insAreaCompanySingle.getInscompany());
|
|
|
|
|
+ companyList.add(new PriceParityVo(insAreaCompanySingle.getInscompany(),false,false));
|
|
|
|
|
+ jqList.add(new PriceParityVo(insAreaCompanySingle.getJqpremium().toString(),false,false));
|
|
|
|
|
+ syList.add(new PriceParityVo(insAreaCompanySingle.getSypremium().toString(),false,false));
|
|
|
|
|
+ ccList.add(new PriceParityVo(insAreaCompanySingle.getTaxamount().toString(),false,false));
|
|
|
|
|
+ jyList.add(new PriceParityVo(insAreaCompanySingle.getJypremium().toString(),false,false));
|
|
|
|
|
+ zbfList.add(new PriceParityVo(insAreaCompanySingle.getSumpremium().toString(),false,false));
|
|
|
|
|
+ yhjList.add(new PriceParityVo(sumyh.toString(),false,false));
|
|
|
|
|
+ //优惠后金额
|
|
|
|
|
+ BigDecimal sumyhh = insAreaCompanySingle.getSumpremium().subtract(sumyh);
|
|
|
|
|
+ yhhList.add(new PriceParityVo(sumyhh.toString(),false,false));
|
|
|
|
|
+ yhhbjList.add(sumyhh.toString());
|
|
|
|
|
+ subOrderVos.add(subOrderVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ //最优惠公司
|
|
|
|
|
+ int index = getCompanyNameByMinAmount(yhhbjList)+1;
|
|
|
|
|
+ companyName = companyAllList.get(index);
|
|
|
|
|
+ // priceList.add(getZYList(companyList,index,false));
|
|
|
|
|
+ priceList.add(companyList);
|
|
|
|
|
+ priceList.add(getZYList(jqList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(syList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(ccList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(jyList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(zbfList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(yhjList,index,false));
|
|
|
|
|
+ priceList.add(getZYList(yhhList,index,true));
|
|
|
|
|
+ }
|
|
|
|
|
+ return new InquiryDetalsVo(insOrderVo,subOrderVos,priceList,companyName);
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/25 16:31
|
|
|
|
|
+ * @Description: 设置优惠公司数据颜色区分
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<PriceParityVo> getZYList(List<PriceParityVo> companyList, int index, boolean flag) {
|
|
|
|
|
+ List<PriceParityVo> newList=new ArrayList<>();
|
|
|
|
|
+ if(companyList !=null && companyList.size()>0){
|
|
|
|
|
+ for (int i = 1; i < companyList.size(); i++) {
|
|
|
|
|
+ if (i==index) {
|
|
|
|
|
+ PriceParityVo priceParityVo = companyList.get(i);
|
|
|
|
|
+ priceParityVo.setFlag(true);
|
|
|
|
|
+ priceParityVo.setYzhFlag(flag);
|
|
|
|
|
+ newList.add(priceParityVo);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ newList.add(companyList.get(i));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return newList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/25 9:47
|
|
|
|
|
+ * @Description: 获取优惠后最低的公司
|
|
|
|
|
+ */
|
|
|
|
|
+ private static int getCompanyNameByMinAmount(List<String> yhhbjList) {
|
|
|
|
|
+ int minIndex=0;
|
|
|
|
|
+ if(yhhbjList !=null && yhhbjList.size()>0){
|
|
|
|
|
+ String minValue = yhhbjList.get(0);
|
|
|
|
|
+ for (int i = 1; i < yhhbjList.size(); i++) {
|
|
|
|
|
+ if (minValue.compareTo(yhhbjList.get(i)) > 0) {
|
|
|
|
|
+ minIndex = i;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return minIndex;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/25 9:13
|
|
|
|
|
+ * @Description: 获取驾意险信息
|
|
|
|
|
+ */
|
|
|
|
|
+ private JSONArray getJYRiskList(InsAreaCompany insAreaCompanySingle) {
|
|
|
|
|
+ InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving = insAreaCompanyAccidentalDrivingService.getByCompanyId(insAreaCompanySingle.getCompanyId());
|
|
|
|
|
+ if (insAreaCompanyAccidentalDriving != null) {
|
|
|
|
|
+ List<InsDrivingIntentionInsuranceSon> insDrivingIntentionInsuranceSon = insDrivingIntentionInsuranceService.getInsDrivingIntentionInsuranceSon(
|
|
|
|
|
+ insAreaCompanySingle.getCompanyId(),
|
|
|
|
|
+ insAreaCompanyAccidentalDriving.getRideRiskCode());
|
|
|
|
|
+ if(insDrivingIntentionInsuranceSon.size() == 1 && insDrivingIntentionInsuranceSon.get(0).getPremium() == null) {
|
|
|
|
|
+ insDrivingIntentionInsuranceSon.get(0).setPremium(insAreaCompanySingle.getJypremium().toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONArray accidentInfo = JSON.parseArray(JSON.toJSONString(insDrivingIntentionInsuranceSon));
|
|
|
|
|
+ return accidentInfo;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return new JSONArray();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/25 9:06
|
|
|
|
|
+ * @Description: 获取交强险险种列表
|
|
|
|
|
+ */
|
|
|
|
|
+ private static JSONArray getJQRiskList(InsAreaCompany insAreaCompanySingle) {
|
|
|
|
|
+ if(insAreaCompanySingle.getProductid().equals(ProductsType.PT_0330.getCode()) ||
|
|
|
|
|
+ insAreaCompanySingle.getProductid().equals(ProductsType.PT_0330034001.getCode()) ||
|
|
|
|
|
+ insAreaCompanySingle.getProductid().equals(ProductsType.PT_0330034002.getCode())) {
|
|
|
|
|
+ return JqInsuranceType.toJsonArray();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return new JSONArray();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/6/24 18:58
|
|
|
|
|
+ * @Description: 返回详情信息
|
|
|
|
|
+ */
|
|
|
|
|
+ private InsOrderVo getInsOrderVoDetals(InsOrders orders) {
|
|
|
|
|
+ JSONObject carinfo = orders.getCarinfo();
|
|
|
|
|
+ JSONObject ownerinfo = orders.getOwnerinfo();
|
|
|
|
|
+ JSONObject applyinfo = orders.getApplyinfo();
|
|
|
|
|
+ JSONObject insureinfo = orders.getInsureinfo();
|
|
|
|
|
+ InsOrderVo insOrderVo =new InsOrderVo(StringUtils.isEmpty(orders.getOrderno())?"":orders.getOrderno(),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getFrameno())?"":orders.getFrameno(),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getLicenseno())?"":orders.getLicenseno(),
|
|
|
|
|
+ StringUtils.isEmpty(carinfo.getString("brandName"))?"":carinfo.getString("brandName"),
|
|
|
|
|
+ StringUtils.isEmpty(carinfo.getString("engineNo"))?"":carinfo.getString("engineNo"),
|
|
|
|
|
+ StringUtils.isEmpty(carinfo.getString("seatCount"))?"":carinfo.getString("seatCount"),
|
|
|
|
|
+ StringUtils.isEmpty(ownerinfo.getString("name"))?"":ownerinfo.getString("name"),
|
|
|
|
|
+ setNewIdCard(ownerinfo),
|
|
|
|
|
+ StringUtils.isEmpty(applyinfo.getString("name"))?"":applyinfo.getString("name"),
|
|
|
|
|
+ setNewIdCard(applyinfo),
|
|
|
|
|
+ StringUtils.isEmpty(insureinfo.getString("name"))?"":insureinfo.getString("name"),
|
|
|
|
|
+ setNewIdCard(insureinfo),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getJqstartdate())?"":orders.getJqstartdate(),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getJqenddate())?"":orders.getJqenddate(),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getSystartdate())?"":orders.getSystartdate(),
|
|
|
|
|
+ StringUtils.isEmpty(orders.getSyenddate())?"": orders.getSyenddate());
|
|
|
|
|
+ return insOrderVo;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @version
|
|
|
|
|
+ * @author: hxl
|
|
|
|
|
+ * @Date: 2024/5/9 16:18
|
|
|
|
|
+ * @Description: 处理身份证为01返回身份证
|
|
|
|
|
+ */
|
|
|
|
|
+ private static String setNewIdCard(JSONObject ownerinfo) {
|
|
|
|
|
+ String identify="";
|
|
|
|
|
+ if(ownerinfo !=null ){
|
|
|
|
|
+ String identifyType = ownerinfo.getString("identifyNumber");
|
|
|
|
|
+ if(StringUtils.isNotBlank(identifyType)){
|
|
|
|
|
+ identify=identifyType.replaceAll("(\\d{4})\\d{10}(\\d{4})", "$1****$2");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return identify;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|