Browse Source

Merge branch 'dev' of liuwenbin/wlyy2.0 into dev

huangwenjie 6 years ago
parent
commit
608d0bbc47

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java

@ -20,13 +20,13 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntityWithOperat
    private String patientName;//居民名称
    private String doctorCode;//执行医生code
    private String doctorName;//执行医生名称
    private String node;//服务完成笔记
    private Integer relationRecordType;//关联记录类型(1、随访记录,2、健康指导,3、健康教育,4、服务码)
    private String relationRecordCode;//关联记录code
    private String relationRecordImg;//相关记录图片地址,json格式
    private Date reserveTime;//服务预定完成时间
    private Date completeTime;//服务完成时间
    private Integer status;//是否确认完成(0、未确认,1、已确认)
    private String node;//服务完成笔记
    @Column(name = "saas_id")
    public String getSaasId() {
@ -144,4 +144,5 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntityWithOperat
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java

@ -55,6 +55,6 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    RehabilitationDetailDO findById(String planDetailId);
    @Query(value ="select d.doctor,p.patient,count(1) from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.status!=1 and d.execute_time>=?1 and d.execute_time<=?2 GROUP BY d.doctor,p.patient",nativeQuery = true)
    @Query(value ="select d.doctor,p.patient,count(1) as num from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.status!=1 and d.execute_time>=?1 and d.execute_time<=?2 GROUP BY d.doctor,p.patient",nativeQuery = true)
    List<Map<String,Object>> dailyJob(String startTime,String endTime);
}

+ 19 - 5
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -18,6 +18,8 @@ import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
@ -105,7 +107,7 @@ public class RehabilitationManageService {
//        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(finalSql);
        int count = 0;
        if(rstotal!=null&&rstotal.size()>0){
        if(rstotal!=null&&rstotal.size()>0&&rstotal.get(0).get("id")!=null){
            count = rstotal.size();
        }
        finalSql += " ORDER BY b.create_time DESC LIMIT "+(page-1)*pageSize+","+pageSize;
@ -445,7 +447,11 @@ public class RehabilitationManageService {
                    }
                }
            }else{
                m.put("myTaskFlag",0);
                if(doctorCode.equals(one.get("doctor").toString())){
                    m.put("myTaskFlag",1);
                }else{
                    m.put("myTaskFlag",0);
                }
            }
            if(m.containsKey("planDetailIds")){
                m.put("planDetailIds",m.get("planDetailIds")+","+one.get("id"));
@ -497,7 +503,7 @@ public class RehabilitationManageService {
            planDetailList +=",'"+one+"'";
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
        String sql = "select i.title,i.content,i.type,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor," +
        String sql = "select i.title,i.content,i.type,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor," +
                " d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
@ -517,11 +523,13 @@ public class RehabilitationManageService {
            executeDoctorList.add(one.get("specialistDoctorName")+"");
            resultMap.put("executeDoctorList",executeDoctorList);
            resultMap.put("title",one.get("title"));//项目标题
            resultMap.put("planDetaiId",one.get("id"));//计划服务项目id
            resultMap.put("shortExecuteTime",DateUtil.dateToStr((Date) one.get("execute_time"),DateUtil.HH_MM));//项目标题
            resultMap.put("content",one.get("content"));//项目内容
            resultMap.put("hospitalName",one.get("hospital_name"));//地点
            resultMap.put("executeTime",one.get("execute_time"));//执行时间
            resultMap.put("expense",one.get("expense"));//收费
            resultMap.put("reserve",one.get("reserve"));//是否需要预约(1预约、0不预约)
            Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
            String statusName = "";
            switch (status){
@ -544,7 +552,7 @@ public class RehabilitationManageService {
            resultMap.put("messageList",messageMapList);//指导与汇报记录
            resultMap.put("patient",one.get("patient"));
            resultMap.put("type",one.get("type"));
            resultMap.put("status",status);//状态
            //是否完成任务
            List<RehabilitationOperateRecordsDO> operateList = rehabilitationOperateRecordsDao.findByRehabilitationDetailId(one.get("id").toString());
            Integer operate = 0;
@ -566,7 +574,7 @@ public class RehabilitationManageService {
     * @throws Exception
     */
    public ObjEnvelop serviceItem(String planDetailId) throws Exception{
        String sql = "select i.title,i.content,i.type as itemType,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor, " +
        String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor, " +
                " d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
@ -588,6 +596,7 @@ public class RehabilitationManageService {
        resultMap.put("hospitalName",one.get("hospital_name"));//地点
        resultMap.put("executeTime",one.get("execute_time"));//执行时间
        resultMap.put("expense",one.get("expense"));//收费
        resultMap.put("reserve",one.get("reserve"));//是否需要预约(1预约、0不预约)
        Integer status = Integer.valueOf(one.get("status").toString());//状态(0未完成,1已完成,2已预约)
        String statusName = "";
        switch (status){
@ -622,6 +631,8 @@ public class RehabilitationManageService {
            String completeTimeStr = DateUtil.dateToStr(completeTime,DateUtil.YYYY_MM_DD_HH_MM);
            resultMap.put("completeTime",completeTimeStr);//完成时间
            resultMap.put("operatorDoctorName",temp.getDoctorName());//执行医生名称
            resultMap.put("node",temp.getNode());
            resultMap.put("relationRecordImg",temp.getRelationRecordImg()!=null?(new JSONArray(temp.getRelationRecordImg())):null);
            if(itemType!=1&&itemType!=0){
                resultMap.put("relationRecordCode",temp.getRelationRecordCode());
                resultMap.put("completeTimeShort",DateUtil.dateToStr(completeTime,"yyyy/MM/dd"));
@ -943,6 +954,7 @@ public class RehabilitationManageService {
        Map<String,Object> generalDoctorMap =  new HashMap<>();
        generalDoctorMap.put("type","全科医生");
        generalDoctorMap.put("doctorName",generalDoctorName);
        generalDoctorMap.put("doctorCode",generalDoctor);
        Integer generalUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(generalDoctor,patientCode,1);
        Integer generalFinishCount = rehabilitationDetailDao.findItemByDoctor(generalDoctor,patientCode);
        Integer generalServiceCount = rehabilitationDetailDao.completeServiceByDoctor(generalDoctor,patientCode,1);
@ -953,6 +965,7 @@ public class RehabilitationManageService {
        Map<String,Object> healthDoctorMap =  new HashMap<>();
        healthDoctorMap.put("type","健管师");
        healthDoctorMap.put("doctorName",healthDoctorName);
        healthDoctorMap.put("doctorCode",healthDoctor);
        Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
        Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
        Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
@ -972,6 +985,7 @@ public class RehabilitationManageService {
            map.put("finishedItem",finishCount-unfinishCount);
            map.put("serviceCount",serviceCount);
            map.put("doctorName",doctorName);
            map.put("doctorCode",doctor);
            map.put("type","专科医生");
            serviceDoctorList.add(map);
        }