|
@ -76,7 +76,11 @@ public class PatientRemindService extends BaseService {
|
|
|
}
|
|
|
|
|
|
RemindAll(doc, hos);
|
|
|
redisTemplate.opsForValue().set("expenses:remind:doctor:" + doctor, "0");
|
|
|
redisTemplate.expire("expenses:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
|
|
|
} catch (Exception e) {
|
|
|
redisTemplate.opsForValue().set("expenses:remind:doctor:" + doctor, "0");
|
|
|
redisTemplate.expire("expenses:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
@ -87,8 +91,7 @@ public class PatientRemindService extends BaseService {
|
|
|
* @param doc
|
|
|
* @param hos
|
|
|
*/
|
|
|
public void RemindAll(Doctor doc, Hospital hos) {
|
|
|
try {
|
|
|
public void RemindAll(Doctor doc, Hospital hos) throws Exception {
|
|
|
boolean flag = true;
|
|
|
int page = 0;
|
|
|
int start = 0;
|
|
@ -103,7 +106,7 @@ public class PatientRemindService extends BaseService {
|
|
|
" limit ?,3000";
|
|
|
|
|
|
while (flag) {
|
|
|
List<Patient> result = jdbcTemplate.query(sql,new Object[]{doc.getCode(), doc.getCode(), start}, new BeanPropertyRowMapper(Patient.class));
|
|
|
List<Patient> result = jdbcTemplate.query(sql, new Object[]{doc.getCode(), doc.getCode(), start}, new BeanPropertyRowMapper(Patient.class));
|
|
|
|
|
|
if (result != null && result.size() > 0) {
|
|
|
for (Patient p : result) {
|
|
@ -122,9 +125,6 @@ public class PatientRemindService extends BaseService {
|
|
|
flag = false;
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -294,36 +294,44 @@ public class PatientRemindService extends BaseService {
|
|
|
*/
|
|
|
@Async
|
|
|
public void remindPatientWechatFocusAll(String doctor) throws Exception {
|
|
|
int page = 0;
|
|
|
int start = 0;
|
|
|
boolean flag = true;
|
|
|
Doctor doc = doctorDao.findByCode(doctor);
|
|
|
if (doc == null) {
|
|
|
throw new Exception("doctor info can not find");
|
|
|
}
|
|
|
String sql = "select p.code,p.name,p.mobile" +
|
|
|
" from " +
|
|
|
" wlyy_sign_family f join wlyy_patient p on f.patient = p.code" +
|
|
|
" where " +
|
|
|
" (f.doctor = ? or f.doctor_health = ?) " +
|
|
|
" and f.status > 0 " +
|
|
|
" and f.expenses_status = '1' " +
|
|
|
" and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
|
|
|
|
|
|
while (flag) {
|
|
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
|
|
|
|
|
|
if (result != null && result.size() > 0) {
|
|
|
for (Map<String, Object> map : result) {
|
|
|
remindWechatFocus(map, doc);
|
|
|
try {
|
|
|
int page = 0;
|
|
|
int start = 0;
|
|
|
boolean flag = true;
|
|
|
Doctor doc = doctorDao.findByCode(doctor);
|
|
|
if (doc == null) {
|
|
|
throw new Exception("doctor info can not find");
|
|
|
}
|
|
|
String sql = "select p.code,p.name,p.mobile" +
|
|
|
" from " +
|
|
|
" wlyy_sign_family f join wlyy_patient p on f.patient = p.code" +
|
|
|
" where " +
|
|
|
" (f.doctor = ? or f.doctor_health = ?) " +
|
|
|
" and f.status > 0 " +
|
|
|
" and f.expenses_status = '1' " +
|
|
|
" and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
|
|
|
|
|
|
while (flag) {
|
|
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
|
|
|
|
|
|
if (result != null && result.size() > 0) {
|
|
|
for (Map<String, Object> map : result) {
|
|
|
remindWechatFocus(map, doc);
|
|
|
}
|
|
|
page = page + 1;
|
|
|
start = page * 3000;
|
|
|
} else {
|
|
|
flag = false;
|
|
|
}
|
|
|
page = page + 1;
|
|
|
start = page * 3000;
|
|
|
} else {
|
|
|
flag = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
|
|
|
redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
|
|
|
} catch (Exception e) {
|
|
|
redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
|
|
|
redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|