diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerApplyController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerApplyController.java index 697c9c6..0675391 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerApplyController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerApplyController.java @@ -54,7 +54,7 @@ public class ShopDealerApplyController extends BaseController { } @PreAuthorize("hasAuthority('shop:shopDealerApply:list')") - @Operation(summary = "根据id查询分销商申请记录表") + @Operation(summary = "根据userId查询分销商申请记录表") @GetMapping("/{id}") public ApiResult get(@PathVariable("id") Integer id) { // 使用关联查询 @@ -72,6 +72,12 @@ public class ShopDealerApplyController extends BaseController { shopDealerApply.setApplyTime(LocalDateTime.now()); shopDealerApply.setUserId(loginUser.getUserId()); } + if (shopDealerApply.getRefereeId() != null) { + if(shopDealerUserService.getByIdRel(shopDealerApply.getRefereeId()) == null){ + return fail("推荐人不存在"); + } + } + if (shopDealerApplyService.save(shopDealerApply)) { return success("添加成功"); } diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerUserController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerUserController.java index ddd9603..11700a1 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerUserController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerUserController.java @@ -47,7 +47,7 @@ public class ShopDealerUserController extends BaseController { } @PreAuthorize("hasAuthority('shop:shopDealerUser:list')") - @Operation(summary = "根据id查询分销商用户记录表") + @Operation(summary = "根据userId查询分销商用户") @GetMapping("/{id}") public ApiResult get(@PathVariable("id") Integer id) { // 使用关联查询 diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopGift.java b/src/main/java/com/gxwebsoft/shop/entity/ShopGift.java index 6e101b2..261c980 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopGift.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopGift.java @@ -3,6 +3,8 @@ package com.gxwebsoft.shop.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; + +import java.math.BigDecimal; import java.time.LocalDateTime; import com.fasterxml.jackson.annotation.JsonFormat; import com.baomidou.mybatisplus.annotation.TableLogic; @@ -43,6 +45,10 @@ public class ShopGift implements Serializable { @TableField(exist = false) private String goodsImage; + @Schema(description = "面值") + @TableField(exist = false) + private BigDecimal faceValue; + @Schema(description = "使用地点") private String useLocation; diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGiftMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGiftMapper.xml index 3511db8..b2f0569 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGiftMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGiftMapper.xml @@ -4,7 +4,7 @@ - SELECT a.*,b.name as goodsName,b.image as goodsImage,c.nickname, u.nickname as operatorUserName + SELECT a.*,b.name as goodsName, b.price as faceValue, b.image as goodsImage,c.nickname, u.nickname as operatorUserName FROM shop_gift a LEFT JOIN shop_goods b ON a.goods_id = b.goods_id LEFT JOIN gxwebsoft_core.sys_user c ON a.user_id = c.user_id diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerApplyServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerApplyServiceImpl.java index 26cb8d1..d070ca2 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerApplyServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerApplyServiceImpl.java @@ -40,7 +40,7 @@ public class ShopDealerApplyServiceImpl extends ServiceImpl