feat: 增加查询图片统计功能
parent
f88a5c6c22
commit
9473fea643
@ -0,0 +1,31 @@
|
|||||||
|
package com.shxy.xymanager_common.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatChannel {
|
||||||
|
Integer channelId;
|
||||||
|
List<StatPreset> presets;
|
||||||
|
|
||||||
|
public void addPhoto(TerminalPhotoSelectListModel.PhotoBean photo) {
|
||||||
|
if (presets == null) {
|
||||||
|
presets = new ArrayList<>();
|
||||||
|
}
|
||||||
|
StatPreset the = null;
|
||||||
|
for (StatPreset item : presets) {
|
||||||
|
if (item.getPresetId().intValue() == photo.getPresetId().intValue()) {
|
||||||
|
the = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (the == null) {
|
||||||
|
the = new StatPreset();
|
||||||
|
the.setPresetId(photo.getPresetId());
|
||||||
|
presets.add(the);
|
||||||
|
}
|
||||||
|
the.addPhoto(photo);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.shxy.xymanager_common.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatPreset {
|
||||||
|
Integer presetId;
|
||||||
|
List<Date> photoTimes;
|
||||||
|
|
||||||
|
public void addPhoto(TerminalPhotoSelectListModel.PhotoBean photo) {
|
||||||
|
if (photoTimes == null) {
|
||||||
|
photoTimes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
photoTimes.add(photo.getPhotoTime());
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,35 @@
|
|||||||
package com.shxy.xymanager_common.model;
|
package com.shxy.xymanager_common.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@Data
|
@Data
|
||||||
public class StatTerm {
|
public class StatTerm {
|
||||||
int termId;
|
int termId;
|
||||||
Object uploads;
|
Object uploads;
|
||||||
|
String cmdid;
|
||||||
|
List<StatChannel> channels;
|
||||||
|
|
||||||
|
public void addPhoto(TerminalPhotoSelectListModel.PhotoBean photo) {
|
||||||
|
if (channels == null) {
|
||||||
|
channels = new ArrayList<>();
|
||||||
|
}
|
||||||
|
StatChannel the = null;
|
||||||
|
for (StatChannel item : channels) {
|
||||||
|
if (item.getChannelId().intValue() == photo.getChannelid().intValue()) {
|
||||||
|
the = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (the == null) {
|
||||||
|
the = new StatChannel();
|
||||||
|
the.setChannelId(photo.getChannelid());
|
||||||
|
channels.add(the);
|
||||||
|
}
|
||||||
|
the.addPhoto(photo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue