修改
This commit is contained in:
@ -49,4 +49,6 @@ public class MemberUserRespVO extends MemberUserBaseVO {
|
||||
@Schema(description = "用户经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "绑定卡号")
|
||||
private String cardId;
|
||||
}
|
||||
|
@ -46,13 +46,13 @@ public class AppOrderRespVO {
|
||||
private List<AppOrderDetailRespVO> detailList;
|
||||
|
||||
@Schema(description = "推荐摄入量")
|
||||
private Double proposeIntake;
|
||||
private BigDecimal proposeIntake;
|
||||
|
||||
@Schema(description = "摄入量")
|
||||
private Double intake;
|
||||
private BigDecimal intake;
|
||||
|
||||
@Schema(description = "差值")
|
||||
private Double difference;
|
||||
private BigDecimal difference;
|
||||
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.orderdetail.OrderDetailDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -15,10 +16,10 @@ import java.util.List;
|
||||
public class AppNutritionDayVo {
|
||||
|
||||
@Schema(description = "摄入量", example = "24217")
|
||||
private Double intake;
|
||||
private BigDecimal intake;
|
||||
|
||||
@Schema(description = "推荐摄入量", example = "赵六")
|
||||
private Double proposeIntake;
|
||||
private BigDecimal proposeIntake;
|
||||
|
||||
@Schema(description = "时间段(1-早,2-中,3-晚)")
|
||||
private String timePeriod;
|
||||
|
@ -90,9 +90,9 @@ public class CustomerTrafficServiceImpl implements CustomerTrafficService {
|
||||
public List<CustomerTrafficDO> getData(Long storeId) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<CustomerTrafficDO> customerTrafficDOS = customerTrafficMapper.selectList(Wrappers.<CustomerTrafficDO>lambdaQuery()
|
||||
.lt(CustomerTrafficDO::getCreateTime, now)
|
||||
//.lt(CustomerTrafficDO::getCreateTime, now)
|
||||
.eq(storeId!=null,CustomerTrafficDO::getStoreId,storeId)
|
||||
.orderByDesc(CustomerTrafficDO::getCustomerNum)
|
||||
.orderByDesc(CustomerTrafficDO::getCreateTime)
|
||||
.last("limit 7"));
|
||||
return customerTrafficDOS;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
List<AppOrderDetailRespVO> appOrderDetailRespVOS = orderDetailService.selectListByOrderId(id);
|
||||
appOrderRespVO.setDetailList(appOrderDetailRespVOS);
|
||||
BigDecimal reduce1 = appOrderDetailRespVOS.stream().filter(heat -> ObjUtil.isNotEmpty(heat.getHeat())).map(m-> BigDecimal.valueOf(m.getHeat())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Double reduce= reduce1.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
BigDecimal reduce = reduce1.setScale(2, RoundingMode.HALF_UP);
|
||||
appOrderRespVO.setIntake(reduce);
|
||||
//判断时间
|
||||
int hour = order.getCreateTime().getHour();
|
||||
|
@ -426,10 +426,10 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
if(CollectionUtil.isNotEmpty(moIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(moIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream()
|
||||
BigDecimal reduce = orderDetailDOS.stream()
|
||||
.filter(f-> ObjectUtil.isNotEmpty(f.getHeat()))
|
||||
.map(m->BigDecimal.valueOf(m.getHeat()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_MORNING);
|
||||
appNutritionDayVo.setTimePeriod("1");
|
||||
@ -439,10 +439,10 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
if(CollectionUtil.isNotEmpty(miIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(miIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream()
|
||||
BigDecimal reduce = orderDetailDOS.stream()
|
||||
.filter(f-> ObjectUtil.isNotEmpty(f.getHeat()))
|
||||
.map(m->BigDecimal.valueOf(m.getHeat()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NOON);
|
||||
appNutritionDayVo.setTimePeriod("2");
|
||||
@ -452,10 +452,10 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
if(CollectionUtil.isNotEmpty(niIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(niIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream()
|
||||
BigDecimal reduce = orderDetailDOS.stream()
|
||||
.filter(f-> ObjectUtil.isNotEmpty(f.getHeat()))
|
||||
.map(m->BigDecimal.valueOf(m.getHeat()))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NIGHT);
|
||||
appNutritionDayVo.setTimePeriod("3");
|
||||
|
@ -72,15 +72,15 @@ public class MemberConstants {
|
||||
/**
|
||||
* 早餐推荐摄入量
|
||||
*/
|
||||
public static final Double PROPOSE_MORNING = 400D;
|
||||
public static final BigDecimal PROPOSE_MORNING = new BigDecimal("400");
|
||||
|
||||
/**
|
||||
* 午餐推荐摄入量
|
||||
*/
|
||||
public static final Double PROPOSE_NOON = 800D;
|
||||
public static final BigDecimal PROPOSE_NOON = new BigDecimal("800");
|
||||
|
||||
/**
|
||||
* 晚餐推荐摄入量
|
||||
*/
|
||||
public static final Double PROPOSE_NIGHT = 400D;
|
||||
public static final BigDecimal PROPOSE_NIGHT = new BigDecimal("400");
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<select id="selectUser" resultType="integer">
|
||||
select count(distinct user_id) from member_dish_order where
|
||||
select count(distinct user_id) from member_dish_order
|
||||
<where>
|
||||
<if test="time != null and time !=''">
|
||||
date_format(create_time,'%Y-%m-%d') = #{time}
|
||||
|
Reference in New Issue
Block a user