feat:用户判断

This commit is contained in:
dzc committed 2026-01-28 20:16:14 +08:00
1 parent 86e8f08242
commit cce4230f0d
2 files changed
+20 -1

No files matched your search

@@ -37,6 +37,7 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletTransactionEntity::getDeptId, dto.getDeptId())
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletTransactionEntity::getUserId, dto.getUserIds())
.in(ObjectUtil.isNotEmpty(dto.getBizTypes()), WalletTransactionEntity::getBizType, dto.getBizTypes())
.in(ObjectUtil.isNotEmpty(dto.getPriceList()), WalletTransactionEntity::getPrice, dto.getPriceList())
.between(
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
WalletTransactionEntity::getCreateTime,
@@ -7,11 +7,15 @@ import com.bsd.pjcloud.admin.api.entity.SysUser;
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
import com.bsd.pjcloud.common.core.constant.enums.MerchantTypeEnum;
import com.bsd.pjcloud.common.core.exception.ServiceException;
import com.bsd.pjcloud.wallet.api.constant.WalletBizEnum;
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
import com.bsd.pjcloud.wallet.api.dto.WalletTransactionDto;
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponReceiveDto;
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
import com.bsd.pjcloud.wallet.api.vo.transaction.WalletTransactionVo;
import com.bsd.pjcloud.wallet.mapper.WalletTransactionMapper;
import com.bsd.pjcloud.wallet.mapper.act.ActCouponMapper;
import com.bsd.pjcloud.wallet.mapper.act.ActCouponRecordMapper;
import com.bsd.pjcloud.wallet.service.ActCouponRecordService;
@@ -22,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.List;
@@ -34,6 +39,7 @@ import java.util.List;
public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMapper, ActCouponRecordEntity> implements ActCouponRecordService {
private final ActCouponMapper actCouponMapper;
private final WalletTransactionMapper walletTransactionMapper;
private final MchManageService mchManageService;
private final ActCouponComUtilService actCouponComUtilService;
@@ -78,7 +84,19 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
return ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
}
// 判断用户最近一年充值是否为500,1500,800,2400
WalletTransactionDto dto = new WalletTransactionDto();
dto.setBizTypes(WalletBizEnum.getTopUpCodes());
dto.setType(WalletTransactionDto.TYPE_INCOME);
dto.setUserId(sysUser.getUserId());
dto.setPriceList(List.of(500 * 100, 1500 * 100, 800 * 100, 2400 * 100));
dto.setCreateTimeList(new LocalDate[]{
LocalDate.now().minusMonths(6),
LocalDate.now()
});
List<WalletTransactionVo> walletList = walletTransactionMapper.scopeList(dto, null);
if (ObjectUtil.isEmpty(walletList)) {
return ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
}
return ActUserReceiveEnum.USER_CAN_JOIN_ACT;
}
return null;