InsAreaCompany.java 13 KB

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