InsAreaCompany.java 16 KB

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