package com.ydtech.modules.order.entity; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ydtech.modules.order.entity.vo.BaseQuoteVo; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; /** * 子订单驾意险信息 * * @TableName ins_area_company_accidental_driving */ @TableName(value = "ins_area_company_accidental_driving") @Data public class InsAreaCompanyAccidentalDriving implements Serializable { private static final long serialVersionUID = 2549273518435897774L; /** * */ @TableId(value = "id") private String id; @TableField(value = "company_id") private String companyId; /** * 编号 */ @TableField(value = "ride_risk_code") private String rideRiskCode; /** * 名称 */ @TableField(value = "ride_risk_name") private String rideRiskName; /** * 份数 */ @TableField(value = "quantity") private Integer quantity; /** * 转换爬虫的驾意险信息 * @param t * @return */ public void convertCrawler(BaseQuoteVo t) { //众安 if (t.getCompanyId().equals("ZAPA1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("name")); this.setQuantity(jsonObject.getInteger("quantity")); } else //恒邦 if (t.getCompanyId().equals("HBIC1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("programname")); this.setQuantity(jsonObject.getInteger("quantity")); this.setRideRiskCode(jsonObject.getString("programcode")); } else //人寿 if (t.getCompanyId().equals("GPIC1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("productName")); this.setQuantity(jsonObject.getInteger("quantity")); this.setRideRiskCode(jsonObject.getString("quotaProjectNo")); }else //太平 if (t.getCompanyId().equals("TPIC1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("rationName")); this.setQuantity(jsonObject.getInteger("quantity")); this.setRideRiskCode(jsonObject.getString("productCode")); }else //华农 if (t.getCompanyId().equals("HNIC1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("planName")); this.setQuantity(jsonObject.getInteger("quantity")); this.setRideRiskCode(jsonObject.getString("planCode")); }else //安盛 if(t.getCompanyId().equals("TPBX1000000")) { JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo())); this.setRideRiskName(jsonObject.getString("productName")); this.setQuantity(jsonObject.getInteger("quantity")); this.setRideRiskCode(jsonObject.getString("productCode")); } } }