PtlAgreementAttribution.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package com.ydtech.modules.protocol.entity.po;
  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.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
  9. import lombok.*;
  10. import java.io.Serializable;
  11. /**
  12. * 协议归属信息
  13. *
  14. * @TableName ptl_agreement_attribution
  15. */
  16. @TableName(value = "ptl_agreement_attribution", autoResultMap = true)
  17. @Data
  18. @ToString
  19. @EqualsAndHashCode
  20. @AllArgsConstructor
  21. @NoArgsConstructor
  22. public class PtlAgreementAttribution implements Serializable {
  23. /**
  24. * 协议id
  25. */
  26. @TableId(value = "id")
  27. private String id;
  28. /**
  29. * 保险公司ID
  30. */
  31. @TableField(value = "ins_company_id")
  32. private String insCompanyId;
  33. /**
  34. * 保险公司名称
  35. */
  36. @TableField(value = "ins_company_name")
  37. private String insCompanyName;
  38. /**
  39. * 模板id
  40. */
  41. @TableField(value = "template_id")
  42. private String templateId;
  43. /**
  44. * api类型(1、api对接,2、python对接)
  45. */
  46. @TableField(value = "api_type")
  47. private Integer apiType;
  48. /**
  49. * 字段集
  50. */
  51. @TableField(value = "fields", typeHandler = FastjsonTypeHandler.class)
  52. private JSONArray fields;
  53. /**
  54. * 保险公司账号
  55. */
  56. @TableField(value = "username")
  57. private String username;
  58. /**
  59. * 保险公司密码
  60. */
  61. @TableField(value = "password")
  62. private String password;
  63. @TableField(exist = false)
  64. private static final long serialVersionUID = 1L;
  65. public PtlAgreementAttribution(String agreementId, String insCompanyId, String insCompanyName, PtlAgreementAttributionDto ptlAgreementAttributionDto) {
  66. this.id = agreementId;
  67. this.insCompanyId = insCompanyId;
  68. this.insCompanyName = insCompanyName;
  69. this.templateId = ptlAgreementAttributionDto.getTemplateId();
  70. this.apiType = ptlAgreementAttributionDto.getApiType();
  71. this.fields = JSON.parseArray(JSON.toJSONString(ptlAgreementAttributionDto.getFields()));
  72. this.username = ptlAgreementAttributionDto.getUsername();
  73. this.password = ptlAgreementAttributionDto.getPassword();
  74. }
  75. public PtlAgreementAttribution(PtlInsAttributionTemplate ptlInsAttributionTemplate) {
  76. this.id = ptlInsAttributionTemplate.getId();
  77. this.insCompanyId = ptlInsAttributionTemplate.getInsCompanyId();
  78. this.insCompanyName = ptlInsAttributionTemplate.getInsCompanyName();
  79. this.templateId = ptlInsAttributionTemplate.getId();
  80. this.apiType = ptlInsAttributionTemplate.getApiType();
  81. this.fields = ptlInsAttributionTemplate.getFields();
  82. }
  83. }