InsAreaCompany.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. /**
  23. * 报价渠道
  24. *
  25. * @TableName ins_area_company
  26. */
  27. @TableName(value = "ins_area_company", autoResultMap = true)
  28. @Data
  29. @ApiModel(value = "报价渠道")
  30. @NoArgsConstructor
  31. @AllArgsConstructor
  32. public class InsAreaCompany implements Serializable {
  33. /**
  34. * 主键
  35. */
  36. @TableId(value = "id")
  37. private String id;
  38. /**
  39. * 订单号
  40. */
  41. @TableField(value = "orderno")
  42. private String orderno;
  43. /**
  44. * 协议id
  45. */
  46. @TableField(value = "agreement_id")
  47. private String agreementId;
  48. /**
  49. * 请求类型
  50. */
  51. @TableField(value = "api_type")
  52. private Integer apiType;
  53. /**
  54. * 订单状态
  55. *
  56. * @see com.ydtech.constants.enums.dict.InsOrderStatusEnum
  57. */
  58. @TableField(value = "orderstatus")
  59. private String orderstatus;
  60. /**
  61. * 保险公司编号
  62. */
  63. @TableField(value = "company_id")
  64. private String companyId;
  65. /**
  66. * 保险名称
  67. */
  68. @TableField(value = "inscompany")
  69. private String inscompany;
  70. /**
  71. * 请求报文
  72. */
  73. @TableField(value = "reqtxt", typeHandler = FastjsonTypeHandler.class)
  74. private JSONObject reqtxt;
  75. /**
  76. * 响应报文
  77. */
  78. @TableField(value = "reptxt", typeHandler = FastjsonTypeHandler.class)
  79. private JSONObject reptxt;
  80. /**
  81. * 交强投保单号
  82. */
  83. @TableField(value = "jqapplyno")
  84. private String jqapplyno;
  85. /**
  86. * 交强保单号
  87. */
  88. @TableField(value = "jqpolicyno")
  89. private String jqpolicyno;
  90. /**
  91. * 商业投保单号
  92. */
  93. @TableField(value = "syapplyno")
  94. private String syapplyno;
  95. /**
  96. * 商业保单号
  97. */
  98. @TableField(value = "sypolicyno")
  99. private String sypolicyno;
  100. /**
  101. * 交叉销售保单信息
  102. */
  103. @TableField(value = "cross_insurance", typeHandler = FastjsonTypeHandler.class)
  104. private JSONArray crossInsurance;
  105. /**
  106. * 驾意险
  107. */
  108. @TableField(value = "accident_info", typeHandler = FastjsonTypeHandler.class)
  109. private JSONArray accidentInfo;
  110. /**
  111. * 交强险商业险
  112. */
  113. @TableField(value = "riskinfo", typeHandler = FastjsonTypeHandler.class)
  114. private JSONArray riskinfo;
  115. /**
  116. * 商业险信息
  117. */
  118. @TableField(value = "kindinfo", typeHandler = FastjsonTypeHandler.class)
  119. private JSONArray kindinfo;
  120. /**
  121. * 交强险费用
  122. */
  123. @TableField(value = "jqpremium")
  124. private BigDecimal jqpremium;
  125. /**
  126. * 商业险费用
  127. */
  128. @TableField(value = "sypremium")
  129. private BigDecimal sypremium;
  130. /**
  131. * 驾意险
  132. */
  133. @TableField(value = "jypremium")
  134. private BigDecimal jypremium;
  135. /**
  136. * 车船税费用
  137. */
  138. @TableField(value = "taxamount")
  139. private BigDecimal taxamount;
  140. /**
  141. * 总保费
  142. */
  143. @TableField(value = "sumpremium")
  144. private BigDecimal sumpremium;
  145. /**
  146. * 交强优惠比例
  147. */
  148. @TableField(value = "jqdiscountrate")
  149. private Double jqdiscountrate;
  150. /**
  151. * 商业优惠比例
  152. */
  153. @TableField(value = "sydiscountrate")
  154. private Double sydiscountrate;
  155. /**
  156. * 交强手续费比例
  157. */
  158. @TableField(value = "feerate")
  159. private Double feerate;
  160. /**
  161. * 商业手续费比例
  162. */
  163. @TableField(value = "disrate")
  164. private Double disrate;
  165. /**
  166. * 核保人
  167. */
  168. @TableField(value = "auditid")
  169. private String auditid;
  170. /**
  171. * 核保人姓名
  172. */
  173. @TableField(value = "auditname")
  174. private String auditname;
  175. /**
  176. * 核保时间
  177. */
  178. @TableField(value = "audittime")
  179. private LocalDateTime audittime;
  180. /**
  181. * 核保意见
  182. */
  183. @TableField(value = "auditopinion")
  184. private String auditopinion;
  185. /**
  186. * 交强特别约定
  187. */
  188. @TableField(value = "jqappoint")
  189. private String jqappoint;
  190. /**
  191. * 商业特别约定
  192. */
  193. @TableField(value = "syappoint")
  194. private String syappoint;
  195. /**
  196. * 创建时间
  197. */
  198. @TableField(value = "createtime")
  199. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  200. private LocalDateTime createtime;
  201. /**
  202. * 支付链接
  203. */
  204. @TableField(value = "payment_link")
  205. private String paymentLink;
  206. /**
  207. * 支付时间
  208. */
  209. @TableField(value = "pay_date")
  210. private LocalDateTime payDate;
  211. /**
  212. * 签单时间(支付二维生成时间)
  213. */
  214. @TableField(value = "signing_time")
  215. private LocalDateTime signingTime;
  216. /**
  217. * 保险公司订单号
  218. * lig 新增字段 2023-02-24
  219. */
  220. @TableField(value = "ins_order_no")
  221. private String insOrderNo;
  222. /**
  223. *
  224. */
  225. @TableField(value = "attribution_id")
  226. private String attributionId;
  227. /**
  228. * 欠税
  229. */
  230. @TableField(value = "tax_arrears", typeHandler = FastjsonTypeHandler.class)
  231. private JSONArray taxArrears;
  232. /**
  233. * 交强险起期
  234. * lig 新增字段 2023-09-14
  235. */
  236. @TableField(value = "jq_start_date")
  237. private String jqStartDate;
  238. /**
  239. * 交强险止期
  240. * lig 新增字段 2023-09-14
  241. */
  242. @TableField(value = "jq_end_date")
  243. private String jqEndDate;
  244. /**
  245. * 商业险起期
  246. * lig 新增字段 2023-09-14
  247. */
  248. @TableField(value = "sy_start_date")
  249. private String syStartDate;
  250. /**
  251. * 商业险止期
  252. * lig 新增字段 2023-09-14
  253. */
  254. @TableField(value = "sy_end_date")
  255. private String syEndDate;
  256. /**
  257. * 出险 字符串 信息
  258. * lig 新增字段 2023-10-10
  259. */
  260. @TableField(value = "accident_str_info")
  261. private String accidentStrInfo;
  262. /**
  263. * 评分
  264. * lig 新增字段 2023-10-10
  265. */
  266. @TableField(value = "score")
  267. private String score;
  268. /**
  269. * 交强类型评分
  270. */
  271. @TableField(value = "jq_score")
  272. private String jqScore;
  273. /**
  274. * 商业类型评分
  275. */
  276. @TableField(value = "sy_score")
  277. private String syScore;
  278. /**
  279. * 总赔付率
  280. */
  281. @TableField(value = "loss_ration")
  282. private double lossRation;
  283. /**
  284. * 交强赔付率
  285. */
  286. @TableField(value = "jq_loss_ration")
  287. private double jqLossRation;
  288. /**
  289. * 商业赔付率
  290. */
  291. @TableField(value = "sy_loss_ration")
  292. private double syLossRation;
  293. /**
  294. * 总折扣率
  295. */
  296. @TableField(value = "total_adjust_rate")
  297. private double totalAdjustRate;
  298. /**
  299. * 交强险折扣
  300. */
  301. @TableField(value = "jq_adjust_rate")
  302. private double jqAdjustRate;
  303. /**
  304. * 商业险折扣
  305. */
  306. @TableField(value = "sy_adjust_rate")
  307. private double syAdjustRate;
  308. /**
  309. * 业务员
  310. */
  311. @TableField(exist = false)
  312. private String userName;
  313. /**
  314. * 业务员ID
  315. */
  316. @TableField(exist = false)
  317. private String userId;
  318. @TableField(value = "inside_order_status")
  319. private Integer insideOrderStatus;
  320. @TableField(value = "inside_pay_time")
  321. private String insidePayTime;
  322. @TableField(exist = false)
  323. private static final long serialVersionUID = 1L;
  324. /**
  325. * 紫金能源车(鼎然-车辆风险评分 add by hxl 2024-04-09
  326. */
  327. @TableField(value = "ubi_predicted_info_score")
  328. private String ubiPredictedInfoScore;
  329. public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
  330. this.id = IdGenerate.nextId();
  331. this.orderno = quoteRespVo.getOrderno();
  332. this.agreementId = ptlAgreementAttribution.getId();
  333. this.apiType = ptlAgreementAttribution.getApiType();
  334. this.companyId = ptlAgreementAttribution.getInsCompanyId();
  335. this.inscompany = ptlAgreementAttribution.getInsCompanyName();
  336. this.jqpremium = BigDecimal.valueOf(quoteRespVo.getJqPremium());
  337. this.sypremium = BigDecimal.valueOf(quoteRespVo.getSyPremium());
  338. this.jypremium = BigDecimal.valueOf(quoteRespVo.getJyPremium());
  339. this.taxamount = BigDecimal.valueOf(quoteRespVo.getTaxAmount());
  340. this.sumpremium = BigDecimal.valueOf(quoteRespVo.getSumPermium());
  341. this.accidentInfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getAccidentInfo()));
  342. this.riskinfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getRiskList()));
  343. this.kindinfo = JSON.parseArray(JSON.toJSONString(quoteRespVo.getKindList()));
  344. this.orderstatus = InsOrderStatusEnum.QUOTE_ING.getCode();
  345. this.jqStartDate = quoteRespVo.getStartDateJq();
  346. this.jqEndDate = quoteRespVo.getEndDateJq();
  347. this.syStartDate = quoteRespVo.getStartDateSy();
  348. this.syEndDate = quoteRespVo.getEndDateSy();
  349. this.accidentStrInfo = quoteRespVo.getAccidentInfoStr();
  350. // 评分
  351. this.score = quoteRespVo.getILogPreUdwMess();
  352. this.jqScore = quoteRespVo.getJqScore();
  353. this.syScore = quoteRespVo.getSyScore();
  354. // 赔付率
  355. this.lossRation = quoteRespVo.getLossRation();
  356. this.jqLossRation = quoteRespVo.getJqLossRation();
  357. this.syLossRation = quoteRespVo.getSyLossRation();
  358. // 保单号
  359. this.jqapplyno = quoteRespVo.getJqApplyNo();
  360. this.syapplyno = quoteRespVo.getSyApplyNo();
  361. // 折扣率
  362. this.totalAdjustRate = quoteRespVo.getTotalAdjustRate();
  363. this.jqAdjustRate = StringUtils.parseDouble(quoteRespVo.getJqAdjustRate()) ;
  364. this.syAdjustRate = StringUtils.parseDouble(quoteRespVo.getSyAdjustRate());
  365. }
  366. public void setPaymentLink(String paymentLink) {
  367. this.signingTime = LocalDateTime.now();
  368. this.paymentLink = paymentLink;
  369. }
  370. }