InsAreaCompany.java 16 KB

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