ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java
@@ -12,11 +12,15 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.YearMonth; import java.util.List; /** @@ -49,12 +53,26 @@ */ @GetMapping("/getUserPointDetail") @ApiOperation("获取变更明细") public TableDataInfo<UserPointDetailVO> getUserPointDetail(@ApiParam("指定日期") LocalDateTime date, public TableDataInfo<UserPointDetailVO> getUserPointDetail(@ApiParam("指定日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date, @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + "5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 " + "10 =注册积分)") Integer type){ LocalDateTime startTime = null; LocalDateTime endTime = null; if (date != null) { // 将 createTime 设置为当天的开始时间 (00:00) startTime = date.atStartOfDay(); // 使用 YearMonth 来获取该月的最后一天 YearMonth yearMonth = YearMonth.from(date); LocalDate lastDayOfMonth = yearMonth.atEndOfMonth(); // 将最后一天转换为 LocalDateTime,并设置为当天的最后一秒 (23:59:59.999) endTime = lastDayOfMonth.atTime(LocalTime.MAX); } startPage(); List<UserPointDetailVO> list = userPointService.getUserPointDetail(SecurityUtils.getUserId(), date, type); List<UserPointDetailVO> list = userPointService.getUserPointDetail(SecurityUtils.getUserId(), startTime, endTime, type); return getDataTable(list); } @@ -70,6 +88,7 @@ /** * 保存积分流水记录 * * @param userPoint * @return */ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java
@@ -21,5 +21,5 @@ UserPointVO getUserPoint(Long userId); List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime date, Integer type); List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.api.model.BalanceChangeRecord; import com.ruoyi.account.api.model.UserPoint; import com.ruoyi.account.enums.PointChangeType; import com.ruoyi.account.mapper.UserPointMapper; @@ -56,8 +57,10 @@ } @Override public List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime date, Integer type) { public List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type) { List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>() .between(startTime != null, UserPoint::getCreateTime, startTime, endTime) .eq(type != null, UserPoint::getType, type) .eq(UserPoint::getAppUserId, userId)); if (CollectionUtil.isNotEmpty(userPointList)) { return userPointList.stream().map(p -> { ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/PhoneController.java
@@ -37,7 +37,7 @@ * 查询指定门店手机号 */ @GetMapping("/selectPhoneByShopId") @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情"}) @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情-查询客服电话"}) public R<List<Phone>> getPhoneByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { return R.ok(phoneService.list(new LambdaQueryWrapper<Phone>() .eq(Phone::getType, PhoneType.SHOP.getCode())