Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

liuwenbin 7 anos atrás
pai
commit
eaed3ebae1
19 arquivos alterados com 419 adições e 170 exclusões
  1. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java
  2. 11 11
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java
  3. 2 1
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  4. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java
  5. 13 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  6. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  7. 84 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java
  8. 27 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  9. 246 129
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  10. 14 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  11. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java
  12. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  13. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdTemplateController.java
  14. 3 1
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  15. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  16. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  17. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  18. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  19. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java

@ -230,7 +230,7 @@ public class FeedbackService extends BaseService {
                    params.add(new BasicNameValuePair("remark", "感谢你的意见"));
                    SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    String newDate = formatDate.format(new Date());
                    String keywords = patientName + "," + typeName + "," + result + "," + newDate;
                    String keywords = newDate + "," + result;
                    params.add(new BasicNameValuePair("keywords", keywords));
                    HttpClientUtil.post(url, params, "UTF-8");

+ 11 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java

@ -111,18 +111,17 @@ public class PatientReservationService extends BaseService {
    }
    /**
     * 客服取消预约
     * 居民取消预约
     */
    @Transactional
    public void userCancelOrder(String code,String user) {
    public void patientCancelOrder(String code,String patient) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }
@ -130,17 +129,18 @@ public class PatientReservationService extends BaseService {
    /**
     * 居民取消预约
     * 客服取消预约
     */
    @Transactional
    public void patientCancelOrder(String code,String patient) {
    public void userCancelOrder(String code,String user) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -253,7 +253,8 @@ wlyyService:
image:
  imgUrlDomain: http://www.xmtyw.cn/
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
  check_upload: http://59.61.92.90:8087/wlyy_service
  #check_upload: http://59.61.92.90:8072/wlyy_service
server:
  server_url: http://www.xmtyw.cn/wlyy/
wechat:

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -746,7 +746,7 @@ public class PatientInfoService extends BaseService {
        json.put("BLOOD",archive.getBlood());//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",archive.getMarry());//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        json.put("INSUR_CARD_NO",p.getSsc());//医保卡号
        //补充参数

+ 13 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -808,14 +808,17 @@ public class PrenatalInspectorPreCardService extends BaseService {
            String pregnancyNo = plan.getInspectionCode();
            String patient = plan.getPatient();
            Boolean flag = getSendStatus(prenatalId);
            Long days = DateUtil.getDays(new Date(), planTime);
            Long days = DateUtil.getDays(DateUtil.getNowDateShort(), planTime);
            Date begin = DateUtil.getPreDays(planTime,-14);
            Date end = DateUtil.getPreDays(planTime,14);
            //有产检code
            if (StringUtils.isNotEmpty(pregnancyNo) && (pregnancyNo != null)){
                Boolean examStatus = getExamStatus(patient,pregnancyNo,begin,end);
                if (examStatus){
                Map<String,String> exams = getExamStatus(patient,pregnancyNo,begin,end);
                String examStatus = exams.get("status");
                if ("1".equals(examStatus)){
                    String examTime = exams.get("examTime");
                    json.put("renatalStatus", "4");
                    json.put("examTime", examTime);
                }else {
                    if (days > 7) {
                        json.put("renatalStatus", "3");
@ -989,8 +992,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
     * @return
     * @throws Exception
     */
    public Boolean getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Boolean flag = false;
    public Map getExamStatus(String patient,String pregnancyNo,Date begin,Date end) throws Exception {
        Map<String,String> respose = new HashMap();
        respose.put("status","0");
        try {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                JSONArray natals = reExamRecode(patient,pregnancyNo);
@ -999,13 +1003,15 @@ public class PrenatalInspectorPreCardService extends BaseService {
                    String exam_time = examRecord.getString("EXAM_TIME");
                    Date examTime = format.parse(exam_time);
                    if ((examTime.getTime()<= end.getTime()) && (examTime.getTime() >= begin.getTime())){
                        return true;
                        respose.put("status","1");
                        respose.put("examTime",exam_time);
                        return respose;
                    }
                }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
        return respose;
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -459,7 +459,7 @@ public class PrescriptionService extends BaseService {
            sql += " AND LEFT(p.hospital, 6) = '"+area+"' ";
            //机构
        }else if("2".equals(level)){
            sql += "AND p.hospital = '"+area+"' ";
            sql += " AND p.hospital = '"+area+"' ";
        }
        List<Map<String,Object>> resultList = new ArrayList<>();
        int start = (pageNo-1)*pageSize;

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

@ -337,6 +337,70 @@ public class PatientRemindService extends BaseService {
        }
    }
//    /**
//     * 提醒所有患者关注微信
//     *
//     * @param doctor
//     */
//    public void remindPatientWechatFocusAll(String doctor) throws Exception {
//        try {
//            Calendar today = Calendar.getInstance();
//            today.set(Calendar.HOUR, 23);
//            today.set(Calendar.MINUTE, 59);
//            today.set(Calendar.SECOND, 59);
//            today.set(Calendar.MILLISECOND, 999);
//            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";
//            List<Map<String, Object>> patients = new ArrayList<>();
//            List<String> redisPatients = new ArrayList<>();
//            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
//            while (flag) {
//                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
//
//                if (result != null && result.size() > 0) {
//                    patients.addAll(result);
//                    for (Map<String, Object> map : result) {
//                        if (exist != null && exist.contains(map.get("code").toString())) {
//                            continue;
//                        }
//                        redisPatients.add(map.get("code").toString());
//                    }
//                    page = page + 1;
//                    start = page * 3000;
//                } else {
//                    flag = false;
//                }
//            }
//
//            if (patients.size() > 0) {
//                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
//                new Thread(task).start();
//                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
//                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
//            }
//
//            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();
//        }
//    }
    /**
     * 提醒所有患者关注微信
     *
@ -366,14 +430,14 @@ public class PatientRemindService extends BaseService {
                    "        and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
            List<Map<String, Object>> patients = new ArrayList<>();
            List<String> redisPatients = new ArrayList<>();
            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> exist = redisTemplate.keys("wechat:focus:remind:flag:*");
            while (flag) {
                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
                if (result != null && result.size() > 0) {
                    patients.addAll(result);
                    for (Map<String, Object> map : result) {
                        if (exist != null && exist.contains(map.get("code").toString())) {
                        if (exist != null && exist.size()>0&& isExist(map.get("code").toString(),exist)) {
                            continue;
                        }
                        redisPatients.add(map.get("code").toString());
@ -388,10 +452,11 @@ public class PatientRemindService extends BaseService {
            if (patients.size() > 0) {
                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
                new Thread(task).start();
                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
                for(String pString:redisPatients){
                    redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,2,TimeUnit.MINUTES);//向redis里存入数据和设置缓存时
                    //redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
                }
            }
            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
        } catch (Exception e) {
@ -401,6 +466,15 @@ public class PatientRemindService extends BaseService {
        }
    }
    public boolean isExist(String code,Set<String> set){
        for(String c :set){
            if(c.contains(code)){
                return true;
            }
        }
        return false;
    }
    /**
     * 微信关注提醒
     *
@ -415,8 +489,11 @@ public class PatientRemindService extends BaseService {
        today.set(Calendar.SECOND, 59);
        today.set(Calendar.MILLISECOND, 59);
        JSONObject result = new JSONObject();
        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+ p.get("code").toString(),p.get("code").toString(),today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
//        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
//        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())) {
            result.put("status", -1);

+ 27 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -405,10 +405,11 @@ public class SignWebService extends BaseService {
        List<String> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor}, String.class);
        if (result != null && result.size() > 0) {
            Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            //Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> set = redisTemplate.keys("wechat:focus:remind:flag:*");
            if (set == null) {
                isAll = false;
            } else if (!set.containsAll(result)) {
            } else if (!isAllRemind(result,set)) {
                isAll = false;
            }
        } else {
@ -418,6 +419,30 @@ public class SignWebService extends BaseService {
        return isAll ? 1 : 0;
    }
    /**
     * 存在未提醒的返回false,全部提醒过返回true
     * @param result
     * @param set
     * @return
     */
    public boolean isAllRemind(List<String> result,Set<String> set){
        for(String code :result){
            //默认未提醒
            boolean flag = false;
            for(String c :set){
                if(c.contains(code)){
                    //提醒过标识
                   flag = true;
                }
            }
            if(!flag){
                //返回未提醒
                return false;
            }
        }
        return true;
    }
    /**
     * 查询家庭签约已缴费未关注人数
     *

+ 246 - 129
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -2045,6 +2045,8 @@ public class StatisticsService extends BaseService {
        String totalSql = "SELECT " +
                "  COUNT(1) total " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2058,7 +2060,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id ;
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        Long totalCount = 0L;
        if (totalList != null && totalList.size() > 0) {
@ -2068,6 +2073,8 @@ public class StatisticsService extends BaseService {
        String noReySql = "SELECT " +
                "  COUNT(1) noRey " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2083,7 +2090,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'"+
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(noReySql);
        Long noReyCount = 0L;
        if (noReyList != null && noReyList.size() > 0) {
@ -2327,12 +2337,14 @@ public class StatisticsService extends BaseService {
     */
    public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
        String imDataBaseName = im_dataBase_name;
//        startDate = startDate + " 00:00:00";
//        endDate = endDate + " 23:59:59";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        //咨询量
        String consult_sql = "SELECT " +
                "  COUNT(1) consultCount " +
                "  FROM " +
                " wlyy_admin_team_member m JOIN(" +
                " SELECT d.id,t.create_time FROM " +
                "  " + imDataBaseName + ".Topics t, " +
                "  " + imDataBaseName + ".Participants p, " +
                "  " + imDataBaseName + ".Doctors d, " +
@ -2346,7 +2358,10 @@ public class StatisticsService extends BaseService {
                " AND p.session_id = t.session_id " +
                " AND c.admin_team_code =" + id +
                " AND t.create_time >= '" + startDate + "' " +
                " AND t.create_time <= '" + endDate + "'";
                " AND t.create_time <= '" + endDate + "'" +
                ")c ON c.id = m.doctor_code " +
                " WHERE " +
                " m.team_id = "  + id;
        //获取咨詢數
        Map<String, Object> consultCout = jdbcTemplate.queryForMap(consult_sql);
        if (consultCout.get("consultCount") == null) {
@ -2483,54 +2498,66 @@ public class StatisticsService extends BaseService {
        String sql;
        String totalSql;
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        if ("0".equals(type)) {
            //按周统计
            sql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
            sql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) AS noRely  " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND c.type <> 8" +
                    " AND t. STATUS <> 10 " +
                    " AND t.`reply` = 0 " +
                    " AND p.session_id = t.session_id " +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t. STATUS <> 10  " +
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
            totalSql = "SELECT " +
                    "  left(t.create_time,10) AS dateNo, COUNT(1) total " +
            totalSql = "SELECT" +
                    " left(c.create_time,10) AS dateNo, COUNT(1) total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
                    "  Wlyy_Consult_Team c, " +
                    "  " + imDataBaseName + ".Patients s " +
                    " WHERE " +
                    "  WHERE " +
                    "  d.id = p.participant_id " +
                    " AND c.consult = t.id " +
                    " AND c.patient = s.id " +
                    " AND p.session_id = t.session_id " +
                    " AND c.type <> 8" +
                    " AND c.admin_team_code = " + teamCode +
                    " AND t.create_time >= '" + startDate + "' " +
                    " AND t.create_time <= '" + endDate + "' " +
                    "  AND c.consult = t.id " +
                    "  AND c.patient = s.id " +
                    "  AND p.session_id = t.session_id " +
                    "  AND c.type <> 8" +
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY dateNo";
        } else {
            //按月统计
            sql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS noRely " +
                    "  FROM " +
            sql = "SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS noRely " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2547,11 +2574,17 @@ public class StatisticsService extends BaseService {
                    "  AND t.`reply` = 0  " +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
            totalSql = "SELECT " +
                    "  (DATE_FORMAT(t.create_time, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1) AS weekOfMonth, " +
                    "  COUNT(1) AS total " +
                    "  FROM " +
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
            totalSql="SELECT" +
                    " (DATE_FORMAT(c.create_time, '%v')- DATE_FORMAT('2017-12-01 00:00:00', '%v')+ 1)AS weekOfMonth, " +
                    " COUNT(1)AS total " +
                    " FROM " +
                    " wlyy_admin_team_member m JOIN(" +
                    " SELECT d.id,t.create_time FROM " +
                    "  " + imDataBaseName + ".Topics t, " +
                    "  " + imDataBaseName + ".Participants p, " +
                    "  " + imDataBaseName + ".Doctors d, " +
@ -2566,7 +2599,10 @@ public class StatisticsService extends BaseService {
                    "  AND c.admin_team_code = " + teamCode +
                    "  AND t.create_time >= '" + startDate + "' " +
                    "  AND t.create_time <= '" + endDate + "' " +
                    "  GROUP BY weekOfMonth";
                    ")c ON c.id = m.doctor_code " +
                    " WHERE " +
                    " m.team_id = "  + teamCode +
                    " GROUP BY weekOfMonth";
        }
        List<Map<String, Object>> noReyList = jdbcTemplate.queryForList(sql);
@ -3044,8 +3080,10 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorFollowupLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String startDateStr = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        List<Map<String, Object>> totalList = new ArrayList<>();
        List<Map<String, Object>> planList = new ArrayList<>();
        String totalSQL;
        String planSQL;
        if ("0".equals(type)) {
@ -3057,7 +3095,7 @@ public class StatisticsService extends BaseService {
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time >= '" + startDateStr + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " GROUP BY dateNo";
@ -3068,40 +3106,41 @@ public class StatisticsService extends BaseService {
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time >= '" + startDateStr + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " AND w.status ='2'" +
                    " GROUP BY dateNo";
            totalList = jdbcTemplate.queryForList(totalSQL);
             planList = jdbcTemplate.queryForList(planSQL);
        } else {
            //按月
            totalSQL = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "', '%v') + 1 " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS followupCount " +
                    " FROM " +
                    " wlyy_followup w " +
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " GROUP BY weekOfMonth";
                    " AND w.create_time >= '?1' " +
                    " AND w.create_time <= '?2' ";
            planSQL = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + DateUtil.getFristDayOfMonth() + "', '%v') + 1 " +
                    "  DATE_FORMAT(w.create_time, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS planCount " +
                    " FROM " +
                    " wlyy_followup w " +
                    " WHERE " +
                    " w.admin_team_code =" + teamCode +
                    " AND w.doctor_code ='" + doctor + "'" +
                    " AND w.create_time >= '" + startDate + "' " +
                    " AND w.create_time <= '" + endDate + "' " +
                    " AND w.status ='2'" +
                    " GROUP BY weekOfMonth";
                    " AND w.create_time >= '?1' " +
                    " AND w.create_time <= '?2' " +
                    " AND w.status ='2'" ;
            totalList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,totalSQL);
            planList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,planSQL);
        }
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSQL);
        List<Map<String, Object>> planList = jdbcTemplate.queryForList(planSQL);
        JSONObject rs = new JSONObject();
        rs.put("totalLine", totalList);
        rs.put("planLine", planList);
@ -3170,22 +3209,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getDoctorTeamFolList(String startDate, String endDate, String teamCode, String sort, String sortType) {
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSQL = "SELECT " +
                " IFNULL(c.followupCount,0) AS followupCount, " +
                " d.`code` AS doctorCode, " +
@ -3391,8 +3417,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorFolTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql = "SELECT " +
                " COUNT(1) AS followupCount " +
                " FROM " +
@ -3478,9 +3505,10 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorResLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String startDateStr = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql;
        List<Map<String, Object>> resultList = new ArrayList<>();
        if ("0".equals(type)) {
            //查周
            totalSql = "SELECT " +
@ -3491,45 +3519,32 @@ public class StatisticsService extends BaseService {
                    " w.admin_team_code = " + teamCode +
                    " AND w.doctor = '" + doctor + "'" +
                    " AND w.czrq <= '" + endDate + "' " +
                    " AND w.czrq >= '" + startDate + "' " +
                    " AND w.czrq >= '" + startDateStr + "' " +
                    " GROUP BY dateNo";
            resultList = jdbcTemplate.queryForList(totalSql);
        } else {
            //查月
            //查月份
            totalSql = "SELECT " +
                    " ( " +
                    "  DATE_FORMAT(w.czrq, '%v') - DATE_FORMAT('" + startDate + "', '%v') + 1 " +
                    "  ( " +
                    "  DATE_FORMAT(w.czrq, '%v') - DATE_FORMAT('" + startDateStr + "', '%v') + 1 " +
                    " ) AS weekOfMonth,COUNT(1) AS reservationCount " +
                    " FROM " +
                    " wlyy_patient_reservation w " +
                    " WHERE " +
                    " w.admin_team_code = " + teamCode +
                    " AND w.doctor = '" + doctor + "'" +
                    " AND w.czrq <= '" + endDate + "' " +
                    " AND w.czrq >= '" + startDate + "' " +
                    " GROUP BY weekOfMonth";
                    " AND w.czrq >= '?1' "+
                    " AND w.czrq <= '?2' " ;
            resultList = getGZBGDataMonthLineForEs(startDate,endDate,startDateStr,totalSql);
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(totalSql);
        return new JSONArray(list);
        return new JSONArray(resultList);
    }
    public JSONArray getTeamDoctorResList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSql = "SELECT " +
                " IFNULL(c.reservationCount,0) AS reservationCount, " +
                " d.`code` AS doctorCode, " +
@ -3638,8 +3653,9 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorResTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        endDate = endDate + " 17:00:00";
        String totalSQL = "SELECT " +
                " COUNT(1) AS reservationCount " +
                " FROM " +
@ -3715,9 +3731,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorGuidLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        String SQL;
        if ("0".equals(type)) {
            //按周统计
@ -3753,6 +3783,13 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamGuidList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
@ -3762,13 +3799,7 @@ public class StatisticsService extends BaseService {
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.guidanceCount,0) AS guidanceCount, " +
                " d.`code` AS doctorCode, " +
@ -3877,8 +3908,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorGuiTitle(String teamCode, String doctor, String startDate, String endDate) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String totalSQL = "SELECT " +
                " COUNT(1) AS guidanceCount " +
                " FROM " +
@ -3951,8 +3997,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamDoctorEduLine(String teamCode, String startDate, String endDate, String type, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String sql;
        if ("0".equals(type)) {
@ -3986,6 +4047,13 @@ public class StatisticsService extends BaseService {
    }
    public JSONArray getTeamEduList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
@ -3995,13 +4063,7 @@ public class StatisticsService extends BaseService {
        }else{
            startDate = startDate + " 00:00:00";
        }
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " IFNULL(c.articleCount,0) AS articleCount, " +
                " IFNULL(c.batchno,0) AS batchno, " +
@ -4137,8 +4199,23 @@ public class StatisticsService extends BaseService {
    }
    public JSONObject getTeamDoctorEduTitle(String teamCode, String startDate, String endDate, String doctor) {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        //如果开始时间是当月的最后一天,则到当天的下午五点
        String endStr = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (endStr.equals(endDate)){
            endDate = endDate + " 17:00:00";
        }else{
            endDate = endDate + " 23:59:59";
        }
        //如果是本月第一天则开始时间为上个月最后一天的下午五点
        Calendar cal = Calendar.getInstance();
        cal.setTime(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        boolean flag = DateUtil.checkFristDayOfDateMonth(cal);
        if (flag){
            startDate = DateUtil.getNextDay(startDate,-1)+" 17:00:00";
        }else{
            startDate = startDate + " 00:00:00";
        }
        String totalSql = "SELECT " +
                " COUNT(1) AS articleCount, " +
                " COUNT(DISTINCT w.batch_no) batchno " +
@ -4157,8 +4234,7 @@ public class StatisticsService extends BaseService {
                " w.admin_team_code =" + teamCode +
                " AND w.doctor ='" + doctor + "'" +
                " AND w.czrq <= '" + endDate + "' " +
                " AND w.czrq >= '" + startDate + "'"+
                " GROUP BY w.batch_no";
                " AND w.czrq >= '" + startDate + "'";
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> addList = jdbcTemplate.queryForList(addSql);
        JSONObject rs = new JSONObject();
@ -5176,11 +5252,7 @@ public class StatisticsService extends BaseService {
        if (interval==1){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,10) date  FROM wlyy_prescription p ";
            rs = DateUtil.findDates(startDate,endDate);
            //加入当天数据
            Map<String,Object> dateMap = new HashedMap();
            dateMap.put("date",sdf.format(endDate));
            dateMap.put("count", 0.0D);
            rs.add(dateMap);
            startTime = DateUtil.dateToStr(startDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }
@ -6883,5 +6955,50 @@ public class StatisticsService extends BaseService {
        List<Map<String, Object>> totalList = jdbcTemplate.queryForList(totalSql);
        return totalList;
    }
    /**
     * 工作报告医生个人详情折线图--按照月份的公用方法(为了解决与es的数据冲突).
     * @param startDate
     * @param endDate
     * @param startDateStr
     * @param sql
     * @return
     */
    public List<Map<String,Object>> getGZBGDataMonthLineForEs(String startDate,String endDate,String startDateStr,String sql){
        List<Map<String, Object>> resultList  = new ArrayList<>();
        List<Map<String,Object>> dateList = DateUtil.findDateASWeeks(DateUtil.strToDate(startDate),DateUtil.strToDate(endDate));
        String firstWeekMonday = DateUtil.getMondayOfThisDate(DateUtil.strToDate(startDate,"yyyy-MM-dd"));
        if (DateUtil.strToDate(firstWeekMonday).before(DateUtil.strToDate(startDate))){
            Map<String,Object> map = new HashedMap();
            map.put("date",firstWeekMonday);
            dateList.add(0,map);
        }
        //以每天的17:00:00为时间的边界设置每周的起始时间和结束时间查询数据库
        if (dateList!=null && dateList.size()>0) {
            for (Map<String, Object> map : dateList) {
                String resultSql = sql;
                String mondayDate = String.valueOf(map.get("date"));
                String sundayDate = DateUtil.getSundayOfThisDate(DateUtil.strToDate(mondayDate));
                if (DateUtil.strToDate(mondayDate).before(DateUtil.strToDate(startDate))) {
                    mondayDate = startDateStr;
                } else {
                    mondayDate = DateUtil.getNextDay(mondayDate, -1) + " 17:00:00";
                }
                sundayDate += " 17:00:00";
                resultSql = resultSql.replace("?1",mondayDate);
                resultSql = resultSql.replace("?2",sundayDate);
                List<Map<String, Object>> list = jdbcTemplate.queryForList(resultSql);
                //放入结果集
                if (list!=null && list.size()>0){
                    for(Map<String,Object> reMap : list){
                        if (reMap.get("weekOfMonth")!=null){
                            resultList.add(reMap);
                        }
                    }
                }
            }
        }
        return resultList;
    }
}

+ 14 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1315,7 +1315,12 @@ public class StatisticsESService {
        }
        if (resultList != null) {
            String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            String signTaskNum = "";
            if ("3".equals(lowCode)){
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17_65", year);//2017年65岁以上的目标量
            }else{
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            }
            String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
            DecimalFormat df = new DecimalFormat("0.0000");
            for (Map<String, Object> map : resultList) {
@ -2372,7 +2377,6 @@ public class StatisticsESService {
    public JSONArray getTeamEduLine(String teamCode, String startDate, String endDate, String type)throws Exception {
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 00:00:00";
        List<Map<String,Object>> dateList = DateUtil.findDates(dateFormat.parse(startDate),dateFormat.parse(endDate));
        Integer interval = Integer.parseInt(type) + 1;
        List<SaveModel> articleCountList = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate,endDate,teamCode,Integer.valueOf(SaveModel.teamLevel),"59",SaveModel.timeLevel_ZL,String.valueOf(interval));
@ -2394,7 +2398,12 @@ public class StatisticsESService {
            });
        }
        //获取结果集
        List<Map<String, Object>> resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
        List<Map<String, Object>> resultList = null;
        if ("0".equals(type)){
            resultList = DateUtil.findDates(dateFormat.parse(startDate),dateFormat.parse(endDate));
        }else{
            resultList = DateUtil.findDateASWeeks(dateFormat.parse(startDate),dateFormat.parse(endDate));
        }
        String MondayWeekDateStr = DateUtil.getMondayOfThisDate(dateFormat.parse(startDate));
        Date MondayWeekDate = DateUtil.strToDate(MondayWeekDateStr,"yyyy-MM-dd");
        if (dateFormat.parse(startDate).after(MondayWeekDate)){
@ -2408,7 +2417,7 @@ public class StatisticsESService {
            for (Map<String, Object> reMap : resultList) {
                //设置时间
                if ("0".equals(type)) {
                    reMap.put("dateNo",dateFormat.format(reMap.get("date")));
                    reMap.put("dateNo",reMap.get("date"));
                } else {
                    if (dateFormat.parse(String.valueOf(reMap.get("date"))).before(dateFormat.parse(startDate))){
                        reMap.put("weekOfMonth", 1);
@ -3077,7 +3086,7 @@ public class StatisticsESService {
                if ("0".equals(type)) {
                    map.put("dateNo", dateFormat.format(one.getQuotaDate()));
                } else {
                    map.put("weekOfMonth", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                    map.put("weekNo", DateUtil.getWeekOfMonth(dateFormat.format(one.getQuotaDate())));
                }
                map.put("avgCount", avgCountStr);
                rs.add(map);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -293,7 +293,7 @@ public class DoctorSignController extends WeixinBaseController {
                    if (status == 3) {
                        boolean epTime = false;
                        try {
                            epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", temp.get("patient"));
                            epTime = redisTemplate.hasKey("wechat:focus:remind:flag:"+temp.get("patient"));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -901,7 +901,7 @@ public class EsStatisticsController extends BaseController {
                                   @RequestParam(required = true) String isNow) {
        try {
            return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow(getUID(), startDate, endDate, isNow));
            //return write(200, "查询成功", "data", statisticsESService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
            //return write(200, "查询成功", "data", statisticsService.getReyStatbyTeamNow("xh1D2017031502222",startDate,endDate,isNow));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
@ -1363,7 +1363,7 @@ public class EsStatisticsController extends BaseController {
    }
    /**
     * 获取团队健康
     * 获取团队健康.
     *
     * @param teamCode
     * @param startDate

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdTemplateController.java

@ -29,6 +29,8 @@ public class ThirdTemplateController extends BaseController {
    private PushMsgTask pushMsgTask;
    @Value("${wechat.message.template_doctor_survey}")
    private String template_doctor_survey;
    @Value("${wechat.message.template_deal_with}")
    private String template_deal_with;
    /**
     * 发送模板消息
@ -101,7 +103,7 @@ public class ThirdTemplateController extends BaseController {
                templateId = template_doctor_survey;
                break;
            case "2":
                templateId = "";
                templateId = template_deal_with;
                break;
            default:
                templateId = template_doctor_survey;

+ 3 - 1
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -66,6 +66,8 @@ wechat:
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
@ -129,4 +131,4 @@ activemq:
neiwang:
  enable: false
  #wlyy: http://59.61.92.90:8072/wlyy
  wlyy: http://192.168.131.131:8080/
  wlyy: http://192.168.131.131:8080/

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -66,6 +66,8 @@ wechat:
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     #体检报告提醒
     template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
     #处理结果通知
     template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/