|
|
@@ -9,6 +9,9 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
|
import com.alibaba.excel.annotation.ExcelProperty;
|
|
|
import com.ruoyi.clock.domain.Employee;
|
|
|
import com.ruoyi.clock.domain.bo.AgentBo;
|
|
|
+import com.ruoyi.clock.enums.ActivityStatusEnum;
|
|
|
+import com.ruoyi.clock.enums.ActivityTypeEnum;
|
|
|
+import com.ruoyi.clock.enums.ActivityUnitEnum;
|
|
|
import com.ruoyi.clock.service.IActivityAgentService;
|
|
|
import com.ruoyi.clock.service.IActivityProductService;
|
|
|
import com.ruoyi.clock.service.IAgentService;
|
|
|
@@ -24,6 +27,8 @@ import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
+import com.ruoyi.common.utils.converter.DateConverter;
|
|
|
+
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -59,20 +64,24 @@ public class ActivityVo extends BaseEntity {
|
|
|
/**
|
|
|
* 活动类型 0晒单打卡 1销售pk
|
|
|
*/
|
|
|
- @ExcelProperty(value = "活动类型 0晒单打卡 1销售pk")
|
|
|
@ApiModelProperty("活动类型 0晒单打卡 1销售pk")
|
|
|
private Integer type;
|
|
|
|
|
|
+ @ExcelProperty(value = "活动类型")
|
|
|
+ @ApiModelProperty("活动类型 0晒单打卡 1销售pk")
|
|
|
+ @ExcelDictFormat(readConverterExp = "0=晒单打卡,1=销售pk")
|
|
|
+ private String typeStr;
|
|
|
+
|
|
|
@ApiModelProperty(value = "代理商信息", required = true)
|
|
|
private List<AgentVo> agentList;
|
|
|
|
|
|
- @ExcelProperty(value = "代理商名称")
|
|
|
+ @ExcelProperty(value = "代理商")
|
|
|
private String agentName;
|
|
|
|
|
|
/**
|
|
|
* 开始日期
|
|
|
*/
|
|
|
- @ExcelProperty(value = "开始日期")
|
|
|
+ @ExcelProperty(value = "开始日期",converter = DateConverter.class)
|
|
|
@ApiModelProperty("开始日期")
|
|
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
|
@@ -81,7 +90,7 @@ public class ActivityVo extends BaseEntity {
|
|
|
/**
|
|
|
* 结束日期
|
|
|
*/
|
|
|
- @ExcelProperty(value = "结束日期")
|
|
|
+ @ExcelProperty(value = "结束日期",converter = DateConverter.class)
|
|
|
@ApiModelProperty("结束日期")
|
|
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
|
@@ -90,7 +99,7 @@ public class ActivityVo extends BaseEntity {
|
|
|
@ApiModelProperty(value = "代理商信息", required = true)
|
|
|
private List<ProductVo> productList;
|
|
|
|
|
|
- @ExcelProperty(value = "产品信息")
|
|
|
+ @ExcelProperty(value = "产品名称")
|
|
|
private String productName;
|
|
|
|
|
|
/**
|
|
|
@@ -101,16 +110,17 @@ public class ActivityVo extends BaseEntity {
|
|
|
@FilePathValue
|
|
|
private List<String> image;
|
|
|
|
|
|
- @ExcelProperty(value = "图片信息")
|
|
|
private String imageUrl;
|
|
|
|
|
|
/**
|
|
|
* 单位 0 盒 1 支
|
|
|
*/
|
|
|
- @ExcelProperty(value = "单位 0 盒 1 支")
|
|
|
@ApiModelProperty("单位 0 盒 1 支")
|
|
|
private Integer unit;
|
|
|
|
|
|
+ @ExcelProperty(value = "单位")
|
|
|
+ private String unitStr;
|
|
|
+
|
|
|
/**
|
|
|
* 活动规则
|
|
|
*/
|
|
|
@@ -128,10 +138,12 @@ public class ActivityVo extends BaseEntity {
|
|
|
/**
|
|
|
* 活动状态 0正常 1停用
|
|
|
*/
|
|
|
- @ExcelProperty(value = "活动状态 0正常 1停用")
|
|
|
@ApiModelProperty("活动状态 0正常 1停用")
|
|
|
private Integer status;
|
|
|
|
|
|
+ @ExcelProperty(value = "活动状态")
|
|
|
+ private String statusStr;
|
|
|
+
|
|
|
@ApiModelProperty("打卡次数")
|
|
|
private Long clockCount = 0l;
|
|
|
|
|
|
@@ -183,4 +195,18 @@ public class ActivityVo extends BaseEntity {
|
|
|
return this.clockCount;
|
|
|
}
|
|
|
|
|
|
+ public void convert(){
|
|
|
+ if (ObjectUtil.isNotNull(this.type)){
|
|
|
+ ActivityTypeEnum activityTypeEnum = ActivityTypeEnum.getByCode(this.type,ActivityTypeEnum.values());
|
|
|
+ this.typeStr = activityTypeEnum.getMsg();
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotNull(this.unit)){
|
|
|
+ ActivityUnitEnum activityUnitEnum = ActivityUnitEnum.getByCode(this.type,ActivityUnitEnum.values());
|
|
|
+ this.unitStr = activityUnitEnum.getMsg();
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotNull(this.status)){
|
|
|
+ ActivityStatusEnum activityStatusEnum = ActivityStatusEnum.getByCode(this.type,ActivityStatusEnum.values());
|
|
|
+ this.statusStr = activityStatusEnum.getMsg();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|