完成ShopDealerApply经销商入驻模块
This commit is contained in:
@@ -54,7 +54,7 @@ public class ShopDealerApplyController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerApply:list')")
|
||||
@Operation(summary = "根据id查询分销商申请记录表")
|
||||
@Operation(summary = "根据userId查询分销商申请记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopDealerApply> 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("添加成功");
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ShopDealerUserController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerUser:list')")
|
||||
@Operation(summary = "根据id查询分销商用户记录表")
|
||||
@Operation(summary = "根据userId查询分销商用户")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopDealerUser> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
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
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ShopDealerApplyServiceImpl extends ServiceImpl<ShopDealerApplyMappe
|
||||
@Override
|
||||
public ShopDealerApply getByIdRel(Integer applyId) {
|
||||
ShopDealerApplyParam param = new ShopDealerApplyParam();
|
||||
param.setApplyId(applyId);
|
||||
param.setUserId(applyId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ShopDealerUserServiceImpl extends ServiceImpl<ShopDealerUserMapper,
|
||||
@Override
|
||||
public ShopDealerUser getByIdRel(Integer id) {
|
||||
ShopDealerUserParam param = new ShopDealerUserParam();
|
||||
param.setId(id);
|
||||
param.setUserId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user