| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | THuiminCard huiminCard = huiminCardService.getById(id); |
| | | if (huiminCard.getEndTime()!=null && huiminCard.getEndTime().before(new Date())){ |
| | | return ResultUtil.error("该惠民卡已过期"); |
| | | } |
| | | if (huiminCard.getGrantCount()!=null){ |
| | | if (huiminCard.getGrantCount()<=payHuiminService.lambdaQuery().eq(TPayHuimin::getCardId, huiminCard.getId()) |
| | | .eq(TPayHuimin::getStatus,2).count()){ |
| | |
| | | case 2: |
| | | // 年内卡 |
| | | Date date1 = new Date(); |
| | | |
| | | date1.setMonth(11); |
| | | date1.setDate(31); |
| | | date1.setHours(23); |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查看惠民卡详情 |
| | |
| | | List<THuiminCard> list = huiminCardService.list(); |
| | | for (MyHuiminCardVO myHuiminCardVO : cardList) { |
| | | TPayHuimin byId = payHuiminService.getById(myHuiminCardVO.getId()); |
| | | myHuiminCardVO.setEndTime(byId.getEndTime()); |
| | | |
| | | myHuiminCardVO.setSalesMoney(byId.getSalesMoney()); |
| | | if (myHuiminCardVO.getEndTime().before(new Date())){ |
| | | // 已过期 |
| | | myHuiminCardVO.setIsExpire(1); |
| | | }else{ |
| | | myHuiminCardVO.setIsExpire(0); |
| | | } |
| | | |
| | | int count = huiminRecordService.count(new LambdaQueryWrapper<THuiminRecord>() |
| | | .eq(THuiminRecord::getHuiminCardId, myHuiminCardVO.getCardId())); |
| | | // 购卡7日内没有使用记录可退款。超过7日不管有没有使用记录都不能退款 |
| | |
| | | THuiminCard huiminCard = list.stream().filter(e -> e.getId().equals(myHuiminCardVO.getCardId())).findFirst().orElse(null); |
| | | if (null!=huiminCard){ |
| | | myHuiminCardVO.setCover(huiminCard.getBuyCover()); |
| | | } |
| | | if (myHuiminCardVO.getEndTime().before(new Date())){ |
| | | // 已过期 |
| | | myHuiminCardVO.setIsExpire(1); |
| | | if (null!=huiminCard){ |
| | | myHuiminCardVO.setCover(huiminCard.getUnBuyCover()); |
| | | } |
| | | }else{ |
| | | myHuiminCardVO.setIsExpire(0); |
| | | } |
| | | // 查询绑定人员列表 |
| | | List<TStudent> studentByIds = studentClient.getStudentByIds(myHuiminCardVO.getStudentId()); |
| | |
| | | return ResultUtil.success(new ArrayList<>()); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime localDateTime = LocalDateTime.now().plusDays(365); |
| | | // 将LocalDateTime转换为Date类型 |
| | | Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | String format = simpleDateFormat.format(date); |
| | | System.err.println(format); |
| | | } |
| | | /** |
| | | * 个人中心-我的惠民卡-查看详情 |
| | | */ |