| | |
| | | } |
| | | } |
| | | |
| | | Integer isMember = member.getIsMember(); |
| | | if(AppContants.MEMBER_STATE_NO == isMember){ |
| | | List<MallOrderInfo> mallOrderInfos = this.baseMapper.selectOrderInfoByStatus(OrderStatusEnum.FINISH.getValue()); |
| | | if(CollUtil.isNotEmpty(mallOrderInfos)){ |
| | | DataDictionaryCustom minAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.MIN_AMOUNT_IS_MEMBER.getType(), |
| | | DataDictionaryEnum.MIN_AMOUNT_IS_MEMBER.getCode() |
| | | ); |
| | | BigDecimal minAmount = new BigDecimal(minAmountDic.getValue());//系统设置的累计消费金额 |
| | | BigDecimal accumulateAmount = mallOrderInfos.stream().map(MallOrderInfo::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);//累计消费金额 |
| | | if(minAmount.compareTo(accumulateAmount) <= 0){//用户累计消费大于系统设置的累计消费 |
| | | member.setIsMember(AppContants.MEMBER_STATE_YES); |
| | | memberMapper.updateById(member); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |