| | |
| | | } |
| | | // 获取查询结果 |
| | | BirthdayCard birthdayCardOld = this.getOne(queryWrapper,false); |
| | | // 如果查询结果不为空,则进行更新操作 |
| | | // 如果查询结果不为空,则进行更新为历史记录 |
| | | if (birthdayCardOld!=null) { |
| | | // 设置删除标志为1 |
| | | birthdayCardOld.setDelFlag(1); |
| | |
| | | birthdayCard.setCreateTime(new Date()); |
| | | birthdayCard.setCreateUserId(merBirthdayEditDto.getUserId()); |
| | | } |
| | | birthdayCard.setCardStatus(merBirthdayEditDto.getCardStatus()); |
| | | this.saveOrUpdate(birthdayCard); |
| | | List<BirthdayGift> birthdayGiftList = birthdayGiftService.listByCardId(birthdayCard.getCardId()); |
| | | if(merBirthdayEditDto.getCardStatus()==1){ |
| | | if(birthdayGiftList==null||birthdayGiftList.isEmpty()){ |
| | | throw new ServiceException(AppErrorConstant.BIRTHDAYCARD_NO_GIFT); |
| | | } |
| | | } |
| | | birthdayCard.setCardStatus(merBirthdayEditDto.getCardStatus()); |
| | | this.saveOrUpdate(birthdayCard); |
| | | } |
| | | |
| | | /** |