| | |
| | | |
| | | @Override |
| | | public void add(TFoundationPersonDTO dto) { |
| | | |
| | | long count1 = this.count(Wrappers.lambdaQuery(TFoundationPerson.class) |
| | | .eq(TFoundationPerson::getShopId, dto.getShopId()) |
| | | .eq(TFoundationPerson::getMealCount, dto.getMealCount())); |
| | | if(count1>0){ |
| | | throw new ServiceException("该店铺已存在该用餐人数设置"); |
| | | } |
| | | |
| | | List<TFoundationConfig> foundationConfigs = dto.getFoundationConfigs(); |
| | | long count = foundationConfigs.stream().map(TFoundationConfig::getTypeId).distinct().count(); |
| | | if(foundationConfigs.size()!=count){ |
| | |
| | | |
| | | @Override |
| | | public void edit(TFoundationPersonDTO dto) { |
| | | long count1 = this.count(Wrappers.lambdaQuery(TFoundationPerson.class) |
| | | .eq(TFoundationPerson::getShopId, dto.getShopId()) |
| | | .eq(TFoundationPerson::getMealCount, dto.getMealCount()) |
| | | .ne(TFoundationPerson::getId,dto.getId())); |
| | | if(count1>0){ |
| | | throw new ServiceException("该店铺已存在该用餐人数设置"); |
| | | } |
| | | |
| | | List<TFoundationConfig> foundationConfigs = dto.getFoundationConfigs(); |
| | | long count = foundationConfigs.stream().map(TFoundationConfig::getTypeId).distinct().count(); |
| | | if(foundationConfigs.size()!=count){ |