常量
This commit is contained in:
		| @ -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.dto.DeviceInfoDto; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
|  | ||||
| @ -66,13 +65,6 @@ public class OrderServiceImpl implements OrderService { | ||||
|     @Resource | ||||
|     private CarteenApi carteenApi; | ||||
|  | ||||
|     @Value("${propose.morning}") | ||||
|     private Double proposeMorning; | ||||
|     @Value("${propose.noon}") | ||||
|     private Double proposeNoon; | ||||
|     @Value("${propose.night}") | ||||
|     private Double proposeNight; | ||||
|  | ||||
|     @Override | ||||
|     public Long createOrder(AppOrderSaveReqVO createReqVO) { | ||||
|         // 插入 | ||||
| @ -124,11 +116,11 @@ public class OrderServiceImpl implements OrderService { | ||||
|         //判断时间 | ||||
|         int hour = order.getCreateTime().getHour(); | ||||
|         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()){ | ||||
|             appOrderRespVO.setProposeIntake(proposeNoon); | ||||
|             appOrderRespVO.setProposeIntake(MemberConstants.PROPOSE_NOON); | ||||
|         }else{ | ||||
|             appOrderRespVO.setProposeIntake(proposeNight); | ||||
|             appOrderRespVO.setProposeIntake(MemberConstants.PROPOSE_NIGHT); | ||||
|         } | ||||
|         appOrderRespVO.setDifference(NumberUtil.sub(reduce,appOrderRespVO.getProposeIntake())); | ||||
|         return appOrderRespVO; | ||||
|  | ||||
| @ -6,7 +6,12 @@ import cn.hutool.core.collection.CollectionUtil; | ||||
| import cn.hutool.core.collection.ListUtil; | ||||
| import cn.hutool.core.lang.Assert; | ||||
| 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.UserTypeEnum; | ||||
| 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.google.common.annotations.VisibleForTesting; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.security.crypto.password.PasswordEncoder; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| @ -121,13 +125,6 @@ public class MemberUserServiceImpl implements MemberUserService { | ||||
|     @Resource | ||||
|     private UserExpandService userExpandService; | ||||
|  | ||||
|     @Value("${propose.morning}") | ||||
|     private Double proposeMorning; | ||||
|     @Value("${propose.noon}") | ||||
|     private Double proposeNoon; | ||||
|     @Value("${propose.night}") | ||||
|     private Double proposeNight; | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     public MemberUserDO getUserByMobile(String mobile) { | ||||
| @ -434,7 +431,7 @@ public class MemberUserServiceImpl implements MemberUserService { | ||||
|                     .map(m->BigDecimal.valueOf(m.getHeat())) | ||||
|                     .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue(); | ||||
|             appNutritionDayVo.setIntake(reduce); | ||||
|             appNutritionDayVo.setProposeIntake(proposeMorning); | ||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_MORNING); | ||||
|             appNutritionDayVo.setTimePeriod("1"); | ||||
|             appNutritionDayVo.setDetailList(orderDetailDOS); | ||||
|             result.add(appNutritionDayVo); | ||||
| @ -447,7 +444,7 @@ public class MemberUserServiceImpl implements MemberUserService { | ||||
|                     .map(m->BigDecimal.valueOf(m.getHeat())) | ||||
|                     .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue(); | ||||
|             appNutritionDayVo.setIntake(reduce); | ||||
|             appNutritionDayVo.setProposeIntake(proposeNoon); | ||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NOON); | ||||
|             appNutritionDayVo.setTimePeriod("2"); | ||||
|             appNutritionDayVo.setDetailList(orderDetailDOS); | ||||
|             result.add(appNutritionDayVo); | ||||
| @ -460,7 +457,7 @@ public class MemberUserServiceImpl implements MemberUserService { | ||||
|                     .map(m->BigDecimal.valueOf(m.getHeat())) | ||||
|                     .reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP).doubleValue(); | ||||
|             appNutritionDayVo.setIntake(reduce); | ||||
|             appNutritionDayVo.setProposeIntake(proposeNight); | ||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NIGHT); | ||||
|             appNutritionDayVo.setTimePeriod("3"); | ||||
|             appNutritionDayVo.setDetailList(orderDetailDOS); | ||||
|             result.add(appNutritionDayVo); | ||||
|  | ||||
| @ -68,4 +68,19 @@ public class MemberConstants { | ||||
|      * 门店顾客流量key | ||||
|      */ | ||||
|     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; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 zengtao01
					zengtao01