Kaynağa Gözat

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

huangwenjie 6 yıl önce
ebeveyn
işleme
b8aa07d9f0

+ 38 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -1,6 +1,7 @@
package com.yihu.jw.entity.specialist.rehabilitation;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
@ -32,7 +33,8 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    private String doctor;//计划完成者标识
    @Column(name = "doctor_name")
    private String doctorName;//计划完成者标识
    @Column(name = "execute_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "execute_time", nullable = false, length = 0,updatable = false)
    private Date executeTime;//服务项目执行时间
    @Column(name = "status")
    private Integer status;//状态(0未完成,1已完成,2已预约)
@ -40,6 +42,12 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    private Integer expense;
    @Column(name = "service_qr_code")
    private String serviceQrCode;//服务码
    @Column(name = "frequency_code")
    private String frequencyCode;//频次
    @Column(name = "time_type")
    private Integer timeType;//时间类型
    @Column(name = "remark")
    private String remark;//备注
    @Column(name = "saas_id")
    public String getSaasId() {
@ -77,7 +85,8 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
        this.hospital = hospital;
    }
    @Column(name = "execute_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "execute_time", nullable = false, length = 0,updatable = false)
    public Date getExecuteTime() {
        return executeTime;
    }
@ -148,4 +157,31 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    public void setServiceQrCode(String serviceQrCode) {
        this.serviceQrCode = serviceQrCode;
    }
    @Column(name = "frequency_code")
    public String getFrequencyCode() {
        return frequencyCode;
    }
    public void setFrequencyCode(String frequencyCode) {
        this.frequencyCode = frequencyCode;
    }
    @Column(name = "time_type")
    public Integer getTimeType() {
        return timeType;
    }
    public void setTimeType(Integer timeType) {
        this.timeType = timeType;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 3 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -84,10 +84,13 @@ public class SpecialistMapping {
        public static final String findServiceItemsByHospital = "/findServiceItemsByHospital";
        public static final String serviceDoctorList = "/serviceDoctorList";
        public static final String dailyJob = "/dailyJob";
        public static final String tomorrowJob = "/tomorrowJob";
        public static final String dailyByJob ="/dailyByJob";
        public static final String dailyJobReserve = "/dailyJobReserve";
        public static final String appCalendarPlanDetailList = "/appCalendarPlanDetailList";
        public static final String updatePlanDetailStatusById = "/updatePlanDetailStatusById";
        public static final String updatePlanStatusById = "/updatePlanStatusById";
        public static final String updatePlanDetailExecuteTimeById = "/updatePlanDetailExecuteTimeById";
        public static final String planSchedule = "/planSchedule";
        public static final String planListByPatient = "/planListByPatient";
        public static final String patientCount = "/patientCount";

+ 51 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -6,6 +6,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.service.rehabilitation.RehabilitationManageService;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.Map;
/**
@ -288,6 +290,37 @@ public class RehabilitationManageController {
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.tomorrowJob)
    @ApiOperation(value = "明日康复服务通知")
    public ObjEnvelop tomorrowJob(@ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                               @RequestParam(value = "startTime", required = true)String startTime,
                               @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                               @RequestParam(value = "endTime", required = true)String endTime){
        try {
            return rehabilitationManageService.tomorrowJob(startTime,endTime);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.dailyByJob)
    @ApiOperation(value = "每日康复计划提醒")
    public ObjEnvelop dailyByJob(@ApiParam(name = "startTime", value = "开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                               @RequestParam(value = "startTime", required = true)String startTime,
                               @ApiParam(name = "endTime", value = "结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                               @RequestParam(value = "endTime", required = true)String endTime){
        try {
            return rehabilitationManageService.dailyByJob(startTime,endTime);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.updateNoteAndImageRehabilitationOperate)
    @ApiOperation(value = "康复计划完成时更新服务完成笔记和图片接口并且确认完成")
    public ObjEnvelop updateNoteAndImageRehabilitationOperate(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)@RequestParam(value = "planDetailId", required = true)String planDetailId,
@ -319,6 +352,24 @@ public class RehabilitationManageController {
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.updatePlanDetailExecuteTimeById)
    @ApiOperation(value = "康复管理-修改康复计划项目执行时间")
    public Envelop updatePlanDetailExecuteTimeById(@ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                              @RequestParam(value = "planDetailId", required = true)String planDetailId,
                                              @ApiParam(name = "executeTime", value = "状态", required = true)
                                              @RequestParam(value = "executeTime", required = true)String executeTime){
        try {
            Date date = DateUtil.strToDateLong(executeTime);
            return rehabilitationManageService.updatePlanDetailExecuteTimeById(date,planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = SpecialistMapping.rehabilitation.planSchedule)
    @ApiOperation(value = "康复管理-计划总进度")
    public ObjEnvelop planSchedule(@ApiParam(name = "planId", value = "计划id", required = true)

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

@ -71,4 +71,9 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    @Query
    List<RehabilitationDetailDO> findByPlanIdAndStatus(String planId,int status);
    @Modifying
    @Query("update RehabilitationDetailDO t set t.executeTime = ?1 where t.id=?2 ")
    int updateExecuteTime(Date executeTime,String id);
}

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

@ -1086,6 +1086,61 @@ public class RehabilitationManageService {
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,list);
    }
    /**
     * 明日康复计划提醒
     *
     * @param startTime
     * @param endTime
     * @return
     */
    public ObjEnvelop tomorrowJob(String startTime,String endTime){
        String sql = "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 p.status=1 and d.execute_time>='"+startTime+"' and d.execute_time<='"+endTime+"' GROUP BY d.doctor,p.patient";
//        List<Object> list = rehabilitationDetailDao.dailyJob(startTime,endTime);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        String doctorCode = "";
        String patientCode = "";
        List<String> listMap  = null;
        for(Map<String,Object> one:list){
            doctorCode = one.get("doctor")+"";
            patientCode = one.get("patient")+"";
            listMap = rehabilitationDetailDao.findByPatientAndDoctor(startTime,endTime,doctorCode,patientCode);
            String ids = "";
            for(String one2 : listMap){
                ids += ","+one2;
            }
            one.put("planDetailIds",StringUtils.isNotEmpty(ids)?ids.substring(1):"");
        }
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,list);
    }
    /**
     * 每日康复计划提醒
     *
     * @param startTime
     * @param endTime
     * @return
     */
    public ObjEnvelop dailyByJob(String startTime,String endTime){
        String sql = "select d.doctor,p.patient,h.service_item_name AS serviceItemName,d.time_type AS timeType from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id left join wlyy_hospital_service_item h ON h.id=d.hospital_service_item_id where d.status!=1 and p.status=1 and d.execute_time>='"+startTime+"' and d.execute_time<='"+endTime+"' GROUP BY d.doctor,p.patient";
//        List<Object> list = rehabilitationDetailDao.dailyJob(startTime,endTime);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
         String doctorCode = "";
        String patientCode = "";
        List<String> listMap  = null;
       for(Map<String,Object> one:list){
            doctorCode = one.get("doctor")+"";
            patientCode = one.get("patient")+"";
            listMap = rehabilitationDetailDao.findByPatientAndDoctor(startTime,endTime,doctorCode,patientCode);
            String ids = "";
            for(String one2 : listMap){
                ids += ","+one2;
            }
            one.put("planDetailIds",StringUtils.isNotEmpty(ids)?ids.substring(1):"");
        }
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,list);
    }
    /**
     * 更新康复计划项目操作日志并且确认完成更新status.
     * @param node
@ -1140,6 +1195,8 @@ public class RehabilitationManageService {
        return resultMap;
    }
    /**
     * 更新康复计划项目状态
     * @param status
@ -1154,6 +1211,16 @@ public class RehabilitationManageService {
        return Envelop.getError("更新失败!");
    }
    public Envelop updatePlanDetailExecuteTimeById(Date executeTime,String planDetailId) throws Exception{
        if(rehabilitationDetailDao.updateExecuteTime(executeTime,planDetailId)>0){
            return Envelop.getSuccess(SpecialistMapping.api_success);
        }
        return Envelop.getError("更新失败!");
    }
    /**
     * 计划总进度
     * @param planId