feat(shop): 添加分销商申请记录相关功能
- 新增根据 ID 查询分销商申请记录的接口和实现 - 修改根据用户 ID 查询分销商申请记录的接口路径 - 在 ShopDealerApply 模型中添加合同金额和详细地址字段 - 更新 ShopDealerApplyService 接口,添加新的查询方法 - 修改 ShopDealerApplyServiceImpl 中的查询实现方法
This commit is contained in:
@@ -54,11 +54,19 @@ public class ShopDealerApplyController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerApply:list')")
|
||||
@Operation(summary = "根据userId查询分销商申请记录表")
|
||||
@Operation(summary = "根据id查询分销商申请记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopDealerApply> get(@PathVariable("id") Integer id) {
|
||||
public ApiResult<ShopDealerApply> getById(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopDealerApplyService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerApply:list')")
|
||||
@Operation(summary = "根据userId查询分销商申请记录表")
|
||||
@GetMapping("/getByUserId/{id}")
|
||||
public ApiResult<ShopDealerApply> getByUserId(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopDealerApplyService.getByIdRel(id));
|
||||
return success(shopDealerApplyService.getByUserIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopDealerApply:save')")
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
@@ -40,6 +42,12 @@ public class ShopDealerApply implements Serializable {
|
||||
@Schema(description = "手机号")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "推荐人用户ID")
|
||||
private Integer refereeId;
|
||||
|
||||
|
||||
@@ -39,4 +39,5 @@ public interface ShopDealerApplyService extends IService<ShopDealerApply> {
|
||||
*/
|
||||
ShopDealerApply getByIdRel(Integer applyId);
|
||||
|
||||
ShopDealerApply getByUserIdRel(Integer userId);
|
||||
}
|
||||
|
||||
@@ -38,9 +38,16 @@ public class ShopDealerApplyServiceImpl extends ServiceImpl<ShopDealerApplyMappe
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopDealerApply getByIdRel(Integer applyId) {
|
||||
public ShopDealerApply getByIdRel(Integer id) {
|
||||
ShopDealerApplyParam param = new ShopDealerApplyParam();
|
||||
param.setApplyId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopDealerApply getByUserIdRel(Integer userId) {
|
||||
ShopDealerApplyParam param = new ShopDealerApplyParam();
|
||||
param.setUserId(applyId);
|
||||
param.setUserId(userId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user