去除无用接口
Showing
23 changed files
with
436 additions
and
225 deletions
| ... | @@ -30,7 +30,7 @@ import java.time.LocalDateTime; | ... | @@ -30,7 +30,7 @@ import java.time.LocalDateTime; |
| 30 | * 实体类 | 30 | * 实体类 |
| 31 | * | 31 | * |
| 32 | * @author BladeX | 32 | * @author BladeX |
| 33 | * @since 2019-11-06 | 33 | * @since 2019-11-07 |
| 34 | */ | 34 | */ |
| 35 | @Data | 35 | @Data |
| 36 | @TableName("fs_coupon") | 36 | @TableName("fs_coupon") | ... | ... |
| ... | @@ -17,6 +17,8 @@ | ... | @@ -17,6 +17,8 @@ |
| 17 | package org.springblade.store.entity; | 17 | package org.springblade.store.entity; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.annotation.TableName; | 19 | import com.baomidou.mybatisplus.annotation.TableName; |
| 20 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 21 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
| 20 | import io.swagger.annotations.ApiModel; | 22 | import io.swagger.annotations.ApiModel; |
| 21 | import io.swagger.annotations.ApiModelProperty; | 23 | import io.swagger.annotations.ApiModelProperty; |
| 22 | import lombok.Data; | 24 | import lombok.Data; |
| ... | @@ -30,7 +32,7 @@ import java.time.LocalDateTime; | ... | @@ -30,7 +32,7 @@ import java.time.LocalDateTime; |
| 30 | * 实体类 | 32 | * 实体类 |
| 31 | * | 33 | * |
| 32 | * @author BladeX | 34 | * @author BladeX |
| 33 | * @since 2019-11-06 | 35 | * @since 2019-11-07 |
| 34 | */ | 36 | */ |
| 35 | @Data | 37 | @Data |
| 36 | @TableName("fs_order") | 38 | @TableName("fs_order") |
| ... | @@ -48,11 +50,13 @@ public class Order extends BaseEntity { | ... | @@ -48,11 +50,13 @@ public class Order extends BaseEntity { |
| 48 | /** | 50 | /** |
| 49 | * 用户ID | 51 | * 用户ID |
| 50 | */ | 52 | */ |
| 53 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 51 | @ApiModelProperty(value = "用户ID") | 54 | @ApiModelProperty(value = "用户ID") |
| 52 | private Long userId; | 55 | private Long userId; |
| 53 | /** | 56 | /** |
| 54 | * 园区地址ID | 57 | * 园区地址ID |
| 55 | */ | 58 | */ |
| 59 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 56 | @ApiModelProperty(value = "园区地址ID") | 60 | @ApiModelProperty(value = "园区地址ID") |
| 57 | private Long addressId; | 61 | private Long addressId; |
| 58 | /** | 62 | /** |
| ... | @@ -73,10 +77,12 @@ public class Order extends BaseEntity { | ... | @@ -73,10 +77,12 @@ public class Order extends BaseEntity { |
| 73 | /** | 77 | /** |
| 74 | * 商品id | 78 | * 商品id |
| 75 | */ | 79 | */ |
| 80 | @ApiModelProperty(value = "商品id") | ||
| 76 | private Long productId; | 81 | private Long productId; |
| 77 | /** | 82 | /** |
| 78 | * 品类Id | 83 | * 品类Id |
| 79 | */ | 84 | */ |
| 85 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 80 | @ApiModelProperty(value = "品类Id") | 86 | @ApiModelProperty(value = "品类Id") |
| 81 | private Long categoryId; | 87 | private Long categoryId; |
| 82 | /** | 88 | /** |
| ... | @@ -90,8 +96,14 @@ public class Order extends BaseEntity { | ... | @@ -90,8 +96,14 @@ public class Order extends BaseEntity { |
| 90 | @ApiModelProperty(value = "总价") | 96 | @ApiModelProperty(value = "总价") |
| 91 | private BigDecimal totalPrice; | 97 | private BigDecimal totalPrice; |
| 92 | /** | 98 | /** |
| 99 | * 优惠价 | ||
| 100 | */ | ||
| 101 | @ApiModelProperty(value = "优惠价") | ||
| 102 | private BigDecimal discountPrice; | ||
| 103 | /** | ||
| 93 | * 优惠券ID | 104 | * 优惠券ID |
| 94 | */ | 105 | */ |
| 106 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 95 | @ApiModelProperty(value = "优惠券ID") | 107 | @ApiModelProperty(value = "优惠券ID") |
| 96 | private Long couponId; | 108 | private Long couponId; |
| 97 | /** | 109 | /** |
| ... | @@ -102,6 +114,7 @@ public class Order extends BaseEntity { | ... | @@ -102,6 +114,7 @@ public class Order extends BaseEntity { |
| 102 | /** | 114 | /** |
| 103 | * 用户优惠券ID | 115 | * 用户优惠券ID |
| 104 | */ | 116 | */ |
| 117 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 105 | @ApiModelProperty(value = "用户优惠券ID") | 118 | @ApiModelProperty(value = "用户优惠券ID") |
| 106 | private Long userCouponId; | 119 | private Long userCouponId; |
| 107 | 120 | ... | ... |
| ... | @@ -18,18 +18,18 @@ package org.springblade.store.entity; | ... | @@ -18,18 +18,18 @@ package org.springblade.store.entity; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.annotation.TableName; | 19 | import com.baomidou.mybatisplus.annotation.TableName; |
| 20 | import io.swagger.annotations.ApiModel; | 20 | import io.swagger.annotations.ApiModel; |
| 21 | import io.swagger.annotations.ApiModelProperty; | ||
| 21 | import lombok.Data; | 22 | import lombok.Data; |
| 22 | import lombok.EqualsAndHashCode; | 23 | import lombok.EqualsAndHashCode; |
| 23 | import org.springblade.core.mp.base.BaseEntity; | 24 | import org.springblade.core.mp.base.BaseEntity; |
| 24 | 25 | ||
| 25 | import java.time.LocalDate; | ||
| 26 | import java.time.LocalDateTime; | 26 | import java.time.LocalDateTime; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 实体类 | 29 | * 实体类 |
| 30 | * | 30 | * |
| 31 | * @author BladeX | 31 | * @author BladeX |
| 32 | * @since 2019-11-06 | 32 | * @since 2019-11-07 |
| 33 | */ | 33 | */ |
| 34 | @Data | 34 | @Data |
| 35 | @TableName("fs_product") | 35 | @TableName("fs_product") |
| ... | @@ -39,10 +39,30 @@ public class Product extends BaseEntity { | ... | @@ -39,10 +39,30 @@ public class Product extends BaseEntity { |
| 39 | 39 | ||
| 40 | private static final long serialVersionUID = 1L; | 40 | private static final long serialVersionUID = 1L; |
| 41 | 41 | ||
| 42 | private String name; | 42 | /** |
| 43 | * 商品名 | ||
| 44 | */ | ||
| 45 | @ApiModelProperty(value = "商品名") | ||
| 46 | private String productName; | ||
| 47 | /** | ||
| 48 | * 图片 | ||
| 49 | */ | ||
| 50 | @ApiModelProperty(value = "图片") | ||
| 43 | private String img; | 51 | private String img; |
| 52 | /** | ||
| 53 | * 商品简介 | ||
| 54 | */ | ||
| 55 | @ApiModelProperty(value = "商品简介") | ||
| 44 | private String describe; | 56 | private String describe; |
| 57 | /** | ||
| 58 | * 商品介绍 | ||
| 59 | */ | ||
| 60 | @ApiModelProperty(value = "商品介绍") | ||
| 45 | private String contactUs; | 61 | private String contactUs; |
| 62 | /** | ||
| 63 | * 配送时间 | ||
| 64 | */ | ||
| 65 | @ApiModelProperty(value = "配送时间") | ||
| 46 | private LocalDateTime deliveryTime; | 66 | private LocalDateTime deliveryTime; |
| 47 | 67 | ||
| 48 | 68 | ... | ... |
| ... | @@ -17,7 +17,10 @@ | ... | @@ -17,7 +17,10 @@ |
| 17 | package org.springblade.store.entity; | 17 | package org.springblade.store.entity; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.annotation.TableName; | 19 | import com.baomidou.mybatisplus.annotation.TableName; |
| 20 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 21 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
| 20 | import io.swagger.annotations.ApiModel; | 22 | import io.swagger.annotations.ApiModel; |
| 23 | import io.swagger.annotations.ApiModelProperty; | ||
| 21 | import lombok.Data; | 24 | import lombok.Data; |
| 22 | import lombok.EqualsAndHashCode; | 25 | import lombok.EqualsAndHashCode; |
| 23 | import org.springblade.core.mp.base.BaseEntity; | 26 | import org.springblade.core.mp.base.BaseEntity; |
| ... | @@ -28,7 +31,7 @@ import java.math.BigDecimal; | ... | @@ -28,7 +31,7 @@ import java.math.BigDecimal; |
| 28 | * 实体类 | 31 | * 实体类 |
| 29 | * | 32 | * |
| 30 | * @author BladeX | 33 | * @author BladeX |
| 31 | * @since 2019-11-06 | 34 | * @since 2019-11-07 |
| 32 | */ | 35 | */ |
| 33 | @Data | 36 | @Data |
| 34 | @TableName("fs_product_category") | 37 | @TableName("fs_product_category") |
| ... | @@ -38,8 +41,21 @@ public class ProductCategory extends BaseEntity { | ... | @@ -38,8 +41,21 @@ public class ProductCategory extends BaseEntity { |
| 38 | 41 | ||
| 39 | private static final long serialVersionUID = 1L; | 42 | private static final long serialVersionUID = 1L; |
| 40 | 43 | ||
| 44 | /** | ||
| 45 | * 商品id | ||
| 46 | */ | ||
| 47 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 48 | @ApiModelProperty(value = "商品id") | ||
| 41 | private Long productId; | 49 | private Long productId; |
| 50 | /** | ||
| 51 | * 分类名 | ||
| 52 | */ | ||
| 53 | @ApiModelProperty(value = "分类名") | ||
| 42 | private String categoryName; | 54 | private String categoryName; |
| 55 | /** | ||
| 56 | * 价格 | ||
| 57 | */ | ||
| 58 | @ApiModelProperty(value = "价格") | ||
| 43 | private BigDecimal price; | 59 | private BigDecimal price; |
| 44 | 60 | ||
| 45 | 61 | ... | ... |
| ... | @@ -27,7 +27,7 @@ import org.springblade.core.mp.base.BaseEntity; | ... | @@ -27,7 +27,7 @@ import org.springblade.core.mp.base.BaseEntity; |
| 27 | * 实体类 | 27 | * 实体类 |
| 28 | * | 28 | * |
| 29 | * @author BladeX | 29 | * @author BladeX |
| 30 | * @since 2019-11-06 | 30 | * @since 2019-11-07 |
| 31 | */ | 31 | */ |
| 32 | @Data | 32 | @Data |
| 33 | @TableName("fs_shipping_address") | 33 | @TableName("fs_shipping_address") |
| ... | @@ -43,5 +43,11 @@ public class ShippingAddress extends BaseEntity { | ... | @@ -43,5 +43,11 @@ public class ShippingAddress extends BaseEntity { |
| 43 | @ApiModelProperty(value = "配送地址") | 43 | @ApiModelProperty(value = "配送地址") |
| 44 | private String addressName; | 44 | private String addressName; |
| 45 | 45 | ||
| 46 | /** | ||
| 47 | * 地区编号 | ||
| 48 | */ | ||
| 49 | @ApiModelProperty(value = "地区编号") | ||
| 50 | private String addressNum; | ||
| 51 | |||
| 46 | 52 | ||
| 47 | } | 53 | } | ... | ... |
| ... | @@ -17,6 +17,8 @@ | ... | @@ -17,6 +17,8 @@ |
| 17 | package org.springblade.store.entity; | 17 | package org.springblade.store.entity; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.annotation.TableName; | 19 | import com.baomidou.mybatisplus.annotation.TableName; |
| 20 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 21 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
| 20 | import io.swagger.annotations.ApiModel; | 22 | import io.swagger.annotations.ApiModel; |
| 21 | import io.swagger.annotations.ApiModelProperty; | 23 | import io.swagger.annotations.ApiModelProperty; |
| 22 | import lombok.Data; | 24 | import lombok.Data; |
| ... | @@ -29,7 +31,7 @@ import java.time.LocalDateTime; | ... | @@ -29,7 +31,7 @@ import java.time.LocalDateTime; |
| 29 | * 实体类 | 31 | * 实体类 |
| 30 | * | 32 | * |
| 31 | * @author BladeX | 33 | * @author BladeX |
| 32 | * @since 2019-11-06 | 34 | * @since 2019-11-07 |
| 33 | */ | 35 | */ |
| 34 | @Data | 36 | @Data |
| 35 | @TableName("fs_user_coupon") | 37 | @TableName("fs_user_coupon") |
| ... | @@ -42,11 +44,13 @@ public class UserCoupon extends BaseEntity { | ... | @@ -42,11 +44,13 @@ public class UserCoupon extends BaseEntity { |
| 42 | /** | 44 | /** |
| 43 | * 用户ID | 45 | * 用户ID |
| 44 | */ | 46 | */ |
| 47 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 45 | @ApiModelProperty(value = "用户ID") | 48 | @ApiModelProperty(value = "用户ID") |
| 46 | private Long userId; | 49 | private Long userId; |
| 47 | /** | 50 | /** |
| 48 | * 优惠券ID | 51 | * 优惠券ID |
| 49 | */ | 52 | */ |
| 53 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 50 | @ApiModelProperty(value = "优惠券ID") | 54 | @ApiModelProperty(value = "优惠券ID") |
| 51 | private Long couponId; | 55 | private Long couponId; |
| 52 | /** | 56 | /** | ... | ... |
| ... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
| 16 | */ | 16 | */ |
| 17 | package org.springblade.store.controller; | 17 | package org.springblade.store.controller; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 19 | import com.baomidou.mybatisplus.core.metadata.IPage; | 20 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 20 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
| 21 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -25,11 +26,16 @@ import org.springblade.core.boot.ctrl.BladeController; | ... | @@ -25,11 +26,16 @@ import org.springblade.core.boot.ctrl.BladeController; |
| 25 | import org.springblade.core.mp.support.Condition; | 26 | import org.springblade.core.mp.support.Condition; |
| 26 | import org.springblade.core.mp.support.Query; | 27 | import org.springblade.core.mp.support.Query; |
| 27 | import org.springblade.core.tool.api.R; | 28 | import org.springblade.core.tool.api.R; |
| 29 | import org.springblade.core.tool.utils.BeanUtil; | ||
| 28 | import org.springblade.core.tool.utils.Func; | 30 | import org.springblade.core.tool.utils.Func; |
| 31 | import org.springblade.core.tool.utils.StringUtil; | ||
| 29 | import org.springblade.store.entity.Coupon; | 32 | import org.springblade.store.entity.Coupon; |
| 30 | import org.springblade.store.service.ICouponService; | 33 | import org.springblade.store.service.ICouponService; |
| 31 | import org.springblade.store.vo.CouponVO; | 34 | import org.springblade.store.vo.CouponVO; |
| 35 | import org.springblade.store.vo.coupon.CouponAddVO; | ||
| 36 | import org.springblade.store.vo.coupon.CouponUpdateVO; | ||
| 32 | import org.springblade.store.wrapper.CouponWrapper; | 37 | import org.springblade.store.wrapper.CouponWrapper; |
| 38 | import org.springframework.context.annotation.Bean; | ||
| 33 | import org.springframework.web.bind.annotation.*; | 39 | import org.springframework.web.bind.annotation.*; |
| 34 | 40 | ||
| 35 | import javax.validation.Valid; | 41 | import javax.validation.Valid; |
| ... | @@ -52,29 +58,24 @@ public class CouponController extends BladeController { | ... | @@ -52,29 +58,24 @@ public class CouponController extends BladeController { |
| 52 | * 详情 | 58 | * 详情 |
| 53 | */ | 59 | */ |
| 54 | @GetMapping("/detail") | 60 | @GetMapping("/detail") |
| 55 | @ApiOperation(value = "详情", notes = "传入coupon", position = 1) | 61 | @ApiOperation(value = "详情", notes = "传入couponId", position = 1) |
| 56 | public R<CouponVO> detail(Coupon coupon) { | 62 | public R<CouponVO> detail(Long couponId) { |
| 57 | Coupon detail = couponService.getOne(Condition.getQueryWrapper(coupon)); | 63 | Coupon detail = couponService.getById(couponId); |
| 58 | return R.data(CouponWrapper.build().entityVO(detail)); | 64 | return R.data(CouponWrapper.build().entityVO(detail)); |
| 59 | } | 65 | } |
| 60 | 66 | ||
| 61 | /** | 67 | /** |
| 62 | * 分页 | 68 | * 分页 |
| 63 | */ | 69 | */ |
| 64 | @GetMapping("/list") | 70 | @GetMapping("/page") |
| 65 | @ApiOperation(value = "分页", notes = "传入coupon", position = 2) | 71 | @ApiOperation(value = "分页", notes = "传入coupon", position = 2) |
| 66 | public R<IPage<CouponVO>> list(Coupon coupon, Query query) { | 72 | public R<IPage<Coupon>> page(String keyword, Query query) { |
| 67 | IPage<Coupon> pages = couponService.page(Condition.getPage(query), Condition.getQueryWrapper(coupon)); | 73 | QueryWrapper<Coupon> wrapper = new QueryWrapper<>(); |
| 68 | return R.data(CouponWrapper.build().pageVO(pages)); | 74 | if(StringUtil.isNotBlank(keyword)){ |
| 75 | wrapper.like("coupon_name",keyword); | ||
| 69 | } | 76 | } |
| 70 | 77 | wrapper.orderByDesc("update_time"); | |
| 71 | /** | 78 | IPage<Coupon> pages = couponService.page(Condition.getPage(query), wrapper); |
| 72 | * 自定义分页 | ||
| 73 | */ | ||
| 74 | @GetMapping("/page") | ||
| 75 | @ApiOperation(value = "分页", notes = "传入coupon", position = 3) | ||
| 76 | public R<IPage<CouponVO>> page(CouponVO coupon, Query query) { | ||
| 77 | IPage<CouponVO> pages = couponService.selectCouponPage(Condition.getPage(query), coupon); | ||
| 78 | return R.data(pages); | 79 | return R.data(pages); |
| 79 | } | 80 | } |
| 80 | 81 | ||
| ... | @@ -82,8 +83,10 @@ public class CouponController extends BladeController { | ... | @@ -82,8 +83,10 @@ public class CouponController extends BladeController { |
| 82 | * 新增 | 83 | * 新增 |
| 83 | */ | 84 | */ |
| 84 | @PostMapping("/save") | 85 | @PostMapping("/save") |
| 85 | @ApiOperation(value = "新增", notes = "传入coupon", position = 4) | 86 | @ApiOperation(value = "新增", notes = "传入coupon", position = 3) |
| 86 | public R save(@Valid @RequestBody Coupon coupon) { | 87 | public R save(@Valid @RequestBody CouponAddVO couponAddVO) { |
| 88 | Coupon coupon = new Coupon(); | ||
| 89 | BeanUtil.copy(couponAddVO,coupon); | ||
| 87 | return R.status(couponService.save(coupon)); | 90 | return R.status(couponService.save(coupon)); |
| 88 | } | 91 | } |
| 89 | 92 | ||
| ... | @@ -91,26 +94,19 @@ public class CouponController extends BladeController { | ... | @@ -91,26 +94,19 @@ public class CouponController extends BladeController { |
| 91 | * 修改 | 94 | * 修改 |
| 92 | */ | 95 | */ |
| 93 | @PostMapping("/update") | 96 | @PostMapping("/update") |
| 94 | @ApiOperation(value = "修改", notes = "传入coupon", position = 5) | 97 | @ApiOperation(value = "修改", notes = "传入coupon", position = 4) |
| 95 | public R update(@Valid @RequestBody Coupon coupon) { | 98 | public R update(@Valid @RequestBody CouponUpdateVO couponUpdateVO) { |
| 99 | Coupon coupon = new Coupon(); | ||
| 100 | BeanUtil.copy(couponUpdateVO,coupon); | ||
| 96 | return R.status(couponService.updateById(coupon)); | 101 | return R.status(couponService.updateById(coupon)); |
| 97 | } | 102 | } |
| 98 | 103 | ||
| 99 | /** | ||
| 100 | * 新增或修改 | ||
| 101 | */ | ||
| 102 | @PostMapping("/submit") | ||
| 103 | @ApiOperation(value = "新增或修改", notes = "传入coupon", position = 6) | ||
| 104 | public R submit(@Valid @RequestBody Coupon coupon) { | ||
| 105 | return R.status(couponService.saveOrUpdate(coupon)); | ||
| 106 | } | ||
| 107 | |||
| 108 | 104 | ||
| 109 | /** | 105 | /** |
| 110 | * 删除 | 106 | * 删除 |
| 111 | */ | 107 | */ |
| 112 | @PostMapping("/remove") | 108 | @PostMapping("/remove") |
| 113 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) | 109 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 5) |
| 114 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { | 110 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| 115 | return R.status(couponService.deleteLogic(Func.toLongList(ids))); | 111 | return R.status(couponService.deleteLogic(Func.toLongList(ids))); |
| 116 | } | 112 | } | ... | ... |
| ... | @@ -70,8 +70,8 @@ public class OrderController extends BladeController { | ... | @@ -70,8 +70,8 @@ public class OrderController extends BladeController { |
| 70 | */ | 70 | */ |
| 71 | @GetMapping("/detail") | 71 | @GetMapping("/detail") |
| 72 | @ApiOperation(value = "详情", notes = "传入order", position = 1) | 72 | @ApiOperation(value = "详情", notes = "传入order", position = 1) |
| 73 | public R<OrderVO> detail(Order order) { | 73 | public R<OrderVO> detail(Long orderId) { |
| 74 | Order detail = orderService.getOne(Condition.getQueryWrapper(order)); | 74 | Order detail = orderService.getById(orderId); |
| 75 | return R.data(OrderWrapper.build().entityVO(detail)); | 75 | return R.data(OrderWrapper.build().entityVO(detail)); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| ... | @@ -86,16 +86,6 @@ public class OrderController extends BladeController { | ... | @@ -86,16 +86,6 @@ public class OrderController extends BladeController { |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | /** | 88 | /** |
| 89 | * 自定义分页 | ||
| 90 | */ | ||
| 91 | @GetMapping("/page") | ||
| 92 | @ApiOperation(value = "分页", notes = "传入order", position = 3) | ||
| 93 | public R<IPage<OrderVO>> page(OrderVO order, Query query) { | ||
| 94 | IPage<OrderVO> pages = orderService.selectOrderPage(Condition.getPage(query), order); | ||
| 95 | return R.data(pages); | ||
| 96 | } | ||
| 97 | |||
| 98 | /** | ||
| 99 | * 新增 | 89 | * 新增 |
| 100 | */ | 90 | */ |
| 101 | @PostMapping("/save") | 91 | @PostMapping("/save") |
| ... | @@ -177,11 +167,10 @@ public class OrderController extends BladeController { | ... | @@ -177,11 +167,10 @@ public class OrderController extends BladeController { |
| 177 | 167 | ||
| 178 | /** | 168 | /** |
| 179 | * 获取用户订单 | 169 | * 获取用户订单 |
| 180 | * @param userId | ||
| 181 | * @return | 170 | * @return |
| 182 | */ | 171 | */ |
| 183 | @GetMapping("/order_list") | 172 | @GetMapping("/order_list") |
| 184 | public R getOrderList(String userId){ | 173 | public R getOrderList(){ |
| 185 | List<Order> orderList = orderService.getOrderList(); | 174 | List<Order> orderList = orderService.getOrderList(); |
| 186 | return R.data(orderList); | 175 | return R.data(orderList); |
| 187 | } | 176 | } |
| ... | @@ -201,7 +190,6 @@ public class OrderController extends BladeController { | ... | @@ -201,7 +190,6 @@ public class OrderController extends BladeController { |
| 201 | map.put("timeStamp", WXPayUtil.generateNonceStr()); | 190 | map.put("timeStamp", WXPayUtil.generateNonceStr()); |
| 202 | //微信下单 | 191 | //微信下单 |
| 203 | String prepayId = WXOrderUtil.pay(order.getOrderId(), order.getTotalPrice(), ""); | 192 | String prepayId = WXOrderUtil.pay(order.getOrderId(), order.getTotalPrice(), ""); |
| 204 | |||
| 205 | map.put("appId", WXPayConstants.APP_ID); | 193 | map.put("appId", WXPayConstants.APP_ID); |
| 206 | map.put("nonceStr",WXPayUtil.generateNonceStr()); | 194 | map.put("nonceStr",WXPayUtil.generateNonceStr()); |
| 207 | map.put("package","prepay_id="+prepayId); | 195 | map.put("package","prepay_id="+prepayId); | ... | ... |
| ... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
| 16 | */ | 16 | */ |
| 17 | package org.springblade.store.controller; | 17 | package org.springblade.store.controller; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 19 | import com.baomidou.mybatisplus.core.metadata.IPage; | 20 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 20 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
| 21 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -25,14 +26,19 @@ import org.springblade.core.boot.ctrl.BladeController; | ... | @@ -25,14 +26,19 @@ import org.springblade.core.boot.ctrl.BladeController; |
| 25 | import org.springblade.core.mp.support.Condition; | 26 | import org.springblade.core.mp.support.Condition; |
| 26 | import org.springblade.core.mp.support.Query; | 27 | import org.springblade.core.mp.support.Query; |
| 27 | import org.springblade.core.tool.api.R; | 28 | import org.springblade.core.tool.api.R; |
| 29 | import org.springblade.core.tool.utils.BeanUtil; | ||
| 28 | import org.springblade.core.tool.utils.Func; | 30 | import org.springblade.core.tool.utils.Func; |
| 29 | import org.springblade.store.entity.ProductCategory; | 31 | import org.springblade.store.entity.ProductCategory; |
| 30 | import org.springblade.store.service.IProductCategoryService; | 32 | import org.springblade.store.service.IProductCategoryService; |
| 31 | import org.springblade.store.vo.ProductCategoryVO; | 33 | import org.springblade.store.vo.ProductCategoryVO; |
| 34 | import org.springblade.store.vo.productcategory.CategoryAddVO; | ||
| 35 | import org.springblade.store.vo.productcategory.CategoryUpdateVO; | ||
| 32 | import org.springblade.store.wrapper.ProductCategoryWrapper; | 36 | import org.springblade.store.wrapper.ProductCategoryWrapper; |
| 37 | import org.springframework.context.annotation.Bean; | ||
| 33 | import org.springframework.web.bind.annotation.*; | 38 | import org.springframework.web.bind.annotation.*; |
| 34 | 39 | ||
| 35 | import javax.validation.Valid; | 40 | import javax.validation.Valid; |
| 41 | import java.util.List; | ||
| 36 | 42 | ||
| 37 | /** | 43 | /** |
| 38 | * 控制器 | 44 | * 控制器 |
| ... | @@ -49,41 +55,23 @@ public class ProductCategoryController extends BladeController { | ... | @@ -49,41 +55,23 @@ public class ProductCategoryController extends BladeController { |
| 49 | private IProductCategoryService productCategoryService; | 55 | private IProductCategoryService productCategoryService; |
| 50 | 56 | ||
| 51 | /** | 57 | /** |
| 52 | * 详情 | 58 | * 列表 |
| 53 | */ | ||
| 54 | @GetMapping("/detail") | ||
| 55 | @ApiOperation(value = "详情", notes = "传入productCategory", position = 1) | ||
| 56 | public R<ProductCategoryVO> detail(ProductCategory productCategory) { | ||
| 57 | ProductCategory detail = productCategoryService.getOne(Condition.getQueryWrapper(productCategory)); | ||
| 58 | return R.data(ProductCategoryWrapper.build().entityVO(detail)); | ||
| 59 | } | ||
| 60 | |||
| 61 | /** | ||
| 62 | * 分页 | ||
| 63 | */ | 59 | */ |
| 64 | @GetMapping("/list") | 60 | @GetMapping("/list") |
| 65 | @ApiOperation(value = "分页", notes = "传入productCategory", position = 2) | 61 | @ApiOperation(value = "列表", notes = "传入productId", position = 1) |
| 66 | public R<IPage<ProductCategoryVO>> list(ProductCategory productCategory, Query query) { | 62 | public R<List<ProductCategory>> list(Long productId) { |
| 67 | IPage<ProductCategory> pages = productCategoryService.page(Condition.getPage(query), Condition.getQueryWrapper(productCategory)); | 63 | List<ProductCategory> list = productCategoryService.list(new QueryWrapper<ProductCategory>().eq("product_id",productId)); |
| 68 | return R.data(ProductCategoryWrapper.build().pageVO(pages)); | 64 | return R.data(list); |
| 69 | } | ||
| 70 | |||
| 71 | /** | ||
| 72 | * 自定义分页 | ||
| 73 | */ | ||
| 74 | @GetMapping("/page") | ||
| 75 | @ApiOperation(value = "分页", notes = "传入productCategory", position = 3) | ||
| 76 | public R<IPage<ProductCategoryVO>> page(ProductCategoryVO productCategory, Query query) { | ||
| 77 | IPage<ProductCategoryVO> pages = productCategoryService.selectProductCategoryPage(Condition.getPage(query), productCategory); | ||
| 78 | return R.data(pages); | ||
| 79 | } | 65 | } |
| 80 | 66 | ||
| 81 | /** | 67 | /** |
| 82 | * 新增 | 68 | * 新增 |
| 83 | */ | 69 | */ |
| 84 | @PostMapping("/save") | 70 | @PostMapping("/save") |
| 85 | @ApiOperation(value = "新增", notes = "传入productCategory", position = 4) | 71 | @ApiOperation(value = "新增", notes = "传入productCategory", position = 2) |
| 86 | public R save(@Valid @RequestBody ProductCategory productCategory) { | 72 | public R save(@Valid @RequestBody CategoryAddVO categoryAddVO) { |
| 73 | ProductCategory productCategory = new ProductCategory(); | ||
| 74 | BeanUtil.copy(categoryAddVO,productCategory); | ||
| 87 | return R.status(productCategoryService.save(productCategory)); | 75 | return R.status(productCategoryService.save(productCategory)); |
| 88 | } | 76 | } |
| 89 | 77 | ||
| ... | @@ -91,26 +79,18 @@ public class ProductCategoryController extends BladeController { | ... | @@ -91,26 +79,18 @@ public class ProductCategoryController extends BladeController { |
| 91 | * 修改 | 79 | * 修改 |
| 92 | */ | 80 | */ |
| 93 | @PostMapping("/update") | 81 | @PostMapping("/update") |
| 94 | @ApiOperation(value = "修改", notes = "传入productCategory", position = 5) | 82 | @ApiOperation(value = "修改", notes = "传入productCategory", position = 3) |
| 95 | public R update(@Valid @RequestBody ProductCategory productCategory) { | 83 | public R update(@Valid @RequestBody CategoryUpdateVO categoryUpdateVO) { |
| 84 | ProductCategory productCategory = new ProductCategory(); | ||
| 85 | BeanUtil.copy(categoryUpdateVO,productCategory); | ||
| 96 | return R.status(productCategoryService.updateById(productCategory)); | 86 | return R.status(productCategoryService.updateById(productCategory)); |
| 97 | } | 87 | } |
| 98 | 88 | ||
| 99 | /** | 89 | /** |
| 100 | * 新增或修改 | ||
| 101 | */ | ||
| 102 | @PostMapping("/submit") | ||
| 103 | @ApiOperation(value = "新增或修改", notes = "传入productCategory", position = 6) | ||
| 104 | public R submit(@Valid @RequestBody ProductCategory productCategory) { | ||
| 105 | return R.status(productCategoryService.saveOrUpdate(productCategory)); | ||
| 106 | } | ||
| 107 | |||
| 108 | |||
| 109 | /** | ||
| 110 | * 删除 | 90 | * 删除 |
| 111 | */ | 91 | */ |
| 112 | @PostMapping("/remove") | 92 | @PostMapping("/remove") |
| 113 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) | 93 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 4) |
| 114 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { | 94 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| 115 | return R.status(productCategoryService.deleteLogic(Func.toLongList(ids))); | 95 | return R.status(productCategoryService.deleteLogic(Func.toLongList(ids))); |
| 116 | } | 96 | } | ... | ... |
| ... | @@ -25,10 +25,13 @@ import org.springblade.core.boot.ctrl.BladeController; | ... | @@ -25,10 +25,13 @@ import org.springblade.core.boot.ctrl.BladeController; |
| 25 | import org.springblade.core.mp.support.Condition; | 25 | import org.springblade.core.mp.support.Condition; |
| 26 | import org.springblade.core.mp.support.Query; | 26 | import org.springblade.core.mp.support.Query; |
| 27 | import org.springblade.core.tool.api.R; | 27 | import org.springblade.core.tool.api.R; |
| 28 | import org.springblade.core.tool.utils.BeanUtil; | ||
| 28 | import org.springblade.core.tool.utils.Func; | 29 | import org.springblade.core.tool.utils.Func; |
| 29 | import org.springblade.store.entity.Product; | 30 | import org.springblade.store.entity.Product; |
| 30 | import org.springblade.store.service.IProductService; | 31 | import org.springblade.store.service.IProductService; |
| 31 | import org.springblade.store.vo.ProductVO; | 32 | import org.springblade.store.vo.ProductVO; |
| 33 | import org.springblade.store.vo.product.ProductAddVO; | ||
| 34 | import org.springblade.store.vo.product.ProductUpdateVO; | ||
| 32 | import org.springblade.store.wrapper.ProductWrapper; | 35 | import org.springblade.store.wrapper.ProductWrapper; |
| 33 | import org.springframework.http.HttpStatus; | 36 | import org.springframework.http.HttpStatus; |
| 34 | import org.springframework.http.ResponseEntity; | 37 | import org.springframework.http.ResponseEntity; |
| ... | @@ -54,27 +57,18 @@ public class ProductController extends BladeController { | ... | @@ -54,27 +57,18 @@ public class ProductController extends BladeController { |
| 54 | * 详情 | 57 | * 详情 |
| 55 | */ | 58 | */ |
| 56 | @GetMapping("/detail") | 59 | @GetMapping("/detail") |
| 57 | @ApiOperation(value = "详情", notes = "传入product", position = 1) | 60 | @ApiOperation(value = "详情", notes = "传入id", position = 1) |
| 58 | public R<ProductVO> detail(Product product) { | 61 | public R<ProductVO> detail(Long id) { |
| 59 | Product detail = productService.getOne(Condition.getQueryWrapper(product)); | 62 | Product detail = productService.getById(id); |
| 60 | return R.data(ProductWrapper.build().entityVO(detail)); | 63 | return R.data(ProductWrapper.build().entityVO(detail)); |
| 61 | } | 64 | } |
| 62 | 65 | ||
| 63 | /** | ||
| 64 | * 分页 | ||
| 65 | */ | ||
| 66 | @GetMapping("/list") | ||
| 67 | @ApiOperation(value = "分页", notes = "传入product", position = 2) | ||
| 68 | public R<IPage<ProductVO>> list(Product product, Query query) { | ||
| 69 | IPage<Product> pages = productService.page(Condition.getPage(query), Condition.getQueryWrapper(product)); | ||
| 70 | return R.data(ProductWrapper.build().pageVO(pages)); | ||
| 71 | } | ||
| 72 | 66 | ||
| 73 | /** | 67 | /** |
| 74 | * 自定义分页 | 68 | * 分页 |
| 75 | */ | 69 | */ |
| 76 | @GetMapping("/page") | 70 | @GetMapping("/page") |
| 77 | @ApiOperation(value = "分页", notes = "传入product", position = 3) | 71 | @ApiOperation(value = "分页", notes = "传入product", position = 2) |
| 78 | public R<IPage<ProductVO>> page(ProductVO product, Query query) { | 72 | public R<IPage<ProductVO>> page(ProductVO product, Query query) { |
| 79 | IPage<ProductVO> pages = productService.selectProductPage(Condition.getPage(query), product); | 73 | IPage<ProductVO> pages = productService.selectProductPage(Condition.getPage(query), product); |
| 80 | return R.data(pages); | 74 | return R.data(pages); |
| ... | @@ -84,8 +78,10 @@ public class ProductController extends BladeController { | ... | @@ -84,8 +78,10 @@ public class ProductController extends BladeController { |
| 84 | * 新增 | 78 | * 新增 |
| 85 | */ | 79 | */ |
| 86 | @PostMapping("/save") | 80 | @PostMapping("/save") |
| 87 | @ApiOperation(value = "新增", notes = "传入product", position = 4) | 81 | @ApiOperation(value = "新增", notes = "传入product", position = 3) |
| 88 | public R save(@Valid @RequestBody Product product) { | 82 | public R save(@Valid @RequestBody ProductAddVO productAddVO) { |
| 83 | Product product = new Product(); | ||
| 84 | BeanUtil.copy(productAddVO,product); | ||
| 89 | return R.status(productService.save(product)); | 85 | return R.status(productService.save(product)); |
| 90 | } | 86 | } |
| 91 | 87 | ||
| ... | @@ -93,26 +89,18 @@ public class ProductController extends BladeController { | ... | @@ -93,26 +89,18 @@ public class ProductController extends BladeController { |
| 93 | * 修改 | 89 | * 修改 |
| 94 | */ | 90 | */ |
| 95 | @PostMapping("/update") | 91 | @PostMapping("/update") |
| 96 | @ApiOperation(value = "修改", notes = "传入product", position = 5) | 92 | @ApiOperation(value = "修改", notes = "传入product", position = 4) |
| 97 | public R update(@Valid @RequestBody Product product) { | 93 | public R update(@Valid @RequestBody ProductUpdateVO productUpdateVO) { |
| 94 | Product product = new Product(); | ||
| 95 | BeanUtil.copy(productUpdateVO,product); | ||
| 98 | return R.status(productService.updateById(product)); | 96 | return R.status(productService.updateById(product)); |
| 99 | } | 97 | } |
| 100 | 98 | ||
| 101 | /** | 99 | /** |
| 102 | * 新增或修改 | ||
| 103 | */ | ||
| 104 | @PostMapping("/submit") | ||
| 105 | @ApiOperation(value = "新增或修改", notes = "传入product", position = 6) | ||
| 106 | public R submit(@Valid @RequestBody Product product) { | ||
| 107 | return R.status(productService.saveOrUpdate(product)); | ||
| 108 | } | ||
| 109 | |||
| 110 | |||
| 111 | /** | ||
| 112 | * 删除 | 100 | * 删除 |
| 113 | */ | 101 | */ |
| 114 | @PostMapping("/remove") | 102 | @PostMapping("/remove") |
| 115 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) | 103 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 5) |
| 116 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { | 104 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| 117 | return R.status(productService.deleteLogic(Func.toLongList(ids))); | 105 | return R.status(productService.deleteLogic(Func.toLongList(ids))); |
| 118 | } | 106 | } | ... | ... |
| ... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
| 16 | */ | 16 | */ |
| 17 | package org.springblade.store.controller; | 17 | package org.springblade.store.controller; |
| 18 | 18 | ||
| 19 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 19 | import com.baomidou.mybatisplus.core.metadata.IPage; | 20 | import com.baomidou.mybatisplus.core.metadata.IPage; |
| 20 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
| 21 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
| ... | @@ -25,20 +26,18 @@ import org.springblade.core.boot.ctrl.BladeController; | ... | @@ -25,20 +26,18 @@ import org.springblade.core.boot.ctrl.BladeController; |
| 25 | import org.springblade.core.mp.support.Condition; | 26 | import org.springblade.core.mp.support.Condition; |
| 26 | import org.springblade.core.mp.support.Query; | 27 | import org.springblade.core.mp.support.Query; |
| 27 | import org.springblade.core.tool.api.R; | 28 | import org.springblade.core.tool.api.R; |
| 29 | import org.springblade.core.tool.utils.BeanUtil; | ||
| 28 | import org.springblade.core.tool.utils.Func; | 30 | import org.springblade.core.tool.utils.Func; |
| 31 | import org.springblade.core.tool.utils.StringUtil; | ||
| 29 | import org.springblade.store.entity.ShippingAddress; | 32 | import org.springblade.store.entity.ShippingAddress; |
| 30 | import org.springblade.store.service.IShippingAddressService; | 33 | import org.springblade.store.service.IShippingAddressService; |
| 31 | import org.springblade.store.vo.ShippingAddressVO; | 34 | import org.springblade.store.vo.ShippingAddressVO; |
| 35 | import org.springblade.store.vo.shippingaddress.AddressAddVO; | ||
| 36 | import org.springblade.store.vo.shippingaddress.AddressUpdateVO; | ||
| 32 | import org.springblade.store.wrapper.ShippingAddressWrapper; | 37 | import org.springblade.store.wrapper.ShippingAddressWrapper; |
| 33 | import org.springframework.http.HttpStatus; | ||
| 34 | import org.springframework.http.ResponseEntity; | ||
| 35 | import org.springframework.web.bind.annotation.*; | 38 | import org.springframework.web.bind.annotation.*; |
| 36 | 39 | ||
| 37 | import javax.validation.Valid; | 40 | import javax.validation.Valid; |
| 38 | import java.util.ArrayList; | ||
| 39 | import java.util.HashMap; | ||
| 40 | import java.util.List; | ||
| 41 | import java.util.Map; | ||
| 42 | 41 | ||
| 43 | /** | 42 | /** |
| 44 | * 控制器 | 43 | * 控制器 |
| ... | @@ -54,34 +53,20 @@ public class ShippingAddressController extends BladeController { | ... | @@ -54,34 +53,20 @@ public class ShippingAddressController extends BladeController { |
| 54 | 53 | ||
| 55 | private IShippingAddressService shippingAddressService; | 54 | private IShippingAddressService shippingAddressService; |
| 56 | 55 | ||
| 57 | /** | ||
| 58 | * 详情 | ||
| 59 | */ | ||
| 60 | @GetMapping("/detail") | ||
| 61 | @ApiOperation(value = "详情", notes = "传入shippingAddress", position = 1) | ||
| 62 | public R<ShippingAddressVO> detail(ShippingAddress shippingAddress) { | ||
| 63 | ShippingAddress detail = shippingAddressService.getOne(Condition.getQueryWrapper(shippingAddress)); | ||
| 64 | return R.data(ShippingAddressWrapper.build().entityVO(detail)); | ||
| 65 | } | ||
| 66 | 56 | ||
| 67 | /** | 57 | /** |
| 68 | * 分页 | 58 | * 分页 |
| 69 | */ | 59 | */ |
| 70 | @GetMapping("/list") | 60 | @GetMapping("/list") |
| 71 | @ApiOperation(value = "分页", notes = "传入shippingAddress", position = 2) | 61 | @ApiOperation(value = "分页", notes = "传入shippingAddress", position = 2) |
| 72 | public R<IPage<ShippingAddressVO>> list(ShippingAddress shippingAddress, Query query) { | 62 | public R<IPage<ShippingAddressVO>> list(String keyword, Query query) { |
| 73 | IPage<ShippingAddress> pages = shippingAddressService.page(Condition.getPage(query), Condition.getQueryWrapper(shippingAddress)); | 63 | QueryWrapper<ShippingAddress> wrapper = new QueryWrapper<>(); |
| 74 | return R.data(ShippingAddressWrapper.build().pageVO(pages)); | 64 | if(StringUtil.isNotBlank(keyword)){ |
| 65 | wrapper.like("address_name",keyword); | ||
| 75 | } | 66 | } |
| 76 | 67 | wrapper.orderByDesc("update_time"); | |
| 77 | /** | 68 | IPage<ShippingAddress> pages = shippingAddressService.page(Condition.getPage(query),wrapper); |
| 78 | * 自定义分页 | 69 | return R.data(ShippingAddressWrapper.build().pageVO(pages)); |
| 79 | */ | ||
| 80 | @GetMapping("/page") | ||
| 81 | @ApiOperation(value = "分页", notes = "传入shippingAddress", position = 3) | ||
| 82 | public R<IPage<ShippingAddressVO>> page(ShippingAddressVO shippingAddress, Query query) { | ||
| 83 | IPage<ShippingAddressVO> pages = shippingAddressService.selectShippingAddressPage(Condition.getPage(query), shippingAddress); | ||
| 84 | return R.data(pages); | ||
| 85 | } | 70 | } |
| 86 | 71 | ||
| 87 | /** | 72 | /** |
| ... | @@ -89,8 +74,10 @@ public class ShippingAddressController extends BladeController { | ... | @@ -89,8 +74,10 @@ public class ShippingAddressController extends BladeController { |
| 89 | */ | 74 | */ |
| 90 | @PostMapping("/save") | 75 | @PostMapping("/save") |
| 91 | @ApiOperation(value = "新增", notes = "传入shippingAddress", position = 4) | 76 | @ApiOperation(value = "新增", notes = "传入shippingAddress", position = 4) |
| 92 | public R save(@Valid @RequestBody ShippingAddress shippingAddress) { | 77 | public R save(@Valid @RequestBody AddressAddVO addressAddVO) { |
| 93 | return R.status(shippingAddressService.save(shippingAddress)); | 78 | ShippingAddress address = new ShippingAddress(); |
| 79 | BeanUtil.copy(addressAddVO,address); | ||
| 80 | return R.status(shippingAddressService.save(address)); | ||
| 94 | } | 81 | } |
| 95 | 82 | ||
| 96 | /** | 83 | /** |
| ... | @@ -98,17 +85,10 @@ public class ShippingAddressController extends BladeController { | ... | @@ -98,17 +85,10 @@ public class ShippingAddressController extends BladeController { |
| 98 | */ | 85 | */ |
| 99 | @PostMapping("/update") | 86 | @PostMapping("/update") |
| 100 | @ApiOperation(value = "修改", notes = "传入shippingAddress", position = 5) | 87 | @ApiOperation(value = "修改", notes = "传入shippingAddress", position = 5) |
| 101 | public R update(@Valid @RequestBody ShippingAddress shippingAddress) { | 88 | public R update(@Valid @RequestBody AddressUpdateVO addressUpdateVO) { |
| 102 | return R.status(shippingAddressService.updateById(shippingAddress)); | 89 | ShippingAddress address = new ShippingAddress(); |
| 103 | } | 90 | BeanUtil.copy(addressUpdateVO,address); |
| 104 | 91 | return R.status(shippingAddressService.updateById(address)); | |
| 105 | /** | ||
| 106 | * 新增或修改 | ||
| 107 | */ | ||
| 108 | @PostMapping("/submit") | ||
| 109 | @ApiOperation(value = "新增或修改", notes = "传入shippingAddress", position = 6) | ||
| 110 | public R submit(@Valid @RequestBody ShippingAddress shippingAddress) { | ||
| 111 | return R.status(shippingAddressService.saveOrUpdate(shippingAddress)); | ||
| 112 | } | 92 | } |
| 113 | 93 | ||
| 114 | 94 | ... | ... |
| ... | @@ -35,6 +35,7 @@ import org.springblade.store.wrapper.UserCouponWrapper; | ... | @@ -35,6 +35,7 @@ import org.springblade.store.wrapper.UserCouponWrapper; |
| 35 | import org.springframework.web.bind.annotation.*; | 35 | import org.springframework.web.bind.annotation.*; |
| 36 | 36 | ||
| 37 | import javax.validation.Valid; | 37 | import javax.validation.Valid; |
| 38 | import java.time.LocalDateTime; | ||
| 38 | import java.util.List; | 39 | import java.util.List; |
| 39 | 40 | ||
| 40 | /** | 41 | /** |
| ... | @@ -52,80 +53,24 @@ public class UserCouponController extends BladeController { | ... | @@ -52,80 +53,24 @@ public class UserCouponController extends BladeController { |
| 52 | private IUserCouponService userCouponService; | 53 | private IUserCouponService userCouponService; |
| 53 | 54 | ||
| 54 | /** | 55 | /** |
| 55 | * 详情 | ||
| 56 | */ | ||
| 57 | @GetMapping("/detail") | ||
| 58 | @ApiOperation(value = "详情", notes = "传入userCoupon", position = 1) | ||
| 59 | public R<UserCouponVO> detail(UserCoupon userCoupon) { | ||
| 60 | UserCoupon detail = userCouponService.getOne(Condition.getQueryWrapper(userCoupon)); | ||
| 61 | return R.data(UserCouponWrapper.build().entityVO(detail)); | ||
| 62 | } | ||
| 63 | |||
| 64 | /** | ||
| 65 | * 分页 | ||
| 66 | */ | ||
| 67 | @GetMapping("/list") | ||
| 68 | @ApiOperation(value = "分页", notes = "传入userCoupon", position = 2) | ||
| 69 | public R<IPage<UserCouponVO>> list(UserCoupon userCoupon, Query query) { | ||
| 70 | IPage<UserCoupon> pages = userCouponService.page(Condition.getPage(query), Condition.getQueryWrapper(userCoupon)); | ||
| 71 | return R.data(UserCouponWrapper.build().pageVO(pages)); | ||
| 72 | } | ||
| 73 | |||
| 74 | /** | ||
| 75 | * 自定义分页 | ||
| 76 | */ | ||
| 77 | @GetMapping("/page") | ||
| 78 | @ApiOperation(value = "分页", notes = "传入userCoupon", position = 3) | ||
| 79 | public R<IPage<UserCouponVO>> page(UserCouponVO userCoupon, Query query) { | ||
| 80 | IPage<UserCouponVO> pages = userCouponService.selectUserCouponPage(Condition.getPage(query), userCoupon); | ||
| 81 | return R.data(pages); | ||
| 82 | } | ||
| 83 | |||
| 84 | /** | ||
| 85 | * 新增 | 56 | * 新增 |
| 86 | */ | 57 | */ |
| 87 | @PostMapping("/save") | 58 | @PostMapping("/save") |
| 88 | @ApiOperation(value = "新增", notes = "传入userCoupon", position = 4) | 59 | @ApiOperation(value = "新增", notes = "传入userCoupon", position = 1) |
| 89 | public R save(@Valid @RequestBody UserCoupon userCoupon) { | 60 | public R save(@Valid @RequestBody UserCoupon userCoupon) { |
| 90 | return R.status(userCouponService.save(userCoupon)); | 61 | return R.status(userCouponService.save(userCoupon)); |
| 91 | } | 62 | } |
| 92 | 63 | ||
| 93 | /** | ||
| 94 | * 修改 | ||
| 95 | */ | ||
| 96 | @PostMapping("/update") | ||
| 97 | @ApiOperation(value = "修改", notes = "传入userCoupon", position = 5) | ||
| 98 | public R update(@Valid @RequestBody UserCoupon userCoupon) { | ||
| 99 | return R.status(userCouponService.updateById(userCoupon)); | ||
| 100 | } | ||
| 101 | |||
| 102 | /** | ||
| 103 | * 新增或修改 | ||
| 104 | */ | ||
| 105 | @PostMapping("/submit") | ||
| 106 | @ApiOperation(value = "新增或修改", notes = "传入userCoupon", position = 6) | ||
| 107 | public R submit(@Valid @RequestBody UserCoupon userCoupon) { | ||
| 108 | return R.status(userCouponService.saveOrUpdate(userCoupon)); | ||
| 109 | } | ||
| 110 | |||
| 111 | |||
| 112 | /** | ||
| 113 | * 删除 | ||
| 114 | */ | ||
| 115 | @PostMapping("/remove") | ||
| 116 | @ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7) | ||
| 117 | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { | ||
| 118 | return R.status(userCouponService.deleteLogic(Func.toLongList(ids))); | ||
| 119 | } | ||
| 120 | 64 | ||
| 121 | 65 | ||
| 122 | /** | 66 | /** |
| 123 | * 获取用户优惠券 | 67 | * 获取用户优惠券 |
| 124 | * @return | 68 | * @return |
| 125 | */ | 69 | */ |
| 126 | @GetMapping("/coupon") | 70 | @GetMapping("/list") |
| 71 | @ApiOperation(value = "新增", notes = "获取用户优惠券", position = 1) | ||
| 127 | public R coupon(){ | 72 | public R coupon(){ |
| 128 | List<UserCoupon> userCoupon= userCouponService.list(new QueryWrapper<UserCoupon>().eq("user_id",getUser().getUserId())); | 73 | List<UserCoupon> userCoupon= userCouponService.list(new QueryWrapper<UserCoupon>().eq("user_id",getUser().getUserId()).le("expired_date", LocalDateTime.now())); |
| 129 | return R.data(userCoupon); | 74 | return R.data(userCoupon); |
| 130 | } | 75 | } |
| 131 | 76 | ... | ... |
| ... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
| 11 | <result column="create_user" property="createUser"/> | 11 | <result column="create_user" property="createUser"/> |
| 12 | <result column="update_user" property="updateUser"/> | 12 | <result column="update_user" property="updateUser"/> |
| 13 | <result column="is_deleted" property="isDeleted"/> | 13 | <result column="is_deleted" property="isDeleted"/> |
| 14 | <result column="name" property="name"/> | 14 | <result column="product_name" property="productName"/> |
| 15 | <result column="img" property="img"/> | 15 | <result column="img" property="img"/> |
| 16 | <result column="describe" property="describe"/> | 16 | <result column="describe" property="describe"/> |
| 17 | <result column="contact_us" property="contactUs"/> | 17 | <result column="contact_us" property="contactUs"/> | ... | ... |
| ... | @@ -64,9 +64,8 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem | ... | @@ -64,9 +64,8 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem |
| 64 | List<Order> list = list(new QueryWrapper<Order>().eq("state", 2)); | 64 | List<Order> list = list(new QueryWrapper<Order>().eq("state", 2)); |
| 65 | Delivery delivery = new Delivery(); | 65 | Delivery delivery = new Delivery(); |
| 66 | BigDecimal bigDecimal = new BigDecimal(0); | 66 | BigDecimal bigDecimal = new BigDecimal(0); |
| 67 | |||
| 68 | for (Order o : list) { | 67 | for (Order o : list) { |
| 69 | //计算商品总价 | 68 | //总价 |
| 70 | BigDecimal totalPrice = o.getTotalPrice(); | 69 | BigDecimal totalPrice = o.getTotalPrice(); |
| 71 | BigDecimal add = bigDecimal.add(totalPrice); | 70 | BigDecimal add = bigDecimal.add(totalPrice); |
| 72 | bigDecimal = add; | 71 | bigDecimal = add; |
| ... | @@ -154,7 +153,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem | ... | @@ -154,7 +153,6 @@ public class OrderServiceImpl extends BaseServiceImpl<OrderMapper, Order> implem |
| 154 | userCouponService.deleteLogic(list); | 153 | userCouponService.deleteLogic(list); |
| 155 | } | 154 | } |
| 156 | } | 155 | } |
| 157 | |||
| 158 | Product product = productService.getById(order.getProductId()); | 156 | Product product = productService.getById(order.getProductId()); |
| 159 | order.setDeliveryTime(product.getDeliveryTime() ); | 157 | order.setDeliveryTime(product.getDeliveryTime() ); |
| 160 | return R.status(save(order)); | 158 | return R.status(save(order)); | ... | ... |
| 1 | package org.springblade.store.vo.coupon; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | import java.math.BigDecimal; | ||
| 8 | import java.time.LocalDateTime; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @author 吕鸿磊 | ||
| 12 | * @date 2019-11-07 20:28 | ||
| 13 | */ | ||
| 14 | @Data | ||
| 15 | @ApiModel(value = "CouponAddVO对象", description = "CouponAddVO对象") | ||
| 16 | public class CouponAddVO { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * 优惠券名 | ||
| 20 | */ | ||
| 21 | @ApiModelProperty(value = "优惠券名") | ||
| 22 | private String couponName; | ||
| 23 | /** | ||
| 24 | * 优惠券类型 | ||
| 25 | */ | ||
| 26 | @ApiModelProperty(value = "优惠券类型") | ||
| 27 | private Integer couponType; | ||
| 28 | /** | ||
| 29 | * 优惠金额/折扣 | ||
| 30 | */ | ||
| 31 | @ApiModelProperty(value = "优惠金额/折扣") | ||
| 32 | private BigDecimal discounts; | ||
| 33 | /** | ||
| 34 | * 优惠券使用范围 | ||
| 35 | */ | ||
| 36 | @ApiModelProperty(value = "优惠券使用范围") | ||
| 37 | private String scope; | ||
| 38 | /** | ||
| 39 | * 优惠券使用条件(金额) | ||
| 40 | */ | ||
| 41 | @ApiModelProperty(value = "优惠券使用条件(金额)") | ||
| 42 | private BigDecimal orderCondition; | ||
| 43 | /** | ||
| 44 | * 优惠券有效时间 | ||
| 45 | */ | ||
| 46 | @ApiModelProperty(value = "优惠券有效时间") | ||
| 47 | private Integer validTime; | ||
| 48 | /** | ||
| 49 | * 优惠券过期时间 | ||
| 50 | */ | ||
| 51 | @ApiModelProperty(value = "优惠券过期时间") | ||
| 52 | private LocalDateTime expiredDate; | ||
| 53 | } |
blade-service/blade-store/src/main/java/org/springblade/store/vo/coupon/CouponUpdateVO.java
0 → 100644
| 1 | package org.springblade.store.vo.coupon; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @author 吕鸿磊 | ||
| 9 | * @date 2019-11-07 20:28 | ||
| 10 | */ | ||
| 11 | @Data | ||
| 12 | @ApiModel(value = "CouponUpdateVO对象", description = "CouponUpdateVO对象") | ||
| 13 | public class CouponUpdateVO extends CouponAddVO { | ||
| 14 | |||
| 15 | @ApiModelProperty(value = "id") | ||
| 16 | private Long id; | ||
| 17 | } |
| 1 | package org.springblade.store.vo.order; | ||
| 2 | |||
| 3 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 5 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
| 6 | import io.swagger.annotations.ApiModel; | ||
| 7 | import io.swagger.annotations.ApiModelProperty; | ||
| 8 | import lombok.Data; | ||
| 9 | import org.springframework.format.annotation.DateTimeFormat; | ||
| 10 | |||
| 11 | import java.time.LocalDateTime; | ||
| 12 | |||
| 13 | |||
| 14 | /** | ||
| 15 | * @author 吕鸿磊 | ||
| 16 | * @date 2019-11-07 21:58 | ||
| 17 | */ | ||
| 18 | @Data | ||
| 19 | @ApiModel(value = "OrderQueryVO对象", description = "OrderQueryVO对象") | ||
| 20 | public class OrderQueryVO { | ||
| 21 | |||
| 22 | /** | ||
| 23 | * 订单Id | ||
| 24 | */ | ||
| 25 | @ApiModelProperty(value = "订单Id") | ||
| 26 | private String orderId; | ||
| 27 | /** | ||
| 28 | * 用户ID | ||
| 29 | */ | ||
| 30 | @JsonSerialize(using = ToStringSerializer.class) | ||
| 31 | @ApiModelProperty(value = "用户ID") | ||
| 32 | private Long userId; | ||
| 33 | /** | ||
| 34 | * 园区地址 | ||
| 35 | */ | ||
| 36 | @ApiModelProperty(value = "园区地址") | ||
| 37 | private String address; | ||
| 38 | /** | ||
| 39 | * 预留手机号 | ||
| 40 | */ | ||
| 41 | @ApiModelProperty(value = "预留手机号") | ||
| 42 | private String mobile; | ||
| 43 | /** | ||
| 44 | * 开始时间 | ||
| 45 | */ | ||
| 46 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 47 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 48 | @ApiModelProperty(value = "开始时间") | ||
| 49 | private LocalDateTime startTime; | ||
| 50 | /** | ||
| 51 | * 结束时间 | ||
| 52 | */ | ||
| 53 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 54 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
| 55 | @ApiModelProperty(value = "结束时间") | ||
| 56 | private LocalDateTime endTime; | ||
| 57 | |||
| 58 | |||
| 59 | } |
blade-service/blade-store/src/main/java/org/springblade/store/vo/product/ProductAddVO.java
0 → 100644
| 1 | package org.springblade.store.vo.product; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | import java.time.LocalDateTime; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @author 吕鸿磊 | ||
| 11 | * @date 2019-11-07 19:29 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | @ApiModel(value = "ProductAddVO对象", description = "ProductAddVO对象") | ||
| 15 | public class ProductAddVO { | ||
| 16 | |||
| 17 | /** | ||
| 18 | * 商品名 | ||
| 19 | */ | ||
| 20 | @ApiModelProperty(value = "商品名") | ||
| 21 | private String productName; | ||
| 22 | /** | ||
| 23 | * 图片 | ||
| 24 | */ | ||
| 25 | @ApiModelProperty(value = "图片") | ||
| 26 | private String img; | ||
| 27 | /** | ||
| 28 | * 商品简介 | ||
| 29 | */ | ||
| 30 | @ApiModelProperty(value = "商品简介") | ||
| 31 | private String describe; | ||
| 32 | /** | ||
| 33 | * 商品介绍 | ||
| 34 | */ | ||
| 35 | @ApiModelProperty(value = "商品介绍") | ||
| 36 | private String contactUs; | ||
| 37 | /** | ||
| 38 | * 配送时间 | ||
| 39 | */ | ||
| 40 | @ApiModelProperty(value = "配送时间") | ||
| 41 | private LocalDateTime deliveryTime; | ||
| 42 | } |
blade-service/blade-store/src/main/java/org/springblade/store/vo/product/ProductUpdateVO.java
0 → 100644
| 1 | package org.springblade.store.vo.product; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @author 吕鸿磊 | ||
| 9 | * @date 2019-11-07 19:44 | ||
| 10 | */ | ||
| 11 | @Data | ||
| 12 | @ApiModel(value = "ProductUpdateVO对象", description = "ProductUpdateVO对象") | ||
| 13 | public class ProductUpdateVO extends ProductAddVO { | ||
| 14 | |||
| 15 | @ApiModelProperty(value = "id") | ||
| 16 | private Long id; | ||
| 17 | } |
blade-service/blade-store/src/main/java/org/springblade/store/vo/productcategory/CategoryAddVO.java
0 → 100644
| 1 | package org.springblade.store.vo.productcategory; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | import java.math.BigDecimal; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @author 吕鸿磊 | ||
| 11 | * @date 2019-11-07 19:56 | ||
| 12 | */ | ||
| 13 | @Data | ||
| 14 | @ApiModel(value = "CategoryAddVO对象", description = "CategoryAddVO对象") | ||
| 15 | public class CategoryAddVO { | ||
| 16 | /** | ||
| 17 | * 商品id | ||
| 18 | */ | ||
| 19 | @ApiModelProperty(value = "商品id") | ||
| 20 | private Long productId; | ||
| 21 | /** | ||
| 22 | * 分类名 | ||
| 23 | */ | ||
| 24 | @ApiModelProperty(value = "分类名") | ||
| 25 | private String categoryName; | ||
| 26 | /** | ||
| 27 | * 价格 | ||
| 28 | */ | ||
| 29 | @ApiModelProperty(value = "价格") | ||
| 30 | private BigDecimal price; | ||
| 31 | |||
| 32 | } |
| 1 | package org.springblade.store.vo.productcategory; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import lombok.Data; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @author 吕鸿磊 | ||
| 8 | * @date 2019-11-07 19:58 | ||
| 9 | */ | ||
| 10 | @Data | ||
| 11 | @ApiModel(value = "CategoryUpdateVO对象", description = "CategoryUpdateVO对象") | ||
| 12 | public class CategoryUpdateVO extends CategoryAddVO{ | ||
| 13 | private Long id; | ||
| 14 | } |
blade-service/blade-store/src/main/java/org/springblade/store/vo/shippingaddress/AddressAddVO.java
0 → 100644
| 1 | package org.springblade.store.vo.shippingaddress; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @author 吕鸿磊 | ||
| 9 | * @date 2019-11-07 20:41 | ||
| 10 | */ | ||
| 11 | |||
| 12 | @Data | ||
| 13 | @ApiModel(value = "AddressAddVO对象", description = "AddressAddVO对象") | ||
| 14 | public class AddressAddVO { | ||
| 15 | /** | ||
| 16 | * 配送地址 | ||
| 17 | */ | ||
| 18 | @ApiModelProperty(value = "配送地址") | ||
| 19 | private String addressName; | ||
| 20 | |||
| 21 | /** | ||
| 22 | * 地区编号 | ||
| 23 | */ | ||
| 24 | @ApiModelProperty(value = "地区编号") | ||
| 25 | private String addressNum; | ||
| 26 | } |
| 1 | package org.springblade.store.vo.shippingaddress; | ||
| 2 | |||
| 3 | import io.swagger.annotations.ApiModel; | ||
| 4 | import io.swagger.annotations.ApiModelProperty; | ||
| 5 | import lombok.Data; | ||
| 6 | |||
| 7 | /** | ||
| 8 | * @author 吕鸿磊 | ||
| 9 | * @date 2019-11-07 21:27 | ||
| 10 | */ | ||
| 11 | @Data | ||
| 12 | @ApiModel(value = "AddressUpdateVO对象", description = "AddressUpdateVO对象") | ||
| 13 | public class AddressUpdateVO extends AddressAddVO{ | ||
| 14 | |||
| 15 | @ApiModelProperty(value = "id") | ||
| 16 | private Long id; | ||
| 17 | } |
-
Please register or sign in to post a comment