| | |
| | | public int apiAddVip(AddVipDto addVipDto) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", addVipDto.getVipNo(), |
| | | "company_id",user.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | if (StringUtils.isNotBlank(addVipDto.getVipNo())) { |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", addVipDto.getVipNo(), |
| | | "company_id", user.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | } |
| | | } |
| | | |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", addVipDto.getPhone(), |
| | |
| | | throw new GlobleException("用户不存在"); |
| | | } |
| | | |
| | | if (!modifyVipDto.getVipNo().equals(vipInfo.getVipNo())) { |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", modifyVipDto.getVipNo(), |
| | | "company_id",user.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | if (StringUtils.isNotBlank(modifyVipDto.getVipNo())) { |
| | | if (!modifyVipDto.getVipNo().equals(vipInfo.getVipNo())) { |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", modifyVipDto.getVipNo(), |
| | | "company_id", user.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | private void batchInsertLabel(List<String> labelList, Long id) { |
| | | Set<String> labels = new HashSet<>(labelList); |
| | | Iterator<String> iterator = labels.iterator(); |
| | | if (iterator.hasNext()) { |
| | | while (iterator.hasNext()) { |
| | | SysVipLabelRelate relate = new SysVipLabelRelate(); |
| | | relate.setLabelId(Long.parseLong(iterator.next())); |
| | | relate.setVipId(id); |