package com.fdkankan.manage.vo.request; import com.fdkankan.manage.util.DateUtils; import com.fdkankan.manage.util.FiledUtil; import jodd.util.StringUtil; import lombok.Data; import java.util.ArrayList; import java.util.List; @Data public class SceneParam extends RequestBase { private String num; private String sceneName; //场景标题 private String snCode; //sn码 private String userName; //绑定账号 private Integer type = 0; //0 看看,1看见,2深时 private Integer companyId; private List snCodes; private List timeList; private String startTime; private String endTime; private String field; private String order; private List cameraIds; private List userIds; private List shootCounts; private Integer shootCountMin; private Integer shootCountMax; private List locations; private List numList = new ArrayList<>(); public String getStartTime() { if(timeList != null && timeList.size() >1){ return DateUtils.getStartTime(timeList.get(0)); } return DateUtils.getStartTime(startTime); } public String getEndTime() { if(timeList != null && timeList.size() >1){ return DateUtils.getEndTime(timeList.get(1)); } return DateUtils.getEndTime(endTime); } public String getField() { if(StringUtil.isNotBlank(field)){ return FiledUtil.upperCharToUnderLine(field); } return "create_time"; } public String getOrder() { if(StringUtil.isNotBlank(order) && order.contains("end")){ return order.split("end")[0]; } return "DESC"; } public Integer getShootCountMin() { if(shootCounts != null && shootCounts.size() >1){ return shootCounts.get(0); } return shootCountMin; } public Integer getShootCountMax() { if(shootCounts != null && shootCounts.size() >1){ return shootCounts.get(1); } return shootCountMax; } }