InsAreaCompany.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. package com.ydtech.modules.order.entity;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONArray;
  4. import com.baomidou.mybatisplus.annotation.TableField;
  5. import com.baomidou.mybatisplus.annotation.TableId;
  6. import com.baomidou.mybatisplus.annotation.TableName;
  7. import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
  8. import com.fasterxml.jackson.annotation.JsonFormat;
  9. import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
  10. import com.ydtech.modules.ins.model.vo.QuoteKindRespVo;
  11. import com.ydtech.modules.ins.model.vo.QuoteRespVo;
  12. import com.ydtech.modules.ins.model.vo.QuoteRiskRespVo;
  13. import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
  14. import com.ydtech.utils.StringUtils;
  15. import com.ydtech.utils.idgen.IdGenerate;
  16. import io.swagger.annotations.ApiModel;
  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. import java.util.List;
  25. /**
  26. * 报价渠道
  27. *
  28. * @TableName ins_area_company
  29. */
  30. @TableName(value = "ins_area_company", autoResultMap = true)
  31. @Data
  32. @ApiModel(value = "报价渠道")
  33. @NoArgsConstructor
  34. @AllArgsConstructor
  35. public class InsAreaCompany implements Serializable {
  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 = "jqapplyno")
  77. private String jqapplyno;
  78. /**
  79. * 交强保单号
  80. */
  81. @TableField(value = "jqpolicyno")
  82. private String jqpolicyno;
  83. /**
  84. * 商业投保单号
  85. */
  86. @TableField(value = "syapplyno")
  87. private String syapplyno;
  88. /**
  89. * 商业保单号
  90. */
  91. @TableField(value = "sypolicyno")
  92. private String sypolicyno;
  93. /**
  94. * 交叉销售保单信息
  95. */
  96. @TableField(value = "cross_insurance", typeHandler = FastjsonTypeHandler.class)
  97. private JSONArray crossInsurance;
  98. /**
  99. * 驾意险
  100. */
  101. @TableField(value = "accident_info", typeHandler = FastjsonTypeHandler.class)
  102. private JSONArray accidentInfo;
  103. /**
  104. * 交强险费用
  105. */
  106. @TableField(value = "jqpremium")
  107. private BigDecimal jqpremium;
  108. /**
  109. * 商业险费用
  110. */
  111. @TableField(value = "sypremium")
  112. private BigDecimal sypremium;
  113. /**
  114. * 驾意险
  115. */
  116. @TableField(value = "jypremium")
  117. private BigDecimal jypremium;
  118. /**
  119. * 车船税费用
  120. */
  121. @TableField(value = "taxamount")
  122. private BigDecimal taxamount;
  123. /**
  124. * 总保费
  125. */
  126. @TableField(value = "sumpremium")
  127. private BigDecimal sumpremium;
  128. /**
  129. * 交强优惠比例
  130. */
  131. @TableField(value = "jqdiscountrate")
  132. private Double jqdiscountrate;
  133. /**
  134. * 商业优惠比例
  135. */
  136. @TableField(value = "sydiscountrate")
  137. private Double sydiscountrate;
  138. /**
  139. * 交强手续费比例
  140. */
  141. @TableField(value = "feerate")
  142. private Double feerate;
  143. /**
  144. * 商业手续费比例
  145. */
  146. @TableField(value = "disrate")
  147. private Double disrate;
  148. /**
  149. * 核保人
  150. */
  151. @TableField(value = "auditid")
  152. private String auditid;
  153. /**
  154. * 核保人姓名
  155. */
  156. @TableField(value = "auditname")
  157. private String auditname;
  158. /**
  159. * 核保时间
  160. */
  161. @TableField(value = "audittime")
  162. private LocalDateTime audittime;
  163. /**
  164. * 核保意见
  165. */
  166. @TableField(value = "auditopinion")
  167. private String auditopinion;
  168. /**
  169. * 交强特别约定
  170. */
  171. @TableField(value = "jqappoint")
  172. private String jqappoint;
  173. /**
  174. * 商业特别约定
  175. */
  176. @TableField(value = "syappoint")
  177. private String syappoint;
  178. /**
  179. * 创建时间
  180. */
  181. @TableField(value = "createtime")
  182. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  183. private LocalDateTime createtime;
  184. /**
  185. * 支付链接
  186. */
  187. @TableField(value = "payment_link")
  188. private String paymentLink;
  189. /**
  190. * 支付时间
  191. */
  192. @TableField(value = "pay_date")
  193. private LocalDateTime payDate;
  194. /**
  195. * 签单时间(支付二维生成时间)
  196. */
  197. @TableField(value = "signing_time")
  198. private LocalDateTime signingTime;
  199. /**
  200. * 保险公司订单号
  201. * lig 新增字段 2023-02-24
  202. */
  203. @TableField(value = "ins_order_no")
  204. private String insOrderNo;
  205. /**
  206. *
  207. */
  208. @TableField(value = "attribution_id")
  209. private String attributionId;
  210. /**
  211. * 欠税
  212. */
  213. @TableField(exist = false, typeHandler = FastjsonTypeHandler.class)
  214. private JSONArray taxArrears;
  215. /**
  216. * 交强险起期
  217. * lig 新增字段 2023-09-14
  218. */
  219. @TableField(value = "jq_start_date")
  220. private String jqStartDate;
  221. /**
  222. * 交强险止期
  223. * lig 新增字段 2023-09-14
  224. */
  225. @TableField(value = "jq_end_date")
  226. private String jqEndDate;
  227. /**
  228. * 商业险起期
  229. * lig 新增字段 2023-09-14
  230. */
  231. @TableField(value = "sy_start_date")
  232. private String syStartDate;
  233. /**
  234. * 商业险止期
  235. * lig 新增字段 2023-09-14
  236. */
  237. @TableField(value = "sy_end_date")
  238. private String syEndDate;
  239. /**
  240. * 出险 字符串 信息
  241. * lig 新增字段 2023-10-10
  242. */
  243. @TableField(value = "accident_str_info")
  244. private String accidentStrInfo;
  245. /**
  246. * 评分
  247. * lig 新增字段 2023-10-10
  248. */
  249. @TableField(value = "score")
  250. private String score;
  251. /**
  252. * 交强类型评分
  253. */
  254. @TableField(value = "jq_score")
  255. private String jqScore;
  256. /**
  257. * 商业类型评分
  258. */
  259. @TableField(value = "sy_score")
  260. private String syScore;
  261. /**
  262. * 总赔付率
  263. */
  264. @TableField(value = "loss_ration")
  265. private double lossRation;
  266. /**
  267. * 交强赔付率
  268. */
  269. @TableField(value = "jq_loss_ration")
  270. private double jqLossRation;
  271. /**
  272. * 商业赔付率
  273. */
  274. @TableField(value = "sy_loss_ration")
  275. private double syLossRation;
  276. /**
  277. * 总折扣率
  278. */
  279. @TableField(value = "total_adjust_rate")
  280. private double totalAdjustRate;
  281. /**
  282. * 交强险折扣
  283. */
  284. @TableField(value = "jq_adjust_rate")
  285. private double jqAdjustRate;
  286. /**
  287. * 商业险折扣
  288. */
  289. @TableField(value = "sy_adjust_rate")
  290. private double syAdjustRate;
  291. /**
  292. * 业务员
  293. */
  294. @TableField(exist = false)
  295. private String userName;
  296. /**
  297. * 业务员ID
  298. */
  299. @TableField(exist = false)
  300. private String userId;
  301. @TableField(value = "inside_order_status")
  302. private Integer insideOrderStatus;
  303. @TableField(value = "inside_pay_time")
  304. private String insidePayTime;
  305. /**
  306. * 车辆信息
  307. */
  308. @TableField(exist = false)
  309. private InsAreaCompanyCarInfo carinfo;
  310. /**
  311. * 车主信息
  312. */
  313. @TableField(exist = false)
  314. private InsAreaCompanyCarUserInfo ownerInfo;
  315. /**
  316. * 投保人信息
  317. */
  318. @TableField(exist = false)
  319. private InsAreaCompanyCarUserInfo applyInfo;
  320. /**
  321. * 被保人信息
  322. */
  323. @TableField(exist = false)
  324. private InsAreaCompanyCarUserInfo insureInfo;
  325. /**
  326. * 保险信息
  327. */
  328. @TableField(exist = false)
  329. private List<InsAreaCompanyRisk> risk;
  330. /**
  331. * 商业险信息
  332. */
  333. @TableField(exist = false)
  334. private List<InsAreaCompanyKing> king;
  335. /**
  336. * 欠税信息
  337. */
  338. @TableField(exist = false)
  339. private InsAreaCompanyTaxArrears taxArrearsInfo;
  340. @TableField(exist = false)
  341. private static final long serialVersionUID = 1L;
  342. /**
  343. * 紫金能源车(鼎然-车辆风险评分 add by hxl 2024-04-09
  344. */
  345. @TableField(value = "ubi_predicted_info_score")
  346. private String ubiPredictedInfoScore;
  347. /**
  348. * 添加操作人
  349. */
  350. @TableField(value = "operator_id")
  351. private String operatorId;
  352. /**
  353. * 操作时间
  354. */
  355. @TableField(value = "operator_time")
  356. private Date operatorTime;
  357. /**
  358. * 添加操作人
  359. */
  360. @TableField(value = "operator_name")
  361. private String operatorName;
  362. public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
  363. this.id = IdGenerate.nextId();
  364. this.orderno = quoteRespVo.getOrderno();
  365. this.agreementId = ptlAgreementAttribution.getId();
  366. this.apiType = ptlAgreementAttribution.getApiType();
  367. this.companyId = ptlAgreementAttribution.getInsCompanyId();
  368. this.inscompany = ptlAgreementAttribution.getInsCompanyName();
  369. this.jqpremium = BigDecimal.valueOf(quoteRespVo.getJqPremium());
  370. this.sypremium = BigDecimal.valueOf(quoteRespVo.getSyPremium());
  371. this.jypremium = BigDecimal.valueOf(quoteRespVo.getJyPremium());
  372. this.taxamount = BigDecimal.valueOf(quoteRespVo.getTaxAmount());
  373. this.sumpremium = BigDecimal.valueOf(quoteRespVo.getSumPermium());
  374. this.accidentInfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getAccidentInfo()));
  375. this.orderstatus = InsOrderStatusEnum.QUOTE_ING.getCode();
  376. this.jqStartDate = quoteRespVo.getStartDateJq();
  377. this.jqEndDate = quoteRespVo.getEndDateJq();
  378. this.syStartDate = quoteRespVo.getStartDateSy();
  379. this.syEndDate = quoteRespVo.getEndDateSy();
  380. this.accidentStrInfo = quoteRespVo.getAccidentInfoStr();
  381. // 评分
  382. this.score = quoteRespVo.getILogPreUdwMess();
  383. this.jqScore = quoteRespVo.getJqScore();
  384. this.syScore = quoteRespVo.getSyScore();
  385. // 赔付率
  386. this.lossRation = quoteRespVo.getLossRation();
  387. this.jqLossRation = quoteRespVo.getJqLossRation();
  388. this.syLossRation = quoteRespVo.getSyLossRation();
  389. // 保单号
  390. this.jqapplyno = quoteRespVo.getJqApplyNo();
  391. this.syapplyno = quoteRespVo.getSyApplyNo();
  392. // 折扣率
  393. this.totalAdjustRate = quoteRespVo.getTotalAdjustRate();
  394. this.jqAdjustRate = StringUtils.parseDouble(quoteRespVo.getJqAdjustRate()) ;
  395. this.syAdjustRate = StringUtils.parseDouble(quoteRespVo.getSyAdjustRate());
  396. }
  397. public void setPaymentLink(String paymentLink) {
  398. this.signingTime = LocalDateTime.now();
  399. this.paymentLink = paymentLink;
  400. }
  401. public List<QuoteKindRespVo> convertQuoteKindRespVo() {
  402. return JSON.parseArray(JSON.toJSONString(this.king), QuoteKindRespVo.class);
  403. }
  404. public List<QuoteRiskRespVo> convertQuoteRiskRespVo() {
  405. return JSON.parseArray(JSON.toJSONString(this.risk), QuoteRiskRespVo.class);
  406. }
  407. public void setCarUserInfo(){
  408. }
  409. }