InsAreaCompany.java 11 KB

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