Sfoglia il codice sorgente

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 anni fa
parent
commit
8ba3ca8ff8

+ 41 - 33
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java

@ -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();
        }
    }

+ 2 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -925,8 +925,6 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                return write(result.getInt("status"), result.getString("msg"));
            } else if (StringUtils.isNotEmpty(isAll) && isAll.equals("1")) {
                patientRemindService.remindPatientExpensesAll(getUID());
                redisTemplate.opsForValue().set("expenses:remind:doctor:" + getUID(), "0");
                redisTemplate.expire("expenses:remind:doctor:" + getUID(), 10, TimeUnit.MINUTES);
                return error(200, "提醒操作成功");
            } else {
                redisTemplate.opsForValue().set("expenses:remind:doctor:" + getUID(), "0");
@ -1087,10 +1085,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                JSONObject json = patientRemindService.remindPatientFocusWechat(patient, getUID());
                result = json.getInt("status");
                msg = json.getString("msg");
                redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + getUID(), "0");
                redisTemplate.expire("wechat:focus:remind:doctor:" + getUID(), 10, TimeUnit.MINUTES);
            }
            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + getUID(), "0");
            redisTemplate.expire("wechat:focus:remind:doctor:" + getUID(), 10, TimeUnit.MINUTES);
            return write(result, msg);
        } catch (Exception e) {
            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + getUID(), "0");