feat:超市大屏
This commit is contained in:
1 parent
b4d245250a
commit
02b841bd3c
14 files changed
+487
-222
No files matched your search
+3
-1
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PanelCanteenDto {
|
||||
public class PanelProductDto {
|
||||
|
||||
private DateRangeTypeEnum dateRangeType = DateRangeTypeEnum.YESTERDAY;
|
||||
|
||||
@@ -21,6 +21,8 @@ public class PanelCanteenDto {
|
||||
|
||||
private List<String> mchTypeCodes;
|
||||
|
||||
private String hourTypeIsNull;
|
||||
|
||||
private String hourType;
|
||||
|
||||
private Long limit;
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.hard;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PanelCanteenVo {
|
||||
|
||||
/**
|
||||
* 商品名
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 商家ID
|
||||
*/
|
||||
private Long mchId;
|
||||
|
||||
/**
|
||||
* 商家名称
|
||||
*/
|
||||
private String mchName;
|
||||
|
||||
/**
|
||||
* 用餐时间段(早中晚)
|
||||
*/
|
||||
private String hourType;
|
||||
|
||||
/**
|
||||
* 商品名
|
||||
*/
|
||||
private String productStr;
|
||||
|
||||
/**
|
||||
* 用餐人数
|
||||
*/
|
||||
private Long personCount;
|
||||
|
||||
/**
|
||||
* 购买次数
|
||||
*/
|
||||
private Long buyCount;
|
||||
|
||||
/**
|
||||
* 购买商品数量
|
||||
*/
|
||||
private Long buyProductCount;
|
||||
|
||||
/**
|
||||
* 购买总金额(分)
|
||||
*/
|
||||
private Long totalPrice;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 时间字符串
|
||||
*/
|
||||
private LocalDate timeStr;
|
||||
|
||||
/**
|
||||
* 周几
|
||||
*/
|
||||
private String weekStr;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int order;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class HourTypeItemVo {
|
||||
|
||||
private String type;
|
||||
|
||||
private String typeStr;
|
||||
|
||||
private List<PanelCanteenVo> list;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class HourTypeVo {
|
||||
|
||||
/**
|
||||
* 早
|
||||
*/
|
||||
private HourTypeItemVo morning;
|
||||
|
||||
/**
|
||||
* 中
|
||||
*/
|
||||
private HourTypeItemVo noon;
|
||||
|
||||
/**
|
||||
* 晚
|
||||
*/
|
||||
private HourTypeItemVo evening;
|
||||
}
|
||||
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.hard;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.DateRangeTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PanelPorductVo {
|
||||
|
||||
/**
|
||||
* 商品名
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 商家ID
|
||||
*/
|
||||
private Long mchId;
|
||||
|
||||
/**
|
||||
* 商家名称
|
||||
*/
|
||||
private String mchName;
|
||||
|
||||
/**
|
||||
* 用餐时间段(早中晚)
|
||||
*/
|
||||
private String hourType;
|
||||
|
||||
/**
|
||||
* 商品名
|
||||
*/
|
||||
private String productStr;
|
||||
|
||||
/**
|
||||
* 用餐人数
|
||||
*/
|
||||
private Long personCount;
|
||||
|
||||
/**
|
||||
* 购买次数
|
||||
*/
|
||||
private Long buyCount;
|
||||
|
||||
/**
|
||||
* 购买商品数量
|
||||
*/
|
||||
private Long buyProductCount;
|
||||
|
||||
/**
|
||||
* 购买总金额(分)
|
||||
*/
|
||||
private Long totalPrice;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 时间字符串
|
||||
*/
|
||||
private LocalDate timeStr;
|
||||
|
||||
/**
|
||||
* 周几
|
||||
*/
|
||||
private String weekStr;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int order;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class ProductTypeItemVo {
|
||||
|
||||
private String type;
|
||||
|
||||
private String typeStr;
|
||||
|
||||
private List<PanelPorductVo> list;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class HourTypeVo {
|
||||
|
||||
/**
|
||||
* 早
|
||||
*/
|
||||
private ProductTypeItemVo morning;
|
||||
|
||||
/**
|
||||
* 中
|
||||
*/
|
||||
private ProductTypeItemVo noon;
|
||||
|
||||
/**
|
||||
* 晚
|
||||
*/
|
||||
private ProductTypeItemVo evening;
|
||||
}
|
||||
|
||||
public static List<PanelPorductVo> generatePanelCanteenList(LocalDateTime[] totalTimeList, DateRangeTypeEnum dateRangeType) {
|
||||
List<PanelPorductVo> dateList = new LinkedList<>();
|
||||
LocalDate startTime = totalTimeList[0].toLocalDate();
|
||||
LocalDate endTime = totalTimeList[1].toLocalDate();
|
||||
LocalDate currentDate = startTime;
|
||||
while (!currentDate.isAfter(endTime)) {
|
||||
PanelPorductVo entity = new PanelPorductVo();
|
||||
entity.setPersonCount(0L);
|
||||
entity.setBuyCount(0L);
|
||||
entity.setBuyProductCount(0L);
|
||||
if (ObjectUtil.equals(dateRangeType, DateRangeTypeEnum.THIS_YEAR)) {
|
||||
entity.setTime(currentDate.withDayOfMonth(1));
|
||||
entity.setWeekStr("");
|
||||
} else {
|
||||
entity.setTime(currentDate);
|
||||
entity.setWeekStr(LocalDateTimeUtil.dayOfWeek(currentDate).toChinese());
|
||||
}
|
||||
dateList.add(entity);
|
||||
if (ObjectUtil.equals(dateRangeType, DateRangeTypeEnum.THIS_YEAR)) {
|
||||
currentDate = currentDate.plusMonths(1);
|
||||
} else {
|
||||
currentDate = currentDate.plusDays(1);
|
||||
}
|
||||
}
|
||||
return dateList;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user