| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531 |
- package com.ydtech.modules.ins.model.guoRen;
- import cn.hutool.core.date.DateUtil;
- import com.alibaba.fastjson.annotation.JSONField;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonProperty;
- import com.ydtech.constants.enums.InsuranceRisk;
- import com.ydtech.modules.ins.model.vo.CarInfoVo;
- import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
- import com.ydtech.modules.ins.model.vo.KindInfoVo;
- import com.ydtech.modules.ins.model.vo.RiskInfoVo;
- import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
- import com.ydtech.utils.StringUtils;
- import lombok.Data;
- import lombok.NoArgsConstructor;
- import java.util.List;
- @NoArgsConstructor
- @Data
- public class CarPriceReq {
- @JsonProperty(value = "bc")
- @JSONField(name = "bc")
- private BcDTO bc;
- @JsonProperty(value = "basePartVo")
- @JSONField(name = "basePartVo")
- private BasePartVoDTO basePartVo;
- @JsonProperty(value = "bi")
- @JSONField(name = "bi")
- private BiDTO bi;
- @JsonProperty(value = "ci")
- @JSONField(name = "ci")
- private CiDTO ci;
- @JsonIgnore
- public static CarPriceReq buildCarPriceParam(BaseQuoteInfoVo yaQuoteInfoVo, VinQueryResp.DataDTO vinQ, ChannelInfoDto channelInfo) {
- CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
- CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
- List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
- List<KindInfoVo> kindInfoVList = yaQuoteInfoVo.getKindList();
- //交强
- RiskInfoVo ciRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.TRAFFIC.getCode())).findFirst().orElse(null);
- //商业
- RiskInfoVo biRiskInfo = (RiskInfoVo) riskList.stream().filter(x -> x.getRiskCode().equals(InsuranceRisk.BUSINESS.getCode())).findFirst().orElse(null);
- // riskList.stream().forEach(a ->{
- // if(a.getRiskCode().equals("0507")){
- // ciRiskInfo = a;
- // }
- // });
- CarPriceReq req = new CarPriceReq();
- BcDTO bc = new BcDTO();
- bc.setLoginComCode(channelInfo.getComCode());
- /**
- * 主信息====================
- */
- BcDTO.PrpTmainDTO prpTmain = new BcDTO.PrpTmainDTO();
- //机构代码
- prpTmain.setComCode(channelInfo.getComCode());
- prpTmain.setArgueSolution("1");
- prpTmain.setUnitMaintenanceName(channelInfo.getUnitMaintenanceName());
- prpTmain.setBusinessNature("2");
- //渠道标志(我司提供)
- prpTmain.setActivityPlan("TQDL");
- //签单时间 signDate 字符串 Y 默认为投保当天
- prpTmain.setSignDate(DateUtil.today());
- prpTmain.setHandlerCode(channelInfo.getHandlerCode());
- prpTmain.setChanneltypeoneName(channelInfo.getChannelTypeOneName());
- prpTmain.setUnitMaintenanceCode(channelInfo.getUnitMaintenanceCode());
- prpTmain.setUnitmainTenanceType1(channelInfo.getUnitmainTenanceType1());
- prpTmain.setUnitmainTenanceType2(channelInfo.getUnitmainTenanceType2());
- prpTmain.setChanneltypetwoName(channelInfo.getChannelTypeTwoName());
- prpTmain.setHandler1Code(channelInfo.getHandlerCode());
- prpTmain.setComName(channelInfo.getComName());
- prpTmain.setComCode(channelInfo.getComCode());
- prpTmain.setOperateDate(DateUtil.today());
- //起保日期 商业险起保日期,如果单交强,传交强起保日期
- prpTmain.setStartDate(biRiskInfo == null ? ciRiskInfo.getStartDate() : biRiskInfo.getStartDate());
- prpTmain.setEProposalFlag("1");
- //购车发票日期
- prpTmain.setBusiness(carInfo.getIssueDate());
- prpTmain.setAgentName(channelInfo.getAgentName());
- prpTmain.setChanneltypetwoName(channelInfo.getChannelTypeTwoName());
- prpTmain.setChanneltypeoneName(channelInfo.getChannelTypeOneName());
- //代理人
- prpTmain.setAgentCode(channelInfo.getAgentCode());
- prpTmain.setAgreementNo(channelInfo.getAgreementNo());
- prpTmain.setUnitmainTenanceType2Name(channelInfo.getUnitmainTenanceType2Name());
- prpTmain.setChanneltypeone(channelInfo.getChannelTypeOne());
- prpTmain.setHandler1Name(channelInfo.getHandler1Name());
- prpTmain.setChanneltypetwo(channelInfo.getChannelTypeTwo());
- /**
- * 车辆信息====================
- */
- BcDTO.PrpTitemCarDTO prpTitemCar = new BcDTO.PrpTitemCarDTO();
- prpTitemCar.setFrameNo(carInfo.getFrameNo());
- prpTitemCar.setLicenseNo(carInfo.getLicenseNo());
- prpTitemCar.setNewEnergyFlag("0");
- //类比排量
- prpTitemCar.setExhaustScalelb(vinQ.getExHaustScale());
- //排量
- prpTitemCar.setExhaustScale(vinQ.getExHaustScale());
- // prpTitemCar.setTonCount(carInfo.getLimitLoad());
- prpTitemCar.setTonCount(vinQ.getTonCount());
- //新车标识 newCarFlag 字符串 新车传空,非新车-1
- prpTitemCar.setNewCarFlag(StringUtils.isEmpty(carInfo.getLicenseNo()) ? "" : "-1");
- prpTitemCar.setLicenseKindCode("02");
- prpTitemCar.setPurchasePrice(vinQ.getPurchasePriceSZ());
- prpTitemCar.setClauseType("F54");
- prpTitemCar.setVinNo(carInfo.getVinNo());
- prpTitemCar.setVehicleBrand(vinQ.getBrandNameBC());
- // prpTitemCar.setVehicleBrand(carInfo.getCarBrand());
- prpTitemCar.setCompleteKerbMass(vinQ.getCompleteKerbMass());
- prpTitemCar.setLoanVehicleFlag("0");
- prpTitemCar.setChgOwnerFlag(carInfo.isTransferFlag() ? "1" : "0");
- prpTitemCar.setProductType("0101");
- prpTitemCar.setClauseTypeSystem("04");
- prpTitemCar.setEngineNo(carInfo.getEngineNo());
- prpTitemCar.setBrandName(vinQ.getBrandNameBC());
- prpTitemCar.setCertifiCateDate(carInfo.getIssueDate());
- //使用性质 8A 家庭自用
- prpTitemCar.setUseNatureCode("8A");
- //初登日期
- prpTitemCar.setEnrollDate(carInfo.getIssueDate());
- //核定载客数
- prpTitemCar.setSeatCount(carInfo.getSeatCount());
- prpTitemCar.setFuelType("0");
- prpTitemCar.setTermsSystem("04");
- prpTitemCar.setTonCountlb(vinQ.getTonCount());
- // prpTitemCar.setTonCountlb("0");
- prpTitemCar.setVinClick("0");
- prpTitemCar.setMaincarKindCode("A");
- //过户日期
- prpTitemCar.setChgOwnerDate(carInfo.getTransferDate());
- /**
- * vin car
- */
- prpTitemCar.setBrandCode(vinQ.getBrandCode());
- prpTitemCar.setModelCode(vinQ.getModelCodeBC());
- prpTitemCar.setModelName(vinQ.getBrandNameBC());
- prpTitemCar.setNewFuelModel(vinQ.getNewFuelModel());
- /**
- * 车主信息
- */
- prpTitemCar.setCarOwner(ownerInfo.getName());
- prpTitemCar.setCarOwnerIdentifyNumber(ownerInfo.getIdentifyNumber());
- prpTitemCar.setCarOwnerIdentifyType("01");
- //车主客户性质 carOwnerNature 字符串 Y 1:机关 2:企业 0:个人
- prpTitemCar.setCarOwnerNature("0");
- prpTitemCar.setIDValidStartDate(ownerInfo.getIdentifyValidDate());
- prpTitemCar.setIdValidDate(ownerInfo.getIdentifyValidEndDate());
- /**
- * 整合
- */
- bc.setPrpTmain(prpTmain);
- bc.setPrpTitemCar(prpTitemCar);
- //登录机构
- bc.setLoginComCode(channelInfo.getComCode());
- //保费计算折扣 0是第一次计算保费,1是价费联动,2是批折扣,默认0
- bc.setFeeandDiscountFlag("0");
- //险种信息 0500-车险 摩托车、拖拉机的商业险-0521
- bc.setRiskCode("0500");
- //是否涉及农险业务 默认0
- bc.setAgriFlagBC("0");
- BasePartVoDTO basePartVo = new BasePartVoDTO();
- basePartVo.setEditType("EditType_ProposalInput");
- basePartVo.setInputType("34");
- basePartVo.setLoginComCode(channelInfo.getComCode());
- basePartVo.setLoginComCodeSub(channelInfo.getComCode().substring(0, 2));
- // basePartVo.setLoginRiskCode("0500");
- basePartVo.setUserCode(channelInfo.getAgentCode());
- req.setBi(new BiDTO());
- req.setCi(new CiDTO());
- req.setBc(bc);
- req.setBasePartVo(basePartVo);
- return req;
- }
- @NoArgsConstructor
- @Data
- public static class BcDTO {
- @JsonProperty(value = "prpTitemCar")
- @JSONField(name = "prpTitemCar")
- private PrpTitemCarDTO prpTitemCar;
- @JsonProperty(value = "loginComCode")
- @JSONField(name = "loginComCode")
- private String loginComCode;
- @JsonProperty(value = "prpTmain")
- @JSONField(name = "prpTmain")
- private PrpTmainDTO prpTmain;
- @JsonProperty(value = "feeandDiscountFlag")
- @JSONField(name = "feeandDiscountFlag")
- private String feeandDiscountFlag;
- @JsonProperty(value = "riskCode")
- @JSONField(name = "riskCode")
- private String riskCode;
- @JsonProperty(value = "agriFlagBC")
- @JSONField(name = "agriFlagBC")
- private String agriFlagBC;
- @NoArgsConstructor
- @Data
- public static class PrpTitemCarDTO {
- @JsonProperty(value = "frameNo")
- @JSONField(name = "frameNo")
- private String frameNo;
- @JsonProperty(value = "licenseNo")
- @JSONField(name = "licenseNo")
- private String licenseNo;
- @JsonProperty(value = "newEnergyFlag")
- @JSONField(name = "newEnergyFlag")
- private String newEnergyFlag;
- @JsonProperty(value = "exhaustScalelb")
- @JSONField(name = "exhaustScalelb")
- private String exhaustScalelb;
- @JsonProperty(value = "tonCount")
- @JSONField(name = "tonCount")
- private String tonCount;
- @JsonProperty(value = "newCarFlag")
- @JSONField(name = "newCarFlag")
- private String newCarFlag;
- @JsonProperty(value = "licenseKindCode")
- @JSONField(name = "licenseKindCode")
- private String licenseKindCode;
- @JsonProperty(value = "purchasePrice")
- @JSONField(name = "purchasePrice")
- private String purchasePrice;
- @JsonProperty(value = "clauseType")
- @JSONField(name = "clauseType")
- private String clauseType;
- @JsonProperty(value = "vinNo")
- @JSONField(name = "vinNo")
- private String vinNo;
- @JsonProperty(value = "vehicleBrand")
- @JSONField(name = "vehicleBrand")
- private String vehicleBrand;
- @JsonProperty(value = "carOwner")
- @JSONField(name = "carOwner")
- private String carOwner;
- @JsonProperty(value = "modelCode")
- @JSONField(name = "modelCode")
- private String modelCode;
- @JsonProperty(value = "exhaustScale")
- @JSONField(name = "exhaustScale")
- private String exhaustScale;
- @JsonProperty(value = "completeKerbMass")
- @JSONField(name = "completeKerbMass")
- private String completeKerbMass;
- @JsonProperty(value = "loanVehicleFlag")
- @JSONField(name = "loanVehicleFlag")
- private String loanVehicleFlag;
- @JsonProperty(value = "chgOwnerFlag")
- @JSONField(name = "chgOwnerFlag")
- private String chgOwnerFlag;
- @JsonProperty(value = "carOwnerIdentifyNumber")
- @JSONField(name = "carOwnerIdentifyNumber")
- private String carOwnerIdentifyNumber;
- @JsonProperty(value = "productType")
- @JSONField(name = "productType")
- private String productType;
- @JsonProperty(value = "brandCode")
- @JSONField(name = "brandCode")
- private String brandCode;
- @JsonProperty(value = "chgOwnerDate")
- @JSONField(name = "chgOwnerDate")
- private String chgOwnerDate;
- @JsonProperty(value = "clauseTypeSystem")
- @JSONField(name = "clauseTypeSystem")
- private String clauseTypeSystem;
- @JsonProperty(value = "engineNo")
- @JSONField(name = "engineNo")
- private String engineNo;
- @JsonProperty(value = "brandName")
- @JSONField(name = "brandName")
- private String brandName;
- @JsonProperty(value = "certifiCateDate")
- @JSONField(name = "certifiCateDate")
- private String certifiCateDate;
- @JsonProperty(value = "useNatureCode")
- @JSONField(name = "useNatureCode")
- private String useNatureCode;
- @JsonProperty(value = "enrollDate")
- @JSONField(name = "enrollDate")
- private String enrollDate;
- @JsonProperty(value = "seatCount")
- @JSONField(name = "seatCount")
- private String seatCount;
- @JsonProperty(value = "carOwnerIdentifyType")
- @JSONField(name = "carOwnerIdentifyType")
- private String carOwnerIdentifyType;
- @JsonProperty(value = "carOwnerNature")
- @JSONField(name = "carOwnerNature")
- private String carOwnerNature;
- @JsonProperty(value = "modelName")
- @JSONField(name = "modelName")
- private String modelName;
- @JsonProperty(value = "fuelType")
- @JSONField(name = "fuelType")
- private String fuelType;
- @JsonProperty(value = "termsSystem")
- @JSONField(name = "termsSystem")
- private String termsSystem;
- @JsonProperty(value = "tonCountlb")
- @JSONField(name = "tonCountlb")
- private String tonCountlb;
- @JsonProperty(value = "newFuelModel")
- @JSONField(name = "newFuelModel")
- private String newFuelModel;
- @JsonProperty(value = "vinClick")
- @JSONField(name = "vinClick")
- private String vinClick;
- @JsonProperty(value = "maincarKindCode")
- @JSONField(name = "maincarKindCode")
- private String maincarKindCode;
- //车主证件有效期起期
- // @JsonProperty(value = "IDValidStartDate")
- @JSONField(name = "IDValidStartDate")
- @JsonProperty(value = "IDValidStartDate")
- private String IDValidStartDate;
- //车主证件有效期止期
- @JsonProperty(value = "idValidDate")
- @JSONField(name = "idValidDate")
- private String idValidDate;
- }
- @NoArgsConstructor
- @Data
- public static class PrpTmainDTO {
- //代理人代码
- @JsonProperty(value = "agentCode")
- @JSONField(name = "agentCode")
- private String agentCode;
- //代理协议
- @JsonProperty(value = "agreementNo")
- @JSONField(name = "agreementNo")
- private String agreementNo;
- @JsonProperty(value = "unitmainTenanceType2Name")
- @JSONField(name = "unitmainTenanceType2Name")
- private String unitmainTenanceType2Name;
- @JsonProperty(value = "channeltypeone")
- @JSONField(name = "channeltypeone")
- private String channeltypeone;
- @JsonProperty(value = "argueSolution")
- @JSONField(name = "argueSolution")
- private String argueSolution;
- @JsonProperty(value = "handler1Name")
- @JSONField(name = "handler1Name")
- private String handler1Name;
- @JsonProperty(value = "channeltypetwo")
- @JSONField(name = "channeltypetwo")
- private String channeltypetwo;
- @JsonProperty(value = "agentName")
- @JSONField(name = "agentName")
- private String agentName;
- @JsonProperty(value = "unitMaintenanceName")
- @JSONField(name = "unitMaintenanceName")
- private String unitMaintenanceName;
- @JsonProperty(value = "businessNature")
- @JSONField(name = "businessNature")
- private String businessNature;
- @JsonProperty(value = "activityPlan")
- @JSONField(name = "activityPlan")
- private String activityPlan;
- @JsonProperty(value = "signDate")
- @JSONField(name = "signDate")
- private String signDate;
- @JsonProperty(value = "handlerCode")
- @JSONField(name = "handlerCode")
- private String handlerCode;
- @JsonProperty(value = "channeltypeoneName")
- @JSONField(name = "channeltypeoneName")
- private String channeltypeoneName;
- @JsonProperty(value = "unitMaintenanceCode")
- @JSONField(name = "unitMaintenanceCode")
- private String unitMaintenanceCode;
- @JsonProperty(value = "unitmainTenanceType1")
- @JSONField(name = "unitmainTenanceType1")
- private String unitmainTenanceType1;
- @JsonProperty(value = "unitmainTenanceType2")
- @JSONField(name = "unitmainTenanceType2")
- private String unitmainTenanceType2;
- @JsonProperty(value = "channeltypetwoName")
- @JSONField(name = "channeltypetwoName")
- private String channeltypetwoName;
- @JsonProperty(value = "handler1Code")
- @JSONField(name = "handler1Code")
- private String handler1Code;
- @JsonProperty(value = "comName")
- @JSONField(name = "comName")
- private String comName;
- @JsonProperty(value = "comCode")
- @JSONField(name = "comCode")
- private String comCode;
- @JsonProperty(value = "operateDate")
- @JSONField(name = "operateDate")
- private String operateDate;
- @JsonProperty(value = "startDate")
- @JSONField(name = "startDate")
- private String startDate;
- @JsonProperty(value = "eProposalFlag")
- @JSONField(name = "eProposalFlag")
- private String eProposalFlag;
- @JsonProperty(value = "business")
- @JSONField(name = "business")
- private String business;
- }
- }
- @NoArgsConstructor
- @Data
- public static class BasePartVoDTO {
- /**
- * 编辑类型
- * 投保单录入 EditType_ProposalInput
- * 投保单修改
- * EditType_ProposalModify
- */
- @JsonProperty(value = "editType")
- @JSONField(name = "editType")
- private String editType;
- /**
- * 输入类型
- * 34-同保
- */
- @JsonProperty(value = "inputType")
- @JSONField(name = "inputType")
- private String inputType;
- /**
- * 登录机构
- */
- @JsonProperty(value = "loginComCode")
- @JSONField(name = "loginComCode")
- private String loginComCode;
- /**
- * 登录机构地区编码
- * 取登录机构前两位
- */
- @JsonProperty(value = "loginComCodeSub")
- @JSONField(name = "loginComCodeSub")
- private String loginComCodeSub;
- /**
- * 险种代码
- * 0500同保
- */
- @JsonProperty(value = "loginRiskCode")
- @JSONField(name = "loginRiskCode")
- private String loginRiskCode;
- /**
- * 业务员代码
- */
- @JsonProperty(value = "userCode")
- @JSONField(name = "userCode")
- private String userCode;
- }
- @NoArgsConstructor
- @Data
- public static class BiDTO {
- }
- @NoArgsConstructor
- @Data
- public static class CiDTO {
- }
- // private static BcDTO.PrpTmainDTO buildPrpTmain(){
- // BcDTO.PrpTmainDTO tmain = new BcDTO.PrpTmainDTO();
- // tmain.setUnitmainTenanceType2Name();
- // "unitmainTenanceType2Name":"直通网销",
- // "channeltypeone":"60",
- // "argueSolution":"1",
- // "handler1Name":"徐丽",
- // "channeltypetwo":"0201",
- // "agentName":"徐丽",
- // "unitMaintenanceName":"南京测试标准件",
- // "businessNature":"0",
- // "activityPlan":"IXX",
- // "signDate":"2022-06-17",
- // "handlerCode":"S0300042",
- // "channeltypeoneName":"行销",
- // "unitMaintenanceCode":"0315G022105203121",
- // "unitmainTenanceType1":"G",
- // "unitmainTenanceType2":"06",
- // "channeltypetwoName":"行销传统",
- // "handler1Code":"S0300042",
- // "comName":"江苏南京溧水支公司个客综合",
- // "comCode":"031514A3",
- // "operateDate":"2022-06-17",
- // "startDate":"2022-06-18",
- // "eProposalFlag":"1",
- // "business":"2020-06-18"
- // }
- }
|