Explorar o código

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

yeshijie %!s(int64=7) %!d(string=hai) anos
pai
achega
31f2345c4b

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientHealthGuidanceDao.java

@ -55,6 +55,6 @@ public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<Pat
    @Query("SELECT count(a) from PatientHealthGuidance a WHERE  a.patient=?2 and a.doctor=?1 ")
    Integer findbydoctorAndPatient(String doctor, String patientCode);
    @Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
    @Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode,a.readStatus from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
    Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
}

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientReservationDao.java

@ -22,10 +22,11 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	PatientReservation findByCode(String code);
	List<PatientReservation> findByPatient(String patient, Pageable page);
	List<PatientReservation> findByPatientAndAdminTeamCode(String patient,Long teamCode,Pageable page);
//	List<PatientReservation> findByPatient(String patient, Pageable page);
//	List<PatientReservation> findByPatientAndAdminTeamCode(String patient,Long teamCode,Pageable page);
	Page<Object> findByPatient(String patient, Pageable page);
	Page<Object>  findByPatientAndAdminTeamCode(String patient,Long teamCode,Pageable page);
	List<PatientReservation> findByDoctor(String doctor,Pageable page);
	@Query("select count(1) from PatientReservation a where a.doctor = ?1 and a.patient=?2 ")

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -758,6 +758,7 @@ public class ConsultTeamService extends ConsultService {
            consult.put("patient", patient);
            consult.put("patientName", p.getName());
            consult.put("patientPhoto", p.getPhoto());
            consult.put("total", result.getTotalElements());
            array.put(consult);
        }

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -333,6 +333,7 @@ public class FollowUpService extends BaseService {
                followup.put("followupPlanDate", objArr[13] != null ? DateUtil.dateToStrLong((Date) objArr[13]) : "");
                followup.put("followupNextDate", objArr[14] != null ? DateUtil.dateToStrLong((Date) objArr[14]) : "");
                followup.put("prescriptionCode", objArr[17]);
                followup.put("total", result.getTotalElements());
                array.put(followup);
            }
        }

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java

@ -262,6 +262,8 @@ public class PatientHealthGuidanceService extends BaseService {
				json.put("content", temp[3]);
				json.put("createTime", DateUtil.dateToStrLong((Date) temp[4]));
				json.put("adminTeamCode", temp[7]);
				json.put("readStatus", temp[8]);
				json.put("total", result.getTotalElements());
				array.put(json);
			}
		}

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

