邀请人列表
This commit is contained in:
parent
618286703e
commit
faac76cc33
|
|
@ -43,10 +43,11 @@ public class DistributionUserController {
|
|||
@GetMapping("/inviteUser")
|
||||
public CzgResult<Page<InviteUserVO>> getInviteUser(
|
||||
@RequestParam Long id,
|
||||
@RequestParam Long shopUserId,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
AssertUtil.isNull(id, "邀请人ID");
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id, page, size));
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id, shopUserId, page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.dto.MkDistributionWithdrawFlowDTO;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.market.dto.MkDistributionUserDTO;
|
||||
import com.czg.market.entity.MkDistributionConfig;
|
||||
import com.czg.market.dto.MkDistributionWithdrawFlowDTO;
|
||||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
||||
import com.czg.market.service.MkDistributionConfigService;
|
||||
import com.czg.market.service.MkDistributionFlowService;
|
||||
|
|
@ -12,14 +11,11 @@ import com.czg.market.service.MkDistributionWithdrawFlowService;
|
|||
import com.czg.market.vo.DistributionCenterShopVO;
|
||||
import com.czg.market.vo.InviteUserVO;
|
||||
import com.czg.market.vo.MkDistributionConfigVO;
|
||||
import com.czg.order.dto.MkDistributionPayDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -89,20 +85,10 @@ public class UDistributionController {
|
|||
* 分销员中心-获取邀请码
|
||||
*/
|
||||
@GetMapping("/getInviteCode")
|
||||
public CzgResult<String> getInviteCode(@RequestParam Long shopId,@RequestParam Long shopUserId) {
|
||||
return CzgResult.success(distributionUserService.getInviteCode(shopId,shopUserId));
|
||||
public CzgResult<String> getInviteCode(@RequestParam Long shopId, @RequestParam Long shopUserId) {
|
||||
return CzgResult.success(distributionUserService.getInviteCode(shopId, shopUserId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销员购买
|
||||
*/
|
||||
@PostMapping("/pay")
|
||||
public CzgResult<Map<String, Object>> pay(@Validated @RequestBody MkDistributionPayDTO payDTO) {
|
||||
return CzgResult.success(distributionUserService.pay(StpKit.USER.getLoginIdAsLong(), payDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销员中心-实名认证
|
||||
*/
|
||||
|
|
@ -136,11 +122,12 @@ public class UDistributionController {
|
|||
@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
AssertUtil.isNull(id, "邀请人ID");
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id, page, size));
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id, null, page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户提现
|
||||
*
|
||||
* @param withdrawFlowDTO 提现信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
|
|
@ -169,10 +156,11 @@ public class UDistributionController {
|
|||
|
||||
/**
|
||||
* 收益明细
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param shopId
|
||||
* @param status pending待入账 success已入账
|
||||
* @param status pending待入账 success已入账
|
||||
*/
|
||||
@GetMapping("/distributionFlow")
|
||||
public CzgResult<Map<String, Object>> distributionFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.shopuser.*;
|
||||
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.market.vo.InviteUserVO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
@ -29,7 +28,7 @@ public interface ShopUserService extends IService<ShopUser> {
|
|||
/**
|
||||
* 获取邀请用户列表
|
||||
*/
|
||||
Page<InviteUserVO> getInviteUser(Long getDistributionUserId, Integer page, Integer size);
|
||||
Page<InviteUserVO> getInviteUser(Long getDistributionUserId, Long shopUserId, Integer page, Integer size);
|
||||
|
||||
|
||||
boolean updateInfo(ShopUser shopUser);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public interface MkDistributionUserService extends IService<MkDistributionUser>
|
|||
/**
|
||||
* 获取分销员邀请人分页列表
|
||||
*/
|
||||
Page<InviteUserVO> getInviteUser(Long id, Integer page, Integer size);
|
||||
Page<InviteUserVO> getInviteUser(Long id, Long shopUserId, Integer page, Integer size);
|
||||
|
||||
/**
|
||||
* 分销员:按消费金额升级等级
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ import java.time.LocalDateTime;
|
|||
*/
|
||||
@Data
|
||||
public class InviteUserVO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long shopUserId;
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -70,5 +70,5 @@ public interface ShopUserMapper extends BaseMapper<ShopUser> {
|
|||
* @param distributionUserId 分销员ID
|
||||
* @return 分页结果
|
||||
*/
|
||||
List<InviteUserVO> getInviteUser(Long distributionUserId);
|
||||
List<InviteUserVO> getInviteUser(Long distributionUserId, Long shopUserId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import com.czg.market.service.TbMemberConfigService;
|
|||
import com.czg.market.vo.InviteUserVO;
|
||||
import com.czg.market.vo.MemberConfigVO;
|
||||
import com.czg.service.account.mapper.ShopUserMapper;
|
||||
import com.czg.utils.MyQueryWrapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
|
@ -100,9 +99,9 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
|||
}
|
||||
|
||||
@Override
|
||||
public Page<InviteUserVO> getInviteUser(Long distributionUserId, Integer page, Integer size) {
|
||||
public Page<InviteUserVO> getInviteUser(Long distributionUserId, Long shopUserId, Integer page, Integer size) {
|
||||
PageHelper.startPage(page, size);
|
||||
List<InviteUserVO> inviteUser = mapper.getInviteUser(distributionUserId);
|
||||
List<InviteUserVO> inviteUser = mapper.getInviteUser(distributionUserId, shopUserId);
|
||||
return PageUtil.convert(new PageInfo<>(inviteUser));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -263,17 +263,18 @@
|
|||
order by u.create_time desc
|
||||
</select>
|
||||
<select id="getInviteUser" resultType="com.czg.market.vo.InviteUserVO">
|
||||
SELECT user.head_img AS headImg,
|
||||
user.nick_name AS shopUserName,
|
||||
user.phone AS shopUserPhone,
|
||||
user.one_income AS oneIncome,
|
||||
user.invite_time AS inviteTime,
|
||||
dist.distribution_level_id AS levelId,
|
||||
dist.distribution_level_name AS levelName,
|
||||
SELECT user.head_img AS headImg,
|
||||
user.nick_name AS shopUserName,
|
||||
user.phone AS shopUserPhone,
|
||||
user.one_income AS oneIncome,
|
||||
user.invite_time AS inviteTime,
|
||||
dist.distribution_level_id AS levelId,
|
||||
dist.distribution_level_name AS levelName,
|
||||
CASE WHEN dist.id IS NOT NULL THEN 1 ELSE 0 END AS isDistribution
|
||||
FROM `tb_shop_user` user
|
||||
left join mk_distribution_user dist on user.id = dist.id
|
||||
WHERE user.`distribution_user_id` = #{distributionUserId}
|
||||
<if test="shopUserId != null">and user.id = #{shopUserId}</if>
|
||||
ORDER BY `create_time` DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||
Map<String, Object> result = new HashMap<>(5);
|
||||
result.put("totalIncome", centerTopVO == null ? 0.0 : centerTopVO.getTotalIncome());
|
||||
result.put("pendingIncome", centerTopVO == null ? 0.0 : centerTopVO.getPendingIncome());
|
||||
result.put("cashOutAmount", centerTopVO == null ? 0.0 : centerTopVO.getCashOutAmount());
|
||||
result.put("cashOutAmount", centerTopVO == null ? 0.0 : centerTopVO.getUnCashOutAmount());
|
||||
|
||||
result.put("activates", activates(userId, 1, 5));
|
||||
result.put("unActivates", unActivates(userId, 1, 3));
|
||||
|
|
@ -380,8 +380,8 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
|||
}
|
||||
|
||||
@Override
|
||||
public Page<InviteUserVO> getInviteUser(Long id, Integer page, Integer size) {
|
||||
return shopUserService.getInviteUser(id, page, size);
|
||||
public Page<InviteUserVO> getInviteUser(Long id, Long shopUserId, Integer page, Integer size) {
|
||||
return shopUserService.getInviteUser(id, shopUserId, page, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue