| | |
| | | if (!DataAuthUtil.hasAllShopAuth()) { |
| | | vipInfoListDto.setShopId(sysUsers.getShopId()); |
| | | } |
| | | QueryUtil.setQueryLimitCom(sysUsers.getCompanyId()); |
| | | QueryUtil.setQueryLimitCom(vipInfoListDto); |
| | | return sysVipInfoDao.selectVipAddressBookByList(vipInfoListDto); |
| | | } |
| | | |
| | |
| | | int i=sysVipInfoDao.insert(vipInfo); |
| | | |
| | | if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { |
| | | batchInsertLabel(addVipDto.getLabels(), user.getSuName(), vipInfo.getId()); |
| | | batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); |
| | | } |
| | | |
| | | //创建用户默认储值卡 |
| | |
| | | int i = sysVipInfoDao.update(vipInfo); |
| | | |
| | | if (CollectionUtils.isNotEmpty(modifyVipDto.getLabels())) { |
| | | sysVipLabelDao.deleteByVipId(modifyVipDto.getVipId()); |
| | | |
| | | batchInsertLabel(modifyVipDto.getLabels(), user.getSuName(), vipInfo.getId()); |
| | | sysVipLabelDao.deleteRelateByVipId(modifyVipDto.getVipId()); |
| | | batchInsertLabel(modifyVipDto.getLabels(), vipInfo.getId()); |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | private void batchInsertLabel(List<String> labelList, String suName, Long id) { |
| | | private void batchInsertLabel(List<String> labelList, Long id) { |
| | | Set<String> labels = new HashSet<>(labelList); |
| | | Iterator<String> iterator = labels.iterator(); |
| | | if (iterator.hasNext()) { |
| | | SysVipLabel sysVipLabel = new SysVipLabel(); |
| | | sysVipLabel.setCreateTime(new Date()); |
| | | sysVipLabel.setCreateBy(suName); |
| | | sysVipLabel.setLabel(iterator.next()); |
| | | sysVipLabel.setVipId(id); |
| | | sysVipLabelDao.insert(sysVipLabel); |
| | | while (iterator.hasNext()) { |
| | | SysVipLabelRelate relate = new SysVipLabelRelate(); |
| | | relate.setLabelId(Long.parseLong(iterator.next())); |
| | | relate.setVipId(id); |
| | | sysVipLabelDao.insertRelate(relate); |
| | | } |
| | | } |
| | | |