| | |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Member member = memberService.getByUserId(userId); |
| | | AppBirthdayCardVo appBirthdayCardVo = new AppBirthdayCardVo(); |
| | | if(StringUtils.isNotBlank(member.getBirthday())){ |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | String birthday = member.getBirthday(); |
| | | LocalDate today = LocalDate.now(); |
| | | int birthdayMonth = Integer.parseInt(birthday.split("-")[1]); |
| | | int todayMonth = today.getMonthValue(); |
| | | if (birthdayMonth == todayMonth) { |
| | | appBirthdayCardVo = birthdayCardService.getUserBirthdayCard(userId,member.getRelationShopId()); |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | appBirthdayCardVo.setInBirthdayFlag(1); |
| | | } else { |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | appBirthdayCardVo.setInBirthdayFlag(0); |
| | | appBirthdayCardVo.setCheckBirthdayCard(0); |
| | | if(member.getBindingFlag()==1){ |
| | | Integer check = birthdayCardService.checkBirthdayCard(member.getRelationShopId()); |
| | | if(check==1){ |
| | | appBirthdayCardVo.setCheckBirthdayCard(1); |
| | | if(StringUtils.isNotBlank(member.getBirthday())){ |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | String birthday = member.getBirthday(); |
| | | LocalDate today = LocalDate.now(); |
| | | int birthdayMonth = Integer.parseInt(birthday.split("-")[1]); |
| | | int todayMonth = today.getMonthValue(); |
| | | if (birthdayMonth == todayMonth) { |
| | | appBirthdayCardVo = birthdayCardService.getUserBirthdayCard(userId,member.getRelationShopId()); |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | appBirthdayCardVo.setInBirthdayFlag(1); |
| | | } else { |
| | | appBirthdayCardVo.setHaveBirthdayFlag(1); |
| | | appBirthdayCardVo.setInBirthdayFlag(0); |
| | | } |
| | | }else{ |
| | | appBirthdayCardVo.setHaveBirthdayFlag(0); |
| | | } |
| | | } |
| | | }else{ |
| | | appBirthdayCardVo.setHaveBirthdayFlag(0); |
| | | } |
| | | return R.ok(appBirthdayCardVo); |
| | | } |