This commit is contained in:
parent
e7cb1526d7
commit
543e492bf2
2 changed files with 8 additions and 7 deletions
|
|
@ -21,7 +21,7 @@ public class UserPackageService {
|
|||
}
|
||||
|
||||
public boolean isPackageNotUnique(String userId, String packageName) {
|
||||
return userPackageMapper.isPackageNotUnique(userId, packageName);
|
||||
return userPackageMapper.isPackageNotUnique(userId.substring(0, 6), packageName);
|
||||
}
|
||||
|
||||
public Long registerPackage(String userId, String packageName, List<Integer> signalTypes) {
|
||||
|
|
@ -63,7 +63,7 @@ public class UserPackageService {
|
|||
userPackageMapper.setFidChanged(id);
|
||||
}
|
||||
public List<UserPackage> findAllPackages(String userId) {
|
||||
return userPackageMapper.findAllPackagesByUserId(userId);
|
||||
return userPackageMapper.findAllPackagesByUserId(userId.substring(0, 6));
|
||||
}
|
||||
|
||||
public List<UserPackage> findByMemberCodeAndPackageName(String memberCode, String packageName) {
|
||||
|
|
|
|||
|
|
@ -41,22 +41,20 @@ public class PersonServiceV2 {
|
|||
}
|
||||
List<Id> passports = mapper.findPassportData(fids);
|
||||
|
||||
Map<Integer, Id> idByFid = passports.stream()
|
||||
return passports.stream()
|
||||
.filter(this::isDUL)
|
||||
.filter(this::checkLength)
|
||||
.collect(Collectors.groupingBy(
|
||||
Id::getFid,
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toList(),
|
||||
docs -> docs.stream()
|
||||
.filter(p ->
|
||||
("21".equals(p.getIdType2()) || "21".equals(p.getIdType()))
|
||||
&& CTUtil.normalizePassport(p).length() == 10)
|
||||
.filter(p -> "21".equals(p.getIdType2()) || "21".equals(p.getIdType()))
|
||||
.max(byDatesDesc)
|
||||
.or(() -> docs.stream().max(byDatesDesc))
|
||||
.orElse(null)
|
||||
)
|
||||
));
|
||||
return idByFid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,4 +101,7 @@ public class PersonServiceV2 {
|
|||
(idType2 != null && (idType2 >= 1 && idType2 <= 999));
|
||||
}
|
||||
|
||||
private boolean checkLength(Id p) {
|
||||
return ("21".equals(p.getIdType2()) || "21".equals(p.getIdType())) && CTUtil.normalizePassport(p).length() == 10;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue