用户列表 1
This commit is contained in:
@@ -27,5 +27,6 @@ public class ShopUserDTO extends ShopUser {
|
|||||||
private String memberLevelName;
|
private String memberLevelName;
|
||||||
private String nextMemberLevelName;
|
private String nextMemberLevelName;
|
||||||
private Long nextExperience;
|
private Long nextExperience;
|
||||||
|
private Long pointBalance;
|
||||||
private boolean isNew;
|
private boolean isNew;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
package com.czg.order.dto;
|
package com.czg.order.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团参与 DTO
|
* 拼团参与 DTO
|
||||||
*
|
*
|
||||||
* @author ww
|
* @author ww
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class GroupJoinDTO extends LtPayOtherDTO{
|
public class GroupJoinDTO extends LtPayOtherDTO{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.czg.order.dto;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 积分商品兑换信息
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class PointGoodsExchangeDTO extends LtPayOtherDTO{
|
|
||||||
/**
|
|
||||||
* 积分商品id
|
|
||||||
*/
|
|
||||||
@NotNull(message = "积分商品不能为空")
|
|
||||||
private Long pointsGoodsId;
|
|
||||||
}
|
|
||||||
@@ -22,7 +22,6 @@ import com.czg.market.vo.MemberConfigVO;
|
|||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.czg.service.account.mapper.ShopUserMapper;
|
import com.czg.service.account.mapper.ShopUserMapper;
|
||||||
import com.czg.system.service.SysParamsService;
|
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@@ -35,7 +34,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@@ -57,8 +55,6 @@ public class AShopUserServiceImpl implements AShopUserService {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private SysParamsService sysParamsService;
|
|
||||||
@DubboReference
|
|
||||||
private OrderInfoService orderInfoService;
|
private OrderInfoService orderInfoService;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private MkShopCouponRecordService couponRecordService;
|
private MkShopCouponRecordService couponRecordService;
|
||||||
@@ -66,8 +62,6 @@ public class AShopUserServiceImpl implements AShopUserService {
|
|||||||
private MemberLevelConfigService memberLevelConfigService;
|
private MemberLevelConfigService memberLevelConfigService;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private TbMemberConfigService memberConfigService;
|
private TbMemberConfigService memberConfigService;
|
||||||
// @DubboReference
|
|
||||||
// private MkShopConsumeDiscountRecordService consumeDiscountService;
|
|
||||||
|
|
||||||
private ShopUser getUserInfo(Long shopUserId) {
|
private ShopUser getUserInfo(Long shopUserId) {
|
||||||
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getId, shopUserId).one();
|
ShopUser shopUser = shopUserService.queryChain().eq(ShopUser::getId, shopUserId).one();
|
||||||
@@ -94,12 +88,8 @@ public class AShopUserServiceImpl implements AShopUserService {
|
|||||||
public Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount) {
|
public Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount) {
|
||||||
Long mainIdByShopId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
|
Long mainIdByShopId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
|
||||||
PageHelper.startPage(PageUtil.buildPageHelp());
|
PageHelper.startPage(PageUtil.buildPageHelp());
|
||||||
PageInfo<ShopUserDTO> shopUserDTOPageInfo = new PageInfo<>(shopUserMapper.selectPageByKeyAndIsVip(mainIdByShopId, isVip, key, amount));
|
PageInfo<ShopUserDTO> shopUsers = new PageInfo<>(shopUserMapper.selectPageByKeyAndIsVip(mainIdByShopId, isVip, key, amount));
|
||||||
// shopUserDTOPageInfo.getList().forEach(item -> {
|
return PageUtil.convert(shopUsers);
|
||||||
// item.setNew(consumeDiscountService.isNewUser(item, StpKit.USER.getShopId()));
|
|
||||||
// setUserDiscount(item);
|
|
||||||
// });
|
|
||||||
return PageUtil.convert(shopUserDTOPageInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -177,16 +167,6 @@ public class AShopUserServiceImpl implements AShopUserService {
|
|||||||
return shopUserService.save(shopUser);
|
return shopUserService.save(shopUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUserDiscount(ShopUserDTO shopUserDTO) {
|
|
||||||
if (shopUserDTO.getMemberLevelId() != null) {
|
|
||||||
MemberLevelConfig memberLevelConfig = memberLevelConfigService.getById(shopUserDTO.getMemberLevelId());
|
|
||||||
shopUserDTO.setMemberLevelName(memberLevelConfig == null ? null : memberLevelConfig.getName());
|
|
||||||
if (memberLevelConfig != null) {
|
|
||||||
shopUserDTO.setDiscount(memberLevelConfig.getDiscount());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ShopUser getDetail(Integer id, Integer userId) {
|
public ShopUser getDetail(Integer id, Integer userId) {
|
||||||
Long mainId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
|
Long mainId = shopInfoService.getMainIdByShopId(StpKit.USER.getShopId());
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<mapper namespace="com.czg.service.account.mapper.ShopUserMapper">
|
<mapper namespace="com.czg.service.account.mapper.ShopUserMapper">
|
||||||
<update id="incrAccount">
|
<update id="incrAccount">
|
||||||
update tb_shop_user
|
update tb_shop_user
|
||||||
set amount = COALESCE(amount, 0) + #{money},
|
set amount = amount + #{money},
|
||||||
update_time = #{time}
|
update_time = #{time}
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectVipCard" resultType="com.czg.account.dto.shopuser.ShopUserVipCardDTO">
|
<select id="selectVipCard" resultType="com.czg.account.dto.shopuser.ShopUserVipCardDTO">
|
||||||
select tb_shop_info.logo, tb_shop_info.shop_name shopName, tb_shop_user.amount, tb_shop_user.shop_id shopId
|
select tb_shop_info.logo, tb_shop_info.shop_name shopName, tb_shop_user.amount, tb_shop_user.main_shop_id shopId
|
||||||
from tb_shop_user
|
from tb_shop_user
|
||||||
left join tb_shop_info on tb_shop_user.main_shop_id = tb_shop_info.id
|
left join tb_shop_info on tb_shop_user.main_shop_id = tb_shop_info.id
|
||||||
${qwSql}
|
${qwSql}
|
||||||
@@ -72,41 +72,20 @@
|
|||||||
IFNULL(c.couponNum, 0) AS couponNum,
|
IFNULL(c.couponNum, 0) AS couponNum,
|
||||||
IFNULL(d.orderNumber, 0) AS orderNumber,
|
IFNULL(d.orderNumber, 0) AS orderNumber,
|
||||||
IFNULL(f.rechargeAmount, 0) AS rechargeAmount,
|
IFNULL(f.rechargeAmount, 0) AS rechargeAmount,
|
||||||
c.name as memberLevelName,
|
point.point_balance as pointBalance,
|
||||||
c.discount
|
c1.name as memberLevelName,
|
||||||
|
c1.discount
|
||||||
FROM tb_shop_user a
|
FROM tb_shop_user a
|
||||||
LEFT JOIN tb_user_info b ON b.id = a.user_id
|
LEFT JOIN tb_member_level_config c1 on c1.id=a.member_level_id
|
||||||
LEFT JOIN tb_member_level_config c on c.id=a.member_level_id
|
LEFT JOIN mk_points_user point on point.shop_user_id = a.id
|
||||||
|
|
||||||
-- 预计算优惠券数量
|
-- 预计算优惠券数量
|
||||||
LEFT JOIN (
|
LEFT JOIN (SELECT shop_user_id, COUNT(*) AS couponNum FROM mk_shop_coupon_record WHERE is_del = 0 GROUP BY shop_user_id ) c ON c.shop_user_id = a.id
|
||||||
SELECT shop_user_id, COUNT(*) AS couponNum
|
|
||||||
FROM mk_shop_coupon_record
|
|
||||||
WHERE
|
|
||||||
is_del = 0
|
|
||||||
# AND status = 0
|
|
||||||
# AND use_start_time < NOW()
|
|
||||||
# AND use_end_time > NOW()
|
|
||||||
GROUP BY shop_user_id
|
|
||||||
) c ON c.shop_user_id = a.id
|
|
||||||
|
|
||||||
-- 预计算订单数量
|
-- 预计算订单数量
|
||||||
LEFT JOIN (
|
LEFT JOIN (SELECT user_id, shop_id, COUNT(*) AS orderNumber FROM tb_order_info GROUP BY user_id, shop_id) d ON d.user_id = a.user_id AND d.shop_id = a.main_shop_id
|
||||||
SELECT user_id, shop_id, COUNT(*) AS orderNumber
|
|
||||||
FROM tb_order_info
|
|
||||||
GROUP BY user_id, shop_id
|
|
||||||
) d ON d.user_id = a.user_id AND d.shop_id = a.main_shop_id
|
|
||||||
|
|
||||||
-- 预计算充值总金额
|
-- 预计算充值总金额
|
||||||
LEFT JOIN (
|
LEFT JOIN ( SELECT user_id, shop_id, SUM(amount) AS rechargeAmount
|
||||||
SELECT user_id, shop_id, SUM(amount) AS rechargeAmount
|
FROM tb_shop_user_flow WHERE biz_code IN ('cashIn', 'wechatIn', 'alipayIn') GROUP BY user_id, shop_id ) f ON f.user_id = a.user_id AND f.shop_id = a.main_shop_id
|
||||||
FROM tb_shop_user_flow
|
|
||||||
WHERE biz_code IN ('cashIn', 'wechatIn', 'alipayIn')
|
|
||||||
GROUP BY user_id, shop_id
|
|
||||||
) f ON f.user_id = a.user_id AND f.shop_id = a.main_shop_id
|
|
||||||
|
|
||||||
WHERE a.main_shop_id = #{shopId}
|
WHERE a.main_shop_id = #{shopId}
|
||||||
|
|
||||||
<if test="isVip != null">
|
<if test="isVip != null">
|
||||||
AND a.is_vip = #{isVip}
|
AND a.is_vip = #{isVip}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user