Plan.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. package com.ruoyi.demo.entity;
  2. import cn.hutool.core.date.DateUtil;
  3. import com.baomidou.mybatisplus.annotation.IdType;
  4. import com.baomidou.mybatisplus.annotation.TableField;
  5. import com.baomidou.mybatisplus.annotation.TableId;
  6. import com.baomidou.mybatisplus.annotation.TableName;
  7. import com.fasterxml.jackson.annotation.JsonFormat;
  8. import com.ruoyi.demo.entity.bo.PlanAddBo;
  9. import com.ruoyi.demo.utils.OnStateUtil;
  10. import com.ruoyi.demo.utils.StateUtil;
  11. import lombok.Data;
  12. import java.math.BigDecimal;
  13. import java.util.Date;
  14. @Data
  15. @TableName("dl_plan")
  16. public class Plan {
  17. @TableId(value = "plan_id",type = IdType.ASSIGN_ID)
  18. private String planId;
  19. @TableField("plan_other_id")
  20. private String planOtherId;
  21. @TableField("plan_name")
  22. private String planName;
  23. @TableField("commercial_id")
  24. private String commercialId;
  25. @TableField("commercial_name")
  26. private String commercialName;
  27. @TableField("appkey")
  28. private String appkey;
  29. @TableField("app_name")
  30. private String appName;
  31. @TableField("vendor_id")
  32. private String vendorId;
  33. @TableField("vendor_name")
  34. private String vendorName;
  35. @TableField("goods_id")
  36. private String goodsId;
  37. @TableField("goods_img")
  38. private String goodsImg;
  39. @TableField("goods_name")
  40. private String goodsName;
  41. @TableField("goods_logo")
  42. private String goodsLogo;
  43. @TableField("goods_introduce")
  44. private String goodsIntroduce;
  45. @TableField("goods_price")
  46. private BigDecimal goodsPrice;
  47. @TableField("goods_classify")
  48. private String goodsClassify;
  49. @TableField("template")
  50. private String template;
  51. @TableField("plan_create_time")
  52. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  53. private Date planCreateTime;
  54. @TableField("plan_start_time")
  55. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  56. private Date planStartTime;
  57. @TableField("plan_end_time")
  58. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  59. private Date planEndTime;
  60. @TableField("audit_time")
  61. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  62. private Date auditTime;
  63. @TableField("state")
  64. private Integer state;
  65. @TableField("on_state")
  66. private Integer onState;
  67. @TableField("principal_name")
  68. private String principalName;
  69. @TableField("principal_telephone")
  70. private String principalTelephone;
  71. @TableField("deleted")
  72. private int deleted;
  73. public Plan(){}
  74. public Plan(App app, PlanAddBo bo){
  75. this.planOtherId = bo.getPlanOtherId();
  76. this.commercialId = app.getCommercialId();
  77. this.commercialName = app.getCommercialName();
  78. this.appkey = app.getAppkey();
  79. this.appName = app.getAppName();
  80. this.planName = bo.getPlanName();
  81. this.vendorId = bo.getVendorId();
  82. this.vendorName = bo.getVendorName();
  83. this.goodsId = bo.getGoodsId();
  84. this.goodsImg = bo.getGoodsImg();
  85. this.goodsName = bo.getGoodsName();
  86. this.goodsLogo = bo.getGoodsLogo();
  87. this.goodsPrice = bo.getGoodsPrice();
  88. this.goodsIntroduce = bo.getGoodsIntroduce();
  89. this.goodsClassify = bo.getGoodsClassify();
  90. this.template = bo.getTemplate();
  91. this.planCreateTime = DateUtil.date();
  92. this.planStartTime = bo.getPlanStartTime();
  93. this.planEndTime = bo.getPlanEndTime();
  94. this.state = StateUtil.NOT_AUDITED;
  95. this.onState = OnStateUtil.UP;
  96. this.principalName = bo.getPrincipalName();
  97. this.principalTelephone = bo.getPrincipalTelephone();
  98. }
  99. }