|
@ -45,7 +45,7 @@ public class PatientSosContactsJob implements Job {
|
|
|
String sql = " select pd.device_sn,pd.category_code,wd.sim,sc.* from wlyy_patient_device pd inner join wlyy_devices wd " +
|
|
|
" on pd.device_sn = wd.device_code and pd.del=0 " +
|
|
|
"INNER JOIN base_patient_sos_contacts sc on sc.patient = pd.user and sc.del=1 " +
|
|
|
"where sc.success_flag=0 group by wd.device_code ";
|
|
|
"where sc.success_flag=0 and pd.category_code in('7','4','16') group by wd.device_code ";
|
|
|
List<Map<String,Object>> sims = jdbcTemplate.queryForList(sql);
|
|
|
List<PatientSosContactsDO> modify = new ArrayList<>();
|
|
|
for(Map<String,Object> tmp:sims){//添加白名单,添加设备联系人
|
|
@ -59,7 +59,9 @@ public class PatientSosContactsJob implements Job {
|
|
|
String phone_seqid = tmp.get("phone_seqid").toString() ;
|
|
|
try {
|
|
|
PatientSosContactsDO sosContactsDO = sosContactsDao.findOne(Long.parseLong(id));
|
|
|
|
|
|
if (StringUtils.isBlank(sosContactsDO.getUpdateInfo())){
|
|
|
sosContactsDO.setUpdateInfo(" ");
|
|
|
}
|
|
|
if(null!=sosContactsDO){
|
|
|
if (StringUtils.isNotBlank(sim)){
|
|
|
JSONObject response = cardService.setPatientContacts(sim, null, null, "1", sos_phone, null);//移动白名单
|
|
@ -102,15 +104,14 @@ public class PatientSosContactsJob implements Job {
|
|
|
yunXunDeviceService.setSos(device_sn,phone1,phone2,phone3);
|
|
|
sosContactsDO.setUpdateInfo(sosContactsDO.getUpdateInfo()+",{deviceSn:"+device_sn+":unknow}");
|
|
|
}
|
|
|
modify.add(sosContactsDO);
|
|
|
|
|
|
sosContactsDao.save(sosContactsDO);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
logger.info(sim+"--同步失败--"+sos_phone);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
sosContactsDao.save(modify);
|
|
|
// sosContactsDao.save(modify);
|
|
|
logger.info("PATIENT_SOS_CONTACTS_JOB end");
|
|
|
}
|
|
|
}
|