常量
This commit is contained in:
@ -76,7 +76,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CARD_NOT_BIND = new ErrorCode(1_004_099_002, "请先绑定餐卡");
|
ErrorCode CARD_NOT_BIND = new ErrorCode(1_004_099_002, "请先绑定餐卡");
|
||||||
ErrorCode DINING_PLATES_NOT_BIND = new ErrorCode(1_004_099_003, "餐盘未绑定");
|
ErrorCode DINING_PLATES_NOT_BIND = new ErrorCode(1_004_099_003, "餐盘未绑定");
|
||||||
ErrorCode ORDER_ALREADY_COMPLETE = new ErrorCode(1_004_099_004, "该餐盘订单已完成,请重新绑定餐盘");
|
ErrorCode ORDER_ALREADY_COMPLETE = new ErrorCode(1_004_099_004, "该餐盘订单已完成,请重新绑定餐盘");
|
||||||
ErrorCode FACE_NOT_BIND_USER = new ErrorCode(1_004_099_005, "该人脸未绑定用户");
|
ErrorCode FACE_NOT_BIND_USER = new ErrorCode(1_004_099_005, "人脸未绑定");
|
||||||
ErrorCode CARD_NOT_BIND_USER = new ErrorCode(1_004_099_006, "该卡未绑定用户");
|
ErrorCode CARD_NOT_BIND_USER = new ErrorCode(1_004_099_006, "该卡未绑定用户");
|
||||||
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足30元,请充值");
|
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足30元,请充值");
|
||||||
ErrorCode CARD_ALREADY_BIND = new ErrorCode(1_004_099_008, "卡号已绑定");
|
ErrorCode CARD_ALREADY_BIND = new ErrorCode(1_004_099_008, "卡号已绑定");
|
||||||
|
@ -27,7 +27,6 @@ import cn.iocoder.yudao.module.system.api.carteen.dto.CarteenRespDto;
|
|||||||
import cn.iocoder.yudao.module.system.api.deviceInfo.DeviceInfoApi;
|
import cn.iocoder.yudao.module.system.api.deviceInfo.DeviceInfoApi;
|
||||||
import cn.iocoder.yudao.module.system.api.deviceInfo.dto.DeviceInfoDto;
|
import cn.iocoder.yudao.module.system.api.deviceInfo.dto.DeviceInfoDto;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -66,13 +65,6 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
@Resource
|
@Resource
|
||||||
private CarteenApi carteenApi;
|
private CarteenApi carteenApi;
|
||||||
|
|
||||||
@Value("${propose.morning}")
|
|
||||||
private Double proposeMorning;
|
|
||||||
@Value("${propose.noon}")
|
|
||||||
private Double proposeNoon;
|
|
||||||
@Value("${propose.night}")
|
|
||||||
private Double proposeNight;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createOrder(AppOrderSaveReqVO createReqVO) {
|
public Long createOrder(AppOrderSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@ -124,11 +116,11 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
//判断时间
|
//判断时间
|
||||||
int hour = order.getCreateTime().getHour();
|
int hour = order.getCreateTime().getHour();
|
||||||
if(TimePeriodEnum.MORNING.getStartInt()<=hour && hour<=TimePeriodEnum.MORNING.getEndInt()){
|
if(TimePeriodEnum.MORNING.getStartInt()<=hour && hour<=TimePeriodEnum.MORNING.getEndInt()){
|
||||||
appOrderRespVO.setProposeIntake(proposeMorning);
|
appOrderRespVO.setProposeIntake(MemberConstants.PROPOSE_MORNING);
|
||||||
} else if (TimePeriodEnum.MIDDAY.getStartInt()<=hour && hour<=TimePeriodEnum.MIDDAY.getEndInt()){
|
} else if (TimePeriodEnum.MIDDAY.getStartInt()<=hour && hour<=TimePeriodEnum.MIDDAY.getEndInt()){
|
||||||
appOrderRespVO.setProposeIntake(proposeNoon);
|
appOrderRespVO.setProposeIntake(MemberConstants.PROPOSE_NOON);
|
||||||
}else{
|
}else{
|
||||||
appOrderRespVO.setProposeIntake(proposeNight);
|
appOrderRespVO.setProposeIntake(MemberConstants.PROPOSE_NIGHT);
|
||||||
}
|
}
|
||||||
appOrderRespVO.setDifference(NumberUtil.sub(reduce,appOrderRespVO.getProposeIntake()));
|
appOrderRespVO.setDifference(NumberUtil.sub(reduce,appOrderRespVO.getProposeIntake()));
|
||||||
return appOrderRespVO;
|
return appOrderRespVO;
|
||||||
|
@ -6,7 +6,12 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.*;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
@ -51,7 +56,6 @@ import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -121,13 +125,6 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserExpandService userExpandService;
|
private UserExpandService userExpandService;
|
||||||
|
|
||||||
@Value("${propose.morning}")
|
|
||||||
private Double proposeMorning;
|
|
||||||
@Value("${propose.noon}")
|
|
||||||
private Double proposeNoon;
|
|
||||||
@Value("${propose.night}")
|
|
||||||
private Double proposeNight;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemberUserDO getUserByMobile(String mobile) {
|
public MemberUserDO getUserByMobile(String mobile) {
|
||||||
@ -434,7 +431,7 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||||||
.map(m->BigDecimal.valueOf(m.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).doubleValue();
|
||||||
appNutritionDayVo.setIntake(reduce);
|
appNutritionDayVo.setIntake(reduce);
|
||||||
appNutritionDayVo.setProposeIntake(proposeMorning);
|
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_MORNING);
|
||||||
appNutritionDayVo.setTimePeriod("1");
|
appNutritionDayVo.setTimePeriod("1");
|
||||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||||
result.add(appNutritionDayVo);
|
result.add(appNutritionDayVo);
|
||||||
@ -447,7 +444,7 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||||||
.map(m->BigDecimal.valueOf(m.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).doubleValue();
|
||||||
appNutritionDayVo.setIntake(reduce);
|
appNutritionDayVo.setIntake(reduce);
|
||||||
appNutritionDayVo.setProposeIntake(proposeNoon);
|
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NOON);
|
||||||
appNutritionDayVo.setTimePeriod("2");
|
appNutritionDayVo.setTimePeriod("2");
|
||||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||||
result.add(appNutritionDayVo);
|
result.add(appNutritionDayVo);
|
||||||
@ -460,7 +457,7 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||||||
.map(m->BigDecimal.valueOf(m.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).doubleValue();
|
||||||
appNutritionDayVo.setIntake(reduce);
|
appNutritionDayVo.setIntake(reduce);
|
||||||
appNutritionDayVo.setProposeIntake(proposeNight);
|
appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NIGHT);
|
||||||
appNutritionDayVo.setTimePeriod("3");
|
appNutritionDayVo.setTimePeriod("3");
|
||||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||||
result.add(appNutritionDayVo);
|
result.add(appNutritionDayVo);
|
||||||
|
@ -68,4 +68,19 @@ public class MemberConstants {
|
|||||||
* 门店顾客流量key
|
* 门店顾客流量key
|
||||||
*/
|
*/
|
||||||
public static final String CUSTOMER_PREFIX = "store";
|
public static final String CUSTOMER_PREFIX = "store";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 早餐推荐摄入量
|
||||||
|
*/
|
||||||
|
public static final Double PROPOSE_MORNING = 400D;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 午餐推荐摄入量
|
||||||
|
*/
|
||||||
|
public static final Double PROPOSE_NOON = 800D;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 晚餐推荐摄入量
|
||||||
|
*/
|
||||||
|
public static final Double PROPOSE_NIGHT = 300D;
|
||||||
}
|
}
|
@ -273,9 +273,3 @@ ureport:
|
|||||||
provider:
|
provider:
|
||||||
database:
|
database:
|
||||||
disabled: false
|
disabled: false
|
||||||
|
|
||||||
# 早中晚推荐
|
|
||||||
propose:
|
|
||||||
morning: 200
|
|
||||||
noon: 750
|
|
||||||
night: 150
|
|
Reference in New Issue
Block a user