修改
This commit is contained in:
		| @ -49,4 +49,6 @@ public class MemberUserRespVO extends MemberUserBaseVO { | |||||||
|     @Schema(description = "用户经验值", requiredMode  = Schema.RequiredMode.REQUIRED, example = "200") |     @Schema(description = "用户经验值", requiredMode  = Schema.RequiredMode.REQUIRED, example = "200") | ||||||
|     private Integer experience; |     private Integer experience; | ||||||
|  |  | ||||||
|  |     @Schema(description = "绑定卡号") | ||||||
|  |     private String cardId; | ||||||
| } | } | ||||||
|  | |||||||
| @ -46,13 +46,13 @@ public class AppOrderRespVO { | |||||||
|     private List<AppOrderDetailRespVO> detailList; |     private List<AppOrderDetailRespVO> detailList; | ||||||
|  |  | ||||||
|     @Schema(description = "推荐摄入量") |     @Schema(description = "推荐摄入量") | ||||||
|     private Double proposeIntake; |     private BigDecimal proposeIntake; | ||||||
|  |  | ||||||
|     @Schema(description = "摄入量") |     @Schema(description = "摄入量") | ||||||
|     private Double intake; |     private BigDecimal intake; | ||||||
|  |  | ||||||
|     @Schema(description = "差值") |     @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 io.swagger.v3.oas.annotations.media.Schema; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
|  | import java.math.BigDecimal; | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @ -15,10 +16,10 @@ import java.util.List; | |||||||
| public class AppNutritionDayVo { | public class AppNutritionDayVo { | ||||||
|  |  | ||||||
|     @Schema(description = "摄入量", example = "24217") |     @Schema(description = "摄入量", example = "24217") | ||||||
|     private Double intake; |     private BigDecimal intake; | ||||||
|  |  | ||||||
|     @Schema(description = "推荐摄入量", example = "赵六") |     @Schema(description = "推荐摄入量", example = "赵六") | ||||||
|     private Double proposeIntake; |     private BigDecimal proposeIntake; | ||||||
|  |  | ||||||
|     @Schema(description = "时间段(1-早,2-中,3-晚)") |     @Schema(description = "时间段(1-早,2-中,3-晚)") | ||||||
|     private String timePeriod; |     private String timePeriod; | ||||||
|  | |||||||
| @ -90,9 +90,9 @@ public class CustomerTrafficServiceImpl implements CustomerTrafficService { | |||||||
|     public List<CustomerTrafficDO> getData(Long storeId) { |     public List<CustomerTrafficDO> getData(Long storeId) { | ||||||
|         LocalDateTime now = LocalDateTime.now(); |         LocalDateTime now = LocalDateTime.now(); | ||||||
|         List<CustomerTrafficDO> customerTrafficDOS = customerTrafficMapper.selectList(Wrappers.<CustomerTrafficDO>lambdaQuery() |         List<CustomerTrafficDO> customerTrafficDOS = customerTrafficMapper.selectList(Wrappers.<CustomerTrafficDO>lambdaQuery() | ||||||
|                 .lt(CustomerTrafficDO::getCreateTime, now) |                 //.lt(CustomerTrafficDO::getCreateTime, now) | ||||||
|                 .eq(storeId!=null,CustomerTrafficDO::getStoreId,storeId) |                 .eq(storeId!=null,CustomerTrafficDO::getStoreId,storeId) | ||||||
|                 .orderByDesc(CustomerTrafficDO::getCustomerNum) |                 .orderByDesc(CustomerTrafficDO::getCreateTime) | ||||||
|                 .last("limit 7")); |                 .last("limit 7")); | ||||||
|         return customerTrafficDOS; |         return customerTrafficDOS; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -111,7 +111,7 @@ public class OrderServiceImpl implements OrderService { | |||||||
|         List<AppOrderDetailRespVO> appOrderDetailRespVOS = orderDetailService.selectListByOrderId(id); |         List<AppOrderDetailRespVO> appOrderDetailRespVOS = orderDetailService.selectListByOrderId(id); | ||||||
|         appOrderRespVO.setDetailList(appOrderDetailRespVOS); |         appOrderRespVO.setDetailList(appOrderDetailRespVOS); | ||||||
|         BigDecimal reduce1 = appOrderDetailRespVOS.stream().filter(heat -> ObjUtil.isNotEmpty(heat.getHeat())).map(m-> BigDecimal.valueOf(m.getHeat())).reduce(BigDecimal.ZERO, BigDecimal::add); |         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); |         appOrderRespVO.setIntake(reduce); | ||||||
|         //判断时间 |         //判断时间 | ||||||
|         int hour = order.getCreateTime().getHour(); |         int hour = order.getCreateTime().getHour(); | ||||||
|  | |||||||
| @ -426,10 +426,10 @@ public class MemberUserServiceImpl implements MemberUserService { | |||||||
|         if(CollectionUtil.isNotEmpty(moIds)){ |         if(CollectionUtil.isNotEmpty(moIds)){ | ||||||
|             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(moIds); |             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(moIds); | ||||||
|             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); |             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); | ||||||
|             Double reduce = orderDetailDOS.stream() |             BigDecimal reduce = orderDetailDOS.stream() | ||||||
|                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) |                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) | ||||||
|                     .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); | ||||||
|             appNutritionDayVo.setIntake(reduce); |             appNutritionDayVo.setIntake(reduce); | ||||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_MORNING); |             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_MORNING); | ||||||
|             appNutritionDayVo.setTimePeriod("1"); |             appNutritionDayVo.setTimePeriod("1"); | ||||||
| @ -439,10 +439,10 @@ public class MemberUserServiceImpl implements MemberUserService { | |||||||
|         if(CollectionUtil.isNotEmpty(miIds)){ |         if(CollectionUtil.isNotEmpty(miIds)){ | ||||||
|             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(miIds); |             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(miIds); | ||||||
|             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); |             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); | ||||||
|             Double reduce = orderDetailDOS.stream() |             BigDecimal reduce = orderDetailDOS.stream() | ||||||
|                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) |                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) | ||||||
|                     .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); | ||||||
|             appNutritionDayVo.setIntake(reduce); |             appNutritionDayVo.setIntake(reduce); | ||||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NOON); |             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NOON); | ||||||
|             appNutritionDayVo.setTimePeriod("2"); |             appNutritionDayVo.setTimePeriod("2"); | ||||||
| @ -452,10 +452,10 @@ public class MemberUserServiceImpl implements MemberUserService { | |||||||
|         if(CollectionUtil.isNotEmpty(niIds)){ |         if(CollectionUtil.isNotEmpty(niIds)){ | ||||||
|             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(niIds); |             List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(niIds); | ||||||
|             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); |             AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo(); | ||||||
|             Double reduce = orderDetailDOS.stream() |             BigDecimal reduce = orderDetailDOS.stream() | ||||||
|                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) |                     .filter(f-> ObjectUtil.isNotEmpty(f.getHeat())) | ||||||
|                     .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); | ||||||
|             appNutritionDayVo.setIntake(reduce); |             appNutritionDayVo.setIntake(reduce); | ||||||
|             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NIGHT); |             appNutritionDayVo.setProposeIntake(MemberConstants.PROPOSE_NIGHT); | ||||||
|             appNutritionDayVo.setTimePeriod("3"); |             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/ |         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ | ||||||
|      --> |      --> | ||||||
|     <select id="selectUser" resultType="integer"> |     <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> |         <where> | ||||||
|             <if test="time != null and time !=''"> |             <if test="time != null and time !=''"> | ||||||
|                 date_format(create_time,'%Y-%m-%d') = #{time} |                 date_format(create_time,'%Y-%m-%d') = #{time} | ||||||
|  | |||||||
| @ -17,6 +17,7 @@ import org.springframework.validation.annotation.Validated; | |||||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||||
|  |  | ||||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||||
|  | import javax.annotation.security.PermitAll; | ||||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||||
| import javax.validation.Valid; | import javax.validation.Valid; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| @ -71,7 +72,7 @@ public class CarteenController { | |||||||
|  |  | ||||||
|     @GetMapping("/page") |     @GetMapping("/page") | ||||||
|     @Operation(summary = "获得门店管理分页") |     @Operation(summary = "获得门店管理分页") | ||||||
|     @PreAuthorize("@ss.hasPermission('t:carteen:query')") |     @PermitAll | ||||||
|     public CommonResult<PageResult<CarteenRespVO>> getCarteenPage(@Valid CarteenPageReqVO pageReqVO) { |     public CommonResult<PageResult<CarteenRespVO>> getCarteenPage(@Valid CarteenPageReqVO pageReqVO) { | ||||||
|         PageResult<CarteenDO> pageResult = carteenService.getCarteenPage(pageReqVO); |         PageResult<CarteenDO> pageResult = carteenService.getCarteenPage(pageReqVO); | ||||||
|         return success(BeanUtils.toBean(pageResult, CarteenRespVO.class)); |         return success(BeanUtils.toBean(pageResult, CarteenRespVO.class)); | ||||||
|  | |||||||
| @ -22,7 +22,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |||||||
|  */ |  */ | ||||||
| @Tag(name = "门店") | @Tag(name = "门店") | ||||||
| @RestController | @RestController | ||||||
| @RequestMapping("/app/t/carteen") | @RequestMapping("/t/carteen") | ||||||
| @Validated | @Validated | ||||||
| public class AppCarteenController { | public class AppCarteenController { | ||||||
|     @Resource |     @Resource | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 zengtao01
					zengtao01