@ -230,16 +230,19 @@ public class PatientReservationService extends BaseService {
     */
    @Transactional
    public JSONArray getReservationByPatient(String patient, Long teamCode, int page, int pagesize) throws Exception {
        List<PatientReservation> list = new ArrayList<>();
//        List<PatientReservation> list = new ArrayList<>();
        JSONArray array = new JSONArray();
        // 排序
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(page - 1, pagesize, sort);
        Page<Object> result = null;
        if (teamCode != null && teamCode > 0) {//传入医生查询医生帮此患者的预约记录
            list = patientReservationDao.findByPatientAndAdminTeamCode(patient, teamCode, pageRequest);
//            list = patientReservationDao.findByPatientAndAdminTeamCode(patient, teamCode, pageRequest);
            result = patientReservationDao.findByPatientAndAdminTeamCode(patient, teamCode, pageRequest);
        } else {
            list = patientReservationDao.findByPatient(patient, pageRequest);
//            list = patientReservationDao.findByPatient(patient, pageRequest);
            result = patientReservationDao.findByPatient(patient, pageRequest);
        }
        //更新当前状态
@ -262,10 +265,12 @@ public class PatientReservationService extends BaseService {
            patientReservationDao.save(list);
        }*/
//        List<PatientReservation> a = new ArrayList<PatientReservation>(result.getContent());
        List<Object> list = result.getContent();
        if (list != null) {
            Map<String, Doctor> doctors = new HashMap<>();
            for (PatientReservation item : list) {
            for (Object one : list) {
                PatientReservation item = (PatientReservation)one;
                JSONObject obj = new JSONObject(item);
                if (!StringUtils.isEmpty(item.getDoctor())) {
                    if (doctors.get(item.getDoctor()) != null) {
@ -279,7 +284,7 @@ public class PatientReservationService extends BaseService {
                        }
                    }
                }
                obj.put("total",result.getTotalElements());
                array.put(obj);
            }
        }

+ 9 - 41
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1251,44 +1251,6 @@ public class JMJkEduArticleService extends BaseService {
        }
    }
    /**
     * 查询给患者发送的健康教育文章
     *
     * @param patient
     * @param teamCode
     * @param page
     * @param pageSize
     * @return
     */
//    public List<Map<String, Object>> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
//        List<Object> params = new ArrayList<Object>();
//        String sql = "select " +
//                "    a.article" +
//                "    ,b.title" +
//                "    ,b.url" +
//                "    ,a.czrq" +
//                "    ,b.summary content" +
//                "    ,d.code" +
//                "    ,d.name" +
//                "    ,d.photo" +
//                "    ,a.admin_team_code" +
//                "    ,a.is_read" +
//                "    ,a.attached_content" +
//                "  from" +
//                "    wlyy_health_edu_article_patient a" +
//                "    ,wlyy_health_edu_article b" +
//                "    ,wlyy_doctor d" +
//                "  where" +
//                "    a.article = b.code " +
//                "    and a.doctor = d.code " +
//                "   and ( a.send_type =1 or a.send_type is null or a.send_type = '') "+  //添加类型判断是集美的推送还是三师原来的推送
//                "    and a.patient = ?" +
//                "    and a.admin_team_code = ?" +
//                "  order by a.czrq desc limit " + page*pageSize + "," + pageSize;
//
//        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql,new Object[]{patient,teamCode});
//        return result;
//    }
    public List<HealthEduArticleES> findByPatientAndTeam(String patient, long teamCode, int page, int pageSize) {
@ -1313,17 +1275,22 @@ public class JMJkEduArticleService extends BaseService {
    
    
        page = (page - 1) * pagesize;
    
        //查询记录sql
        String sql = "SELECT * FROM " + esType + "  where patientCode= '" + patientCode + "' and adminTeamCode = '"+teamCode+"' and doctorCode='" + uid + "' and userType = 1";
    
        //查询总数sql
        String countSql = "SELECT COUNT(*) AS count FROM " + esType + "  where patientCode= '" + patientCode + "' and adminTeamCode = '"+teamCode+"' and doctorCode='" + uid + "' and userType = 1";
        if(!StringUtils.isEmpty(level1Type)){
            sql= sql + " and firstLevelCategoryId = '"+level1Type+"' ";
            countSql= countSql + " and firstLevelCategoryId = '"+level1Type+"' ";
        }
        sql += " order by createTime desc ";
        if(pagesize !=0){
            sql= sql+  " limit " + page + "," + pagesize;
        }
    
        Long total = elasticsearchUtil.excuteForLong(countSql,esIndex, esType);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql, HealthEduArticleES.class, esIndex, esType);
        HealthEduArticlePatientModel heapm = null;
        JSONObject article = null;
@ -1356,6 +1323,7 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setLeaveWords(one.getLeaveWords());//医生留言
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
            heapm.setTotalData(total);
            result.add(heapm);
            // heapm.setTime();//时间  xx小时前  2017-10-11
        }

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/HealthEduArticlePatientModel.java

@ -62,6 +62,7 @@ public class HealthEduArticlePatientModel {
    private String photo;//医生头像
    private String operatorName;//文章作者
    private String czrq;//阅读时间
    private Long totalData;//查询数据总数
    public String getSendCode() {
        return sendCode;
@ -286,4 +287,12 @@ public class HealthEduArticlePatientModel {
    public void setCzrq(String czrq) {
        this.czrq = czrq;
    }
    public Long getTotalData() {
        return totalData;
    }
    public void setTotalData(Long totalData) {
        this.totalData = totalData;
    }
}