InsAreaCompany.java 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. package com.ydtech.modules.order.entity;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONArray;
  4. import com.alibaba.fastjson.JSONObject;
  5. import com.baomidou.mybatisplus.annotation.TableField;
  6. import com.baomidou.mybatisplus.annotation.TableId;
  7. import com.baomidou.mybatisplus.annotation.TableName;
  8. import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
  9. import com.fasterxml.jackson.annotation.JsonFormat;
  10. import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
  11. import com.ydtech.modules.ins.model.vo.QuoteRespVo;
  12. import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
  13. import com.ydtech.utils.StringUtils;
  14. import com.ydtech.utils.idgen.IdGenerate;
  15. import io.swagger.annotations.ApiModel;
  16. import io.swagger.annotations.ApiModelProperty;
  17. import lombok.AllArgsConstructor;
  18. import lombok.Data;
  19. import lombok.NoArgsConstructor;
  20. import java.io.Serializable;
  21. import java.math.BigDecimal;
  22. import java.time.LocalDateTime;
  23. import java.util.Date;
  24. /**
  25. * 报价渠道
  26. *
  27. * @TableName ins_area_company
  28. */
  29. @TableName(value = "ins_area_company", autoResultMap = true)
  30. @Data
  31. @ApiModel(value = "报价渠道")
  32. @NoArgsConstructor
  33. @AllArgsConstructor
  34. public class InsAreaCompany implements Serializable {
  35. @TableField(exist = false)
  36. private static final long serialVersionUID = -6827009009645748787L;
  37. /**
  38. * 主键
  39. */
  40. @TableId(value = "id")
  41. private String id;
  42. /**
  43. * 订单号
  44. */
  45. @TableField(value = "orderno")
  46. private String orderno;
  47. /**
  48. * 协议id
  49. */
  50. @TableField(value = "agreement_id")
  51. private String agreementId;
  52. /**
  53. * 请求类型
  54. */
  55. @TableField(value = "api_type")
  56. private Integer apiType;
  57. /**
  58. * 订单状态
  59. *
  60. * @see com.ydtech.constants.enums.dict.InsOrderStatusEnum
  61. */
  62. @TableField(value = "orderstatus")
  63. private String orderstatus = "0";
  64. /**
  65. * 保险公司编号
  66. */
  67. @TableField(value = "company_id")
  68. private String companyId;
  69. /**
  70. * 保险名称
  71. */
  72. @TableField(value = "inscompany")
  73. private String inscompany;
  74. /**
  75. * 请求报文
  76. */
  77. @TableField(value = "reqtxt", typeHandler = FastjsonTypeHandler.class)
  78. private JSONObject reqtxt;
  79. /**
  80. * 二维码有效状态
  81. * @see com.ydtech.modules.protocol.constants.ValidStatus
  82. */
  83. @TableField(value = "code_valid_status")
  84. private String codeValidStatus;
  85. /**
  86. * 响应报文
  87. */
  88. @TableField(value = "reptxt", typeHandler = FastjsonTypeHandler.class)
  89. private JSONObject reptxt;
  90. /**
  91. * 交强投保单号
  92. */
  93. @TableField(value = "jqapplyno")
  94. private String jqapplyno;
  95. /**
  96. * 交强保单号
  97. */
  98. @TableField(value = "jqpolicyno")
  99. private String jqpolicyno;
  100. /**
  101. * 商业投保单号
  102. */
  103. @TableField(value = "syapplyno")
  104. private String syapplyno;
  105. /**
  106. * 商业保单号
  107. */
  108. @TableField(value = "sypolicyno")
  109. private String sypolicyno;
  110. /**
  111. * 交叉销售保单信息
  112. */
  113. @TableField(value = "cross_insurance", typeHandler = FastjsonTypeHandler.class)
  114. private JSONArray crossInsurance;
  115. /**
  116. * 驾意险
  117. */
  118. @TableField(value = "accident_info", typeHandler = FastjsonTypeHandler.class)
  119. private JSONArray accidentInfo;
  120. /**
  121. * 交强险商业险
  122. */
  123. @TableField(value = "riskinfo", typeHandler = FastjsonTypeHandler.class)
  124. private JSONArray riskinfo;
  125. /**
  126. * 商业险信息
  127. */
  128. @TableField(value = "kindinfo", typeHandler = FastjsonTypeHandler.class)
  129. private JSONArray kindinfo;
  130. /**
  131. * 交强险费用
  132. */
  133. @TableField(value = "jqpremium")
  134. private BigDecimal jqpremium;
  135. /**
  136. * 商业险费用
  137. */
  138. @TableField(value = "sypremium")
  139. private BigDecimal sypremium;
  140. /**
  141. * 驾意险
  142. */
  143. @TableField(value = "jypremium")
  144. private BigDecimal jypremium;
  145. /**
  146. * 车船税费用
  147. */
  148. @TableField(value = "taxamount")
  149. private BigDecimal taxamount;
  150. /**
  151. * 总保费
  152. */
  153. @TableField(value = "sumpremium")
  154. private BigDecimal sumpremium;
  155. /**
  156. * 交强优惠比例
  157. */
  158. @TableField(value = "jqdiscountrate")
  159. private Double jqdiscountrate;
  160. /**
  161. * 商业优惠比例
  162. */
  163. @TableField(value = "sydiscountrate")
  164. private Double sydiscountrate;
  165. /**
  166. * 交强手续费比例
  167. */
  168. @TableField(value = "feerate")
  169. private Double feerate;
  170. /**
  171. * 商业手续费比例
  172. */
  173. @TableField(value = "disrate")
  174. private Double disrate;
  175. /**
  176. * 核保人
  177. */
  178. @TableField(value = "auditid")
  179. private String auditid;
  180. /**
  181. * 核保人姓名
  182. */
  183. @TableField(value = "auditname")
  184. private String auditname;
  185. /**
  186. * 核保时间
  187. */
  188. @TableField(value = "audittime")
  189. private LocalDateTime audittime;
  190. /**
  191. * 核保意见
  192. */
  193. @TableField(value = "auditopinion")
  194. private String auditopinion;
  195. /**
  196. * 交强特别约定
  197. */
  198. @TableField(value = "jqappoint")
  199. private String jqappoint;
  200. /**
  201. * 商业特别约定
  202. */
  203. @TableField(value = "syappoint")
  204. private String syappoint;
  205. /**
  206. * 创建时间
  207. */
  208. @TableField(value = "createtime")
  209. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  210. private LocalDateTime createtime;
  211. /**
  212. * 支付链接
  213. */
  214. @TableField(value = "payment_link")
  215. private String paymentLink;
  216. /**
  217. * 支付时间
  218. */
  219. @TableField(value = "pay_date")
  220. private LocalDateTime payDate;
  221. /**
  222. * 签单时间(支付二维生成时间)
  223. */
  224. @TableField(value = "signing_time")
  225. private LocalDateTime signingTime;
  226. /**
  227. * 保险公司订单号
  228. * lig 新增字段 2023-02-24
  229. */
  230. @TableField(value = "ins_order_no")
  231. private String insOrderNo;
  232. /**
  233. *
  234. */
  235. @TableField(value = "attribution_id")
  236. private String attributionId;
  237. /**
  238. * 欠税
  239. */
  240. @TableField(value = "tax_arrears", typeHandler = FastjsonTypeHandler.class)
  241. private JSONArray taxArrears;
  242. /**
  243. * 交强险起期
  244. * lig 新增字段 2023-09-14
  245. */
  246. @TableField(value = "jq_start_date")
  247. private String jqStartDate;
  248. /**
  249. * 交强险止期
  250. * lig 新增字段 2023-09-14
  251. */
  252. @TableField(value = "jq_end_date")
  253. private String jqEndDate;
  254. /**
  255. * 商业险起期
  256. * lig 新增字段 2023-09-14
  257. */
  258. @TableField(value = "sy_start_date")
  259. private String syStartDate;
  260. /**
  261. * 商业险止期
  262. * lig 新增字段 2023-09-14
  263. */
  264. @TableField(value = "sy_end_date")
  265. private String syEndDate;
  266. /**
  267. * 出险 字符串 信息
  268. * lig 新增字段 2023-10-10
  269. */
  270. @TableField(value = "accident_str_info")
  271. private String accidentStrInfo;
  272. /**
  273. * 评分
  274. * lig 新增字段 2023-10-10
  275. */
  276. @TableField(value = "score")
  277. private String score;
  278. /**
  279. * 交强类型评分
  280. */
  281. @TableField(value = "jq_score")
  282. private String jqScore;
  283. /**
  284. * 商业类型评分
  285. */
  286. @TableField(value = "sy_score")
  287. private String syScore;
  288. /**
  289. * 总赔付率
  290. */
  291. @TableField(value = "loss_ration")
  292. private double lossRation;
  293. /**
  294. * 交强赔付率
  295. */
  296. @TableField(value = "jq_loss_ration")
  297. private double jqLossRation;
  298. /**
  299. * 商业赔付率
  300. */
  301. @TableField(value = "sy_loss_ration")
  302. private double syLossRation;
  303. /**
  304. * 总折扣率
  305. */
  306. @TableField(value = "total_adjust_rate")
  307. private double totalAdjustRate;
  308. /**
  309. * 交强险折扣
  310. */
  311. @TableField(value = "jq_adjust_rate")
  312. private double jqAdjustRate;
  313. /**
  314. * 商业险折扣
  315. */
  316. @TableField(value = "sy_adjust_rate")
  317. private double syAdjustRate;
  318. @TableField(value = "inside_order_status")
  319. private Integer insideOrderStatus;
  320. @TableField(value = "inside_pay_time")
  321. private String insidePayTime;
  322. /**
  323. * 紫金能源车(鼎然-车辆风险评分 add by hxl 2024-04-09
  324. */
  325. @TableField(value = "ubi_predicted_info_score")
  326. private String ubiPredictedInfoScore;
  327. /**
  328. * 太平洋绿黄红区间评分
  329. */
  330. @TableField(value = "tp_color_score")
  331. private String tpColorScore;
  332. /**
  333. * 紫金 渤海真假单交
  334. */
  335. @TableField(value = "is_djq")
  336. private String isDjq;
  337. /**
  338. * 添加操作人
  339. */
  340. @TableField(value = "operator_id")
  341. private String operatorId;
  342. /**
  343. * 操作时间
  344. */
  345. @TableField(value = "operator_time")
  346. private Date operatorTime;
  347. /**
  348. * 添加操作人
  349. */
  350. @TableField(value = "operator_name")
  351. private String operatorName;
  352. /**
  353. * 新操作人
  354. */
  355. @TableField(value = "new_operator_id")
  356. private String newOperatorId;
  357. /**
  358. * 新操作人
  359. */
  360. @TableField(value = "new_operator_name")
  361. private String newOperatorName;
  362. /**
  363. * 报价成功或者失败状态
  364. */
  365. //@TableField(value = "error_status")
  366. //private Integer errorStatus;
  367. // add by hxl 2024-05-10 子订单添加产品信息 更新 险种信息从子订单中获取
  368. /**
  369. * 产品id
  370. */
  371. @TableField(value = "productid")
  372. private String productid;
  373. /**
  374. * 产品名称
  375. */
  376. @TableField(value = "product")
  377. private String product;
  378. /**
  379. * 交强续保
  380. *
  381. * @see com.ydtech.constants.enums.dict.insurance.Renewal
  382. */
  383. @TableField(value = "jq_renewal")
  384. private String jqRenewal;
  385. /**
  386. * 商业续保
  387. *
  388. * @see com.ydtech.constants.enums.dict.insurance.Renewal
  389. */
  390. @TableField(value = "sy_renewal")
  391. private String syRenewal;
  392. /**
  393. * 交强出险次数
  394. */
  395. @TableField(value = "jq_claims")
  396. private String jqClaims;
  397. /**
  398. * 商业出险次数
  399. */
  400. @TableField("sy_claims")
  401. private String syClaims;
  402. /**
  403. * 疑问订单标注
  404. */
  405. @TableField("problem_order")
  406. private String problemOrder;
  407. @TableField(exist = false)
  408. private String licenseno;
  409. @TableField(exist = false)
  410. private String rejectinfo;
  411. /***
  412. * 平安流程id
  413. */
  414. @TableField("flowid")
  415. private String flowid;
  416. /***
  417. * 平安通知单号
  418. */
  419. @TableField("notice_no")
  420. private String noticeNo;
  421. /**
  422. * 非车信息
  423. */
  424. @TableField(exist = false)
  425. private InsAreaCompanyAccidentalDriving accidentalDriving;
  426. /**
  427. * 业务员
  428. */
  429. @TableField(exist = false)
  430. private String userName;
  431. /**
  432. * 业务员ID
  433. */
  434. @TableField(exist = false)
  435. private String userId;
  436. /***
  437. * 外部状态 0 暂存 1 驳回
  438. */
  439. @TableField(exist = false)
  440. private String orderExternalStatus;
  441. /**
  442. * 录入状态 1 车险录入 2 待客录单 3 外部订单
  443. */
  444. @TableField(value = "entry_status")
  445. private Integer entryStatus;
  446. /**
  447. * @see com.ydtech.modules.order.constants.UnderwritingStatus
  448. * 核保状态
  449. */
  450. @TableField("underwriting_status")
  451. private Integer underwritingStatus;
  452. /**
  453. * @see com.ydtech.modules.order.constants.PcPhoneStatus
  454. * 报价状态 0 pc 1.app
  455. */
  456. @TableField("order_source")
  457. private Integer orderSource;
  458. //费用匹配信息
  459. @TableField("fee_match_err_msg")
  460. // @TableField(exist = false)
  461. private String feeMatchErrMsg;
  462. //报价错误信息
  463. @TableField("quote_err_msg")
  464. // @TableField(exist = false)
  465. private String quoteErrMsg;
  466. /**
  467. * 0 删除 1 正常
  468. * 删除订单
  469. */
  470. @TableField(value = "del_flag")
  471. private String delFlag;
  472. //add by hxl 添加时间相关
  473. /**
  474. * 核保时间
  475. */
  476. @TableField(value = "underwriting_time")
  477. private Date underwritingTime;
  478. /**
  479. * 更新状态 1 手动更新 2. 自动更新
  480. */
  481. @TableField(value = "update_status")
  482. private String updateStatus;
  483. /**
  484. * 更新时间
  485. */
  486. @TableField(value = "update_status_time")
  487. private Date updateStatusTime;
  488. /**
  489. * 维护人id
  490. */
  491. @TableField(value = "leader_id")
  492. private String leaderId;
  493. /**
  494. * 维护人名称
  495. */
  496. @TableField(value = "leader_name")
  497. private String leaderName;
  498. /**
  499. * 验车链接
  500. */
  501. @TableField(value = "vehicle_inspection_url")
  502. private String vehicleInspectionUrl;
  503. /**
  504. * 商业是否有费用 太平使用
  505. */
  506. @TableField(value = "ci_message")
  507. private String ciMessage;
  508. /**
  509. * 扩展字段
  510. */
  511. @TableField(value = "extend_info")
  512. private Object extendInfo;
  513. /**
  514. * 交商含增值服务合并经营成本率 阳光使用
  515. */
  516. @TableField(value = "merge_cost_rate")
  517. private String mergeCostRate;
  518. /**
  519. * 对接人
  520. */
  521. @TableField(value = "docking_person")
  522. private String dockingPerson;
  523. /**
  524. * 红黄蓝车系(仅电车返回有值) (阳光使用)
  525. */
  526. @TableField(value = "series_type_actual_name")
  527. private String seriesTypeActualName;
  528. /**
  529. * 向阳花标识 (阳光使用)
  530. */
  531. @TableField(value = "xyh_grade")
  532. private String xyhGrade;
  533. //入口总金额
  534. @TableField(exist = false)
  535. private BigDecimal entranceAllFee;
  536. //出口总金额
  537. @TableField(exist = false)
  538. private BigDecimal exportAllFee;
  539. //毛利润
  540. @TableField(exist = false)
  541. private BigDecimal distributionAmount;
  542. /***
  543. * 驾意险编号 add by hxl 2024-10-21
  544. */
  545. @TableField(exist = false)
  546. private String jyPolicyNo;
  547. @TableField(exist = false)
  548. private String recorder;
  549. /**
  550. * 添加车辆 人员信息 25-01-18
  551. */
  552. @TableField(exist = false)
  553. private String carInfo;
  554. @TableField(exist = false)
  555. private String ownerInfo;
  556. @TableField(exist = false)
  557. private String applyInfo;
  558. @TableField(exist = false)
  559. private String insureInfo;
  560. public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
  561. this.id = IdGenerate.nextId();
  562. this.orderno = quoteRespVo.getOrderno();
  563. this.agreementId = ptlAgreementAttribution.getId();
  564. this.apiType = ptlAgreementAttribution.getApiType();
  565. this.companyId = ptlAgreementAttribution.getInsCompanyId();
  566. this.inscompany = ptlAgreementAttribution.getInsCompanyName();
  567. this.jqpremium = BigDecimal.valueOf(quoteRespVo.getJqPremium());
  568. this.sypremium = BigDecimal.valueOf(quoteRespVo.getSyPremium());
  569. this.jypremium = BigDecimal.valueOf(quoteRespVo.getJyPremium());
  570. this.taxamount = BigDecimal.valueOf(quoteRespVo.getTaxAmount());
  571. this.sumpremium = BigDecimal.valueOf(quoteRespVo.getSumPermium());
  572. this.accidentInfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getAccidentInfo()));
  573. this.riskinfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getRiskList()));
  574. this.kindinfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getKindList()));
  575. this.orderstatus = InsOrderStatusEnum.QUOTE_ING.getCode();
  576. this.jqStartDate = quoteRespVo.getStartDateJq();
  577. this.jqEndDate = quoteRespVo.getEndDateJq();
  578. this.syStartDate = quoteRespVo.getStartDateSy();
  579. this.syEndDate = quoteRespVo.getEndDateSy();
  580. this.accidentStrInfo = quoteRespVo.getAccidentInfoStr();
  581. // 评分
  582. this.score = quoteRespVo.getILogPreUdwMess();
  583. this.jqScore = quoteRespVo.getJqScore();
  584. this.syScore = quoteRespVo.getSyScore();
  585. // 赔付率
  586. this.lossRation = quoteRespVo.getLossRation();
  587. this.jqLossRation = quoteRespVo.getJqLossRation();
  588. this.syLossRation = quoteRespVo.getSyLossRation();
  589. this.mergeCostRate = quoteRespVo.getMergeCostRate();
  590. // 保单号
  591. this.jqapplyno = quoteRespVo.getJqApplyNo();
  592. this.syapplyno = quoteRespVo.getSyApplyNo();
  593. // 折扣率
  594. this.totalAdjustRate = quoteRespVo.getTotalAdjustRate();
  595. this.jqAdjustRate = StringUtils.parseDouble(quoteRespVo.getJqAdjustRate());
  596. this.syAdjustRate = StringUtils.parseDouble(quoteRespVo.getSyAdjustRate());
  597. this.jqRenewal = StringUtils.isEmpty(quoteRespVo.getJqRenewal()) ? null : quoteRespVo.getJqRenewal();
  598. this.syRenewal = StringUtils.isEmpty(quoteRespVo.getSyRenewal()) ? null : quoteRespVo.getSyRenewal();
  599. if (StringUtils.isNotEmpty(quoteRespVo.getJqClaims())) {
  600. this.jqClaims = quoteRespVo.getJqClaims();
  601. }
  602. if (StringUtils.isNotEmpty(quoteRespVo.getSyClaims())) {
  603. this.syClaims = quoteRespVo.getSyClaims();
  604. }
  605. if (StringUtils.isNotEmpty(quoteRespVo.getIszdj())) {
  606. this.isDjq = quoteRespVo.getIszdj();
  607. }
  608. if(StringUtils.isNotBlank(quoteRespVo.getInitialProposalDiscount())
  609. && StringUtils.isNotBlank(quoteRespVo.getExpectedDiscount())){
  610. JSONObject discountJson = new JSONObject();
  611. discountJson.put("initDiscount", quoteRespVo.getInitialProposalDiscount());
  612. discountJson.put("hopeDiscount", quoteRespVo.getExpectedDiscount());
  613. discountJson.put("hopeCoefficient", quoteRespVo.getPricingCoefficient());
  614. this.extendInfo = discountJson.toJSONString();
  615. }
  616. }
  617. public void setPaymentLink(String paymentLink) {
  618. // this.signingTime = LocalDateTime.now();
  619. this.paymentLink = paymentLink;
  620. }
  621. }