|
|
@ -138,31 +138,30 @@ public class ProxyServiceImpl implements ProxyService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public void update(ProxyEntity proxyEntity) {
|
|
|
|
public void update(ProxyEntity proxyEntity) {
|
|
|
|
|
|
|
|
|
|
|
|
// 修改IP的信息
|
|
|
|
// 修改IP的信息
|
|
|
|
proxyMapper.updateById(proxyEntity);
|
|
|
|
proxyMapper.updateById(proxyEntity);
|
|
|
|
List<String> phoneList = proxyEntity.getPhoneList();
|
|
|
|
// List<String> phoneList = proxyEntity.getPhoneList();
|
|
|
|
List<ProxyAccountEntity> list = new ArrayList<>();
|
|
|
|
// List<ProxyAccountEntity> list = new ArrayList<>();
|
|
|
|
|
|
|
|
//
|
|
|
|
List<ProxyAccountEntity> proxyAccountEntities = proxyAccountMapper.selectList(new LambdaQueryWrapper<ProxyAccountEntity>()
|
|
|
|
// List<ProxyAccountEntity> proxyAccountEntities = proxyAccountMapper.selectList(new LambdaQueryWrapper<ProxyAccountEntity>()
|
|
|
|
.eq(ProxyAccountEntity::getProxyId, proxyEntity.getId()));
|
|
|
|
// .eq(ProxyAccountEntity::getProxyId, proxyEntity.getId()));
|
|
|
|
Map<String, List<ProxyAccountEntity>> map = proxyAccountEntities.stream().collect(Collectors.groupingBy(ProxyAccountEntity::getNid));
|
|
|
|
// Map<String, List<ProxyAccountEntity>> map = proxyAccountEntities.stream().collect(Collectors.groupingBy(ProxyAccountEntity::getNid));
|
|
|
|
|
|
|
|
//
|
|
|
|
// 获取所有要绑定的账号-并添加绑定关系
|
|
|
|
// // 获取所有要绑定的账号-并添加绑定关系
|
|
|
|
for (String phone : phoneList) {
|
|
|
|
// for (String phone : phoneList) {
|
|
|
|
if (!map.containsKey(phone)) {
|
|
|
|
// if (!map.containsKey(phone)) {
|
|
|
|
ProxyAccountEntity proxyAccountEntity = new ProxyAccountEntity(phone, proxyEntity.getId());
|
|
|
|
// ProxyAccountEntity proxyAccountEntity = new ProxyAccountEntity(phone, proxyEntity.getId());
|
|
|
|
list.add(proxyAccountEntity);
|
|
|
|
// list.add(proxyAccountEntity);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if (CollUtil.isNotEmpty(list)) proxyAccountMapper.insertAll(list);
|
|
|
|
// if (CollUtil.isNotEmpty(list)) proxyAccountMapper.insertAll(list);
|
|
|
|
|
|
|
|
//
|
|
|
|
// 删除的账号-删除绑定关系
|
|
|
|
// // 删除的账号-删除绑定关系
|
|
|
|
Set<String> phones = map.keySet();
|
|
|
|
// Set<String> phones = map.keySet();
|
|
|
|
List<String> deleteList = phones.stream().filter(t -> !phoneList.contains(t)).collect(Collectors.toList());
|
|
|
|
// List<String> deleteList = phones.stream().filter(t -> !phoneList.contains(t)).collect(Collectors.toList());
|
|
|
|
if (CollUtil.isNotEmpty(deleteList)) {
|
|
|
|
// if (CollUtil.isNotEmpty(deleteList)) {
|
|
|
|
proxyAccountMapper.delete(new LambdaQueryWrapper<ProxyAccountEntity>().in(ProxyAccountEntity::getNid, deleteList));
|
|
|
|
// proxyAccountMapper.delete(new LambdaQueryWrapper<ProxyAccountEntity>().in(ProxyAccountEntity::getNid, deleteList));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -277,7 +276,7 @@ public class ProxyServiceImpl implements ProxyService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void addSurplusDay(ProxyDTO proxyDTO) {
|
|
|
|
public void addSurplusDay(ProxyDTO proxyDTO) {
|
|
|
|
proxyMapper.addSurplusDay(proxyDTO.getIds(), proxyDTO.getSurplusDay());
|
|
|
|
proxyMapper.addSurplusDay(proxyDTO.getIds(), proxyDTO.getSurplusDay(), "0");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|