个人基础属性
This commit is contained in:
@ -57,8 +57,11 @@ public interface ErrorCodeConstants {
|
||||
|
||||
//========== 用户余额明细 1-004-013-000 =============
|
||||
ErrorCode CARD_NOT_EXISTS = new ErrorCode(1_004_013_000, "余额明细不存在");
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_004_013_000, "订单不存在");
|
||||
ErrorCode ORDER_DETAIL_NOT_EXISTS = new ErrorCode(1_004_013_000, "订单明细不存在");
|
||||
|
||||
ErrorCode ORDER_NOT_EXISTS = new ErrorCode(1_004_013_001, "订单不存在");
|
||||
ErrorCode ORDER_DETAIL_NOT_EXISTS = new ErrorCode(1_004_013_002, "订单明细不存在");
|
||||
ErrorCode RECHARGE_AMOUNT_NOT_EXISTS = new ErrorCode(1_004_013_003, "订单明细不存在");
|
||||
ErrorCode DINING_PLATES_NOT_EXISTS = new ErrorCode(1_004_013_004, "订单明细不存在");
|
||||
ErrorCode USER_EXPAND_NOT_EXISTS = new ErrorCode(1_004_013_005, "订单明细不存在");
|
||||
ErrorCode USER_PREFERENCE_NOT_EXISTS = new ErrorCode(1_004_013_006, "订单明细不存在");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.diningplates;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
import cn.iocoder.yudao.module.member.service.diningplates.DiningPlatesService;
|
||||
|
||||
@Tag(name = "管理后台 - 餐盘")
|
||||
@RestController
|
||||
@RequestMapping("/member/dining-plates")
|
||||
@Validated
|
||||
public class DiningPlatesController {
|
||||
|
||||
@Resource
|
||||
private DiningPlatesService diningPlatesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建餐盘")
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:create')")
|
||||
public CommonResult<Long> createDiningPlates(@Valid @RequestBody DiningPlatesSaveReqVO createReqVO) {
|
||||
return success(diningPlatesService.createDiningPlates(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新餐盘")
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:update')")
|
||||
public CommonResult<Boolean> updateDiningPlates(@Valid @RequestBody DiningPlatesSaveReqVO updateReqVO) {
|
||||
diningPlatesService.updateDiningPlates(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除餐盘")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:delete')")
|
||||
public CommonResult<Boolean> deleteDiningPlates(@RequestParam("id") Long id) {
|
||||
diningPlatesService.deleteDiningPlates(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得餐盘")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:query')")
|
||||
public CommonResult<DiningPlatesRespVO> getDiningPlates(@RequestParam("id") Long id) {
|
||||
DiningPlatesDO diningPlates = diningPlatesService.getDiningPlates(id);
|
||||
return success(BeanUtils.toBean(diningPlates, DiningPlatesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得餐盘分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:query')")
|
||||
public CommonResult<PageResult<DiningPlatesRespVO>> getDiningPlatesPage(@Valid DiningPlatesPageReqVO pageReqVO) {
|
||||
PageResult<DiningPlatesDO> pageResult = diningPlatesService.getDiningPlatesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DiningPlatesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出餐盘 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:dining-plates:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportDiningPlatesExcel(@Valid DiningPlatesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DiningPlatesDO> list = diningPlatesService.getDiningPlatesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "餐盘.xls", "数据", DiningPlatesRespVO.class,
|
||||
BeanUtils.toBean(list, DiningPlatesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.diningplates.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DiningPlatesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] bindingTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.diningplates.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DiningPlatesRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22308")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
@ExcelProperty("餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
@ExcelProperty("状态:0-空闲,1-正在使用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
@ExcelProperty("绑定时间")
|
||||
private LocalDateTime bindingTime;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.diningplates.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘新增/修改 Request VO")
|
||||
@Data
|
||||
public class DiningPlatesSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22308")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
private LocalDateTime bindingTime;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.rechargeamount;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
|
||||
import cn.iocoder.yudao.module.member.service.rechargeamount.RechargeAmountService;
|
||||
|
||||
@Tag(name = "管理后台 - 充值金额配置")
|
||||
@RestController
|
||||
@RequestMapping("/member/recharge-amount")
|
||||
@Validated
|
||||
public class RechargeAmountController {
|
||||
|
||||
@Resource
|
||||
private RechargeAmountService rechargeAmountService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建充值金额配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:create')")
|
||||
public CommonResult<Long> createRechargeAmount(@Valid @RequestBody RechargeAmountSaveReqVO createReqVO) {
|
||||
return success(rechargeAmountService.createRechargeAmount(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新充值金额配置")
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:update')")
|
||||
public CommonResult<Boolean> updateRechargeAmount(@Valid @RequestBody RechargeAmountSaveReqVO updateReqVO) {
|
||||
rechargeAmountService.updateRechargeAmount(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除充值金额配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:delete')")
|
||||
public CommonResult<Boolean> deleteRechargeAmount(@RequestParam("id") Long id) {
|
||||
rechargeAmountService.deleteRechargeAmount(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得充值金额配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:query')")
|
||||
public CommonResult<RechargeAmountRespVO> getRechargeAmount(@RequestParam("id") Long id) {
|
||||
RechargeAmountDO rechargeAmount = rechargeAmountService.getRechargeAmount(id);
|
||||
return success(BeanUtils.toBean(rechargeAmount, RechargeAmountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得充值金额配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:query')")
|
||||
public CommonResult<PageResult<RechargeAmountRespVO>> getRechargeAmountPage(@Valid RechargeAmountPageReqVO pageReqVO) {
|
||||
PageResult<RechargeAmountDO> pageResult = rechargeAmountService.getRechargeAmountPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RechargeAmountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出充值金额配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:recharge-amount:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportRechargeAmountExcel(@Valid RechargeAmountPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RechargeAmountDO> list = rechargeAmountService.getRechargeAmountPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "充值金额配置.xls", "数据", RechargeAmountRespVO.class,
|
||||
BeanUtils.toBean(list, RechargeAmountRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RechargeAmountPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RechargeAmountRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17982")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "金额")
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
@ExcelProperty("赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
@ExcelProperty("状态:0-关闭,1-开启")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class RechargeAmountSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17982")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
private String status;
|
||||
|
||||
}
|
@ -118,10 +118,6 @@ public class MemberUserController {
|
||||
return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels, groups));
|
||||
}
|
||||
|
||||
@PutMapping("/bindCard")
|
||||
@Operation(summary = "绑卡")
|
||||
public CommonResult<Boolean> bindCard(@Valid @RequestBody BindCardVO vo){
|
||||
return success(memberUserService.bindCard(vo.getCardId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userexpand;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userexpand.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userexpand.UserExpandDO;
|
||||
import cn.iocoder.yudao.module.member.service.userexpand.UserExpandService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户拓展属性")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-expand")
|
||||
@Validated
|
||||
public class UserExpandController {
|
||||
|
||||
@Resource
|
||||
private UserExpandService userExpandService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户拓展属性")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:create')")
|
||||
public CommonResult<Long> createUserExpand(@Valid @RequestBody UserExpandSaveReqVO createReqVO) {
|
||||
return success(userExpandService.createUserExpand(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户拓展属性")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:update')")
|
||||
public CommonResult<Boolean> updateUserExpand(@Valid @RequestBody UserExpandSaveReqVO updateReqVO) {
|
||||
userExpandService.updateUserExpand(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户拓展属性")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:delete')")
|
||||
public CommonResult<Boolean> deleteUserExpand(@RequestParam("id") Long id) {
|
||||
userExpandService.deleteUserExpand(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户拓展属性")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:query')")
|
||||
public CommonResult<UserExpandRespVO> getUserExpand(@RequestParam("id") Long id) {
|
||||
UserExpandDO userExpand = userExpandService.getUserExpand(id);
|
||||
return success(BeanUtils.toBean(userExpand, UserExpandRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户拓展属性分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:query')")
|
||||
public CommonResult<PageResult<UserExpandRespVO>> getUserExpandPage(@Valid UserExpandPageReqVO pageReqVO) {
|
||||
PageResult<UserExpandDO> pageResult = userExpandService.getUserExpandPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, UserExpandRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户拓展属性 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-expand:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserExpandExcel(@Valid UserExpandPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<UserExpandDO> list = userExpandService.getUserExpandPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户拓展属性.xls", "数据", UserExpandRespVO.class,
|
||||
BeanUtils.toBean(list, UserExpandRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userexpand.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserExpandPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String card;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userexpand.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserExpandRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26696")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
@ExcelProperty("身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
@ExcelProperty("体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
@ExcelProperty("健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
@ExcelProperty("饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
@ExcelProperty("身份证")
|
||||
private String card;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userexpand.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性新增/修改 Request VO")
|
||||
@Data
|
||||
public class UserExpandSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26696")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String card;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userpreference;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userpreference.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userpreference.UserPreferenceDO;
|
||||
import cn.iocoder.yudao.module.member.service.userpreference.UserPreferenceService;
|
||||
|
||||
@Tag(name = "管理后台 - 用户偏好")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-preference")
|
||||
@Validated
|
||||
public class UserPreferenceController {
|
||||
|
||||
@Resource
|
||||
private UserPreferenceService userPreferenceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户偏好")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:create')")
|
||||
public CommonResult<Long> createUserPreference(@Valid @RequestBody UserPreferenceSaveReqVO createReqVO) {
|
||||
return success(userPreferenceService.createUserPreference(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户偏好")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:update')")
|
||||
public CommonResult<Boolean> updateUserPreference(@Valid @RequestBody UserPreferenceSaveReqVO updateReqVO) {
|
||||
userPreferenceService.updateUserPreference(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户偏好")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:delete')")
|
||||
public CommonResult<Boolean> deleteUserPreference(@RequestParam("id") Long id) {
|
||||
userPreferenceService.deleteUserPreference(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户偏好")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:query')")
|
||||
public CommonResult<UserPreferenceRespVO> getUserPreference(@RequestParam("id") Long id) {
|
||||
UserPreferenceDO userPreference = userPreferenceService.getUserPreference(id);
|
||||
return success(BeanUtils.toBean(userPreference, UserPreferenceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户偏好分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:query')")
|
||||
public CommonResult<PageResult<UserPreferenceRespVO>> getUserPreferencePage(@Valid UserPreferencePageReqVO pageReqVO) {
|
||||
PageResult<UserPreferenceDO> pageResult = userPreferenceService.getUserPreferencePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, UserPreferenceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出用户偏好 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('member:user-preference:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserPreferenceExcel(@Valid UserPreferencePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<UserPreferenceDO> list = userPreferenceService.getUserPreferencePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "用户偏好.xls", "数据", UserPreferenceRespVO.class,
|
||||
BeanUtils.toBean(list, UserPreferenceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userpreference.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class UserPreferencePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
private String custom;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userpreference.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class UserPreferenceRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14844")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
@ExcelProperty("辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
@ExcelProperty("口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
@ExcelProperty("健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
@ExcelProperty("食物类型")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
@ExcelProperty("过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
@ExcelProperty("健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
@ExcelProperty("饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
@ExcelProperty("自定义")
|
||||
private String custom;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.userpreference.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好新增/修改 Request VO")
|
||||
@Data
|
||||
public class UserPreferenceSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14844")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
private String custom;
|
||||
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.card;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.card.vo.AppCardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.card.CardDO;
|
||||
import cn.iocoder.yudao.module.member.service.card.CardService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 APP - 余额变动明细")
|
||||
@RestController
|
||||
@RequestMapping("/member/card")
|
||||
@Validated
|
||||
public class AppCardController {
|
||||
|
||||
@Resource
|
||||
private CardService cardService;
|
||||
|
||||
//@PostMapping("/create")
|
||||
//@Operation(summary = "创建余额变动明细")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:create')")
|
||||
//public CommonResult<Long> createCard(@Valid @RequestBody CardSaveReqVO createReqVO) {
|
||||
// return success(cardService.createCard(createReqVO));
|
||||
//}
|
||||
//
|
||||
//@PutMapping("/update")
|
||||
//@Operation(summary = "更新余额变动明细")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:update')")
|
||||
//public CommonResult<Boolean> updateCard(@Valid @RequestBody CardSaveReqVO updateReqVO) {
|
||||
// cardService.updateCard(updateReqVO);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@DeleteMapping("/delete")
|
||||
//@Operation(summary = "删除余额变动明细")
|
||||
//@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:delete')")
|
||||
//public CommonResult<Boolean> deleteCard(@RequestParam("id") Long id) {
|
||||
// cardService.deleteCard(id);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/get")
|
||||
//@Operation(summary = "获得余额变动明细")
|
||||
//@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:query')")
|
||||
//public CommonResult<CardRespVO> getCard(@RequestParam("id") Long id) {
|
||||
// CardDO card = cardService.getCard(id);
|
||||
// return success(BeanUtils.toBean(card, CardRespVO.class));
|
||||
//}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得余额变动明细分页")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:query')")
|
||||
public CommonResult<PageResult<CardRespVO>> getCardPage(@Valid AppCardPageReqVO pageReqVO) {
|
||||
PageResult<CardDO> pageResult = cardService.getCardPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CardRespVO.class));
|
||||
}
|
||||
|
||||
//@GetMapping("/export-excel")
|
||||
//@Operation(summary = "导出余额变动明细 Excel")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:export')")
|
||||
//@OperateLog(type = EXPORT)
|
||||
//public void exportCardExcel(@Valid CardPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<CardDO> list = cardService.getCardPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "余额变动明细.xls", "数据", CardRespVO.class,
|
||||
// BeanUtils.toBean(list, CardRespVO.class));
|
||||
//}
|
||||
|
||||
@PutMapping("/recharge")
|
||||
@Operation(summary = "充值")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:update')")
|
||||
public CommonResult<Boolean> recharge(BigDecimal money) {
|
||||
return success(cardService.recharge(money,CardDO.ADD));
|
||||
}
|
||||
|
||||
@GetMapping("/getMoney")
|
||||
@Operation(summary = "获取余额")
|
||||
public CommonResult<BigDecimal> getMoney() {
|
||||
return success(cardService.getMoney());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.card.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "用户 APP - 余额变动明细分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppCardPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "卡号", example = "23469")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "加减标志(0:减,1:加)")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "变动金额")
|
||||
private BigDecimal changeMoney;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.card.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "用户 APP - 余额变动明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppCardRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21508")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "卡号", example = "23469")
|
||||
@ExcelProperty("卡号")
|
||||
private String cardId;
|
||||
|
||||
@Schema(description = "余额")
|
||||
@ExcelProperty("余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "加减标志(0:减,1:加)")
|
||||
@ExcelProperty("加减标志(0:减,1:加)")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "变动金额")
|
||||
@ExcelProperty("变动金额")
|
||||
private BigDecimal changeMoney;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.card.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "用户 APP - 余额变动明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppCardSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21508")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户Id",example = "23469")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "余额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "加减标志(0:减,1:加)")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "变动金额")
|
||||
private BigDecimal changeMoney;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.diningplates;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
import cn.iocoder.yudao.module.member.service.diningplates.DiningPlatesService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 App - 餐盘")
|
||||
@RestController
|
||||
@RequestMapping("/member/dining-plates")
|
||||
@Validated
|
||||
public class AppDiningPlatesController {
|
||||
|
||||
@Resource
|
||||
private DiningPlatesService diningPlatesService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得餐盘列表")
|
||||
public CommonResult<List<DiningPlatesRespVO>> getDiningPlatesPage() {
|
||||
List<DiningPlatesDO> pageResult = diningPlatesService.getDiningPlatesList();
|
||||
return success(BeanUtils.toBean(pageResult, DiningPlatesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.diningplates.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppDiningPlatesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] bindingTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.diningplates.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppDiningPlatesRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22308")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
@ExcelProperty("餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
@ExcelProperty("状态:0-空闲,1-正在使用")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
@ExcelProperty("绑定时间")
|
||||
private LocalDateTime bindingTime;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.diningplates.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 餐盘新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppDiningPlatesSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22308")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "餐盘编号")
|
||||
private String diningPlatesNum;
|
||||
|
||||
@Schema(description = "用户id", example = "17553")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "状态:0-空闲,1-正在使用", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "绑定时间")
|
||||
private LocalDateTime bindingTime;
|
||||
|
||||
}
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 会员订单")
|
||||
@Tag(name = "用户 App - 会员订单")
|
||||
@RestController
|
||||
@RequestMapping("/member/order")
|
||||
@Validated
|
||||
@ -59,7 +59,6 @@ public class AppOrderController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除会员订单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('member:order:delete')")
|
||||
public CommonResult<Boolean> deleteOrder(@RequestParam("id") Long id) {
|
||||
orderService.deleteOrder(id);
|
||||
return success(true);
|
||||
@ -68,18 +67,16 @@ public class AppOrderController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员订单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('member:order:query')")
|
||||
public CommonResult<AppOrderRespVO> getOrder(@RequestParam("id") Long id) {
|
||||
return success(orderService.getOrder(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员订单分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:order:query')")
|
||||
public CommonResult<PageResult<AppOrderRespVO>> getOrderPage(@Valid AppOrderPageReqVO pageReqVO) {
|
||||
PageResult<DishOrderDO> pageResult = orderService.getOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AppOrderRespVO.class));
|
||||
}
|
||||
//@GetMapping("/page")
|
||||
//@Operation(summary = "获得会员订单分页")
|
||||
//public CommonResult<PageResult<AppOrderRespVO>> getOrderPage(@Valid AppOrderPageReqVO pageReqVO) {
|
||||
// PageResult<DishOrderDO> pageResult = orderService.getOrderPage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, AppOrderRespVO.class));
|
||||
//}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出会员订单 Excel")
|
||||
@ -94,4 +91,12 @@ public class AppOrderController {
|
||||
BeanUtils.toBean(list, AppOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员订单")
|
||||
public CommonResult<PageResult<AppOrderRespVO>> getOrderPage(PageParam vo) {
|
||||
PageResult<AppOrderRespVO> orderList = orderService.getOrderList(vo);
|
||||
return success(orderList);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -42,7 +42,7 @@ public class AppOrderRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "总价")
|
||||
@Schema(description = "菜品")
|
||||
private List<AppOrderDetailRespVO> detailList;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.order.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "用户 App - 会员订单修改 Request VO")
|
||||
@Data
|
||||
public class AppOrderUpdateReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19151")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "门店Id", example = "24217")
|
||||
private Long storeId;
|
||||
|
||||
@Schema(description = "门店名", example = "赵六")
|
||||
private String storeName;
|
||||
|
||||
@Schema(description = "订单状态", example = "1")
|
||||
private String orderStatus;
|
||||
|
||||
@Schema(description = "用户ID", example = "1")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "总价")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
}
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 订单明细")
|
||||
@Tag(name = "用户 App - 订单明细")
|
||||
@RestController
|
||||
@RequestMapping("/member/order-detail")
|
||||
@Validated
|
||||
|
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.rechargeamount;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.app.rechargeamount.vo.AppRechargeAmountRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
|
||||
import cn.iocoder.yudao.module.member.service.rechargeamount.RechargeAmountService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 App - 充值金额配置")
|
||||
@RestController
|
||||
@RequestMapping("/member/recharge-amount")
|
||||
@Validated
|
||||
public class AppRechargeAmountController {
|
||||
|
||||
@Resource
|
||||
private RechargeAmountService rechargeAmountService;
|
||||
|
||||
//@PostMapping("/create")
|
||||
//@Operation(summary = "创建充值金额配置")
|
||||
//@PreAuthorize("@ss.hasPermission('member:recharge-amount:create')")
|
||||
//public CommonResult<Long> createRechargeAmount(@Valid @RequestBody AppRechargeAmountSaveReqVO createReqVO) {
|
||||
// return success(rechargeAmountService.createRechargeAmount(createReqVO));
|
||||
//}
|
||||
//
|
||||
//@PutMapping("/update")
|
||||
//@Operation(summary = "更新充值金额配置")
|
||||
//@PreAuthorize("@ss.hasPermission('member:recharge-amount:update')")
|
||||
//public CommonResult<Boolean> updateRechargeAmount(@Valid @RequestBody AppRechargeAmountSaveReqVO updateReqVO) {
|
||||
// rechargeAmountService.updateRechargeAmount(updateReqVO);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@DeleteMapping("/delete")
|
||||
//@Operation(summary = "删除充值金额配置")
|
||||
//@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('member:recharge-amount:delete')")
|
||||
//public CommonResult<Boolean> deleteRechargeAmount(@RequestParam("id") Long id) {
|
||||
// rechargeAmountService.deleteRechargeAmount(id);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/get")
|
||||
//@Operation(summary = "获得充值金额配置")
|
||||
//@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('member:recharge-amount:query')")
|
||||
//public CommonResult<AppRechargeAmountRespVO> getRechargeAmount(@RequestParam("id") Long id) {
|
||||
// RechargeAmountDO rechargeAmount = rechargeAmountService.getRechargeAmount(id);
|
||||
// return success(BeanUtils.toBean(rechargeAmount, AppRechargeAmountRespVO.class));
|
||||
//}
|
||||
//
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得充值金额")
|
||||
public CommonResult<List<AppRechargeAmountRespVO>> getRechargeAmountPage() {
|
||||
List<RechargeAmountDO> amount = rechargeAmountService.getAmount();
|
||||
return success(BeanUtils.toBean(amount, AppRechargeAmountRespVO.class));
|
||||
}
|
||||
//
|
||||
//@GetMapping("/export-excel")
|
||||
//@Operation(summary = "导出充值金额配置 Excel")
|
||||
//@PreAuthorize("@ss.hasPermission('member:recharge-amount:export')")
|
||||
//@OperateLog(type = EXPORT)
|
||||
//public void exportRechargeAmountExcel(@Valid AppRechargeAmountPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<RechargeAmountDO> list = rechargeAmountService.getRechargeAmountPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "充值金额配置.xls", "数据", AppRechargeAmountRespVO.class,
|
||||
// BeanUtils.toBean(list, AppRechargeAmountRespVO.class));
|
||||
//}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.rechargeamount.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppRechargeAmountPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.rechargeamount.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppRechargeAmountRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17982")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "金额")
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
@ExcelProperty("赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
@ExcelProperty("状态:0-关闭,1-开启")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.rechargeamount.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 充值金额配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppRechargeAmountSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17982")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "赠送金额")
|
||||
private BigDecimal donateMoney;
|
||||
|
||||
@Schema(description = "状态:0-关闭,1-开启", example = "1")
|
||||
private String status;
|
||||
|
||||
}
|
@ -2,7 +2,13 @@ package cn.iocoder.yudao.module.member.controller.app.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppBindCardVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserInfoRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserResetPasswordReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateMobileByWeixinReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateMobileReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdatePasswordReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
@ -12,7 +18,11 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
@ -80,5 +90,23 @@ public class AppMemberUserController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/bindCard")
|
||||
@Operation(summary = "绑卡")
|
||||
public CommonResult<Boolean> bindCard(@Valid @RequestBody AppBindCardVO vo){
|
||||
return success(userService.bindCard(vo.getCardId()));
|
||||
}
|
||||
|
||||
@GetMapping("/nutritionDay")
|
||||
@Operation(summary = "营养日报")
|
||||
public CommonResult<Boolean> nutritionDay(String time){
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/NutritionWeek")
|
||||
@Operation(summary = "营养周报")
|
||||
public CommonResult<Boolean> NutritionWeek(@Valid @RequestBody AppBindCardVO vo){
|
||||
return success(userService.bindCard(vo.getCardId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.user.vo;
|
||||
package cn.iocoder.yudao.module.member.controller.app.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -11,7 +11,7 @@ import javax.validation.constraints.NotNull;
|
||||
* @since 2024/3/29
|
||||
*/
|
||||
@Data
|
||||
public class BindCardVO {
|
||||
public class AppBindCardVO {
|
||||
@Schema(description = "卡号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "卡号不能为空")
|
||||
private String cardId;
|
@ -1,7 +1,5 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.user.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.URL;
|
||||
@ -20,4 +18,22 @@ public class AppMemberUserUpdateReqVO {
|
||||
@Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String card;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.user.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.orderdetail.OrderDetailDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zt
|
||||
* @description <description class purpose>
|
||||
* @since 2024/4/2
|
||||
*/
|
||||
@Data
|
||||
public class AppNutritionDayVo {
|
||||
|
||||
@Schema(description = "摄入量", example = "24217")
|
||||
private Double intake;
|
||||
|
||||
@Schema(description = "推荐摄入量", example = "赵六")
|
||||
private Double proposeIntake;
|
||||
|
||||
@Schema(description = "时间段(1-早,2-中,3-晚)")
|
||||
private String timePeriod;
|
||||
|
||||
@Schema(description = "菜品")
|
||||
private List<OrderDetailDO> detailList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.user.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.orderdetail.OrderDetailDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zt
|
||||
* @description <description class purpose>
|
||||
* @since 2024/4/2
|
||||
*/
|
||||
@Data
|
||||
public class AppNutritionWeekVO {
|
||||
|
||||
@Schema(description = "时间")
|
||||
private String time;
|
||||
|
||||
@Schema(description = "摄入量")
|
||||
private Double intake;
|
||||
|
||||
@Schema(description = "菜品")
|
||||
private List<OrderDetailDO> detailList;
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userexpand;
|
||||
|
||||
import cn.iocoder.yudao.module.member.service.userexpand.UserExpandService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Tag(name = "用户 APP - 用户拓展属性")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-expand")
|
||||
@Validated
|
||||
public class AppUserExpandController {
|
||||
|
||||
@Resource
|
||||
private UserExpandService userExpandService;
|
||||
|
||||
//@PostMapping("/create")
|
||||
//@Operation(summary = "创建用户拓展属性")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:create')")
|
||||
//public CommonResult<Long> createUserExpand(@Valid @RequestBody UserExpandSaveReqVO createReqVO) {
|
||||
// return success(userExpandService.createUserExpand(createReqVO));
|
||||
//}
|
||||
//
|
||||
//@PutMapping("/update")
|
||||
//@Operation(summary = "更新用户拓展属性")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:update')")
|
||||
//public CommonResult<Boolean> updateUserExpand(@Valid @RequestBody UserExpandSaveReqVO updateReqVO) {
|
||||
// userExpandService.updateUserExpand(updateReqVO);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@DeleteMapping("/delete")
|
||||
//@Operation(summary = "删除用户拓展属性")
|
||||
//@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:delete')")
|
||||
//public CommonResult<Boolean> deleteUserExpand(@RequestParam("id") Long id) {
|
||||
// userExpandService.deleteUserExpand(id);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/get")
|
||||
//@Operation(summary = "获得用户拓展属性")
|
||||
//@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:query')")
|
||||
//public CommonResult<UserExpandRespVO> getUserExpand(@RequestParam("id") Long id) {
|
||||
// UserExpandDO userExpand = userExpandService.getUserExpand(id);
|
||||
// return success(BeanUtils.toBean(userExpand, UserExpandRespVO.class));
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/page")
|
||||
//@Operation(summary = "获得用户拓展属性分页")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:query')")
|
||||
//public CommonResult<PageResult<UserExpandRespVO>> getUserExpandPage(@Valid UserExpandPageReqVO pageReqVO) {
|
||||
// PageResult<UserExpandDO> pageResult = userExpandService.getUserExpandPage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, UserExpandRespVO.class));
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/export-excel")
|
||||
//@Operation(summary = "导出用户拓展属性 Excel")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-expand:export')")
|
||||
//@OperateLog(type = EXPORT)
|
||||
//public void exportUserExpandExcel(@Valid UserExpandPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<UserExpandDO> list = userExpandService.getUserExpandPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "用户拓展属性.xls", "数据", UserExpandRespVO.class,
|
||||
// BeanUtils.toBean(list, UserExpandRespVO.class));
|
||||
//}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userexpand.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppUserExpandPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String card;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userexpand.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppUserExpandRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26696")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
@ExcelProperty("身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
@ExcelProperty("体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
@ExcelProperty("健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
@ExcelProperty("饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
@ExcelProperty("身份证")
|
||||
private String card;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userexpand.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户拓展属性新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppUserExpandSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26696")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "6387")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "身高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "体重")
|
||||
private String weight;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "饮食目标")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "身份证")
|
||||
private String card;
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userpreference;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "用户 APP - 用户偏好")
|
||||
@RestController
|
||||
@RequestMapping("/member/user-preference")
|
||||
@Validated
|
||||
public class AppUserPreferenceController {
|
||||
|
||||
//@Resource
|
||||
//private UserPreferenceService userPreferenceService;
|
||||
//
|
||||
//@PostMapping("/create")
|
||||
//@Operation(summary = "创建用户偏好")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:create')")
|
||||
//public CommonResult<Long> createUserPreference(@Valid @RequestBody UserPreferenceSaveReqVO createReqVO) {
|
||||
// return success(userPreferenceService.createUserPreference(createReqVO));
|
||||
//}
|
||||
//
|
||||
//@PutMapping("/update")
|
||||
//@Operation(summary = "更新用户偏好")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:update')")
|
||||
//public CommonResult<Boolean> updateUserPreference(@Valid @RequestBody UserPreferenceSaveReqVO updateReqVO) {
|
||||
// userPreferenceService.updateUserPreference(updateReqVO);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@DeleteMapping("/delete")
|
||||
//@Operation(summary = "删除用户偏好")
|
||||
//@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:delete')")
|
||||
//public CommonResult<Boolean> deleteUserPreference(@RequestParam("id") Long id) {
|
||||
// userPreferenceService.deleteUserPreference(id);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/get")
|
||||
//@Operation(summary = "获得用户偏好")
|
||||
//@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:query')")
|
||||
//public CommonResult<UserPreferenceRespVO> getUserPreference(@RequestParam("id") Long id) {
|
||||
// UserPreferenceDO userPreference = userPreferenceService.getUserPreference(id);
|
||||
// return success(BeanUtils.toBean(userPreference, UserPreferenceRespVO.class));
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/page")
|
||||
//@Operation(summary = "获得用户偏好分页")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:query')")
|
||||
//public CommonResult<PageResult<UserPreferenceRespVO>> getUserPreferencePage(@Valid UserPreferencePageReqVO pageReqVO) {
|
||||
// PageResult<UserPreferenceDO> pageResult = userPreferenceService.getUserPreferencePage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, UserPreferenceRespVO.class));
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/export-excel")
|
||||
//@Operation(summary = "导出用户偏好 Excel")
|
||||
//@PreAuthorize("@ss.hasPermission('member:user-preference:export')")
|
||||
//@OperateLog(type = EXPORT)
|
||||
//public void exportUserPreferenceExcel(@Valid UserPreferencePageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<UserPreferenceDO> list = userPreferenceService.getUserPreferencePage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "用户偏好.xls", "数据", UserPreferenceRespVO.class,
|
||||
// BeanUtils.toBean(list, UserPreferenceRespVO.class));
|
||||
//}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userpreference.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AppUserPreferencePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
private String custom;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userpreference.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AppUserPreferenceRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14844")
|
||||
@ExcelProperty("编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
@ExcelProperty("辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
@ExcelProperty("口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
@ExcelProperty("健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
@ExcelProperty("食物类型")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
@ExcelProperty("过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
@ExcelProperty("健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
@ExcelProperty("饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
@ExcelProperty("自定义")
|
||||
private String custom;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.userpreference.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 用户偏好新增/修改 Request VO")
|
||||
@Data
|
||||
public class AppUserPreferenceSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14844")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户ID", example = "11807")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "辣度")
|
||||
private String spicy;
|
||||
|
||||
@Schema(description = "口味")
|
||||
private String taste;
|
||||
|
||||
@Schema(description = "健康状态")
|
||||
private String health;
|
||||
|
||||
@Schema(description = "食物类型", example = "1")
|
||||
private String foodType;
|
||||
|
||||
@Schema(description = "过敏食物")
|
||||
private String allergy;
|
||||
|
||||
@Schema(description = "健康需求")
|
||||
private String demand;
|
||||
|
||||
@Schema(description = "饮食限制")
|
||||
private String restrict;
|
||||
|
||||
@Schema(description = "自定义")
|
||||
private String custom;
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.diningplates;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 餐盘 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("member_dining_plates")
|
||||
@KeySequence("member_dining_plates_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DiningPlatesDO extends BaseDO {
|
||||
|
||||
public final static String USE = "1";
|
||||
public final static String FREE = "0";
|
||||
public final static String PAY = "1";
|
||||
public final static String TO_PAY = "0";
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 餐盘编号
|
||||
*/
|
||||
private String diningPlatesNum;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 状态:0-空闲,1-正在使用
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 状态:付费标志(0-无付费,1-正在付费)
|
||||
*/
|
||||
private String payFlag;
|
||||
/**
|
||||
* 绑定时间
|
||||
*/
|
||||
private LocalDateTime bindingTime;
|
||||
|
||||
}
|
@ -28,6 +28,10 @@ import java.math.BigDecimal;
|
||||
@AllArgsConstructor
|
||||
public class DishOrderDO extends BaseDO {
|
||||
|
||||
public final static String COMPLETE = "1";
|
||||
public final static String INCOMPLETE = "0";
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
|
@ -54,4 +54,9 @@ public class OrderDetailDO extends BaseDO {
|
||||
*/
|
||||
private Double heat;
|
||||
|
||||
/**
|
||||
* 菜品图片
|
||||
*/
|
||||
private String dishUrl;
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 充值金额配置 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("member_recharge_amount")
|
||||
@KeySequence("member_recharge_amount_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RechargeAmountDO extends BaseDO {
|
||||
|
||||
public static final String ON = "1";
|
||||
public static final String OFF = "0";
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private BigDecimal donateMoney;
|
||||
/**
|
||||
* 状态:0-关闭,1-开启
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.userexpand;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 用户拓展属性 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("member_user_expand")
|
||||
@KeySequence("member_user_expand_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserExpandDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
private String height;
|
||||
/**
|
||||
* 体重
|
||||
*/
|
||||
private String weight;
|
||||
/**
|
||||
* 健康状态
|
||||
*/
|
||||
private String health;
|
||||
/**
|
||||
* 饮食目标
|
||||
*/
|
||||
private String target;
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
private String card;
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.userpreference;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 用户偏好 DO
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@TableName("member_user_preference")
|
||||
@KeySequence("member_user_preference_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserPreferenceDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 辣度
|
||||
*/
|
||||
private String spicy;
|
||||
/**
|
||||
* 口味
|
||||
*/
|
||||
private String taste;
|
||||
/**
|
||||
* 健康状态
|
||||
*/
|
||||
private String health;
|
||||
/**
|
||||
* 食物类型
|
||||
*/
|
||||
private String foodType;
|
||||
/**
|
||||
* 过敏食物
|
||||
*/
|
||||
private String allergy;
|
||||
/**
|
||||
* 健康需求
|
||||
*/
|
||||
private String demand;
|
||||
/**
|
||||
* 饮食限制
|
||||
*/
|
||||
private String restrict;
|
||||
/**
|
||||
* 自定义
|
||||
*/
|
||||
private String custom;
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.card.vo.AppCardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.card.CardDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@ -24,4 +25,14 @@ public interface CardMapper extends BaseMapperX<CardDO> {
|
||||
.betweenIfPresent(CardDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CardDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<CardDO> selectPage(AppCardPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CardDO>()
|
||||
.eqIfPresent(CardDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(CardDO::getMoney, reqVO.getMoney())
|
||||
.eqIfPresent(CardDO::getFlag, reqVO.getFlag())
|
||||
.eqIfPresent(CardDO::getChangeMoney, reqVO.getChangeMoney())
|
||||
.betweenIfPresent(CardDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CardDO::getId));
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.diningplates;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 餐盘 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface DiningPlatesMapper extends BaseMapperX<DiningPlatesDO> {
|
||||
|
||||
default PageResult<DiningPlatesDO> selectPage(DiningPlatesPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DiningPlatesDO>()
|
||||
.eqIfPresent(DiningPlatesDO::getDiningPlatesNum, reqVO.getDiningPlatesNum())
|
||||
.eqIfPresent(DiningPlatesDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(DiningPlatesDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(DiningPlatesDO::getBindingTime, reqVO.getBindingTime())
|
||||
.betweenIfPresent(DiningPlatesDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DiningPlatesDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.rechargeamount;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 充值金额配置 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface RechargeAmountMapper extends BaseMapperX<RechargeAmountDO> {
|
||||
|
||||
default PageResult<RechargeAmountDO> selectPage(RechargeAmountPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RechargeAmountDO>()
|
||||
.eqIfPresent(RechargeAmountDO::getMoney, reqVO.getMoney())
|
||||
.eqIfPresent(RechargeAmountDO::getDonateMoney, reqVO.getDonateMoney())
|
||||
.eqIfPresent(RechargeAmountDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(RechargeAmountDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RechargeAmountDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.userexpand;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userexpand.vo.UserExpandPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userexpand.UserExpandDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户拓展属性 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserExpandMapper extends BaseMapperX<UserExpandDO> {
|
||||
|
||||
default PageResult<UserExpandDO> selectPage(UserExpandPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<UserExpandDO>()
|
||||
.eqIfPresent(UserExpandDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(UserExpandDO::getHeight, reqVO.getHeight())
|
||||
.eqIfPresent(UserExpandDO::getWeight, reqVO.getWeight())
|
||||
.eqIfPresent(UserExpandDO::getHealth, reqVO.getHealth())
|
||||
.eqIfPresent(UserExpandDO::getTarget, reqVO.getTarget())
|
||||
.eqIfPresent(UserExpandDO::getCard, reqVO.getCard())
|
||||
.betweenIfPresent(UserExpandDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(UserExpandDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.userpreference;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userpreference.vo.UserPreferencePageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userpreference.UserPreferenceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户偏好 Mapper
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserPreferenceMapper extends BaseMapperX<UserPreferenceDO> {
|
||||
|
||||
default PageResult<UserPreferenceDO> selectPage(UserPreferencePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<UserPreferenceDO>()
|
||||
.eqIfPresent(UserPreferenceDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(UserPreferenceDO::getSpicy, reqVO.getSpicy())
|
||||
.eqIfPresent(UserPreferenceDO::getTaste, reqVO.getTaste())
|
||||
.eqIfPresent(UserPreferenceDO::getHealth, reqVO.getHealth())
|
||||
.eqIfPresent(UserPreferenceDO::getFoodType, reqVO.getFoodType())
|
||||
.eqIfPresent(UserPreferenceDO::getAllergy, reqVO.getAllergy())
|
||||
.eqIfPresent(UserPreferenceDO::getDemand, reqVO.getDemand())
|
||||
.eqIfPresent(UserPreferenceDO::getRestrict, reqVO.getRestrict())
|
||||
.eqIfPresent(UserPreferenceDO::getCustom, reqVO.getCustom())
|
||||
.betweenIfPresent(UserPreferenceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(UserPreferenceDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -54,14 +54,14 @@ public enum TimePeriodEnum {
|
||||
.put("end", end).build();
|
||||
}
|
||||
|
||||
public String getTimePeriod(LocalDateTime localDateTime){
|
||||
public static String getTimePeriod(LocalDateTime localDateTime){
|
||||
int hour = localDateTime.getHour();
|
||||
if(TimePeriodEnum.MORNING.startInt<=hour && hour<=TimePeriodEnum.MORNING.endInt){
|
||||
return CostTypeEnum.MORNING.getName();
|
||||
return CostTypeEnum.MORNING.getCode();
|
||||
} else if (TimePeriodEnum.MIDDAY.startInt<=hour && hour<=TimePeriodEnum.MIDDAY.endInt){
|
||||
return CostTypeEnum.NOON.getName();
|
||||
return CostTypeEnum.NOON.getCode();
|
||||
}else{
|
||||
return CostTypeEnum.NIGHT.getName();
|
||||
return CostTypeEnum.NIGHT.getCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.member.job;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.card.CardDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.order.DishOrderDO;
|
||||
import cn.iocoder.yudao.module.member.enums.TimePeriodEnum;
|
||||
import cn.iocoder.yudao.module.member.service.card.CardService;
|
||||
import cn.iocoder.yudao.module.member.service.diningplates.DiningPlatesService;
|
||||
import cn.iocoder.yudao.module.member.service.order.OrderService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物理删除 N 天前的任务日志的 Job
|
||||
*
|
||||
* @author j-sentinel
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class BalanceDeductionJob implements JobHandler {
|
||||
|
||||
@Resource
|
||||
private DiningPlatesService platesService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private CardService cardService;
|
||||
|
||||
/**
|
||||
* 20分钟之后自动解绑并扣款
|
||||
*/
|
||||
private static final Integer EXPIRATION_TIME = 20;
|
||||
|
||||
/**
|
||||
* 每次删除间隔的条数,如果值太高可能会造成数据库的压力过大
|
||||
*/
|
||||
private static final Integer DELETE_LIMIT = 100;
|
||||
|
||||
@Override
|
||||
@TenantIgnore
|
||||
public String execute(String param) {
|
||||
//查询扣费用户
|
||||
List<DiningPlatesDO> diningPlatesToCharging = platesService.getDiningPlatesToCharging(EXPIRATION_TIME);
|
||||
int size = 0;
|
||||
|
||||
if(CollectionUtil.isNotEmpty(diningPlatesToCharging)){
|
||||
List<Long> ids = diningPlatesToCharging.stream().map(DiningPlatesDO::getId).collect(Collectors.toList());
|
||||
List<Long> users = diningPlatesToCharging.stream().map(DiningPlatesDO::getUserId).collect(Collectors.toList());
|
||||
//先更改状态防止重复消费
|
||||
platesService.updatePayFlag(ids,DiningPlatesDO.PAY);
|
||||
//获取用户订单
|
||||
List<DishOrderDO> toPay = orderService.getToPay(users);
|
||||
//扣除余额
|
||||
List<CardDO> list = new ArrayList<>();
|
||||
toPay.forEach(dishOrderDO -> {
|
||||
Long userId = dishOrderDO.getUserId();
|
||||
CardDO cardDO = new CardDO();
|
||||
cardDO.setType(TimePeriodEnum.getTimePeriod(LocalDateTime.now()));
|
||||
BigDecimal oldMoney = cardService.getMoneyByUserId(userId);
|
||||
cardDO.setMoney(oldMoney.subtract(dishOrderDO.getTotalMoney()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
cardDO.setUserId(userId);
|
||||
cardDO.setChangeMoney(dishOrderDO.getTotalMoney());
|
||||
cardDO.setFlag(CardDO.MINUS);
|
||||
list.add(cardDO);
|
||||
});
|
||||
cardService.insertBatch(list);
|
||||
size = list.size();
|
||||
//餐盘解绑、更改订单状态
|
||||
platesService.updateBind(ids);
|
||||
orderService.updateStatus(users);
|
||||
}
|
||||
|
||||
log.info("[execute][扣款定时任务扣款数量 ({}) 个]", size);
|
||||
return String.format("扣款定时任务扣款数量 %s 个", size);
|
||||
}
|
||||
|
||||
}
|
@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.member.service.card;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.card.vo.AppCardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.card.CardDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 余额变动明细 Service 接口
|
||||
@ -53,6 +55,14 @@ public interface CardService {
|
||||
*/
|
||||
PageResult<CardDO> getCardPage(CardPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得余额变动明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 余额变动明细分页
|
||||
*/
|
||||
PageResult<CardDO> getCardPage(AppCardPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 余额变动
|
||||
*/
|
||||
@ -63,4 +73,14 @@ public interface CardService {
|
||||
*/
|
||||
BigDecimal getMoney();
|
||||
|
||||
/**
|
||||
* 获取余额
|
||||
*/
|
||||
BigDecimal getMoneyByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 批量扣款
|
||||
*/
|
||||
void insertBatch(List<CardDO> list);
|
||||
|
||||
}
|
@ -1,10 +1,12 @@
|
||||
package cn.iocoder.yudao.module.member.service.card;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.card.vo.CardSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.card.vo.AppCardPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.card.CardDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.card.CardMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.CostTypeEnum;
|
||||
@ -15,6 +17,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.CARD_NOT_EXISTS;
|
||||
@ -75,6 +78,12 @@ public class CardServiceImpl implements CardService {
|
||||
return cardMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CardDO> getCardPage(AppCardPageReqVO pageReqVO) {
|
||||
return cardMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean recharge(BigDecimal money, String flag) {
|
||||
//获取最新余额
|
||||
@ -84,13 +93,14 @@ public class CardServiceImpl implements CardService {
|
||||
cardDO.setFlag(flag);
|
||||
cardDO.setChangeMoney(money);
|
||||
cardDO.setType(CostTypeEnum.WX_PAY.getCode());
|
||||
if(lastCardDO.getMoney() == null){
|
||||
lastCardDO.setMoney(BigDecimal.ZERO);
|
||||
BigDecimal oldMoney = BigDecimal.ZERO;
|
||||
if(ObjectUtil.isNotEmpty(lastCardDO) && lastCardDO.getMoney() != null){
|
||||
oldMoney = lastCardDO.getMoney();
|
||||
}
|
||||
if(CardDO.ADD.equals(flag)){
|
||||
cardDO.setMoney(lastCardDO.getMoney().add(money).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
cardDO.setMoney(oldMoney.add(money).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}else {
|
||||
cardDO.setMoney(lastCardDO.getMoney().subtract(money).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
cardDO.setMoney(oldMoney.subtract(money).setScale(2, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
return cardMapper.insert(cardDO)>0;
|
||||
}
|
||||
@ -104,6 +114,16 @@ public class CardServiceImpl implements CardService {
|
||||
return lastCardDO.getMoney();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getMoneyByUserId(Long userId) {
|
||||
CardDO lastCardDO = cardMapper.selectOne(Wrappers.<CardDO>lambdaQuery().eq(CardDO::getUserId, userId)
|
||||
.orderByDesc(CardDO::getCreateTime).last("limit 1"));
|
||||
if (lastCardDO.getMoney() == null){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return lastCardDO.getMoney();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户最新余额明细
|
||||
* @return
|
||||
@ -114,5 +134,8 @@ public class CardServiceImpl implements CardService {
|
||||
return lastCardDO;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void insertBatch(List<CardDO> list) {
|
||||
cardMapper.insertBatch(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.member.service.diningplates;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 餐盘 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface DiningPlatesService {
|
||||
|
||||
/**
|
||||
* 创建餐盘
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createDiningPlates(@Valid DiningPlatesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新餐盘
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDiningPlates(@Valid DiningPlatesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除餐盘
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDiningPlates(Long id);
|
||||
|
||||
/**
|
||||
* 获得餐盘
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 餐盘
|
||||
*/
|
||||
DiningPlatesDO getDiningPlates(Long id);
|
||||
|
||||
/**
|
||||
* 获得餐盘分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 餐盘分页
|
||||
*/
|
||||
PageResult<DiningPlatesDO> getDiningPlatesPage(DiningPlatesPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获取扣费餐盘
|
||||
*
|
||||
* @param time
|
||||
*/
|
||||
List<DiningPlatesDO> getDiningPlatesToCharging(Integer time);
|
||||
|
||||
/**
|
||||
* 修改付费状态
|
||||
*/
|
||||
void updatePayFlag(List<Long> ids,String payStatus);
|
||||
|
||||
/**
|
||||
* 解绑
|
||||
*/
|
||||
void updateBind(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 餐盘列表
|
||||
* @return
|
||||
*/
|
||||
List<DiningPlatesDO> getDiningPlatesList();
|
||||
|
||||
/**
|
||||
* 绑定
|
||||
* @return
|
||||
*/
|
||||
Boolean bind(String diningPlatesNum);
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package cn.iocoder.yudao.module.member.service.diningplates;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.diningplates.vo.DiningPlatesSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.diningplates.DiningPlatesMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.DINING_PLATES_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 餐盘 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DiningPlatesServiceImpl implements DiningPlatesService {
|
||||
|
||||
@Resource
|
||||
private DiningPlatesMapper diningPlatesMapper;
|
||||
|
||||
@Override
|
||||
public Long createDiningPlates(DiningPlatesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DiningPlatesDO diningPlates = BeanUtils.toBean(createReqVO, DiningPlatesDO.class);
|
||||
diningPlatesMapper.insert(diningPlates);
|
||||
// 返回
|
||||
return diningPlates.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDiningPlates(DiningPlatesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDiningPlatesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DiningPlatesDO updateObj = BeanUtils.toBean(updateReqVO, DiningPlatesDO.class);
|
||||
diningPlatesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDiningPlates(Long id) {
|
||||
// 校验存在
|
||||
validateDiningPlatesExists(id);
|
||||
// 删除
|
||||
diningPlatesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateDiningPlatesExists(Long id) {
|
||||
if (diningPlatesMapper.selectById(id) == null) {
|
||||
throw exception(DINING_PLATES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiningPlatesDO getDiningPlates(Long id) {
|
||||
return diningPlatesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DiningPlatesDO> getDiningPlatesPage(DiningPlatesPageReqVO pageReqVO) {
|
||||
return diningPlatesMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiningPlatesDO> getDiningPlatesToCharging(Integer time) {
|
||||
// 获取当前时间
|
||||
LocalDateTime currentTime = LocalDateTime.now();
|
||||
|
||||
// 计算指定分钟之前的时间
|
||||
LocalDateTime timeMinutesAgo = currentTime.minusMinutes(time);
|
||||
|
||||
LambdaQueryWrapper<DiningPlatesDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DiningPlatesDO::getStatus, DiningPlatesDO.USE)
|
||||
.eq(DiningPlatesDO::getPayFlag, DiningPlatesDO.TO_PAY)
|
||||
.le(DiningPlatesDO::getBindingTime, timeMinutesAgo);
|
||||
|
||||
List<DiningPlatesDO> diningPlatesDOS = diningPlatesMapper.selectList(wrapper);
|
||||
return diningPlatesDOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePayFlag(List<Long> ids,String payStatus) {
|
||||
diningPlatesMapper.update(Wrappers.<DiningPlatesDO>lambdaUpdate()
|
||||
.set(DiningPlatesDO::getPayFlag,DiningPlatesDO.PAY)
|
||||
.in(DiningPlatesDO::getId,ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBind(List<Long> ids) {
|
||||
diningPlatesMapper.update(Wrappers.<DiningPlatesDO>lambdaUpdate()
|
||||
.set(DiningPlatesDO::getPayFlag,DiningPlatesDO.TO_PAY)
|
||||
.set(DiningPlatesDO::getStatus,DiningPlatesDO.FREE)
|
||||
.set(DiningPlatesDO::getUserId,null)
|
||||
.set(DiningPlatesDO::getBindingTime,null)
|
||||
.in(DiningPlatesDO::getId,ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiningPlatesDO> getDiningPlatesList() {
|
||||
return diningPlatesMapper.selectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean bind(String diningPlatesNum) {
|
||||
DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(Wrappers.<DiningPlatesDO>lambdaQuery()
|
||||
.eq(DiningPlatesDO::getDiningPlatesNum, diningPlatesNum)
|
||||
.last("limit 1"));
|
||||
diningPlatesDO.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
diningPlatesDO.setStatus(DiningPlatesDO.USE);
|
||||
diningPlatesDO.setBindingTime(LocalDateTime.now());
|
||||
int i = diningPlatesMapper.updateById(diningPlatesDO);
|
||||
return i>0;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.service.order;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.order.vo.OrderDetailsReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.order.vo.OrderDetailsRespVO;
|
||||
@ -9,6 +10,7 @@ import cn.iocoder.yudao.module.member.controller.app.order.vo.AppOrderSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.order.DishOrderDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -58,9 +60,29 @@ public interface OrderService {
|
||||
|
||||
/**
|
||||
* 获得会员订单分页
|
||||
* @return 会员订单分页
|
||||
* @return
|
||||
*/
|
||||
List<AppOrderRespVO> getOrderList();
|
||||
PageResult<AppOrderRespVO> getOrderList(PageParam vo);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户的未支付订单
|
||||
* @return
|
||||
*/
|
||||
List<DishOrderDO> getToPay(List<Long> users);
|
||||
|
||||
/**
|
||||
* 更改用户的支付状态
|
||||
* @return
|
||||
*/
|
||||
void updateStatus(List<Long> users);
|
||||
|
||||
/**
|
||||
* 根据时间获取用户的订单
|
||||
* @return
|
||||
*/
|
||||
List<DishOrderDO> getDishOrderByTime(LocalDateTime startTime ,LocalDateTime endTime );
|
||||
|
||||
|
||||
PageResult<OrderDetailsRespVO> getPageOrderDetails(OrderDetailsReqVO reqVO);
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
package cn.iocoder.yudao.module.member.service.order;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@ -28,12 +26,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -111,17 +105,16 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppOrderRespVO> getOrderList() {
|
||||
public PageResult<AppOrderRespVO> getOrderList(PageParam vo) {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
List<DishOrderDO> dishOrderDOS = dishOrderMapper.selectList(Wrappers.<DishOrderDO>lambdaQuery().eq(DishOrderDO::getUserId,loginUserId));
|
||||
List<AppOrderRespVO> vos = new ArrayList<>();
|
||||
for (DishOrderDO dishOrderDO : dishOrderDOS){
|
||||
PageResult<DishOrderDO> dishOrderDOPageResult = dishOrderMapper.selectPage(vo, Wrappers.<DishOrderDO>lambdaQuery().eq(DishOrderDO::getUserId, loginUserId));
|
||||
PageResult<AppOrderRespVO> appOrderRespVOPageResult = BeanUtils.toBean(dishOrderDOPageResult, AppOrderRespVO.class);
|
||||
for (AppOrderRespVO dishOrderDO : appOrderRespVOPageResult.getList()){
|
||||
List<AppOrderDetailRespVO> appOrderDetailRespVOS = orderDetailService.selectListByOrderId(dishOrderDO.getId());
|
||||
AppOrderRespVO appOrderRespVO = BeanUtils.toBean(dishOrderDO, AppOrderRespVO.class);
|
||||
appOrderRespVO.setDetailList(appOrderDetailRespVOS);
|
||||
vos.add(appOrderRespVO);
|
||||
dishOrderDO.setDetailList(appOrderDetailRespVOS);
|
||||
}
|
||||
return vos;
|
||||
|
||||
return appOrderRespVOPageResult;
|
||||
}
|
||||
@Override
|
||||
public PageResult<OrderDetailsRespVO> getPageOrderDetails(OrderDetailsReqVO reqVO) {
|
||||
@ -175,5 +168,26 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DishOrderDO> getToPay(List<Long> users) {
|
||||
List<DishOrderDO> dishOrderDOS = dishOrderMapper.selectList(Wrappers.<DishOrderDO>lambdaQuery()
|
||||
.in(DishOrderDO::getUserId, users)
|
||||
.eq(DishOrderDO::getOrderStatus, DishOrderDO.INCOMPLETE));
|
||||
return dishOrderDOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(List<Long> users) {
|
||||
dishOrderMapper.update(Wrappers.<DishOrderDO>lambdaUpdate()
|
||||
.in(DishOrderDO::getUserId, users)
|
||||
.eq(DishOrderDO::getOrderStatus, DishOrderDO.INCOMPLETE)
|
||||
.set(DishOrderDO::getOrderStatus,DishOrderDO.COMPLETE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DishOrderDO> getDishOrderByTime(LocalDateTime startTime, LocalDateTime endTime) {
|
||||
List<DishOrderDO> dishOrderDOS = dishOrderMapper.selectList(Wrappers.<DishOrderDO>lambdaQuery()
|
||||
.between(DishOrderDO::getCreateTime, startTime, endTime));
|
||||
return dishOrderDOS;
|
||||
}
|
||||
}
|
@ -56,4 +56,5 @@ public interface OrderDetailService {
|
||||
|
||||
List<AppOrderDetailRespVO> selectListByOrderId(Long orderId);
|
||||
|
||||
List<OrderDetailDO> selectListByOrderIds(List<Long> orderIds);
|
||||
}
|
@ -77,4 +77,10 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailMapper.selectList(Wrappers.<OrderDetailDO>lambdaQuery().eq(OrderDetailDO::getOrderId, orderId));
|
||||
return BeanUtils.toBean(orderDetailDOS, AppOrderDetailRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderDetailDO> selectListByOrderIds(List<Long> orderIds) {
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailMapper.selectList(Wrappers.<OrderDetailDO>lambdaQuery().in(OrderDetailDO::getOrderId, orderIds));
|
||||
return orderDetailDOS;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.member.service.rechargeamount;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值金额配置 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface RechargeAmountService {
|
||||
|
||||
/**
|
||||
* 创建充值金额配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRechargeAmount(@Valid RechargeAmountSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新充值金额配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRechargeAmount(@Valid RechargeAmountSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除充值金额配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRechargeAmount(Long id);
|
||||
|
||||
/**
|
||||
* 获得充值金额配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 充值金额配置
|
||||
*/
|
||||
RechargeAmountDO getRechargeAmount(Long id);
|
||||
|
||||
/**
|
||||
* 获得充值金额配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 充值金额配置分页
|
||||
*/
|
||||
PageResult<RechargeAmountDO> getRechargeAmountPage(RechargeAmountPageReqVO pageReqVO);
|
||||
|
||||
List<RechargeAmountDO> getAmount();
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.member.service.rechargeamount;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.rechargeamount.vo.RechargeAmountSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.rechargeamount.RechargeAmountDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.rechargeamount.RechargeAmountMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.RECHARGE_AMOUNT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 充值金额配置 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RechargeAmountServiceImpl implements RechargeAmountService {
|
||||
|
||||
@Resource
|
||||
private RechargeAmountMapper rechargeAmountMapper;
|
||||
|
||||
@Override
|
||||
public Long createRechargeAmount(RechargeAmountSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RechargeAmountDO rechargeAmount = BeanUtils.toBean(createReqVO, RechargeAmountDO.class);
|
||||
rechargeAmountMapper.insert(rechargeAmount);
|
||||
// 返回
|
||||
return rechargeAmount.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRechargeAmount(RechargeAmountSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRechargeAmountExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RechargeAmountDO updateObj = BeanUtils.toBean(updateReqVO, RechargeAmountDO.class);
|
||||
rechargeAmountMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRechargeAmount(Long id) {
|
||||
// 校验存在
|
||||
validateRechargeAmountExists(id);
|
||||
// 删除
|
||||
rechargeAmountMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRechargeAmountExists(Long id) {
|
||||
if (rechargeAmountMapper.selectById(id) == null) {
|
||||
throw exception(RECHARGE_AMOUNT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RechargeAmountDO getRechargeAmount(Long id) {
|
||||
return rechargeAmountMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RechargeAmountDO> getRechargeAmountPage(RechargeAmountPageReqVO pageReqVO) {
|
||||
return rechargeAmountMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RechargeAmountDO> getAmount() {
|
||||
List<RechargeAmountDO> list = rechargeAmountMapper.selectList(Wrappers.<RechargeAmountDO>lambdaQuery()
|
||||
.eq(RechargeAmountDO::getStatus, RechargeAmountDO.ON)
|
||||
.orderByAsc(RechargeAmountDO::getMoney));
|
||||
return list;
|
||||
}
|
||||
}
|
@ -5,7 +5,13 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserResetPasswordReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateMobileByWeixinReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateMobileReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdatePasswordReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppNutritionDayVo;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppNutritionWeekVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@ -192,5 +198,13 @@ public interface MemberUserService {
|
||||
*/
|
||||
boolean bindCard(String cardId);
|
||||
|
||||
/**
|
||||
* 营养日报
|
||||
*/
|
||||
List<AppNutritionDayVo> nutritionDay(String time);
|
||||
/**
|
||||
* 营养周报
|
||||
*/
|
||||
List<AppNutritionWeekVO> NutritionWeek(String start, String end);
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.member.service.user;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@ -19,12 +20,19 @@ import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdate
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateMobileReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdatePasswordReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppNutritionDayVo;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppNutritionWeekVO;
|
||||
import cn.iocoder.yudao.module.member.convert.auth.AuthConvert;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.order.DishOrderDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.orderdetail.OrderDetailDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.card.CardMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
||||
import cn.iocoder.yudao.module.member.enums.TimePeriodEnum;
|
||||
import cn.iocoder.yudao.module.member.mq.producer.user.MemberUserProducer;
|
||||
import cn.iocoder.yudao.module.member.service.order.OrderService;
|
||||
import cn.iocoder.yudao.module.member.service.orderdetail.OrderDetailService;
|
||||
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
|
||||
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.social.SocialClientApi;
|
||||
@ -32,6 +40,7 @@ import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoResp
|
||||
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
|
||||
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;
|
||||
@ -40,9 +49,13 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
@ -76,6 +89,20 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
@Resource
|
||||
private CardMapper cardMapper;
|
||||
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@Resource
|
||||
private OrderDetailService orderDetailService;
|
||||
|
||||
@Value("${propose.morning}")
|
||||
private Double proposeMorning;
|
||||
@Value("${propose.noon}")
|
||||
private Double proposeNoon;
|
||||
@Value("${propose.night}")
|
||||
private Double proposeNight;
|
||||
|
||||
|
||||
@Override
|
||||
public MemberUserDO getUserByMobile(String mobile) {
|
||||
return memberUserMapper.selectByMobile(mobile);
|
||||
@ -332,4 +359,173 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
memberUserDO.setCardId(cardId);
|
||||
return memberUserMapper.updateById(memberUserDO) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppNutritionDayVo> nutritionDay(String time) {
|
||||
List<AppNutritionDayVo> result = new ArrayList<>();
|
||||
//获取日期的订单
|
||||
String start = time+"00:00:00";
|
||||
String end = time+"23:59:59";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
LocalDateTime startTime = LocalDateTime.parse(start, formatter);
|
||||
LocalDateTime endTime = LocalDateTime.parse(end, formatter);
|
||||
List<DishOrderDO> dishOrderDOS = orderService.getDishOrderByTime(startTime, endTime);
|
||||
List<Long> moIds = new ArrayList<>();
|
||||
List<Long> miIds = new ArrayList<>();
|
||||
List<Long> niIds = new ArrayList<>();
|
||||
for (DishOrderDO orderDO : dishOrderDOS){
|
||||
int hour = orderDO.getCreateTime().getHour();
|
||||
//早
|
||||
if(TimePeriodEnum.MORNING.getStartInt()<=hour && hour<=TimePeriodEnum.MORNING.getEndInt()){
|
||||
moIds.add(orderDO.getId());
|
||||
} else if (TimePeriodEnum.MIDDAY.getStartInt()<=hour && hour<=TimePeriodEnum.MIDDAY.getEndInt()){
|
||||
miIds.add(orderDO.getId());
|
||||
}else{
|
||||
niIds.add(orderDO.getId());
|
||||
}
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(moIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(moIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d, Double::sum);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(proposeMorning);
|
||||
appNutritionDayVo.setTimePeriod("1");
|
||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||
result.add(appNutritionDayVo);
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(miIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(miIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d, Double::sum);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(proposeNoon);
|
||||
appNutritionDayVo.setTimePeriod("2");
|
||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||
result.add(appNutritionDayVo);
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(niIds)){
|
||||
List<OrderDetailDO> orderDetailDOS = orderDetailService.selectListByOrderIds(niIds);
|
||||
AppNutritionDayVo appNutritionDayVo = new AppNutritionDayVo();
|
||||
Double reduce = orderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d, Double::sum);
|
||||
appNutritionDayVo.setIntake(reduce);
|
||||
appNutritionDayVo.setProposeIntake(proposeNight);
|
||||
appNutritionDayVo.setTimePeriod("3");
|
||||
appNutritionDayVo.setDetailList(orderDetailDOS);
|
||||
result.add(appNutritionDayVo);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppNutritionWeekVO> NutritionWeek(String start, String end) {
|
||||
List<AppNutritionWeekVO> result = new ArrayList<>();
|
||||
//获取日期的订单
|
||||
String newStart = start+"00:00:00";
|
||||
String newEnd = end+"23:59:59";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
LocalDateTime startTime = LocalDateTime.parse(newStart, formatter);
|
||||
LocalDateTime endTime = LocalDateTime.parse(newEnd, formatter);
|
||||
List<DishOrderDO> dishOrderDOS = orderService.getDishOrderByTime(startTime, endTime);
|
||||
//周一
|
||||
LocalDateTime monday = startTime.with(DayOfWeek.MONDAY);
|
||||
String mondayString = monday.format(formatter1);
|
||||
List<DishOrderDO> mondayCollect = dishOrderDOS.stream().filter(orderDO -> mondayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> mondayOrderIds = mondayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> mondayOrderDetailDOS = orderDetailService.selectListByOrderIds(mondayOrderIds);
|
||||
AppNutritionWeekVO mondayVO = new AppNutritionWeekVO();
|
||||
mondayVO.setDetailList(mondayOrderDetailDOS);
|
||||
mondayVO.setIntake(mondayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
mondayVO.setTime(mondayString);
|
||||
result.add(mondayVO);
|
||||
|
||||
//周二
|
||||
LocalDateTime tuesday = startTime.with(DayOfWeek.TUESDAY);
|
||||
String tuesdayString = tuesday.format(formatter1);
|
||||
List<DishOrderDO> tuesdayCollect = dishOrderDOS.stream().filter(orderDO -> tuesdayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> tuesdayOrderIds = tuesdayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> tuesdayOrderDetailDOS = orderDetailService.selectListByOrderIds(tuesdayOrderIds);
|
||||
AppNutritionWeekVO tuesdayVO = new AppNutritionWeekVO();
|
||||
tuesdayVO.setDetailList(tuesdayOrderDetailDOS);
|
||||
tuesdayVO.setIntake(tuesdayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
tuesdayVO.setTime(tuesdayString);
|
||||
result.add(tuesdayVO);
|
||||
|
||||
//周三
|
||||
LocalDateTime wednesday = startTime.with(DayOfWeek.WEDNESDAY);
|
||||
String wednesdayString = wednesday.format(formatter1);
|
||||
List<DishOrderDO> wednesdayCollect = dishOrderDOS.stream().filter(orderDO -> wednesdayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> wednesdayOrderIds = wednesdayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> wednesdayOrderDetailDOS = orderDetailService.selectListByOrderIds(wednesdayOrderIds);
|
||||
AppNutritionWeekVO wednesdayVO = new AppNutritionWeekVO();
|
||||
wednesdayVO.setDetailList(wednesdayOrderDetailDOS);
|
||||
wednesdayVO.setIntake(wednesdayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
wednesdayVO.setTime(wednesdayString);
|
||||
result.add(wednesdayVO);
|
||||
|
||||
//周四
|
||||
LocalDateTime thursday = startTime.with(DayOfWeek.THURSDAY);
|
||||
String thursdayString = thursday.format(formatter1);
|
||||
List<DishOrderDO> thursdayCollect = dishOrderDOS.stream().filter(orderDO -> thursdayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> thursdayOrderIds = thursdayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> thursdayOrderDetailDOS = orderDetailService.selectListByOrderIds(thursdayOrderIds);
|
||||
AppNutritionWeekVO thursdayVO = new AppNutritionWeekVO();
|
||||
thursdayVO.setDetailList(thursdayOrderDetailDOS);
|
||||
thursdayVO.setIntake(thursdayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
thursdayVO.setTime(thursdayString);
|
||||
result.add(thursdayVO);
|
||||
|
||||
//周五
|
||||
LocalDateTime friday = startTime.with(DayOfWeek.FRIDAY);
|
||||
String fridayString = friday.format(formatter1);
|
||||
List<DishOrderDO> fridayCollect = dishOrderDOS.stream().filter(orderDO -> fridayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> fridayOrderIds = fridayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> fridayOrderDetailDOS = orderDetailService.selectListByOrderIds(fridayOrderIds);
|
||||
AppNutritionWeekVO fridayVO = new AppNutritionWeekVO();
|
||||
fridayVO.setDetailList(fridayOrderDetailDOS);
|
||||
fridayVO.setIntake(fridayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
fridayVO.setTime(fridayString);
|
||||
result.add(fridayVO);
|
||||
|
||||
//周六
|
||||
LocalDateTime saturday = startTime.with(DayOfWeek.SATURDAY);
|
||||
String saturdayString = saturday.format(formatter1);
|
||||
List<DishOrderDO> saturdayCollect = dishOrderDOS.stream().filter(orderDO -> saturdayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> saturdayOrderIds = saturdayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> saturdayOrderDetailDOS = orderDetailService.selectListByOrderIds(saturdayOrderIds);
|
||||
AppNutritionWeekVO saturdayVO = new AppNutritionWeekVO();
|
||||
saturdayVO.setDetailList(saturdayOrderDetailDOS);
|
||||
saturdayVO.setIntake(saturdayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
saturdayVO.setTime(saturdayString);
|
||||
result.add(saturdayVO);
|
||||
|
||||
//周日
|
||||
LocalDateTime sunday = startTime.with(DayOfWeek.SUNDAY);
|
||||
String sundayString = sunday.format(formatter1);
|
||||
List<DishOrderDO> sundayCollect = dishOrderDOS.stream().filter(orderDO -> sundayString.equals(orderDO.getCreateTime().format(formatter1)))
|
||||
.collect(Collectors.toList());
|
||||
//获取当天的点的所有菜品
|
||||
List<Long> sundayOrderIds = sundayCollect.stream().map(DishOrderDO::getId).collect(Collectors.toList());
|
||||
List<OrderDetailDO> sundayOrderDetailDOS = orderDetailService.selectListByOrderIds(sundayOrderIds);
|
||||
AppNutritionWeekVO sundayVO = new AppNutritionWeekVO();
|
||||
sundayVO.setDetailList(sundayOrderDetailDOS);
|
||||
sundayVO.setIntake(sundayOrderDetailDOS.stream().map(OrderDetailDO::getHeat).reduce(0d,Double::sum));
|
||||
sundayVO.setTime(sundayString);
|
||||
result.add(sundayVO);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.member.service.userexpand;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userexpand.vo.UserExpandPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userexpand.vo.UserExpandSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userexpand.UserExpandDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户拓展属性 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface UserExpandService {
|
||||
|
||||
/**
|
||||
* 创建用户拓展属性
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createUserExpand(@Valid UserExpandSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户拓展属性
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateUserExpand(@Valid UserExpandSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户拓展属性
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteUserExpand(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户拓展属性
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户拓展属性
|
||||
*/
|
||||
UserExpandDO getUserExpand(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户拓展属性分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户拓展属性分页
|
||||
*/
|
||||
PageResult<UserExpandDO> getUserExpandPage(UserExpandPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.member.service.userexpand;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userexpand.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userexpand.UserExpandDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.userexpand.UserExpandMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 用户拓展属性 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UserExpandServiceImpl implements UserExpandService {
|
||||
|
||||
@Resource
|
||||
private UserExpandMapper userExpandMapper;
|
||||
|
||||
@Override
|
||||
public Long createUserExpand(UserExpandSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
UserExpandDO userExpand = BeanUtils.toBean(createReqVO, UserExpandDO.class);
|
||||
userExpandMapper.insert(userExpand);
|
||||
// 返回
|
||||
return userExpand.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserExpand(UserExpandSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateUserExpandExists(updateReqVO.getId());
|
||||
// 更新
|
||||
UserExpandDO updateObj = BeanUtils.toBean(updateReqVO, UserExpandDO.class);
|
||||
userExpandMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserExpand(Long id) {
|
||||
// 校验存在
|
||||
validateUserExpandExists(id);
|
||||
// 删除
|
||||
userExpandMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateUserExpandExists(Long id) {
|
||||
if (userExpandMapper.selectById(id) == null) {
|
||||
throw exception(USER_EXPAND_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserExpandDO getUserExpand(Long id) {
|
||||
return userExpandMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserExpandDO> getUserExpandPage(UserExpandPageReqVO pageReqVO) {
|
||||
return userExpandMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.member.service.userpreference;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userpreference.vo.UserPreferencePageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userpreference.vo.UserPreferenceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userpreference.UserPreferenceDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户偏好 Service 接口
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
public interface UserPreferenceService {
|
||||
|
||||
/**
|
||||
* 创建用户偏好
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createUserPreference(@Valid UserPreferenceSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新用户偏好
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateUserPreference(@Valid UserPreferenceSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除用户偏好
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteUserPreference(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户偏好
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 用户偏好
|
||||
*/
|
||||
UserPreferenceDO getUserPreference(Long id);
|
||||
|
||||
/**
|
||||
* 获得用户偏好分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 用户偏好分页
|
||||
*/
|
||||
PageResult<UserPreferenceDO> getUserPreferencePage(UserPreferencePageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cn.iocoder.yudao.module.member.service.userpreference;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.userpreference.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.userpreference.UserPreferenceDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.userpreference.UserPreferenceMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 用户偏好 Service 实现类
|
||||
*
|
||||
* @author 开发账号
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class UserPreferenceServiceImpl implements UserPreferenceService {
|
||||
|
||||
@Resource
|
||||
private UserPreferenceMapper userPreferenceMapper;
|
||||
|
||||
@Override
|
||||
public Long createUserPreference(UserPreferenceSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
UserPreferenceDO userPreference = BeanUtils.toBean(createReqVO, UserPreferenceDO.class);
|
||||
userPreferenceMapper.insert(userPreference);
|
||||
// 返回
|
||||
return userPreference.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserPreference(UserPreferenceSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateUserPreferenceExists(updateReqVO.getId());
|
||||
// 更新
|
||||
UserPreferenceDO updateObj = BeanUtils.toBean(updateReqVO, UserPreferenceDO.class);
|
||||
userPreferenceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserPreference(Long id) {
|
||||
// 校验存在
|
||||
validateUserPreferenceExists(id);
|
||||
// 删除
|
||||
userPreferenceMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateUserPreferenceExists(Long id) {
|
||||
if (userPreferenceMapper.selectById(id) == null) {
|
||||
throw exception(USER_PREFERENCE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserPreferenceDO getUserPreference(Long id) {
|
||||
return userPreferenceMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<UserPreferenceDO> getUserPreferencePage(UserPreferencePageReqVO pageReqVO) {
|
||||
return userPreferenceMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.member.dal.mysql.diningplates.DiningPlatesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
|
||||
</mapper>
|
@ -184,7 +184,7 @@ yudao:
|
||||
- cn.iocoder.yudao.module.system.enums.ErrorCodeConstants
|
||||
- cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
enable: false
|
||||
ignore-urls:
|
||||
- /admin-api/system/tenant/get-id-by-name # 基于名字获取租户,不许带租户编号
|
||||
- /admin-api/system/tenant/get-by-website # 基于域名获取租户,不许带租户编号
|
||||
@ -273,3 +273,9 @@ ureport:
|
||||
provider:
|
||||
database:
|
||||
disabled: false
|
||||
|
||||
# 早中晚推荐
|
||||
propose:
|
||||
morning: 200
|
||||
noon: 750
|
||||
night: 150
|
Reference in New Issue
Block a user