This commit is contained in:
parent
4994af50bd
commit
c32d430483
3 changed files with 16 additions and 10 deletions
|
|
@ -49,9 +49,8 @@ public class FidNameUpdater implements Handler<SubjectPayload, SubjectPayload> {
|
||||||
List<Long> notFoundFidPhones = new ArrayList<>();
|
List<Long> notFoundFidPhones = new ArrayList<>();
|
||||||
subjects.forEach(subjectProfile -> {
|
subjects.forEach(subjectProfile -> {
|
||||||
Name name = nameByPhone.get(CTUtil.normalizePhoneNumber(subjectProfile.getPhone()));
|
Name name = nameByPhone.get(CTUtil.normalizePhoneNumber(subjectProfile.getPhone()));
|
||||||
if (subjectProfile.getFid() == null && name == null) {
|
if (name != null) {
|
||||||
notFoundFidPhones.add(subjectProfile.getPhone());
|
if (subjectProfile.getFid() == null || !subjectProfile.getFid().equals(name.getFid())) {
|
||||||
} else if (subjectProfile.getFid() == null || !subjectProfile.getFid().equals(name.getFid())) {
|
|
||||||
subjectProfile.setFid(name.getFid());
|
subjectProfile.setFid(name.getFid());
|
||||||
subjectProfile.getNameData().setFirstName(name.getFirst());
|
subjectProfile.getNameData().setFirstName(name.getFirst());
|
||||||
subjectProfile.getNameData().setLastName(name.getLast());
|
subjectProfile.getNameData().setLastName(name.getLast());
|
||||||
|
|
@ -59,6 +58,9 @@ public class FidNameUpdater implements Handler<SubjectPayload, SubjectPayload> {
|
||||||
subjectProfile.getNameData().setBirthDate(name.getBirthDate());
|
subjectProfile.getNameData().setBirthDate(name.getBirthDate());
|
||||||
changingFidPhones.add(subjectProfile);
|
changingFidPhones.add(subjectProfile);
|
||||||
}
|
}
|
||||||
|
} else if (subjectProfile.getFid() != null) {
|
||||||
|
notFoundFidPhones.add(subjectProfile.getPhone());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
List<Long> changingFids = new ArrayList<>();
|
List<Long> changingFids = new ArrayList<>();
|
||||||
if (!notFoundFidPhones.isEmpty()) {
|
if (!notFoundFidPhones.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,10 @@
|
||||||
FROM json_to_recordset(#{json}::json) AS t(
|
FROM json_to_recordset(#{json}::json) AS t(
|
||||||
phone bigint
|
phone bigint
|
||||||
))
|
))
|
||||||
select distinct (package_id) from signals_packages_records where phone_l in (select * from src)
|
select distinct (package_id)
|
||||||
|
from signals_packages_records spr
|
||||||
|
join signals_user_packages sup on sup.id = spr.package_id
|
||||||
|
where spr.phone_l in (select * from src) and sup.status = 'ON_MONITORING'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="registerJson" parameterType="string" resultType="long">
|
<select id="registerJson" parameterType="string" resultType="long">
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,8 @@
|
||||||
id_type = null,
|
id_type = null,
|
||||||
flag_debt5000 = null,
|
flag_debt5000 = null,
|
||||||
flag_90_12 = null,
|
flag_90_12 = null,
|
||||||
calculated_at = null
|
calculated_at = null,
|
||||||
|
searched_at = now()
|
||||||
FROM json_to_recordset(#{json}::json) AS src(
|
FROM json_to_recordset(#{json}::json) AS src(
|
||||||
phone bigint)
|
phone bigint)
|
||||||
where dst.phone = src.phone
|
where dst.phone = src.phone
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue