feat:规则修改
This commit is contained in:
1 parent
ee1736ccf8
commit
9787739cff
3 files changed
+12
-11
No files matched your search
+2
-7
@@ -231,14 +231,9 @@ public class ActCancelItemServiceImpl extends ServiceImpl<ActCancelItemMapper, A
|
||||
.eq(ActCancelItemEntity::getReceiverUserId, userId)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return ActUserReceiveEnum.USER_LIMIT_REACHED;
|
||||
return ActUserReceiveEnum.USER_CAN_JOIN_ACT;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(detail.getExpireTime())) {
|
||||
if (detail.getExpireTime().isBefore(LocalDateTime.now())) {
|
||||
return ActUserReceiveEnum.ACT_EXPIRED;
|
||||
}
|
||||
}
|
||||
return ActUserReceiveEnum.USER_CAN_JOIN_ACT;
|
||||
return ActUserReceiveEnum.USER_LIMIT_REACHED;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+9
-4
@@ -25,6 +25,7 @@ import com.bsd.pjcloud.wallet.api.dto.WalletTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponReceiveDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponRecordDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
@@ -166,7 +167,7 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
if (ObjectUtil.equals(uniqueCode, "1qRgFo")) {
|
||||
// 判断是否为食堂用户
|
||||
MchManageVo userMch = mchManageService.getFirstMchByDeptId(sysUser.getDeptId(), List.of(MerchantTypeEnum.CANTEEN));
|
||||
if (ObjectUtil.isEmpty(userMch)) {
|
||||
if (ObjectUtil.isEmpty(userMch) && false) {
|
||||
log.info("|{}|{}用户参加{}活动失败:不是食堂用户,用户属于食堂{}", TAG, sysUser.getName(), uniqueCode, JSONUtil.toJsonStr(userMch));
|
||||
return ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
|
||||
}
|
||||
@@ -178,14 +179,18 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
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(4),
|
||||
LocalDate.now().minusMonths(3).withDayOfMonth(1),
|
||||
LocalDate.now().plusDays(1)
|
||||
});
|
||||
List<WalletTransactionVo> walletList = walletTransactionMapper.scopeList(dto, null);
|
||||
if (ObjectUtil.isEmpty(walletList)) {
|
||||
log.info("|{}|{}用户参加{}活动失败:用户最近一年充值金额不足500,1500,800,2400", TAG, sysUser.getName(), uniqueCode);
|
||||
log.info("|{}|{}用户参加{}活动失败:用户最近3个月没有充值记录", TAG, sysUser.getName(), uniqueCode);
|
||||
return ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
|
||||
}
|
||||
Integer walletTotalPrice = walletList.stream().filter(v -> ObjectUtil.isNotEmpty(v.getPrice())).map(WalletTransactionEntity::getPrice).reduce(Integer::sum).orElse(0);
|
||||
if (walletTotalPrice < 1500 * 100) {
|
||||
log.info("|{}|{}用户参加{}活动失败:用户最近3个月没有充值{}分", TAG, sysUser.getName(), uniqueCode, walletTotalPrice);
|
||||
return ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
|
||||
}
|
||||
// 要在生日当月领取
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc , a.id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user